Open 3D Engine EMotionFX Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
EMotionFX::TwoStringEventData Class Reference

Inherits EMotionFX::EventDataSyncable.

Public Member Functions

 AZ_RTTI (TwoStringEventData, "{A437CD65-4012-47DE-BC60-4F9EC2A9ACEE}", EventDataSyncable)
 
 TwoStringEventData (const AZStd::string &subject, const AZStd::string &parameters="", const AZStd::string &mirrorSubject="")
 
const AZStd::string & GetSubject () const
 
const AZStd::string & GetParameters () const
 
const AZStd::string & GetMirrorSubject () const
 
bool Equal (const EventData &rhs, bool ignoreEmptyFields=false) const override
 Test if two EventData instances are equal.
 
size_t HashForSyncing (bool isMirror) const override
 
- Public Member Functions inherited from EMotionFX::EventDataSyncable
 AZ_RTTI (EventDataSyncable, "{18A0050C-D05A-424C-B645-8E3B31120CBA}", EventData)
 
virtual size_t HashForSyncing (bool isMirror) const
 
- 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::EventDataSyncable
static void Reflect (AZ::ReflectContext *context)
 
- Static Public Member Functions inherited from EMotionFX::EventData
static void Reflect (AZ::ReflectContext *context)
 

Additional Inherited Members

- Protected Member Functions inherited from EMotionFX::EventDataSyncable
 EventDataSyncable (const size_t hash)
 
- Protected Attributes inherited from EMotionFX::EventDataSyncable
size_t m_hash
 

Member Function Documentation

◆ Equal()

bool EMotionFX::TwoStringEventData::Equal ( const EventData rhs,
bool  ignoreEmptyFields = false 
) const
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.

◆ HashForSyncing()

size_t EMotionFX::TwoStringEventData::HashForSyncing ( bool  isMirror) const
overridevirtual

Reimplemented from EMotionFX::EventDataSyncable.


The documentation for this class was generated from the following file: