NcEngine
|
State machine that controls animation transitions for a SkinnedMesh. More...
#include <SkeletalAnimationController.h>
Public Member Functions | |
SkeletalAnimationController (asset::AssetId animationId=asset::NullAssetId, float defaultTransitionDuration=0.3f) | |
Construct a SkeletalAnimationController. More... | |
State Machine Functions | |
Animation transitions are managed automatically based on the properties of current animation states. | |
auto | GetActiveState () const -> AnimationStateId |
auto | GetCurrentAnimationId () const -> uint64_t |
auto | AddState (LoopAnimation &&properties) -> AnimationStateId |
auto | AddState (PlayOnceAnimation &&properties) -> AnimationStateId |
auto | AddState (StopAnimation &&properties) -> AnimationStateId |
auto | GetAnimation (AnimationStateId stateId) const -> asset::AssetId |
void | SetAnimation (AnimationStateId stateId, asset::AssetId animationId) |
auto | GetDefaultTransitionDuration () const -> float |
void | SetDefaultTransitionDuration (float dur) |
Immediate Transition Functions | |
Immediate transitions interrupt the state machine and move to the specified state. Control is returned to the state machine upon the exit condition being met, or the immediate animation finishing, for PlayOnce. | |
void | LoopImmediate (asset::AssetId animId, TransitionCondition &&exitWhen, AnimationStateId exitTo=RootAnimationState, float transitionDuration=UseDefaultTransitionDuration) |
void | PlayOnceImmediate (asset::AssetId animId, AnimationStateId exitTo=RootAnimationState, float transitionDuration=UseDefaultTransitionDuration) |
void | StopImmediate (TransitionCondition &&exitWhen, AnimationStateId exitTo=RootAnimationState, float transitionDuration=UseDefaultTransitionDuration) |
State machine that controls animation transitions for a SkinnedMesh.
internal
|
explicit |
Construct a SkeletalAnimationController.
The controller is initialized with a default state that loops the animation asset specified by animationId. This state is set with the id 'RootState' and cannot not be removed.
void nc::SkeletalAnimationController::LoopImmediate | ( | asset::AssetId | animId, |
TransitionCondition && | exitWhen, | ||
AnimationStateId | exitTo = RootAnimationState , |
||
float | transitionDuration = UseDefaultTransitionDuration |
||
) |
internal
void nc::SkeletalAnimationController::PlayOnceImmediate | ( | asset::AssetId | animId, |
AnimationStateId | exitTo = RootAnimationState , |
||
float | transitionDuration = UseDefaultTransitionDuration |
||
) |
internal
void nc::SkeletalAnimationController::StopImmediate | ( | TransitionCondition && | exitWhen, |
AnimationStateId | exitTo = RootAnimationState , |
||
float | transitionDuration = UseDefaultTransitionDuration |
||
) |
internal