Saga3D API Documentation  1.0-RC4
saga::scene::ISceneNodeAnimator Class Referenceabstract

Animates a scene node. Can animate position, rotation, material, and so on. More...

#include <ISceneNodeAnimator.h>

Inheritance diagram for saga::scene::ISceneNodeAnimator:
saga::IEventReceiver saga::scene::ISceneNodeAnimatorCameraFPS saga::scene::ISceneNodeAnimatorCameraMaya saga::scene::ISceneNodeAnimatorCollisionResponse

Public Member Functions

 ISceneNodeAnimator ()
 
virtual void animateNode (ISceneNode &node, const float time)=0
 Animates a scene node. More...
 
virtual void onEvent (const SDL_Event &event) override
 Creates a clone of this animator. More...
 
virtual E_SCENE_NODE_ANIMATOR_TYPE getType () const
 Returns type of the scene node animator. More...
 
virtual bool hasFinished (void) const
 Returns if the animator has finished. More...
 
virtual void setStartTime (std::uint32_t time, bool resetPauseTime=true)
 Reset a time-based movement by changing the starttime. More...
 
virtual std::uint32_t getStartTime () const
 Get the starttime. More...
 
virtual void setEnabled (bool enabled, std::uint32_t timeNow=0)
 Sets the enabled state of this element. More...
 
virtual bool isEnabled () const
 
- Public Member Functions inherited from saga::IEventReceiver
virtual ~IEventReceiver ()
 Destructor. More...
 

Protected Attributes

bool IsEnabled
 
std::uint32_t PauseTimeSum
 Only enabled animators are updated. More...
 
std::uint32_t PauseTimeStart
 Sum up time which the animator was disabled. More...
 
std::uint32_t StartTime
 Last time setEnabled(false) was called with a timer > 0. More...
 

Detailed Description

Animates a scene node. Can animate position, rotation, material, and so on.

A scene node animator is able to animate a scene node in a very simple way. It may change its position, rotation, scale and/or material. There are lots of animators to choose from. You can create scene node animators with the ISceneManager interface.

Definition at line 24 of file ISceneNodeAnimator.h.

Constructor & Destructor Documentation

◆ ISceneNodeAnimator()

saga::scene::ISceneNodeAnimator::ISceneNodeAnimator ( )
inline

Definition at line 27 of file ISceneNodeAnimator.h.

Member Function Documentation

◆ animateNode()

virtual void saga::scene::ISceneNodeAnimator::animateNode ( ISceneNode node,
const float  time 
)
pure virtual

Animates a scene node.

Parameters
nodeNode to animate.
timeMsCurrent time in milliseconds.

◆ getStartTime()

virtual std::uint32_t saga::scene::ISceneNodeAnimator::getStartTime ( ) const
inlinevirtual

Get the starttime.

This will return 0 for by animators which don't work with a starttime unless a starttime was manually set

Definition at line 81 of file ISceneNodeAnimator.h.

◆ getType()

virtual E_SCENE_NODE_ANIMATOR_TYPE saga::scene::ISceneNodeAnimator::getType ( ) const
inlinevirtual

Returns type of the scene node animator.

Definition at line 49 of file ISceneNodeAnimator.h.

◆ hasFinished()

virtual bool saga::scene::ISceneNodeAnimator::hasFinished ( void  ) const
inlinevirtual

Returns if the animator has finished.

This is only valid for non-looping animators with a discrete end state.

Returns
true if the animator has finished, false if it is still running.

Definition at line 57 of file ISceneNodeAnimator.h.

◆ isEnabled()

virtual bool saga::scene::ISceneNodeAnimator::isEnabled ( ) const
inlinevirtual

Definition at line 111 of file ISceneNodeAnimator.h.

◆ onEvent()

virtual void saga::scene::ISceneNodeAnimator::onEvent ( const SDL_Event &  event)
inlineoverridevirtual

Creates a clone of this animator.

Please note that you will have to drop (IReferenceCounted::drop()) the returned pointer after calling this. Event receiver, override this function for camera controlling animators

Implements saga::IEventReceiver.

Definition at line 43 of file ISceneNodeAnimator.h.

◆ setEnabled()

virtual void saga::scene::ISceneNodeAnimator::setEnabled ( bool  enabled,
std::uint32_t  timeNow = 0 
)
inlinevirtual

Sets the enabled state of this element.

Parameters
enabledWhen set to false ISceneNodes will not update the animator anymore. Animators themselves usually don't care. So manual calls to animateNode still work.
timeNowWhen set to values > 0 on enabling and disabling an internal timer will be increased by the time disabled time. Animator decide themselves how to handle that timer, but generally setting it will allow you to pause an animator, so it will continue at the same position when you enable it again. To use that pass saga::ITimer::getTime() as value. Animators with no timers will just ignore this.

Definition at line 95 of file ISceneNodeAnimator.h.

◆ setStartTime()

virtual void saga::scene::ISceneNodeAnimator::setStartTime ( std::uint32_t  time,
bool  resetPauseTime = true 
)
inlinevirtual

Reset a time-based movement by changing the starttime.

By default most animators start on object creation. This value is ignored by animators which don't work with a starttime. Known problems: CSceneNodeAnimatorRotation currently overwrites this value constantly (might be changed in the future).

Parameters
timeCommonly you will use saga::ITimer::getTime().
resetPauseTimeReset internal pause time for enabling/diabling animators as well

Definition at line 69 of file ISceneNodeAnimator.h.

Member Data Documentation

◆ IsEnabled

bool saga::scene::ISceneNodeAnimator::IsEnabled
protected

This method can be used by clone() implementations of derived classes

Parameters
toCopyFromThe animator from which the values are copied

Definition at line 129 of file ISceneNodeAnimator.h.

◆ PauseTimeStart

std::uint32_t saga::scene::ISceneNodeAnimator::PauseTimeStart
protected

Sum up time which the animator was disabled.

Definition at line 131 of file ISceneNodeAnimator.h.

◆ PauseTimeSum

std::uint32_t saga::scene::ISceneNodeAnimator::PauseTimeSum
protected

Only enabled animators are updated.

Definition at line 130 of file ISceneNodeAnimator.h.

◆ StartTime

std::uint32_t saga::scene::ISceneNodeAnimator::StartTime
protected

Last time setEnabled(false) was called with a timer > 0.

Definition at line 132 of file ISceneNodeAnimator.h.


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