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

#include <MorphSetup.h>

Inherits EMotionFX::BaseObject.

Public Member Functions

void ReserveMorphTargets (size_t numMorphTargets)
 
MCORE_INLINE size_t GetNumMorphTargets () const
 
MCORE_INLINE MorphTargetGetMorphTarget (size_t nr) const
 
void AddMorphTarget (MorphTarget *morphTarget)
 
void RemoveMorphTarget (size_t nr, bool delFromMem=true)
 
void RemoveMorphTarget (MorphTarget *morphTarget, bool delFromMem=true)
 
void RemoveAllMorphTargets ()
 
MorphTargetFindMorphTargetByID (uint32 id) const
 
size_t FindMorphTargetNumberByID (uint32 id) const
 
size_t FindMorphTargetIndexByName (const char *name) const
 
size_t FindMorphTargetIndexByNameNoCase (const char *name) const
 
MorphTargetFindMorphTargetByName (const char *name) const
 
MorphTargetFindMorphTargetByNameNoCase (const char *name) const
 
MorphSetupClone () const
 
void Scale (float scaleFactor)
 
- 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 MorphSetupCreate ()
 

Protected Member Functions

 MorphSetup ()=default
 
 ~MorphSetup ()
 
- Protected Member Functions inherited from EMotionFX::BaseObject
void Delete () override
 
virtual void Delete ()
 

Protected Attributes

AZStd::vector< MorphTarget * > m_morphTargets
 

Detailed Description

The morph setup class. This class contains a collection of morph targets. Each LOD in an Actor object can have a morph setup.

Constructor & Destructor Documentation

◆ MorphSetup()

EMotionFX::MorphSetup::MorphSetup ( )
protecteddefault

The constructor.

◆ ~MorphSetup()

EMotionFX::MorphSetup::~MorphSetup ( )
protected

The destructor. Automatically removes all morph targets from memory.

Member Function Documentation

◆ AddMorphTarget()

void EMotionFX::MorphSetup::AddMorphTarget ( MorphTarget morphTarget)

Add a morph target to this morph setup.

Parameters
morphTargetThe morph target to add.

◆ Clone()

MorphSetup * EMotionFX::MorphSetup::Clone ( ) const

Clone the morph setup, and return the clone.

Returns
Returns an exact clone of this morph setup.

◆ FindMorphTargetByID()

MorphTarget * EMotionFX::MorphSetup::FindMorphTargetByID ( uint32  id) const

Find a morph target by its unique ID, which has been calculated based on its name. All morph targets with the same ID will also have the same name.

Parameters
idThe ID to search for.
Returns
A pointer to the morph target that has the specified ID, or nullptr when none could be found.

◆ FindMorphTargetByName()

MorphTarget * EMotionFX::MorphSetup::FindMorphTargetByName ( const char *  name) const

Find a morph target by its name. Please remember that this is case sensitive.

Returns
A pointer to the morph target, or nullptr when not found.

◆ FindMorphTargetByNameNoCase()

MorphTarget * EMotionFX::MorphSetup::FindMorphTargetByNameNoCase ( const char *  name) const

Find a morph target by its name. Please remember that this is NOT case sensitive.

Returns
A pointer to the morph target, or nullptr when not found.

◆ FindMorphTargetIndexByName()

size_t EMotionFX::MorphSetup::FindMorphTargetIndexByName ( const char *  name) const

Find a morph target index by its name. Please remember that this is case sensitive.

Returns
The index of the morph target that you can pass to GetMorphTarget(index).

◆ FindMorphTargetIndexByNameNoCase()

size_t EMotionFX::MorphSetup::FindMorphTargetIndexByNameNoCase ( const char *  name) const

Find a morph target index by its name. Please remember that this is case insensitive.

Returns
The index of the morph target that you can pass to GetMorphTarget(index).

◆ FindMorphTargetNumberByID()

size_t EMotionFX::MorphSetup::FindMorphTargetNumberByID ( uint32  id) const

Find a morph target index by its unique ID, which has been calculated based on its name. All morph targets with the same ID will also have the same name.

Parameters
idThe ID to search for.
Returns
The morph target number, or InvalidIndex when not found. You can use the returned number with the method GetMorphTarget(nr) in order to convert it into a direct pointer to the morph target.

◆ GetMorphTarget()

MCORE_INLINE MorphTarget * EMotionFX::MorphSetup::GetMorphTarget ( size_t  nr) const
inline

Get a given morph target.

Parameters
nrThe morph target number, must be in range of [0..GetNumMorphTargets()-1].
Returns
A pointer to the morph target.

◆ GetNumMorphTargets()

MCORE_INLINE size_t EMotionFX::MorphSetup::GetNumMorphTargets ( ) const
inline

Get the number of morph targets inside this morph setup.

Returns
The number of morph targets.

◆ RemoveAllMorphTargets()

void EMotionFX::MorphSetup::RemoveAllMorphTargets ( )

Remove all morph targets inside this setup. NOTE: They will also be deleted from memory.

◆ RemoveMorphTarget() [1/2]

void EMotionFX::MorphSetup::RemoveMorphTarget ( MorphTarget morphTarget,
bool  delFromMem = true 
)

Remove a given morph target.

Parameters
morphTargetA pointer to the morph target to remove. This morph target must be part of this morph setup.
delFromMemWhen set to true, the morph target will be deleted from memory as well. When false, it will only be removed from the array of morph targets inside this class.

◆ RemoveMorphTarget() [2/2]

void EMotionFX::MorphSetup::RemoveMorphTarget ( size_t  nr,
bool  delFromMem = true 
)

Remove a given morph target, by index.

Parameters
nrThe morph target number to remove. This value must be in range of [0..GetNumMorphTargets()-1].
delFromMemWhen set to true, the morph target will be deleted from memory as well. When false, it will only be removed from the array of morph targets inside this class.

◆ ReserveMorphTargets()

void EMotionFX::MorphSetup::ReserveMorphTargets ( size_t  numMorphTargets)

Pre-allocate space for a given amount of morph targets. This does not influence the return value of GetNumMorphTargets().

Parameters
numMorphTargetsThe number of morph targets to pre-allocate space for.

◆ Scale()

void EMotionFX::MorphSetup::Scale ( float  scaleFactor)

Scale all transform and positional data. This is a very slow operation and is used to convert between different unit systems (cm, meters, etc).

Parameters
scaleFactorThe scale factor to scale the current data by.

Member Data Documentation

◆ m_morphTargets

AZStd::vector<MorphTarget*> EMotionFX::MorphSetup::m_morphTargets
protected

The collection of morph targets.


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