class RED::ISkeletalAnimationController

Skeletal animation controller interface. More...

#include <REDISkeletalAnimationController.h>

Inherits: IREDObject.

Public functions:

virtual RED_RCAddSkinnedMesh ( RED::Object * iSkinnedMesh ) = 0
virtual RED_RCClearSkinnedMeshes ( ) = 0
virtual doubleGetBlendWeight ( ) const = 0
virtual RED_RCGetBonesCount ( unsigned int & oCount ) const = 0
virtual RED_RCGetBoneTransform ( const RED::AnimationData *& oTransform, unsigned int iBoneIndex ) const = 0
virtual unsigned intGetGroup ( ) const = 0
virtual voidGetRootMotionMatrix ( const RED::Matrix *& oMatrix ) const = 0
virtual RED_RCGetSkinnedMesh ( RED::Object *& oSkinnedMesh, unsigned int iSkinnedMeshIndex ) const = 0
virtual RED_RCGetSkinnedMeshesCount ( unsigned int & oSkinnedMeshesCount ) const = 0
virtual boolIsAdditive ( ) const = 0
virtual boolIsBoneAnimated ( int iBoneIndex ) const = 0
virtual RED_RCRemoveSkinnedMesh ( RED::Object * iSkinnedMesh ) = 0
virtual voidSetAdditive ( bool iAdditive ) = 0
virtual voidSetBlendWeight ( double iBlendWeight ) = 0
virtual RED_RCSetBoneFilter ( int iBoneIndex, bool iFilter, bool iFilterChildrenTree ) = 0
virtual voidSetFadeParameters ( double iDuration, double iWeight ) = 0
virtual voidSetGroup ( unsigned int iGroup ) = 0
virtual voidSetIsAppliedToSkeleton ( bool iIsApplied ) = 0
virtual RED_RCSetRootMotionPolicy ( RED::ROOT_MOTION_COMPONENT iRootComponent, RED::ROOT_MOTION_POLICY iPolicy, bool iExtract ) = 0
virtual RED_RCUpdate ( double iDeltaTime, const RED::State & iState ) = 0

Public static functions:

static RED::CIDGetClassID ( )

Detailed description:

Skeletal animation controller interface.

This interface provides functions to control a skeleton animation. It also provides several parameters used by the RED::ISkeletalAnimationBlender object

The bone filtering functions prevents the animation of some bones in the skeletons if desired.

Skeletal animation controllers are created with RED::Factory::CreateSkeletalAnimationClipController and RED::Factory::CreateSkeletalAnimationBlender.

Functions documentation

Associates a skinned mesh to this controller.

This function does nothing if the controller already contains the given skinned mesh.

This function returns RED_BAD_PARAM if iSkinnedMesh does not share the same skeleton with the meshes already registered.

Parameters:

iSkinnedMesh:Skinned mesh as a RED::IMeshShape.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if iSkinnedMesh can't be added to the controller,
RED_FAIL otherwise

Removes all the skinned meshes from this controller.

Returns:

RED_OK if the operation has succeeded,
RED_FAIL otherwise
public virtual double RED::ISkeletalAnimationController::GetBlendWeight() const = 0

Returns the animation blend weight.

The blend weight is the amount of this animation used in the RED::ISkeletalAnimationBlender. The blend weight value must range from 0 to 1.

Returns:

the animation blend weight.
public virtual RED_RC RED::ISkeletalAnimationController::GetBonesCount(unsigned int &oCount) const = 0

Returns the number of bones in the animated skeleton.

Parameters:

oCount:Returned number of bones.

Returns:

RED_OK if the operation has succeeded,
RED_FAIL otherwise
public virtual RED_RC RED::ISkeletalAnimationController::GetBoneTransform(const RED::AnimationData *&oTransform,
unsigned intiBoneIndex
)const = 0

Returns the animation bone transforms.

Parameters:

oTransform:Returned animation bone transform.
iBoneIndex:Bone index to get the transform.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if iBoneIndex is incorrect,
RED_FAIL otherwise
public virtual unsigned int RED::ISkeletalAnimationController::GetGroup() const = 0

Gets the controller group.

See RED::ISkeletalAnimationController::SetGroup for details about groups.

Returns:

the controller group.
public virtual void RED::ISkeletalAnimationController::GetRootMotionMatrix(const RED::Matrix *&oMatrix) const = 0

Returns the extracted root motion matrix.

If the RED::ISkeletalAnimationController::SetRootMotionPolicy function had been called with the option to extract the root motion, the user can retrieve it via this function.

Parameters:

oMatrix:The output extracted root motion transform.
public virtual RED_RC RED::ISkeletalAnimationController::GetSkinnedMesh(RED::Object *&oSkinnedMesh,
unsigned intiSkinnedMeshIndex
)const = 0

Returns the skinned mesh associated to this controller.

Parameters:

