Saga3D API Documentation
1.0-RC4
|
Animates a scene node. Can animate position, rotation, material, and so on. More...
#include <ISceneNodeAnimator.h>
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 |
![]() | |
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... | |
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.
|
inline |
Definition at line 27 of file ISceneNodeAnimator.h.
|
pure virtual |
Animates a scene node.
node | Node to animate. |
timeMs | Current time in milliseconds. |
|
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.
|
inlinevirtual |
Returns type of the scene node animator.
Definition at line 49 of file ISceneNodeAnimator.h.
|
inlinevirtual |
Returns if the animator has finished.
This is only valid for non-looping animators with a discrete end state.
Definition at line 57 of file ISceneNodeAnimator.h.
|
inlinevirtual |
Definition at line 111 of file ISceneNodeAnimator.h.
|
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.
|
inlinevirtual |
Sets the enabled state of this element.
enabled | When set to false ISceneNodes will not update the animator anymore. Animators themselves usually don't care. So manual calls to animateNode still work. |
timeNow | When 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.
|
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).
time | Commonly you will use saga::ITimer::getTime(). |
resetPauseTime | Reset internal pause time for enabling/diabling animators as well |
Definition at line 69 of file ISceneNodeAnimator.h.
|
protected |
This method can be used by clone() implementations of derived classes
toCopyFrom | The animator from which the values are copied |
Definition at line 129 of file ISceneNodeAnimator.h.
|
protected |
Sum up time which the animator was disabled.
Definition at line 131 of file ISceneNodeAnimator.h.
|
protected |
Only enabled animators are updated.
Definition at line 130 of file ISceneNodeAnimator.h.
|
protected |
Last time setEnabled(false) was called with a timer > 0.
Definition at line 132 of file ISceneNodeAnimator.h.