CQuaternionf Class Reference
Implementation of a float quaternion q=a+bi+cj+dk. This class is typically used for implementing custom ICE nodes. More...#include <xsi_quaternionf.h>
List of all members.
|
|
Public Member Functions
|
| __forceinline |
CQuaternionf () |
| __forceinline |
CQuaternionf (const CQuaternionf &in_quaternion) |
| |
~CQuaternionf () |
| __forceinline CQuaternionf & |
operator= (const CQuaternionf &in_quaternion) |
| __forceinline |
CQuaternionf (const float in_W, const float in_X, const float in_Y, const float in_Z) |
| __forceinline |
CQuaternionf (const CVector3f &in_vct) |
| __forceinline |
CQuaternionf (const CVector4f &in_vct) |
| __forceinline bool |
Equals (const CQuaternionf &in_Quat) const |
| __forceinline bool |
EpsilonEquals (const CQuaternionf &in_quat, const float in_fEpsilon) const |
| __forceinline bool |
operator== (const CQuaternionf &in_Quat) const |
| __forceinline bool |
operator< (const CQuaternionf &in_Quat) const |
| __forceinline CQuaternionf & |
operator *= (const CQuaternionf &in_Quat) |
| __forceinline CQuaternionf & |
Mul (const CQuaternionf &in_Quat) |
| __forceinline CQuaternionf & |
Mul (const CQuaternionf &in_Quat1, const CQuaternionf &in_Quat2) |
| __forceinline float |
Dot (const CQuaternionf &in_quat1) const |
| __forceinline CQuaternionf & |
Slerp (const CQuaternionf &in_quatStart, const CQuaternionf &in_quatEnd, const float in_fU) |
| __forceinline CQuaternionf & |
operator-= (const CQuaternionf &in_Quat) |
| __forceinline CQuaternionf & |
SubInPlace (const CQuaternionf &in_Quat) |
| __forceinline CQuaternionf & |
Sub (const CQuaternionf &in_Quat1, const CQuaternionf &in_Quat2) |
| __forceinline CQuaternionf & |
NegateInPlace () |
| __forceinline CQuaternionf & |
Negate (const CQuaternionf &in_Quat) |
| __forceinline float |
GetSquaredLength () const |
| __forceinline float |
GetLength () const |
| __forceinline CQuaternionf & |
operator+= (const CQuaternionf &in_Quat) |
| __forceinline CQuaternionf & |
AddInPlace (const CQuaternionf &in_Quat) |
| __forceinline CQuaternionf & |
Add (const CQuaternionf &in_Quat1, const CQuaternionf &in_Quat2) |
| __forceinline CQuaternionf & |
ConjugateInPlace () |
| __forceinline CQuaternionf & |
Conjugate (const CQuaternionf &in_Quat) |
| __forceinline CQuaternionf & |
InvertInPlace () |
| __forceinline CQuaternionf & |
Invert (const CQuaternionf &in_Quat) |
| __forceinline CQuaternionf & |
SetIdentity () |
| __forceinline CQuaternionf & |
Copy (const CQuaternionf &in_Quat) |
| __forceinline CQuaternionf & |
NormalizeInPlace () |
| __forceinline void |
Get (float &out_W, float &out_X, float &out_Y, float &out_Z) const |
| __forceinline CVector3f |
Get () const |
| __forceinline void |
Get (CVector4f &io_XYZWVector) const |
| __forceinline CQuaternionf & |
Set (float in_W, float in_X, float in_Y, float in_Z) |
| __forceinline CQuaternionf & |
Set (const CVector3f &in_XYZVector) |
| __forceinline CQuaternionf & |
Set (const CVector4f &in_XYZWVector) |
| __forceinline float |
GetValue (short in_nIndex) const |
| __forceinline CQuaternionf & |
SetValue (short in_nIndex, float newVal) |
| __forceinline float |
GetW () const |
| __forceinline CQuaternionf & |
PutW (float newVal) |
| __forceinline float |
GetZ () const |
| __forceinline CQuaternionf & |
PutZ (float newVal) |
| __forceinline float |
GetY () const |
| __forceinline CQuaternionf & |
PutY (float newVal) |
| __forceinline float |
GetX () const |
| __forceinline CQuaternionf & |
PutX (float newVal) |
| __forceinline bool |
operator!= (const CQuaternionf &in_quat) const |
Detailed Description
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.
- See also:
- CRotation3f
Constructor & Destructor Documentation
Copy constructor.
- Parameters:
-
|
|
in_quaternion |
constant class object. |
Default destructor.
| __forceinline CQuaternionf |
( |
const float |
in_W, |
|
|
|
const float |
in_X, |
|
|
|
const float |
in_Y, |
|
|
|
const float |
in_Z |
|
|
|
) |
|
|
|
Constructor.
- Parameters:
-
|
|
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 |
Constructor.
- Note:
- The W component of the quaternion will be set to 1.0
- Parameters:
-
|
|
in_vct |
Vector containing the X, Y and Z values |
Constructor.
- Parameters:
-
|
|
in_vct |
Vector containing the X, Y, Z and W values |
Member Function Documentation
Assignment operator.
- Parameters:
-
|
|
in_quaternion |
constant class object. |
- Returns:
- This quaternion
| __forceinline bool Equals |
( |
const CQuaternionf & |
in_Quat |
) |
const |
Performs an exact comparison of two quaternions.
- Note:
- Each parameter of both quaternions must be exactly the same fora match.
- Parameters:
-
|
|
in_Quat |
Quaternion to compare against |
- See also:
- CQuaternionf::EpsilonEquals
| __forceinline 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.
- Parameters:
-
|
|
in_quat |
Quaternion to compare against. |
|
|
in_fEpsilon |
Tolerance value (validity domain: [0, +INF[) |
- See also:
- CQuaternionf::Equals
| __forceinline bool operator== |
( |
const CQuaternionf & |
in_Quat |
) |
const |
Performs a comparison.
- Note:
- Each parameter of both quaternions must be exactly the same for a match.
- Parameters:
-
|
|
in_Quat |
Quaternion to compare against |
- See also:
- CQuaternionf::EpsilonEquals, CQuaternionf::Equals
| __forceinline 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.
- Parameters:
-
- Returns:
- true if this CQuaternionf is less than the specified CQuaternionf, false otherwise.
- Since:
- 7.5
Multiplies this quaternion with another one in place.
- Parameters:
-
|
|
in_Quat |
Quaternion to multiply |
- Returns:
- This quaternion
- See also:
- CQuaternionf::Mul, CQuaternionf::MulInPlace
Multiplies this quaternion with another one in place.
- Parameters:
-
|
|
in_Quat |
Quaternion to multiply |
- Returns:
- This quaternion
- See also:
- CQuaternionf::Mul
Stores the result of the multiplication of two quaternions.
- Parameters:
-
|
|
in_Quat1 |
First quaternion |
|
|
in_Quat2 |
Second quaternion |
- Returns:
- This quaternion
| __forceinline float Dot |
( |
const CQuaternionf & |
in_quat1 |
) |
const |
Performs the dot product between this quaternion and the one specified in in_quat1.
- Parameters:
-
|
|
in_quat1 |
Quaternion operand. |
- Returns:
- This quaternion
Performs the spherical linear interpolation of two unit quaternions into this one for u between 0 and 1.
- Parameters:
-
|
|
in_quatStart |
Starting unitary quaternion. |
|
|
in_quatEnd |
Ending unitary quaternion. |
|
|
in_fU |
Interpolation factor (validity domain: [0.0, 1.0]) |
- Returns:
- This quaternion.
Subtracts a quaternion from the current quaternion in place.
- Parameters:
-
|
|
in_Quat |
Quaternion to subtract |
- Returns:
- This quaternion
- See also:
- CQuaternionf::SubInPlace, CQuaternionf::Sub
Subtracts a quaternion from the current quaternion in place.
- Parameters:
-
|
|
in_Quat |
Quaternion to subtract |
- Returns:
- This quaternion
- See also:
- CQuaternionf::Sub
Stores the result of the subtraction of two quaternions.
- Parameters:
-
|
|
in_Quat1 |
First quaternion |
|
|
in_Quat2 |
Second quaternion |
- Returns:
- This quaternion
- See also:
- CQuaternionf::SubInPlace
Negates all the components of this quaternion.
- Returns:
- This quaternion
- See also:
- CQuaternionf::Negate
Stores the result of the negation of a given quaternion without changing it.
- Parameters:
-
|
|
in_Quat |
Quaternion to negate |
- Returns:
- This quaternion
- See also:
- CQuaternionf::NegateInPlace
| __forceinline float GetSquaredLength |
( |
|
) |
const |
Returns the squared length of this quaternion.
- Returns:
- The squared length
- See also:
- CQuaternionf::GetLength
| __forceinline float GetLength |
( |
|
) |
const |
Returns the length of this quaternion.
- Returns:
- Length of this quaternion
- See also:
- CQuaternionf::GetSquaredLength
Adds a quaternion to this quaternion.
- Parameters:
-
|
|
in_Quat |
Quaternion to add |
- See also:
- CQuaternionf::AddInPlace, CQuaternionf::Add
Adds a quaternion to this quaternion.
- Parameters:
-
|
|
in_Quat |
Quaternion to add |
- See also:
- CQuaternionf::Add
Stores the result of the addition of two quaternions.
- Parameters:
-
|
|
in_Quat1 |
First quaternion |
|
|
in_Quat2 |
Second quaternion |
- Returns:
- This quaternion
- See also:
- CQuaternionf::AddInPlace
Conjugates this quaternion.
- Returns:
- This quaternion
- See also:
- CQuaternionf::ConjugateInPlace
Stores the conjugate of a quaternion without changing it.
- Parameters:
-
|
|
in_Quat |
Quaternion to conjugate. |
- Returns:
- This quaternion
- See also:
- CQuaternionf::ConjugateInPlace
Inverts this quaternion.
- Returns:
- This quaternion
- See also:
- CQuaternionf::Invert
Stores the invert of a quaternion without changing it.
- Parameters:
-
|
|
in_Quat |
Quaternion to invert |
- Returns:
- This quaternion
- See also:
- CQuaternionf::Invert
Sets this quaternion to identity quaternion.
- Returns:
- This quaternion
Copies the content of a quaternion.
- Parameters:
-
|
|
in_Quat |
Quaternion to copy |
- Returns:
- This quaternion
Normalizes the quaternion in place.
- Returns:
- CStatus::OK if the normalization has been computed.
| __forceinline void Get |
( |
float & |
out_W, |
|
|
|
float & |
out_X, |
|
|
|
float & |
out_Y, |
|
|
|
float & |
out_Z |
|
|
|
) |
|
|
const |
Returns the components of this quaternion.
- Return values:
-
|
|
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 |
Returns the components of this quaternion.
- Returns:
- Vector that holds the values of the X, Y and Z components
| __forceinline void Get |
( |
CVector4f & |
io_XYZWVector |
) |
const |
Returns the components of this quaternion.
- Parameters:
-
|
|
io_XYZWVector |
Vector that holds the values of the X, Y, Z and W components |
| __forceinline CQuaternionf & Set |
( |
float |
in_W, |
|
|
|
float |
in_X, |
|
|
|
float |
in_Y, |
|
|
|
float |
in_Z |
|
|
|
) |
|
|
|
Sets the quaternion's components.
- Parameters:
-
|
|
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 |
- Returns:
- This quaternion
Sets the quaternion's components.
- Note:
- The W value is left as is.
- Parameters:
-
|
|
in_XYZVector |
Vector that holds the new values for the X, Y and Z components |
- Returns:
- This quaternion
Sets the quaternion's components.
- Parameters:
-
|
|
in_XYZWVector |
Vector that holds the new values for the X, Y and Z components. The W component is set to 1.0. |
- Returns:
- This quaternion
| __forceinline float GetValue |
( |
short |
in_nIndex |
) |
const |
Gets the value of a single component.
- Parameters:
-
|
|
in_nIndex |
0-based index of the component to get. This value can be 0 (W), 1(X), 2(Y) or 3(Z). |
- Returns:
- The requested value
0.0 if an invalid index was provided.
- See also:
- CQuaternionf::SetValue
| __forceinline CQuaternionf & SetValue |
( |
short |
in_nIndex, |
|
|
|
float |
newVal |
|
|
|
) |
|
|
|
Sets the value of a single component.
- Note:
- The quaternion is unchanged if the provided index is invalid
- Parameters:
-
|
|
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 |
- Returns:
- This quaternion
- See also:
- CQuaternionf::SetValue
| __forceinline float GetW |
( |
|
) |
const |
Returns the W component.
- Returns:
- The W component
Sets the W component.
- Parameters:
-
|
|
newVal |
The new value for the component |
- Returns:
- This quaternion
| __forceinline float GetZ |
( |
|
) |
const |
Returns the Z component.
- Returns:
- The Z component
Sets the Z component.
- Parameters:
-
|
|
newVal |
The new value for the component |
- Returns:
- This quaternion
| __forceinline float GetY |
( |
|
) |
const |
Returns the Y component.
- Returns:
- The Y component
Sets the Y component.
- Parameters:
-
|
|
newVal |
The new value for the component |
- Returns:
- This quaternion
| __forceinline float GetX |
( |
|
) |
const |
Returns the X component.
- Returns:
- The X component
Sets the X component.
- Parameters:
-
|
|
newVal |
The new value for the component |
- Returns:
- This quaternion
| __forceinline bool operator!= |
( |
const CQuaternionf & |
in_quat |
) |
const |
Inequality operator (tests the strict inequality of this quaternion with the quaternion in_quat).
- Parameters:
-
|
|
in_quat |
Operand quaternion. |
- Returns:
- true if equal else false.
- See also:
- CQuaternionf::Equals
The documentation for this class was generated from the following file: