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

#include <DualQuatSkinDeformer.h>

Inherits EMotionFX::MeshDeformer.

Classes

struct  BoneInfo
 

Public Types

enum  { TYPE_ID = 0x00000003 }
 
enum  { SUBTYPE_ID = 0x00000002 }
 

Public Member Functions

void Update (ActorInstance *actorInstance, Node *node, float timeDelta) override
 
void Reinitialize (Actor *actor, Node *node, size_t lodLevel, uint16 highestJointIndex) 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 DualQuatSkinDeformerCreate (Mesh *mesh)
 

Protected Member Functions

 DualQuatSkinDeformer (Mesh *mesh)
 
virtual ~DualQuatSkinDeformer ()
 
- 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 ()
 

Static Protected Member Functions

static void SkinRange (Mesh *mesh, AZ::u32 startVertex, AZ::u32 endVertex, const AZStd::vector< BoneInfo > &boneInfos)
 

Protected Attributes

AZStd::vector< BoneInfom_bones
 
AZ::TaskGraph m_taskGraph { "DualQuatSkinDeformer" }
 
bool m_useTaskGraph = false
 
- Protected Attributes inherited from EMotionFX::MeshDeformer
Meshm_mesh
 
bool m_isEnabled
 

Static Protected Attributes

static constexpr AZ::u32 s_numVerticesPerBatch = 10000
 Number of vertices per batch/job used for multi-threaded software skinning.
 

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

◆ DualQuatSkinDeformer()

EMotionFX::DualQuatSkinDeformer::DualQuatSkinDeformer ( Mesh mesh)
protected

Default constructor.

Parameters
meshA pointer to the mesh to deform.

◆ ~DualQuatSkinDeformer()

virtual EMotionFX::DualQuatSkinDeformer::~DualQuatSkinDeformer ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ Clone()

MeshDeformer * EMotionFX::DualQuatSkinDeformer::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 DualQuatSkinDeformer * EMotionFX::DualQuatSkinDeformer::Create ( Mesh mesh)
static

Creation method.

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

◆ GetLocalBone()

MCORE_INLINE size_t EMotionFX::DualQuatSkinDeformer::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::DualQuatSkinDeformer::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::DualQuatSkinDeformer::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::DualQuatSkinDeformer::GetType ( ) const
overridevirtual

Returns the unique type ID of the deformer.

Returns
The type ID of the deformer.

Implements EMotionFX::MeshDeformer.

◆ Reinitialize()

void EMotionFX::DualQuatSkinDeformer::Reinitialize ( Actor actor,
Node node,
size_t  lodLevel,
uint16  highestJointIndex 
)
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::DualQuatSkinDeformer::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.

◆ SkinRange()

static void EMotionFX::DualQuatSkinDeformer::SkinRange ( Mesh mesh,
AZ::u32  startVertex,
AZ::u32  endVertex,
const AZStd::vector< BoneInfo > &  boneInfos 
)
staticprotected

Skin a part of the mesh.

Parameters
meshThe mesh to be skinned.
startVertexThe start vertex index to start skinning.
endVertexThe end vertex index for the range to be skinned.
boneInfosThe pre-calculated skinning matrices shared across the skinning process.

◆ Update()

void EMotionFX::DualQuatSkinDeformer::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.

Member Data Documentation

◆ m_bones

AZStd::vector<BoneInfo> EMotionFX::DualQuatSkinDeformer::m_bones
protected

The array of bone information used for pre-calculation.


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