![]() |
Murl Engine API
Version 2018.3
|
The timeline base class. More...
#include <murl_util_timeline.h>
The timeline base class.
The timeline base class is used to implement the Graph::ITimeline and the Logic::ITimeline object.
Public Member Functions | |
Timeline () | |
The default constructor. | |
virtual | ~Timeline () |
The destructor. | |
void | Reset () |
Reset the timeline. More... | |
void | ResetTo (Real startTime) |
Reset the timeline to a specified start time. More... | |
Bool | Start () |
Start or continue the timeline. More... | |
Bool | Start (Real startTime, Real endTime) |
Start the timeline with specified parameters. More... | |
Bool | Start (Real startTime, Real endTime, SInt32 numberOfLoops) |
Start the timeline with specified parameters. More... | |
Bool | Start (Real startTime, Real endTime, Real loopStartTime, Real loopEndTime, SInt32 numberOfLoops) |
Start the timeline with specified parameters. More... | |
Bool | Pause () |
Pause the timeline. More... | |
Bool | Stop () |
Stop the timeline. More... | |
Bool | Rewind () |
Rewind the timeline. More... | |
void | SetStartTime (Real startTime) |
Set the start time. More... | |
Real | GetStartTime () const |
Get the start time. More... | |
void | SetEndTime (Real endTime) |
Set the end time. More... | |
Real | GetEndTime () const |
Get the end time. More... | |
void | SetLoopStartTime (Real startTime) |
Set the loop start time. More... | |
Real | GetLoopStartTime () const |
Get the loop start time. More... | |
void | SetLoopEndTime (Real endTime) |
Set the loop end time. More... | |
Real | GetLoopEndTime () const |
Get the loop end time. More... | |
void | SetStartLoop (SInt32 startLoop) |
Set the start loop. More... | |
SInt32 | GetStartLoop () const |
Get the start loop. More... | |
void | SetNumberOfLoops (SInt32 numberOfLoops) |
Set the number of loops. More... | |
SInt32 | GetNumberOfLoops () const |
Get the number of loops. More... | |
void | SetTimeScale (Real timeScale) |
Set the time scale factor. More... | |
Real | GetTimeScale () const |
Get the time scale factor. More... | |
void | SetAutoRewindEnabled (Bool enabled) |
Enable/disable automatic rewind. More... | |
Bool | IsAutoRewindEnabled () const |
Check if automatic rewind is enabled. More... | |
Bool | IsRunning () const |
Check if the timeline is running. More... | |
Bool | IsPaused () const |
Check if the timeline is paused. More... | |
Bool | IsStopped () const |
Check if the timeline is stopped. More... | |
Bool | WasStarted () const |
Check if the timeline was started from stopped state. More... | |
Bool | WasRunning () const |
Check if the timeline has stopped running. More... | |
Bool | IsOrWasRunning () const |
Check if the timeline is or was running. More... | |
Bool | HasPassedTime (Real time) const |
Check if the current time has passed a specified time within the most recent tick. More... | |
Bool | HasPassedLoop (SInt32 loop=-1) const |
Check if the current loop has passed a specified loop number within the most recent tick. More... | |
Double | GetRecentTime () const |
Get the recent time. More... | |
Double | GetCurrentTime () const |
Get the current time. More... | |
Double | GetRemainingTime () const |
Get the remaining time. More... | |
void | SetCurrentTime (Double time) |
Set the current time. More... | |
SInt32 | GetRecentLoop () const |
Get the recent loop. More... | |
SInt32 | GetCurrentLoop () const |
Get the current loop. More... | |
SInt32 | GetRemainingLoops () const |
Get the remaining loops. More... | |
Bool | SetCurrentLoop (SInt32 loop) |
Set the current loop. More... | |
IEnums::AnimationState | GetRecentState () const |
Get the recent animation state. More... | |
IEnums::AnimationState | GetCurrentState () const |
Get the current animation state. More... | |
Bool | ProcessTimeline (Double deltaTime) |
Process the timeline. More... | |
void Murl::Util::Timeline::Reset | ( | ) |
Reset the timeline.
Stop the timeline, reset the WasRunning() state and call Rewind().
void Murl::Util::Timeline::ResetTo | ( | Real | startTime | ) |
Reset the timeline to a specified start time.
Set the start time and call Reset().
startTime | The start time in seconds. |
Bool Murl::Util::Timeline::Start | ( | ) |
Start or continue the timeline.
Reset the WasRunning() state. Does not modify the current time and loop.
Bool Murl::Util::Timeline::Start | ( | Real | startTime, |
Real | endTime, | ||
Real | loopStartTime, | ||
Real | loopEndTime, | ||
SInt32 | numberOfLoops | ||
) |
Start the timeline with specified parameters.
Set start/end time, loop start/end time, number of loops, calls Rewind() and Start().
startTime | The start time in seconds. |
endTime | The end time in seconds. |
loopStartTime | The loop start time in seconds. |
loopEndTime | The loop end time in seconds. |
numberOfLoops | Number of loops. |
Bool Murl::Util::Timeline::Pause | ( | ) |
Pause the timeline.
Bool Murl::Util::Timeline::Stop | ( | ) |
Stop the timeline.
Rewind() is called if auto rewind is enabled.
Bool Murl::Util::Timeline::Rewind | ( | ) |
Rewind the timeline.
Sets the current time to the start time and the current loop to the start loop. Does not affect the current running state.
void Murl::Util::Timeline::SetStartTime | ( | Real | startTime | ) |
Set the start time.
startTime | The start time in seconds. |
Real Murl::Util::Timeline::GetStartTime | ( | ) | const |
Get the start time.
void Murl::Util::Timeline::SetEndTime | ( | Real | endTime | ) |
Set the end time.
endTime | The end time in seconds. |
Real Murl::Util::Timeline::GetEndTime | ( | ) | const |
Get the end time.
void Murl::Util::Timeline::SetLoopStartTime | ( | Real | startTime | ) |
Set the loop start time.
startTime | The loop start time in seconds. |
Real Murl::Util::Timeline::GetLoopStartTime | ( | ) | const |
Get the loop start time.
void Murl::Util::Timeline::SetLoopEndTime | ( | Real | endTime | ) |
Set the loop end time.
endTime | The loop end time in seconds. |
Real Murl::Util::Timeline::GetLoopEndTime | ( | ) | const |
Get the loop end time.
void Murl::Util::Timeline::SetStartLoop | ( | SInt32 | startLoop | ) |
Set the start loop.
Loop #0 is considered the intro, if it is desired to start right in the middle of the first actual loop, the start loop should be set to 1.
startLoop | The start loop. |
SInt32 Murl::Util::Timeline::GetStartLoop | ( | ) | const |
Get the start loop.
void Murl::Util::Timeline::SetNumberOfLoops | ( | SInt32 | numberOfLoops | ) |
Set the number of loops.
numberOfLoops | Number of loops. |
SInt32 Murl::Util::Timeline::GetNumberOfLoops | ( | ) | const |
Get the number of loops.
void Murl::Util::Timeline::SetTimeScale | ( | Real | timeScale | ) |
Set the time scale factor.
The recent tick duration is multiplied by the time scale factor and added to the current time each logic tick. The default time scale factor is 1.
timeScale | The time scale factor. |
Real Murl::Util::Timeline::GetTimeScale | ( | ) | const |
Get the time scale factor.
void Murl::Util::Timeline::SetAutoRewindEnabled | ( | Bool | enabled | ) |
Enable/disable automatic rewind.
Automatic rewind is calling Rewind() when the timeline is stopped.
enabled | Enable automatic rewind if true. |
Bool Murl::Util::Timeline::IsAutoRewindEnabled | ( | ) | const |
Check if automatic rewind is enabled.
Bool Murl::Util::Timeline::IsRunning | ( | ) | const |
Bool Murl::Util::Timeline::IsPaused | ( | ) | const |
Bool Murl::Util::Timeline::IsStopped | ( | ) | const |
Bool Murl::Util::Timeline::WasStarted | ( | ) | const |
Check if the timeline was started from stopped state.
Bool Murl::Util::Timeline::WasRunning | ( | ) | const |
Check if the timeline has stopped running.
If the timeline is stopped this state is true within the current logic tick only and will be cleared at the next logic tick.
(!) This state remains unchanged if the timeline is no longer processed. In such a case the Reset() method can be called to clear the state.
Bool Murl::Util::Timeline::IsOrWasRunning | ( | ) | const |
Check if the timeline is or was running.
Returns (IsRunning() || WasRunning()) state.
Check if the current time has passed a specified time within the most recent tick.
Does not consider loops, for evaluating loops see HasPassedLoop().
time | The time to check in seconds. |
Check if the current loop has passed a specified loop number within the most recent tick.
If the loop number to check is negative, true is returned each time the current loop has changed.
loop | The loop number to check. |
Double Murl::Util::Timeline::GetRecentTime | ( | ) | const |
Get the recent time.
Double Murl::Util::Timeline::GetCurrentTime | ( | ) | const |
Get the current time.
This method does not consider loops, for evaluating loops see GetCurrentLoop().
Double Murl::Util::Timeline::GetRemainingTime | ( | ) | const |
Get the remaining time.
This method calculates GetEndTime() - GetCurrentTime() which does not consider loops, for evaluating loops see GetCurrentLoop().
void Murl::Util::Timeline::SetCurrentTime | ( | Double | time | ) |
Set the current time.
This method does not consider loops, for setting loops see SetCurrentLoop().
time | The current time to set in seconds. |
SInt32 Murl::Util::Timeline::GetRecentLoop | ( | ) | const |
Get the recent loop.
SInt32 Murl::Util::Timeline::GetCurrentLoop | ( | ) | const |
Get the current loop.
The current loop provides the following information for n loops:
SInt32 Murl::Util::Timeline::GetRemainingLoops | ( | ) | const |
Get the remaining loops.
Calculates GetNumberOfLoops() - GetCurrentLoop().
Set the current loop.
The current loop represents the following information for n loops:
loop | The current loop to set. |
IEnums::AnimationState Murl::Util::Timeline::GetRecentState | ( | ) | const |
Get the recent animation state.
IEnums::AnimationState Murl::Util::Timeline::GetCurrentState | ( | ) | const |
Get the current animation state.
Process the timeline.
deltaTime | The recent tick duration in seconds. |