An individual point in a CYITimelineTrack which represents a CYISceneNode property value for a specific time in the track.
Keytimes are added to a CYITimelineTrack. The keytime contains information about the type of interpolation which is used to calculate a sample property value between two keytimes. The keytime also contains information relating to the speed and influence (EASE) at which the keytime property value is approached.
#include <animation/YiTimelineKeyTime.h>
Classes | |
struct | EASE |
struct | KEYTIME_SETUP |
struct | SPATIAL_EASE |
Public Types | |
enum | InterpolationType : uint8_t { InterpolationType::Linear, InterpolationType::Bezier, InterpolationType::Hold } |
Static Public Attributes | |
static const uint32_t | MAX_EASE_DIMENSIONS = 3 |
|
strong |
Enumeration of the interpolation types which the keytime is processed with.
Enumerator | |
---|---|
Linear | Only takes into account the keytimes on either side of the current keytime and values change uniformly between keytimes. This interpolation type is not as smooth as CYITimelineKeyTime::InterpolationType::Bezier. |
Bezier | The smoothest of the available interpolation types, creates a smooth curve between keytimes. |
Hold | Changes a CYISceneNode property over time without a gradual transition. This is a temporal interpolation method and not used for spatial properties. |
CYITimelineKeyTime::CYITimelineKeyTime | ( | ) |
CYITimelineKeyTime::CYITimelineKeyTime | ( | CYITimelineKeyTime && | ) |
CYITimelineKeyTime::~CYITimelineKeyTime | ( | ) |
void CYITimelineKeyTime::CalculateValue | ( | const CYITimelineKeyTime * | pPrevious, |
float | dataPositions[MAX_EASE_DIMENSIONS], | ||
uint32_t | dimensionCount, | ||
CYIVariant & | rOutValue | ||
) | const |
Calculates the interpolated value between this keytime and the pPrevious keytime. dataPositions represents the ease positions and dimensionCount specifies the number of dimensions represented by dataPositions. The interpolated output value will be stored in rOutValue.
void CYITimelineKeyTime::ClearInterpolators | ( | ) |
Resets the state of all temporal interpolators associated with this keytime.
void CYITimelineKeyTime::DumpSpatialInterpolatorData | ( | ) |
Logs the current spatial interpolator data for each dimension index.
uint32_t CYITimelineKeyTime::GetAbsoluteTime | ( | ) | const |
Returns the absolute time of this keytime, in milliseconds.
size_t CYITimelineKeyTime::GetApproximateSize | ( | ) | const |
Returns the approximate size of the keytime, in bytes. This approximation includes ease values associated with the keytime as well as class signature sizes.
uint32_t CYITimelineKeyTime::GetDuration | ( | ) | const |
Returns the duration of this keytime, in milliseconds.
Returns the ease values for dimensionIndex. Returns nullptr if dimensionIndex is out of range for the number of ease dimensions associated with this keytime.
size_t CYITimelineKeyTime::GetEaseDimensionCount | ( | ) | const |
Returns the number of ease dimensions associated with this keytime. This is based on the number of KEYTIME_SETUP::easeValues the keytime is initialized with.
InterpolationType CYITimelineKeyTime::GetInterpolationType | ( | ) | const |
Returns the type of interpolation associated with this keytime. This is set at initialization time.
const CYIVariant& CYITimelineKeyTime::GetKeyValue | ( | ) | const |
Returns the property value at this keytime. This is set at initialization time.
float CYITimelineKeyTime::GetKeyValueAsFloat | ( | size_t | dimensionIndex | ) | const |
Returns the property value at this keytime as a float. dimensionIndex represents the dimension of the value, if the value is a vector.
const SPATIAL_EASE* CYITimelineKeyTime::GetSpatialEaseIn | ( | ) | const |
Returns the spatial ease values coming into the keytime. This is set at initialization time.
const SPATIAL_EASE* CYITimelineKeyTime::GetSpatialEaseOut | ( | ) | const |
Returns the spatial ease values going out of the keytime. This is set at initialization time.
CYITimeInterpolator* CYITimelineKeyTime::GetTimeInterpolator | ( | size_t | valueIndex | ) |
Returns the time interpolator for valueIndex. Returns nullptr if the interpolator for the index has not been set or if the index is greater than or equal to MAX_EASE_DIMENSIONS.
void CYITimelineKeyTime::InitKeyTime | ( | CYITimelineKeyTime::KEYTIME_SETUP && | keytimeSetup | ) |
Initializes the keytime with the values provided in keytimeSetup.
void CYITimelineKeyTime::InitKeyTime | ( | const CYITimelineKeyTime::KEYTIME_SETUP * | pKeytimeSetup | ) |
Initializes the keytime with the values provided in pKeytimeSetup.
CYITimelineKeyTime& CYITimelineKeyTime::operator= | ( | CYITimelineKeyTime && | ) |
void CYITimelineKeyTime::SetAbsoluteTime | ( | uint32_t | absoluteTime | ) |
Sets the absolute time of this keytime to absoluteTime. This is the absolute position of this keytime in the timeline, in milliseconds.
void CYITimelineKeyTime::SetDuration | ( | uint32_t | duration | ) |
Sets the duration of this keytime to duration, in milliseconds.
void CYITimelineKeyTime::SetSpatialInterpolator | ( | float | c0, |
float | c1, | ||
float | c2, | ||
float | c3, | ||
size_t | dimensionIndex | ||
) |
Sets the spatial interpolator data for the specified dimensionIndex. dimensionIndex must be less than MAX_EASE_DIMENSIONS.
void CYITimelineKeyTime::SetTimeInterpolator | ( | std::unique_ptr< CYITimeInterpolator > | pInterpolator, |
size_t | dimensionIndex | ||
) |
Sets the time interpolator for the specified dimensionIndex to pInterpolator. dimensionIndex must be less than MAX_EASE_DIMENSIONS.
|
static |
Represents the the number of dimensions that ease values can represent. The three dimensions are x, y and z.