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

#include <MorphTargetStandard.h>

Inherits EMotionFX::MorphTarget.

Classes

class  DeformData
 

Public Types

enum  { TYPE_ID = 0x00000001 }
 
enum  { MEMORYBLOCK_ID = 101 }
 
- Public Types inherited from EMotionFX::MorphTarget
enum  EPhonemeSet {
  PHONEMESET_NONE = 0 , PHONEMESET_NEUTRAL_POSE = 1 << 0 , PHONEMESET_M_B_P_X = 1 << 1 , PHONEMESET_AA_AO_OW = 1 << 2 ,
  PHONEMESET_IH_AE_AH_EY_AY_H = 1 << 3 , PHONEMESET_AW = 1 << 4 , PHONEMESET_N_NG_CH_J_DH_D_G_T_K_Z_ZH_TH_S_SH = 1 << 5 , PHONEMESET_IY_EH_Y = 1 << 6 ,
  PHONEMESET_UW_UH_OY = 1 << 7 , PHONEMESET_F_V = 1 << 8 , PHONEMESET_L_EL = 1 << 9 , PHONEMESET_W = 1 << 10 ,
  PHONEMESET_R_ER = 1 << 11
}
 

Public Member Functions

struct EMFX_API alignas (16) Transformation
 
uint32 GetType () const override
 
void InitFromPose (bool captureTransforms, Actor *neutralPose, Actor *targetPose) override
 
void ApplyTransformation (ActorInstance *actorInstance, size_t nodeIndex, AZ::Vector3 &position, AZ::Quaternion &rotation, AZ::Vector3 &scale, float weight) override
 
bool Influences (size_t nodeIndex) const override
 
void Apply (ActorInstance *actorInstance, float weight) override
 
size_t GetNumDeformDatas () const
 
DeformDataGetDeformData (size_t nr) const
 
void AddDeformData (DeformData *data)
 
void AddTransformation (const Transformation &transform)
 
size_t GetNumTransformations () const
 
Transformation & GetTransformation (size_t nr)
 
MorphTargetClone () const override
 
void RemoveAllDeformDatas ()
 
void RemoveAllDeformDatasFor (Node *joint)
 
void RemoveDeformData (size_t index, bool delFromMem=true)
 
void RemoveTransformation (size_t index)
 
void ReserveDeformDatas (size_t numDeformDatas)
 
void ReserveTransformations (size_t numTransforms)
 
void Scale (float scaleFactor) override
 
- Public Member Functions inherited from EMotionFX::MorphTarget
virtual void ApplyTransformation (ActorInstance *actorInstance, size_t nodeIndex, AZ::Vector3 &position, AZ::Quaternion &rotation, AZ::Vector3 &scale, float weight)=0
 
MCORE_INLINE uint32 GetID () const
 
const char * GetName () const
 
const AZStd::string & GetNameString () const
 
void SetRangeMin (float rangeMin)
 
void SetRangeMax (float rangeMax)
 
float GetRangeMin () const
 
float GetRangeMax () const
 
virtual uint32 GetType () const =0
 
void SetName (const char *name)
 
void SetPhonemeSets (EPhonemeSet phonemeSets)
 
EPhonemeSet GetPhonemeSets () const
 
void EnablePhonemeSet (EPhonemeSet set, bool enabled)
 
bool GetIsPhonemeSetEnabled (EPhonemeSet set) const
 
virtual void InitFromPose (bool captureTransforms, Actor *neutralPose, Actor *targetPose)=0
 
virtual bool Influences (size_t nodeIndex) const =0
 
float CalcRangedWeight (float weight) const
 
float CalcZeroInfluenceWeight () const
 
float CalcNormalizedWeight (float rangedWeight) const
 
bool GetIsPhoneme () const
 
virtual void Apply (ActorInstance *actorInstance, float weight)=0
 
virtual MorphTargetClone () const =0
 
void CopyBaseClassMemberValues (MorphTarget *target) const
 
virtual void Scale (float scaleFactor)=0
 
- 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 MorphTargetStandardCreate (const char *name)
 
static MorphTargetStandardCreate (bool captureTransforms, Actor *neutralPose, Actor *targetPose, const char *name)
 
- Static Public Member Functions inherited from EMotionFX::MorphTarget
static EPhonemeSet FindPhonemeSet (const AZStd::string &phonemeName)
 
static AZStd::string GetPhonemeSetString (const EPhonemeSet phonemeSet)
 
static uint32 GetNumAvailablePhonemeSets ()
 

Additional Inherited Members

- Protected Member Functions inherited from EMotionFX::MorphTarget
 MorphTarget (const char *name)
 
- Protected Member Functions inherited from EMotionFX::BaseObject
void Delete () override
 
virtual void Delete ()
 
- Protected Attributes inherited from EMotionFX::MorphTarget
uint32 m_nameId
 
float m_rangeMin
 
float m_rangeMax
 
EPhonemeSet m_phonemeSets
 

Detailed Description

The standard morph target. This type of morph target supports vertex morphs (position, normals and first tangent layer) as well as transformation morph targets.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

The memory block ID where allocations made by this class will remain in.

Member Function Documentation

◆ AddDeformData()

void EMotionFX::MorphTargetStandard::AddDeformData ( DeformData data)

Add a given deform data to the array of deform data objects.

Parameters
dataThe deform data object to add.

◆ AddTransformation()

void EMotionFX::MorphTargetStandard::AddTransformation ( const Transformation &  transform)

Add a new transformation to the morph target for the given node.

Parameters
transformThe transformation which contains the relative position, scale and the absolute rotation and the node index to apply this on.

◆ alignas()

struct EMFX_API EMotionFX::MorphTargetStandard::alignas ( 16  )
inline

The transformation struct. This contains a position, rotation and scale. Please keep in mind that the rotation is stored as non-delta value, while the position and scale are stored as delta values.

◆ Apply()

void EMotionFX::MorphTargetStandard::Apply ( ActorInstance actorInstance,
float  weight 
)
overridevirtual

Apply the relative deformations for this morph target to the given actor instance.

Parameters
actorInstanceThe actor instance to apply the deformations on.
weightThe absolute weight of the morph target.

Implements EMotionFX::MorphTarget.

◆ ApplyTransformation()

void EMotionFX::MorphTargetStandard::ApplyTransformation ( ActorInstance actorInstance,
size_t  nodeIndex,
AZ::Vector3 &  position,
AZ::Quaternion &  rotation,
AZ::Vector3 &  scale,
float  weight 
)
overridevirtual

Apply the relative transformation caused by this morph target to a given node. It does not change the node itself, but it modifies the input position, rotation and scale. The node and actor pointers are only needed to retrieve some additional information from the node, needed to perform the calculations.

Parameters
actorInstanceThe actor instance where the node belongs to.
nodeIndexThe node we would like to modify (please note that the node itself will stay untouched).
positionThe input position to which relative adjustments will be applied.
rotationThe input rotation to which relative adjustments will be applied.
scaleThe input scale to which relative adjustments will be applied.
weightThe absolute weight value.

Implements EMotionFX::MorphTarget.

◆ Clone()

MorphTarget * EMotionFX::MorphTargetStandard::Clone ( ) const
overridevirtual

Creates an exact clone of this morph target.

Returns
Returns a pointer to an exact clone of this morph target.

Implements EMotionFX::MorphTarget.

◆ Create() [1/2]

static MorphTargetStandard * EMotionFX::MorphTargetStandard::Create ( bool  captureTransforms,
Actor neutralPose,
Actor targetPose,
const char *  name 
)
static

Extended constructor.

Parameters
captureTransformsSet this to true if you want this morph target to capture rigid transformations (changes in pos/rot/scale).
neutralPoseThe actor that contains the neutral pose.
targetPoseThe actor representing the pose of the character when the weight value would equal 1.
nameThe unique name of the morph target.

◆ Create() [2/2]

static MorphTargetStandard * EMotionFX::MorphTargetStandard::Create ( const char *  name)
static

The constructor. Please note that you will have to call the InitFromPose method in order to make it do something. Or use the extended constructor.

Parameters
nameThe unique name of the morph target.

◆ GetDeformData()

DeformData * EMotionFX::MorphTargetStandard::GetDeformData ( size_t  nr) const

Get a given deform data object.

Parameters
nrThe deform data number, which must be in range of [0..GetNumDeformDatas()-1].
Returns
A pointer to the deform data object.

◆ GetNumDeformDatas()

size_t EMotionFX::MorphTargetStandard::GetNumDeformDatas ( ) const

Get the number of deform data objects.

Returns
The number of deform data objects.

◆ GetNumTransformations()

size_t EMotionFX::MorphTargetStandard::GetNumTransformations ( ) const

Get the number of transformations which are part of this bones morph target.

Returns
The number of tranformations.

◆ GetTransformation()

Transformation & EMotionFX::MorphTargetStandard::GetTransformation ( size_t  nr)

Get a given transformation and it's corresponding node id to which the transformation belongs to.

Parameters
nrThe transformation number, must be in range of [0..GetNumTransformations()-1].
Returns
A reference to the transformation.

◆ GetType()

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

Get the type of morph target. You can have different types of morph targets, such as morph targets which work with bones, or which work with morphing or other techniques.

Returns
The unique type ID of the morph target.

Implements EMotionFX::MorphTarget.

◆ Influences()

bool EMotionFX::MorphTargetStandard::Influences ( size_t  nodeIndex) const
overridevirtual

Checks if this morph target would influence the given node.

Parameters
nodeIndexThe node to perform the check with.
Returns
Returns true if the given node will be modified by this morph target, otherwise false is returned.

Implements EMotionFX::MorphTarget.

◆ InitFromPose()

void EMotionFX::MorphTargetStandard::InitFromPose ( bool  captureTransforms,
Actor neutralPose,
Actor targetPose 
)
overridevirtual

Initializes this expresion part from two given actors, representing a neutral and target pose. The morph target will filter out all data which is changed compared to the base pose and store this information on a specific way so it can be used to accumulate multiple morph targets together and apply them to the actor to which this morph target is attached to.

Parameters
captureTransformsSet this to true if you want this morph target to capture rigid transformations (changes in pos/rot/scale).
neutralPoseThe actor that represents the neutral pose.
targetPoseThe actor representing the pose of the character when the weight value would equal 1.

Implements EMotionFX::MorphTarget.

◆ RemoveAllDeformDatas()

void EMotionFX::MorphTargetStandard::RemoveAllDeformDatas ( )

Remove all deform data objects from memory as well as from the class.

◆ RemoveAllDeformDatasFor()

void EMotionFX::MorphTargetStandard::RemoveAllDeformDatasFor ( Node joint)

Remove all deform data objects for the given joint.

◆ RemoveDeformData()

void EMotionFX::MorphTargetStandard::RemoveDeformData ( size_t  index,
bool  delFromMem = true 
)

Remove the given deform data.

Parameters
indexThe deform data to remove. The index must be in range of [0, GetNumDeformDatas()].
delFromMemSet to true (default) when you wish to also delete the specified deform data from memory.

◆ RemoveTransformation()

void EMotionFX::MorphTargetStandard::RemoveTransformation ( size_t  index)

Remove the given transformation.

Parameters
indexThe transformation to remove. The index must be in range of [0, GetNumTransformations()].

◆ ReserveDeformDatas()

void EMotionFX::MorphTargetStandard::ReserveDeformDatas ( size_t  numDeformDatas)

Reserve (pre-allocate) space in the array of deform datas. This does NOT change the value returned by GetNumDeformDatas().

Parameters
numDeformDatasThe absolute number of deform datas to pre-allocate space for.

◆ ReserveTransformations()

void EMotionFX::MorphTargetStandard::ReserveTransformations ( size_t  numTransforms)

Reserve (pre-allocate) space in the array of transformations. This does NOT change the value returned by GetNumTransformations().

Parameters
numTransformsThe absolute number of transformations to pre-allocate space for.

◆ Scale()

void EMotionFX::MorphTargetStandard::Scale ( float  scaleFactor)
overridevirtual

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.

Implements EMotionFX::MorphTarget.


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