#include <EventDataFloatArray.h>
Inherits EMotionFX::EventData.
Public Member Functions | |
AZ_RTTI (EventDataFloatArray, "{8CB47D5E-4C19-42C5-A9E1-FA47DF45163D}", EventData) | |
AZ_INLINE const AZStd::string & | GetSubject () const |
AZ_INLINE float | GetElement (size_t index) const |
AZStd::string | DataToString () const |
bool | Equal (const EventData &rhs, bool ignoreEmptyFields=false) const override |
Test if two EventData instances are equal. | |
Public Member Functions inherited from EMotionFX::EventData | |
AZ_RTTI (EventData, "{F6AFCD3B-D58E-4821-9E7C-D1F437304E5D}") | |
virtual bool | operator== (const EventData &rhs) const |
virtual bool | Equal (const EventData &rhs, bool ignoreEmptyFields=false) const =0 |
Test if two EventData instances are equal. | |
virtual AZStd::string | ToString () const |
Static Public Member Functions | |
static void | Reflect (AZ::ReflectContext *context) |
Static Public Member Functions inherited from EMotionFX::EventData | |
static void | Reflect (AZ::ReflectContext *context) |
The EventDataFloatArray is a type of event data that holds an array of float. The float array is not fixed sized, so it's easy to add and remove elements that make this event type fit for variaty needs. The event data is serialized to motion event as a string, with floats data structed like "n0,n1,n2...n" with comma as a spliter.
|
overridevirtual |
Test if two EventData instances are equal.
This method is used by EMotionFX to deduplicate instances of EventData subclasses, and by the AnimGraphMotionCondition's Motion Event matching logic.
When loading a .motion file and deserializing the MotionEvents on the event tracks, each EventData instance is run through EventManager::FindOrCreateEventData. The EventManager stores a list of all EventData instances in use, and attempts to find one where Equal(loadedEventData) returns true. If it finds one that is equal, the duplicate data is discarded. So this method is essential in saving memory of the duplicated EventData instances.
When an AnimGraphMotionCondition is used to test against a Motion Event, this method is called by AnimGraphMotionCondition::TestCondition. In this case, ignoreEmptyFields
is true. This allows the condition to match against parts of the EventData and not others. For example, if one of the fields is a string, and that string value is empty in the condition, it can act as a wildcard match for that field.
This method is not used by the AnimGraphSyncTrack to determine if events are the same for syncing (that method is EventDataSyncable::HashForSyncing).
Implements EMotionFX::EventData.