A simple clock for keeping track of simulated time.
alias Clock
{Object} [options] Object with the following properties:
{JulianDate} [options.startTime] The start time of the clock.
{JulianDate} [options.stopTime] The stop time of the clock.
{JulianDate} [options.currentTime] The current time.
{Number} [options.multiplier=1.0] Determines how much time advances when tick is called, negative values allow for advancing backwards.
{ClockStep} [options.clockStep=ClockStep.SYSTEM_CLOCK_MULTIPLIER] Determines if calls to tick are frame dependent or system clock dependent.
{ClockRange} [options.clockRange=ClockRange.UNBOUNDED] Determines how the clock should behave when startTime or stopTime is reached.
{Boolean} [options.canAnimate=true] Indicates whether tick can advance time. This could be false if data is being buffered, for example. The clock will only tick when both canAnimate and shouldAnimate are true.
{Boolean} [options.shouldAnimate=true] Indicates whether tick should attempt to advance time. The clock will only tick when both canAnimate and shouldAnimate are true.
exception {DeveloperError} startTime must come before stopTime.
Annotations
@RawJSType()@native()@JSName("Cesium.Clock")
Example:
// Create a clock that loops on Christmas day 2013 and runs in real-time.
var clock = new Cesium.Clock({
startTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
currentTime : Cesium.JulianDate.fromIso8601("2013-12-25"),
stopTime : Cesium.JulianDate.fromIso8601("2013-12-26"),
clockRange : Cesium.ClockRange.LOOP_STOP,
clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER
});
A simple clock for keeping track of simulated time.
alias Clock
tick
are frame dependent or system clock dependent.startTime
orstopTime
is reached.canAnimate
andshouldAnimate
are true.canAnimate
andshouldAnimate
are true.exception {DeveloperError} startTime must come before stopTime.
// Create a clock that loops on Christmas day 2013 and runs in real-time. var clock = new Cesium.Clock({ startTime : Cesium.JulianDate.fromIso8601("2013-12-25"), currentTime : Cesium.JulianDate.fromIso8601("2013-12-25"), stopTime : Cesium.JulianDate.fromIso8601("2013-12-26"), clockRange : Cesium.ClockRange.LOOP_STOP, clockStep : Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER });
JulianDate
ClockRange
ClockStep