Animates a scene node. Can animate position, rotation, material, and so on.
More...
#include <nirtcpp/core/engine/ISceneNodeAnimator.hpp>
|
bool | IsEnabled |
|
u32 | PauseTimeSum |
| Only enabled animators are updated.
|
|
u32 | PauseTimeStart |
| Sum up time which the animator was disabled.
|
|
u32 | StartTime |
| Last time setEnabled(false) was called with a timer > 0.
|
|
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.
◆ animateNode()
virtual void nirt::scene::ISceneNodeAnimator::animateNode |
( |
ISceneNode * |
node, |
|
|
u32 |
timeMs |
|
) |
| |
|
pure virtual |
Animates a scene node.
- Parameters
-
node | Node to animate. |
timeMs | Current time in milliseconds. |
◆ cloneMembers()
void nirt::scene::ISceneNodeAnimator::cloneMembers |
( |
const ISceneNodeAnimator * |
toCopyFrom | ) |
|
|
inlineprotected |
This method can be used by clone() implementations of derived classes
- Parameters
-
toCopyFrom | The animator from which the values are copied |
◆ createClone()
Creates a clone of this animator.
Please note that you will have to drop (IReferenceCounted::drop()) the returned pointer after calling this.
◆ deserializeAttributes()
◆ getStartTime()
virtual nirt::u32 nirt::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
◆ hasFinished()
virtual bool nirt::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.
◆ isEventReceiverEnabled()
virtual bool nirt::scene::ISceneNodeAnimator::isEventReceiverEnabled |
( |
| ) |
const |
|
inlinevirtual |
Returns true if this animator receives events.
When attached to an active camera, this animator will be able to respond to events such as mouse and keyboard events.
◆ OnEvent()
virtual bool nirt::scene::ISceneNodeAnimator::OnEvent |
( |
const SEvent & |
event | ) |
|
|
inlineoverridevirtual |
Event receiver, override this function for camera controlling animators.
Implements nirt::IEventReceiver.
◆ serializeAttributes()
◆ setEnabled()
virtual void nirt::scene::ISceneNodeAnimator::setEnabled |
( |
bool |
enabled, |
|
|
u32 |
timeNow = 0 |
|
) |
| |
|
inlinevirtual |
Sets the enabled state of this element.
- Parameters
-
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 nirt::ITimer::getTime() as value. Animators with no timers will just ignore this. |
◆ setStartTime()
virtual void nirt::scene::ISceneNodeAnimator::setStartTime |
( |
u32 |
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
-
time | Commonly you will use nirt::ITimer::getTime(). |
resetPauseTime | Reset internal pause time for enabling/disabling animators as well |
The documentation for this class was generated from the following file: