[name]
A class representing [link:http://en.wikipedia.org/wiki/Euler_angles Euler Angles].
Euler angles describe a rotational transformation by rotating an object on its various
axes in specified amounts per axis, and a specified axis order.
Example
var a = new THREE.Euler( 0, 1, 1.57, 'XYZ' );
var b = new THREE.Vector3( 1, 0, 1 );
b.applyEuler(a);
Constructor
[name]( [page:Float x], [page:Float y], [page:Float z], [page:String order] )
[page:Float x] - (optional) the angle of the x axis in radians. Default is *0*.
[page:Float y] - (optional) the angle of the y axis in radians. Default is *0*.
[page:Float z] - (optional) the angle of the z axis in radians. Default is *0*.
[page:String order] - (optional) a string representing the order that the rotations are applied,
defaults to 'XYZ' (must be upper case).
Properties
[property:Boolean isEuler]
Used to check whether this or derived classes are Eulers. Default is *true*.
You should not change this, as it used internally for optimisation.
[property:String order]
The order in which to apply rotations. Default is 'XYZ', which means that the object will first be
rotated around its X axis, then its Y axis and finally its Z axis. Other possibilities are:
'YZX', 'ZXY', 'XZY', 'YXZ' and 'ZYX'. These must be in upper case.
Three.js uses intrinsic (Tait-Bryan) ordering, also known as yaw, pitch
and roll. This means that rotations are performed with respect to the local
coordinate system. That is, for order 'XYZ', the rotation is first around world-X, then around
local-Y (which may now be different from the world Y-axis), then local-Z (which may be different
from the world Z-axis).
Some implementations may use extrinsic (proper) ordering, in which case rotations are performed
with respect to the world coordinate system, so that for order 'XYZ', the rotations
are around world-X, world-Y, and world-Z.
Converting between the two types is relatively straightforward, you just need to reverse the order
and the rotation, so that an intrinsic (three.js) Euler rotation of angles a, b, c about XYZ
will be equivalent to to an extrinsic Euler rotation of angles c, b, a about ZYX.
If the order is changed, [page:.onChangeCallback onChangeCallback] will be called.
[property:Float x]
The current value of the x component.
If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
[property:Float y]
The current value of the y component.
If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
[property:Float z]
The current value of the z component.
If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
Methods
[method:Euler copy]( [page:Euler euler] )
Copies value of [page:Euler euler] to this euler.
[method:Euler clone]()
Returns a new Euler with the same parameters as this one.
[method:Boolean equals]( [page:Euler euler] )
Checks for strict equality of this euler and [page:Euler euler].
[method:Euler fromArray]( [page:Array array] )
[page:Array array] of length 3 or 4. The optional 4th argument corresponds to the [page:.order order].
Assigns this euler's [page:.x x] angle to array[0].
Assigns this euler's [page:.y y] angle to array[1].
Assigns this euler's [page:.z z] angle to array[2].
Optionally assigns this euler's [page:.order order] to array[3].
[method:Euler onChange]( [page:Function onChangeCallback] )
[page:Function onChangeCallback] - set the value of the onChangeCallback() function.
[method:Euler onChangeCallback]( )
By default this is an empty function, however it can be set via [page:.onChange onChange]().
It gets called after changing the [page:.x x], [page:.y y], [page:.z z] or [page:.order order] properties,
and also after calling most setter functions (see those for details).
[method:Euler reorder]( [page:String newOrder] )
Resets the euler angle with a new order by creating a quaternion from this euler angle
and then setting this euler angle with the quaternion and the new order.
WARNING: this discards revolution information.
[method:Euler set]( [page:Float x], [page:Float y], [page:Float z], [page:String order] )
[page:.x x] - the angle of the x axis in radians.
[page:.y y] - the angle of the y axis in radians.
[page:.z z] - the angle of the z axis in radians.
[page:.order order] - (optional) a string representing the order that the rotations are applied.
Sets the angles of this euler transform and optionally the [page:.order order] and then call [page:.onChangeCallback onChangeCallback]().
[method:Euler setFromRotationMatrix]( [page:Matrix4 m], [page:String order], [page:Boolean update] )
[page:Matrix4 m] - a [page:Matrix4] of which the upper 3x3 of matrix is a pure
[link:https://en.wikipedia.org/wiki/Rotation_matrix rotation matrix] (i.e. unscaled).
[page:.order order] - (optional) a string representing the order that the rotations are applied.
[page:Boolean update] - (optional) whether to call [page:.onChangeCallback onChangeCallback]() after applying
the matrix.
Sets the angles of this euler transform from a pure rotation matrix based on the orientation
specified by order.
[method:Euler setFromQuaternion]( [page:Quaternion q], [page:String order], [page:Boolean update] )
[page:Quaternion q] - a normalized quaternion.
[page:.order order] - (optional) a string representing the order that the rotations are applied.
[page:Boolean update] - (optional) whether to call [page:.onChangeCallback onChangeCallback]() after applying
the matrix.
Sets the angles of this euler transform from a normalized quaternion based on the orientation
specified by [page:.order order].
[method:Euler setFromVector3]( [page:Vector3 vector], [page:String order] )
[page:Vector3 vector] - [page:Vector3].
[page:.order order] - (optional) a string representing the order that the rotations are applied.
Set the [page:.x x], [page:.y y] and [page:.z z], and optionally update the [page:.order order]. [page:.onChangeCallback onChangeCallback]()
is called after these changes are made.
[method:Array toArray]( [page:Array array], [page:Integer offset] )
[page:Array array] - (optional) array to store the euler in.
[page:Integer offset] (optional) offset in the array.
Returns an array of the form [[page:.x x], [page:.y y], [page:.z z], [page:.order order ]].
[method:Vector3 toVector3]()
Returns the Euler's [page:.x x], [page:.y y] and [page:.z z] properties as a [page:Vector3].
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]