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::SoftSkinDeformer Class Reference

#include <SoftSkinDeformer.h>

Inherits EMotionFX::MeshDeformer.

Public Types

enum  { TYPE_ID = 0x00000001 }
 
enum  { SUBTYPE_ID = 0x00000001 }
 

Public Member Functions

void Update (ActorInstance *actorInstance, Node *node, float timeDelta) override
 
void Reinitialize (Actor *actor, Node *node, size_t lodLevel, uint16 highestJointId) override
 
MeshDeformerClone (Mesh *mesh) const override
 
uint32 GetType () const override
 
uint32 GetSubType () const override
 
MCORE_INLINE size_t GetNumLocalBones () const
 
MCORE_INLINE size_t GetLocalBone (size_t index) const
 
MCORE_INLINE void ReserveLocalBones (size_t numBones)
 
- Public Member Functions inherited from EMotionFX::MeshDeformer
virtual void Update (ActorInstance *actorInstance, Node *node, float timeDelta)=0
 
virtual void Reinitialize (Actor *actor, Node *node, size_t lodLevel, uint16 highestJointIndex)
 
virtual MeshDeformerClone (Mesh *mesh) const =0
 
virtual uint32 GetType () const =0
 
virtual uint32 GetSubType () const =0
 
bool GetIsEnabled () const
 
void SetIsEnabled (bool enabled)
 
- 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 SoftSkinDeformerCreate (Mesh *mesh)
 

Protected Member Functions

 SoftSkinDeformer (Mesh *mesh)
 
virtual ~SoftSkinDeformer ()
 
MCORE_INLINE size_t FindLocalBoneIndex (size_t nodeIndex) const
 
void SkinVertexRange (uint32 startVertex, uint32 endVertex, AZ::Vector3 *positions, AZ::Vector3 *normals, AZ::Vector4 *tangents, AZ::Vector3 *bitangents, uint32 *orgVerts, SkinningInfoVertexAttributeLayer *layer)
 
- Protected Member Functions inherited from EMotionFX::MeshDeformer
 MeshDeformer (Mesh *mesh)
 
virtual ~MeshDeformer ()
 
- Protected Member Functions inherited from EMotionFX::BaseObject
void Delete () override
 
virtual void Delete ()
 

Protected Attributes

AZStd::vector< AZ::Matrix3x4 > m_boneMatrices
 
AZStd::vector< size_t > m_nodeNumbers
 
- Protected Attributes inherited from EMotionFX::MeshDeformer
Meshm_mesh
 
bool m_isEnabled
 

Detailed Description

The soft skinning mesh deformer 'base' class. The calculations will be done on the CPU, however there will also be specialized versions of this class, so which are inherited from this class. These other classes will be a special soft skinning deformer for the Intel Pentium 4 and one for the AMD Athlon. However, this class will work on all CPUs, but will be slower as the natively optimized ones.

Constructor & Destructor Documentation

◆ SoftSkinDeformer()

EMotionFX::SoftSkinDeformer::SoftSkinDeformer ( Mesh mesh)
protected

Default constructor.

Parameters
meshA pointer to the mesh to deform.

◆ ~SoftSkinDeformer()

virtual EMotionFX::SoftSkinDeformer::~SoftSkinDeformer ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ Clone()

MeshDeformer * EMotionFX::SoftSkinDeformer::Clone ( Mesh mesh) const
overridevirtual

Creates an exact clone (copy) of this deformer, and returns a pointer to it.

Parameters
meshThe mesh to apply the deformer on.
Returns
A pointer to the newly created clone of this deformer.

Implements EMotionFX::MeshDeformer.

◆ Create()

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

Creation method.

Parameters
meshA pointer to the mesh to deform.
Returns
The created deformer object.

◆ FindLocalBoneIndex()

MCORE_INLINE size_t EMotionFX::SoftSkinDeformer::FindLocalBoneIndex ( size_t  nodeIndex) const
inlineprotected

Find the entry number that uses a specified node number.

Parameters
nodeIndexThe node number to search for.
Returns
The index inside the m_bones member array, which uses the given node.

◆ GetLocalBone()

MCORE_INLINE size_t EMotionFX::SoftSkinDeformer::GetLocalBone ( size_t  index) const
inline

Get the node number of a given local bone.

Parameters
indexThe local bone number, which must be in range of [0..GetNumLocalBones()-1].
Returns
The node number, which is in range of [0..Actor::GetNumNodes()-1], depending on the actor where this deformer works on.

◆ GetNumLocalBones()

MCORE_INLINE size_t EMotionFX::SoftSkinDeformer::GetNumLocalBones ( ) const
inline

Get the number of bones used by this deformer. This is the number of different bones that the skinning information of the mesh where this deformer works on uses.

Returns
The number of bones.

◆ GetSubType()

uint32 EMotionFX::SoftSkinDeformer::GetSubType ( ) const
overridevirtual

Returns the unique subtype ID of this deformer. A subtype identifies the specialization type of the given deformer. A cplus plus version of a deformer could have a sub type of 0, while the SSE assembly optimized version would have a sub type of 1 for example.

Returns
The sub type identification number.

Implements EMotionFX::MeshDeformer.

◆ GetType()

uint32 EMotionFX::SoftSkinDeformer::GetType ( ) const
overridevirtual

Returns the unique type ID of the deformer.

Returns
The type ID of the deformer.

Implements EMotionFX::MeshDeformer.

◆ Reinitialize()

void EMotionFX::SoftSkinDeformer::Reinitialize ( Actor actor,
Node node,
size_t  lodLevel,
uint16  highestJointId 
)
overridevirtual

Reinitialize the mesh deformer. Updates the the array of bone information used for precalculation.

Parameters
actorThe actor to to initialize the deformer for.
nodeThe node where the mesh belongs to during this initialization.
lodLevelThe LOD level of the mesh the mesh deformer works on.

Reimplemented from EMotionFX::MeshDeformer.

◆ ReserveLocalBones()

MCORE_INLINE void EMotionFX::SoftSkinDeformer::ReserveLocalBones ( size_t  numBones)
inline

Pre-allocate space for a given number of local bones. This does not alter the value returned by GetNumLocalBones().

Parameters
numBonesThe number of bones to pre-allocate space for.

◆ Update()

void EMotionFX::SoftSkinDeformer::Update ( ActorInstance actorInstance,
Node node,
float  timeDelta 
)
overridevirtual

Update the mesh deformer.

Parameters
actorInstanceThe actor instance to use for the update. So the actor where the mesh 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.

Implements EMotionFX::MeshDeformer.


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