#include <MeshDeformerStack.h>
Inherits EMotionFX::BaseObject.
Public Member Functions | |
void | Update (ActorInstance *actor, Node *node, float timeDelta, bool forceUpdateDisabledDeformers=false) |
void | UpdateByModifierType (ActorInstance *actorInstance, Node *node, float timeDelta, uint32 typeID, bool resetMesh, bool forceUpdateDisabledDeformers) |
void | ReinitializeDeformers (Actor *actor, Node *node, size_t lodLevel) |
void | AddDeformer (MeshDeformer *meshDeformer) |
void | InsertDeformer (size_t pos, MeshDeformer *meshDeformer) |
bool | RemoveDeformer (MeshDeformer *meshDeformer) |
size_t | RemoveAllDeformersByType (uint32 deformerTypeID) |
void | RemoveAllDeformers () |
size_t | EnableAllDeformersByType (uint32 deformerTypeID, bool enabled) |
MeshDeformerStack * | Clone (Mesh *mesh) |
Mesh * | GetMesh () const |
size_t | GetNumDeformers () const |
MeshDeformer * | GetDeformer (size_t nr) const |
bool | CheckIfHasDeformerOfType (uint32 deformerTypeID) const |
MeshDeformer * | FindDeformerByType (uint32 deformerTypeID, size_t occurrence=0) const |
Public Member Functions inherited from EMotionFX::BaseObject | |
BaseObject () | |
virtual | ~BaseObject () |
Public Member Functions inherited from MCore::MemoryObject | |
MemoryObject () | |
virtual | ~MemoryObject () |
void | IncreaseReferenceCount () |
void | DecreaseReferenceCount () |
void | Destroy () |
uint32 | GetReferenceCount () const |
Static Public Member Functions | |
static MeshDeformerStack * | Create (Mesh *mesh) |
Additional Inherited Members | |
Protected Member Functions inherited from EMotionFX::BaseObject | |
void | Delete () override |
virtual void | Delete () |
The mesh deformer stack. This class represents a stack of mesh deformers, which are executed on a given mesh in the order defined by the stack. The deformers will be executed from bottom to the top. An example stack could be:
This would first perform a morph on the given mesh. After that a softskinning deformer would be applied to it, using bone deformations. And finally the result of that would be deformed by a twist modifier, which would twist the mesh. People who know 3D Studio Max will recognise this system as the Max Modifier Stack.
void EMotionFX::MeshDeformerStack::AddDeformer | ( | MeshDeformer * | meshDeformer | ) |
Add a given deformer to the back of the stack.
meshDeformer | The deformer to add. |
bool EMotionFX::MeshDeformerStack::CheckIfHasDeformerOfType | ( | uint32 | deformerTypeID | ) | const |
Check if the stack contains a deformer of a given type.
deformerTypeID | The type ID of the deformer you'd like to check. |
MeshDeformerStack * EMotionFX::MeshDeformerStack::Clone | ( | Mesh * | mesh | ) |
Creates an exact clone (copy) of this deformer stack, including all deformers (which will also be cloned).
mesh | The mesh to apply the new stack on. |
|
static |
Creation method.
mesh | The mesh to apply this deformer on. |
size_t EMotionFX::MeshDeformerStack::EnableAllDeformersByType | ( | uint32 | deformerTypeID, |
bool | enabled | ||
) |
Enable or disable all the deformers with the specified type ID. You can use this to for example disable all softskin deformers.
deformerTypeID | The type ID of the deformer, which is returned by MeshDeformer::GetType(). |
enabled | Set to true when you want to enable these deformers, or false if you want to disable them. |
MeshDeformer * EMotionFX::MeshDeformerStack::FindDeformerByType | ( | uint32 | deformerTypeID, |
size_t | occurrence = 0 |
||
) | const |
Find a mesh deformer of a given type as returned by MeshDeformer::GetType().
deformerTypeID | The mesh deformer type to search for. |
occurrence | In case there are multiple controllers of the same type, 0 means it returns the first one, 1 means the second, etc. |
MeshDeformer * EMotionFX::MeshDeformerStack::GetDeformer | ( | size_t | nr | ) | const |
Get a given deformer.
nr | The deformer number to get. |
Mesh * EMotionFX::MeshDeformerStack::GetMesh | ( | ) | const |
Returns the mesh we are applying the stack on.
size_t EMotionFX::MeshDeformerStack::GetNumDeformers | ( | ) | const |
Get the number of deformers in the stack.
void EMotionFX::MeshDeformerStack::InsertDeformer | ( | size_t | pos, |
MeshDeformer * | meshDeformer | ||
) |
Insert a given deformer at a given position in the deformer stack.
pos | The position to insert the deformer. |
meshDeformer | The deformer to store at this position. |
void EMotionFX::MeshDeformerStack::ReinitializeDeformers | ( | Actor * | actor, |
Node * | node, | ||
size_t | lodLevel | ||
) |
Iterates through all mesh deformers in the stack and reinitializes them.
actor | The actor that will use the mesh deformers. |
node | The node to use for the reinitialize, so the node where the mesh belongs to during this initialization. |
lodLevel | The LOD level the mesh deformers work on. |
void EMotionFX::MeshDeformerStack::RemoveAllDeformers | ( | ) |
Remove all deformers from this mesh deformer stack.
size_t EMotionFX::MeshDeformerStack::RemoveAllDeformersByType | ( | uint32 | deformerTypeID | ) |
Remove all deformers from this mesh deformer stack that have a specified type ID. So you can use this to for example delete all softskin deformers.
deformerTypeID | The type ID of the deformer, which is returned by MeshDeformer::GetType(). |
bool EMotionFX::MeshDeformerStack::RemoveDeformer | ( | MeshDeformer * | meshDeformer | ) |
Remove a given deformer.
meshDeformer | The item/element to remove. |
void EMotionFX::MeshDeformerStack::Update | ( | ActorInstance * | actor, |
Node * | node, | ||
float | timeDelta, | ||
bool | forceUpdateDisabledDeformers = false |
||
) |
Update the stack calling the mesh deformers.
actor | The actor instance to use for the update. So the actor instance where the stack belongs to during this update. |
node | The node to use for the update, so the node where the mesh belongs to during this update. |
timeDelta | The time (in seconds) passed since the last call. |
forceUpdateDisabledDeformers | When set to true this will force updating disabled deformers. |
void EMotionFX::MeshDeformerStack::UpdateByModifierType | ( | ActorInstance * | actorInstance, |
Node * | node, | ||
float | timeDelta, | ||
uint32 | typeID, | ||
bool | resetMesh, | ||
bool | forceUpdateDisabledDeformers | ||
) |
Update the stack calling the mesh morph deformers.
actor | The actor instance to use for the update. So the actor instance where the stack belongs to during this update. |
node | The node to use for the update, so the node where the mesh belongs to during this update. |
timeDelta | The time (in seconds) passed since the last call. |
typeID | The type of the deformer you wish to apply. |
resetMesh | Should the mesh be reset before this deformer or not. |
forceUpdateDisabledDeformers | When set to true this will force updating disabled deformers. |