A description of an event that happens at a given time in a motion. More...
#include <MotionEvent.h>
Inherits EMotionFX::Event.
Public Member Functions | |
MotionEvent (float timeValue, EventDataPtr &&data) | |
MotionEvent (float startTimeValue, float endTimeValue, EventDataPtr &&data) | |
MotionEvent (float timeValue, EventDataSet &&datas) | |
MotionEvent (float startTimeValue, float endTimeValue, EventDataSet &&datas) | |
void | SetStartTime (float timeValue) |
void | SetEndTime (float timeValue) |
float | GetStartTime () const |
float | GetEndTime () const |
bool | GetIsTickEvent () const |
void | ConvertToTickEvent () |
bool | GetIsSyncEvent () const |
void | SetIsSyncEvent (bool newValue) |
size_t | HashForSyncing (bool isMirror) const |
Public Member Functions inherited from EMotionFX::Event | |
AZ_RTTI (Event, "{67549E9F-8E3F-4336-BDB8-716AFCBD4985}") | |
Event (EventDataPtr &&data) | |
Event (EventDataSet &&datas) | |
const EventDataSet & | GetEventDatas () const |
EventDataSet & | GetEventDatas () |
void | AppendEventData (EventDataPtr &&newData) |
void | RemoveEventData (size_t index) |
void | SetEventData (size_t index, EventDataPtr &&newData) |
void | InsertEventData (size_t index, EventDataPtr &&newData) |
Static Public Member Functions | |
static void | Reflect (AZ::ReflectContext *context) |
Static Public Member Functions inherited from EMotionFX::Event | |
static void | Reflect (AZ::ReflectContext *context) |
Additional Inherited Members | |
Protected Attributes inherited from EMotionFX::Event | |
EventDataSet | m_eventDatas |
A description of an event that happens at a given time in a motion.
A MotionEvent could be a footstep sound that needs to be played, or a particle system that needs to be spawened or a script that needs to be executed. Motion events are completely generic, which means EMotion FX does not handle the events for you. It is up to you how you handle the events. Also we do not specify any set of available events.
Each MotionEvent has a list of EventData instances that are attached to the event. The EventData list is used by an Event Handler to perform the required actions.
All motion events are stored in a motion event table. This table contains the event data for the event types and parameters, which can be shared between events. This will mean if you have 100 events that contain the strings "SOUND" and "Footstep.wav", those strings will only be stored in memory once.
To manually add motion events to a motion, do something like this:
To listen to motion events, connect to the ActorNotificationBus, and implement OnMotionEvent().
EMotionFX::MotionEvent::MotionEvent | ( | float | timeValue, |
EventDataPtr && | data | ||
) |
Creates a tick event
timeValue | The time value, in seconds, when the motion event should occur. |
data | The values to emit when the event is triggered |
EMotionFX::MotionEvent::MotionEvent | ( | float | startTimeValue, |
float | endTimeValue, | ||
EventDataPtr && | data | ||
) |
Creates a ranged event
startTimeValue | The start time value, in seconds, when the motion event should start. |
endTimeValue | The end time value, in seconds, when the motion event should end. When this is equal to the start time value we won't trigger an end event, but only a start event at the specified time. |
data | The values to emit when the event is triggered |
EMotionFX::MotionEvent::MotionEvent | ( | float | timeValue, |
EventDataSet && | datas | ||
) |
Creates a tick event
timeValue | The time value, in seconds, when the motion event should occur. |
datas | The list of values to emit when the event is triggered |
EMotionFX::MotionEvent::MotionEvent | ( | float | startTimeValue, |
float | endTimeValue, | ||
EventDataSet && | datas | ||
) |
Creates a ranged event
startTimeValue | The start time value, in seconds, when the motion event should start. |
endTimeValue | The end time value, in seconds, when the motion event should end. When this is equal to the start time value we won't trigger an end event, but only a start event at the specified time. |
data | The list of values to emit when the event is triggered |
void EMotionFX::MotionEvent::ConvertToTickEvent | ( | ) |
Convert this event into a tick event. This makes the end time equal to the start time.
|
inline |
Get the end time value of this event, which is when it should stop.
|
inline |
Check if this event is a sync event.
The Sync track of a motion can only contain events where GetIsSyncEvent() is true.
bool EMotionFX::MotionEvent::GetIsTickEvent | ( | ) | const |
Check whether this is a tick event or not. It is a tick event when both start and end time are equal.
|
inline |
Get the start time value of this event, which is when it should be executed.
void EMotionFX::MotionEvent::SetEndTime | ( | float | timeValue | ) |
Set the end time value of the event, which is when the event should be processed.
timeValue | The time on which the event shall be processed, in seconds. |
void EMotionFX::MotionEvent::SetIsSyncEvent | ( | bool | newValue | ) |
Set if this event is a sync event.
void EMotionFX::MotionEvent::SetStartTime | ( | float | timeValue | ) |
Set the start time value of the event, which is when the event should be processed.
timeValue | The time on which the event shall be processed, in seconds. |