文档链接
new Cesium.Clock(options)
describe
A simple clock for keeping track of simulated time.
options
Type:object
Object with the following properties:
Name | Type | Default | Description |
---|---|---|---|
startTime | JulianDate | The start time of the clock. | |
stopTime | JulianDate | The stop time of the clock. | |
currentTime | JulianDate | The current time. | |
multiplier | Number | 1.0 | Determines how much time advances when clock#tick is called,negative values allow for advancing backward. |
clockStep | ClockStep | ClockStep.SYSTEM_CLOCK_MULTIPLIER | Determines if calls to Clock#tick are frame dependent or system clock dependent. |
clockRange | ClockRange | ClockRange.UNBOUNDED | Determines how the clock should behave when Clock#startTime or Clock#stop Time is reached. |
canAnimate | Boolean | true | Indicates whether Clock#tick can advance time. This could be false if data is being buffered, for example. The clock will only tick when both Clock#canAnimate and Clock#shouldAnimate are true. |
shouldAnimate | Boolean | false | Indicates whether Clock#tick should attempt to advance time. The clock will only tick when both Clock#canAnimate and Clock#shouldAnimate are true. |
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
});
Members
canAnimate : Boolean
clockRange : ClockRange
clockStep : ClockStep
currentTime : JulianDate
multiplier : Number
onStop : Event
onTick : Event
shouldAnimate : Boolean
startTime : JulianDate
The start time of the clock.
stopTime : JulianDate
The stop time of the clock.
Methods
tick() → JulianDate
JulianDate
new Cesium.JulianDate(julianDayNumber, secondsOfDay, timeStandard)
Core/JulianDate.js 207
Represents an astronomical Julian date, which is the number of days since noon on January 1, -4712 (4713 BC). For increased precision, this class stores the whole number part of the date and the seconds part of the date in separate components. In order to be safe for arithmetic and represent leap seconds, the date is always stored in the International Atomic Time standard TimeStandard.TAI.
Name | Type | Default | Description |
---|---|---|---|
julianDayNumber | Number | 0.0 | optional The Julian Day Number representing the number of whole days. Fractional days will also be handled correctly. |
secondsOfDay | Number | 0.0 | optional The number of seconds into the current Julian Day Number. Fractional seconds, negative seconds and seconds greater than a day will be handled correctly. |
timeStandard | TimeStandard | TimeStandard.UTC | optional The time standard in which the first two parameters are defined. |