Open 3D Engine MotionMatching 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::MotionMatching::FeatureTrajectory Class Reference

#include <FeatureTrajectory.h>

Inherits EMotionFX::MotionMatching::Feature.

Classes

struct  Sample
 

Public Types

enum class  Axis { X = 0 , Y = 1 , X_NEGATIVE = 2 , Y_NEGATIVE = 3 }
 
- Public Types inherited from EMotionFX::MotionMatching::Feature
enum  ResidualType { Absolute , Squared }
 

Public Member Functions

bool Init (const InitSettings &settings) override
 
void ExtractFeatureValues (const ExtractFeatureContext &context) override
 
void FillQueryVector (QueryVector &queryVector, const QueryVectorContext &context) override
 
float CalculateFutureFrameCost (size_t frameIndex, const FrameCostContext &context) const
 
float CalculatePastFrameCost (size_t frameIndex, const FrameCostContext &context) const
 
void DebugDraw (AzFramework::DebugDisplayRequests &debugDisplay, const Pose &currentPose, const FeatureMatrix &featureMatrix, const FeatureMatrixTransformer *featureTransformer, size_t frameIndex) override
 
void SetNumPastSamplesPerFrame (size_t numHistorySamples)
 
void SetNumFutureSamplesPerFrame (size_t numFutureSamples)
 
void SetPastTimeRange (float timeInSeconds)
 
void SetFutureTimeRange (float timeInSeconds)
 
void SetFacingAxis (const Axis axis)
 
void UpdateFacingAxis ()
 
float GetPastTimeRange () const
 
size_t GetNumPastSamples () const
 
float GetPastCostFactor () const
 
float GetFutureTimeRange () const
 
size_t GetNumFutureSamples () const
 
float GetFutureCostFactor () const
 
AZ::Vector2 CalculateFacingDirection (const Pose &pose, const Transform &invRootTransform) const
 
AZ::Vector3 GetFacingAxisDir () const
 
size_t GetNumDimensions () const override
 
AZStd::string GetDimensionName (size_t index) const override
 
- Public Member Functions inherited from EMotionFX::MotionMatching::Feature
virtual bool Init (const InitSettings &settings)
 
virtual void ExtractFeatureValues (const ExtractFeatureContext &context)=0
 
virtual void FillQueryVector (QueryVector &queryVector, const QueryVectorContext &context)=0
 
virtual float CalculateFrameCost (size_t frameIndex, const FrameCostContext &context) const
 
void SetCostFactor (float costFactor)
 
float GetCostFactor () const
 
virtual void DebugDraw (AzFramework::DebugDisplayRequests &debugDisplay, const Pose &currentPose, const FeatureMatrix &featureMatrix, const FeatureMatrixTransformer *featureTransformer, size_t frameIndex)
 
void SetDebugDrawColor (const AZ::Color &color)
 
const AZ::Color & GetDebugDrawColor () const
 
void SetDebugDrawEnabled (bool enabled)
 
bool GetDebugDrawEnabled () const
 
void SetJointName (const AZStd::string &jointName)
 
const AZStd::string & GetJointName () const
 
void SetRelativeToJointName (const AZStd::string &jointName)
 
const AZStd::string & GetRelativeToJointName () const
 
void SetName (const AZStd::string &name)
 
const AZStd::string & GetName () const
 
virtual size_t GetNumDimensions () const =0
 
virtual AZStd::string GetDimensionName (size_t index) const
 
FeatureMatrix::Index GetColumnOffset () const
 
void SetColumnOffset (FeatureMatrix::Index offset)
 
const AZ::TypeId & GetId () const
 
size_t GetRelativeToNodeIndex () const
 
void SetRelativeToNodeIndex (size_t nodeIndex)
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 
static void DebugDrawFacingDirection (AzFramework::DebugDisplayRequests &debugDisplay, const AZ::Vector3 &positionWorldSpace, const AZ::Vector3 &facingDirectionWorldSpace)
 
- Static Public Member Functions inherited from EMotionFX::MotionMatching::Feature
static void Reflect (AZ::ReflectContext *context)
 

Additional Inherited Members

- Protected Member Functions inherited from EMotionFX::MotionMatching::Feature
float GetNormalizedDirectionDifference (const AZ::Vector2 &directionA, const AZ::Vector2 &directionB) const
 
float GetNormalizedDirectionDifference (const AZ::Vector3 &directionA, const AZ::Vector3 &directionB) const
 
float CalcResidual (float value) const
 
float CalcResidual (const AZ::Vector3 &a, const AZ::Vector3 &b) const
 
virtual AZ::Crc32 GetCostFactorVisibility () const
 
- Protected Attributes inherited from EMotionFX::MotionMatching::Feature
AZ::TypeId m_id = AZ::TypeId::CreateRandom()
 
AZStd::string m_name
 
AZStd::string m_jointName
 
AZStd::string m_relativeToJointName
 
AZ::Color m_debugColor = AZ::Colors::Green
 
bool m_debugDrawEnabled = false
 
float m_costFactor = 1.0f
 
ResidualType m_residualType = ResidualType::Absolute
 
FeatureMatrix::Index m_featureColumnOffset
 
size_t m_relativeToNodeIndex = InvalidIndex
 
size_t m_jointIndex = InvalidIndex
 

Detailed Description

Matches the root joint past and future trajectory. For each frame in the motion database, the position and facing direction relative to the current frame of the joint will be evaluated for a past and future time window. The past and future samples together form the trajectory of the current frame within the time window. This basically describes where the character came from to reach the current frame and where it will go when continuing to play the animation.

Member Function Documentation

◆ DebugDraw()

void EMotionFX::MotionMatching::FeatureTrajectory::DebugDraw ( AzFramework::DebugDisplayRequests &  debugDisplay,
const Pose &  currentPose,
const FeatureMatrix featureMatrix,
const FeatureMatrixTransformer featureTransformer,
size_t  frameIndex 
)
overridevirtual

◆ ExtractFeatureValues()

void EMotionFX::MotionMatching::FeatureTrajectory::ExtractFeatureValues ( const ExtractFeatureContext context)
overridevirtual

◆ FillQueryVector()

void EMotionFX::MotionMatching::FeatureTrajectory::FillQueryVector ( QueryVector queryVector,
const QueryVectorContext context 
)
overridevirtual

◆ GetDimensionName()

AZStd::string EMotionFX::MotionMatching::FeatureTrajectory::GetDimensionName ( size_t  index) const
overridevirtual

◆ GetNumDimensions()

size_t EMotionFX::MotionMatching::FeatureTrajectory::GetNumDimensions ( ) const
overridevirtual

◆ Init()

bool EMotionFX::MotionMatching::FeatureTrajectory::Init ( const InitSettings settings)
overridevirtual

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