Castor3D  ..
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Castor3D::AnimationObject Class Referenceabstract

Class which represents the moving things. More...

+ Inheritance diagram for Castor3D::AnimationObject:
+ Collaboration diagram for Castor3D::AnimationObject:

Classes

class  BinaryParser
 MovingObjectBase binary loader. More...
 

Public Member Functions

virtual C3D_API ~AnimationObject ()
 Destructor. More...
 
C3D_API void AddChild (AnimationObjectSPtr p_object)
 Adds a child to this object. More...
 
C3D_API void Update (real p_time, Castor::Matrix4x4r const &p_transformations)
 Updates the object, applies the transformations at given time. More...
 
virtual C3D_API Castor::String const & GetName () const =0
 Retrieves the object name. More...
 
C3D_API KeyFrameAddKeyFrame (real p_from, Castor::Point3r const &p_translate=Castor::Point3r{}, Castor::Quaternion const &p_rotate=Castor::Quaternion{}, Castor::Point3r const &p_scale=Castor::Point3r{ 1.0_r, 1.0_r, 1.0_r })
 Creates a scaling key frame and adds it to the list. More...
 
C3D_API void RemoveKeyFrame (real p_time)
 Deletes the scaling key frame at time index p_time. More...
 
C3D_API void SetInterpolationMode (eINTERPOLATOR_MODE p_mode)
 
C3D_API AnimationObjectSPtr Clone (Animation &p_animation)
 Clones this moving thing. More...
 
eINTERPOLATOR_MODE GetInterpolationMode () const
 
KeyFrameArray const & GetKeyFrames () const
 
real GetLength () const
 
eANIMATION_OBJECT_TYPE GetType () const
 
void SetLength (real p_length)
 Sets the animation length. More...
 
Castor::Matrix4x4r const & GetFinalTransform () const
 The final object's animations transformation. More...
 
Castor::Matrix4x4r const & GetNodeTransform () const
 Retrieves the animation node transformation. More...
 
void SetNodeTransform (Castor::Matrix4x4r const &p_transform)
 Sets the animation node transformation. More...
 
bool HasKeyFrames () const
 Tells whether or not the object has keyframes. More...
 
AnimationObjectPtrArray const & GetChildren () const
 

Protected Member Functions

C3D_API AnimationObject (eANIMATION_OBJECT_TYPE p_type)
 Constructor. More...
 
C3D_API AnimationObject (AnimationObject const &p_rhs)
 Copy constructor. More...
 
virtual C3D_API void DoApply ()=0
 Updates the object, applies the transformations matrix. More...
 
virtual C3D_API AnimationObjectSPtr DoClone (Animation &p_animation)=0
 Clones this moving thing. More...
 

Protected Attributes

eANIMATION_OBJECT_TYPE m_type
 The moving thing type. More...
 
eINTERPOLATOR_MODE m_mode = eINTERPOLATOR_MODE_NONE
 The interpolation mode. More...
 
std::unique_ptr< Point3rInterpolatorm_pointInterpolator
 The point interpolator. More...
 
std::unique_ptr< QuaternionInterpolatorm_quaternionInterpolator
 The quaternion interpolator. More...
 
KeyFrameArray m_keyframes
 The key frames. More...
 
KeyFrameArray::const_iterator m_prev
 Iterator to the previous keyframe (when playing the animation). More...
 
KeyFrameArray::const_iterator m_curr
 Iterator to the current keyframe (when playing the animation). More...
 
Castor::Matrix4x4r m_nodeTransform
 Animation node transformations. More...
 
real m_length
 The animation length. More...
 
AnimationObjectPtrArray m_children
 The objects depending on this one. More...
 
Castor::Matrix4x4r m_cumulativeTransform
 The cumulative animation transformations. More...
 
Castor::Matrix4x4r m_finalTransform
 The matrix holding transformation at current time. More...
 

Detailed Description

Class which represents the moving things.

Author
Sylvain DOREMUS
Version
0.1
Date
09/02/2010
Remarks
Manages translation, scaling, rotation of the thing.

Constructor & Destructor Documentation

◆ AnimationObject() [1/2]

C3D_API Castor3D::AnimationObject::AnimationObject ( eANIMATION_OBJECT_TYPE  p_type)
protected

Constructor.

Parameters
[in]p_typeThe moving thing type.

◆ AnimationObject() [2/2]

C3D_API Castor3D::AnimationObject::AnimationObject ( AnimationObject const &  p_rhs)
protected

Copy constructor.

◆ ~AnimationObject()

virtual C3D_API Castor3D::AnimationObject::~AnimationObject ( )
virtual

Destructor.

Member Function Documentation

◆ AddChild()

C3D_API void Castor3D::AnimationObject::AddChild ( AnimationObjectSPtr  p_object)

Adds a child to this object.

Remarks
The child's transformations are affected by this object's ones.
Parameters
[in]p_objectThe child.

◆ AddKeyFrame()

C3D_API KeyFrame& Castor3D::AnimationObject::AddKeyFrame ( real  p_from,
Castor::Point3r const &  p_translate = Castor::Point3r{},
Castor::Quaternion const &  p_rotate = Castor::Quaternion{},
Castor::Point3r const &  p_scale = Castor::Point3r{ 1.0_r, 1.0_r, 1.0_r } 
)

Creates a scaling key frame and adds it to the list.

Remarks
If a key frame with the same starting time already exists, it is returned, but not modified.
Parameters
[in]p_fromThe starting time.
[in]p_translateThe translation at start time.
[in]p_rotateThe rotation at start time.
[in]p_scaleThe scaling at start time.

