# CRotationf Class Reference

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

`#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
__forceinline | CRotationf ()
__forceinline | CRotationf (const CRotationf &in_rotation)
__forceinline | CRotationf (const CVector3f &in_EulerAngles, const RotationOrder in_RotOrder=siXYZ)
__forceinline | CRotationf (const float in_X, const float in_Y, const float in_Z, const RotationOrder in_RotOrder=siXYZ)
__forceinline | CRotationf (const CQuaternionf &in_Quat)
__forceinline | CRotationf (const CVector3f &in_Axis, const float in_Angle)
__forceinline | ~CRotationf ()
__forceinline CRotationf & | operator= (const CRotationf &in_rotation)
__forceinline CVector3f | GetXYZAngles (const RotationOrder in_Order) const
__forceinline void | GetXYZAngles (float &io_X, float &io_Y, float &io_Z) const
__forceinline CVector3f | GetXYZAngles () const
__forceinline RotationOrder | GetOrder () const
__forceinline void | SetOrder (const RotationOrder in_rotOrder)
__forceinline RotationRep | GetRepresentation () const
__forceinline void | SetRepresentation (const RotationRep in_rotRep, const RotationOrder in_order=siXYZ)
__forceinline CRotationf & | Set (const RotationOrder in_order, const bool in_bCompensate=false)
__forceinline CRotationf & | Set (const CVector3f &in_EulerAngles, const RotationOrder in_Order=siXYZ)
__forceinline CRotationf & | Set (const float in_X, const float in_Y, const float in_Z, const RotationOrder in_Order=siXYZ)
__forceinline CRotationf & | Set (const CQuaternionf &in_Quat)
__forceinline CRotationf & | Mul (const CRotationf &in_rot)
__forceinline CRotationf & | Mul (const CRotationf &in_rot1, const CRotationf &in_rot2)
__forceinline CRotationf & | Mul (const float in_scalar)
__forceinline CRotationf & | LeftMul (const CRotationf &in_rot)
__forceinline CRotationf & | Interpolate (const CRotationf &in_rot1, const CRotationf &in_rot2, const float in_u)
__forceinline CRotationf & | Div (const CRotationf &in_rot1, const float in_scalar)
__forceinline CRotationf & | Div (const float in_scalar)
__forceinline CRotationf & | Div (const CRotationf &in_rot)
__forceinline CRotationf & | Div (const CRotationf &in_rot1, const CRotationf &in_rot2)
__forceinline CRotationf & | Invert ()
__forceinline CRotationf & | Invert (const CRotationf &in_rot)
__forceinline CQuaternionf | GetQuaternion () const
__forceinline CRotationf & | operator= (const CQuaternionf &in_Quat)
__forceinline CVector3f | GetAxisAngle (float &io_Angle) const
__forceinline CRotationf & | Set (const CVector3f &in_Axis, const float in_Angle)
__forceinline void | SetIdentity ()
__forceinline bool | Equals (const CRotationf &in_rot) const
__forceinline bool | EpsilonEquals (const CRotationf &in_rot, const float in_fEpsilon) const
__forceinline bool | operator== (const CRotationf &in_rot) const
__forceinline bool | operator!= (const CRotationf &in_rot) const
__forceinline bool | operator< (const CRotationf &in_rot) const

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

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

__forceinline CRotationf | ( |  | ) |

Default constructor.

__forceinline CRotationf | ( | const CRotationf & | in_rotation | ) |

Copy constructor.

Parameters:

  | in_rotation | Rotation to copy

__forceinline 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

__forceinline 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

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

Constructor (from a quaternion).

Parameters:

  | in_Quat | Quaternion to construct from

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

__forceinline 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

__forceinline ~CRotationf | ( |  | ) |

Default destructor.

## Member Function Documentation

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

Assignment operator.

Parameters:

  | in_rotation | Rotation to copy

Returns:
  A reference to this rotation.

__forceinline 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

__forceinline 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

__forceinline CVector3f GetXYZAngles | ( |  | ) | const

Returns the Euler angles's representation of the rotation.

Returns:
  Euler vector

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

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

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

Returns:
  CRotationf::RotationOrder

__forceinline 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

__forceinline 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

__forceinline 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

__forceinline 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

__forceinline 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

__forceinline 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

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

Multiplies this rotation with another one in place.

Parameters:

  | in_rot | Rotation to multiply

Returns:
  This rotation

__forceinline 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

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

Multiply in-place this rotation with a scalar.

Parameters:

  | in_scalar | scalar multiplier.

Returns:
  This rotation

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

Left multiply in-place this rotation with a rotation.

Parameters:

  | in_rot | Rotation operand

Returns:
  This rotation

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

__forceinline 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

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

Divides in-place this rotation with a scalar.

Parameters:

  | in_scalar | scalar multiplier.

Returns:
  This rotation

__forceinline 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

__forceinline 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

__forceinline CRotationf & Invert | ( |  | ) |

Inverts the rotation in place.

Returns:
  This rotation

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

Stores the invert of a rotation.

Parameters:

  | in_rot | Rotation to invert

Returns:
  This rotation

__forceinline CQuaternionf GetQuaternion | ( |  | ) | const

Returns the quaternion representation of the rotation.

Returns:
  CQuaternionf

See also:
  CRotationf::Set

__forceinline 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

__forceinline 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

__forceinline 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

__forceinline void SetIdentity | ( |  | ) |

Sets the rotation to identity rotation.

__forceinline 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

__forceinline 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

__forceinline 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

__forceinline 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

__forceinline 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