Creates a new Euler. Accepts any arguments that RS.Euler#set accepts.
Name | Type | Description |
---|---|---|
initial |
RS.Euler | RS.Quaternion | RS.Math.Matrix4x4 | Array | Object | Number |
optional
initial value. |
order |
String |
optional
order to apply rotations in |
Members
-
The default euler order.
-
Array of supported euler orders.
-
The rotation order of the euler.
-
The x component of the euler in radians.
-
The y component of the euler in radians.
-
The z component of the euler in radians.
Methods
-
clone ()RS.Euler
-
Returns a copy of this euler.
Returns:
Type Description RS.Euler -
Returns whether this euler is equal to another euler within an optional tolerance.
Name Type Description rhs
RS.Euler the euler to compare to.
tolerance
Number optional if provided then this level of tolerance is used, otherwise uses an exact match.
Returns:
Type Description Boolean true
if equal,false
if not. -
Returns whether this euler is equal to another euler within a tolerance.
Name Type Description rhs
RS.Euler the euler to compare to.
tolerance
Number optional if provided then this level of tolerance is used, otherwise tolerance is
10e-5
.Returns:
Type Description Boolean true
if equal,false
if not. -
Change the ordering of this euler to
new_order
.Name Type Description new_order
String the new order.
Returns:
Type Description Euler this
-
Sets this euler. The source may be of the following types:
- RS.Euler
- RS.Quaternion
RS.Math.Matrix4x4
- an
Array
with 4 or more members - an
Object
. - 3 individual arguments for
x
,y
andz
In the case of an object being supplied it should have the members
x
,y
,z
. Parsing failures onx
,y
orz
will set them to0
.If the source is
RS.Math.Matrix4x4
then it is expected to have no scaling factors. The matrix is expected to be a forward transformation, IE: an object to world space matrix.Rotation values are in radians.
If the source is not RS.Euler then the final parameter can be a string specifying the order that should be used.
Name Type Description source
RS.Euler | RS.Quaternion | RS.Math.Matrix4x4 | Array | Object | Number the object to set from or a set of numbers. When a number represents a rotation it is in radians.
order
String optional the order in which to apply the extracted rotations, overrides the current value if given.
Returns:
Type Description Euler this
Example
const v = new RS.Euler(); v.set(0,Math.PI/2,0,'XYZ'); v.set([0,Math.PI/2,Math.PI/2]); v.set({x: 0, y: Math.PI, z: 0});
-
Returns a matrix representing this euler rotation. This will be a forward transformation, IE: an object to world space matrix. The matrix can be passed to
RS.Math.Vector3.rotate
to rotate a vector by this Euler.Returns:
Type Description RS.Math.Matrix4x4 the matrix. -
to_quaternion ()RS.Quaternion
-
Returns a quaternion representing this euler rotation.
Returns:
Type Description RS.Quaternion the quaterion.