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::MotionData Class Referenceabstract

Inherited by EMotionFX::NonUniformMotionData, and EMotionFX::UniformMotionData.

Classes

struct  Key
 
struct  OptimizeSettings
 
struct  ReadSettings
 
struct  RootMotionExtractionSettings
 
struct  SaveSettings
 
struct  StaticFloatData
 
struct  StaticJointData
 

Public Types

using Vector3Key = Key< AZ::Vector3 >
 
using QuaternionKey = Key< AZ::Quaternion >
 
using FloatKey = Key< float >
 

Public Member Functions

 MotionData (const MotionData &)=delete
 
 MotionData (MotionData &&)=delete
 
MotionDataoperator= (const MotionData &)=delete
 
MotionDataoperator= (MotionData &&)=delete
 
virtual void InitFromNonUniformData (const NonUniformMotionData *motionData, bool keepSameSampleRate=true, float newSampleRate=30.0f, bool updateDuration=false)=0
 
virtual void Optimize (const OptimizeSettings &settings)
 
virtual bool Read (MCore::Stream *stream, const ReadSettings &readSettings)=0
 
virtual bool Save (MCore::Stream *stream, const SaveSettings &saveSettings) const =0
 
virtual size_t CalcStreamSaveSizeInBytes (const SaveSettings &saveSettings) const =0
 
virtual AZ::u32 GetStreamSaveVersion () const =0
 
virtual bool GetSupportsOptimizeSettings () const
 
virtual const char * GetSceneSettingsName () const =0
 
virtual Transform SampleJointTransform (const MotionDataSampleSettings &settings, size_t jointSkeletonIndex) const =0
 
virtual void SamplePose (const MotionDataSampleSettings &settings, Pose *outputPose) const =0
 
virtual float SampleMorph (float sampleTime, size_t morphDataIndex) const =0
 
virtual float SampleFloat (float sampleTime, size_t morphDataIndex) const =0
 
virtual Transform SampleJointTransform (float sampleTime, size_t jointIndex) const =0
 
virtual AZ::Vector3 SampleJointPosition (float sampleTime, size_t jointDataIndex) const =0
 
virtual AZ::Quaternion SampleJointRotation (float sampleTime, size_t jointDataIndex) const =0
 
bool SampleJointPosition (float sampleTime, AZ::u32 jointNameId, AZ::Vector3 &resultValue) const
 
bool SampleJointRotation (float sampleTime, AZ::u32 jointNameId, AZ::Quaternion &resultValue) const
 
bool SampleMorph (float sampleTime, AZ::u32 id, float &resultValue) const
 
bool SampleFloat (float sampleTime, AZ::u32 id, float &resultValue) const
 
virtual void ClearAllJointTransformSamples ()=0
 
virtual void ClearAllMorphSamples ()=0
 
virtual void ClearAllFloatSamples ()=0
 
virtual void ClearJointPositionSamples (size_t jointDataIndex)=0
 
virtual void ClearJointRotationSamples (size_t jointDataIndex)=0
 
virtual void ClearJointTransformSamples (size_t jointDataIndex)=0
 
virtual void ClearMorphSamples (size_t morphDataIndex)=0
 
virtual void ClearFloatSamples (size_t floatDataIndex)=0
 
virtual bool IsJointPositionAnimated (size_t jointDataIndex) const =0
 
virtual bool IsJointRotationAnimated (size_t jointDataIndex) const =0
 
virtual bool IsJointAnimated (size_t jointDataIndex) const =0
 
virtual bool IsMorphAnimated (size_t morphDataIndex) const =0
 
virtual bool IsFloatAnimated (size_t floatDataIndex) const =0
 
virtual void UpdateDuration ()
 
virtual bool VerifyIntegrity () const
 
void Resize (size_t numJoints, size_t numMorphs, size_t numFloats)
 
void Clear ()
 
size_t AddJoint (const AZStd::string &name, const Transform &poseTransform, const Transform &bindPoseTransform)
 
size_t AddMorph (const AZStd::string &name, float poseValue)
 
size_t AddFloat (const AZStd::string &name, float poseValue)
 
void RemoveJoint (size_t jointDataIndex)
 
void RemoveMorph (size_t morphDataIndex)
 
void RemoveFloat (size_t floatDataIndex)
 
void Scale (float scaleFactor)
 
float GetDuration () const
 
float GetSampleRate () const
 
void SetDuration (float duration)
 
virtual void SetSampleRate (float sampleRate)
 
AZ::Outcome< size_t > FindJointIndexByNameId (size_t nameId) const
 
AZ::Outcome< size_t > FindMorphIndexByNameId (AZ::u32 nameId) const
 
AZ::Outcome< size_t > FindFloatIndexByNameId (AZ::u32 nameId) const
 
size_t GetNumJoints () const
 
size_t GetNumMorphs () const
 
size_t GetNumFloats () const
 
const AZStd::string & GetJointName (size_t jointDataIndex) const
 
const AZStd::string & GetMorphName (size_t morphDataIndex) const
 
const AZStd::string & GetFloatName (size_t floatDataIndex) const
 
AZ::Vector3 GetJointStaticPosition (size_t jointDataIndex) const
 
AZ::Quaternion GetJointStaticRotation (size_t jointDataIndex) const
 
Transform GetJointStaticTransform (size_t jointDataIndex) const
 
AZ::Vector3 GetJointBindPosePosition (size_t jointDataIndex) const
 
AZ::Quaternion GetJointBindPoseRotation (size_t jointDataIndex) const
 
