![]() |
ezEngine Release 26.3
|
#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) |
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.
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:
| 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().
|
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.