Castor3D  ..
Classes | Public Member Functions | Protected Attributes | List of all members
Castor3D::Animation Class Reference

Animation class. More...

+ Inheritance diagram for Castor3D::Animation:
+ Collaboration diagram for Castor3D::Animation:

Classes

class  BinaryParser
 Animation binary loader. More...
 

Public Member Functions

C3D_API Animation (Castor::String const &p_name=Castor::cuEmptyString)
 Constructor. More...
 
C3D_API ~Animation ()
 Destructor. More...
 
C3D_API void Update (real p_tslf)
 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...
 
C3D_API AnimationObjectSPtr AddObject (Castor::String const &p_name, AnimationObjectSPtr p_parent)
 Creates and adds a moving node. More...
 
C3D_API AnimationObjectSPtr AddObject (GeometrySPtr p_object, AnimationObjectSPtr p_parent)
 Creates and adds a moving object. More...
 
C3D_API AnimationObjectSPtr AddObject (BoneSPtr p_bone, AnimationObjectSPtr p_parent)
 Creates and adds a moving bone. More...
 
C3D_API void AddObject (AnimationObjectSPtr p_object, AnimationObjectSPtr p_parent)
 Adds an animated object. More...
 
C3D_API bool HasObject (eANIMATION_OBJECT_TYPE p_type, Castor::String const &p_name) const
 Tells if the animation has the animated object. More...
 
C3D_API AnimationObjectSPtr GetObject (MovableObjectSPtr p_object) const
 Retrieves an animated object. More...
 
C3D_API AnimationObjectSPtr GetObject (BoneSPtr p_bone) const
 Retrieves an animated bone. More...
 
C3D_API void SetInterpolationMode (eINTERPOLATOR_MODE p_mode)
 
C3D_API AnimationSPtr Clone () const
 Clones this animation. More...
 
eANIMATION_STATE GetState () const
 Retrieves the animation state. More...
 
real GetScale () const
 Retrieves the animation time scale. More...
 
bool IsLooped () const
 Retrieves the animation loop status. More...
 
void SetScale (real p_scale)
 Sets the animation time scale. More...
 
void SetLooped (bool p_looped)
 Sets the animation loop status. More...
 
AnimationObjectPtrStrMap const & GetObjects () const
 Retrieves the moving objects count. More...
 

Protected Attributes

real m_currentTime
 The current playing time. More...
 
eANIMATION_STATE m_state
 The current state of the animation. More...
 
real m_scale
 The animation time scale. More...
 
real m_length
 The animation length. More...
 
bool m_looped
 Tells whether or not the animation is looped. More...
 
AnimationObjectPtrArray m_arrayMoving
 The parent moving objects. More...
 
AnimationObjectPtrStrMap m_toMove
 The moving objects. More...
 

Detailed Description

Animation class.

Author
Sylvain DOREMUS
Version
0.1
Date
09/02/2010
Todo:
Write and Read functions.
Remarks
The class which handles an Animation, its length, key frames ...

Constructor & Destructor Documentation

◆ Animation()

C3D_API Castor3D::Animation::Animation ( Castor::String const &  p_name = Castor::cuEmptyString)

Constructor.

Parameters
[in]p_nameThe name of the animation.

◆ ~Animation()

C3D_API Castor3D::Animation::~Animation ( )

Destructor.

Member Function Documentation

◆ AddObject() [1/4]

C3D_API AnimationObjectSPtr Castor3D::Animation::AddObject ( Castor::String const &  p_name,
AnimationObjectSPtr  p_parent 
)

Creates and adds a moving node.

Parameters
[in]p_nameThe node name.
[in]p_parentThe moving object's parent.

◆ AddObject() [2/4]

C3D_API AnimationObjectSPtr Castor3D::Animation::AddObject ( GeometrySPtr  p_object,
AnimationObjectSPtr  p_parent 
)

Creates and adds a moving object.

Parameters
[in]p_objectThe moving object to add.
[in]p_parentThe moving object's parent.

◆ AddObject() [3/4]

