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>

Inheritance diagram for CYITimelineKeyTime:

Classes

struct  EASE
 
struct  KEYTIME_SETUP
 
struct  SPATIAL_EASE
 

Public Types

enum  INTERPOLATION_TYPE {
  LINEAR,
  BEZIER,
  HOLD
}
 

Public Member Functions

 CYITimelineKeyTime ()
 
virtual ~CYITimelineKeyTime ()
 
void CalculateValue (const CYITimelineKeyTime *pPrevious, float fDataPositions[MAX_EASE_DIMENSIONS], uint32_t uDimensionCount, CYIVariant &rOutValue) const
 
void ClearInterpolators ()
 
uint32_t GetDuration () const
 
void SetDuration (uint32_t uDuration)
 
uint32_t GetAbsoluteTime () const
 
void SetAbsoluteTime (uint32_t uAbsoluteTime)
 
const EASEGetEase (uint32_t uDimensionIndex) const
 
uint32_t GetEaseDimensionCount () const
 
INTERPOLATION_TYPE GetInterpolationType () const
 
const CYIVariantGetKeyValue () const
 
float GetKeyValueAsFloat (uint32_t nDimensionIndex) const
 
const SPATIAL_EASEGetSpatialEaseIn () const
 
const SPATIAL_EASEGetSpatialEaseOut () const
 
CYITimeInterpolatorGetTimeInterpolator (uint32_t uValueIndex)
 
void InitKeyTime (const CYITimelineKeyTime::KEYTIME_SETUP *pKeytimeSetup)
 
void SetSpatialInterpolator (float fC0, float fC1, float fC2, float fC3, uint32_t uDimensionIndex)
 
void SetTimeInterpolator (std::unique_ptr< CYITimeInterpolator > pInterpolator, uint32_t uDimensionIndex)
 
void DumpSpatialInterpolatorData ()
 
int32_t GetApproximateSize () const
 
- Public Member Functions inherited from CYIScriptableObject
 CYIScriptableObject ()
 
 CYIScriptableObject (const CYIScriptableObject &other)
 
CYIScriptableObjectoperator= (const CYIScriptableObject &other)
 
virtual ~CYIScriptableObject ()
 
CYIBindingImplementationGetBindingImplementation () const
 
void SetBindingImplementation (CYIBindingImplementation *pBindingImplementation)
 
virtual const CYIRuntimeTypeInfoGetRuntimeTypeInfoForScriptObject () const
 

Static Public Attributes

static const uint32_t MAX_EASE_DIMENSIONS = 3
 

Member Enumeration Documentation

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 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::CYITimelineKeyTime ( )
virtual CYITimelineKeyTime::~CYITimelineKeyTime ( )
virtual

Member Function Documentation

void CYITimelineKeyTime::CalculateValue ( const CYITimelineKeyTime pPrevious,
float  fDataPositions[MAX_EASE_DIMENSIONS],
uint32_t  uDimensionCount,
CYIVariant rOutValue 
) const

Calculates the interpolated value between this keytime and the pPrevious keytime. fDataPositions represents the ease positions and uDimensionCount specifies the number of dimensions represented by fDataPositions. The interpolated output value will be stored in rOutValue.

void CYITimelineKeyTime::ClearInterpolators ( )

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

See also
CYITimeInterpolator::Reset
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.

See also
SetAbsoluteTime
int32_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.

See also
SetDuration
const EASE* CYITimelineKeyTime::GetEase ( uint32_t  uDimensionIndex) const

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

See also
GetEaseDimensionCount
uint32_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
INTERPOLATION_TYPE CYITimelineKeyTime::GetInterpolationType ( ) const

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

See also
InitKeyTime
const CYIVariant& CYITimelineKeyTime::GetKeyValue ( ) const

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

See also
InitKeyTime
float CYITimelineKeyTime::GetKeyValueAsFloat ( uint32_t  nDimensionIndex) const

Returns the property value at this keytime as a float. nDimensionIndex represents the dimension of the value, if the value is a vector.

Note
nDimensionIndex must be less than 3. Returns 0.0f if nDimensionIndex is greater than 3 or the value cannot be returned as a float.
See also
GetKeyValue
const SPATIAL_EASE* CYITimelineKeyTime::GetSpatialEaseIn ( ) const

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

See also
InitKeyTime
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
CYITimeInterpolator* CYITimelineKeyTime::GetTimeInterpolator ( uint32_t  uValueIndex)

Returns the time interpolator for uValueIndex. 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
void CYITimelineKeyTime::InitKeyTime ( const CYITimelineKeyTime::KEYTIME_SETUP pKeytimeSetup)

Initializes the keytime with the values provided in pKeytimeSetup.

void CYITimelineKeyTime::SetAbsoluteTime ( uint32_t  uAbsoluteTime)

Sets the absolute time of this keytime to uAbsoluteTime. This is the absolute position of this keytime in the timeline, in milliseconds.

void CYITimelineKeyTime::SetDuration ( uint32_t  uDuration)

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

void CYITimelineKeyTime::SetSpatialInterpolator ( float  fC0,
float  fC1,
float  fC2,
float  fC3,
uint32_t  uDimensionIndex 
)

Sets the spatial interpolator data for the specified uDimensionIndex. uDimensionIndex must be less than MAX_EASE_DIMENSIONS.

void CYITimelineKeyTime::SetTimeInterpolator ( std::unique_ptr< CYITimeInterpolator pInterpolator,
uint32_t  uDimensionIndex 
)

Sets the time interpolator for the specified uDimensionIndex to pInterpolator. uDimensionIndex must be less than MAX_EASE_DIMENSIONS.

Member Data Documentation

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: