Castor3D 0.16.0
Multiplatform 3D engine
|
#include <AnimationInstance.hpp>
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 AnimationInstance & | operator= (AnimationInstance &&rhs) noexcept=delete |
C3D_API | AnimationInstance (AnimationInstance const &rhs)=delete |
C3D_API AnimationInstance & | operator= (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. | |
|
delete |
|
noexcept |
C3D_API castor3d::AnimationInstance::AnimationInstance | ( | AnimatedObject & | object, |
Animation const & | animation, | ||
bool | looped = false ) |
Constructor.
[in] | object | The parent AnimatedObject. |
[in] | animation | The animation. |
[in] | looped | Is the animation looped or not. |
|
virtualdefaultnoexcept |
Destructor.
|
inline |
References m_animation.
|
inline |
References m_interpolation.
|
inline |
References m_scale.
|
inline |
References m_startingPoint.
|
inline |
References m_state.
|
inline |
References m_stoppingPoint.
|
inline |
References m_looped.
|
deletenoexcept |
name Copy / Move.
|
delete |
C3D_API void castor3d::AnimationInstance::pause | ( | ) |
Pauses the animation.
C3D_API void castor3d::AnimationInstance::play | ( | ) |
Plays the animation.
|
inline |
Sets the animation interpolation mode.
[in] | value | The new value. |
References m_interpolation.
|
inline |
|
inline |
|
inline |
Sets the animation stopping point.
[in] | value | The new value. |
References m_currentTime, and m_startingPoint.
|
inline |
Sets the animation stopping point.
[in] | value | The new value. |
References m_currentTime, and m_stoppingPoint.
C3D_API void castor3d::AnimationInstance::stop | ( | ) |
Stops the animation.
C3D_API void castor3d::AnimationInstance::update | ( | castor::Milliseconds const & | elapsed | ) |
Updates the animation, updates the key frame at the good time index.
[in] | elapsed | The time since the last frame. |
|
protected |
The animation.
Referenced by getAnimation().
|
protected |
The current playing time.
Referenced by setStartingPoint(), and setStoppingPoint().
|
protected |
The interpolation for the animation.
Referenced by getInterpolation(), and setInterpolation().
|
protected |
Tells whether or not the animation is looped.
Referenced by isLooped(), and setLooped().
|
protected |
The animation time scale.
Referenced by getScale(), and setScale().
|
protected |
The starting point.
Referenced by getStartingPoint(), and setStartingPoint().
|
protected |
The current state of the animation.
Referenced by getState().
|
protected |
The stopping point.
Referenced by getStoppingPoint(), and setStoppingPoint().