#include <MotionQueue.h>
Inherits EMotionFX::BaseObject.
Classes | |
class | QueueEntry |
Public Member Functions | |
void | ClearAllEntries () |
void | AddEntry (const QueueEntry &motion) |
size_t | GetNumEntries () const |
QueueEntry & | GetFirstEntry () |
void | RemoveFirstEntry () |
QueueEntry & | GetEntry (size_t nr) |
void | RemoveEntry (size_t nr) |
void | Update () |
bool | ShouldPlayNextMotion () |
void | PlayNextMotion () |
Public Member Functions inherited from EMotionFX::BaseObject | |
BaseObject () | |
virtual | ~BaseObject () |
Public Member Functions inherited from MCore::MemoryObject | |
MemoryObject () | |
virtual | ~MemoryObject () |
void | IncreaseReferenceCount () |
void | DecreaseReferenceCount () |
void | Destroy () |
uint32 | GetReferenceCount () const |
Static Public Member Functions | |
static MotionQueue * | Create (ActorInstance *actorInstance, MotionSystem *motionSystem) |
Additional Inherited Members | |
Protected Member Functions inherited from EMotionFX::BaseObject | |
void | Delete () override |
virtual void | Delete () |
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.
void EMotionFX::MotionQueue::AddEntry | ( | const QueueEntry & | motion | ) |
Add an entry to the queue.
motion | The queue entry to add to the back of the queue. |
void EMotionFX::MotionQueue::ClearAllEntries | ( | ) |
Remove all entries from the queue. Does not delete them from the actor or from memory though.
|
static |
Creation method.
actorInstance | The actor to which this queue belongs to. |
motionSystem | A pointer to the motion system of the actor. |
QueueEntry & EMotionFX::MotionQueue::GetEntry | ( | size_t | nr | ) |
Get a specific queue entry.
nr | The queue entry number to get. |
QueueEntry & EMotionFX::MotionQueue::GetFirstEntry | ( | ) |
Get the first entry. BEWARE: only call when GetNumEntries() returns a value above zero.
size_t EMotionFX::MotionQueue::GetNumEntries | ( | ) | const |
Get the number of entries currently in the queue.
void EMotionFX::MotionQueue::PlayNextMotion | ( | ) |
Play the next motion in the motion queue. If there are no entries in the queue, nothing will happen.
void EMotionFX::MotionQueue::RemoveEntry | ( | size_t | nr | ) |
Remove a given entry from the queue.
nr | The entry number to remove from the queue. |
void EMotionFX::MotionQueue::RemoveFirstEntry | ( | ) |
Remove the first entry from the queueu. BEWARE: only call when GetNumEntries() returns a value above zero.
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.
void EMotionFX::MotionQueue::Update | ( | ) |
Updates the motion queue. This will automatically start playing the motions on the queue when they have to be played.