Castor3D 0.12.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. More...
 
 AnimationT (AnimableHandlerT &handler, AnimationType type, castor::String const &name=castor::cuEmptyString)
 Constructor. More...
 
void addKeyFrame (AnimationKeyFrameUPtr keyFrame)
 Adds a keyframe to the animation. More...
 
AnimationKeyFrameArray::iterator find (castor::Milliseconds const &time)
 Finds a keyframe given a time index. More...
 
void findKeyFrame (castor::Milliseconds const &time, AnimationKeyFrameArray::iterator &prv, AnimationKeyFrameArray::iterator &cur) const
 Finds a keyframe given a time index. More...
 
void updateLength ()
 Updates the animation length. More...
 
bool isEmpty () 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)=default
 
C3D_API AnimationToperator= (AnimationT &&rhs)=delete
 
C3D_API AnimationT (AnimationT const &rhs)=delete
 
C3D_API AnimationToperator= (AnimationT const &rhs)=delete
 
virtual C3D_API ~AnimationT ()=default
 

Protected Attributes

AnimableT< AnimableHandlerT > * m_animable {}
 
AnimationType m_type { AnimationType::eCount }
 
castor::Milliseconds m_length { 0 }
 
AnimationKeyFrameArray m_keyframes
 

Friends

class BinaryWriter< AnimationT >
 
class BinaryParser< AnimationT >
 

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)
default

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 ( )
virtualdefault

◆ AnimationT() [3/4]

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

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 
)
inline

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)
inline

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)
inline

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
inline

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)
delete

◆ operator=() [2/2]

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

◆ updateLength()

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

Updates the animation length.

Friends And Related Function 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: