Open 3D Engine EMotionFX Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
EMotionFX::MeshDeformerStack Class Reference

#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)
 
MeshDeformerStackClone (Mesh *mesh)
 
MeshGetMesh () const
 
size_t GetNumDeformers () const
 
MeshDeformerGetDeformer (size_t nr) const
 
bool CheckIfHasDeformerOfType (uint32 deformerTypeID) const
 
MeshDeformerFindDeformerByType (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 MeshDeformerStackCreate (Mesh *mesh)
 

Additional Inherited Members

- Protected Member Functions inherited from EMotionFX::BaseObject
void Delete () override
 
virtual void Delete ()
 

Detailed Description

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:

  • Twist deformer
  • SoftSkin deformer
  • Morph deformer

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.

Member Function Documentation

◆ AddDeformer()

void EMotionFX::MeshDeformerStack::AddDeformer ( MeshDeformer meshDeformer)

Add a given deformer to the back of the stack.

Parameters
meshDeformerThe deformer to add.

◆ CheckIfHasDeformerOfType()

bool EMotionFX::MeshDeformerStack::CheckIfHasDeformerOfType ( uint32  deformerTypeID) const

Check if the stack contains a deformer of a given type.

Parameters
deformerTypeIDThe type ID of the deformer you'd like to check.
Returns
Returns true when the stack has one or more deformers of the specified type, otherwise false is returned.

◆ Clone()

MeshDeformerStack * EMotionFX::MeshDeformerStack::Clone ( Mesh mesh)

Creates an exact clone (copy) of this deformer stack, including all deformers (which will also be cloned).

Parameters
meshThe mesh to apply the new stack on.
Returns
A pointer to the cloned stack.

◆ Create()

static MeshDeformerStack * EMotionFX::MeshDeformerStack::Create ( Mesh mesh)
static

Creation method.

Parameters
meshThe mesh to apply this deformer on.

◆ EnableAllDeformersByType()

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.

Parameters
deformerTypeIDThe type ID of the deformer, which is returned by MeshDeformer::GetType().
enabledSet to true when you want to enable these deformers, or false if you want to disable them.
Returns
Returns the number of deformers that have been enabled or disabled.

◆ FindDeformerByType()

MeshDeformer * EMotionFX::MeshDeformerStack::FindDeformerByType ( uint32  deformerTypeID,
size_t  occurrence = 0 
) const

Find a mesh deformer of a given type as returned by MeshDeformer::GetType().

Parameters
deformerTypeIDThe mesh deformer type to search for.
occurrenceIn case there are multiple controllers of the same type, 0 means it returns the first one, 1 means the second, etc.
Returns
A pointer to the mesh deformer of the given type, or nullptr when not found.

◆ GetDeformer()

MeshDeformer * EMotionFX::MeshDeformerStack::GetDeformer ( size_t  nr) const

Get a given deformer.

Parameters
nrThe deformer number to get.
Returns
A pointer to the deformer.

◆ GetMesh()

Mesh * EMotionFX::MeshDeformerStack::GetMesh ( ) const

Returns the mesh we are applying the stack on.

Returns
A pointer to the mesh.

◆ GetNumDeformers()

size_t EMotionFX::MeshDeformerStack::GetNumDeformers ( ) const

Get the number of deformers in the stack.

Returns
The number of deformers in the stack.

◆ InsertDeformer()

void EMotionFX::MeshDeformerStack::InsertDeformer ( size_t  pos,
MeshDeformer meshDeformer 
)

Insert a given deformer at a given position in the deformer stack.

Parameters
posThe position to insert the deformer.
meshDeformerThe deformer to store at this position.

◆ ReinitializeDeformers()

void EMotionFX::MeshDeformerStack::ReinitializeDeformers ( Actor actor,
Node node,
size_t  lodLevel 
)

Iterates through all mesh deformers in the stack and reinitializes them.

Parameters
actorThe actor that will use the mesh deformers.
nodeThe node to use for the reinitialize, so the node where the mesh belongs to during this initialization.
lodLevelThe LOD level the mesh deformers work on.

◆ RemoveAllDeformers()

void EMotionFX::MeshDeformerStack::RemoveAllDeformers ( )

Remove all deformers from this mesh deformer stack.

◆ RemoveAllDeformersByType()

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.

Parameters
deformerTypeIDThe type ID of the deformer, which is returned by MeshDeformer::GetType().
Returns
Returns the number of deformers that have been removed.

◆ RemoveDeformer()

bool EMotionFX::MeshDeformerStack::RemoveDeformer ( MeshDeformer meshDeformer)

Remove a given deformer.

Parameters
meshDeformerThe item/element to remove.

◆ Update()

void EMotionFX::MeshDeformerStack::Update ( ActorInstance actor,
Node node,
float  timeDelta,
bool  forceUpdateDisabledDeformers = false 
)

Update the stack calling the mesh deformers.

Parameters
actorThe actor instance to use for the update. So the actor instance where the stack belongs to during this update.
nodeThe node to use for the update, so the node where the mesh belongs to during this update.
timeDeltaThe time (in seconds) passed since the last call.
forceUpdateDisabledDeformersWhen set to true this will force updating disabled deformers.

◆ UpdateByModifierType()

void EMotionFX::MeshDeformerStack::UpdateByModifierType ( ActorInstance actorInstance,
Node node,
float  timeDelta,
uint32  typeID,
bool  resetMesh,
bool  forceUpdateDisabledDeformers 
)

Update the stack calling the mesh morph deformers.

Parameters
actorThe actor instance to use for the update. So the actor instance where the stack belongs to during this update.
nodeThe node to use for the update, so the node where the mesh belongs to during this update.
timeDeltaThe time (in seconds) passed since the last call.
typeIDThe type of the deformer you wish to apply.
resetMeshShould the mesh be reset before this deformer or not.
forceUpdateDisabledDeformersWhen set to true this will force updating disabled deformers.

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