Public Types | Public Member Functions
CRotationf Class Reference

## Detailed Description

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.

Note:
  All angle values are expressed in radians.

See also:
  CQuaternionf

`#include <xsi_rotationf.h>`

List of all members.

## 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

## Member Enumeration Documentation

enum RotationOrder

Defines the rotation order of a rotation for the Euler angles representation.

Enumerator:

  siXYZ | X, Y, Z order
  siXZY | X, Z, Y order
  siYXZ | Y, X, Z order
  siYZX | Y, Z, X order
  siZXY | Z, X, Y order
  siZYX | Z, Y, X order

enum RotationRep

Defines the rotation representation.

Enumerator:

  siQuaternionRot | Quaternion representation
  siEulerRot | Euler representation
  siAxisAngleRot | Axis angle representation

## Constructor & Destructor Documentation

SICPPSDK_INLINE CRotationf | ( |  | ) |

Default constructor.

SICPPSDK_INLINE CRotationf | ( | const CRotationf & | in_rotation | ) |

Copy constructor.

Parameters:

  in_rotation | Rotation to copy

SICPPSDK_INLINE CRotationf | ( | const CVector3f & | in_EulerAngles,
|  | const RotationOrder | in_RotOrder = `siXYZ`
| ) |  |

Constructor (from CVector3f of Euler angles).

Parameters:

  in_EulerAngles | Euler angles to construct from
  in_RotOrder | Rotation order to use

See also:
  CRotationf::Set, CRotationf::SetOrder

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).

Parameters:

  in_X | X angle
  in_Y | Y angle
  in_Z | Z angle
  in_RotOrder | Rotation order to use

See also:
  CRotationf::Set, CRotationf::SetOrder

SICPPSDK_INLINE CRotationf | ( | const CQuaternionf & | in_Quat | ) |

Constructor (from a quaternion).

Parameters:

  in_Quat | Quaternion to construct from

See also:
  CRotationf::GetQuaternion, CRotationf::Set

SICPPSDK_INLINE CRotationf | ( | const CVector3f & | in_Axis,
|  | const float | in_Angle
| ) |  |

Constructor (using axis angle representation).

Parameters:

  in_Axis | Axis of rotation
  in_Angle | Rotation angle around the axis

See also:
  CRotationf::GetAxisAngle, CRotationf::Set

SICPPSDK_INLINE ~CRotationf | ( |  | ) |

Default destructor.

## Member Function Documentation

SICPPSDK_INLINE CRotationf & operator= | ( | const CRotationf & | in_rotation | ) |

Assignment operator.

Parameters:

  in_rotation | Rotation to copy

Returns:
  A reference to this rotation.

SICPPSDK_INLINE CVector3f GetXYZAngles | ( | const RotationOrder | in_Order | ) | const

Returns the euler angles of the rotation as a CVector3f from a rotation order.

Parameters:

  in_Order | Rotation order

Returns:
  CVector3f Rotation euler angle vector

See also:
  CRotationf::Set, CRotationf::GetOrder

SICPPSDK_INLINE void GetXYZAngles | ( | float & | io_X,
|  | float & | io_Y,
|  | float & | io_Z
| ) |  | const

Returns the Euler angles's representation of the rotation.

Parameters:

  io_X | X angle
  io_Y | Y angle
  io_Z | Z angle

See also:
  CRotationf::Set, CRotationf::GetOrder

SICPPSDK_INLINE CVector3f GetXYZAngles | ( |  | ) | const

Returns the Euler angles's representation of the rotation.

Returns:
  Euler vector

See also:
  CRotationf::Set, CRotationf::GetOrder

SICPPSDK_INLINE CRotationf::RotationOrder GetOrder | ( |  | ) | const

Returns the rotation order of this rotation for the Euler angles representation.

Returns:
  CRotationf::RotationOrder

SICPPSDK_INLINE void SetOrder | ( | const RotationOrder | in_rotOrder | ) |

Sets the rotation order for the Euler angles representation.

Parameters:

  in_rotOrder | New rotation order to use

See also:
  CRotationf::GetOrder

SICPPSDK_INLINE CRotationf::RotationRep GetRepresentation | ( |  | ) | const

Returns the rotation representation of this rotation.

Returns:
  CRotationf::RotationRep

void SetRepresentation | ( | const RotationRep | in_rotRep,
|  | const RotationOrder | in_order = `siXYZ`
| ) |  |

Sets the rotation representation for this rotation.

Parameters:

  in_rotRep | Rotation representation to set
  in_order | New rotation order to use

See also:
  CRotationf::GetOrder

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).

Parameters:

  in_order | Rotation order type.
  in_bCompensate | Compensation flag.

Returns:
  This rotation

See also:
  CRotationf::SetOrder

SICPPSDK_INLINE CRotationf & Set | ( | const CVector3f & | in_EulerAngles,
|  | const RotationOrder | in_Order = `siXYZ`
| ) |  |

Sets the current rotation from Euler angles.

Parameters:

  in_EulerAngles | Vector containing the rotation angles
  in_Order | Rotation order

Returns:
  This rotation

See also:
  CRotationf::GetXYZAngles, CRotationf::SetOrder

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.

Parameters:

  in_X | X angle
  in_Y | Y angle
  in_Z | Z angle
  in_Order | Requested rotation order

