Clock

new Clock(autoStart?: boolean)
THREE: THREE.Clock

Frame-delta timer. Access the delta getter each frame to drive animations. Auto-starts on first access when autoStart is true.

Differs from THREE.js

getDelta() is a getter (clock.delta) rather than a method call. getElapsedTime() is likewise clock.elapsedTime.

Properties

NameTypeDescription
delta

number

Seconds elapsed since the last time delta was accessed. Auto-starts the clock if autoStart is true.

elapsedTime

number

Total seconds elapsed since the clock started.

Methods

MethodDescription
start(): void

Starts or restarts the clock, resetting elapsedTime to zero.

stop(): void

Stops the clock and disables autoStart.