C3D_API AnimationObjectSPtr Castor3D::Animation::AddObject ( BoneSPtr  p_bone,
AnimationObjectSPtr  p_parent 
)

Creates and adds a moving bone.

Parameters
[in]p_boneThe bone to add.
[in]p_parentThe moving object's parent.

◆ AddObject() [4/4]

C3D_API void Castor3D::Animation::AddObject ( AnimationObjectSPtr  p_object,
AnimationObjectSPtr  p_parent 
)

Adds an animated object.

Parameters
[in]p_objectThe animated object to add.
[in]p_parentThe moving object's parent.

◆ Clone()

C3D_API AnimationSPtr Castor3D::Animation::Clone ( ) const

Clones this animation.

Returns
The clone.

◆ GetObject() [1/2]

C3D_API AnimationObjectSPtr Castor3D::Animation::GetObject ( MovableObjectSPtr  p_object) const

Retrieves an animated object.

Parameters
[in]p_objectThe movable object to add.

◆ GetObject() [2/2]

C3D_API AnimationObjectSPtr Castor3D::Animation::GetObject ( BoneSPtr  p_bone) const

Retrieves an animated bone.

Parameters
[in]p_boneThe bone.

◆ GetObjects()

AnimationObjectPtrStrMap const& Castor3D::Animation::GetObjects ( ) const
inline

Retrieves the moving objects count.

Returns
The count

References m_toMove.

◆ GetScale()

real Castor3D::Animation::GetScale ( ) const
inline

Retrieves the animation time scale.

Returns
The animation time scale

References m_scale.

◆ GetState()

eANIMATION_STATE Castor3D::Animation::GetState ( ) const
inline

Retrieves the animation state.

Returns
The animation state

References m_state.

◆ HasObject()

C3D_API bool Castor3D::Animation::HasObject ( eANIMATION_OBJECT_TYPE  p_type,
Castor::String const &  p_name 
) const

Tells if the animation has the animated object.

Parameters
[in]p_typeThe object type.
[in]p_nameThe object name.

◆ IsLooped()

bool Castor3D::Animation::IsLooped ( ) const
inline

Retrieves the animation loop status.

Returns
The animation loop status

References m_looped.

◆ Pause()

C3D_API void Castor3D::Animation::Pause ( )

Pauses the animation.

◆ Play()

C3D_API void Castor3D::Animation::Play ( )

Plays the animation.

◆ SetInterpolationMode()

C3D_API void Castor3D::Animation::SetInterpolationMode ( eINTERPOLATOR_MODE  p_mode)
Returns
The key frames interpolation mode.

◆ SetLooped()

void Castor3D::Animation::SetLooped ( bool  p_looped)
inline

Sets the animation loop status.

Parameters
[in]p_loopedThe new value

References m_looped.

◆ SetScale()

void Castor3D::Animation::SetScale ( real  p_scale)
inline

Sets the animation time scale.

Parameters
[in]p_scaleThe new value

References m_scale.

◆ Stop()

C3D_API void Castor3D::Animation::Stop ( )

Stops the animation.

◆ Update()

C3D_API void Castor3D::Animation::Update ( real  p_tslf)

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

Parameters
[in]p_tslfThe time since the last frame.

Member Data Documentation

◆ m_arrayMoving

AnimationObjectPtrArray Castor3D::Animation::m_arrayMoving
protected

The parent moving objects.

◆ m_currentTime

real Castor3D::Animation::m_currentTime
protected

The current playing time.

◆ m_length

real Castor3D::Animation::m_length
protected

The animation length.

◆ m_looped

bool Castor3D::Animation::m_looped
protected

Tells whether or not the animation is looped.

Referenced by IsLooped(), and SetLooped().

◆ m_scale

real Castor3D::Animation::m_scale
protected

The animation time scale.

Referenced by GetScale(), and SetScale().

◆ m_state

eANIMATION_STATE Castor3D::Animation::m_state
protected

The current state of the animation.

Referenced by GetState().

◆ m_toMove

AnimationObjectPtrStrMap Castor3D::Animation::m_toMove
protected

The moving objects.

Referenced by GetObjects().


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