FBX C++ API Reference
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FbxQuaternion Class Reference

#include <fbxquaternion.h>

Class Description

FBX SDK quaternion class.

Quaternions form a four-dimensional normed division algebra over the real numbers. It is for calculations involving three-dimensional rotations.

Examples:
ViewScene/DrawScene.cxx.

Definition at line 27 of file fbxquaternion.h.

+ Inheritance diagram for FbxQuaternion:

Constructors and Destructor

 FbxQuaternion ()
 Constructor. More...
 
 FbxQuaternion (const FbxQuaternion &pV)
 Copy constructor. More...
 
 FbxQuaternion (double pX, double pY, double pZ, double pW=1.0)
 Constructor. More...
 
 FbxQuaternion (const FbxVector4 &pAxis, double pDegree)
 From axis degree constructor. More...
 
 ~FbxQuaternion ()
 Destructor. More...
 

Access

FbxQuaternionoperator= (const FbxQuaternion &pQuaternion)
 Assignment operation. More...
 
double & operator[] (int pIndex)
 Accessor. More...
 
const double & operator[] (int pIndex) const
 Accessor. More...
 
double GetAt (int pIndex) const
 Get a vector element. More...
 
void SetAt (int pIndex, double pValue)
 Set a vector element. More...
 
void Set (double pX, double pY, double pZ, double pW=1.0)
 Set vector. More...
 

Scalar Operations

FbxQuaternion operator+ (double pValue) const
 The addition operator between the scalar part of this quaternion and a scalar value, no influence on the vector part of the quaternion. More...
 
FbxQuaternion operator- (double pValue) const
 The subtraction operator between the scalar part of this quaternion and a scalar value, no influence on the vector part of the quaternion. More...
 
FbxQuaternion operator* (double pValue) const
 Multiply all vector components by a value. More...
 
FbxQuaternion operator/ (double pValue) const
 Divide all vector components by a value. More...
 
FbxQuaternionoperator+= (double pValue)
 The in place addition operator between the real part of this quaternion and a scalar value. More...
 
FbxQuaternionoperator-= (double pValue)
 The subtraction operator between the real part of this quaternion and a scalar value. More...
 
FbxQuaternionoperator*= (double pValue)
 Multiply a value to all vector elements. More...
 
FbxQuaternionoperator/= (double pValue)
 Divide all vector elements by a value. More...
 

Vector Operations

FbxQuaternion operator- () const
 Unary minus operator. More...
 
FbxQuaternion operator+ (const FbxQuaternion &pQuaternion) const
 Add two vectors together. More...
 
FbxQuaternion operator- (const FbxQuaternion &pQuaternion) const
 Subtract a quaternion from another quaternion. More...
 
FbxQuaternion operator* (const FbxQuaternion &pOther) const
 The quaternion multiplication operator. More...
 
FbxQuaternion operator/ (const FbxQuaternion &pOther) const
 The quaternion division operator. More...
 
FbxQuaternionoperator+= (const FbxQuaternion &pQuaternion)
 Add two quaternions together. More...
 
FbxQuaternionoperator-= (const FbxQuaternion &pQuaternion)
 Subtract a quaternion from another vector. More...
 
FbxQuaternionoperator*= (const FbxQuaternion &pOther)
 The in place quaternion multiplication operator. More...
 
FbxQuaternionoperator/= (const FbxQuaternion &pOther)
 The in place quaternion division operator. More...
 
FbxQuaternion Product (const FbxQuaternion &pOther) const
 Return quaternion product. More...
 
double DotProduct (const FbxQuaternion &pQuaternion) const
 Return quaternion dot product. More...
 
void Normalize ()
 Normalize the quaternion, length set to 1. More...
 
void Conjugate ()
 Calculate the quaternion conjugate. More...
 
double Length ()
 Calculate the length (norm) of the quaternion. More...
 
void Inverse ()
 Calculate the inverse of the quaternion. More...
 
void SetAxisAngle (const FbxVector4 &pAxis, double pDegree)
 Set the quaternion rotation from an axis degree angle. More...
 
FbxQuaternion Slerp (const FbxQuaternion &pOther, double pWeight) const
 Calculate a spherical linear interpolation quaternion. More...
 
void ComposeSphericalXYZ (const FbxVector4 pEuler)
 Create a Quaternion equivalent to the supplied Euler XYZ in spherical coordinate. More...
 
FbxVector4 DecomposeSphericalXYZ () const
 Create an Euler XYZ equivalent to the current quaternion. More...
 

Boolean Operations

bool operator== (const FbxQuaternion &pV) const
 Equivalence operator. More...
 
bool operator!= (const FbxQuaternion &pV) const
 Non equivalence operator. More...
 

Casting

 operator double * ()
 Cast the vector in a double pointer. More...
 
 operator const double * () const
 Cast the vector in a const double pointer. More...
 

Comparison methods

int Compare (const FbxQuaternion &pQ2, const double pThreshold=(1.0e-6)) const
 Comparison method. More...
 

Additional Inherited Members

- Public Member Functions inherited from FbxVectorTemplate4< T >
 FbxVectorTemplate4 ()
 
 FbxVectorTemplate4 (T pValue)
 
 FbxVectorTemplate4 (T pData0, T pData1, T pData2, T pData3)
 
 ~FbxVectorTemplate4 ()
 
T & operator[] (int pIndex)
 
const T & operator[] (int pIndex) const
 
 operator FbxVectorTemplate3< T > & () const
 
FbxVectorTemplate4< T > & operator= (const T &pValue)
 
FbxVectorTemplate4< T > & operator= (const FbxVectorTemplate3< T > &pValue)
 
FbxVectorTemplate4< T > & operator= (const FbxVectorTemplate4< T > &pVector)
 
bool operator== (const FbxVectorTemplate4< T > &pVector) const
 
bool operator!= (const FbxVectorTemplate4< T > &pVector) const
 
T * Buffer ()
 
const T * Buffer () const
 
- Public Attributes inherited from FbxVectorTemplate4< T >
mData [4]
 

Constructor & Destructor Documentation

◆ FbxQuaternion() [1/4]

Constructor.

Initialize to the multiplicative identity.

◆ FbxQuaternion() [2/4]

FbxQuaternion ( const FbxQuaternion pV)

Copy constructor.

Parameters
pVFbxQuaternion object copied to this one.

◆ FbxQuaternion() [3/4]

FbxQuaternion ( double  pX,
double  pY,
double  pZ,
double  pW = 1.0 
)

Constructor.

Parameters
pXThe X component.
pYThe Y component.
pZThe Z component.
pWThe W component.

◆ FbxQuaternion() [4/4]

FbxQuaternion ( const FbxVector4 pAxis,
double  pDegree 
)

From axis degree constructor.

Parameters
pAxisThe axis to rotate around.
pDegreeThe amount of degree to rotate around the axis.

◆ ~FbxQuaternion()

Destructor.

Member Function Documentation

◆ operator=()

FbxQuaternion& operator= ( const FbxQuaternion pQuaternion)

Assignment operation.

Parameters
pQuaternionFbxQuaternion object assigned to this one.

◆ operator[]() [1/2]

double& operator[] ( int  pIndex)

Accessor.

Parameters
pIndexThe index of the component to access.
Returns
The reference to the indexed component.
Remarks
The index parameter is not checked for values out of bounds. The valid range is [0,3].

◆ operator[]() [2/2]

const double& operator[] ( int  pIndex) const

Accessor.

Parameters
pIndexThe index of the component to access.
Returns
The const reference to the indexed component.
Remarks
The index parameter is not checked for values out of bounds. The valid range is [0,3].

◆ GetAt()

double GetAt ( int  pIndex) const

Get a vector element.

Parameters
pIndexThe index of the component to access.
Returns
The value of the indexed component.
Remarks
The index parameter is not checked for values out of bounds. The valid range is [0,3].

◆ SetAt()

void SetAt ( int  pIndex,
double  pValue 
)

Set a vector element.

Parameters
pIndexThe index of the component to set.
pValueThe new value to set the component.
Remarks
The index parameter is not checked for values out of bounds. The valid range is [0,3].

◆ Set()

void Set ( double  pX,
double  pY,
double  pZ,
double  pW = 1.0 
)

Set vector.

Parameters
pXThe X component value.
pYThe Y component value.
pZThe Z component value.
pWThe W component value.

◆ operator+() [1/2]

FbxQuaternion operator+ ( double  pValue) const

The addition operator between the scalar part of this quaternion and a scalar value, no influence on the vector part of the quaternion.

Parameters
pValueThe scalar value to be added.
Returns
The sum of addition.

◆ operator-() [1/3]

FbxQuaternion operator- ( double  pValue) const

The subtraction operator between the scalar part of this quaternion and a scalar value, no influence on the vector part of the quaternion.

Parameters
pValueThe scalar subtrahend.
Returns
The difference of subtraction.

◆ operator*() [1/2]

FbxQuaternion operator* ( double  pValue) const

Multiply all vector components by a value.

Parameters
pValueThe value multiplying each component of the vector.
Returns
New vector.
Remarks
The passed value is not checked.

◆ operator/() [1/2]

FbxQuaternion operator/ ( double  pValue) const

Divide all vector components by a value.

Parameters
pValueThe value dividing each component of the vector.
Returns
New vector.
Remarks
The passed value is not checked.

◆ operator+=() [1/2]

FbxQuaternion& operator+= ( double  pValue)

The in place addition operator between the real part of this quaternion and a scalar value.

Parameters
pValueThe value to be added.
Returns
The sum of addition.

◆ operator-=() [1/2]

FbxQuaternion& operator-= ( double  pValue)

The subtraction operator between the real part of this quaternion and a scalar value.

Parameters
pValueThe scalar subtrahend.
Returns
The difference of subtraction.

◆ operator*=() [1/2]

FbxQuaternion& operator*= ( double  pValue)

Multiply a value to all vector elements.

Parameters
pValueThe value multiplying each component of the vector.
Returns
The result of multiplying each component of the vector by pValue, replacing this quaternion.
Remarks
The passed value is not checked.

◆ operator/=() [1/2]

FbxQuaternion& operator/= ( double  pValue)

Divide all vector elements by a value.

Parameters
pValueThe value dividing each component of the vector.
Returns
The result of dividing each component of the vector by pValue, replacing this quaternion.
Remarks
The passed value is not checked.

◆ operator-() [2/3]

FbxQuaternion operator- ( ) const

Unary minus operator.

Returns
A quaternion where each component is multiplied by -1.

◆ operator+() [2/2]

FbxQuaternion operator+ ( const FbxQuaternion pQuaternion) const

Add two vectors together.

Parameters
pQuaternionQuaternion to add.
Returns
The quaternion v' = this + pQuaternion.
Remarks
The values in pQuaternion are not checked.

◆ operator-() [3/3]

FbxQuaternion operator- ( const FbxQuaternion pQuaternion) const

Subtract a quaternion from another quaternion.

Parameters
pQuaternionQuaternion to subtract.
Returns
The quaternion v' = this - pQuaternion.
Remarks
The values in pQuaternion are not checked.

◆ operator*() [2/2]

FbxQuaternion operator* ( const FbxQuaternion pOther) const

The quaternion multiplication operator.

Parameters
pOtherThe quaternion to be multiplied with this quaternion.
Returns
The product of two quaternions.
Remarks
In general, quaternion multiplication does not commute.

◆ operator/() [2/2]

FbxQuaternion operator/ ( const FbxQuaternion pOther) const

The quaternion division operator.

Parameters
pOtherThe divisor quaternion.
Returns
The quotient quaternion.
Remarks
If the divisor has a zero length, return zero quaternion.

◆ operator+=() [2/2]

FbxQuaternion& operator+= ( const FbxQuaternion pQuaternion)

Add two quaternions together.

Parameters
pQuaternionQuaternion to add.
Returns
The quaternion v' = this + pQuaternion, replacing this quaternion.
Remarks
The values in pQuaternion are not checked.

◆ operator-=() [2/2]

FbxQuaternion& operator-= ( const FbxQuaternion pQuaternion)

Subtract a quaternion from another vector.

Parameters
pQuaternionQuaternion to subtract.
Returns
The quaternion v' = this - pQuaternion, replacing this quaternion.
Remarks
The values in pQuaternion are not checked.

◆ operator*=() [2/2]

FbxQuaternion& operator*= ( const FbxQuaternion pOther)

The in place quaternion multiplication operator.

Parameters
pOtherThe quaternion to be multiplied with this quaternion.
Returns
The product of two quaternions.
Remarks
In general, quaternion multiplication does not commute.

◆ operator/=() [2/2]

FbxQuaternion& operator/= ( const FbxQuaternion pOther)

The in place quaternion division operator.

Parameters
pOtherThe divisor quaternion.
Returns
The quotient quaternion.
Remarks
If the divisor has a zero length, return zero quaternion.

◆ Product()

FbxQuaternion Product ( const FbxQuaternion pOther) const

Return quaternion product.

Parameters
pOtherThe quaternion to be multiplied with this quaternion.
Returns
The product of two quaternions.

◆ DotProduct()

double DotProduct ( const FbxQuaternion pQuaternion) const

Return quaternion dot product.

Parameters
pQuaternionDot product quaternion.
Returns
The dot product of this quaternion and pQuaternion.
Examples:
ViewScene/DrawScene.cxx.

◆ Normalize()

void Normalize ( )

Normalize the quaternion, length set to 1.

◆ Conjugate()

void Conjugate ( )

Calculate the quaternion conjugate.

Returns
The conjugate of this quaternion.

◆ Length()

double Length ( )

Calculate the length (norm) of the quaternion.

Returns
The length of the quaternion.

◆ Inverse()

void Inverse ( )

Calculate the inverse of the quaternion.

Returns
The inverse of this quaternion.
Remarks
If this quaternion has a zero length, retain the original value.
If the quaternion is normalized, then its inverse is equal to its conjugate.

◆ SetAxisAngle()

void SetAxisAngle ( const FbxVector4 pAxis,
double  pDegree 
)

Set the quaternion rotation from an axis degree angle.

Parameters
pAxisThe axis to rotate around.
pDegreeThe amount of degree to rotate around the axis.

◆ Slerp()

FbxQuaternion Slerp ( const FbxQuaternion pOther,
double  pWeight 
) const

Calculate a spherical linear interpolation quaternion.

Parameters
pOtherThe other quaternion to interpolate with.
pWeightA value between 0.0 and 1.0 to specify the interpolation amount.

◆ ComposeSphericalXYZ()

void ComposeSphericalXYZ ( const FbxVector4  pEuler)

Create a Quaternion equivalent to the supplied Euler XYZ in spherical coordinate.

Parameters
pEulerThe Euler XYZ angle (in degrees).

◆ DecomposeSphericalXYZ()

FbxVector4 DecomposeSphericalXYZ ( ) const

Create an Euler XYZ equivalent to the current quaternion.

Returns
The Euler XYZ angle (in degrees) equivalent to the current quaternion in spherical coordinate.

◆ operator==()

bool operator== ( const FbxQuaternion pV) const

Equivalence operator.

Parameters
pVThe quaternion to be compared to this quaternion.
Returns
true if the two quaternions are equal (each element is within a FBXSDK_TOLERANCE tolerance), false otherwise.

◆ operator!=()

bool operator!= ( const FbxQuaternion pV) const

Non equivalence operator.

Parameters
pVThe quaternion to be compared to this.
Returns
false if the two quaternions are equal (each element is within a FBXSDK_TOLERANCE tolerance), true otherwise.

◆ operator double *()

operator double * ( )

Cast the vector in a double pointer.

◆ operator const double *()

operator const double * ( ) const

Cast the vector in a const double pointer.

◆ Compare()

int Compare ( const FbxQuaternion pQ2,
const double  pThreshold = (1.0e-6) 
) const

Comparison method.

Parameters
pQ2Quaternion to compare with this
pThresholdEpsilon for small number comparison
Returns
0 if quaternions are equal, non-zero value otherwise.

The documentation for this class was generated from the following file: