You.i Engine
CYITimelineKeyTime Class Reference

Detailed Description

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
}
 

Public Member Functions

 CYITimelineKeyTime ()
 
 CYITimelineKeyTime (CYITimelineKeyTime &&)
 
 ~CYITimelineKeyTime ()
 
CYITimelineKeyTimeoperator= (CYITimelineKeyTime &&)
 
void CalculateValue (const CYITimelineKeyTime *pPrevious, float dataPositions[MAX_EASE_DIMENSIONS], uint32_t dimensionCount, CYIVariant &rOutValue) const
 
void ClearInterpolators ()
 
uint32_t GetDuration () const
 
void SetDuration (uint32_t duration)
 
uint32_t GetAbsoluteTime () const
 
void SetAbsoluteTime (uint32_t absoluteTime)
 
const EASEGetEase (size_t dimensionIndex) const
 
size_t GetEaseDimensionCount () const
 
InterpolationType GetInterpolationType () const
 
const CYIVariantGetKeyValue () const
 
float GetKeyValueAsFloat (size_t dimensionIndex) const
 
const SPATIAL_EASEGetSpatialEaseIn () const
 
const SPATIAL_EASEGetSpatialEaseOut () const
 
CYITimeInterpolatorGetTimeInterpolator (size_t valueIndex)
 
void InitKeyTime (CYITimelineKeyTime::KEYTIME_SETUP &&keytimeSetup)
 
void InitKeyTime (const CYITimelineKeyTime::KEYTIME_SETUP *pKeytimeSetup)
 
void SetSpatialInterpolator (float c0, float c1, float c2, float c3, size_t dimensionIndex)
 
void SetTimeInterpolator (std::unique_ptr< CYITimeInterpolator > pInterpolator, size_t dimensionIndex)
 
void DumpSpatialInterpolatorData ()
 
size_t GetApproximateSize () const
 

Static Public Attributes

static const uint32_t MAX_EASE_DIMENSIONS = 3
 

Member Enumeration Documentation

◆ InterpolationType

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.

Constructor & Destructor Documentation

◆ CYITimelineKeyTime() [1/2]

CYITimelineKeyTime::CYITimelineKeyTime ( )

◆ CYITimelineKeyTime() [2/2]

CYITimelineKeyTime::CYITimelineKeyTime ( CYITimelineKeyTime &&  )

◆ ~CYITimelineKeyTime()

CYITimelineKeyTime::~CYITimelineKeyTime ( )

Member Function Documentation

◆ CalculateValue()

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.

◆ ClearInterpolators()

void CYITimelineKeyTime::ClearInterpolators ( )

Resets the state of all temporal interpolators associated with this keytime.

See also
CYITimeInterpolator::Reset

◆ DumpSpatialInterpolatorData()

void CYITimelineKeyTime::DumpSpatialInterpolatorData ( )

Logs the current spatial interpolator data for each dimension index.

◆ GetAbsoluteTime()

uint32_t CYITimelineKeyTime::GetAbsoluteTime ( ) const

Returns the absolute time of this keytime, in milliseconds.

See also
SetAbsoluteTime

◆ GetApproximateSize()

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.

◆ GetDuration()

uint32_t CYITimelineKeyTime::GetDuration ( ) const

Returns the duration of this keytime, in milliseconds.

See also
SetDuration

◆ GetEase()

const EASE* CYITimelineKeyTime::GetEase ( size_t  dimensionIndex) const

Returns the ease values for dimensionIndex. Returns nullptr if dimensionIndex is out of range for the number of ease dimensions associated with this keytime.

See also
GetEaseDimensionCount

◆ GetEaseDimensionCount()

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.

See also
InitKeyTime

◆ GetInterpolationType()

InterpolationType CYITimelineKeyTime::GetInterpolationType ( ) const

Returns the type of interpolation associated with this keytime. This is set at initialization time.

See also
InitKeyTime

◆ GetKeyValue()

const CYIVariant& CYITimelineKeyTime::GetKeyValue ( ) const

Returns the property value at this keytime. This is set at initialization time.

See also
InitKeyTime

◆ GetKeyValueAsFloat()

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.

Note
dimensionIndex must be less than 3. Returns 0.0f if dimensionIndex is greater than 3 or the value cannot be returned as a float.
See also
GetKeyValue

◆ GetSpatialEaseIn()

const SPATIAL_EASE* CYITimelineKeyTime::GetSpatialEaseIn ( ) const

Returns the spatial ease values coming into the keytime. This is set at initialization time.

See also
InitKeyTime

◆ GetSpatialEaseOut()

const SPATIAL_EASE* CYITimelineKeyTime::GetSpatialEaseOut ( ) const

Returns the spatial ease values going out of the keytime. This is set at initialization time.

See also
InitKeyTime

◆ GetTimeInterpolator()

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.

See also
SetTimeInterpolator

◆ InitKeyTime() [1/2]

void CYITimelineKeyTime::InitKeyTime ( CYITimelineKeyTime::KEYTIME_SETUP &&  keytimeSetup)

Initializes the keytime with the values provided in keytimeSetup.

◆ InitKeyTime() [2/2]

void CYITimelineKeyTime::InitKeyTime ( const CYITimelineKeyTime::KEYTIME_SETUP pKeytimeSetup)
Deprecated:
This function is deprecated and may be removed in a future release. InitKeyTime(CYITimelineKeyTime::KEYTIME_SETUP &&) should be used instead.

Initializes the keytime with the values provided in pKeytimeSetup.

◆ operator=()

CYITimelineKeyTime& CYITimelineKeyTime::operator= ( CYITimelineKeyTime &&  )

◆ SetAbsoluteTime()

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.

◆ SetDuration()

void CYITimelineKeyTime::SetDuration ( uint32_t  duration)

Sets the duration of this keytime to duration, in milliseconds.

◆ SetSpatialInterpolator()

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.

◆ SetTimeInterpolator()

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.

Member Data Documentation

◆ MAX_EASE_DIMENSIONS

const uint32_t CYITimelineKeyTime::MAX_EASE_DIMENSIONS = 3
static

Represents the the number of dimensions that ease values can represent. The three dimensions are x, y and z.


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