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.
|
#include <MultiThreadScheduler.h>
Inherits EMotionFX::ActorUpdateScheduler.
Classes | |
struct | ScheduleStep |
Public Types | |
enum | { TYPE_ID = 0x00000002 } |
Public Member Functions | |
const char * | GetName () const override |
uint32 | GetType () const override |
void | Execute (float timePassedInSeconds) override |
void | Print () override |
void | Clear () override |
void | RemoveEmptySteps () |
void | RecursiveInsertActorInstance (ActorInstance *actorInstance, size_t startStep=0) override |
void | RecursiveRemoveActorInstance (ActorInstance *actorInstance, size_t startStep=0) override |
size_t | RemoveActorInstance (ActorInstance *actorInstance, size_t startStep=0) override |
void | Lock () |
void | Unlock () |
const ScheduleStep & | GetScheduleStep (size_t index) const |
size_t | GetNumScheduleSteps () const |
Public Member Functions inherited from EMotionFX::ActorUpdateScheduler | |
size_t | GetNumUpdatedActorInstances () const |
size_t | GetNumVisibleActorInstances () const |
size_t | GetNumSampledActorInstances () const |
Public Member Functions inherited from MCore::RefCounted | |
RefCounted () | |
virtual | ~RefCounted () |
void | IncreaseReferenceCount () |
void | DecreaseReferenceCount () |
void | Destroy () |
uint32 | GetReferenceCount () const |
Static Public Member Functions | |
static MultiThreadScheduler * | Create () |
Protected Member Functions | |
bool | HasActorInstanceInSteps (const ActorInstance *actorInstance) const |
MultiThreadScheduler () | |
virtual | ~MultiThreadScheduler () |
bool | CheckIfHasMatchingDependency (ActorInstance *instance, ScheduleStep *step) const |
bool | FindNextFreeItem (ActorInstance *actorInstance, size_t startStep, size_t *outStepNr) |
void | AddDependenciesToStep (ActorInstance *instance, ScheduleStep *outStep) |
Protected Member Functions inherited from EMotionFX::ActorUpdateScheduler | |
ActorUpdateScheduler () | |
virtual | ~ActorUpdateScheduler () |
Protected Member Functions inherited from MCore::RefCounted | |
virtual void | Delete () |
Protected Attributes | |
AZStd::vector< ScheduleStep > | m_steps |
float | m_cleanTimer |
MCore::MutexRecursive | m_mutex |
Protected Attributes inherited from EMotionFX::ActorUpdateScheduler | |
MCore::AtomicSizeT | m_numUpdated |
MCore::AtomicSizeT | m_numVisible |
MCore::AtomicSizeT | m_numSampled |
The multi processor scheduler. This class can manage the actor instances in such a way that multiple actor instances can be processed at the same time without getting any conflicts with shared memory. If however you wish to let EMotion FX only use one single CPU, or if the target system ahs only one CPU, it is recommended to use the SingleThreadScheduler class instead, as that will be faster in that specific case. Significant performance gains can be achieved by using this scheduler on multi-processor or multi-core systems though.
anonymous enum |
The unique type ID of this scheduler, as returned by the GetType() method.
|
protected |
The constructor.
|
protectedvirtual |
The destructor.
|
protected |
Add the dependencies of a given actor instance to a specified scheduler step. This will also prevent any duplicated dependencies. So dependencies that are already inside the step will not be added again.
instance | The actor instance to add the dependencies from. |
outStep | The scheduler step to add the dependencies to. |
|
protected |
Check if a given update step has any similar dependencies than the specified actor instance. If this is the case, the specified actor instance can't be inserted inside the same scheduler step, as it would conflict with the other actor instances inside it.
instance | The acotr instance to test. |
step | The scheduler step to test. |
|
overridevirtual |
Clear the schedule.
Implements EMotionFX::ActorUpdateScheduler.
|
static |
The constructor.
|
overridevirtual |
The main method which will execute all callbacks, which on their turn will check for visibilty, perform updates and render.
timePassedInSeconds | The time passed, in seconds, since the last call to the update. |
Implements EMotionFX::ActorUpdateScheduler.
|
protected |
Find the next free spot in the schedule where we can insert a given actor instance.
actorInstance | The actor instance we are trying to insert. |
startStep | The step offset in the scheduler, to start searching from. |
outStepNr | This will contain the step number in which we can insert the actor instance. |
|
inlineoverridevirtual |
Get the name of this class, or a description.
Implements EMotionFX::ActorUpdateScheduler.
|
inlineoverridevirtual |
Get the unique type ID of the scheduler type. All schedulers will have another ID, so that you can use this to identify what scheduler you are dealing with.
Implements EMotionFX::ActorUpdateScheduler.
|
overridevirtual |
LOG the schedule using the LOG method. This can for example show the update order, in which order the actor instances will be updated.
Reimplemented from EMotionFX::ActorUpdateScheduler.
|
overridevirtual |
Recursively insert an actor instance into the schedule, including all its attachments.
actorInstance | The actor instance to insert. |
startStep | An offset in the schedule where to start trying to insert the actor instances. |
Implements EMotionFX::ActorUpdateScheduler.
|
overridevirtual |
Recursively remove an actor instance and its attachments from the schedule.
actorInstance | The actor instance to remove. |
startStep | An offset in the schedule where to start trying to remove from. |
Implements EMotionFX::ActorUpdateScheduler.
|
overridevirtual |
Remove a single actor instance from the schedule. This will not remove its attachments.
actorInstance | The actor instance to remove. |
startStep | An offset in the schedule where to start trying to remove from. |
Implements EMotionFX::ActorUpdateScheduler.
void EMotionFX::MultiThreadScheduler::RemoveEmptySteps | ( | ) |
Remove all empty scheduler steps.
|
protected |
The time passed since the last automatic call to the Optimize method.
|
protected |
An array of update steps, that together form the schedule.