ezEngine Release 26.3
Loading...
Searching...
No Matches
ezAnimGraphInstance Class Reference

#include <AnimGraphInstance.h>

Public Member Functions

void Configure (const ezAnimGraph &animGraph)
 
void Update (ezAnimController &ref_controller, ezTime diff, ezGameObject *pTarget, const ezSkeletonResource *pSekeltonResource)
 Executes all nodes in the graph to generate animation output.
 
template<typename T >
T * GetAnimNodeInstanceData (const ezAnimGraphNode &node)
 

Friends

class ezAnimGraphTriggerOutputPin
 
class ezAnimGraphTriggerInputPin
 
class ezAnimGraphBoneWeightsInputPin
 
class ezAnimGraphBoneWeightsOutputPin
 
class ezAnimGraphLocalPoseInputPin
 
class ezAnimGraphLocalPoseOutputPin
 
class ezAnimGraphNumberInputPin
 
class ezAnimGraphNumberOutputPin
 
class ezAnimGraphBoolInputPin
 
class ezAnimGraphBoolOutputPin
 

Detailed Description

Runtime state for a single animation graph, owned by ezAnimController.

While ezAnimGraph defines the structure (nodes, connections, logic), ezAnimGraphInstance holds the per-character runtime state needed to execute that graph. This allows one graph definition to be shared by many characters, each with their own instance storing playback positions, blend weights, transition states, and pin values.

Node Instance Data Access

Nodes that need per-instance state (playback time, transition progress, etc.) access it via GetAnimNodeInstanceData<T>(). The instance data offset is pre-computed during graph preparation and stored in the node.

Example from a node's Step() method:

InstanceData* pState = ref_graph.GetAnimNodeInstanceData<InstanceData>(*this);
pState->m_PlaybackTime += tDiff;

Member Function Documentation

◆ Configure()

void ezAnimGraphInstance::Configure ( const ezAnimGraph animGraph)

Allocates instance data and initializes pin state pointers for the given graph.

Must be called once after construction. The graph must have been prepared via PrepareForUse().

◆ GetAnimNodeInstanceData()

template<typename T >
T * ezAnimGraphInstance::GetAnimNodeInstanceData ( const ezAnimGraphNode node)
inline

Retrieves the instance data for a specific node.

Nodes use this to access their per-instance state (playback time, blend weights, etc.). The type T should match the InstanceData struct defined in the node class.


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