oSkinnedMesh:Returned skinned mesh as a RED::IMeshShape.
iSkinnedMeshIndex:index of the skinned mesh to retrieve.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if iSkinnedMeshIndex is incorrect,
RED_FAIL otherwise
public virtual RED_RC RED::ISkeletalAnimationController::GetSkinnedMeshesCount(unsigned int &oSkinnedMeshesCount) const = 0

Returns the number of skinned meshes associated to this controller.

Parameters:

oSkinnedMeshesCount:Returned number of skinned meshes.

Returns:

RED_OK if the operation has succeeded,
RED_FAIL otherwise
public virtual bool RED::ISkeletalAnimationController::IsAdditive() const = 0

Tells if the animation is additive or not.

Used in a RED::ISkeletalAnimationBlender, an animation can be additive. If so, it will be added to other animations during the blending instead of classicaly interpolated.

Returns:

true if the animation is additive, false otherwise.
public virtual bool RED::ISkeletalAnimationController::IsBoneAnimated(intiBoneIndex) const = 0

Tests if a bone is filtered or not.

See RED::ISkeletalAnimationController::SetBoneFilter for details about bone filtering.

Parameters:

iBoneIndex:Bone index to test filtering.

Returns:

true if the bone is filtered, false if not.

Removes a skinned mesh from this controller.

This function does nothing if the controller does not contain the given skinned mesh.

Parameters:

iSkinnedMesh:Skinned mesh to remove as a RED::IMeshShape.

Returns:

RED_OK if the operation has succeeded,
RED_FAIL otherwise
public virtual void RED::ISkeletalAnimationController::SetAdditive(booliAdditive) = 0

Sets the animation additive.

See RED::ISkeletalAnimationController::IsAdditive for informations about additive animations.

Parameters:

iAdditive:true to set the animation additive, false otherwise.
public virtual void RED::ISkeletalAnimationController::SetBlendWeight(doubleiBlendWeight) = 0

Sets the animation blend weight.

The blend weight is the amount of this animation used in the RED::ISkeletalAnimationBlender. The blend weight value must range from 0 to 1.

Parameters:

iBlendWeight:The animation blend weight.
public virtual RED_RC RED::ISkeletalAnimationController::SetBoneFilter(intiBoneIndex,
booliFilter,
booliFilterChildrenTree
) = 0

Filters a bone and its hierarchy from the animation.

When a bone is filtered, it is not influenced by the animation controller. Filtering bones is generally used to animate skeleton parts separately. Each part influenced by a different animation controller.

Parameters:

iBoneIndex:Bone index to filter.
iFilter:true to exclude the bone from the animation, false otherwise.
iFilterChildrenTree:If true, applies iFilter to the bone children and propagates it to the tree.

Returns:

RED_OK if the operation has succeeded,
RED_BAD_PARAM if iBoneIndex is incorrect,
RED_WORKFLOW_ERROR if the controller doesn't contain any mesh,
RED_FAIL otherwise
public virtual void RED::ISkeletalAnimationController::SetFadeParameters(doubleiDuration,
doubleiWeight
) = 0

Sets the fading parameters.

The fade parameters control the fade-in and fade-out of the animation. After calling this function and RED::ISkeletalAnimationController::Update the animation weight will vary to iWeight in a iDuration period.

Parameters:

iDuration:the fade duration.
iWeight:the fade target animation weight.
public virtual void RED::ISkeletalAnimationController::SetGroup(unsigned intiGroup) = 0

Sets the controller group.

In a RED::ISkeletalAnimationBlender, animation controllers can be grouped. A group defines a skeleton part. All the controllers in the same group are faded out after a call to RED::ISkeletalAnimationBlender::BlendTo whereas other groups are not faded.

Parameters:

iGroup:the controller group.
public virtual void RED::ISkeletalAnimationController::SetIsAppliedToSkeleton(booliIsApplied) = 0

Applies the animation directly to a skeleton.

If applied to the skeleton, the animation results are applied to the bones of the skeleton. If not, the animation results are stored internally to be used elsewhere.

Parameters:

iIsApplied:true to apply the animation to the skeleton, false otherwise.

Sets the root motion policies for the root bone transforms.

For each component of the root bone, this function sets the policy to apply:

The iExtract parameter tells if the root bone component must be applied to the associated skinned meshes or not. If not, the user can retrieve the extracted root transform with the RED::ISkeletalAnimationController::GetRootMotionMatrix function (and optionnaly apply it to any parent shape of the mesh).

Parameters:

iRootComponent:The component of the root bone on which we set the policy.
iPolicy:The policy to apply.
iExtract:true to extract the root bone component, false to apply it to the mesh.

Returns:

RED_OK when the operation succeeded,
RED_BAD_PARAM if the method received an invalid parameter,
RED_FAIL otherwise.
public virtual RED_RC RED::ISkeletalAnimationController::Update(doubleiDeltaTime,
const RED::State &iState
) = 0

Updates the animation controller.

This method must be called at each frame to update the animation.

Parameters:

iDeltaTime:Time elapsed since last frame.
iState:The current transaction parameter.

Returns:

RED_OK if the operation has succeeded,
RED_FAIL otherwise