@JsType(isNative=true, namespace="Cesium", name="Clock") public class Clock extends Object
Modifier and Type | Field and Description |
---|---|
boolean |
canAnimate
Indicates whether
tick() can advance time. |
Number |
clockRange
|
Number |
clockStep
Determines if calls to
tick() are frame dependent or system clock dependent. |
JulianDate |
currentTime
The current time.
|
double |
multiplier
Gets or sets how much time advances when
tick() is called. |
Event |
onTick
An Event that is fired whenever
tick() is called. |
boolean |
shouldAnimate
Indicates whether
tick() should attempt to advance time. |
JulianDate |
startTime
The start time of the clock.
|
JulianDate |
stopTime
The stop time of the clock.
|
Constructor and Description |
---|
Clock()
A simple clock for keeping track of simulated time.
|
Clock(ClockOptions options)
A simple clock for keeping track of simulated time.
|
Modifier and Type | Method and Description |
---|---|
JulianDate |
tick()
Advances the clock from the current time based on the current configuration options. tick should be called every
frame, regardless of whether animation is taking place or not.
|
@JsProperty public boolean canAnimate
tick()
can advance time. This could be false if data is being buffered, for example.
The clock will only advance time when both canAnimate
and shouldAnimate
are true.
Default: true.@JsProperty public Number clockRange
startTime
or stopTime
is reached.
Default: ClockRange.UNBOUNDED()
@JsProperty public Number clockStep
tick()
are frame dependent or system clock dependent.
Changing this property to ClockStep.SYSTEM_CLOCK()
LOCK will set multiplier
to 1.0,
shouldAnimate
to true, and currentTime
to the current system clock time.
Default: ClockStep.SYSTEM_CLOCK_MULTIPLIER()
@JsProperty public JulianDate currentTime
clockStep
from ClockStep.SYSTEM_CLOCK()
to ClockStep.SYSTEM_CLOCK_MULTIPLIER()
.public double multiplier
tick()
is called. Negative values allow for advancing backwards.
If clockStep
is set to ClockStep.TICK_DEPENDENT()
, this is the number of seconds to advance.
If clockStep
is set to ClockStep.SYSTEM_CLOCK_MULTIPLIER()
, this value is multiplied by the elapsed system
time since the last call to tick()
. Changing this property will change clockStep
from ClockStep.SYSTEM_CLOCK()
to
ClockStep.SYSTEM_CLOCK_MULTIPLIER()
.
Default: 1.0.@JsProperty public boolean shouldAnimate
tick()
should attempt to advance time. The clock will only advance time when both
canAnimate
and shouldAnimate
are true. Changing this property will change clockStep
from
ClockStep.SYSTEM_CLOCK()
to ClockStep.SYSTEM_CLOCK_MULTIPLIER()
.
Default: true@JsProperty public JulianDate startTime
@JsProperty public JulianDate stopTime
@JsConstructor public Clock()
@JsConstructor public Clock(ClockOptions options)
Example:
ClockOptions options = new ClockOptions();
options.startTime = JulianDate.fromIso8601("2013-12-25");
options.currentTime = JulianDate.fromIso8601("2013-12-25");
options.stopTime = JulianDate.fromIso8601("2013-12-26");
options.clockRange = ClockRange.LOOP_STOP();
options.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER();
Clock clock = new Clock(options);
options
- ClockStep
,
ClockRange
,
JulianDate
@JsMethod public JulianDate tick()
shouldAnimate
property.currentTime
property.Copyright © 2019. All rights reserved.