Drag[en]gine Game Engine  1.0
deAnimatorInstance Class Reference

Animator Instance Class. More...

#include <deAnimatorInstance.h>

Inheritance diagram for deAnimatorInstance:
deResource deObject

Public Member Functions

Management
deAnimatorGetAnimator () const
 Animator or NULL if none is set. More...
 
void SetAnimator (deAnimator *animator)
 Set animator or NULL to unset it. More...
 
deComponentGetComponent () const
 Component or NULL if none is set. More...
 
void SetComponent (deComponent *component)
 Set component or NULL to unset it. More...
 
deAnimationGetAnimation () const
 Animation or NULL if none is set. More...
 
void SetAnimation (deAnimation *animation)
 Set animation or NULL to unset it. More...
 
deAnimatorRule::eBlendModes GetBlendMode () const
 Blend mode. More...
 
void SetBlendMode (deAnimatorRule::eBlendModes mode)
 Set blend mode. More...
 
float GetBlendFactor () const
 Blend factor in the range of 0 to 1. More...
 
void SetBlendFactor (float factor)
 Sets the blend factor in the range of 0 to 1. More...
 
bool GetEnableRetargeting () const
 Enable retargeting. More...
 
void SetEnableRetargeting (bool enableRetargeting)
 Set if retargeting is enabled. More...
 
bool GetProtectDynamicBones () const
 Protect dynamic bones from being animated. More...
 
void SetProtectDynamicBones (bool protectDynamicBones)
 Set if dynamic bones are protected from being animated. More...
 
int GetControllerCount () const
 Number of controllers. More...
 
deAnimatorControllerGetControllerAt (int index)
 Controller at index. More...
 
const deAnimatorControllerGetControllerAt (int index) const
 
void NotifyControllerChangedAt (int index)
 Notify peer controller changed. More...
 
void Apply (bool direct=false)
 Apply state of animator to the component if existing. More...
 
void CaptureStateInto (int identifier)
 Capture current state into snapshot rules matching identifier. More...
 
void StoreFrameInto (int identifier, const char *moveName, float moveTime)
 Store animation frame from animation into into rules matching identifier. More...
 
System Peers
deBaseAnimatorAnimatorInstanceGetPeerAnimator () const
 Animator peer or NULL if not set. More...
 
void SetPeerAnimator (deBaseAnimatorAnimatorInstance *peer)
 Set animator peer or NULL if not set. More...
 
- Public Member Functions inherited from deResource
deResourceManagerGetResourceManager () const
 Resource manager or NULL if resource is leaking. More...
 
deEngineGetEngine () const
 Game engine object from resource manager. More...
 
deResourceGetLLManagerPrev () const
 Previous resource in the resource manager linked list. More...
 
void SetLLManagerPrev (deResource *resource)
 Set next resource in the resource manager linked list. More...
 
deResourceGetLLManagerNext () const
 Next resource in the resource manager linked list. More...
 
void SetLLManagerNext (deResource *resource)
 Set next resource in the resource manager linked list. More...
 
void MarkLeaking ()
 Marks the resource leaking. More...
 
 deResource (deResourceManager *resourceManager)
 Create resource. More...
 
- Public Member Functions inherited from deObject
int GetRefCount () const
 Reference count. More...
 
void AddReference ()
 Add reference increasing reference count by 1. More...
 
void FreeReference ()
 Decrease reference count by one and delete object if count reaches 0. More...
 
 deObject ()
 Create object with reference count of 1. More...
 

Constructors and Destructors

 deAnimatorInstance (deAnimatorInstanceManager *manager)
 Create a new animator instance. More...
 
virtual ~deAnimatorInstance ()
 Clean up the animator instance. More...
 

Additional Inherited Members

- Protected Member Functions inherited from deResource
virtual ~deResource ()
 Clean up resource. More...
 
- Protected Member Functions inherited from deObject
virtual ~deObject ()
 Clean up object. More...
 

Detailed Description

Animator Instance Class.

Animators are objects capable of producing an animation state for a component. Every animator composes of a set of rules and controllers which indicate how the final animation state is produced from a set animation. While animators define this production process the animator instance is required to actually apply an animator to a component. This is done for two main reasons. First animators can be shared this way across multiple components without having to create a unique copy for each component. This allows the game to organize animations more efficiently. The second reason is the simple support for animation retargeting. If the rig specified in the animator does not match the rig in the component used in the instance automatic retargeting is conducted. This way the user does not have to think about specifying retargeting explicitely nor does he have to worry about when this is required. The same animator can therefore be used for all kinds of components as long as the rigs used in the components are similar enough to the rig used in the animator (not a requirement but for good results a good practise). More than one animator can act on one component one after the other if complex animations are required that can not be done using one single animator. Animators can not be used at the same time as a collider component if the rig of the component is driven by physics. Animators can though be used if the rig is kinematic.

Author
Pl├╝ss Roland
Version
1.0
Date
2015

Constructor & Destructor Documentation

◆ deAnimatorInstance()

deAnimatorInstance::deAnimatorInstance ( deAnimatorInstanceManager manager)

