struct
TQuaternion
template<typename T>Represents a quaternion used for 3D rotations.
Public
Constructors
TQuaternion<T>
TQuaternion<T>
TQuaternion<T>
TQuaternion<T>
TQuaternion<T>
TQuaternion<T>
Construct a quaternion from a rotation matrix.
TQuaternion<T>
Construct a quaternion from an angle/axis.
TQuaternion<T>
Construct a quaternion from 3 orthonormal local axes.
TQuaternion<T>
Construct a quaternion from euler angles, YXZ ordering.
TQuaternion<T>
Construct a quaternion from euler angles, custom ordering.
TQuaternion
TQuaternion
TQuaternion
TQuaternion
TQuaternion
TQuaternion
Construct a quaternion from a rotation matrix.
TQuaternion
Construct a quaternion from an angle/axis.
TQuaternion
Construct a quaternion from 3 orthonormal local axes.
TQuaternion
Construct a quaternion from euler angles, YXZ ordering.
TQuaternion
Construct a quaternion from euler angles, custom ordering.
TQuaternion
TQuaternion
TQuaternion
TQuaternion
TQuaternion
TQuaternion
Construct a quaternion from a rotation matrix.
TQuaternion
Construct a quaternion from an angle/axis.
TQuaternion
Construct a quaternion from 3 orthonormal local axes.
TQuaternion
Construct a quaternion from euler angles, YXZ ordering.
TQuaternion
Construct a quaternion from euler angles, custom ordering.
Methods
FromRotationMatrix
Initializes the quaternion from a 3x3 rotation matrix.
FromAxisAngle
Initializes the quaternion from an angle axis pair.
Quaternion will represent a rotation of "angle" radians around "axis".
FromAxes
Initializes the quaternion from orthonormal set of axes.
Quaternion will represent a rotation from base axes to the specified set of axes.
FromEulerAngles
Creates a quaternion from the provided Pitch/Yaw/Roll angles.
- xAngle
- Rotation about x axis. (AKA Pitch)
- yAngle
- Rotation about y axis. (AKA Yaw)
- zAngle
- Rotation about z axis. (AKA Roll)
FromEulerAngles
Creates a quaternion from the provided Pitch/Yaw/Roll angles.
- xAngle
- Rotation about x axis. (AKA Pitch)
- yAngle
- Rotation about y axis. (AKA Yaw)
- zAngle
- Rotation about z axis. (AKA Roll)
- order
- The order in which rotations will be extracted. Different values can be retrieved depending on the order.
ToRotationMatrix
Converts a quaternion to a rotation matrix.
ToAxisAngle
Converts a quaternion to an angle axis pair.
- axis
- The axis around the which rotation takes place.
- angle
- The angle in radians determining amount of rotation around the axis.
ToAxes
Converts a quaternion to an orthonormal set of axes.
- xAxis
- The X axis.
- yAxis
- The Y axis.
- zAxis
- The Z axis.
ToEulerAngles
Extracts Pitch/Yaw/Roll rotations from this quaternion.
- xAngle
- Rotation about x axis. (AKA Pitch)
- yAngle
- Rotation about y axis. (AKA Yaw)
- zAngle
- Rotation about z axis. (AKA Roll)
Returns: True if unique solution was found, false otherwise.
XAxis
Gets the positive x-axis of the coordinate system transformed by this quaternion.
YAxis
Gets the positive y-axis of the coordinate system transformed by this quaternion.
ZAxis
Gets the positive z-axis of the coordinate system transformed by this quaternion.
Dot
Calculates the dot product of this quaternion and another.
LookRotation
Orients the quaternion so its negative z axis points to the provided direction.
- forwardDir
- Direction to orient towards.
LookRotation
Orients the quaternion so its negative z axis points to the provided direction.
- forwardDir
- Direction to orient towards.
- upDir
- Constrains y axis orientation to a plane this vector lies on. This rule might be broken if forward and up direction are nearly parallel.
IsNaN
Query if any of the components of the quaternion are not a number.
staticDot
Calculates the dot product between two quaternions.
staticSlerp
Performs spherical interpolation between two quaternions.
Spherical interpolation neatly interpolates between two rotations without modifying the size of the vector it is applied to (unlike linear interpolation).
staticLerp
Linearly interpolates between the two quaternions using . t should be in [0, 1] range, where t = 0 corresponds to the left vector, while t = 1 corresponds to the right vector.
staticGetRotationFromTo
Gets the shortest arc quaternion to rotate this vector to the destination vector.
staticMin
Returns the minimum of all the quaternion components as a new quaternion.
staticMax
Returns the maximum of all the quaternion components as a new quaternion.
FromRotationMatrix
Initializes the quaternion from a 3x3 rotation matrix.
FromAxisAngle
Initializes the quaternion from an angle axis pair.
Quaternion will represent a rotation of "angle" radians around "axis".
FromAxes
Initializes the quaternion from orthonormal set of axes.
Quaternion will represent a rotation from base axes to the specified set of axes.
FromEulerAngles
Creates a quaternion from the provided Pitch/Yaw/Roll angles.
- xAngle
- Rotation about x axis. (AKA Pitch)
- yAngle
- Rotation about y axis. (AKA Yaw)
- zAngle
- Rotation about z axis. (AKA Roll)
FromEulerAngles
Creates a quaternion from the provided Pitch/Yaw/Roll angles.
- xAngle
- Rotation about x axis. (AKA Pitch)
- yAngle
- Rotation about y axis. (AKA Yaw)
- zAngle
- Rotation about z axis. (AKA Roll)
- order
- The order in which rotations will be extracted. Different values can be retrieved depending on the order.
ToRotationMatrix
Converts a quaternion to a rotation matrix.
ToAxisAngle
Converts a quaternion to an angle axis pair.
- axis
- The axis around the which rotation takes place.
- angle
- The angle in radians determining amount of rotation around the axis.
ToAxes
Converts a quaternion to an orthonormal set of axes.
- xAxis
- The X axis.
- yAxis
- The Y axis.
- zAxis
- The Z axis.
ToEulerAngles
Extracts Pitch/Yaw/Roll rotations from this quaternion.
- xAngle
- Rotation about x axis. (AKA Pitch)
- yAngle
- Rotation about y axis. (AKA Yaw)
- zAngle
- Rotation about z axis. (AKA Roll)
Returns: True if unique solution was found, false otherwise.
XAxis
Gets the positive x-axis of the coordinate system transformed by this quaternion.
YAxis
Gets the positive y-axis of the coordinate system transformed by this quaternion.
ZAxis
Gets the positive z-axis of the coordinate system transformed by this quaternion.
Dot
Calculates the dot product of this quaternion and another.
LookRotation
Orients the quaternion so its negative z axis points to the provided direction.
- forwardDir
- Direction to orient towards.
LookRotation
Orients the quaternion so its negative z axis points to the provided direction.
- forwardDir
- Direction to orient towards.
- upDir
- Constrains y axis orientation to a plane this vector lies on. This rule might be broken if forward and up direction are nearly parallel.
IsNaN
Query if any of the components of the quaternion are not a number.
staticDot
Calculates the dot product between two quaternions.
staticSlerp
Performs spherical interpolation between two quaternions.
Spherical interpolation neatly interpolates between two rotations without modifying the size of the vector it is applied to (unlike linear interpolation).
staticLerp
Linearly interpolates between the two quaternions using . t should be in [0, 1] range, where t = 0 corresponds to the left vector, while t = 1 corresponds to the right vector.
staticGetRotationFromTo
Gets the shortest arc quaternion to rotate this vector to the destination vector.
staticMin
Returns the minimum of all the quaternion components as a new quaternion.
staticMax
Returns the maximum of all the quaternion components as a new quaternion.
FromRotationMatrix
Initializes the quaternion from a 3x3 rotation matrix.
FromAxisAngle
Initializes the quaternion from an angle axis pair.
Quaternion will represent a rotation of "angle" radians around "axis".
FromAxes
Initializes the quaternion from orthonormal set of axes.
Quaternion will represent a rotation from base axes to the specified set of axes.
FromEulerAngles
Creates a quaternion from the provided Pitch/Yaw/Roll angles.
- xAngle
- Rotation about x axis. (AKA Pitch)
- yAngle
- Rotation about y axis. (AKA Yaw)
- zAngle
- Rotation about z axis. (AKA Roll)
FromEulerAngles
Creates a quaternion from the provided Pitch/Yaw/Roll angles.
- xAngle
- Rotation about x axis. (AKA Pitch)
- yAngle
- Rotation about y axis. (AKA Yaw)
- zAngle
- Rotation about z axis. (AKA Roll)
- order
- The order in which rotations will be extracted. Different values can be retrieved depending on the order.
ToRotationMatrix
Converts a quaternion to a rotation matrix.
ToAxisAngle
Converts a quaternion to an angle axis pair.
- axis
- The axis around the which rotation takes place.
- angle
- The angle in radians determining amount of rotation around the axis.
ToAxes
Converts a quaternion to an orthonormal set of axes.
- xAxis
- The X axis.
- yAxis
- The Y axis.
- zAxis
- The Z axis.
ToEulerAngles
Extracts Pitch/Yaw/Roll rotations from this quaternion.
- xAngle
- Rotation about x axis. (AKA Pitch)
- yAngle
- Rotation about y axis. (AKA Yaw)
- zAngle
- Rotation about z axis. (AKA Roll)
Returns: True if unique solution was found, false otherwise.
XAxis
Gets the positive x-axis of the coordinate system transformed by this quaternion.
YAxis
Gets the positive y-axis of the coordinate system transformed by this quaternion.
ZAxis
Gets the positive z-axis of the coordinate system transformed by this quaternion.
Dot
Calculates the dot product of this quaternion and another.
LookRotation
Orients the quaternion so its negative z axis points to the provided direction.
- forwardDir
- Direction to orient towards.
LookRotation
Orients the quaternion so its negative z axis points to the provided direction.
- forwardDir
- Direction to orient towards.
- upDir
- Constrains y axis orientation to a plane this vector lies on. This rule might be broken if forward and up direction are nearly parallel.
IsNaN
Query if any of the components of the quaternion are not a number.
staticDot
Calculates the dot product between two quaternions.
staticSlerp
Performs spherical interpolation between two quaternions.
Spherical interpolation neatly interpolates between two rotations without modifying the size of the vector it is applied to (unlike linear interpolation).
staticLerp
Linearly interpolates between the two quaternions using . t should be in [0, 1] range, where t = 0 corresponds to the left vector, while t = 1 corresponds to the right vector.
staticGetRotationFromTo
Gets the shortest arc quaternion to rotate this vector to the destination vector.
staticMin
Returns the minimum of all the quaternion components as a new quaternion.
staticMax
Returns the maximum of all the quaternion components as a new quaternion.