Castor3D 0.12.0
Multiplatform 3D engine
Public Member Functions | Protected Attributes | List of all members
castor3d::AnimationInstance Class Referenceabstract

#include <AnimationInstance.hpp>

Inheritance diagram for castor3d::AnimationInstance:
Inheritance graph
[legend]
Collaboration diagram for castor3d::AnimationInstance:
Collaboration graph
[legend]

Public Member Functions

C3D_API AnimationInstance (AnimatedObject &object, Animation &animation)
 Constructor. More...
 
virtual C3D_API ~AnimationInstance ()=default
 Destructor. More...
 
C3D_API void update (castor::Milliseconds const &elapsed)
 Updates the animation, updates the key frame at the good time index. More...
 
C3D_API void play ()
 Plays the animation. More...
 
C3D_API void pause ()
 Pauses the animation. More...
 
C3D_API void stop ()
 Stops the animation. More...
 
AnimationState getState () const
 
float getScale () const
 
void setScale (float value)
 Sets the animation time scale. More...
 
castor::Milliseconds getStartingPoint () const
 
void setStartingPoint (castor::Milliseconds value)
 Sets the animation stopping point. More...
 
castor::Milliseconds getStoppingPoint () const
 
void setStoppingPoint (castor::Milliseconds value)
 Sets the animation stopping point. More...
 
bool isLooped () const
 
void setLooped (bool value)
 Sets the animation loop status. More...
 
Animation const & getAnimation () const
 

Protected Attributes

Animation const & m_animation
 
float m_scale { 1.0f }
 
bool m_looped { false }
 
castor::Milliseconds m_startingPoint { 0 }
 
castor::Milliseconds m_stoppingPoint { 0 }
 
castor::Milliseconds m_currentTime { 0 }
 
AnimationState m_state { AnimationState::eStopped }
 

Constructor & Destructor Documentation

◆ AnimationInstance()

C3D_API castor3d::AnimationInstance::AnimationInstance ( AnimatedObject object,
Animation animation 
)

Constructor.

Parameters
[in]objectThe parent AnimatedObject.
[in]animationThe animation.

◆ ~AnimationInstance()

virtual C3D_API castor3d::AnimationInstance::~AnimationInstance ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getAnimation()

Animation const & castor3d::AnimationInstance::getAnimation ( ) const
inline
Returns
The animation.

References m_animation.

◆ getScale()

float castor3d::AnimationInstance::getScale ( ) const
inline
Returns
The animation time scale.

References m_scale.

◆ getStartingPoint()

castor::Milliseconds castor3d::AnimationInstance::getStartingPoint ( ) const
inline
Returns
The animation stopping point.

References m_startingPoint.

◆ getState()

AnimationState castor3d::AnimationInstance::getState ( ) const
inline
Returns
The animation state.

References m_state.

◆ getStoppingPoint()

castor::Milliseconds castor3d::AnimationInstance::getStoppingPoint ( ) const
inline
Returns
The animation stopping point.

References m_stoppingPoint.

◆ isLooped()

bool castor3d::AnimationInstance::isLooped ( ) const
inline
Returns
The animation loop status.

References m_looped.

◆ pause()

C3D_API void castor3d::AnimationInstance::pause ( )

Pauses the animation.

◆ play()

C3D_API void castor3d::AnimationInstance::play ( )

Plays the animation.

◆ setLooped()

void castor3d::AnimationInstance::setLooped ( bool  value)
inline

Sets the animation loop status.

Parameters
[in]valueThe new value

References m_looped.

◆ setScale()

void castor3d::AnimationInstance::setScale ( float  value)
inline

Sets the animation time scale.

Parameters
[in]valueThe new value

References m_scale.

◆ setStartingPoint()

void castor3d::AnimationInstance::setStartingPoint ( castor::Milliseconds  value)
inline

Sets the animation stopping point.

Parameters
[in]valueThe new value.

References m_currentTime, and m_startingPoint.

◆ setStoppingPoint()

void castor3d::AnimationInstance::setStoppingPoint ( castor::Milliseconds  value)
inline

Sets the animation stopping point.

Parameters
[in]valueThe new value.

References m_currentTime, and m_stoppingPoint.

◆ stop()

C3D_API void castor3d::AnimationInstance::stop ( )

Stops the animation.

◆ update()

C3D_API void castor3d::AnimationInstance::update ( castor::Milliseconds const &  elapsed)

Updates the animation, updates the key frame at the good time index.

Parameters
[in]elapsedThe time since the last frame.

Member Data Documentation

◆ m_animation

Animation const& castor3d::AnimationInstance::m_animation
protected

The animation.

Referenced by getAnimation().

◆ m_currentTime

castor::Milliseconds castor3d::AnimationInstance::m_currentTime { 0 }
protected

The current playing time.

Referenced by setStartingPoint(), and setStoppingPoint().

◆ m_looped

bool castor3d::AnimationInstance::m_looped { false }
protected

Tells whether or not the animation is looped.

Referenced by isLooped(), and setLooped().

◆ m_scale

float castor3d::AnimationInstance::m_scale { 1.0f }
protected

The animation time scale.

Referenced by getScale(), and setScale().

◆ m_startingPoint

castor::Milliseconds castor3d::AnimationInstance::m_startingPoint { 0 }
protected

The starting point.

Referenced by getStartingPoint(), and setStartingPoint().

◆ m_state

AnimationState castor3d::AnimationInstance::m_state { AnimationState::eStopped }
protected

The current state of the animation.

Referenced by getState().

◆ m_stoppingPoint

castor::Milliseconds castor3d::AnimationInstance::m_stoppingPoint { 0 }
protected

The stopping point.

Referenced by getStoppingPoint(), and setStoppingPoint().


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