Open 3D Engine EMotionFX Gem API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
EMotionFX::MotionQueue Class Reference

#include <MotionQueue.h>

Inherits MCore::RefCounted.

Classes

class  QueueEntry
 

Public Member Functions

void ClearAllEntries ()
 
void AddEntry (const QueueEntry &motion)
 
size_t GetNumEntries () const
 
QueueEntryGetFirstEntry ()
 
void RemoveFirstEntry ()
 
QueueEntryGetEntry (size_t nr)
 
void RemoveEntry (size_t nr)
 
void Update ()
 
bool ShouldPlayNextMotion ()
 
void PlayNextMotion ()
 
- Public Member Functions inherited from MCore::RefCounted
 RefCounted ()
 
virtual ~RefCounted ()
 
void IncreaseReferenceCount ()
 
void DecreaseReferenceCount ()
 
void Destroy ()
 
uint32 GetReferenceCount () const
 

Static Public Member Functions

static MotionQueueCreate (ActorInstance *actorInstance, MotionSystem *motionSystem)
 

Additional Inherited Members

- Protected Member Functions inherited from MCore::RefCounted
virtual void Delete ()
 

Detailed Description

The motion queue is a motion stack which stores and plays the motion, one after each other, if the previous one ended. This can be used for prescriped animations: Imagine you want to let your character walk, and after that play some specific run animation. The motion queue schedules the motions, so that the run animation will be played when the walk animation has been finished. A smooth transition between both motions can be made when desired.

Member Function Documentation

◆ AddEntry()

void EMotionFX::MotionQueue::AddEntry ( const QueueEntry motion)

Add an entry to the queue.

Parameters
motionThe queue entry to add to the back of the queue.

◆ ClearAllEntries()

void EMotionFX::MotionQueue::ClearAllEntries ( )

Remove all entries from the queue. Does not delete them from the actor or from memory though.

◆ Create()

static MotionQueue* EMotionFX::MotionQueue::Create ( ActorInstance actorInstance,
MotionSystem motionSystem 
)
static

Creation method.

Parameters
actorInstanceThe actor to which this queue belongs to.
motionSystemA pointer to the motion system of the actor.

◆ GetEntry()

QueueEntry& EMotionFX::MotionQueue::GetEntry ( size_t  nr)

Get a specific queue entry.

Parameters
nrThe queue entry number to get.
Returns
A reference to the queue entry, with write access.

◆ GetFirstEntry()

QueueEntry& EMotionFX::MotionQueue::GetFirstEntry ( )

Get the first entry. BEWARE: only call when GetNumEntries() returns a value above zero.

Returns
A reference to the first entry, with write access.

◆ GetNumEntries()

size_t EMotionFX::MotionQueue::GetNumEntries ( ) const

Get the number of entries currently in the queue.

Returns
The number of entries currently scheduled in the queue.

◆ PlayNextMotion()

void EMotionFX::MotionQueue::PlayNextMotion ( )

Play the next motion in the motion queue. If there are no entries in the queue, nothing will happen.

◆ RemoveEntry()

void EMotionFX::MotionQueue::RemoveEntry ( size_t  nr)

Remove a given entry from the queue.

Parameters
nrThe entry number to remove from the queue.

◆ RemoveFirstEntry()

void EMotionFX::MotionQueue::RemoveFirstEntry ( )

Remove the first entry from the queueu. BEWARE: only call when GetNumEntries() returns a value above zero.

◆ ShouldPlayNextMotion()

bool EMotionFX::MotionQueue::ShouldPlayNextMotion ( )

Find out if we should start playing the next motion or not. It does this by finding the first non-mixing motion that is being played. Next it checks if the motion has ended or is stopping. If so, true is returned. In case the motion hasn't ended or isn't being stopped yet, true is returned at the last moment so that the new motion on the queue has faded in, at the same time the current last mixing motion is going to fade out. This will prevent the bind pose to be mixed in the final result. So basically the next motion will be played and will be fully faded in before the old motion will fade out.

Returns
True is returned when PlayNextMotion() should be called to start the next motion. Otherwise false is returned.
Note
The Update() method will automatically call PlayNextMotion() when this method returns true.

◆ Update()

void EMotionFX::MotionQueue::Update ( )

Updates the motion queue. This will automatically start playing the motions on the queue when they have to be played.


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