EulerAngles Values

The EulerAngles class provides a representation for orientation in 3D space using rotation angles in degrees about each axis. Angles can be greater than 360 and so specify multiple revolutions. Rotations follow the right-hand-rule.

Constructors

eulerAngles <x_degrees> <y_degrees> <z_degrees>

<quat> as eulerAngles

<angleAxis> as eulerAngles

<matrix3> as eulerAngles

Extracts the rotation component as an eulerAngles.

Operators

<eulerAngles> == <eulerAngles>

<eulerAngles> != <eulerAngles>

<eulerAngles> as <class>

eulerAngles can convert to Matrix3, Quat, angleAxis values

Properties

<eulerAngles>.x : Float

<eulerAngles>.y : Float

<eulerAngles>.z : Float

Rotation about each primary axis in float degrees

Methods

copy <eulerAngles>

Creates a new copy of the eulerAngles value. For example:

newEulerAngles = copy oldEulerAngles

The new value contains a copy of the input eulerAngles value, and is independent of the input eulerAngles value.

random <eulerAngles> <eulerAngles>

Random rotation between the eulerAngles, but uses quat Slerp, so loses multiple revolution angles.

quatToEuler <quat> order:<eulertype_integer>

eulerToQuat <eulerAngle> order:<eulertype_integer>

Convert between quat and euler angle values. The optional order parameter specifies the order of application of the angles. If not specified, XYZ ordering is used. Its value can be any of the following:

1 - XYZ

2 - XZY

3 - YZX

4 - YXZ

5 - ZXY

6 - ZYX

7 - XYX

8 - YZY

9 - ZXZ

getEulerQuatAngleRatio <quat1> <quat2> <eulerAngles1> <eulerAngles2> [angle:<eulertype_integer>]

When converting a series of quat values to eulerAngles values, it is possible for sign flips to occur in the eulerAngles values. This is due to the fact that one single quat value can be expressed through many different eulerAngles values. This flip can be detected by based on the eulerAngles/quat ratio. The eulerAngles/quat ratio is the relation of the angle difference in eulerAngles space to the angle difference in quat space. If this ratio is bigger than PI the rotation between the two quat to eulerAngles conversions. This method returns the eulerAngles/quat angle ratio between the two quat to eulerAngles conversions as a float value. The actual detection of the flip is dependent on the amount of rotation in between conversions. The smaller the amount of rotation, the more accurate the detection is. The parameters to this method are:

quat1 and quat2 are the previous and current rotation values.

eulerAngles1 and eulerAngles2 are the previous and current converted rotation angles.

The optional eulertype_integer specifies the order of application of the angles. If not specified, XYZ ordering is used. Its value can be any of the following:

1 - XYZ

2 - XZY

3 - YZX

4 - YXZ

5 - ZXY

6 - ZYX

7 - XYX

8 - YZY

9 - ZXZ

getEulerMatAngleRatio <matrix3_1> <matrix3_2> <eulerAngles1> <eulerAngles2> [angle:<eulertype_integer>]

This method parallels the getEulerQuatAngleRatio() method. This method is identical to getEulerQuatAngleRatio() with the exception that matrix3 values are passed rather than quat values.