Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | Protected Attributes | Friends | List of all members
castor3d::AnimationT< AnimableHandlerT > Class Template Reference

Animation base class. More...

#include <Animation.hpp>

Inheritance diagram for castor3d::AnimationT< AnimableHandlerT >:
Inheritance graph
[legend]
Collaboration diagram for castor3d::AnimationT< AnimableHandlerT >:
Collaboration graph
[legend]

Public Member Functions

 AnimationT (AnimableHandlerT &handler, AnimationType type, AnimableT< AnimableHandlerT > &animable, castor::String const &name=castor::cuEmptyString)
 Constructor.
 
 AnimationT (AnimableHandlerT &handler, AnimationType type, castor::String const &name=castor::cuEmptyString)
 Constructor.
 
void addKeyFrame (AnimationKeyFrameUPtr keyFrame)
 Adds a keyframe to the animation.
 
AnimationKeyFrameArray::iterator find (castor::Milliseconds const &time)
 Finds a keyframe given a time index.
 
void findKeyFrame (castor::Milliseconds const &time, AnimationKeyFrameArray::iterator &prv, AnimationKeyFrameArray::iterator &cur) const
 Finds a keyframe given a time index.
 
void updateLength ()
 Updates the animation length.
 
bool isEmpty () const
 
size_t size () const
 
AnimationKeyFrameArray::const_iterator begin () const
 
AnimationKeyFrameArray::iterator begin ()
 
AnimationKeyFrameArray::const_iterator end () const
 
AnimationKeyFrameArray::iterator end ()
 
AnimationType getType () const
 
castor::Milliseconds const & getLength () const
 
AnimableT< AnimableHandlerT > * getAnimable () const
 
C3D_API AnimationT (AnimationT &&rhs) noexcept=default
 
C3D_API AnimationToperator= (AnimationT &&rhs) noexcept=delete
 
C3D_API AnimationT (AnimationT const &rhs)=delete
 
C3D_API AnimationToperator= (AnimationT const &rhs)=delete
 
virtual C3D_API ~AnimationT () noexcept=default
 
- Public Member Functions inherited from castor::NamedBaseT< T >
 NamedBaseT (T name) noexcept
 Constructor.
 
T const & getName () const noexcept
 Retrieves the name.
 
void rename (T name) noexcept
 
- Public Member Functions inherited from castor::OwnedBy< AnimableHandlerT >
AnimableHandlerT * getOwner () const
 

Protected Attributes

AnimableT< AnimableHandlerT > * m_animable {}
 
AnimationType m_type { AnimationType::eCount }
 
castor::Milliseconds m_length { 0 }
 
AnimationKeyFrameArray m_keyframes
 
- Protected Attributes inherited from castor::NamedBaseT< T >
m_name
 

Friends

class BinaryWriter< AnimationT >
 
class BinaryParser< AnimationT >
 

Additional Inherited Members

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

Detailed Description

template<typename AnimableHandlerT>
class castor3d::AnimationT< AnimableHandlerT >

Animation base class.

Remarks
An animation is played using an AnimationInstance.

Constructor & Destructor Documentation

◆ AnimationT() [1/4]

template<typename AnimableHandlerT >
C3D_API castor3d::AnimationT< AnimableHandlerT >::AnimationT ( AnimationT< AnimableHandlerT > && rhs)
defaultnoexcept

name Copy / Move.

◆ AnimationT() [2/4]

template<typename AnimableHandlerT >
C3D_API castor3d::AnimationT< AnimableHandlerT >::AnimationT ( AnimationT< AnimableHandlerT > const & rhs)
delete

◆ ~AnimationT()

template<typename AnimableHandlerT >
virtual C3D_API castor3d::AnimationT< AnimableHandlerT >::~AnimationT ( )
virtualdefaultnoexcept

◆ AnimationT() [3/4]

template<typename AnimableHandlerT >
castor3d::AnimationT< AnimableHandlerT >::AnimationT ( AnimableHandlerT & handler,
AnimationType type,
AnimableT< AnimableHandlerT > & animable,
castor::String const & name = castor::cuEmptyString )

Constructor.

Parameters
[in]handlerThe parent handler.
[in]typeThe type of the animation.
[in]animableThe parent animable object.
[in]nameThe name of the animation.

◆ AnimationT() [4/4]

template<typename AnimableHandlerT >
castor3d::AnimationT< AnimableHandlerT >::AnimationT ( AnimableHandlerT & handler,
AnimationType type,
castor::String const & name = castor::cuEmptyString )

Constructor.

Parameters
[in]handlerThe parent handler.
[in]typeThe type of the animation.
[in]nameThe name of the animation.

Member Function Documentation

◆ addKeyFrame()

template<typename AnimableHandlerT >
void castor3d::AnimationT< AnimableHandlerT >::addKeyFrame ( AnimationKeyFrameUPtr keyFrame)

Adds a keyframe to the animation.

Parameters
[in]keyFrameThe keyframe.

◆ begin() [1/2]

template<typename AnimableHandlerT >
AnimationKeyFrameArray::iterator castor3d::AnimationT< AnimableHandlerT >::begin ( )
inline
Returns
The beginning of the key frames.

References castor3d::AnimationT< AnimableHandlerT >::m_keyframes.

◆ begin() [2/2]

template<typename AnimableHandlerT >
AnimationKeyFrameArray::const_iterator castor3d::AnimationT< AnimableHandlerT >::begin ( ) const
inline
Returns
The beginning of the key frames.

References castor3d::AnimationT< AnimableHandlerT >::m_keyframes.

◆ end() [1/2]

template<typename AnimableHandlerT >
AnimationKeyFrameArray::iterator castor3d::AnimationT< AnimableHandlerT >::end ( )
inline
Returns
The end of the key frames.

References castor3d::AnimationT< AnimableHandlerT >::m_keyframes.

◆ end() [2/2]

template<typename AnimableHandlerT >
AnimationKeyFrameArray::const_iterator castor3d::AnimationT< AnimableHandlerT >::end ( ) const
inline
Returns
The end of the key frames.

References castor3d::AnimationT< AnimableHandlerT >::m_keyframes.

◆ find()

template<typename AnimableHandlerT >
AnimationKeyFrameArray::iterator castor3d::AnimationT< AnimableHandlerT >::find ( castor::Milliseconds const & time)

Finds a keyframe given a time index.

Parameters
[in]timeThe time index.

◆ findKeyFrame()

template<typename AnimableHandlerT >
void castor3d::AnimationT< AnimableHandlerT >::findKeyFrame ( castor::Milliseconds const & time,
AnimationKeyFrameArray::iterator & prv,
AnimationKeyFrameArray::iterator & cur ) const

Finds a keyframe given a time index.

Parameters
[in]timeThe time index.
[in,out]prvThe previous keyframe, receives the new previous keyframe, if there is a change.
[in,out]curReceives the current keyframe, receives the new current keyframe, if there is a change.

◆ getAnimable()

template<typename AnimableHandlerT >
AnimableT< AnimableHandlerT > * castor3d::AnimationT< AnimableHandlerT >::getAnimable ( ) const
inline

◆ getLength()

template<typename AnimableHandlerT >
castor::Milliseconds const & castor3d::AnimationT< AnimableHandlerT >::getLength ( ) const
inline
Returns
The animation length.

References castor3d::AnimationT< AnimableHandlerT >::m_length.

◆ getType()

template<typename AnimableHandlerT >
AnimationType castor3d::AnimationT< AnimableHandlerT >::getType ( ) const
inline
Returns
The animation type.

References castor3d::AnimationT< AnimableHandlerT >::m_type.

◆ isEmpty()

template<typename AnimableHandlerT >
bool castor3d::AnimationT< AnimableHandlerT >::isEmpty ( ) const
inline
Returns
true if the key frames list is empty.

References castor3d::AnimationT< AnimableHandlerT >::m_keyframes.

◆ operator=() [1/2]

template<typename AnimableHandlerT >
C3D_API AnimationT & castor3d::AnimationT< AnimableHandlerT >::operator= ( AnimationT< AnimableHandlerT > && rhs)
deletenoexcept

◆ operator=() [2/2]

template<typename AnimableHandlerT >
C3D_API AnimationT & castor3d::AnimationT< AnimableHandlerT >::operator= ( AnimationT< AnimableHandlerT > const & rhs)
delete

◆ size()

template<typename AnimableHandlerT >
size_t castor3d::AnimationT< AnimableHandlerT >::size ( ) const
inline
Returns
The key frames count.

References castor3d::AnimationT< AnimableHandlerT >::m_keyframes.

◆ updateLength()

template<typename AnimableHandlerT >
void castor3d::AnimationT< AnimableHandlerT >::updateLength ( )

Updates the animation length.

Friends And Related Symbol Documentation

◆ BinaryParser< AnimationT >

template<typename AnimableHandlerT >
friend class BinaryParser< AnimationT >
friend

◆ BinaryWriter< AnimationT >

template<typename AnimableHandlerT >
friend class BinaryWriter< AnimationT >
friend

Member Data Documentation

◆ m_animable

template<typename AnimableHandlerT >
AnimableT< AnimableHandlerT >* castor3d::AnimationT< AnimableHandlerT >::m_animable {}
protected

◆ m_keyframes

template<typename AnimableHandlerT >
AnimationKeyFrameArray castor3d::AnimationT< AnimableHandlerT >::m_keyframes
protected

◆ m_length

template<typename AnimableHandlerT >
castor::Milliseconds castor3d::AnimationT< AnimableHandlerT >::m_length { 0 }
protected

The animation length.

Referenced by castor3d::AnimationT< AnimableHandlerT >::getLength().

◆ m_type

template<typename AnimableHandlerT >
AnimationType castor3d::AnimationT< AnimableHandlerT >::m_type { AnimationType::eCount }
protected

The animation type.

Referenced by castor3d::AnimationT< AnimableHandlerT >::getType().


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