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::EMotionFXManager Class Reference

#include <EMotionFXManager.h>

Inherits EMotionFX::BaseObject.

Public Member Functions

void LogInfo ()
 
const char * GetVersionString () const
 
const char * GetCompilationDate () const
 
uint32 GetHighVersion () const
 
uint32 GetLowVersion () const
 
float GetGlobalSimulationSpeed () const
 
void SetGlobalSimulationSpeed (float speedFactor)
 
void BuildLowVersionString (AZStd::string &outLowVersionString)
 
void Update (float timePassedInSeconds)
 
MCORE_INLINE ImporterGetImporter () const
 
MCORE_INLINE ActorManagerGetActorManager () const
 
MCORE_INLINE MotionManagerGetMotionManager () const
 
MCORE_INLINE EventManagerGetEventManager () const
 
MCORE_INLINE SoftSkinManagerGetSoftSkinManager () const
 
MCORE_INLINE MotionInstancePoolGetMotionInstancePool () const
 
MCORE_INLINE AnimGraphManagerGetAnimGraphManager () const
 
MCORE_INLINE RecorderGetRecorder () const
 
MCORE_INLINE DebugDrawGetDebugDraw () const
 
MCORE_INLINE PoseDataFactoryGetPoseDataFactory () const
 
AZ::Render::RenderActorSettingsGetRenderActorSettings () const
 
void SetMediaRootFolder (const char *path)
 
void InitAssetFolderPaths ()
 
void ConstructAbsoluteFilename (const char *relativeFilename, AZStd::string &outAbsoluteFilename)
 
AZStd::string ConstructAbsoluteFilename (const char *relativeFilename)
 
void GetFilenameRelativeToMediaRoot (AZStd::string *inOutFilename) const
 
MCORE_INLINE const char * GetMediaRootFolder () const
 
MCORE_INLINE const AZStd::string & GetMediaRootFolderString () const
 
MCORE_INLINE const AZStd::string & GetAssetSourceFolder () const
 
MCORE_INLINE const AZStd::string & GetAssetCacheFolder () const
 
MCORE_INLINE ThreadDataGetThreadData (uint32 threadIndex) const
 
MCORE_INLINE size_t GetNumThreads () const
 
void ShrinkPools ()
 
void RegisterMemoryCategories (MCore::MemoryTracker &memTracker)
 
MCore::Distance::EUnitType GetUnitType () const
 
void SetUnitType (MCore::Distance::EUnitType unitType)
 
bool GetIsInEditorMode () const
 
void SetIsInEditorMode (bool isInEditorMode)
 
bool GetIsInServerMode () const
 
void SetIsInServerMode (bool isInServerMode)
 
bool GetEnableServerOptimization () const
 
- Public Member Functions inherited from EMotionFX::BaseObject
 BaseObject ()
 
virtual ~BaseObject ()
 
- Public Member Functions inherited from MCore::MemoryObject
 MemoryObject ()
 
virtual ~MemoryObject ()
 
void IncreaseReferenceCount ()
 
void DecreaseReferenceCount ()
 
void Destroy ()
 
uint32 GetReferenceCount () const
 

Static Public Member Functions

static EMotionFXManagerCreate ()
 
static void GetFilenameRelativeTo (AZStd::string *inOutFilename, const char *folderPath)
 
static AZStd::string ResolvePath (const char *path)
 

Friends

class Initializer
 

Additional Inherited Members

- Protected Member Functions inherited from EMotionFX::BaseObject
void Delete () override
 
virtual void Delete ()
 

Detailed Description

The EMotion FX manager. This class can be used to obtain things such as version information about the current library version. Also it will provide initialization functionality which will automatically register things such as the EMotionFX related memory categories to the Core memory manager.

Member Function Documentation

◆ BuildLowVersionString()

void EMotionFX::EMotionFXManager::BuildLowVersionString ( AZStd::string &  outLowVersionString)

Build the low version string. In case of EMotion FX v3.9 this would make the output string equal to "9". In case of EMotion FX v3.05 this would make it equal to "05".

Parameters
outLowVersionStringThe output string to store the low version number in.

◆ ConstructAbsoluteFilename() [1/2]

AZStd::string EMotionFX::EMotionFXManager::ConstructAbsoluteFilename ( const char *  relativeFilename)

Convert relative filename (e.g. 'MyFolder/MyMotion.motion') to absolute one (e.g. 'C:/MyGame/Data/MyFolder/MyMotion.motion'). Converts the input filename to match the folder separator character and replaces the media root keyword with the actual media root folder location.

Parameters
relativeFilenameRelative filename containing the '' keyword.
Returns
Will contain the absolute filename after execution.

◆ ConstructAbsoluteFilename() [2/2]

void EMotionFX::EMotionFXManager::ConstructAbsoluteFilename ( const char *  relativeFilename,
AZStd::string &  outAbsoluteFilename 
)

Convert relative filename (e.g. 'MyFolder/MyMotion.motion') to absolute one (e.g. 'C:/MyGame/Data/MyFolder/MyMotion.motion'). Converts the input filename to match the folder separator character and replaces the media root keyword with the actual media root folder location.

Parameters
relativeFilenameRelative filename containing the '' keyword.
outAbsoluteFilenameWill contain the absolute filename after execution.

◆ GetActorManager()

MCORE_INLINE ActorManager * EMotionFX::EMotionFXManager::GetActorManager ( ) const
inline

Get the actor manager. This can also be accessed with the GetActorManager() macro.

Returns
A pointer to the actor manager.

◆ GetAnimGraphManager()

MCORE_INLINE AnimGraphManager * EMotionFX::EMotionFXManager::GetAnimGraphManager ( ) const
inline

Get the animgraph manager; This can also be accessed with the GetAnimGraphManager() macro.

Returns
A pointer to the animgraph manager.

◆ GetAssetCacheFolder()

MCORE_INLINE const AZStd::string & EMotionFX::EMotionFXManager::GetAssetCacheFolder ( ) const
inline

Get the asset cache folder path.

Returns
The path of the asset cache folder.

◆ GetAssetSourceFolder()

MCORE_INLINE const AZStd::string & EMotionFX::EMotionFXManager::GetAssetSourceFolder ( ) const
inline

Get the asset source folder path.

Returns
The path of the asset source folder.

◆ GetCompilationDate()

const char * EMotionFX::EMotionFXManager::GetCompilationDate ( ) const

Get the compilation date string.

Returns
The compilation date string.

◆ GetDebugDraw()

MCORE_INLINE DebugDraw * EMotionFX::EMotionFXManager::GetDebugDraw ( ) const
inline

Get the debug drawing class.

Returns
A pointer to the wavelet cache.

◆ GetEnableServerOptimization()

bool EMotionFX::EMotionFXManager::GetEnableServerOptimization ( ) const
inline

Get if EMotionFX is enabled for server optimization.

Returns
True if EMotionFX is in server mode and enabled for server optimization.

◆ GetEventManager()

MCORE_INLINE EventManager * EMotionFX::EMotionFXManager::GetEventManager ( ) const
inline

Get the event manager. This can also be accessed with the GetEventManager() macro.

Returns
A pointer to the event manager.

◆ GetFilenameRelativeTo()

static void EMotionFX::EMotionFXManager::GetFilenameRelativeTo ( AZStd::string *  inOutFilename,
const char *  folderPath 
)
static

Convert the given absolute filename to one relative to the given folder path.

Parameters
folderPathBase folder path to remove.
inOutFileNameAbsolute filename to be changed to a relative one.

◆ GetFilenameRelativeToMediaRoot()

void EMotionFX::EMotionFXManager::GetFilenameRelativeToMediaRoot ( AZStd::string *  inOutFilename) const

Convert the passed absolute filename to one relative to the media root folder.

Parameters
inOutFileNameAbsolute filename to be changed to a relative one using the current media root folder.

◆ GetGlobalSimulationSpeed()

float EMotionFX::EMotionFXManager::GetGlobalSimulationSpeed ( ) const

Get the global simulation speed factor. This value is multiplied with the timePassedInSeconds values (the frame times) when doing update calls. The default value is 1.0.

Returns
The currently set simulation play speed.

◆ GetHighVersion()

uint32 EMotionFX::EMotionFXManager::GetHighVersion ( ) const

Get the high version number. This would be 3 in case of EMotion FX v3.01.

Returns
The high version number.

◆ GetImporter()

MCORE_INLINE Importer * EMotionFX::EMotionFXManager::GetImporter ( ) const
inline

Get the importer, which can be used to load actors and motions. This can also be accessed with the GetImporter() macro.

Returns
A pointer to the importer.

◆ GetIsInEditorMode()

bool EMotionFX::EMotionFXManager::GetIsInEditorMode ( ) const
inline

Get if EMotionFX is in editor mode or not

Returns
True if EMotionFX is configured in editor mode (e.g. ly editor or EMStudio).

◆ GetIsInServerMode()

bool EMotionFX::EMotionFXManager::GetIsInServerMode ( ) const
inline

Get if EMotionFX is in server mode or not

Returns
True if EMotionFX is configured in server mode.

◆ GetLowVersion()

uint32 EMotionFX::EMotionFXManager::GetLowVersion ( ) const

Get the low version number. This would be 0 in case of EMotion FX v3.0. And it would be 10 in case of v3.01, or 100 in case of v3.10.

Returns
The low version number.

◆ GetMediaRootFolder()

MCORE_INLINE const char * EMotionFX::EMotionFXManager::GetMediaRootFolder ( ) const
inline

Get the path of the media root folder.

Returns
The path of the media root directory.

◆ GetMediaRootFolderString()

MCORE_INLINE const AZStd::string & EMotionFX::EMotionFXManager::GetMediaRootFolderString ( ) const
inline

Get the path of the media root folder as a string object.

Returns
The path of the media root directory.

◆ GetMotionInstancePool()

MCORE_INLINE MotionInstancePool * EMotionFX::EMotionFXManager::GetMotionInstancePool ( ) const
inline

Get the motion instance pool. This can also be accessed with the GetMotionInstancePool() macro.

Returns
A pointer to the motion instance pool.

◆ GetMotionManager()

MCORE_INLINE MotionManager * EMotionFX::EMotionFXManager::GetMotionManager ( ) const
inline

Get the motion manager. This can also be accessed with the GetMotionManager() macro.

Returns
A pointer to the motion manager.

◆ GetNumThreads()

MCORE_INLINE size_t EMotionFX::EMotionFXManager::GetNumThreads ( ) const
inline

Get the number of threads that are internally created.

Returns
The number of threads that we have internally created.

◆ GetRecorder()

MCORE_INLINE Recorder * EMotionFX::EMotionFXManager::GetRecorder ( ) const
inline

Get the recorder. This can also be accessed with the EMFX_RECODRER macro.

Returns
A pointer to the recorder.

◆ GetRenderActorSettings()

AZ::Render::RenderActorSettings * EMotionFX::EMotionFXManager::GetRenderActorSettings ( ) const
inline

Get the render actor settings

Returns
A pointer to global render actor settings.

◆ GetSoftSkinManager()

MCORE_INLINE SoftSkinManager * EMotionFX::EMotionFXManager::GetSoftSkinManager ( ) const
inline

Get the soft-skin manager. This manager is responsible for creating the best suitable softskin deformer type. On SSE powered PC's this could for example return an SSE optimized softskin mesh deformer, while on other systems it would return a native C++ version. This can also be accessed with the GetSoftSkinManager() macro.

Returns
A pointer to the soft-skinning manager.

◆ GetThreadData()

MCORE_INLINE ThreadData * EMotionFX::EMotionFXManager::GetThreadData ( uint32  threadIndex) const
inline

Get the unique per thread data for a given thread by index.

Parameters
threadIndexThe thread index, which must be between [0..GetNumThreads()-1].
Returns
The unique thread data for this thread.

◆ GetUnitType()

MCore::Distance::EUnitType EMotionFX::EMotionFXManager::GetUnitType ( ) const

Get the current unit type used. On default this is set to meters, so where one unit is one meter.

Returns
The unit type currently used.

◆ GetVersionString()

const char * EMotionFX::EMotionFXManager::GetVersionString ( ) const

Get the version string, which can be like: "EMotion FX v3.0".

Returns
The version string.

◆ InitAssetFolderPaths()

void EMotionFX::EMotionFXManager::InitAssetFolderPaths ( )

Initialize the asset source and cache folder paths.

◆ LogInfo()

void EMotionFX::EMotionFXManager::LogInfo ( )

Log information about this EMotion FX version.

◆ RegisterMemoryCategories()

void EMotionFX::EMotionFXManager::RegisterMemoryCategories ( MCore::MemoryTracker memTracker)

Register the EMotion FX related memory categories to a given memory tracker.

Parameters
memTrackerThe memory tracker to register to.

◆ ResolvePath()

static AZStd::string EMotionFX::EMotionFXManager::ResolvePath ( const char *  path)
static

Accesses the FileIO instance to resolve file alias to full paths

Parameters
pathfile path to resolve file aliases
Returns
The path with file aliases substituted to the registered path entries in the FileIO instance

◆ SetGlobalSimulationSpeed()

void EMotionFX::EMotionFXManager::SetGlobalSimulationSpeed ( float  speedFactor)

Set the global simulation speed factor. On default this is 1.0, which is normal speed. The value you set is basically being multiplied with the timePassedInSeconds values (the frame times) when doing update calls.

Parameters
speedFactorThe speed factor, which can be any number equal to zero or higher.

◆ SetIsInEditorMode()

void EMotionFX::EMotionFXManager::SetIsInEditorMode ( bool  isInEditorMode)
inline

Sets EMotionFX's editor mode.

Parameters
editorModeIndicating if EMotionFX is running in editor mode.

◆ SetIsInServerMode()

void EMotionFX::EMotionFXManager::SetIsInServerMode ( bool  isInServerMode)
inline

Sets EMotionFX's server mode.

Parameters
editorModeIndicating if EMotionFX is running in server mode.

◆ SetMediaRootFolder()

void EMotionFX::EMotionFXManager::SetMediaRootFolder ( const char *  path)

Set the path of the media root directory.

Parameters
pathThe path of the media root folder.

◆ SetUnitType()

void EMotionFX::EMotionFXManager::SetUnitType ( MCore::Distance::EUnitType  unitType)

Initialize the internal unit type to a given one. A unit type is for example meters, centimeters, etc. This normally is done at init time. All loaded data will be converted into this unit type scale. On default EMotion FX uses meters, so if you have an actor that is 180 centimeters high, it will be 1.8 units in height after loading. It is recommended to save all your files into the same unit system as your game uses. Set EMotion Studio to this same unit type and save your data (actors, motions, animgraphs). Please keep in mind switching the unit type using this method after you have actors loaded does not modify the already loaded actors. The same goes for motions and animgraphs and anything else.

Parameters
unitTypeThe unit type to use internally.

◆ ShrinkPools()

void EMotionFX::EMotionFXManager::ShrinkPools ( )

Shrink the memory pools, to reduce memory usage. When you create many actor instances and destroy them later again, the pools have been grown internally, which increases memory usage. To shrink the pools back to their minimum size again this method can be called. Keep in mind that this will free blocks of memory and can cause new allocations to happen again in next frames. So it is not advised to run this every frame.

◆ Update()

void EMotionFX::EMotionFXManager::Update ( float  timePassedInSeconds)

Update EMotion FX with a given time delta. You normally will call this only once per frame. It will update all actor instances internally.

Parameters
timePassedInSecondsThe time delta to update with, so basically the time passed since the last time you called Update.

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