Classes | |
class | MotionEntry |
Public Types | |
typedef AZStd::unordered_map< AZStd::string, MotionSet::MotionEntry * > | MotionEntries |
Public Member Functions | |
MotionSet () | |
MotionSet (const char *name, MotionSet *parent=nullptr) | |
virtual | ~MotionSet () |
void | SetID (uint32 id) |
uint32 | GetID () const |
void | SetName (const char *name) |
const char * | GetName () const |
const AZStd::string & | GetNameString () const |
void | SetFilename (const char *filename) |
const char * | GetFilename () const |
const AZStd::string & | GetFilenameString () const |
AZStd::string | ConstructMotionFilename (const MotionEntry *motionEntry) |
void | AddMotionEntry (MotionEntry *motionEntry) |
MCORE_INLINE size_t | GetNumMotionEntries () const |
const MotionEntries & | GetMotionEntries () const |
void | RecursiveGetMotions (AZStd::unordered_set< Motion * > &childMotions) const |
void | ReserveMotionEntries (size_t numMotionEntries) |
void | Clear () |
void | RemoveMotionEntry (MotionEntry *motionEntry) |
MotionEntry * | FindMotionEntry (const Motion *motion) const |
MotionEntry * | FindMotionEntryById (const AZStd::string &motionId) const |
MotionEntry * | RecursiveFindMotionEntryById (const AZStd::string &motionId) const |
Motion * | RecursiveFindMotionById (const AZStd::string &motionId, bool loadOnDemand=true) const |
MotionSet * | RecursiveFindMotionSetByName (const AZStd::string &motionSetName, bool isOwnedByRuntime=false) const |
void | SetMotionEntryId (MotionEntry *motionEntry, const AZStd::string &newMotionId) |
Motion * | LoadMotion (MotionEntry *entry) const |
void | Preload () |
void | Reload () |
void | AddChildSet (MotionSet *motionSet) |
size_t | GetNumChildSets () const |
MotionSet * | GetChildSet (size_t index) const |
void | RecursiveGetMotionSets (AZStd::vector< const MotionSet * > &childMotionSets, bool isOwnedByRuntime=false) const |
void | RemoveChildSetByID (uint32 childSetID) |
MotionSet * | GetParentSet () const |
void | BuildIdStringList (AZStd::vector< AZStd::string > &idStrings) const |
MotionSet * | FindRootMotionSet () const |
void | SetDirtyFlag (bool dirty) |
bool | GetDirtyFlag () const |
void | SetAutoUnregister (bool enabled) |
bool | GetAutoUnregister () const |
void | SetIsOwnedByRuntime (bool isOwnedByRuntime) |
bool | GetIsOwnedByRuntime () const |
void | SetIsOwnedByAsset (bool isOwnedByAsset) |
bool | GetIsOwnedByAsset () const |
void | SetCallback (MotionSetCallback *callback, bool delExistingOneFromMem=true) |
MotionSetCallback * | GetCallback () const |
bool | SaveToFile (const AZStd::string &filename, AZ::SerializeContext *context) const |
void | Log () |
size_t | GetNumMorphMotions () const |
Static Public Member Functions | |
static void | Reflect (AZ::ReflectContext *context) |
static MotionSet * | LoadFromFile (const AZStd::string &filename, AZ::SerializeContext *context, const AZ::ObjectStream::FilterDescriptor &loadFilter=AZ::ObjectStream::FilterDescriptor(nullptr, AZ::ObjectStream::FILTERFLAG_IGNORE_UNKNOWN_CLASSES)) |
static MotionSet * | LoadFromBuffer (const void *buffer, const AZStd::size_t length, AZ::SerializeContext *context) |
typedef AZStd::unordered_map<AZStd::string, MotionSet::MotionEntry*> EMotionFX::MotionSet::MotionEntries |
Get the container holding the motion entries for entry traversal.
EMotionFX::MotionSet::MotionSet | ( | ) |
Default constructor.
EMotionFX::MotionSet::MotionSet | ( | const char * | name, |
MotionSet * | parent = nullptr |
||
) |
Constructor.
[in] | name | The name of the motion set. |
[in] | parent | The parent motion set. This parameter is optional. |
|
virtual |
Destructor.
void EMotionFX::MotionSet::AddChildSet | ( | MotionSet * | motionSet | ) |
Add the given motion set as a child set.
[in] | motionSet | A pointer to the motion set that will be added as child set. |
void EMotionFX::MotionSet::AddMotionEntry | ( | MotionEntry * | motionEntry | ) |
Add a motion entry to the motion set.
[in] | motionEntry | A pointer to the motion entry to add. |
void EMotionFX::MotionSet::BuildIdStringList | ( | AZStd::vector< AZStd::string > & | idStrings | ) | const |
Generate a list of motion identifications strings. This will walk over all motions and get their id strings.
[out] | idStrings | A list of motion identification strings from the motions inside the motion set. Make sure the array is empty before calling this function. |
void EMotionFX::MotionSet::Clear | ( | ) |
Remove all motion entries from the motion set.
MotionEntry * EMotionFX::MotionSet::FindMotionEntry | ( | const Motion * | motion | ) | const |
Find motion entry by motion pointer.
[in] | motion | A pointer to the motion. |
MotionSet * EMotionFX::MotionSet::FindRootMotionSet | ( | ) | const |
Recursively find the root motion set. This will return a pointer to itself when this is a root motion set already.
bool EMotionFX::MotionSet::GetAutoUnregister | ( | ) | const |
Check if this motion is automatically being unregistered from the motion manager when this motion gets deleted or not.
MotionSet * EMotionFX::MotionSet::GetChildSet | ( | size_t | index | ) | const |
Get the given child motion set.
[in] | index | The index of the child set to get. The index must be in range [0, GetNumChildSets()]. |
bool EMotionFX::MotionSet::GetDirtyFlag | ( | ) | const |
Get the dirty flag which indicates whether the user has made changes to the motion set. This indicator is set to true when the user changed something like adding a new motion entry. When the user saves the motion set, the indicator is usually set to false.
const char * EMotionFX::MotionSet::GetFilename | ( | ) | const |
Get the filename of the motion set.
const AZStd::string & EMotionFX::MotionSet::GetFilenameString | ( | ) | const |
Returns the filename of the motion set, as a string object.
uint32 EMotionFX::MotionSet::GetID | ( | ) | const |
Get the unique identification number for the motion set.
const char * EMotionFX::MotionSet::GetName | ( | ) | const |
Returns the name of the motion set.
const AZStd::string & EMotionFX::MotionSet::GetNameString | ( | ) | const |
Returns the name of the motion set, as a string object.
size_t EMotionFX::MotionSet::GetNumChildSets | ( | ) | const |
Get the number of child motion sets.
size_t EMotionFX::MotionSet::GetNumMorphMotions | ( | ) | const |
Get the number of motion entries that contain morph data.
|
inline |
Get the number of motion entries.
MotionSet * EMotionFX::MotionSet::GetParentSet | ( | ) | const |
Get a pointer to the parent motion set. nullptr if this is a root set.
Motion * EMotionFX::MotionSet::LoadMotion | ( | MotionEntry * | entry | ) | const |
Load the motion for a given entry.
[in] | entry | The entry to load the motion for. |
void EMotionFX::MotionSet::Preload | ( | ) |
Pre-load all motions inside the set and all its child sets. This prevents them from loading on demand only, in case loading performance is an issue.
void EMotionFX::MotionSet::RecursiveGetMotions | ( | AZStd::unordered_set< Motion * > & | childMotions | ) | const |
Gets child motions recursively. Every Motion* returned in childMotions will have directly or indirectly this MotionSet as a parent
[out] | childMotions | set where the child motions are returned. |
void EMotionFX::MotionSet::RecursiveGetMotionSets | ( | AZStd::vector< const MotionSet * > & | childMotionSets, |
bool | isOwnedByRuntime = false |
||
) | const |
Gets child motion sets recursively. Every MotionSet* returned in childMotionSets will have directly or indirectly this MotionSet as a parent
[out] | childMotionSets | set where the child motion sets are returned. |
void EMotionFX::MotionSet::Reload | ( | ) |
Resets all motion entries and pre-loads them once again using the latest media root folder path.
void EMotionFX::MotionSet::RemoveChildSetByID | ( | uint32 | childSetID | ) |
Remove the child set with the given id.
[in] | childSetID | The id of the child set which will be removed. |
void EMotionFX::MotionSet::RemoveMotionEntry | ( | MotionEntry * | motionEntry | ) |
Remove the given motion entry from the motion set.
[in] | motionEntry | A pointer to the motion entry to remove. |
void EMotionFX::MotionSet::ReserveMotionEntries | ( | size_t | numMotionEntries | ) |
Preallocate the array of motion entries. This will NOT grow the motion entries array as reported by GetNumMotionEntries(). However, it internally pre-allocates memory to make the AddMotionEntry() calls faster.
[in] | numMotionEntries | The number of motion entries to peallocate |
void EMotionFX::MotionSet::SetAutoUnregister | ( | bool | enabled | ) |
Set if we want to automatically unregister this motion from the motion manager when we delete this motion. On default this is set to true.
enabled | Set to true when you wish to automatically have the motion unregistered, otherwise set it to false. |
void EMotionFX::MotionSet::SetDirtyFlag | ( | bool | dirty | ) |
Set the dirty flag which indicates whether the user has made changes to the motion set. This indicator is set to true when the user changed something like adding a new motion entry. When the user saves the motion set, the indicator is usually set to false.
dirty | The dirty flag. |
void EMotionFX::MotionSet::SetFilename | ( | const char * | filename | ) |
Set the filename of the motion set.
[in] | filename | The filename of the motion set. |
void EMotionFX::MotionSet::SetID | ( | uint32 | id | ) |
Set the unique identification number for the motion set.
[in] | id | The unique identification number. |
void EMotionFX::MotionSet::SetIsOwnedByAsset | ( | bool | isOwnedByAsset | ) |
Marks the object as owned by an asset, as opposed to the tool suite.
void EMotionFX::MotionSet::SetIsOwnedByRuntime | ( | bool | isOwnedByRuntime | ) |
Marks the object as used by the engine runtime, as opposed to the tool suite.
void EMotionFX::MotionSet::SetMotionEntryId | ( | MotionEntry * | motionEntry, |
const AZStd::string & | newMotionId | ||
) |
Set a new motion id for the given motion entry. This will adjust the actual motion entry as well as update the hashmap.
[in] | motionEntry | The motion entry to change the id for. |
[in] | newMotionId | The new motion id. |
void EMotionFX::MotionSet::SetName | ( | const char * | name | ) |
Set the name of the motion set.
name | The name of the motion set. |