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

Public Types

enum  { FLAG_LOCALTRANSFORMREADY = 1 << 0 , FLAG_MODELTRANSFORMREADY = 1 << 1 }
 

Public Member Functions

 Pose (const Pose &other)
 
void Clear (bool clearMem=true)
 
void ClearFlags (uint8 newFlags=0)
 
void InitFromPose (const Pose *sourcePose)
 
void InitFromBindPose (const ActorInstance *actorInstance)
 
void InitFromBindPose (const Actor *actor)
 
void LinkToActorInstance (const ActorInstance *actorInstance, uint8 initialFlags=0)
 
void LinkToActor (const Actor *actor, uint8 initialFlags=0, bool clearAllFlags=true)
 
void SetNumTransforms (size_t numTransforms)
 
void ApplyMorphWeightsToActorInstance ()
 
void ZeroMorphWeights ()
 
void UpdateAllLocalSpaceTranforms ()
 
void UpdateAllModelSpaceTranforms ()
 
void ForceUpdateFullLocalSpacePose ()
 
void ForceUpdateFullModelSpacePose ()
 
const Transform & GetLocalSpaceTransform (size_t nodeIndex) const
 
const Transform & GetModelSpaceTransform (size_t nodeIndex) const
 
Transform GetWorldSpaceTransform (size_t nodeIndex) const
 
void GetLocalSpaceTransform (size_t nodeIndex, Transform *outResult) const
 
void GetModelSpaceTransform (size_t nodeIndex, Transform *outResult) const
 
void GetWorldSpaceTransform (size_t nodeIndex, Transform *outResult) const
 
void SetLocalSpaceTransform (size_t nodeIndex, const Transform &newTransform, bool invalidateModelSpaceTransforms=true)
 
void SetModelSpaceTransform (size_t nodeIndex, const Transform &newTransform, bool invalidateChildModelSpaceTransforms=true)
 
void SetWorldSpaceTransform (size_t nodeIndex, const Transform &newTransform, bool invalidateChildModelSpaceTransforms=true)
 
void UpdateModelSpaceTransform (size_t nodeIndex) const
 
void UpdateLocalSpaceTransform (size_t nodeIndex) const
 
void CompensateForMotionExtraction (EMotionExtractionFlags motionExtractionFlags=(EMotionExtractionFlags) 0)
 
void CompensateForMotionExtractionDirect (EMotionExtractionFlags motionExtractionFlags=(EMotionExtractionFlags) 0)
 
Transform GetMeshNodeWorldSpaceTransform (size_t lodLevel, size_t nodeIndex) const
 
void InvalidateAllLocalSpaceTransforms ()
 
void InvalidateAllModelSpaceTransforms ()
 
void InvalidateAllLocalAndModelSpaceTransforms ()
 
Transform CalcTrajectoryTransform () const
 
MCORE_INLINE const Transform * GetLocalSpaceTransforms () const
 
MCORE_INLINE const Transform * GetModelSpaceTransforms () const
 
MCORE_INLINE size_t GetNumTransforms () const
 
MCORE_INLINE const ActorInstanceGetActorInstance () const
 
MCORE_INLINE const ActorGetActor () const
 
MCORE_INLINE const SkeletonGetSkeleton () const
 
MCORE_INLINE Transform & GetLocalSpaceTransformDirect (size_t nodeIndex)
 
MCORE_INLINE Transform & GetModelSpaceTransformDirect (size_t nodeIndex)
 
MCORE_INLINE const Transform & GetLocalSpaceTransformDirect (size_t nodeIndex) const
 
MCORE_INLINE const Transform & GetModelSpaceTransformDirect (size_t nodeIndex) const
 
MCORE_INLINE void SetLocalSpaceTransformDirect (size_t nodeIndex, const Transform &transform)
 
MCORE_INLINE void SetModelSpaceTransformDirect (size_t nodeIndex, const Transform &transform)
 
MCORE_INLINE void InvalidateLocalSpaceTransform (size_t nodeIndex)
 
MCORE_INLINE void InvalidateModelSpaceTransform (size_t nodeIndex)
 
MCORE_INLINE void SetMorphWeight (size_t index, float weight)
 
MCORE_INLINE float GetMorphWeight (size_t index) const
 
MCORE_INLINE size_t GetNumMorphWeights () const
 
void ResizeNumMorphs (size_t numMorphTargets)
 
void Blend (const Pose *destPose, float weight, const MotionInstance *instance)
 
void Blend (const Pose *destPose, float weight)
 
void BlendAdditiveUsingBindPose (const Pose *destPose, float weight)
 
void Blend (const Pose *destPose, float weight, const MotionInstance *instance, Pose *outPose)
 
PosePreMultiply (const Pose &other)
 
PoseMultiply (const Pose &other)
 
PoseMultiplyInverse (const Pose &other)
 
void Zero ()
 
void NormalizeQuaternions ()
 
void Sum (const Pose *other, float weight)
 
PoseMakeRelativeTo (const Pose &other)
 
PoseMakeAdditive (const Pose &refPose)
 
PoseApplyAdditive (const Pose &additivePose)
 
PoseApplyAdditive (const Pose &additivePose, float weight)
 
void Mirror (const MotionLinkData *motionLinkData)
 
Poseoperator= (const Pose &other)
 
MCORE_INLINE uint8 GetFlags (size_t nodeIndex) const
 
MCORE_INLINE void SetFlags (size_t nodeIndex, uint8 flags)
 
bool HasPoseData (const AZ::TypeId &typeId) const
 
PoseDataGetPoseDataByType (const AZ::TypeId &typeId) const
 
template<class T >
T * GetPoseData () const
 
void AddPoseData (PoseData *poseData)
 
void ClearPoseDatas ()
 
const AZStd::unordered_map< AZ::TypeId, AZStd::unique_ptr< PoseData > > & GetPoseDatas () const
 
PoseDataGetAndPreparePoseData (const AZ::TypeId &typeId, const ActorInstance *linkToActorInstance)
 
template<class T >
T * GetAndPreparePoseData (const ActorInstance *linkToActorInstance)
 
void DebugDraw (AzFramework::DebugDisplayRequests &debugDisplay, const AZ::Color &color, bool drawPoseDatas=false) const
 

Member Function Documentation

◆ Blend() [1/3]

void EMotionFX::Pose::Blend ( const Pose destPose,
float  weight 
)

Blend the transforms for all enabled nodes in the actor instance.

Parameters
destPoseThe destination pose to blend into.
weightThe weight value to use, which must be in range of [0..1], where 1.0 is the dest pose.

◆ Blend() [2/3]

void EMotionFX::Pose::Blend ( const Pose destPose,
float  weight,
const MotionInstance instance 
)

Blend this pose into a specified destination pose.

Parameters
destPoseThe destination pose to blend into.
weightThe weight value to use.
instanceThe motion instance settings to use.

◆ Blend() [3/3]

void EMotionFX::Pose::Blend ( const Pose destPose,
float  weight,
const MotionInstance instance,
Pose outPose 
)

Blend this pose into a specified destination pose.

Parameters
destPoseThe destination pose to blend into.
weightThe weight value to use.
instanceThe motion instance settings to use.
outPosethe output pose, in which we will write the result.

◆ BlendAdditiveUsingBindPose()

void EMotionFX::Pose::BlendAdditiveUsingBindPose ( const Pose destPose,
float  weight 
)

Additively blend the transforms for all enabled nodes in the actor instance. You can see this as: thisPose += destPose * weight.

Parameters
destPoseThe destination pose to blend into, additively, so displacing the current pose.
weightThe weight value to use, which must be in range of [0..1], where 1.0 is the dest pose.

◆ DebugDraw()

void EMotionFX::Pose::DebugDraw ( AzFramework::DebugDisplayRequests &  debugDisplay,
const AZ::Color &  color,
bool  drawPoseDatas = false 
) const

Draw debug visualization for the given pose.

Parameters
[in]debugDisplayDebug display request bus to spawn the render commands.
[in]colorThe color the skeletal pose should be in.
[in]drawPoseDatasDraw the pose data debug visualizations (e.g. joint velocities) along with the actual skeletal pose. [Default = false]

◆ GetAndPreparePoseData()

PoseData * EMotionFX::Pose::GetAndPreparePoseData ( const AZ::TypeId &  typeId,
const ActorInstance linkToActorInstance 
)

Guaranteed retrieval of a fully prepared and ready to use pose data of the given type. Pose data of the given type will be created and reset to its default value in case it does not yet exist on the current pose. In case the pose data existed but was unused, the pose data will be reset before being returned.

Parameters
[in]typeIdThe type id of the pose data that we want to retrieve.
[in]linkToActorInstanceThe actor instance to link to the pose data.
Returns
Valid pointer to the pose data of the given type.

◆ GetMeshNodeWorldSpaceTransform()

Transform EMotionFX::Pose::GetMeshNodeWorldSpaceTransform ( size_t  lodLevel,
size_t  nodeIndex 
) const

Use this method when you need to transform the mesh data like vertex positions into world space. Multiply all your vertices with the transform returned by this. The difference between using GetWorldSpaceTransform directly from the current pose is that this looks whether the mesh is skinned or not. Right now we handle skinned meshes differently. This will change in the future. Skinned meshes will always return an identity transform and therefore act like they cannot be animated. This requires the pose to be linked to an actor instance. If this is not the case, identity transform is returned.

Parameters
TheLOD level, which must be in range of 0..m_actor->GetNumLODLevels().
nodeIndexThe index of the node. If this node happens to have no mesh the regular current world space transform is returned.

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