IAnimationClipController

Detailed Description

class IAnimationClipController : public RED::IREDObject

Animation clip controller interface.

@related Playing an Animation Clip, Loading and Playing Skeletal Animations , class RED::AnimationClip, class RED::ISkeletalAnimationController, function RED::Factory::CreateAnimationClipController, function RED::Factory::CreateSkeletalAnimationClipController

A clip controller controls a single RED::IAnimationClip object. It provides functions to play the animation:

  • play;
  • pause;
  • stop;
  • rewind;
  • jump to a given time;
  • etc.

Animation controllers are created with RED::Factory::CreateAnimationClipController and RED::Factory::CreateSkeletalAnimationClipController.

Public Functions

SET_CID(CID_class_REDIAnimationClipController)
virtual RED_RC SetAnimationClip(const RED::AnimationClip &iClip) = 0

Associates an animation clip to the controller.

Parameters:iClip – Animation clip to use.
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC GetAnimationClip(const RED::AnimationClip *&oClip) const = 0

Returns the animation clip associated to this controller.

Parameters:oClip – returned animation clip.
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC GetAnimationClip(RED::AnimationClip *&oClip) = 0

Returns the animation clip associated to this controller.

Parameters:oClip – returned animation clip.
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC GetChannelsCount(unsigned int &oCount) const = 0

Gets the number of channels in the animation controller.

Parameters:oCount – Returned number of channels.
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC GetChannelOutput(const RED::AnimationData *&oOutput, unsigned int iChannel) const = 0

Accesses to the channel output results.

Parameters:
  • oOutput – Returned channel result.
  • iChannel – The channel to get the ouput from.
Returns:

RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC GetDeltaChannelOutput(RED::AnimationData &oOutput, unsigned int iChannel) const = 0

Accesses to the delta channel output between last and current frame.

Parameters:
  • oOutput – Returned delta channel result.
  • iChannel – The channel to get the ouput from.
Returns:

RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC IsEndReached(bool &oEndReached) const = 0

Tests if the animation has reached its end.

Parameters:oEndReached – Returned test.
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC SetLoop(bool iLoop) = 0

Sets the animation in loop mode.

Parameters:iLoop – Loop mode or not.
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC GetLoop(bool &oLoop) const = 0

Tests if the animation is in loop mode.

Parameters:oLoop – Returned loop mode.
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC SetSpeed(double iSpeed) = 0

Sets the animation speed.

Parameters:iSpeed – Returned animation speed (1 = normal speed).
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC GetSpeed(double &oSpeed) const = 0

Gets the animation speed.

Parameters:oSpeed – Animation speed (1 = normal speed).
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC GetDuration(double &oDuration) const = 0

Gets the animation clip duration.

Parameters:oDuration – Returned animation clip duration.
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC GetTime(double &oTime) const = 0

Returns the current time in the animation clip.

Parameters:oTime – Returned animation current time.
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC SetStartTime(double iTime) = 0

Sets the start time in the animation clip.

Parameters:iTime – Time to set.
Returns:RED_OK if the method succeeded,

RED_BAD_PARAM if iTime is lower than 0 or higher than end time. RED_FAIL otherwise.

virtual RED_RC GetStartTime(double &oTime) const = 0

Returns the start time in the animation clip.

Parameters:oTime – Returned time.
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC SetEndTime(double iTime) = 0

Sets the end time in the animation clip.

Parameters:iTime – Time to set.
Returns:RED_OK if the method succeeded,

RED_BAD_PARAM if iTime is lower than start time or higher than the clip duration. RED_FAIL otherwise.

virtual RED_RC GetEndTime(double &oTime) const = 0

Returns the end time in the animation clip.

Parameters:oTime – Returned time.
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC Play() = 0

Plays the animation, continue after a call to Pause.

Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC Pause() = 0

Pauses the animation.

Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC Stop() = 0

Stops and rewind the animation.

Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC Rewind() = 0

Rewinds the animation.

Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC JumpToTime(double iTime) = 0

Move to a specific time in the animation.

Parameters:iTime – animation time to jump to.
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.

virtual RED_RC Update(double iDeltaTime) = 0

Updates the animation.

This function has to be called at each application frame.

Parameters:iDeltaTime – the delta time since the last call to this function.
Returns:RED_OK if the method succeeded,

RED_FAIL otherwise.