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::KeyFrameFinder< ReturnType, StorageType > Class Template Reference

#include <KeyFrameFinder.h>

Public Member Functions

 KeyFrameFinder ()
 
 ~KeyFrameFinder ()
 

Static Public Member Functions

static size_t FindKey (float timeValue, const KeyFrame< ReturnType, StorageType > *keyTrack, size_t numKeys)
 

Detailed Description

template<class ReturnType, class StorageType>
class EMotionFX::KeyFrameFinder< ReturnType, StorageType >

The keyframe finder. This is used to quickly locate the two keys inside the keytrack to interpolate between. For example if there is a keyframe at every second, and we want to calculate a value at time 5.6, then we need to interpolate between the key with the time 5 and the key with the time 6. This class basically uses a kd-tree to perform the search. It quickly culls out parts of the keys which cannot be the one which we are searching for. This means the search times are linear, no matter how many keys we are searching.

Constructor & Destructor Documentation

◆ KeyFrameFinder()

template<class ReturnType , class StorageType >
KeyFrameFinder::KeyFrameFinder ( )

The constructor.

◆ ~KeyFrameFinder()

template<class ReturnType , class StorageType >
KeyFrameFinder::~KeyFrameFinder ( )

The destructor.

Member Function Documentation

◆ FindKey()

template<class ReturnType , class StorageType >
size_t KeyFrameFinder::FindKey ( float  timeValue,
const KeyFrame< ReturnType, StorageType > *  keyTrack,
size_t  numKeys 
)
static

Locates the key number to use for interpolation at a given time value. You will interpolate between the returned keyframe number and the one after that.

Parameters
timeValueThe time value you want to calculate a value at.
keyTrackThe keyframe array to perform the search on.
numKeysThe number of keyframes stored inside the keyTrack parameter buffer.
Returns
The key number, or InvalidIndex when no valid key could be found.

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