CrystalSpace

Public API Reference

CS::Animation::iSkeletonAnimation Struct Reference
[Mesh plugins]

Data structure for raw skeletal animations. More...

#include <imesh/animnode/skeleton2anim.h>

Inheritance diagram for CS::Animation::iSkeletonAnimation:

List of all members.

Public Member Functions

virtual ChannelID AddChannel (BoneID bone)=0
 Add a new channel associated with the given bone.
virtual void AddKeyFrame (ChannelID channel, float time, const csQuaternion &rotation, const csVector3 &offset)=0
 Add a key frame at the given time within the given channel.
virtual void AddOrSetKeyFrame (ChannelID channel, float time, const csVector3 &offset)=0
 Add or reset the position at the given time within the given channel.
virtual void AddOrSetKeyFrame (ChannelID channel, float time, const csQuaternion &rotation)=0
 Add or reset the rotation at the given time within the given channel.
virtual void BlendState (AnimatedMeshState *state, float baseWeight, float playbackTime) const =0
 Blend the animation into an animesh state buffer at a specific playback position.
virtual void BlendState (AnimatedMeshState *state, float baseWeight, float playbackTime, bool isPlayingCyclic) const =0
 Blend the animation into a skeletal state buffer at a specific playback position.
virtual void ConvertFrameSpace (CS::Animation::iSkeletonFactory *skeleton)=0
 Convert the frames from bone space to bind space if needed.
virtual ChannelID FindChannel (BoneID bone) const =0
 Find the channel associated with a specific bone, if any.
virtual BoneID GetChannelBone (ChannelID channel) const =0
 Get the id of the bone associated with the given channel.
virtual size_t GetChannelCount () const =0
 Get the count of channels in this animation.
virtual float GetDuration () const =0
 Get the total duration of the animation, ie the difference between the first and last key frame of the animation, in seconds.
virtual bool GetFramesInBindSpace () const =0
 Return whether or not the frames are defined in bind space or in bone space.
virtual void GetKeyFrame (ChannelID channel, KeyFrameID keyframe, BoneID &bone, float &time, csQuaternion &rotation, csVector3 &offset)=0
 Get a specific key frame within the given channel.
virtual size_t GetKeyFrameCount (ChannelID channel) const =0
 Get the total number of key frames in the given channel.
virtual const char * GetName () const =0
 Get the name of the animation.
virtual void GetTwoKeyFrames (ChannelID channel, float time, BoneID &bone, float &timeBefore, csQuaternion &beforeRot, csVector3 &beforeOffset, float &timeAfter, csQuaternion &afterRot, csVector3 &afterOffset)=0
 Get the two key frames on "either side" of the given time.
virtual void RemoveChannel (ChannelID channel)=0
 Remove the given channel from this animation.
virtual void SetChannelBone (ChannelID channel, BoneID bone)=0
 Set the id of the bone associated with the given channel.
virtual void SetFramesInBindSpace (bool isBindSpace)=0
 Set whether the data defined with AddKeyFrame() are in bind space or in bone space.
virtual void SetKeyFrame (ChannelID channel, KeyFrameID keyframe, const csQuaternion &rotation, const csVector3 &offset)=0
 Reset the rotation and position values of a given key frame.

Detailed Description

Data structure for raw skeletal animations.

It defines a base animation to be played eg by a CS::Animation::iSkeletonAnimationNode.

Each animation is made up of one or more channels, where each channel is associated to a bone of the skeleton. Each channel can contain one or more key frames defining the configuration of the bone at a given time. When the animation is played by an CS::Animation::iSkeletonAnimationNode, it calls the BlendState() method who will blend the configuration of each bone between the two closest key frames of the given playback time.

It is allowed to use negative time stamps for the key frames, the main drawback is that the playbackTime parameter of the BlendState() method will then be shifted, and that you must therefore use it more carefully.

When playing the animation and for a given channel, if there is no key frame defined before the current playing time, then the last key frame will be used as the first closest key frame. Similarly, if there is no key frame defined after the current playing time, then the first key frame will be used as the second closest key frame.

This behavior of the transition bewteen the last and the first key frames is useful for cyclic animations but may be surprising for animations that are not cyclic. Therefore, a good practice when defining non cyclic animations is to always define a key frame for all channels at the first and last key frame time.

Main creators of instances implementing this interface:

Main ways to get pointers to this interface:

Main users of this interface:

Definition at line 272 of file skeleton2anim.h.


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

Generated for Crystal Space 2.0 by doxygen 1.6.1