◆ Clone()

C3D_API AnimationObjectSPtr Castor3D::AnimationObject::Clone ( Animation p_animation)

Clones this moving thing.

Parameters
[out]p_animationThe clone is added to this animation.
Returns
The clone.

◆ DoApply()

virtual C3D_API void Castor3D::AnimationObject::DoApply ( )
protectedpure virtual

Updates the object, applies the transformations matrix.

◆ DoClone()

virtual C3D_API AnimationObjectSPtr Castor3D::AnimationObject::DoClone ( Animation p_animation)
protectedpure virtual

Clones this moving thing.

Parameters
[out]p_animationThe clone is added to this animation.
Returns
The clone.

◆ GetChildren()

AnimationObjectPtrArray const& Castor3D::AnimationObject::GetChildren ( ) const
inline
Returns
The children array.

References m_children.

◆ GetFinalTransform()

Castor::Matrix4x4r const& Castor3D::AnimationObject::GetFinalTransform ( ) const
inline

The final object's animations transformation.

References m_finalTransform.

◆ GetInterpolationMode()

eINTERPOLATOR_MODE Castor3D::AnimationObject::GetInterpolationMode ( ) const
inline
Returns
The scaling key frames interpolation mode.

References m_mode.

◆ GetKeyFrames()

KeyFrameArray const& Castor3D::AnimationObject::GetKeyFrames ( ) const
inline
Returns
The key frames.

References m_keyframes.

◆ GetLength()

real Castor3D::AnimationObject::GetLength ( ) const
inline
Returns
The animation length.

References m_length.

◆ GetName()

virtual C3D_API Castor::String const& Castor3D::AnimationObject::GetName ( ) const
pure virtual

Retrieves the object name.

Returns
The name.

Implemented in Castor3D::SkeletonAnimationNode, Castor3D::SkeletonAnimationBone, and Castor3D::SkeletonAnimationObject.

◆ GetNodeTransform()

Castor::Matrix4x4r const& Castor3D::AnimationObject::GetNodeTransform ( ) const
inline

Retrieves the animation node transformation.

Returns
The value.

References m_nodeTransform.

◆ GetType()

eANIMATION_OBJECT_TYPE Castor3D::AnimationObject::GetType ( ) const
inline
Returns
The moving object type.

References m_type.

◆ HasKeyFrames()

bool Castor3D::AnimationObject::HasKeyFrames ( ) const
inline

Tells whether or not the object has keyframes.

Returns
false if no keyframes.

References m_keyframes.

◆ RemoveKeyFrame()

C3D_API void Castor3D::AnimationObject::RemoveKeyFrame ( real  p_time)

Deletes the scaling key frame at time index p_time.

Parameters
[in]p_timeThe time index.

◆ SetInterpolationMode()

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

◆ SetLength()

void Castor3D::AnimationObject::SetLength ( real  p_length)
inline

Sets the animation length.

Parameters
[in]p_lengthThe new value.

References m_length.

◆ SetNodeTransform()

void Castor3D::AnimationObject::SetNodeTransform ( Castor::Matrix4x4r const &  p_transform)
inline

Sets the animation node transformation.

Parameters
[in]p_transformThe new value.

References m_nodeTransform.

◆ Update()

C3D_API void Castor3D::AnimationObject::Update ( real  p_time,
Castor::Matrix4x4r const &  p_transformations 
)

Updates the object, applies the transformations at given time.

Parameters
[in]p_timeCurrent time index.
[in]p_transformationsThe current transformation matrix.

Member Data Documentation

◆ m_children

AnimationObjectPtrArray Castor3D::AnimationObject::m_children
protected

The objects depending on this one.

Referenced by GetChildren().

◆ m_cumulativeTransform

Castor::Matrix4x4r Castor3D::AnimationObject::m_cumulativeTransform
protected

The cumulative animation transformations.

◆ m_curr

KeyFrameArray::const_iterator Castor3D::AnimationObject::m_curr
protected

Iterator to the current keyframe (when playing the animation).

◆ m_finalTransform

Castor::Matrix4x4r Castor3D::AnimationObject::m_finalTransform
protected

The matrix holding transformation at current time.

Referenced by GetFinalTransform().

◆ m_keyframes

KeyFrameArray Castor3D::AnimationObject::m_keyframes
protected

The key frames.

Referenced by GetKeyFrames(), and HasKeyFrames().

◆ m_length

real Castor3D::AnimationObject::m_length
protected

The animation length.

Referenced by GetLength(), and SetLength().

◆ m_mode

eINTERPOLATOR_MODE Castor3D::AnimationObject::m_mode = eINTERPOLATOR_MODE_NONE
protected

The interpolation mode.

Referenced by GetInterpolationMode().

◆ m_nodeTransform

Castor::Matrix4x4r Castor3D::AnimationObject::m_nodeTransform
protected

Animation node transformations.

Referenced by GetNodeTransform(), and SetNodeTransform().

◆ m_pointInterpolator

std::unique_ptr< Point3rInterpolator > Castor3D::AnimationObject::m_pointInterpolator
protected

The point interpolator.

◆ m_prev

KeyFrameArray::const_iterator Castor3D::AnimationObject::m_prev
protected

Iterator to the previous keyframe (when playing the animation).

◆ m_quaternionInterpolator

std::unique_ptr< QuaternionInterpolator > Castor3D::AnimationObject::m_quaternionInterpolator
protected

The quaternion interpolator.

◆ m_type

eANIMATION_OBJECT_TYPE Castor3D::AnimationObject::m_type
protected

The moving thing type.

Referenced by GetType().


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