Implementation of a float quaternion q=a+bi+cj+dk. This class is typically used for implementing custom ICE nodes.
A quaternion is often noted q=(s,v) where s is a scalar and v is a 3D vector, or either noted q=(W,X,Y,Z), where W, X, Y and Z are scalar, and X, Y and Z are the components of vector v in previous notation.
#include <xsi_quaternionf.h>
Public Member Functions | |
SICPPSDK_INLINE | CQuaternionf () |
SICPPSDK_INLINE | CQuaternionf (const CQuaternionf &in_quaternion) |
~CQuaternionf () | |
SICPPSDK_INLINE CQuaternionf & | operator= (const CQuaternionf &in_quaternion) |
SICPPSDK_INLINE | CQuaternionf (const float in_W, const float in_X, const float in_Y, const float in_Z) |
SICPPSDK_INLINE | CQuaternionf (const CVector3f &in_vct) |
SICPPSDK_INLINE | CQuaternionf (const CVector4f &in_vct) |
SICPPSDK_INLINE bool | Equals (const CQuaternionf &in_Quat) const |
SICPPSDK_INLINE bool | EpsilonEquals (const CQuaternionf &in_quat, const float in_fEpsilon) const |
SICPPSDK_INLINE bool | operator== (const CQuaternionf &in_Quat) const |
SICPPSDK_INLINE bool | operator< (const CQuaternionf &in_Quat) const |
SICPPSDK_INLINE CQuaternionf & | operator*= (const CQuaternionf &in_Quat) |
SICPPSDK_INLINE CQuaternionf & | Mul (const CQuaternionf &in_Quat) |
SICPPSDK_INLINE CQuaternionf & | Mul (const CQuaternionf &in_Quat1, const CQuaternionf &in_Quat2) |
SICPPSDK_INLINE float | Dot (const CQuaternionf &in_quat1) const |
SICPPSDK_INLINE CQuaternionf & | Slerp (const CQuaternionf &in_quatStart, const CQuaternionf &in_quatEnd, const float in_fU) |
SICPPSDK_INLINE CQuaternionf & | operator-= (const CQuaternionf &in_Quat) |
SICPPSDK_INLINE CQuaternionf & | SubInPlace (const CQuaternionf &in_Quat) |
SICPPSDK_INLINE CQuaternionf & | Sub (const CQuaternionf &in_Quat1, const CQuaternionf &in_Quat2) |
SICPPSDK_INLINE CQuaternionf & | NegateInPlace () |
SICPPSDK_INLINE CQuaternionf & | Negate (const CQuaternionf &in_Quat) |
SICPPSDK_INLINE float | GetSquaredLength () const |
SICPPSDK_INLINE float | GetLength () const |
SICPPSDK_INLINE CQuaternionf & | operator+= (const CQuaternionf &in_Quat) |
SICPPSDK_INLINE CQuaternionf & | AddInPlace (const CQuaternionf &in_Quat) |
SICPPSDK_INLINE CQuaternionf & | Add (const CQuaternionf &in_Quat1, const CQuaternionf &in_Quat2) |
SICPPSDK_INLINE CQuaternionf & | ConjugateInPlace () |
SICPPSDK_INLINE CQuaternionf & | Conjugate (const CQuaternionf &in_Quat) |
SICPPSDK_INLINE CQuaternionf & | InvertInPlace () |
SICPPSDK_INLINE CQuaternionf & | Invert (const CQuaternionf &in_Quat) |
SICPPSDK_INLINE CQuaternionf & | SetIdentity () |
SICPPSDK_INLINE CQuaternionf & | Copy (const CQuaternionf &in_Quat) |
SICPPSDK_INLINE CQuaternionf & | NormalizeInPlace () |
SICPPSDK_INLINE void | Get (float &out_W, float &out_X, float &out_Y, float &out_Z) const |
SICPPSDK_INLINE CVector3f | GetVector3 () const |
SICPPSDK_INLINE CVector4f | GetVector4 () const |
SICPPSDK_INLINE void | Get (CVector4f &io_XYZWVector) const |
SICPPSDK_INLINE CQuaternionf & | Set (float in_W, float in_X, float in_Y, float in_Z) |
SICPPSDK_INLINE CQuaternionf & | Set (const CVector3f &in_XYZVector) |
SICPPSDK_INLINE CQuaternionf & | Set (const CVector4f &in_XYZWVector) |
SICPPSDK_INLINE float | GetValue (short in_nIndex) const |
SICPPSDK_INLINE CQuaternionf & | SetValue (short in_nIndex, float newVal) |
SICPPSDK_INLINE float | GetW () const |
SICPPSDK_INLINE CQuaternionf & | PutW (float newVal) |
SICPPSDK_INLINE float | GetZ () const |
SICPPSDK_INLINE CQuaternionf & | PutZ (float newVal) |
SICPPSDK_INLINE float | GetY () const |
SICPPSDK_INLINE CQuaternionf & | PutY (float newVal) |
SICPPSDK_INLINE float | GetX () const |
SICPPSDK_INLINE CQuaternionf & | PutX (float newVal) |
SICPPSDK_INLINE bool | operator!= (const CQuaternionf &in_quat) const |
SICPPSDK_INLINE CQuaternionf | ( | ) |
Default constructor. Constructs the identity quaternion.
SICPPSDK_INLINE CQuaternionf | ( | const CQuaternionf & | in_quaternion | ) |
Copy constructor.
in_quaternion | constant class object. |
~CQuaternionf | ( | ) | [inline] |
Default destructor.
SICPPSDK_INLINE CQuaternionf | ( | const float | in_W, |
const float | in_X, | ||
const float | in_Y, | ||
const float | in_Z | ||
) |
Constructor.
in_W | W component |
in_X | X component of the quaternion's vector |
in_Y | Y component of the quaternion's vector |
in_Z | Z component of the quaternion's vector |
SICPPSDK_INLINE CQuaternionf | ( | const CVector3f & | in_vct | ) |
Constructor.
in_vct | Vector containing the X, Y and Z values |
SICPPSDK_INLINE CQuaternionf | ( | const CVector4f & | in_vct | ) |
Constructor.
in_vct | Vector containing the X, Y, Z and W values |
SICPPSDK_INLINE CQuaternionf & operator= | ( | const CQuaternionf & | in_quaternion | ) |
Assignment operator.
in_quaternion | constant class object. |
SICPPSDK_INLINE bool Equals | ( | const CQuaternionf & | in_Quat | ) | const |
Performs an exact comparison of two quaternions.
in_Quat | Quaternion to compare against |
SICPPSDK_INLINE bool EpsilonEquals | ( | const CQuaternionf & | in_quat, |
const float | in_fEpsilon | ||
) | const |
Performs comparison between this quaternion and the in_quat1
quaternion within the specified epsilon value.
in_quat | Quaternion to compare against. |
in_fEpsilon | Tolerance value (validity domain: [0, +INF[ ) |
SICPPSDK_INLINE bool operator== | ( | const CQuaternionf & | in_Quat | ) | const |
Performs a comparison.
in_Quat | Quaternion to compare against |
SICPPSDK_INLINE bool operator< | ( | const CQuaternionf & | in_Quat | ) | const |
Less than operator. Performs a comparison with a specified CQuaternionf to determine if this CQuaternionf is less than the specified CQuaternionf. The comparison is arbitrary and not geometrically meaningful, it's only purpose is to make CQuaternionf compliant with stl for sorting operations.
in_Quat | CQuaternionf to compare. |
SICPPSDK_INLINE CQuaternionf & operator*= | ( | const CQuaternionf & | in_Quat | ) |
Multiplies this quaternion with another one in place.
in_Quat | Quaternion to multiply |
SICPPSDK_INLINE CQuaternionf & Mul | ( | const CQuaternionf & | in_Quat | ) |
Multiplies this quaternion with another one in place.
in_Quat | Quaternion to multiply |
SICPPSDK_INLINE CQuaternionf & Mul | ( | const CQuaternionf & | in_Quat1, |
const CQuaternionf & | in_Quat2 | ||
) |
Stores the result of the multiplication of two quaternions.
in_Quat1 | First quaternion |
in_Quat2 | Second quaternion |
SICPPSDK_INLINE float Dot | ( | const CQuaternionf & | in_quat1 | ) | const |
Performs the dot product between this quaternion and the one specified in in_quat1
.
in_quat1 | Quaternion operand. |
SICPPSDK_INLINE CQuaternionf & Slerp | ( | const CQuaternionf & | in_quatStart, |
const CQuaternionf & | in_quatEnd, | ||
const float | in_fU | ||
) |
Performs the spherical linear interpolation of two unit quaternions into this one for u between 0 and 1.
in_quatStart | Starting unitary quaternion. |
in_quatEnd | Ending unitary quaternion. |
in_fU | Interpolation factor (validity domain: [0.0, 1.0] ) |
SICPPSDK_INLINE CQuaternionf & operator-= | ( | const CQuaternionf & | in_Quat | ) |
Subtracts a quaternion from the current quaternion in place.
in_Quat | Quaternion to subtract |
SICPPSDK_INLINE CQuaternionf & SubInPlace | ( | const CQuaternionf & | in_Quat | ) |
Subtracts a quaternion from the current quaternion in place.
in_Quat | Quaternion to subtract |
SICPPSDK_INLINE CQuaternionf & Sub | ( | const CQuaternionf & | in_Quat1, |
const CQuaternionf & | in_Quat2 | ||
) |
Stores the result of the subtraction of two quaternions.
in_Quat1 | First quaternion |
in_Quat2 | Second quaternion |
SICPPSDK_INLINE CQuaternionf & NegateInPlace | ( | ) |
Negates all the components of this quaternion.
SICPPSDK_INLINE CQuaternionf & Negate | ( | const CQuaternionf & | in_Quat | ) |
Stores the result of the negation of a given quaternion without changing it.
in_Quat | Quaternion to negate |
SICPPSDK_INLINE float GetSquaredLength | ( | ) | const |
Returns the squared length of this quaternion.
SICPPSDK_INLINE float GetLength | ( | ) | const |
Returns the length of this quaternion.
SICPPSDK_INLINE CQuaternionf & operator+= | ( | const CQuaternionf & | in_Quat | ) |
Adds a quaternion to this quaternion.
in_Quat | Quaternion to add |
SICPPSDK_INLINE CQuaternionf & AddInPlace | ( | const CQuaternionf & | in_Quat | ) |
Adds a quaternion to this quaternion.
in_Quat | Quaternion to add |
SICPPSDK_INLINE CQuaternionf & Add | ( | const CQuaternionf & | in_Quat1, |
const CQuaternionf & | in_Quat2 | ||
) |
Stores the result of the addition of two quaternions.
in_Quat1 | First quaternion |
in_Quat2 | Second quaternion |
SICPPSDK_INLINE CQuaternionf & ConjugateInPlace | ( | ) |
SICPPSDK_INLINE CQuaternionf & Conjugate | ( | const CQuaternionf & | in_Quat | ) |
Stores the conjugate of a quaternion without changing it.
in_Quat | Quaternion to conjugate. |
SICPPSDK_INLINE CQuaternionf & InvertInPlace | ( | ) |
SICPPSDK_INLINE CQuaternionf & Invert | ( | const CQuaternionf & | in_Quat | ) |
Stores the invert of a quaternion without changing it.
in_Quat | Quaternion to invert |
SICPPSDK_INLINE CQuaternionf & SetIdentity | ( | ) |
Sets this quaternion to identity quaternion.
SICPPSDK_INLINE CQuaternionf & Copy | ( | const CQuaternionf & | in_Quat | ) |
Copies the content of a quaternion.
in_Quat | Quaternion to copy |
SICPPSDK_INLINE CQuaternionf & NormalizeInPlace | ( | ) |
Normalizes the quaternion in place.
SICPPSDK_INLINE void Get | ( | float & | out_W, |
float & | out_X, | ||
float & | out_Y, | ||
float & | out_Z | ||
) | const |
Returns the components of this quaternion.
out_W | The current value of the W component |
out_X | The current value of the X component |
out_Y | The current value of the Y component |
out_Z | The current value of the Z component |
SICPPSDK_INLINE CVector3f GetVector3 | ( | ) | const |
Returns the components of this quaternion.
SICPPSDK_INLINE CVector4f GetVector4 | ( | ) | const |
Returns the components of this quaternion.
SICPPSDK_INLINE void Get | ( | CVector4f & | io_XYZWVector | ) | const |
Returns the components of this quaternion.
io_XYZWVector | Vector that holds the values of the X, Y, Z and W components |
SICPPSDK_INLINE CQuaternionf & Set | ( | float | in_W, |
float | in_X, | ||
float | in_Y, | ||
float | in_Z | ||
) |
Sets the quaternion's components.
in_W | New value for the W component |
in_X | New value for the X component |
in_Y | New value for the Y component |
in_Z | New value for the Z component |
SICPPSDK_INLINE CQuaternionf & Set | ( | const CVector3f & | in_XYZVector | ) |
Sets the quaternion's components.
in_XYZVector | Vector that holds the new values for the X, Y and Z components |
SICPPSDK_INLINE CQuaternionf & Set | ( | const CVector4f & | in_XYZWVector | ) |
Sets the quaternion's components.
in_XYZWVector | Vector that holds the new values for the X, Y and Z components. The W component is set to 1.0. |
SICPPSDK_INLINE float GetValue | ( | short | in_nIndex | ) | const |
Gets the value of a single component.
in_nIndex | 0-based index of the component to get. This value can be 0 (W), 1(X), 2(Y) or 3(Z). |
SICPPSDK_INLINE CQuaternionf & SetValue | ( | short | in_nIndex, |
float | newVal | ||
) |
Sets the value of a single component.
in_nIndex | 0-based index of the component to set. This value can be 0 (W), 1(X), 2(Y) or 3(Z). |
newVal | new value |
SICPPSDK_INLINE float GetW | ( | ) | const |
Returns the W component.
SICPPSDK_INLINE CQuaternionf & PutW | ( | float | newVal | ) |
Sets the W component.
newVal | The new value for the component |
SICPPSDK_INLINE float GetZ | ( | ) | const |
Returns the Z component.
SICPPSDK_INLINE CQuaternionf & PutZ | ( | float | newVal | ) |
Sets the Z component.
newVal | The new value for the component |
SICPPSDK_INLINE float GetY | ( | ) | const |
Returns the Y component.
SICPPSDK_INLINE CQuaternionf & PutY | ( | float | newVal | ) |
Sets the Y component.
newVal | The new value for the component |
SICPPSDK_INLINE float GetX | ( | ) | const |
Returns the X component.
SICPPSDK_INLINE CQuaternionf & PutX | ( | float | newVal | ) |
Sets the X component.
newVal | The new value for the component |
SICPPSDK_INLINE bool operator!= | ( | const CQuaternionf & | in_quat | ) | const |
Inequality operator (tests the strict inequality of this quaternion with the quaternion in_quat).
in_quat | Operand quaternion. |