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

#include <FrameDatabase.h>

Classes

struct  FrameImportSettings
 

Public Member Functions

AZStd::tuple< size_t, size_t > ImportFrames (Motion *motion, const FrameImportSettings &settings, bool mirrored)
 
void Clear ()
 
size_t GetNumFrames () const
 
size_t GetNumUsedMotions () const
 
size_t CalcMemoryUsageInBytes () const
 
const Motion * GetUsedMotion (size_t index) const
 
const FrameGetFrame (size_t index) const
 
const AZStd::vector< Frame > & GetFrames () const
 
AZStd::vector< Frame > & GetFrames ()
 
const AZStd::vector< const Motion * > & GetUsedMotions () const
 
size_t GetSampleRate () const
 
size_t FindFrameIndex (Motion *motion, float playtime) const
 
void SaveAsCsv (const char *filename, ActorInstance *actorInstance, const ETransformSpace transformSpace, bool writePositions, bool writeRotations) const
 Save every frame as a row to a .csv file.
 

Detailed Description

A set of frames from your animations sampled at a given sample rate is stored in the frame database. A frame object knows about its index in the frame database, the animation it belongs to and the sample time in seconds. It does not hold the actual sampled pose for memory reasons as the EMotionFX::Motion already store the transform keyframes. The sample rate of the animation might differ from the sample rate used for the frame database. For example, your animations might be recorded with 60 Hz while we only want to extract the features with a sample rate of 30 Hz. As the motion matching algorithm is blending between the frames in the motion database while playing the animation window between the jumps/blends, it can make sense to have animations with a higher sample rate than we use to extract the features. A frame of the motion database can be used to sample a pose from which we can extract the features. It also provides functionality to sample a pose with a time offset to that frame. This can be handy in order to calculate joint velocities or trajectory samples. When importing animations, frames that are within the range of a discard frame motion event are ignored and won't be added to the motion database. Discard motion events can be used to cut out sections of the imported animations that are unwanted like a stretching part between two dance cards.

Member Function Documentation

◆ FindFrameIndex()

size_t EMotionFX::MotionMatching::FrameDatabase::FindFrameIndex ( Motion *  motion,
float  playtime 
) const

Find the frame index for the given playtime and motion. NOTE: This is a slow operation and should not be used by the runtime without visual debugging.


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