* Moved the extract events call and the check for a discard frame event to the IsFrameDiscarded() function.
* Added class description for the frame database and ported the comments to //! and //<
Signed-off-by: Benjamin Jillich <jillich@amazon.com>
//! 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,
// This is basically a database of frames (which point to motion objects), together with meta data per frame.
//! 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
// No actual pose data is stored directly inside this class, just references to the right sample times inside specific motions.
//! 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.
// The settings used when importing motions into the frame database.
//! The settings used when importing motions into the frame database.
// Used in combination with ImportFrames().
//! Used in combination with ImportFrames().
structEMFX_APIFrameImportSettings
structEMFX_APIFrameImportSettings
{
{
size_tm_sampleRate=30;/**< Sample at 30 frames per second on default. */
size_tm_sampleRate=30;//< Sample at 30 frames per second on default.
boolm_autoShrink=true;/**< Automatically shrink the internal frame arrays to their minimum size afterwards. */
boolm_autoShrink=true;//< Automatically shrink the internal frame arrays to their minimum size afterwards.
};
};
FrameDatabase();
FrameDatabase();
virtual~FrameDatabase();
virtual~FrameDatabase();
// Main functions.
// Main functions.
AZStd::tuple<size_t,size_t>ImportFrames(Motion*motion,constFrameImportSettings&settings,boolmirrored);// Returns the number of imported frames and the number of discarded frames as second element.
AZStd::tuple<size_t,size_t>ImportFrames(Motion*motion,constFrameImportSettings&settings,boolmirrored);//< Returns the number of imported frames and the number of discarded frames as second element.
voidClear();// Clear the data, so you can re-initialize it with new data.
voidClear();//< Clear the data, so you can re-initialize it with new data.
voidExtractActiveMotionEventDatas(constMotion*motion,floattime,AZStd::vector<EventData*>&activeEventDatas);// Vector will be cleared internally.
voidExtractActiveMotionEventDatas(constMotion*motion,floattime,AZStd::vector<EventData*>&activeEventDatas)const;// Vector will be cleared internally.
private:
private:
AZStd::vector<Frame>m_frames;/**< The collection of frames. Keep in mind these don't hold a pose, but reference to a given frame/time value inside a given motion. */
AZStd::vector<Frame>m_frames;//< The collection of frames. Keep in mind these don't hold a pose, but reference to a given frame/time value inside a given motion.