Transform GetJointBindPoseTransform (size_t jointDataIndex) const
 
float GetMorphStaticValue (size_t morphDataIndex) const
 
float GetFloatStaticValue (size_t floatDataIndex) const
 
AZ::u32 GetJointNameId (size_t jointDataIndex) const
 
AZ::u32 GetMorphNameId (size_t morphDataIndex) const
 
AZ::u32 GetFloatNameId (size_t floatDataIndex) const
 
AZ::Outcome< size_t > FindJointIndexByName (const AZStd::string &name) const
 
AZ::Outcome< size_t > FindMorphIndexByName (const AZStd::string &name) const
 
AZ::Outcome< size_t > FindFloatIndexByName (const AZStd::string &name) const
 
void SetJointName (size_t jointDataIndex, const AZStd::string &name)
 
void SetMorphName (size_t morphDataIndex, const AZStd::string &name)
 
void SetFloatName (size_t floatDataIndex, const AZStd::string &name)
 
void SetJointNameId (size_t jointDataIndex, AZ::u32 id)
 
void SetMorphNameId (size_t morphDataIndex, AZ::u32 id)
 
void SetFloatNameId (size_t floatDataIndex, AZ::u32 id)
 
void SetJointStaticTransform (size_t jointDataIndex, const Transform &transform)
 
void SetJointStaticPosition (size_t jointDataIndex, const AZ::Vector3 &position)
 
void SetJointStaticRotation (size_t jointDataIndex, const AZ::Quaternion &rotation)
 
void SetJointBindPoseTransform (size_t jointDataIndex, const Transform &transform)
 
void SetJointBindPosePosition (size_t jointDataIndex, const AZ::Vector3 &position)
 
void SetJointBindPoseRotation (size_t jointDataIndex, const AZ::Quaternion &rotation)
 
void SetMorphStaticValue (size_t morphDataIndex, float poseValue)
 
void SetFloatStaticValue (size_t floatDataIndex, float poseValue)
 
const MotionLinkDataFindMotionLinkData (const Actor *actor) const
 
size_t GetNumMotionLinkCacheEntries () const
 
void BasicRetarget (const ActorInstance *actorInstance, const MotionLinkData *motionLinkData, size_t jointIndex, Transform &inOutTransform) const
 
bool IsAdditive () const
 
void SetAdditive (bool isAdditive)
 
virtual AZ::Vector3 SampleJointScale (float sampleTime, size_t jointDataIndex) const =0
 
bool SampleJointScale (float sampleTime, AZ::u32 jointNameId, AZ::Vector3 &resultValue) const
 
virtual void ClearJointScaleSamples (size_t jointDataIndex)=0
 
virtual bool IsJointScaleAnimated (size_t jointDataIndex) const =0
 
AZ::Vector3 GetJointStaticScale (size_t jointDataIndex) const
 
AZ::Vector3 GetJointBindPoseScale (size_t jointDataIndex) const
 
void SetJointStaticScale (size_t jointDataIndex, const AZ::Vector3 &scale)
 
void SetJointBindPoseScale (size_t jointDataIndex, const AZ::Vector3 &scale)
 
virtual void ExtractRootMotion (size_t sampleJointDataIndex, size_t rootJointDataIndex, const RootMotionExtractionData &data)
 

Static Public Member Functions

static void CalculateSampleInformation (float duration, float &inOutSampleRate, size_t &numSamples, float &sampleSpacing)
 
static size_t CalculateNumRequiredSamples (float duration, float sampleSpacing)
 
static void CalculateInterpolationIndicesNonUniform (const AZStd::vector< float > &timeValues, float sampleTime, size_t &indexA, size_t &indexB, float &t)
 
static void CalculateInterpolationIndicesUniform (float sampleTime, float sampleSpacing, float duration, size_t numSamples, size_t &indexA, size_t &indexB, float &t)
 
static AZStd::string ReadStringFromStream (MCore::Stream *stream, MCore::Endian::EEndianType sourceEndianType)
 

Protected Member Functions

virtual void ResizeSampleData (size_t numJoints, size_t numMorphs, size_t numFloats)=0
 
virtual void AddJointSampleData (size_t jointDataIndex)=0
 
virtual void AddMorphSampleData (size_t morphDataIndex)=0
 
virtual void AddFloatSampleData (size_t floatDataIndex)=0
 
virtual void RemoveJointSampleData (size_t jointDataIndex)=0
 
virtual void RemoveMorphSampleData (size_t morphDataIndex)=0
 
virtual void RemoveFloatSampleData (size_t floatDataIndex)=0
 
virtual void ClearAllData ()=0
 
virtual void ScaleData (float scaleFactor)=0
 
virtual AZStd::unique_ptr< const MotionLinkDataCreateMotionLinkData (const Actor *actor) const
 
void CopyBaseMotionData (const MotionData *motionData)
 

Static Protected Member Functions

static AZ::Outcome< size_t > FindFloatDataIndexById (const AZStd::vector< StaticFloatData > &data, AZ::u32 id)
 

Protected Attributes

AZStd::vector< StaticJointDatam_staticJointData
 
AZStd::vector< StaticFloatDatam_staticMorphData
 
AZStd::vector< StaticFloatDatam_staticFloatData
 
float m_duration = 0.0f
 
float m_sampleRate = 30.0f
 
bool m_additive = false
 
bool m_rootMotionExtracted = false
 

Friends

class MotionDataFactory
 

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