Provides conversion facilities for various rotation representations including Euler angles, Quaternion, Axis angle and rotation matrix. CRotationf is typically used for implementing custom ICE nodes.
#include <xsi_rotationf.h>
Public Types |
|
enum |
RotationOrder { siXYZ = 0, siXZY = 1, siYXZ = 2, siYZX = 3, siZXY = 4, siZYX = 5 } |
enum |
RotationRep { siQuaternionRot = 0, siEulerRot, siAxisAngleRot } |
Public Member Functions |
|
SICPPSDK_INLINE | CRotationf () |
SICPPSDK_INLINE | CRotationf (const CRotationf &in_rotation) |
SICPPSDK_INLINE | CRotationf (const CVector3f &in_EulerAngles, const RotationOrder in_RotOrder=siXYZ) |
SICPPSDK_INLINE | CRotationf (const float in_X, const float in_Y, const float in_Z, const RotationOrder in_RotOrder=siXYZ) |
SICPPSDK_INLINE | CRotationf (const CQuaternionf &in_Quat) |
SICPPSDK_INLINE | CRotationf (const CVector3f &in_Axis, const float in_Angle) |
SICPPSDK_INLINE | ~CRotationf () |
SICPPSDK_INLINE CRotationf & | operator= (const CRotationf &in_rotation) |
SICPPSDK_INLINE CVector3f | GetXYZAngles (const RotationOrder in_Order) const |
SICPPSDK_INLINE void | GetXYZAngles (float &io_X, float &io_Y, float &io_Z) const |
SICPPSDK_INLINE CVector3f | GetXYZAngles () const |
SICPPSDK_INLINE RotationOrder | GetOrder () const |
SICPPSDK_INLINE void | SetOrder (const RotationOrder in_rotOrder) |
SICPPSDK_INLINE RotationRep | GetRepresentation () const |
SICPPSDK_INLINE void | SetRepresentation (const RotationRep in_rotRep, const RotationOrder in_order=siXYZ) |
SICPPSDK_INLINE CRotationf & | Set (const RotationOrder in_order, const bool in_bCompensate=false) |
SICPPSDK_INLINE CRotationf & | Set (const CVector3f &in_EulerAngles, const RotationOrder in_Order=siXYZ) |
SICPPSDK_INLINE CRotationf & | Set (const float in_X, const float in_Y, const float in_Z, const RotationOrder in_Order=siXYZ) |
SICPPSDK_INLINE CRotationf & | Set (const CQuaternionf &in_Quat) |
SICPPSDK_INLINE CRotationf & | Mul (const CRotationf &in_rot) |
SICPPSDK_INLINE CRotationf & | Mul (const CRotationf &in_rot1, const CRotationf &in_rot2) |
SICPPSDK_INLINE CRotationf & | Mul (const float in_scalar) |
SICPPSDK_INLINE CRotationf & | LeftMul (const CRotationf &in_rot) |
SICPPSDK_INLINE CRotationf & | Interpolate (const CRotationf &in_rot1, const CRotationf &in_rot2, const float in_u) |
SICPPSDK_INLINE CRotationf & | Div (const CRotationf &in_rot1, const float in_scalar) |
SICPPSDK_INLINE CRotationf & | Div (const float in_scalar) |
SICPPSDK_INLINE CRotationf & | Div (const CRotationf &in_rot) |
SICPPSDK_INLINE CRotationf & | Div (const CRotationf &in_rot1, const CRotationf &in_rot2) |
SICPPSDK_INLINE CRotationf & | Invert () |
SICPPSDK_INLINE CRotationf & | Invert (const CRotationf &in_rot) |
SICPPSDK_INLINE CQuaternionf | GetQuaternion () const |
SICPPSDK_INLINE CRotationf & | operator= (const CQuaternionf &in_Quat) |
SICPPSDK_INLINE CVector3f | GetAxisAngle (float &io_Angle) const |
SICPPSDK_INLINE CRotationf & | Set (const CVector3f &in_Axis, const float in_Angle) |
SICPPSDK_INLINE void | SetIdentity () |
SICPPSDK_INLINE bool | Equals (const CRotationf &in_rot) const |
SICPPSDK_INLINE bool | EpsilonEquals (const CRotationf &in_rot, const float in_fEpsilon) const |
SICPPSDK_INLINE bool | operator== (const CRotationf &in_rot) const |
SICPPSDK_INLINE bool | operator!= (const CRotationf &in_rot) const |
SICPPSDK_INLINE bool | operator< (const CRotationf &in_rot) const |
enum RotationOrder |
enum RotationRep |
SICPPSDK_INLINE CRotationf | ( | ) |
Default constructor.
SICPPSDK_INLINE CRotationf | ( | const CRotationf & | in_rotation | ) |
Copy constructor.
in_rotation | Rotation to copy |
SICPPSDK_INLINE CRotationf | ( | const CVector3f & | in_EulerAngles, |
const RotationOrder | in_RotOrder =
siXYZ |
||
) |
Constructor (from CVector3f of Euler angles).
in_EulerAngles | Euler angles to construct from |
in_RotOrder | Rotation order to use |
SICPPSDK_INLINE CRotationf | ( | const float | in_X, |
const float | in_Y, | ||
const float | in_Z, | ||
const RotationOrder | in_RotOrder =
siXYZ |
||
) |
Constructor (from XYZ Euler angles).
in_X | X angle |
in_Y | Y angle |
in_Z | Z angle |
in_RotOrder | Rotation order to use |
SICPPSDK_INLINE CRotationf | ( | const CQuaternionf & | in_Quat | ) |
Constructor (from a quaternion).
in_Quat | Quaternion to construct from |
SICPPSDK_INLINE CRotationf | ( | const CVector3f & | in_Axis, |
const float | in_Angle | ||
) |
Constructor (using axis angle representation).
in_Axis | Axis of rotation |
in_Angle | Rotation angle around the axis |
SICPPSDK_INLINE ~CRotationf | ( | ) |
Default destructor.
SICPPSDK_INLINE CRotationf & operator= | ( | const CRotationf & | in_rotation | ) |
Assignment operator.
in_rotation | Rotation to copy |
SICPPSDK_INLINE CVector3f GetXYZAngles | ( | const RotationOrder | in_Order | ) | const |
Returns the euler angles of the rotation as a CVector3f from a rotation order.
in_Order | Rotation order |
SICPPSDK_INLINE void GetXYZAngles | ( | float & | io_X, |
float & | io_Y, | ||
float & | io_Z | ||
) | const |
Returns the Euler angles's representation of the rotation.
io_X | X angle |
io_Y | Y angle |
io_Z | Z angle |
SICPPSDK_INLINE CVector3f GetXYZAngles | ( | ) | const |
Returns the Euler angles's representation of the rotation.
SICPPSDK_INLINE CRotationf::RotationOrder GetOrder | ( | ) | const |
Returns the rotation order of this rotation for the Euler angles representation.
SICPPSDK_INLINE void SetOrder | ( | const RotationOrder | in_rotOrder | ) |
Sets the rotation order for the Euler angles representation.
in_rotOrder | New rotation order to use |
SICPPSDK_INLINE CRotationf::RotationRep GetRepresentation | ( | ) | const |
Returns the rotation representation of this rotation.
void SetRepresentation | ( | const RotationRep | in_rotRep, |
const RotationOrder | in_order =
siXYZ |
||
) |
Sets the rotation representation for this rotation.
in_rotRep | Rotation representation to set |
in_order | New rotation order to use |
SICPPSDK_INLINE CRotationf & Set | ( | const RotationOrder | in_order, |
const bool | in_bCompensate =
false |
||
) |
Change the current rotation from a rotation order with the option of preserving the overall rotation matrix. If in_bCompensate is true then XYZ rotation angles will be recomputed based on the new rotation order to maintain the overall rotation (so the object's orientation will not change). If false (default), then the XYZ rotation angles are preserved but combined in a different order so the overall rotation will change (the object's orientation will change).
in_order | Rotation order type. |
in_bCompensate | Compensation flag. |
SICPPSDK_INLINE CRotationf & Set | ( | const CVector3f & | in_EulerAngles, |
const RotationOrder | in_Order =
siXYZ |
||
) |
Sets the current rotation from Euler angles.
in_EulerAngles | Vector containing the rotation angles |
in_Order | Rotation order |
SICPPSDK_INLINE CRotationf & Set | ( | const float | in_X, |
const float | in_Y, | ||
const float | in_Z, | ||
const RotationOrder | in_Order =
siXYZ |
||
) |
Sets the rotation from Euler angles.
in_X | X angle |
in_Y | Y angle |
in_Z | Z angle |
in_Order | Requested rotation order |
SICPPSDK_INLINE CRotationf & Set | ( | const CQuaternionf & | in_Quat | ) |
Sets the rotation from a quaternion.
in_Quat | Quaternion to set from |
SICPPSDK_INLINE CRotationf & Mul | ( | const CRotationf & | in_rot | ) |
Multiplies this rotation with another one in place.
in_rot | Rotation to multiply |
SICPPSDK_INLINE CRotationf & Mul | ( | const CRotationf & | in_rot1, |
const CRotationf & | in_rot2 | ||
) |
Stores the result of the multiplication of two rotations.
in_rot1 | First rotation |
in_rot2 | Second rotation |
SICPPSDK_INLINE CRotationf & Mul | ( | const float | in_scalar | ) |
Multiply in-place this rotation with a scalar.
in_scalar | scalar multiplier. |
SICPPSDK_INLINE CRotationf & LeftMul | ( | const CRotationf & | in_rot | ) |
Left multiply in-place this rotation with a rotation.
in_rot | Rotation operand |
SICPPSDK_INLINE CRotationf & Interpolate | ( | const CRotationf & | in_rot1, |
const CRotationf & | in_rot2, | ||
const float | in_u | ||
) |
Interpolate two rotations into this one for in_u between 0 and 1.
in_rot1 | Starting rotation. |
in_rot2 | Ending rotation. |
in_u | Interpolation factor between 0 (starting rotation) and 1 (ending rotation). |
SICPPSDK_INLINE CRotationf& Div | ( | const CRotationf & | in_rot1, |
const float | in_scalar | ||
) |
Divides in-place this rotation with the specified rotation and scalar.
in_rot1 | Rotation divisor |
in_scalar | Scalar multiplier. |
SICPPSDK_INLINE CRotationf & Div | ( | const float | in_scalar | ) |
Divides in-place this rotation with a scalar.
in_scalar | scalar multiplier. |
SICPPSDK_INLINE CRotationf & Div | ( | const CRotationf & | in_rot | ) |
Divides in-place by a rotation. Same as Mul by Invert.
in_rot | Rotation operand. |
SICPPSDK_INLINE CRotationf & Div | ( | const CRotationf & | in_rot1, |
const CRotationf & | in_rot2 | ||
) |
Divide in-place in_rot1 by in_rot2. Same as Mul by Invert.
in_rot1 | First rotation operand. |
in_rot2 | Second rotation operand. |
SICPPSDK_INLINE CRotationf & Invert | ( | ) |
Inverts the rotation in place.
SICPPSDK_INLINE CRotationf & Invert | ( | const CRotationf & | in_rot | ) |
Stores the invert of a rotation.
in_rot | Rotation to invert |
SICPPSDK_INLINE CQuaternionf GetQuaternion | ( | void | ) | const |
Returns the quaternion representation of the rotation.
SICPPSDK_INLINE CRotationf & operator= | ( | const CQuaternionf & | in_Quat | ) |
Sets the rotation from a quaternion.
in_Quat | Quaternion to set from |
SICPPSDK_INLINE CVector3f GetAxisAngle | ( | float & | io_Angle | ) | const |
Returns the axis angle representation of the rotation.
io_Angle | Rotation angle around the axis |
SICPPSDK_INLINE CRotationf & Set | ( | const CVector3f & | in_Axis, |
const float | in_Angle | ||
) |
Sets the rotation from an axis angle.
in_Axis | Axis of rotation |
in_Angle | Rotation angle around the axis |
SICPPSDK_INLINE void SetIdentity | ( | ) |
Sets the rotation to identity rotation.
SICPPSDK_INLINE bool Equals | ( | const CRotationf & | in_rot | ) | const |
Performs exact comparison of two quaternions.
in_rot | Rotation to compare against |
SICPPSDK_INLINE bool EpsilonEquals | ( | const CRotationf & | in_rot, |
const float | in_fEpsilon | ||
) | const |
Performs comparison between this rotation and
in_rot
within the specified epsilon value.
in_rot | Rotation to compare against. |
in_fEpsilon | Tolerance value |
SICPPSDK_INLINE bool operator== | ( | const CRotationf & | in_rot | ) | const |
Performs exact comparison of two quaternions.
in_rot | Rotation to compare against |
SICPPSDK_INLINE bool operator!= | ( | const CRotationf & | in_rot | ) | const |
Inequality operator tests the strict inequality of this rotation with the rotation in_rotation.
in_rot | Operand rotation. |
SICPPSDK_INLINE bool operator< | ( | const CRotationf & | in_rot | ) | const |
Less than operator. Performs a comparison with a specified CRotationf to determine if this CRotationf is less than the specified CRotationf. The comparison is arbitrary and not geometrically meaningful, it's only purpose is to make CRotationf compliant with stl for sorting operations.
in_rot | CRotationf to compare. |