|
@@ -10,10 +10,11 @@
|
|
|
<body>
|
|
|
<h1>[name]</h1>
|
|
|
|
|
|
- <div class="desc">Euler Angles. <br/><br/>
|
|
|
+ <div class="desc">A class representing [link:http://en.wikipedia.org/wiki/Euler_angles Euler Angles].<br /><br />
|
|
|
|
|
|
- Euler angles describe a rotation transformation by rotating an object on its various axes in specified amounts per axis, and a specified axis order.
|
|
|
- (More information on <a href='http://en.wikipedia.org/wiki/Euler_angles' target='blank'>Wikipedia</a>)</div>
|
|
|
+ Euler angles describe a rotational transformation by rotating an object on its various
|
|
|
+ axes in specified amounts per axis, and a specified axis order.
|
|
|
+ </div>
|
|
|
|
|
|
<h2>Example</h2>
|
|
|
|
|
@@ -28,114 +29,149 @@
|
|
|
|
|
|
<h3>[name]( [page:Float x], [page:Float y], [page:Float z], [page:String order] )</h3>
|
|
|
<div>
|
|
|
- x -- [page:Float] the angle of the x axis in radians<br />
|
|
|
- y -- [page:Float] the angle of the y axis in radians<br />
|
|
|
- z -- [page:Float] the angle of the z axis in radians<br />
|
|
|
- order -- [page:String] A string representing the order that the rotations are applied, defaults to 'XYZ' (must be upper case).
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- A euler angle for transforming
|
|
|
+ [page:Float x] - (optional) the angle of the x axis in radians. Default is *0*.<br />
|
|
|
+ [page:Float y] - (optional) the angle of the y axis in radians. Default is *0*.<br />
|
|
|
+ [page:Float z] - (optional) the angle of the z axis in radians. Default is *0*.<br />
|
|
|
+ [page:String order] - (optional) a string representing the order that the rotations are applied,
|
|
|
+ defaults to 'XYZ' (must be upper case).<br /><br />
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<h2>Properties</h2>
|
|
|
|
|
|
- <h3>[property:Float x]</h3>
|
|
|
-
|
|
|
- <h3>[property:Float y]</h3>
|
|
|
+ <h3>[property:Boolean isEuler]</h3>
|
|
|
+ <div>
|
|
|
+ Used to check whether this or derived classes are Eulers. Default is *true*.<br /><br />
|
|
|
|
|
|
- <h3>[property:Float z]</h3>
|
|
|
+ You should not change this, as it used internally for optimisation.
|
|
|
+ </div>
|
|
|
|
|
|
<h3>[property:String order]</h3>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <h2>Methods</h2>
|
|
|
-
|
|
|
- <h3>[method:Euler set]( [page:Float x], [page:Float y], [page:Float z], [page:String order] ) [page:Euler this]</h3>
|
|
|
- <div>
|
|
|
- x -- [page:Float] Angle in x axis in radians<br />
|
|
|
- y -- [page:Float] Angle in y axis in radians<br />
|
|
|
- z -- [page:Float] Angle in z axis in radians<br />
|
|
|
- order -- [page:string] Order of axes, defaults to 'XYZ' (must be upper case)
|
|
|
- </div>
|
|
|
<div>
|
|
|
- Sets the angles of this euler transform.
|
|
|
- </div>
|
|
|
+ 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'. Note that these must be in upper case.<br /><br />
|
|
|
|
|
|
- <h3>[method:Euler copy]( [page:Euler euler] ) [page:Euler this]</h3>
|
|
|
- <div>
|
|
|
- Copies value of *euler* to this euler.
|
|
|
+ If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Euler setFromRotationMatrix]( [page:Matrix4 m], [page:String order] ) [page:Euler this]</h3>
|
|
|
- <div>
|
|
|
- m -- [page:Matrix4] assumes upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled)<br />
|
|
|
- order -- [page:string] Order of axes, defaults to 'XYZ' (must be upper case)
|
|
|
- </div>
|
|
|
+ <h3>[property:Float x]</h3>
|
|
|
<div>
|
|
|
- Sets the angles of this euler transform from a pure rotation matrix based on the orientation specified by order.
|
|
|
- </div>
|
|
|
+ The current value of the x component.<br /><br />
|
|
|
|
|
|
- <h3>[method:Euler setFromQuaternion]( [page:Quaternion q], [page:String order] ) [page:Euler this]</h3>
|
|
|
- <div>
|
|
|
- q -- [page:Quaternion] quaternion must be normalized<br />
|
|
|
- order -- [page:string] Order of axes, defaults to 'XYZ' (must be upper case)
|
|
|
+ If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
|
|
|
</div>
|
|
|
+
|
|
|
+ <h3>[property:Float y]</h3>
|
|
|
<div>
|
|
|
- Sets the angles of this euler transform from a normalized quaternion based on the orientation specified by order.
|
|
|
+ The current value of the y component.<br /><br />
|
|
|
+
|
|
|
+ If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Euler reorder]( [page:String newOrder] ) [page:Euler this]</h3>
|
|
|
+ <h3>[property:Float z]</h3>
|
|
|
<div>
|
|
|
- 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. <br />
|
|
|
- WARNING: this discards revolution information.
|
|
|
+ The current value of the z component.<br /><br />
|
|
|
+
|
|
|
+ If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Euler setFromVector3]( [page:Vector3 vector], [page:String order] ) [page:Euler this]</h3>
|
|
|
+ <h2>Methods</h2>
|
|
|
+
|
|
|
+ <h3>[method:Euler copy]( [page:Euler euler] )</h3>
|
|
|
+ <div>Copies value of [page:Euler euler] to this euler.</div>
|
|
|
+
|
|
|
+ <h3>[method:Euler clone]()</h3>
|
|
|
+ <div>Returns a new Euler with the same parameters as this one.</div>
|
|
|
+
|
|
|
+ <h3>[method:Boolean equals]( [page:Euler euler] )</h3>
|
|
|
+ <div>Checks for strict equality of this euler and [page:Euler euler].</div>
|
|
|
+
|
|
|
+ <h3>[method:Euler fromArray]( [page:Array array] )</h3>
|
|
|
<div>
|
|
|
- vector -- [page:Vector3].
|
|
|
- order -- [page:string] Order of axes, defaults to 'XYZ' (must be upper case)
|
|
|
+ [page:Array array] of length 3 or 4. The optional 4th argument corresponds to the [page:.order order].<br /><br />
|
|
|
+
|
|
|
+ Assigns this euler's [page:.x x] angle to array[0]. <br />
|
|
|
+ Assigns this euler's [page:.y y] angle to array[1]. <br />
|
|
|
+ Assigns this euler's [page:.z z] angle to array[2]. <br />
|
|
|
+ Optionally assigns this euler's [page:.order order] to array[3].
|
|
|
</div>
|
|
|
+
|
|
|
+ <h3>[method:Euler onChange]( [page:Function onChangeCallback] )</h3>
|
|
|
<div>
|
|
|
- Optionally Vector3 to the XYZ parameters of Euler, and order to the Euler's order property.
|
|
|
+ [page:Function onChangeCallback] - set the value of the onChangeCallback() function.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Vector3 toVector3]()</h3>
|
|
|
+ <h3>[method:Euler onChangeCallback]( )</h3>
|
|
|
<div>
|
|
|
- Returns the Euler's XYZ properties as a Vector3.
|
|
|
+ By default this is an empty function, however it can be set via [page:.onChange onChange]().<br />
|
|
|
+ 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).
|
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Euler fromArray]( [page:Array array] ) [page:Euler this]</h3>
|
|
|
+ <h3>[method:Euler reorder]( [page:String newOrder] )</h3>
|
|
|
<div>
|
|
|
- array -- [page:Array] of length 3 or 4. array[3] is an optional order argument.
|
|
|
+ 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. <br /><br />
|
|
|
+
|
|
|
+ <em>WARNING</em>: this discards revolution information.
|
|
|
</div>
|
|
|
+
|
|
|
+ <h3>[method:Euler set]( [page:Float x], [page:Float y], [page:Float z], [page:String order] )</h3>
|
|
|
<div>
|
|
|
- Assigns this euler's x angle to array[0]. <br />
|
|
|
- Assigns this euler's y angle to array[1]. <br />
|
|
|
- Assigns this euler's z angle to array[2]. <br />
|
|
|
- Optionally assigns this euler's order to array[3].
|
|
|
+ [page:.x x] - the angle of the x axis in radians.<br />
|
|
|
+ [page:.y y] - the angle of the y axis in radians.<br />
|
|
|
+ [page:.z z] - the angle of the z axis in radians.<br />
|
|
|
+ [page:.order order] - (optional) a string representing the order that the rotations are applied.<br /><br />
|
|
|
+
|
|
|
+ Sets the angles of this euler transform and optionally the [page:.order order] and then call [page:.onChangeCallback onChangeCallback]().
|
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Array toArray]( [page:Array array] )</h3>
|
|
|
+ <h3>[method:Euler setFromRotationMatrix]( [page:Matrix4 m], [page:String order], [page:Boolean update] )</h3>
|
|
|
<div>
|
|
|
- array -- Optional array to store the euler.
|
|
|
+ [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).<br />
|
|
|
+ [page:.order order] - (optional) a string representing the order that the rotations are applied.<br />
|
|
|
+ [page:Boolean update] - (optional) whether to call [page:.onChangeCallback onChangeCallback]() after applying
|
|
|
+ the matrix.<br /><br />
|
|
|
+
|
|
|
+ Sets the angles of this euler transform from a pure rotation matrix based on the orientation
|
|
|
+ specified by order.
|
|
|
</div>
|
|
|
+
|
|
|
+ <h3>[method:Euler setFromQuaternion]( [page:Quaternion q], [page:String order], [page:Boolean update] )</h3>
|
|
|
<div>
|
|
|
- Returns an array [x, y, z, order]
|
|
|
+ [page:Quaternion q] - a normalized quaternion.<br />
|
|
|
+ [page:.order order] - (optional) a string representing the order that the rotations are applied.<br />
|
|
|
+ [page:Boolean update] - (optional) whether to call [page:.onChangeCallback onChangeCallback]() after applying
|
|
|
+ the matrix.<br /><br />
|
|
|
+
|
|
|
+ Sets the angles of this euler transform from a normalized quaternion based on the orientation
|
|
|
+ specified by [page:.order order].
|
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Boolean equals]( [page:Euler euler] )</h3>
|
|
|
+
|
|
|
+ <h3>[method:Euler setFromVector3]( [page:Vector3 vector], [page:String order] )</h3>
|
|
|
<div>
|
|
|
- Checks for strict equality of this euler and *euler*.
|
|
|
+ [page:Vector3 vector] - [page:Vector3].<br />
|
|
|
+ [page:.order order] - (optional) a string representing the order that the rotations are applied.<br /><br />
|
|
|
+
|
|
|
+ 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.
|
|
|
</div>
|
|
|
|
|
|
- <h3>[method:Euler clone]()</h3>
|
|
|
+
|
|
|
+ <h3>[method:Array toArray]( [page:Array array], [page:Integer offset] )</h3>
|
|
|
<div>
|
|
|
- Returns a new euler created from this euler.
|
|
|
- </div>
|
|
|
+ [page:Array array] - (optional) array to store the euler in.<br />
|
|
|
+ [page:Integer offset] (optional) offset in the array.<br />
|
|
|
|
|
|
+ Returns an array of the form [[page:.x x], [page:.y y], [page:.z z], [page:.order order ]].
|
|
|
+ </div>
|
|
|
|
|
|
+ <h3>[method:Vector3 toVector3]()</h3>
|
|
|
+ <div>Returns the Euler's [page:.x x], [page:.y y] and [page:.z z] properties as a [page:Vector3].</div>
|
|
|
|
|
|
|
|
|
<h2>Source</h2>
|