new ClockViewModel(clock)
A view model which exposes a
Clock
for user interfaces.
Name | Type | Description |
---|---|---|
clock |
Clock | optional The clock object wrapped by this view model, if undefined a new instance will be created. |
See:
Members
-
canAnimate :Boolean
-
Gets or sets whether or not
Clock.tick
can advance time. This could be false if data is being buffered, for example. The clock will only tick when bothcanAnimate
andshouldAnimate
are true. This property is observable.-
Default Value:
undefined
-
clock :Clock
-
Gets the underlying Clock.
-
clockRange :ClockRange
-
Gets or sets how tick should behave when
startTime
orstopTime
is reached. This property is observable.-
Default Value:
undefined
-
clockStep :ClockStep
-
Gets or sets whether calls to
Clock.tick
are frame dependent or system clock dependent. This property is observable.-
Default Value:
undefined
-
currentTime :JulianDate
-
Gets or sets the current time. This property is observable.
-
Default Value:
undefined
-
multiplier :Number
-
Gets or sets how much time advances when 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. IfclockStep
is set to ClockStep.SYSTEM_CLOCK_MULTIPLIER this value is multiplied by the elapsed system time since the last call to tick. This property is observable.-
Default Value:
undefined
-
shouldAnimate :Boolean
-
Gets or sets whether or not
Clock.tick
should attempt to advance time. The clock will only tick when bothcanAnimate
andshouldAnimate
are true. This property is observable.-
Default Value:
undefined
-
startTime :JulianDate
-
Gets or sets the start time of the clock. This property is observable.
-
Default Value:
undefined
-
stopTime :JulianDate
-
Gets or sets the stop time of the clock. This property is observable.
-
Default Value:
undefined
-
systemTime :JulianDate
-
Gets the current system time. This property is observable.
-
Default Value:
JulianDate()
Methods
-
destroy()
-
Destroys the view model. Should be called to properly clean up the view model when it is no longer needed.
-
isDestroyed() → Boolean
-
Returns:
true if the object has been destroyed, false otherwise. -
synchronize()
-
Updates the view model with the contents of the underlying clock. Can be called to force an update of the viewModel if the underlying clock has changed and
Clock.tick
has not yet been called.