Untold Engine  Beta v0.0.16
docs
U4DEngine::U4DAnimation Class Reference

The U4DAnimation class implements 3D animations for 3D model entities. More...

Public Member Functions

 U4DAnimation (U4DModel *uModel)
 Constructor for the animation class. More...
 
 ~U4DAnimation ()
 Destructor for the animation class. More...
 
void play ()
 Method which plays the 3D animation.
 
void playFromKeyframe (int uKeyframe)
 Method which plays the 3D animation.
 
void stop ()
 Method which stops the 3D animation.
 
void pause ()
 pause the 3D animation
 
void runAnimation ()
 Runs the 3D animation.
 
bool isAnimationPlaying ()
 is the current animation playing
 
void setAnimationIsPlaying (bool uValue)
 set if animation is currently playing
 
bool getAnimationIsPlaying ()
 get if the animation is currently playing
 
int getCurrentKeyframe ()
 get the current animation keyframe
 
float getCurrentInterpolationTime ()
 get the current interpolation time
 
float getFPS ()
 get the current animation frame-per-second
 
bool getIsUpdatingKeyframe ()
 is the keyframe currently being updated. More...
 
void setPlayContinuousLoop (bool uValue)
 set if the animation should play in a continous loop
 
bool getPlayContinuousLoop ()
 get if the animation should play in a continuous loop
 
float getDurationOfKeyframe ()
 get the duration of the keyframe
 
void setIsAllowedToBeInterrupted (bool uValue)
 set if the engine is allowed to interrupt the animation while it is playing More...
 
bool getIsAllowedToBeInterrupted ()
 get if the engine is allowed to interrupt the animation while it is playing More...
 

Public Attributes

U4DModelu4dModel
 Pointer to the 3D model entity that the 3D animation will attach to.
 
std::string name
 Name of the 3D animation.
 
float fps
 3D animation frames-per-seconds
 
int keyframe
 3D animation keyframes
 
int keyframeRange
 3D animation keyframe range
 
float interpolationTime
 3D animation keyframe interpolation time
 
U4DMatrix4n modelerAnimationTransform
 Modeler 3D animation transform space. e.g. A Blender 3D animation requires a transform matrix before it can be played in opengl properly.
 
std::vector< ANIMATIONDATAanimationsContainer
 Vector containing all the 3D animation data.
 
U4DBoneDatarootBone
 Pointer to the root bone of the model armature.
 

Detailed Description

The U4DAnimation class implements 3D animations for 3D model entities.

Constructor & Destructor Documentation

◆ U4DAnimation()

U4DEngine::U4DAnimation::U4DAnimation ( U4DModel uModel)

Constructor for the animation class.

it initializes the scheduler and timer. It also gets access to the armature root bone

Parameters
uModel3D model entity to attach the 3D animation to

◆ ~U4DAnimation()

U4DEngine::U4DAnimation::~U4DAnimation ( )

Destructor for the animation class.

releases the scheduler and timer

Member Function Documentation

◆ getIsAllowedToBeInterrupted()

bool U4DEngine::U4DAnimation::getIsAllowedToBeInterrupted ( )

get if the engine is allowed to interrupt the animation while it is playing

if this is set to false, the engine will wait until the animation has finished before it starts playing another animation

◆ getIsUpdatingKeyframe()

bool U4DEngine::U4DAnimation::getIsUpdatingKeyframe ( )

is the keyframe currently being updated.

this is determined by checking if the animation is currently playing and if the interpolation time is not zero

◆ setIsAllowedToBeInterrupted()

void U4DEngine::U4DAnimation::setIsAllowedToBeInterrupted ( bool  uValue)

set if the engine is allowed to interrupt the animation while it is playing

if this is set to false, the engine will wait until the animation has finished before it starts playing another animation