FBX C++ API Reference
|
#include <fbxaxissystem.h>
This class represents the coordinate system of the scene and can convert scenes to other coordinate systems.
By default the FbxScene uses a Y-Up axis system. If the calling application wishes to change the default axis it will need to define the new axis system and call the convert method with the scene as argument. The appropriate transforms will be applied to the first level objects of the scene only (objects whose parent is the scene itself). Child objects do not need to be transformed since they inherit from their parents. The adjustment will affect the translation animation curves and the objects pivots values (the rotation transformation is applied as a pre-rotation transform therefore the rotation animation curves do not need to be transformed). Once converted, the scene will have its axis definition changed to the new system.
For example:
No conversion will take place if the scene current axis system is equal to the new one.
The EUpVector specifies which axis has the up and down direction in the system (typically this is the Y or Z axis). The sign of the EUpVector is applied to represent the direction (1 is up and -1 is down relative to the observer).
The EFrontVector specifies which axis has the front and back direction in the system. It is not an independent variable, which means it depends on EUpVector. The enum values ParityEven and ParityOdd denote the first one and the second one of the remain two axes in addition to the up axis.
For example if the up axis is X, the remain two axes will be Y And Z, so the ParityEven is Y, and the ParityOdd is Z ; If the up axis is Y, the remain two axes will X And Z, so the ParityEven is X, and the ParityOdd is Z; If the up axis is Z, the remain two axes will X And Y, so the ParityEven is X, and the ParityOdd is Y.
There still needs a parameter to denote the direction of the EFrontVector just as the EUpVector. And the sign of the EFrontVector represents the direction (1 is front and -1 is back relative to observer).
If the front axis and the up axis are determined, the third axis will be automatically determined as the left one. The ECoordSystem enum is a parameter to determine the direction of the third axis just as the EUpVector sign. It determines if the axis system is right-handed or left-handed just as the enum values.
Some code for reconstructing a FbxAxisSystem object from reference scene.
Definition at line 97 of file fbxaxissystem.h.
Public Types | |
enum | EUpVector { eXAxis = 1, eYAxis = 2, eZAxis = 3 } |
Specifies which canonical axis represents up in the system (typically Y or Z). More... | |
enum | EFrontVector { eParityEven = 1, eParityOdd = 2 } |
Vector with origin at the screen pointing toward the camera. More... | |
enum | ECoordSystem { eRightHanded, eLeftHanded } |
Specifies the third vector of the system. More... | |
enum | EPreDefinedAxisSystem { eMayaZUp, eMayaYUp, eMax, eMotionBuilder, eOpenGL, eDirectX, eLightwave } |
Enumeration that can be used to initialize a new instance of this class with predefined configurations (see the "Predefined axis systems" section). More... | |
Public Member Functions | |
FbxAxisSystem & | operator= (const FbxAxisSystem &pAxisSystem) |
Assignment operation. More... | |
void | ConvertScene (FbxScene *pScene) const |
Convert a scene to this axis system. More... | |
void | ConvertScene (FbxScene *pScene, FbxNode *pFbxRoot) const |
Convert a scene to this axis system by using the specified node as an Fbx_Root. More... | |
EFrontVector | GetFrontVector (int &pSign) const |
Get the EFrontVector and its sign of this axis system. More... | |
EUpVector | GetUpVector (int &pSign) const |
Get the EUpVector and its sign of this axis system. More... | |
ECoordSystem | GetCoorSystem () const |
Accessor to the ECoordSystem of this object. More... | |
void | GetMatrix (FbxAMatrix &pMatrix) |
Represents the axis system as a 4x4 matrix. More... | |
void | ConvertChildren (FbxNode *pRoot, const FbxAxisSystem &pSrcSystem) const |
Converts the children of the given node to this axis system. More... | |
Constructor and Destructor | |
FbxAxisSystem () | |
FbxAxisSystem (EUpVector pUpVector, EFrontVector pFrontVector, ECoordSystem pCoorSystem) | |
Constructor! More... | |
FbxAxisSystem (const FbxAxisSystem &pAxisSystem) | |
Copy constructor! More... | |
FbxAxisSystem (const EPreDefinedAxisSystem pAxisSystem) | |
Constructor! More... | |
virtual | ~FbxAxisSystem () |
Destructor. More... | |
Boolean operation. | |
bool | operator== (const FbxAxisSystem &pAxisSystem) const |
Equivalence operator. More... | |
bool | operator!= (const FbxAxisSystem &pAxisSystem) const |
Non-equivalence operator. More... | |
Predefined axis systems. | |
These static members define the axis system of the most popular applications. | |
static const FbxAxisSystem | MayaZUp |
Predefined axis system: MayaZUp (UpVector = +Z, FrontVector = -Y, CoordSystem = +X (RightHanded)) More... | |
static const FbxAxisSystem | MayaYUp |
Predefined axis system: MayaYUp (UpVector = +Y, FrontVector = +Z, CoordSystem = +X (RightHanded)) More... | |
static const FbxAxisSystem | Max |
Predefined axis system: Max (UpVector = +Z, FrontVector = -Y, CoordSystem = +X (RightHanded)) More... | |
static const FbxAxisSystem | Motionbuilder |
Predefined axis system: Motionbuilder (UpVector = +Y, FrontVector = +Z, CoordSystem = +X (RightHanded)) More... | |
static const FbxAxisSystem | OpenGL |
Predefined axis system: OpenGL (UpVector = +Y, FrontVector = +Z, CoordSystem = +X (RightHanded)) More... | |
static const FbxAxisSystem | DirectX |
Predefined axis system: DirectX (UpVector = +Y, FrontVector = +Z, CoordSystem = -X (LeftHanded)) More... | |
static const FbxAxisSystem | Lightwave |
Predefined axis system: Lightwave (UpVector = +Y, FrontVector = +Z, CoordSystem = -X (LeftHanded)) More... | |
enum EUpVector |
Specifies which canonical axis represents up in the system (typically Y or Z).
Enumerator | |
---|---|
eXAxis | |
eYAxis | |
eZAxis |
Definition at line 103 of file fbxaxissystem.h.
enum EFrontVector |
Vector with origin at the screen pointing toward the camera.
This is a subset of enum EUpVector because axis cannot be repeated. We use the system of "parity" to define this vector because its value (X,Y or Z axis) really depends on the up-vector. The EPreDefinedAxisSystem list the up-vector, parity and coordinate system values for the predefined systems.
Enumerator | |
---|---|
eParityEven | |
eParityOdd |
Definition at line 117 of file fbxaxissystem.h.
enum ECoordSystem |
Specifies the third vector of the system.
The FbxAxisSystem deduces the correct vector and direction based on this flag and the relationship with the up and front vectors. The EPreDefinedAxisSystem list the up-vector, parity and coordinate system values for the predefined systems.
Enumerator | |
---|---|
eRightHanded | |
eLeftHanded |
Definition at line 128 of file fbxaxissystem.h.
Enumeration that can be used to initialize a new instance of this class with predefined configurations (see the "Predefined axis systems" section).
Definition at line 137 of file fbxaxissystem.h.
FbxAxisSystem | ( | ) |
FbxAxisSystem | ( | EUpVector | pUpVector, |
EFrontVector | pFrontVector, | ||
ECoordSystem | pCoorSystem | ||
) |
Constructor!
pUpVector | Specify the up vector. |
pFrontVector | Specify the front vector. |
pCoorSystem | Specify RightHanded coordinate system or LeftHanded coordinate system. |
FbxAxisSystem | ( | const FbxAxisSystem & | pAxisSystem | ) |
Copy constructor!
pAxisSystem | Another FbxAxisSystem object copied to this one. |
FbxAxisSystem | ( | const EPreDefinedAxisSystem | pAxisSystem | ) |
Constructor!
pAxisSystem | Specify which predefined axis system to copy. |
|
virtual |
Destructor.
bool operator== | ( | const FbxAxisSystem & | pAxisSystem | ) | const |
Equivalence operator.
pAxisSystem | The axis system to compare against this one. |
true
if these two axis systems are equal, false
otherwise. bool operator!= | ( | const FbxAxisSystem & | pAxisSystem | ) | const |
Non-equivalence operator.
pAxisSystem | The axis system to compare against this one. |
true
if these two axis systems are unequal, false
otherwise. FbxAxisSystem& operator= | ( | const FbxAxisSystem & | pAxisSystem | ) |
Assignment operation.
pAxisSystem | Axis system assigned to this one. |
void ConvertScene | ( | FbxScene * | pScene | ) | const |
Convert a scene to this axis system.
Sets the axis system of the scene to this system unit.
pScene | The scene to convert |
Convert a scene to this axis system by using the specified node as an Fbx_Root.
This is provided for backwards compatibility only and ConvertScene(FbxScene* pScene) should be used instead when possible.
pScene | The scene to convert |
pFbxRoot | The Fbx_Root node that will be transformed. |
EFrontVector GetFrontVector | ( | int & | pSign | ) | const |
Get the EFrontVector and its sign of this axis system.
pSign | The sign of the axis, 1 for front, -1 for back (relative to observer). |
EUpVector GetUpVector | ( | int & | pSign | ) | const |
Get the EUpVector and its sign of this axis system.
pSign | The sign of the axis, 1 for up, -1 for down (relative to observer). |
ECoordSystem GetCoorSystem | ( | ) | const |
Accessor to the ECoordSystem of this object.
void GetMatrix | ( | FbxAMatrix & | pMatrix | ) |
Represents the axis system as a 4x4 matrix.
void ConvertChildren | ( | FbxNode * | pRoot, |
const FbxAxisSystem & | pSrcSystem | ||
) | const |
Converts the children of the given node to this axis system.
Unlike the ConvertScene() method, this method does not set the axis system of the scene that the pRoot node belongs, nor does it adjust FbxPose as they are not stored under the scene, and not under a particular node.
pRoot | The node whose children are converted. |
pSrcSystem | The source axis system. |
|
static |
Predefined axis system: MayaZUp (UpVector = +Z, FrontVector = -Y, CoordSystem = +X (RightHanded))
Definition at line 205 of file fbxaxissystem.h.
|
static |
Predefined axis system: MayaYUp (UpVector = +Y, FrontVector = +Z, CoordSystem = +X (RightHanded))
Definition at line 208 of file fbxaxissystem.h.
|
static |
Predefined axis system: Max (UpVector = +Z, FrontVector = -Y, CoordSystem = +X (RightHanded))
Definition at line 211 of file fbxaxissystem.h.
|
static |
Predefined axis system: Motionbuilder (UpVector = +Y, FrontVector = +Z, CoordSystem = +X (RightHanded))
Definition at line 214 of file fbxaxissystem.h.
|
static |
Predefined axis system: OpenGL (UpVector = +Y, FrontVector = +Z, CoordSystem = +X (RightHanded))
Definition at line 217 of file fbxaxissystem.h.
|
static |
Predefined axis system: DirectX (UpVector = +Y, FrontVector = +Z, CoordSystem = -X (LeftHanded))
Definition at line 220 of file fbxaxissystem.h.
|
static |
Predefined axis system: Lightwave (UpVector = +Y, FrontVector = +Z, CoordSystem = -X (LeftHanded))
Definition at line 223 of file fbxaxissystem.h.