Create a new animator instance.

Exceptions
deeInvalidParammanager is NULL.

◆ ~deAnimatorInstance()

virtual deAnimatorInstance::~deAnimatorInstance ( )
protectedvirtual

Clean up the animator instance.

Note
Subclasses should set their destructor protected too to avoid users accidently deleting a reference counted object through the object pointer. Only FreeReference() is allowed to delete the object.

Member Function Documentation

◆ Apply()

void deAnimatorInstance::Apply ( bool  direct = false)

Apply state of animator to the component if existing.

Animator modules can decide to calculate this in parallel. If direct is true the application is always done synchronously and is done after the call returns. If direct is false the calculation can be parallel. The affected resources take care of waiting for the result to become ready if required.

Referenced by GetControllerCount().

◆ CaptureStateInto()

void deAnimatorInstance::CaptureStateInto ( int  identifier)

Capture current state into snapshot rules matching identifier.

Referenced by GetControllerCount().

◆ GetAnimation()

deAnimation* deAnimatorInstance::GetAnimation ( ) const
inline

Animation or NULL if none is set.

References SetAnimation().

◆ GetAnimator()

deAnimator* deAnimatorInstance::GetAnimator ( ) const
inline

Animator or NULL if none is set.

References SetAnimator().

◆ GetBlendFactor()

float deAnimatorInstance::GetBlendFactor ( ) const
inline

Blend factor in the range of 0 to 1.

References SetBlendFactor().

◆ GetBlendMode()

deAnimatorRule::eBlendModes deAnimatorInstance::GetBlendMode ( ) const
inline

Blend mode.

References SetBlendMode().

◆ GetComponent()

deComponent* deAnimatorInstance::GetComponent ( ) const
inline

Component or NULL if none is set.

References SetComponent().

◆ GetControllerAt() [1/2]

deAnimatorController& deAnimatorInstance::GetControllerAt ( int  index)

Controller at index.

Exceptions
deeInvalidParamindex is less than 0.
deeInvalidParamindex is greater or equal than GetControllerCount().

Referenced by GetControllerCount().

◆ GetControllerAt() [2/2]

const deAnimatorController& deAnimatorInstance::GetControllerAt ( int  index) const

◆ GetControllerCount()

int deAnimatorInstance::GetControllerCount ( ) const
inline

◆ GetEnableRetargeting()

bool deAnimatorInstance::GetEnableRetargeting ( ) const
inline

Enable retargeting.

References SetEnableRetargeting().

◆ GetPeerAnimator()

deBaseAnimatorAnimatorInstance* deAnimatorInstance::GetPeerAnimator ( ) const
inline

Animator peer or NULL if not set.

References SetPeerAnimator().

◆ GetProtectDynamicBones()

bool deAnimatorInstance::GetProtectDynamicBones ( ) const
inline

Protect dynamic bones from being animated.

References SetProtectDynamicBones().

◆ NotifyControllerChangedAt()

void deAnimatorInstance::NotifyControllerChangedAt ( int  index)

Notify peer controller changed.

Referenced by GetControllerCount().

◆ SetAnimation()

void deAnimatorInstance::SetAnimation ( deAnimation animation)

Set animation or NULL to unset it.

Referenced by GetAnimation().

◆ SetAnimator()

void deAnimatorInstance::SetAnimator ( deAnimator animator)

Set animator or NULL to unset it.

Referenced by GetAnimator().

◆ SetBlendFactor()

void deAnimatorInstance::SetBlendFactor ( float  factor)

Sets the blend factor in the range of 0 to 1.

Referenced by GetBlendFactor().

◆ SetBlendMode()

void deAnimatorInstance::SetBlendMode ( deAnimatorRule::eBlendModes  mode)

Set blend mode.

Exceptions
deeInvalidParammode is not a member of deAnimatorRule::eBlendModes.

Referenced by GetBlendMode().

◆ SetComponent()

void deAnimatorInstance::SetComponent ( deComponent component)

Set component or NULL to unset it.

Referenced by GetComponent().

◆ SetEnableRetargeting()

void deAnimatorInstance::SetEnableRetargeting ( bool  enableRetargeting)

Set if retargeting is enabled.

Referenced by GetEnableRetargeting().

◆ SetPeerAnimator()

void deAnimatorInstance::SetPeerAnimator ( deBaseAnimatorAnimatorInstance peer)

Set animator peer or NULL if not set.

Referenced by GetPeerAnimator().

◆ SetProtectDynamicBones()

void deAnimatorInstance::SetProtectDynamicBones ( bool  protectDynamicBones)

Set if dynamic bones are protected from being animated.

Referenced by GetProtectDynamicBones().

◆ StoreFrameInto()

void deAnimatorInstance::StoreFrameInto ( int  identifier,
const char *  moveName,
float  moveTime 
)

Store animation frame from animation into into rules matching identifier.

If moveName does not exist in the animation a default state is captured.

Exceptions
deeInvalidParammoveName is NULL.

Referenced by GetControllerCount().


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