#include <EventHandler.h>
Public Member Functions | |
virtual const AZStd::vector< EventTypes > | GetHandledEventTypes () const =0 |
void | SetMotionInstance (MotionInstance *motionInstance) |
MCORE_INLINE MotionInstance * | GetMotionInstance () |
virtual void | OnEvent (const EventInfo &eventInfo) |
virtual void | OnStartMotionInstance (PlayBackInfo *info) |
virtual void | OnDeleteMotionInstance () |
virtual void | OnStop () |
virtual void | OnHasLooped () |
virtual void | OnHasReachedMaxNumLoops () |
virtual void | OnHasReachedMaxPlayTime () |
virtual void | OnIsFrozenAtLastFrame () |
virtual void | OnChangedPauseState () |
virtual void | OnChangedActiveState () |
virtual void | OnStartBlending () |
virtual void | OnStopBlending () |
virtual void | OnQueueMotionInstance (PlayBackInfo *info) |
Protected Attributes | |
MotionInstance * | m_motionInstance = nullptr |
The per motion instance event handlers. This allows you to capture events triggered on a specific motion instance, rather than globally.
|
pure virtual |
Event handlers need to overload this function and return the list of events they are interested about
|
inlinevirtual |
This event gets triggered once the motion active state changes. For example when the motion is active but gets set to inactive using the MotionInstance::SetActive(...) method, then this even twill be triggered. Inactive motions don't get processed at all. They will not update their playback times, blending, nor will they take part in any blending calculations of the final node transforms. In other words, it will just be like the motion instance does not exist at all.
|
inlinevirtual |
This event gets triggered once the motion pause state changes. For example when the motion is unpaused but gets paused, then this even twill be triggered. Paused motions don't get their playback times updated. They do however still perform blending, so it is still possible to fade them in or out.
|
inlinevirtual |
The event that gets triggered once a MotionInstance object is being deleted. This can happen when calling the MotionSystem::RemoveMotionInstance() method manually, or when EMotion FX internally removes the motion instance because it has no visual influence anymore. The destructor of the MotionInstance class automatically triggers this event.
|
inlinevirtual |
The method that processes an event.
eventInfo | The struct holding the information about the triggered event. |
|
inlinevirtual |
This event gets triggered once a given motion instance has looped.
|
inlinevirtual |
This event gets triggered once a given motion instance has reached its maximum number of allowed loops. In this case the motion instance will also be stopped automatically afterwards.
|
inlinevirtual |
This event gets triggered once a given motion instance has reached its maximum playback time. For example if this motion instance is only allowed to play for 2 seconds, and the total playback time reaches two seconds, then this event will be triggered.
|
inlinevirtual |
This event gets triggered once the motion instance is set to freeze at the last frame once the motion reached its end (when it reached its maximum number of loops or playtime). In this case this event will be triggered once.
|
inlinevirtual |
This event gets triggered once the given motion instance gets added to the motion queue. This happens when you set the PlayBackInfo::m_playNow member to false. In that case the MotionSystem::PlayMotion() method (OnPlayMotion) will not directly start playing the motion (OnStartMotionInstance), but will add it to the motion queue instead. The motion queue will then start playing the motion instance once it should.
info | The playback information used to play this motion instance. |
|
inlinevirtual |
This event gets triggered once a motion instance is automatically changing its weight value over time. For example when a motion is automatically being faded in from weight 0 to a given target weight in half a second, then once this blending starts, this event is being triggered. Once the the MotionInstance::SetWeight(...) method is being called with a blend time bigger than zero, and if the motion instance isn't currently already blending, then this event will be triggered. This event most likely will get triggered when using the MotionSystem::PlayMotion() and MotionInstance::Stop() methods.
|
inlinevirtual |
The event that gets triggered when a motion instance is really being played. This can be a manual call through MotionInstance::PlayMotion or when the MotionQueue class will start playing a motion that was on the queue. The difference between OnStartMotionInstance() and this OnPlayMotion() is that the OnPlayMotion doesn't guarantee that the motion is being played yet, as it can also be added to the motion queue. The OnStartMotionInstance() method will be called once the motion is really being played.
info | The playback info used to play the motion. |
|
inlinevirtual |
The event that gets triggered when a motion instance is being stopped using one of the MotionInstance::Stop() methods. EMotion FX will internally stop the motion automatically when the motion instance reached its maximum playback time or its maximum number of loops.
|
inlinevirtual |
This event gets triggered once a motion instance stops it automatic changing of its weight value over time. For example when a motion is automatically being faded in from weight 0 to a given target weight in half a second, and once the target weight is reached after half a second, will cause this event to be triggered. Once the the MotionInstance::SetWeight(...) method is being called with a blend time equal to zero and the motion instance is currently blending its weight value, then this event will be triggered. This event most likely will get triggered when using the MotionSystem::PlayMotion() and MotionInstance::Stop() methods.