![]() |
Duckcpp 2.1.0
Duckcpp is a high-performance c++ graphics engine.
|
Animates a scene node. Can animate position, rotation, material, and so on. More...
#include <duckcpp/core/engine/ISceneNodeAnimator.hpp>
Public Member Functions | |
virtual void | animateNode (ISceneNode *node, dcpp::uint32_kt timeMs)=0 |
Animates a scene node. | |
virtual ISceneNodeAnimator * | createClone (ISceneNode *node, ISceneManager *newManager=0)=0 |
Creates a clone of this animator. | |
virtual bool | isEventReceiverEnabled () const |
Returns true if this animator receives events. | |
virtual bool | OnEvent (const SEvent &event) override |
Event receiver, override this function for camera controlling animators. | |
virtual ESCENE_NODE_ANIMATOR_TYPE | getType () const |
Returns type of the scene node animator. | |
virtual bool | hasFinished (void) const |
Returns if the animator has finished. | |
virtual void | setStartTime (dcpp::uint32_kt time, bool resetPauseTime=true) |
Reset a time-based movement by changing the starttime. | |
virtual dcpp::uint32_kt | getStartTime () const |
Get the starttime. | |
virtual void | setEnabled (bool enabled, dcpp::uint32_kt timeNow=0) |
Sets the enabled state of this element. | |
virtual bool | isEnabled () const |
virtual void | serializeAttributes (dcpp::io::IAttributes *out, dcpp::io::SAttributeReadWriteOptions *options=0) const override |
Writes attributes of the scene node animator. | |
virtual void | deserializeAttributes (dcpp::io::IAttributes *in, dcpp::io::SAttributeReadWriteOptions *options=0) override |
Reads attributes of the scene node animator. | |
![]() | |
IReferenceCounted () | |
Constructor. | |
virtual | ~IReferenceCounted () |
Destructor. | |
void | grab () const |
Grabs the object. Increments the reference counter by one. | |
bool | drop () const |
Drops the object. Decrements the reference counter by one. | |
dcpp::int32_kt | getReferenceCount () const |
Get the reference count. | |
const dcpp::char_kt * | getDebugName () const |
Returns the debug name of the object. | |
![]() | |
virtual | ~IEventReceiver () |
Destructor. | |
Protected Member Functions | |
void | cloneMembers (const ISceneNodeAnimator *toCopyFrom) |
![]() | |
void | setDebugName (const dcpp::char_kt *newName) |
Sets the debug name of the object. | |
Protected Attributes | |
bool | IsEnabled |
dcpp::uint32_kt | PauseTimeSum |
Only enabled animators are updated. | |
dcpp::uint32_kt | PauseTimeStart |
Sum up time which the animator was disabled. | |
dcpp::uint32_kt | 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.
|
pure virtual |
Animates a scene node.
node | Node to animate. |
timeMs | Current time in milliseconds. |
|
inlineprotected |
This method can be used by clone() implementations of derived classes
toCopyFrom | The animator from which the values are copied |
|
pure virtual |
Creates a clone of this animator.
Please note that you will have to drop (IReferenceCounted::drop()) the returned pointer after calling this.
|
inlineoverridevirtual |
Reads attributes of the scene node animator.
Reimplemented from dcpp::io::IAttributeExchangingObject.
|
inlinevirtual |
Get the starttime.
This will return 0 for by animators which don't work with a starttime unless a starttime was manually set
|
inlinevirtual |
Returns if the animator has finished.
This is only valid for non-looping animators with a discrete end state.
|
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.
|
inlineoverridevirtual |
Event receiver, override this function for camera controlling animators.
Implements dcpp::IEventReceiver.
|
inlineoverridevirtual |
Writes attributes of the scene node animator.
Reimplemented from dcpp::io::IAttributeExchangingObject.
|
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 dcpp::ITimer::getTime() as value. Animators with no timers will just ignore this. |
|
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: PSceneNodeAnimatorRotation currently overwrites this value constantly (might be changed in the future).
time | Commonly you will use dcpp::ITimer::getTime(). |
resetPauseTime | Reset internal pause time for enabling/disabling animators as well |