C4 Engine
C4 Engine API Documentation

Animator::ConfigureAnimator

Defined in:  C4Animation.h
Called when an animator is affected by a change in the animation tree for a model.
Prototype

virtual void ConfigureAnimator(void) = 0;

Description
The ConfigureAnimator function is called when the animator tree is being initialized. A custom animator subclass must override this function, and its implementation should call the Animator::AllocateStorage function with the appropriate parameters. The ConfigureAnimator function is called for all subanimators before it is called for the predecessor in the animator tree, so the output information returned for subanimators is valid and may be used to determine the range of nodes actually affected by the animator.

The animator for which the ConfigureAnimator function is called must use the Animator::GetAnimatorTransformNodeStart and Animator::GetAnimatorTransformNodeCount functions to determine the maximum range of nodes that it can actually affect. The values of the nodeStart and nodeCount parameters passed to the Animator::AllocateStorage function must not specify any nodes outside of this range, but they can specify a contiguous subset of nodes to be animated.

An overriding implementation of the ConfigureAnimator function should generally fill its output transform table with pointers to the transforms that it either calculates itself (stored in the animator transform table) or passes through from its subanimators. The Animator::MoveAnimator function then only needs to calculate the new transforms already referenced by entries of the output transform table. The output transform table may contain entries that are nullptr, and in this case no transform animation is applied to the corresponding node.
See Also

Animator::AllocateStorage

Animator::PreprocessAnimator

Animator::MoveAnimator