Castor3D 0.16.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 const &animation, bool looped=false)
 Constructor.
 
virtual C3D_API ~AnimationInstance () noexcept=default
 Destructor.
 
C3D_API void update (castor::Milliseconds const &elapsed)
 Updates the animation, updates the key frame at the good time index.
 
C3D_API void play ()
 Plays the animation.
 
C3D_API void pause ()
 Pauses the animation.
 
C3D_API void stop ()
 Stops the animation.
 
AnimationState getState () const
 
float getScale () const
 
void setScale (float value)
 Sets the animation time scale.
 
castor::Milliseconds getStartingPoint () const
 
void setStartingPoint (castor::Milliseconds value)
 Sets the animation stopping point.
 
castor::Milliseconds getStoppingPoint () const
 
void setStoppingPoint (castor::Milliseconds value)
 Sets the animation stopping point.
 
bool isLooped () const
 
void setLooped (bool value)
 Sets the animation loop status.
 
InterpolatorType getInterpolation () const
 
void setInterpolation (InterpolatorType value)
 Sets the animation interpolation mode.
 
Animation const & getAnimation () const
 
C3D_API AnimationInstanceoperator= (AnimationInstance &&rhs) noexcept=delete
 
C3D_API AnimationInstance (AnimationInstance const &rhs)=delete
 
C3D_API AnimationInstanceoperator= (AnimationInstance const &rhs)=delete
 
C3D_API AnimationInstance (AnimationInstance &&rhs) noexcept
 
- Public Member Functions inherited from castor::OwnedBy< AnimatedObject >
AnimatedObject * getOwner () const
 

Protected Attributes

Animation const & m_animation
 
float m_scale { 1.0f }
 
std::atomic_bool m_looped
 
castor::Milliseconds m_startingPoint { 0 }
 
castor::Milliseconds m_stoppingPoint { 0 }
 
castor::Milliseconds m_currentTime { 0 }
 
AnimationState m_state { AnimationState::eStopped }
 
InterpolatorType m_interpolation { InterpolatorType::eLinear }
 

Additional Inherited Members

- Protected Member Functions inherited from castor::OwnedBy< AnimatedObject >
 OwnedBy (AnimatedObject &owner)
 Constructor.
 

Constructor & Destructor Documentation

◆ AnimationInstance() [1/3]

C3D_API castor3d::AnimationInstance::AnimationInstance ( AnimationInstance const & rhs)
delete

◆ AnimationInstance() [2/3]

C3D_API castor3d::AnimationInstance::AnimationInstance ( AnimationInstance && rhs)
noexcept

◆ AnimationInstance() [3/3]

C3D_API castor3d::AnimationInstance::AnimationInstance ( AnimatedObject & object,
Animation const & animation,
bool looped = false )

Constructor.

Parameters
[in]objectThe parent AnimatedObject.
[in]animationThe animation.
[in]loopedIs the animation looped or not.

◆ ~AnimationInstance()

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

Destructor.

Member Function Documentation

◆ getAnimation()

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

References m_animation.

◆ getInterpolation()

InterpolatorType castor3d::AnimationInstance::getInterpolation ( ) const
inline
Returns
The animation interpolation mode.

References m_interpolation.

◆ 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.

◆ operator=() [1/2]

C3D_API AnimationInstance & castor3d::AnimationInstance::operator= ( AnimationInstance && rhs)
deletenoexcept

name Copy / Move.

◆ operator=() [2/2]

C3D_API AnimationInstance & castor3d::AnimationInstance::operator= ( AnimationInstance const & rhs)
delete

◆ pause()

C3D_API void castor3d::AnimationInstance::pause ( )

Pauses the animation.

◆ play()

C3D_API void castor3d::AnimationInstance::play ( )

Plays the animation.

◆ setInterpolation()

void castor3d::AnimationInstance::setInterpolation ( InterpolatorType value)
inline

Sets the animation interpolation mode.

Parameters
[in]valueThe new value.

References m_interpolation.

◆ 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_interpolation

InterpolatorType castor3d::AnimationInstance::m_interpolation { InterpolatorType::eLinear }
protected

The interpolation for the animation.

Referenced by getInterpolation(), and setInterpolation().

◆ m_looped

std::atomic_bool castor3d::AnimationInstance::m_looped
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: