Tiberian Technologies Scripts Reference Revision: 9000
Loading...
Searching...
No Matches
Public Member Functions | List of all members
LoopedAnimationController Class Reference

Controller for looped animations using a subset of frames. More...

#include <LoopedAnimationController.h>

Public Member Functions

 LoopedAnimationController (GameObject *pObj)
 
 ~LoopedAnimationController ()
 
void PlayAnimation (const char *animation, int startFrame, int endFrame, int nRepetitions=0)
 
void StopAnimation ()
 

Detailed Description

Author
Daniel Paul (danpa.nosp@m.ul88.nosp@m.@yaho.nosp@m.o.co.nosp@m..uk)

This class is designed to be a generic controller that can be dropped into a script to control looping animations that do not use the entire set of frames within an animation. By default the animation subsystem in the Renegade engine does not support this functionality and previously the code in this class was duplicated across several scripts that required it.

It works by attaching itself as a listener on the object being animated, thus causing the Animation_Complete function to be called each time the object completes an animation from a start frame to an end frame. It can then restart that animation from the start frame again, thus creating a looping animation.

Constructor & Destructor Documentation

◆ LoopedAnimationController()

LoopedAnimationController::LoopedAnimationController ( GameObject * pObj)

Class constructor - adds itself as a listener to the specified object

Parameters
[in]pObjThe GameObject upon which we want to control looping animations

◆ ~LoopedAnimationController()

LoopedAnimationController::~LoopedAnimationController ( )

Class destructor - removes itself as a listener if the object still exists

Member Function Documentation

◆ PlayAnimation()

void LoopedAnimationController::PlayAnimation ( const char * animation,
int startFrame,
int endFrame,
int nRepetitions = 0 )

Start playing a looped animation on the object we are listening to

Parameters
[in]animationName of the animation to play
[in]startFrameFirst frame number within the animation to be played
[in]endFrameFinal frame number within the animation to be played, before looping back to startFrame
[in]nRepetitionsOptional number of repetitions to play before stopping the animation, or 0 to loop indefinitely

◆ StopAnimation()

void LoopedAnimationController::StopAnimation ( )

Stop the currently playing looped animation on the object, if any