Returns:
  This rotation

See also:
  CRotationf::GetXYZAngles, CRotationf::SetOrder

SICPPSDK_INLINE CRotationf & Set | ( | const CQuaternionf & | in_Quat | ) |

Sets the rotation from a quaternion.

Parameters:

  in_Quat | Quaternion to set from

Returns:
  This rotation

See also:
  CRotationf::GetQuaternion

SICPPSDK_INLINE CRotationf & Mul | ( | const CRotationf & | in_rot | ) |

Multiplies this rotation with another one in place.

Parameters:

  in_rot | Rotation to multiply

Returns:
  This rotation

SICPPSDK_INLINE CRotationf & Mul | ( | const CRotationf & | in_rot1,
|  | const CRotationf & | in_rot2
| ) |  |

Stores the result of the multiplication of two rotations.

Parameters:

  in_rot1 | First rotation
  in_rot2 | Second rotation

Returns:
  This rotation

SICPPSDK_INLINE CRotationf & Mul | ( | const float | in_scalar | ) |

Multiply in-place this rotation with a scalar.

Parameters:

  in_scalar | scalar multiplier.

Returns:
  This rotation

SICPPSDK_INLINE CRotationf & LeftMul | ( | const CRotationf & | in_rot | ) |

Left multiply in-place this rotation with a rotation.

Parameters:

  in_rot | Rotation operand

Returns:
  This rotation

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.

Parameters:

  in_rot1 | Starting rotation.
  in_rot2 | Ending rotation.
  in_u | Interpolation factor between 0 (starting rotation) and 1 (ending rotation).

Returns:
  This rotation.

SICPPSDK_INLINE CRotationf& Div | ( | const CRotationf & | in_rot1,
|  | const float | in_scalar
| ) |  |

Divides in-place this rotation with the specified rotation and scalar.

Parameters:

  in_rot1 | Rotation divisor
  in_scalar | Scalar multiplier.

Returns:
  This rotation

SICPPSDK_INLINE CRotationf & Div | ( | const float | in_scalar | ) |

Divides in-place this rotation with a scalar.

Parameters:

  in_scalar | scalar multiplier.

Returns:
  This rotation

SICPPSDK_INLINE CRotationf & Div | ( | const CRotationf & | in_rot | ) |

Divides in-place by a rotation. Same as Mul by Invert.

Parameters:

  in_rot | Rotation operand.

Returns:
  This rotation

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.

Parameters:

  in_rot1 | First rotation operand.
  in_rot2 | Second rotation operand.

Returns:
  This rotation

SICPPSDK_INLINE CRotationf & Invert | ( |  | ) |

Inverts the rotation in place.

Returns:
  This rotation

SICPPSDK_INLINE CRotationf & Invert | ( | const CRotationf & | in_rot | ) |

Stores the invert of a rotation.

Parameters:

  in_rot | Rotation to invert

Returns:
  This rotation

SICPPSDK_INLINE CQuaternionf GetQuaternion | ( | void |  | ) | const

Returns the quaternion representation of the rotation.

Returns:
  CQuaternionf

See also:
  CRotationf::Set

SICPPSDK_INLINE CRotationf & operator= | ( | const CQuaternionf & | in_Quat | ) |

Sets the rotation from a quaternion.

Parameters:

  in_Quat | Quaternion to set from

Returns:
  This rotation

See also:
  CRotationf::Set

SICPPSDK_INLINE CVector3f GetAxisAngle | ( | float & | io_Angle | ) | const

Returns the axis angle representation of the rotation.

Parameters:

  io_Angle | Rotation angle around the axis

Returns:
  CVector3f Axis of rotation

See also:
  CRotationf::Set

SICPPSDK_INLINE CRotationf & Set | ( | const CVector3f & | in_Axis,
|  | const float | in_Angle
| ) |  |

Sets the rotation from an axis angle.

Parameters:

  in_Axis | Axis of rotation
  in_Angle | Rotation angle around the axis

Returns:
  This rotation

See also:
  CRotationf::GetAxisAngle

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.

Note:
  Each parameter of both quaternions must be exactly the same for a match.

Parameters:

  in_rot | Rotation to compare against

See also:
  CRotationf::EpsilonEquals

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.

Parameters:

  in_rot | Rotation to compare against.
  in_fEpsilon | Tolerance value

See also:
  CRotationf::EpsilonEquals

SICPPSDK_INLINE bool operator== | ( | const CRotationf & | in_rot | ) | const

Performs exact comparison of two quaternions.

Note:
  Each parameter of both quaternions must be exactly the same for a match.

Parameters:

  in_rot | Rotation to compare against

See also:
  CRotationf::EpsilonEquals, CRotationf::Equals

SICPPSDK_INLINE bool operator!= | ( | const CRotationf & | in_rot | ) | const

Inequality operator tests the strict inequality of this rotation with the rotation in_rotation.

Parameters:

  in_rot | Operand rotation.

Returns:
  true if equal else false.

See also:
  CRotationf::Equals

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.

Parameters:

  in_rot | CRotationf to compare.

Returns:
  true if this CRotationf is less than the specified CRotationf, false otherwise.

Since:
  7.5

The documentation for this class was generated from the following file:

- xsi_rotationf.h