class RED::ISkeletalAnimationController
Skeletal animation controller interface. More...
#include <REDISkeletalAnimationController.h>
Inherits: IREDObject.
Public functions:
virtual RED_RC | AddSkinnedMesh ( RED::Object * iSkinnedMesh ) = 0 |
virtual RED_RC | ClearSkinnedMeshes ( ) = 0 |
virtual double | GetBlendWeight ( ) const = 0 |
virtual RED_RC | GetBonesCount ( unsigned int & oCount ) const = 0 |
virtual RED_RC | GetBoneTransform ( const RED::AnimationData *& oTransform, unsigned int iBoneIndex ) const = 0 |
virtual unsigned int | GetGroup ( ) const = 0 |
virtual void | GetRootMotionMatrix ( const RED::Matrix *& oMatrix ) const = 0 |
virtual RED_RC | GetSkinnedMesh ( RED::Object *& oSkinnedMesh, unsigned int iSkinnedMeshIndex ) const = 0 |
virtual RED_RC | GetSkinnedMeshesCount ( unsigned int & oSkinnedMeshesCount ) const = 0 |
virtual bool | IsAdditive ( ) const = 0 |
virtual bool | IsBoneAnimated ( int iBoneIndex ) const = 0 |
virtual RED_RC | RemoveSkinnedMesh ( RED::Object * iSkinnedMesh ) = 0 |
virtual void | SetAdditive ( bool iAdditive ) = 0 |
virtual void | SetBlendWeight ( double iBlendWeight ) = 0 |
virtual RED_RC | SetBoneFilter ( int iBoneIndex, bool iFilter, bool iFilterChildrenTree ) = 0 |
virtual void | SetFadeParameters ( double iDuration, double iWeight ) = 0 |
virtual void | SetGroup ( unsigned int iGroup ) = 0 |
virtual void | SetIsAppliedToSkeleton ( bool iIsApplied ) = 0 |
virtual RED_RC | SetRootMotionPolicy ( RED::ROOT_MOTION_COMPONENT iRootComponent, RED::ROOT_MOTION_POLICY iPolicy, bool iExtract ) = 0 |
virtual RED_RC | Update ( double iDeltaTime, const RED::State & iState ) = 0 |
Public static functions:
static RED::CID | GetClassID ( ) |
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
- group;
- fade parameters;
- blend weight;
- additive option;
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
public static RED::CID RED::ISkeletalAnimationController::GetClassID | ( | ) |
public virtual RED_RC RED::ISkeletalAnimationController::AddSkinnedMesh | ( | RED::Object * | iSkinnedMesh | ) = 0 |
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_BAD_PARAM if iSkinnedMesh can't be added to the controller,
RED_FAIL otherwise
public virtual RED_RC RED::ISkeletalAnimationController::ClearSkinnedMeshes | ( | ) = 0 |
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:
public virtual RED_RC RED::ISkeletalAnimationController::GetBonesCount | ( | unsigned int & | oCount | ) const = 0 |
public virtual RED_RC RED::ISkeletalAnimationController::GetBoneTransform | ( | const RED::AnimationData *& | oTransform, |
unsigned int | iBoneIndex | ||
) | const = 0 |
Returns the animation bone transforms.
Parameters:
oTransform: | Returned animation bone transform. |
iBoneIndex: | Bone index to get the transform. |
Returns:
public virtual unsigned int RED::ISkeletalAnimationController::GetGroup | ( | ) const = 0 |
Gets the controller group.
See RED::ISkeletalAnimationController::SetGroup for details about groups.
Returns:
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 int | iSkinnedMeshIndex | ||
) | 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_BAD_PARAM if iSkinnedMeshIndex is incorrect,
RED_FAIL otherwise
public virtual RED_RC RED::ISkeletalAnimationController::GetSkinnedMeshesCount | ( | unsigned int & | oSkinnedMeshesCount | ) const = 0 |
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:
public virtual bool RED::ISkeletalAnimationController::IsBoneAnimated | ( | int | iBoneIndex | ) 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:
public virtual RED_RC RED::ISkeletalAnimationController::RemoveSkinnedMesh | ( | RED::Object * | iSkinnedMesh | ) = 0 |
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:
public virtual void RED::ISkeletalAnimationController::SetAdditive | ( | bool | iAdditive | ) = 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 | ( | double | iBlendWeight | ) = 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 | ( | int | iBoneIndex, |
bool | iFilter, | ||
bool | iFilterChildrenTree | ||
) | = 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_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 | ( | double | iDuration, |
double | iWeight | ||
) | = 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 int | iGroup | ) = 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 | ( | bool | iIsApplied | ) = 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. |
public virtual RED_RC RED::ISkeletalAnimationController::SetRootMotionPolicy | ( | RED::ROOT_MOTION_COMPONENT | iRootComponent, |
RED::ROOT_MOTION_POLICY | iPolicy, | ||
bool | iExtract | ||
) | = 0 |
Sets the root motion policies for the root bone transforms.
For each component of the root bone, this function sets the policy to apply:
- RED::RMP_DEFAULT applies the raw animation result.
- RED::RMP_CUMULATIVE cumulates the animation deltas between each frame.
- RED::RMP_DELTA sets the animation deltas between each frame to the bone.
- RED::RMP_ZERO anihilates the root motion.
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_BAD_PARAM if the method received an invalid parameter,
RED_FAIL otherwise.
public virtual RED_RC RED::ISkeletalAnimationController::Update | ( | double | iDeltaTime, |
const RED::State & | iState | ||
) | = 0 |