The timekeeper synchronises a current time across Zinc objects.
More...
#include <timekeeper.hpp>
The timekeeper synchronises a current time across Zinc objects.
The timekeeper maintains a current time that is communicated to objects within Zinc. For example, time-varying graphics are shown at the current timekeeper time; also, the time value field allows the current timekeeper time to be used in field expressions. Responsibility for timing animations is left to client code (as it is UI or OS-dependent), however the timekeeper API assists clients to determine the ideal callback time and to set the current time just before rendering to synchronise animation. Time notifiers allow clients to also use the timekeeper features including callbacks.
- See also
- Timekeeper::getNextCallbackTime
-
Timekeeper::setTime
-
Timenotifier
Specifies the direction of play when querying the next callback time preferred for internal zinc objects.
- See also
- Timekeeper::getNextCallbackTime
Enumerator |
---|
PLAY_DIRECTION_INVALID |
Unspecified play direction
|
PLAY_DIRECTION_FORWARD |
Specify the time keeper to progress at increasing time value
|
PLAY_DIRECTION_REVERSE |
Specify the time keeper to progress at decreasing time value
|
TimenotifierRegular OpenCMISS::Zinc::Timekeeper::createTimenotifierRegular |
( |
double |
updateFrequency, |
|
|
double |
timeOffset |
|
) |
| |
|
inline |
Create and returns a time notifier with regular update time in time keeper. The returned time notifier will automatically be added to the time keeper.
- Parameters
-
updateFrequency | The number of times which time notifier will receive callback per unit of time in the time keeper. |
timeOffset | This value will set the exact time the notification happenes and allow setting the callback time other than t=0. Time notifier will receive/send out notification when time_offset + original callback time is reached. |
- Returns
- Handle to new timekeeper, or NULL/invalid handle on failure.
cmzn_timekeeper_id OpenCMISS::Zinc::Timekeeper::getId |
( |
| ) |
const |
|
inline |
Return the C handle of the Timekeeper object.
- Returns
- C handle of Timekeeper if this objects is valid, 0 otherwise.
double OpenCMISS::Zinc::Timekeeper::getMaximumTime |
( |
| ) |
|
|
inline |
Gets the maximum time in the timekeeper.
- Returns
- Current time or 0 if invalid argument.
double OpenCMISS::Zinc::Timekeeper::getMinimumTime |
( |
| ) |
|
|
inline |
Gets the minimum time in the timekeeper.
- Returns
- Current time or 0 if invalid argument.
double OpenCMISS::Zinc::Timekeeper::getNextCallbackTime |
( |
enum PlayDirection |
playDirection | ) |
|
|
inline |
Gets the next callback time required by any of the time notifiers in the timekeeper. This function takes the minimum and maximum time into consideration. If the direction of playback is forward and next callback time exceeds the maximum time, the next callback time will be timekeeper_minimum + (callback_time - timekeeper_maximum). If the direction of playback is reverse and next callback time is smaller than the minimum time, the next callback time will be timekeeper_maximum + (timekeeper_minimum - callback_time).
- See also
- Timenotifier::getNextCallbackTime
- Parameters
-
playDirection | Enumeration indicating rather next forward/reverse time will be calculated. |
- Returns
- next callback time on success.
double OpenCMISS::Zinc::Timekeeper::getTime |
( |
| ) |
|
|
inline |
Gets the current time from the timekeeper.
- Returns
- Current time or 0 if invalid argument.
bool OpenCMISS::Zinc::Timekeeper::isValid |
( |
| ) |
const |
|
inline |
Check if this is a valid Timekeeper object.
- Returns
- Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Timekeeper::setMaximumTime |
( |
double |
maximumTime | ) |
|
|
inline |
int OpenCMISS::Zinc::Timekeeper::setMinimumTime |
( |
double |
minimumTime | ) |
|
|
inline |
int OpenCMISS::Zinc::Timekeeper::setTime |
( |
double |
time | ) |
|
|
inline |
The documentation for this class was generated from the following files: