Irrlicht 3D Engine
irr::scene::ISceneNodeAnimator Class Referenceabstract

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

#include <ISceneNodeAnimator.h>

+ Inheritance diagram for irr::scene::ISceneNodeAnimator:

Public Member Functions

 ISceneNodeAnimator ()
 
virtual void animateNode (ISceneNode *node, u32 timeMs)=0
 Animates a scene node. More...
 
virtual ISceneNodeAnimatorcreateClone (ISceneNode *node, ISceneManager *newManager=0)=0
 Creates a clone of this animator. More...
 
virtual void deserializeAttributes (io::IAttributes *in, io::SAttributeReadWriteOptions *options=0) _IRR_OVERRIDE_
 Reads attributes of the scene node animator. More...
 
virtual irr::u32 getStartTime () const
 Get the starttime. More...
 
virtual ESCENE_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 bool isEnabled () const
 
virtual bool isEventReceiverEnabled () const
 Returns true if this animator receives events. More...
 
virtual bool OnEvent (const SEvent &event) _IRR_OVERRIDE_
 Event receiver, override this function for camera controlling animators. More...
 
virtual void serializeAttributes (io::IAttributes *out, io::SAttributeReadWriteOptions *options=0) const _IRR_OVERRIDE_
 Writes attributes of the scene node animator. More...
 
virtual void setEnabled (bool enabled, u32 timeNow=0)
 Sets the enabled state of this element. More...
 
virtual void setStartTime (u32 time, bool resetPauseTime=true)
 Reset a time-based movement by changing the starttime. More...
 
- Public Member Functions inherited from irr::IReferenceCounted
 IReferenceCounted ()
 Constructor. More...
 
virtual ~IReferenceCounted ()
 Destructor. More...
 
bool drop () const
 Drops the object. Decrements the reference counter by one. More...
 
const c8getDebugName () const
 Returns the debug name of the object. More...
 
s32 getReferenceCount () const
 Get the reference count. More...
 
void grab () const
 Grabs the object. Increments the reference counter by one. More...
 
- Public Member Functions inherited from irr::IEventReceiver
virtual ~IEventReceiver ()
 Destructor. More...
 

Protected Member Functions

void cloneMembers (const ISceneNodeAnimator *toCopyFrom)
 
- Protected Member Functions inherited from irr::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object. More...
 

Protected Attributes

bool IsEnabled
 
u32 PauseTimeStart
 Sum up time which the animator was disabled. More...
 
u32 PauseTimeSum
 Only enabled animators are updated. More...
 
u32 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 31 of file ISceneNodeAnimator.h.

Constructor & Destructor Documentation

◆ ISceneNodeAnimator()

irr::scene::ISceneNodeAnimator::ISceneNodeAnimator ( )
inline

Definition at line 34 of file ISceneNodeAnimator.h.

Member Function Documentation

◆ animateNode()

virtual void irr::scene::ISceneNodeAnimator::animateNode ( ISceneNode node,
u32  timeMs 
)
pure virtual

Animates a scene node.

Parameters
nodeNode to animate.
timeMsCurrent time in milliseconds.

Referenced by irr::scene::ISceneNode::OnAnimate().

◆ cloneMembers()

void irr::scene::ISceneNodeAnimator::cloneMembers ( const ISceneNodeAnimator toCopyFrom)
inlineprotected

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

Parameters
toCopyFromThe animator from which the values are copied

Definition at line 151 of file ISceneNodeAnimator.h.

References IsEnabled, PauseTimeStart, PauseTimeSum, and StartTime.

◆ createClone()

virtual ISceneNodeAnimator* irr::scene::ISceneNodeAnimator::createClone ( ISceneNode node,
ISceneManager newManager = 0 
)
pure virtual

Creates a clone of this animator.

Please note that you will have to drop (IReferenceCounted::drop()) the returned pointer after calling this.

Referenced by irr::scene::ISceneNode::cloneMembers().

◆ deserializeAttributes()

virtual void irr::scene::ISceneNodeAnimator::deserializeAttributes ( io::IAttributes in,
io::SAttributeReadWriteOptions options = 0 
)
inlinevirtual

Reads attributes of the scene node animator.

Reimplemented from irr::io::IAttributeExchangingObject.

Definition at line 139 of file ISceneNodeAnimator.h.

References irr::io::IAttributes::getAttributeAsBool(), IsEnabled, PauseTimeStart, and PauseTimeSum.

◆ getStartTime()

virtual irr::u32 irr::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 96 of file ISceneNodeAnimator.h.

References StartTime.

◆ getType()

virtual ESCENE_NODE_ANIMATOR_TYPE irr::scene::ISceneNodeAnimator::getType ( ) const
inlinevirtual

Returns type of the scene node animator.

Definition at line 64 of file ISceneNodeAnimator.h.

References irr::scene::ESNAT_UNKNOWN.

◆ hasFinished()

virtual bool irr::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 72 of file ISceneNodeAnimator.h.

◆ isEnabled()

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

Definition at line 126 of file ISceneNodeAnimator.h.

References IsEnabled.

Referenced by irr::scene::ISceneNode::OnAnimate().

◆ isEventReceiverEnabled()

virtual bool irr::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.

Definition at line 52 of file ISceneNodeAnimator.h.

◆ OnEvent()

virtual bool irr::scene::ISceneNodeAnimator::OnEvent ( const SEvent event)
inlinevirtual

Event receiver, override this function for camera controlling animators.

Implements irr::IEventReceiver.

Definition at line 58 of file ISceneNodeAnimator.h.

◆ serializeAttributes()

virtual void irr::scene::ISceneNodeAnimator::serializeAttributes ( io::IAttributes out,
io::SAttributeReadWriteOptions options = 0 
) const
inlinevirtual

Writes attributes of the scene node animator.

Reimplemented from irr::io::IAttributeExchangingObject.

Definition at line 132 of file ISceneNodeAnimator.h.

References irr::io::IAttributes::addBool(), and IsEnabled.

◆ setEnabled()

virtual void irr::scene::ISceneNodeAnimator::setEnabled ( bool  enabled,
u32  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 irr::ITimer::getTime() as value. Animators with no timers will just ignore this.

Definition at line 110 of file ISceneNodeAnimator.h.

References IsEnabled, PauseTimeStart, and PauseTimeSum.

◆ setStartTime()

virtual void irr::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
timeCommonly you will use irr::ITimer::getTime().
resetPauseTimeReset internal pause time for enabling/diabling animators as well

Definition at line 84 of file ISceneNodeAnimator.h.

References PauseTimeStart, PauseTimeSum, and StartTime.

Member Data Documentation

◆ IsEnabled

bool irr::scene::ISceneNodeAnimator::IsEnabled
protected

◆ PauseTimeStart

u32 irr::scene::ISceneNodeAnimator::PauseTimeStart
protected

Sum up time which the animator was disabled.

Definition at line 161 of file ISceneNodeAnimator.h.

Referenced by cloneMembers(), deserializeAttributes(), setEnabled(), and setStartTime().

◆ PauseTimeSum

u32 irr::scene::ISceneNodeAnimator::PauseTimeSum
protected

Only enabled animators are updated.

Definition at line 160 of file ISceneNodeAnimator.h.

Referenced by cloneMembers(), deserializeAttributes(), setEnabled(), and setStartTime().

◆ StartTime

u32 irr::scene::ISceneNodeAnimator::StartTime
protected

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

Definition at line 162 of file ISceneNodeAnimator.h.

Referenced by cloneMembers(), getStartTime(), and setStartTime().


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