ClockViewModel

ClockViewModel

new

A view model which exposes a Clock for user interfaces.

Parameters:
Name Type Argument Description
clock Clock <optional>
The clock object wrapped by this view model, if undefined a new instance will be created.
See:
Source:

Members

: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 both canAnimate and shouldAnimate are true. This property is observable.
Default Value:
  • undefined

:Clock

Gets the underlying Clock.

:ClockRange

Gets or sets how tick should behave when startTime or stopTime is reached. This property is observable.
Default Value:
  • undefined

:ClockStep

Gets or sets whether calls to Clock.tick are frame dependent or system clock dependent. This property is observable.
Default Value:
  • undefined

:JulianDate

Gets or sets the current time. This property is observable.
Default Value:
  • undefined

: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. If clockStep 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

:Boolean

Gets or sets whether or not Clock.tick should attempt to advance time. The clock will only tick when both canAnimate and shouldAnimate are true. This property is observable.
Default Value:
  • undefined

:JulianDate

Gets or sets the start time of the clock. This property is observable.
Default Value:
  • undefined

:JulianDate

Gets or sets the stop time of the clock. This property is observable.
Default Value:
  • undefined

:JulianDate

Gets the current system time. This property is observable.
Default Value:
  • JulianDate()

Methods

Destroys the view model. Should be called to properly clean up the view model when it is no longer needed.

Returns:
Boolean true if the object has been destroyed, false otherwise.

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.