Skip to content

KBE3D / KBCore / Cesium / Clock

类: Clock

A simple clock for keeping track of simulated time.

示例

ts
// Create a clock that loops on Christmas day 2013 and runs in real-time.
const 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
});

参数

Object with the following properties:

参数

The start time of the clock.

参数

The stop time of the clock.

参数

The current time.

参数

Determines how much time advances when Clock#tick is called, negative values allow for advancing backwards.

参数

Determines if calls to Clock#tick are frame dependent or system clock dependent.

参数

Determines how the clock should behave when Clock#startTime or Clock#stopTime is reached.

参数

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.

参数

Indicates whether Clock#tick should attempt to advance time. The clock will only tick when both Clock#canAnimate and Clock#shouldAnimate are true.

属性

startTime

startTime: JulianDate

The start time of the clock.


stopTime

stopTime: JulianDate

The stop time of the clock.


clockRange

clockRange: ClockRange

Determines how the clock should behave when Clock#startTime or Clock#stopTime is reached.


canAnimate

canAnimate: boolean

Indicates whether Clock#tick can advance time. This could be false if data is being buffered, for example. The clock will only advance time when both Clock#canAnimate and Clock#shouldAnimate are true.


onTick

onTick: Event

An Event that is fired whenever Clock#tick is called.


onStop

onStop: Event

An Event that is fired whenever Clock#stopTime is reached.


currentTime

currentTime: JulianDate

The current time. Changing this property will change Clock#clockStep from ClockStep.SYSTEM_CLOCK to ClockStep.SYSTEM_CLOCK_MULTIPLIER.


multiplier

multiplier: number

Gets or sets how much time advances when Clock#tick is called. Negative values allow for advancing backwards. If Clock#clockStep is set to ClockStep.TICK_DEPENDENT, this is the number of seconds to advance. If Clock#clockStep is set to ClockStep.SYSTEM_CLOCK_MULTIPLIER, this value is multiplied by the elapsed system time since the last call to Clock#tick. Changing this property will change Clock#clockStep from ClockStep.SYSTEM_CLOCK to ClockStep.SYSTEM_CLOCK_MULTIPLIER.


clockStep

clockStep: ClockStep

Determines if calls to Clock#tick are frame dependent or system clock dependent. Changing this property to ClockStep.SYSTEM_CLOCK will set Clock#multiplier to 1.0, Clock#shouldAnimate to true, and Clock#currentTime to the current system clock time.


shouldAnimate

shouldAnimate: boolean

Indicates whether Clock#tick should attempt to advance time. The clock will only advance time when both Clock#canAnimate and Clock#shouldAnimate are true. Changing this property will change Clock#clockStep from ClockStep.SYSTEM_CLOCK to ClockStep.SYSTEM_CLOCK_MULTIPLIER.

方法

tick()

tick(): JulianDate

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. To control animation, use the Clock#shouldAnimate property.

返回

JulianDate

The new value of the Clock#currentTime property.

构造函数

构造函数

new Clock(options?: { startTime?: JulianDate; stopTime?: JulianDate; currentTime?: JulianDate; multiplier?: number; clockStep?: ClockStep; clockRange?: ClockRange; canAnimate?: boolean; shouldAnimate?: boolean; }): Clock

参数

options?
startTime?

JulianDate

stopTime?

JulianDate

currentTime?

JulianDate

multiplier?

number

clockStep?

ClockStep

clockRange?

ClockRange

canAnimate?

boolean

shouldAnimate?

boolean

返回

Clock

KBE3D @3.0.0 Copyright © 2024-present KBE3D