The HBhvTimeline class encpasulates an animation timeline.
More...
#include <HBhvTimeline.h>
|
static void * | XMLCallback (HUtilityXMLTag *xt, bool open, void *m_pExtraData) |
|
The HBhvTimeline class encpasulates an animation timeline.
Each animation consists of one timeline and multiple interpolators. The timeline is an array of ascending values measured in ticks with each value representing one keyframe of the animation.
◆ HBhvTimeline()
Constructs an HBhvTimeline object.
- Parameters
-
animation | A pointer to the animation that this timeline is associated with. |
◆ AddKeyframe() [1/2]
int HBhvTimeline::AddKeyframe |
( |
int |
t, |
|
|
bool & |
doesExist |
|
) |
| |
Adds a new keyframe to the timeline.
- Parameters
-
t | The keyframe time in ticks. |
doesExist | Pass by reference. Returns true if a keyframe time already exists in the timeline. |
- Returns
- The number of the newly created keyframe.
◆ AddKeyframe() [2/2]
int HBhvTimeline::AddKeyframe |
( |
int |
t | ) |
|
Adds a new keyframe to the timeline.
- Parameters
-
t | The keyframe time in ticks. |
- Returns
- The number of the newly created keyframe.
◆ AddKeyframeInternal()
int HBhvTimeline::AddKeyframeInternal |
( |
int |
t, |
|
|
bool * |
doesExist |
|
) |
| |
|
protected |
Add keyframe interval to timeline. This method is for internal use.
- Parameters
-
t | Position where to add interval. |
doesExist | Returns true if interval already exist or false if interval does not exist. |
- Returns
- Position of the newly inserted interval.
◆ Adjust()
void HBhvTimeline::Adjust |
( |
int |
time, |
|
|
int |
delta, |
|
|
bool |
doall = true |
|
) |
| |
Adjusts the given keyframe time by the passed delta value.
- Parameters
-
time | The time of the keyframe to begin the adjustment. |
delta | The number of ticks to offset the given time. |
doall | Pass true ripple the effect to all keyframes after the given time. |
◆ AdjustRelative()
void HBhvTimeline::AdjustRelative |
( |
int |
time, |
|
|
int |
delta |
|
) |
| |
Adjust Timeline based on delta value relative to current time. In other words, the timeline will be offset by the pass delta value for all the keyframe interval at the given time and all the keyframe intervals after that time.
- Parameters
-
time | The time of the keyframe to begin the adjustment. |
delta | The number of ticks to offset the given time. |
◆ AdjustTickToTimeline()
float HBhvTimeline::AdjustTickToTimeline |
( |
float |
tick | ) |
|
|
protected |
For the given tick, this method returns a tick that has been adjusted to for the timeline. It takes into account factors such as start time and if the animation is looped.
- Parameters
-
tick | The time in ticks to be adjusted. |
- Returns
- The newly adjusted time.
◆ CheckKeyframe()
int HBhvTimeline::CheckKeyframe |
( |
int |
t | ) |
|
This method searches for keyframe based the given time.
- Parameters
-
t | Time in ticks of the keyframe to be searched for. |
- Returns
- The position of the keyframe associated with the given time or -1 if no keyframe could be found.
◆ CreateInstance()
In special cases, you might want to reference this timeline without changing it. To create a new timeline that references this timeline, use this method and pass a pointer to the animation you want associated with the new timeline.
- Parameters
-
animation | Animation that the created timeline instance should reference |
- Returns
- The newly created timeline instance.
◆ DeleteKeyframe()
int HBhvTimeline::DeleteKeyframe |
( |
int |
t | ) |
|
This method deletes the keyframe associated with the given time t from the timeline.
- Parameters
-
t | Time in ticks of the keyframe to delete. |
- Returns
- The position of the deleted keyframe or -1 if no keyframe was found and deleted.
◆ Evaluate()
virtual bool HBhvTimeline::Evaluate |
( |
float |
currentTick, |
|
|
int & |
interval, |
|
|
float & |
fraction |
|
) |
| |
|
virtual |
Calculates the keyframe position and fraction value based on the current time.
- Parameters
-
currentTick | Current Time int tps |
interval | Returns the keyframe interval which was closest to the currentTick. |
fraction | Returns fraction to next keyframe which will be a value between 0 and 1. |
- Returns
- True if a valid keyframe interval was found and false if no valid keyframe was found.
◆ GetAnimation()
- Returns
- A pointer to the associated animation object.
◆ GetCurrentRelativeTick()
float HBhvTimeline::GetCurrentRelativeTick |
( |
| ) |
|
|
inline |
- Returns
- Current tick relative to the properties in this timeline. This value takes into account start time and looping.
◆ GetCurrentTick()
float HBhvTimeline::GetCurrentTick |
( |
| ) |
|
|
inline |
- Returns
- The current tick for this timeline.
◆ GetFirstTick()
int HBhvTimeline::GetFirstTick |
( |
| ) |
|
- Returns
- The first time value of keyframe time array.
◆ GetLastTick()
int HBhvTimeline::GetLastTick |
( |
| ) |
|
- Returns
- The last time value of keyframe time array.
◆ GetStartTick()
float HBhvTimeline::GetStartTick |
( |
| ) |
|
|
inline |
- Returns
- The start time for this time line.
◆ GetTimelineArray()
int* HBhvTimeline::GetTimelineArray |
( |
| ) |
|
|
inline |
- Returns
- The timeline array which contains a list of the keyframe times. Note this is for read-only purposes. If you want to modify the timeline, use the methods provided by this class.
◆ GetTimelineArrayLength()
int HBhvTimeline::GetTimelineArrayLength |
( |
| ) |
|
|
inline |
- Returns
- The length of the timeline array. This is the number of keyframes in the timeline.
◆ GetTimelineInterval()
bool HBhvTimeline::GetTimelineInterval |
( |
int |
currentTick, |
|
|
int & |
interval |
|
) |
| |
This method find the keyframe interval that is closet to the current time.
- Parameters
-
currentTick | The time that we are searching for the closest interval. |
interval | Returns interval that is closet to the current time. |
- Returns
- True if the currentTick is inside the timeline's range and false if the currentTick is outside the timeline's range.
◆ Serialize()
void HBhvTimeline::Serialize |
( |
HUtilityXMLGenerator * |
xmlgen | ) |
|
◆ SetAnimation()
Sets the animation that this timeline is associated with.
- Parameters
-
animation | Pointer to Animation |
◆ SetCurrentRelativeTick()
void HBhvTimeline::SetCurrentRelativeTick |
( |
float |
tick | ) |
|
|
inline |
Sets current relative time position.
- Parameters
-
tick | Relative Time Position |
◆ SetInstancedTimeline()
void HBhvTimeline::SetInstancedTimeline |
( |
HBhvTimeline * |
timeline | ) |
|
|
inline |
Sets the timeline instance.
- Parameters
-
timeline | Instanced Timeline |
◆ SetStartTick()
void HBhvTimeline::SetStartTick |
( |
float |
starttick | ) |
|
|
inline |
Set the start time for the timeline. All keyframes are evaluated based on the start time.
- Parameters
-
◆ SetTimeline()
void HBhvTimeline::SetTimeline |
( |
const int * |
timeline, |
|
|
int |
length |
|
) |
| |
This method replaces a timeline array with array of integer values.
- Parameters
-
timeline | The array of ticks representing the new timeline. |
length | The number of entries in the passed timeline. |
◆ XMLCallback()
static void* HBhvTimeline::XMLCallback |
( |
HUtilityXMLTag * |
xt, |
|
|
bool |
open, |
|
|
void * |
m_pExtraData |
|
) |
| |
|
static |
This is XML read callback which parses XML data and then populates the member variables with the associated values.
The documentation for this class was generated from the following file: