CQuaternionf Class Reference
 
 
 
CQuaternionf Class Reference

#include <xsi_quaternionf.h>


Class 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

List of all members.

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

Constructor & Destructor Documentation

SICPPSDK_INLINE CQuaternionf ( )

Default constructor. Constructs the identity quaternion.

See also:
CQuaternionf::SetIdentity
SICPPSDK_INLINE CQuaternionf ( const CQuaternionf in_quaternion )

Copy constructor.

Parameters:
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.

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
SICPPSDK_INLINE CQuaternionf ( const CVector3f in_vct )

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
SICPPSDK_INLINE CQuaternionf ( const CVector4f in_vct )

Constructor.

Parameters:
in_vct Vector containing the X, Y, Z and W values

Member Function Documentation

SICPPSDK_INLINE CQuaternionf & operator= ( const CQuaternionf in_quaternion )

Assignment operator.

Parameters:
in_quaternion constant class object.
Returns:
This quaternion
SICPPSDK_INLINE 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
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.

Parameters:
in_quat Quaternion to compare against.
in_fEpsilon Tolerance value (validity domain: [0, +INF[)
See also:
CQuaternionf::Equals
SICPPSDK_INLINE 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
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.

Parameters:
in_Quat CQuaternionf to compare.
Returns:
true if this CQuaternionf is less than the specified CQuaternionf, false otherwise.
Since:
7.5
SICPPSDK_INLINE CQuaternionf & operator*= ( const CQuaternionf in_Quat )

Multiplies this quaternion with another one in place.

Parameters:
in_Quat Quaternion to multiply
Returns:
This quaternion
See also:
CQuaternionf::Mul, CQuaternionf::MulInPlace
SICPPSDK_INLINE CQuaternionf & Mul ( const CQuaternionf in_Quat )

Multiplies this quaternion with another one in place.

Parameters:
in_Quat Quaternion to multiply
Returns:
This quaternion
See also:
CQuaternionf::Mul
SICPPSDK_INLINE CQuaternionf & Mul ( const CQuaternionf in_Quat1,
const CQuaternionf in_Quat2 
)

Stores the result of the multiplication of two quaternions.

Parameters:
in_Quat1 First quaternion
in_Quat2 Second quaternion
Returns:
This quaternion
SICPPSDK_INLINE 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
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.

Parameters:
in_quatStart Starting unitary quaternion.
in_quatEnd Ending unitary quaternion.
in_fU Interpolation factor (validity domain: [0.0, 1.0])
Returns:
This quaternion.
SICPPSDK_INLINE CQuaternionf & operator-= ( const CQuaternionf in_Quat )

Subtracts a quaternion from the current quaternion in place.

Parameters:
in_Quat Quaternion to subtract
Returns:
This quaternion
See also:
CQuaternionf::SubInPlace, CQuaternionf::Sub
SICPPSDK_INLINE CQuaternionf & SubInPlace ( const CQuaternionf in_Quat )

Subtracts a quaternion from the current quaternion in place.

Parameters:
in_Quat Quaternion to subtract
Returns:
This quaternion
See also:
CQuaternionf::Sub
SICPPSDK_INLINE CQuaternionf & Sub ( const CQuaternionf in_Quat1,
const CQuaternionf in_Quat2 
)

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
SICPPSDK_INLINE CQuaternionf & NegateInPlace ( )

Negates all the components of this quaternion.

Returns:
This quaternion
See also:
CQuaternionf::Negate
SICPPSDK_INLINE CQuaternionf & Negate ( const CQuaternionf in_Quat )

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
SICPPSDK_INLINE float GetSquaredLength ( ) const

Returns the squared length of this quaternion.

Returns:
The squared length
See also:
CQuaternionf::GetLength
SICPPSDK_INLINE float GetLength ( ) const

Returns the length of this quaternion.

Returns:
Length of this quaternion
See also:
CQuaternionf::GetSquaredLength
SICPPSDK_INLINE CQuaternionf & operator+= ( const CQuaternionf in_Quat )

Adds a quaternion to this quaternion.

Parameters:
in_Quat Quaternion to add
See also:
CQuaternionf::AddInPlace, CQuaternionf::Add
SICPPSDK_INLINE CQuaternionf & AddInPlace ( const CQuaternionf in_Quat )

Adds a quaternion to this quaternion.

Parameters:
in_Quat Quaternion to add
See also:
CQuaternionf::Add
SICPPSDK_INLINE CQuaternionf & Add ( const CQuaternionf in_Quat1,
const CQuaternionf in_Quat2 
)

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
SICPPSDK_INLINE CQuaternionf & ConjugateInPlace ( )

Conjugates this quaternion.

Returns:
This quaternion
See also:
CQuaternionf::ConjugateInPlace
SICPPSDK_INLINE CQuaternionf & Conjugate ( const CQuaternionf in_Quat )

Stores the conjugate of a quaternion without changing it.

Parameters:
in_Quat Quaternion to conjugate.
Returns:
This quaternion
See also:
CQuaternionf::ConjugateInPlace
SICPPSDK_INLINE CQuaternionf & InvertInPlace ( )

Inverts this quaternion.

Returns:
This quaternion
See also:
CQuaternionf::Invert
SICPPSDK_INLINE CQuaternionf & Invert ( const CQuaternionf in_Quat )

Stores the invert of a quaternion without changing it.

Parameters:
in_Quat Quaternion to invert
Returns:
This quaternion
See also:
CQuaternionf::Invert
SICPPSDK_INLINE CQuaternionf & SetIdentity ( )

Sets this quaternion to identity quaternion.

Returns:
This quaternion
SICPPSDK_INLINE CQuaternionf & Copy ( const CQuaternionf in_Quat )

Copies the content of a quaternion.

Parameters:
in_Quat Quaternion to copy
Returns:
This quaternion
SICPPSDK_INLINE CQuaternionf & NormalizeInPlace ( )

Normalizes the quaternion in place.

Returns:
CStatus::OK if the normalization has been computed.
SICPPSDK_INLINE 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
SICPPSDK_INLINE CVector3f GetVector3 ( ) const

Returns the components of this quaternion.

Returns:
CVector3f that holds the values of the X, Y and Z components.
SICPPSDK_INLINE CVector4f GetVector4 ( ) const

Returns the components of this quaternion.

Returns:
CVector4f that holds the values of the X, Y, Z, W components.
SICPPSDK_INLINE 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
SICPPSDK_INLINE 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
SICPPSDK_INLINE CQuaternionf & Set ( const CVector3f in_XYZVector )

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
SICPPSDK_INLINE CQuaternionf & Set ( const CVector4f in_XYZWVector )

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
SICPPSDK_INLINE 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
SICPPSDK_INLINE 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
SICPPSDK_INLINE float GetW ( ) const

Returns the W component.

Returns:
The W component
SICPPSDK_INLINE CQuaternionf & PutW ( float  newVal )

Sets the W component.

Parameters:
newVal The new value for the component
Returns:
This quaternion
SICPPSDK_INLINE float GetZ ( ) const

Returns the Z component.

Returns:
The Z component
SICPPSDK_INLINE CQuaternionf & PutZ ( float  newVal )

Sets the Z component.

Parameters:
newVal The new value for the component
Returns:
This quaternion
SICPPSDK_INLINE float GetY ( ) const

Returns the Y component.

Returns:
The Y component
SICPPSDK_INLINE CQuaternionf & PutY ( float  newVal )

Sets the Y component.

Parameters:
newVal The new value for the component
Returns:
This quaternion
SICPPSDK_INLINE float GetX ( ) const

Returns the X component.

Returns:
The X component
SICPPSDK_INLINE CQuaternionf & PutX ( float  newVal )

Sets the X component.

Parameters:
newVal The new value for the component
Returns:
This quaternion
SICPPSDK_INLINE 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: