FBX C++ API Reference
FbxVector4 Class Reference

#include <fbxvector4.h>

Class Description

+ Inheritance diagram for FbxVector4:

Public Member Functions

bool IsZero (int pSize=4) const
 Find out if the vector is equal to zero. More...
 
void FixIncorrectValue ()
 
- 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
 

Constructors and Destructor

 FbxVector4 ()
 Constructor. More...
 
 FbxVector4 (const FbxVector4 &pVector4)
 Copy constructor. More...
 
 FbxVector4 (double pX, double pY, double pZ, double pW=1.0)
 Constructor. More...
 
 FbxVector4 (const double pValue[4])
 Constructor. More...
 
 FbxVector4 (const FbxDouble3 &pValue)
 Constructor. More...
 

Access

FbxVector4operator= (const FbxVector4 &pVector4)
 Assignment operation. More...
 
FbxVector4operator= (const double *pValue)
 Assignment operation. More...
 
FbxVector4operator= (const FbxDouble3 &pValue)
 Assignment operation. More...
 
void Set (double pX, double pY, double pZ, double pW=1.0)
 Set vector. More...
 

Scalar Operations

FbxVector4 operator+ (double pValue) const
 Add a value to all vector components. More...
 
FbxVector4 operator- (double pValue) const
 Subtract a value from all vector components. More...
 
FbxVector4 operator* (double pValue) const
 Multiply a value to all vector components. More...
 
FbxVector4 operator/ (double pValue) const
 Divide all vector components by a value. More...
 
FbxVector4operator+= (double pValue)
 Add a value to all vector components. More...
 
FbxVector4operator-= (double pValue)
 Subtract a value from all vector components. More...
 
FbxVector4operator*= (double pValue)
 Multiply a value to all vector elements. More...
 
FbxVector4operator/= (double pValue)
 Divide all vector elements by a value. More...
 

Vector Operations

FbxVector4 operator- () const
 Unary minus operator. More...
 
FbxVector4 operator+ (const FbxVector4 &pVector) const
 Add two vectors together. More...
 
FbxVector4 operator- (const FbxVector4 &pVector) const
 Subtract a vector from another vector. More...
 
FbxVector4 operator* (const FbxVector4 &pVector) const
 Memberwise multiplication of two vectors. More...
 
FbxVector4 operator/ (const FbxVector4 &pVector) const
 Memberwise division of a vector with another vector. More...
 
FbxVector4operator+= (const FbxVector4 &pVector)
 Add two vectors together. More...
 
FbxVector4operator-= (const FbxVector4 &pVector)
 Subtract a vector from another vector. More...
 
FbxVector4operator*= (const FbxVector4 &pVector)
 Memberwise multiplication of two vectors. More...
 
FbxVector4operator/= (const FbxVector4 &pVector)
 Memberwise division of a vector with another vector. More...
 
double DotProduct (const FbxVector4 &pVector) const
 Calculate the dot product of two vectors. More...
 
FbxVector4 CrossProduct (const FbxVector4 &pVector) const
 Calculate the cross product of two vectors. More...
 
static bool AxisAlignmentInEulerAngle (const FbxVector4 &pAB, const FbxVector4 &pA, const FbxVector4 &pB, FbxVector4 &pAngles)
 Calculate the Euler rotation required to align axis pAB-pA on pAB-pB. More...
 

Boolean Operations

bool operator== (const FbxVector4 &pVector) const
 Equivalence operator. More...
 
bool operator!= (const FbxVector4 &pVector) const
 Non equivalence operator. More...
 

Length

double Length () const
 Get the vector's length. More...
 
double SquareLength () const
 Get the vector's length squared. More...
 
double Distance (const FbxVector4 &pVector) const
 Find the distance between 2 vectors. More...
 
void Normalize ()
 Normalize the vector, length set to 1. More...
 
void SetXYZ (const FbxQuaternion pQuat)
 Set the Euler XYZ from a Quaternion. 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...
 

Additional Inherited Members

- Public Attributes inherited from FbxVectorTemplate4< T >
mData [4]
 

Constructor & Destructor Documentation

◆ FbxVector4() [1/5]

Constructor.

◆ FbxVector4() [2/5]

FbxVector4 ( const FbxVector4 pVector4)

Copy constructor.

Parameters
pVector4The vector copied to this one.

◆ FbxVector4() [3/5]

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

Constructor.

Parameters
pXX component.
pYY component.
pZZ component.
pWW component.

◆ FbxVector4() [4/5]

FbxVector4 ( const double  pValue[4])

Constructor.

Parameters
pValueX,Y,Z,W components.

◆ FbxVector4() [5/5]

FbxVector4 ( const FbxDouble3 pValue)

Constructor.

Parameters
pValueX,Y,Z components.
Remarks
The fourth component of this object is assigned 1.

Member Function Documentation

◆ operator=() [1/3]

FbxVector4& operator= ( const FbxVector4 pVector4)

Assignment operation.

Parameters
pVector4The vector assigned to this one.
Returns
This vector after assignment.

◆ operator=() [2/3]

FbxVector4& operator= ( const double *  pValue)

Assignment operation.

Parameters
pValueThe pointer to an array whose elements are assigned to this vector.
Returns
This vector after assignment.

◆ operator=() [3/3]

FbxVector4& operator= ( const FbxDouble3 pValue)

Assignment operation.

Parameters
pValueThe vector with 3 elements assigned to this vector.
Returns
This vector after assignment.
Remarks
The first three elements are assigned with pValue. The fourth element is set as 1.0

◆ 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.
Examples:
ExportScene01/main.cxx, ExportScene02/main.cxx, and ExportScene05/main.cxx.

◆ operator+() [1/2]

FbxVector4 operator+ ( double  pValue) const

Add a value to all vector components.

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

◆ operator-() [1/3]

FbxVector4 operator- ( double  pValue) const

Subtract a value from all vector components.

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

◆ operator*() [1/2]

FbxVector4 operator* ( double  pValue) const

Multiply a value to all vector components.

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

◆ operator/() [1/2]

FbxVector4 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]

FbxVector4& operator+= ( double  pValue)

Add a value to all vector components.

Parameters
pValueThe value to add to each component of the vector.
Returns
this updated with the operation result.
Remarks
The passed value is not checked.

◆ operator-=() [1/2]

FbxVector4& operator-= ( double  pValue)

Subtract a value from all vector components.

Parameters
pValueThe value to subtract from each component of the vector.
Returns
this updated with the operation result.
Remarks
The passed value is not checked.

◆ operator*=() [1/2]

FbxVector4& operator*= ( double  pValue)

Multiply a value to all vector elements.

Parameters
pValueThe value multiplying each component of the vector.
Returns
this updated with the operation result.
Remarks
The passed value is not checked.

◆ operator/=() [1/2]

FbxVector4& operator/= ( double  pValue)

Divide all vector elements by a value.

Parameters
pValueThe value dividing each component of the vector.
Returns
this updated with the operation result.
Remarks
The passed value is not checked.

◆ operator-() [2/3]

FbxVector4 operator- ( ) const

Unary minus operator.

Returns
The vector that is the negation of this.

◆ operator+() [2/2]

FbxVector4 operator+ ( const FbxVector4 pVector) const

Add two vectors together.

Parameters
pVectorVector to add.
Returns
The vector v' = this + pVector.
Remarks
The values in pVector are not checked.

◆ operator-() [3/3]

FbxVector4 operator- ( const FbxVector4 pVector) const

Subtract a vector from another vector.

Parameters
pVectorVector to subtract.
Returns
The vector v' = this - pVector.
Remarks
The values in pVector are not checked.

◆ operator*() [2/2]

FbxVector4 operator* ( const FbxVector4 pVector) const

Memberwise multiplication of two vectors.

Parameters
pVectorMultiplying vector.
Returns
The vector v' = this * pVector.
Remarks
The values in pVector are not checked.

◆ operator/() [2/2]

FbxVector4 operator/ ( const FbxVector4 pVector) const

Memberwise division of a vector with another vector.

Parameters
pVectorDividing vector.
Returns
The vector v[i]' = this[i] / pVector[i].
Remarks
The values in pVector are not checked.

◆ operator+=() [2/2]

FbxVector4& operator+= ( const FbxVector4 pVector)

Add two vectors together.

Parameters
pVectorVector to add.
Returns
this updated with the operation result.
Remarks
The values in pVector are not checked.

◆ operator-=() [2/2]

FbxVector4& operator-= ( const FbxVector4 pVector)

Subtract a vector from another vector.

Parameters
pVectorVector to subtract.
Returns
this updated with the operation result.
Remarks
The values in pVector are not checked.

◆ operator*=() [2/2]

FbxVector4& operator*= ( const FbxVector4 pVector)

Memberwise multiplication of two vectors.

Parameters
pVectorMultiplying vector.
Returns
this updated with the operation result.
Remarks
The values in pVector are not checked.

◆ operator/=() [2/2]

FbxVector4& operator/= ( const FbxVector4 pVector)

Memberwise division of a vector with another vector.

Parameters
pVectorDividing vector.
Returns
this updated with the operation result.
Remarks
The values in pVector are not checked.

◆ DotProduct()

double DotProduct ( const FbxVector4 pVector) const

Calculate the dot product of two vectors.

Parameters
pVectorThe second vector.
Returns
The dot product value.
Remarks
Being considered as a XYZ vector with a weight, only the 3 first elements are considered in this operation.

◆ CrossProduct()

FbxVector4 CrossProduct ( const FbxVector4 pVector) const

Calculate the cross product of two vectors.

Parameters
pVectorThe second vector.
Returns
The cross product vector.
Remarks
Being considered as a XYZ vector with a weight, only the first 3 elements are considered in this operation.
Examples:
ViewScene/SetCamera.cxx.

◆ AxisAlignmentInEulerAngle()

static bool AxisAlignmentInEulerAngle ( const FbxVector4 pAB,
const FbxVector4 pA,
const FbxVector4 pB,
FbxVector4 pAngles 
)
static

Calculate the Euler rotation required to align axis pAB-pA on pAB-pB.

Parameters
pABThe intersection of the 2 axis.
pAA point on axis to be aligned.
pBA point on reference axis.
pAnglesResulting euler angles.
Returns
true on success.
Remarks
Being considered as a XYZ vector with a weight, only the first 3 elements are considered in this operation.
Examples:
ExportScene04/main.cxx, and ViewScene/DrawScene.cxx.

◆ operator==()

bool operator== ( const FbxVector4 pVector) const

Equivalence operator.

Parameters
pVectorThe vector to be compared to this.
Returns
true if the two vectors are equal (each element is within a FBXSDK_TOLERANCE tolerance) and false otherwise.

◆ operator!=()

bool operator!= ( const FbxVector4 pVector) const

Non equivalence operator.

Parameters
pVectorThe vector to be compared to this.
Returns
false if the two vectors are equal (each element is within a FBXSDK_TOLERANCE tolerance) and true otherwise.

◆ Length()

double Length ( ) const

Get the vector's length.

Returns
The mathematical length of the vector.
Remarks
Being considered as a XYZ vector with a weight, only the first 3 elements are considered in this operation.
Examples:
ViewScene/SetCamera.cxx.

◆ SquareLength()

double SquareLength ( ) const

Get the vector's length squared.

Returns
The mathematical square length of the vector.
Remarks
Being considered as a XYZ vector with a weight, only the first 3 elements are considered in this operation.

◆ Distance()

double Distance ( const FbxVector4 pVector) const

Find the distance between 2 vectors.

Parameters
pVectorThe second vector.
Returns
The mathematical distance between the two vectors.
Remarks
Being considered as a XYZ vector with a weight, only the 3 first elements are considered in this operation.

◆ Normalize()

void Normalize ( )

Normalize the vector, length set to 1.

Remarks
Being considered as a XYZ vector with a weight, only the first 3 elements are considered in this operation.
Examples:
ViewScene/SetCamera.cxx.

◆ SetXYZ()

void SetXYZ ( const FbxQuaternion  pQuat)

Set the Euler XYZ from a Quaternion.

Parameters
pQuatQuaternion from which Euler XYZ information is got.

◆ 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.

◆ IsZero()

bool IsZero ( int  pSize = 4) const

Find out if the vector is equal to zero.

Parameters
pSizeThe number of element to test, starting at beginning. Value must range between [1, 4].
Returns
true if all elements of the vector are zero, false otherwise.

◆ FixIncorrectValue()

void FixIncorrectValue ( )

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