ezEngine Release 25.08
Loading...
Searching...
No Matches
ezAnimPoseGenerator Class Referencefinal

Low-level infrastructure to generate animation poses from animation clips and other inputs. More...

#include <AnimPoseGenerator.h>

Public Member Functions

void Reset (const ezSkeletonResource *pSkeleton, ezGameObject *pTarget)
 
const ezSkeletonResourceGetSkeleton () const
 
const ezGameObjectGetTargetObject () const
 
ezAnimPoseGeneratorCommandSampleTrackAllocCommandSampleTrack (ezUInt32 uiDeterministicID)
 
ezAnimPoseGeneratorCommandRestPoseAllocCommandRestPose ()
 
ezAnimPoseGeneratorCommandCombinePosesAllocCommandCombinePoses ()
 
ezAnimPoseGeneratorCommandLocalToModelPoseAllocCommandLocalToModelPose ()
 
ezAnimPoseGeneratorCommandSampleEventTrackAllocCommandSampleEventTrack ()
 
ezAnimPoseGeneratorCommandAimIKAllocCommandAimIK ()
 
ezAnimPoseGeneratorCommandTwoBoneIKAllocCommandTwoBoneIK ()
 
const ezAnimPoseGeneratorCommandGetCommand (ezAnimPoseGeneratorCommandID id) const
 
ezAnimPoseGeneratorCommandGetCommand (ezAnimPoseGeneratorCommandID id)
 
void UpdatePose (bool bRequestExternalPoseGeneration)
 Calculates the pose, using the final command as reference where to start.
 
ezArrayPtr< ezMat4GetCurrentPose () const
 
void SetFinalCommand (ezAnimPoseGeneratorCommandID cmdId)
 Sets the (currently) final command in the pose generation.
 
ezAnimPoseGeneratorCommandID GetFinalCommand () const
 Returns the (currently) final command.
 
bool ShouldSendPoseResultMsg () const
 Whether the caller should send ezMsgAnimationPoseUpdated to its children.
 

Detailed Description

Low-level infrastructure to generate animation poses from animation clips and other inputs.

Even though instances of this class should be reused over frames, it is assumed that all commands are recreated every frame, to build a new pose. Some commands take predecessor commands as inputs to combine. If a command turns out not be actually needed, it won't be evaluated.

Member Function Documentation

◆ GetFinalCommand()

ezAnimPoseGeneratorCommandID ezAnimPoseGenerator::GetFinalCommand ( ) const
inline

Returns the (currently) final command.

Can be used to inject further commands after it. Call SetFinalCommand() afterwards.

◆ SetFinalCommand()

void ezAnimPoseGenerator::SetFinalCommand ( ezAnimPoseGeneratorCommandID  cmdId)
inline

Sets the (currently) final command in the pose generation.

This will be used to determine which other commands are necessary to calculate.

◆ ShouldSendPoseResultMsg()

bool ezAnimPoseGenerator::ShouldSendPoseResultMsg ( ) const
inline

Whether the caller should send ezMsgAnimationPoseUpdated to its children.

Typically this should be done, to forward the calculated pose to the animated mesh components. However, when some other component takes over control (usually a ragdoll), the pose from this generator isn't the final result and thus should not be forwarded. The other component will take care of this already.

◆ UpdatePose()

void ezAnimPoseGenerator::UpdatePose ( bool  bRequestExternalPoseGeneration)

Calculates the pose, using the final command as reference where to start.

If bRequestExternalPoseGeneration is true, inverse-kinematics (IK) and powered ragdolls are also used.


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