new Clock(options)
A simple clock for keeping track of simulated time.
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Object with the following properties:
|
Throws:
-
DeveloperError : startTime must come before stopTime.
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
});
See:
Source:
Core/Clock.js, line 54
Members
-
canAnimate :Boolean
-
Indicates whether tick can advance time. This could be false if data is being buffered, for example. The clock will only tick when both
canAnimateandshouldAnimateare true.-
Default Value:
trueSource: Core/Clock.js, line 141 -
clockRange :ClockRange
-
Determines how the clock should behave when
startTimeorstopTimeis reached.-
Default Value:
ClockRange.UNBOUNDEDSource: Core/Clock.js, line 133 -
clockStep :ClockStep
-
Determines if calls to
tickare frame dependent or system clock dependent.-
Default Value:
ClockStep.SYSTEM_CLOCK_MULTIPLIERSource: Core/Clock.js, line 126 -
currentTime :JulianDate
-
The current time.Source: Core/Clock.js, line 109
-
multiplier :Number
-
Determines how much time advances when tick is called, negative values allow for advancing backwards. If
clockStepis set to ClockStep.TICK_DEPENDENT this is the number of seconds to advance. IfclockStepis set to ClockStep.SYSTEM_CLOCK_MULTIPLIER this value is multiplied by the elapsed system time since the last call to tick.-
Default Value:
1.0Source: Core/Clock.js, line 119 -
onTick
-
An
Eventthat is fired whenevertick.Source: Core/Clock.js, line 154 -
shouldAnimate :Boolean
-
Indicates whether tick should attempt to advance time. The clock will only tick when both
canAnimateandshouldAnimateare true.-
Default Value:
trueSource: Core/Clock.js, line 149 -
startTime :JulianDate
-
The start time of the clock.Source: Core/Clock.js, line 97
-
stopTime :JulianDate
-
The stop time of the clock.Source: Core/Clock.js, line 103
Methods
-
tick() → JulianDate
-
Advances the clock from the currentTime based on the current configuration options. tick should be called every frame, regardless of whether animation is taking place or not. To control animation, use the
shouldAnimateproperty.Returns:
The new value of thecurrentTimeproperty.Source: Core/Clock.js, line 166
