#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 |
DeformData * | GetDeformData (size_t nr) const |
void | AddDeformData (DeformData *data) |
void | AddTransformation (const Transformation &transform) |
size_t | GetNumTransformations () const |
Transformation & | GetTransformation (size_t nr) |
MorphTarget * | Clone () 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 MorphTarget * | Clone () 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 MorphTargetStandard * | Create (const char *name) |
static MorphTargetStandard * | Create (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 |
The standard morph target. This type of morph target supports vertex morphs (position, normals and first tangent layer) as well as transformation morph targets.
anonymous enum |
The memory block ID where allocations made by this class will remain in.
void EMotionFX::MorphTargetStandard::AddDeformData | ( | DeformData * | data | ) |
Add a given deform data to the array of deform data objects.
data | The deform data object to add. |
void EMotionFX::MorphTargetStandard::AddTransformation | ( | const Transformation & | transform | ) |
Add a new transformation to the morph target for the given node.
transform | The transformation which contains the relative position, scale and the absolute rotation and the node index to apply this on. |
|
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.
|
overridevirtual |
Apply the relative deformations for this morph target to the given actor instance.
actorInstance | The actor instance to apply the deformations on. |
weight | The absolute weight of the morph target. |
Implements EMotionFX::MorphTarget.
|
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.
actorInstance | The actor instance where the node belongs to. |
nodeIndex | The node we would like to modify (please note that the node itself will stay untouched). |
position | The input position to which relative adjustments will be applied. |
rotation | The input rotation to which relative adjustments will be applied. |
scale | The input scale to which relative adjustments will be applied. |
weight | The absolute weight value. |
Implements EMotionFX::MorphTarget.
|
overridevirtual |
Creates an exact clone of this morph target.
Implements EMotionFX::MorphTarget.
|
static |
Extended constructor.
captureTransforms | Set this to true if you want this morph target to capture rigid transformations (changes in pos/rot/scale). |
neutralPose | The actor that contains the neutral pose. |
targetPose | The actor representing the pose of the character when the weight value would equal 1. |
name | The unique name of the morph target. |
|
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.
name | The unique name of the morph target. |
DeformData * EMotionFX::MorphTargetStandard::GetDeformData | ( | size_t | nr | ) | const |
Get a given deform data object.
nr | The deform data number, which must be in range of [0..GetNumDeformDatas()-1]. |
size_t EMotionFX::MorphTargetStandard::GetNumDeformDatas | ( | ) | const |
Get the number of deform data objects.
size_t EMotionFX::MorphTargetStandard::GetNumTransformations | ( | ) | const |
Get the number of transformations which are part of this bones morph target.
Transformation & EMotionFX::MorphTargetStandard::GetTransformation | ( | size_t | nr | ) |
Get a given transformation and it's corresponding node id to which the transformation belongs to.
nr | The transformation number, must be in range of [0..GetNumTransformations()-1]. |
|
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.
Implements EMotionFX::MorphTarget.
|
overridevirtual |
Checks if this morph target would influence the given node.
nodeIndex | The node to perform the check with. |
Implements EMotionFX::MorphTarget.
|
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.
captureTransforms | Set this to true if you want this morph target to capture rigid transformations (changes in pos/rot/scale). |
neutralPose | The actor that represents the neutral pose. |
targetPose | The actor representing the pose of the character when the weight value would equal 1. |
Implements EMotionFX::MorphTarget.
void EMotionFX::MorphTargetStandard::RemoveAllDeformDatas | ( | ) |
Remove all deform data objects from memory as well as from the class.
void EMotionFX::MorphTargetStandard::RemoveAllDeformDatasFor | ( | Node * | joint | ) |
Remove all deform data objects for the given joint.
void EMotionFX::MorphTargetStandard::RemoveDeformData | ( | size_t | index, |
bool | delFromMem = true |
||
) |
Remove the given deform data.
index | The deform data to remove. The index must be in range of [0, GetNumDeformDatas()]. |
delFromMem | Set to true (default) when you wish to also delete the specified deform data from memory. |
void EMotionFX::MorphTargetStandard::RemoveTransformation | ( | size_t | index | ) |
Remove the given transformation.
index | The transformation to remove. The index must be in range of [0, GetNumTransformations()]. |
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().
numDeformDatas | The absolute number of deform datas to pre-allocate space for. |
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().
numTransforms | The absolute number of transformations to pre-allocate space for. |
|
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).
scaleFactor | The scale factor to scale the current data by. |
Implements EMotionFX::MorphTarget.