Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
nirt::scene::ISceneNodeAnimator Class Referenceabstract

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

#include <nirtcpp/core/engine/ISceneNodeAnimator.hpp>

Inheritance diagram for nirt::scene::ISceneNodeAnimator:
Inheritance graph
Collaboration diagram for nirt::scene::ISceneNodeAnimator:
Collaboration graph

Public Member Functions

virtual void animateNode (ISceneNode *node, u32 timeMs)=0
 Animates a scene node.
 
virtual ISceneNodeAnimatorcreateClone (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 (u32 time, bool resetPauseTime=true)
 Reset a time-based movement by changing the starttime.
 
virtual nirt::u32 getStartTime () const
 Get the starttime.
 
virtual void setEnabled (bool enabled, u32 timeNow=0)
 Sets the enabled state of this element.
 
virtual bool isEnabled () const
 
virtual void serializeAttributes (io::IAttributes *out, io::SAttributeReadWriteOptions *options=0) const override
 Writes attributes of the scene node animator.
 
virtual void deserializeAttributes (io::IAttributes *in, io::SAttributeReadWriteOptions *options=0) override
 Reads attributes of the scene node animator.
 
- Public Member Functions inherited from nirt::IReferenceCounted
 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.
 
s32 getReferenceCount () const
 Get the reference count.
 
const c8getDebugName () const
 Returns the debug name of the object.
 
- Public Member Functions inherited from nirt::IEventReceiver
virtual ~IEventReceiver ()
 Destructor.
 

Protected Member Functions

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

Protected Attributes

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.
 

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.

Member Function Documentation

◆ animateNode()

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

Animates a scene node.

Parameters
nodeNode to animate.
timeMsCurrent 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
toCopyFromThe animator from which the values are copied

◆ createClone()

virtual ISceneNodeAnimator * nirt::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.

◆ deserializeAttributes()

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

Reads attributes of the scene node animator.

Reimplemented from nirt::io::IAttributeExchangingObject.

◆ 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()

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

Writes attributes of the scene node animator.

Reimplemented from nirt::io::IAttributeExchangingObject.

◆ setEnabled()

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

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

Nirtcpp    @cppfx.xyz

Esvcpp    esv::print