API / WorldClock
Class: WorldClock
Defined in: animation/WorldClock.ts:35
Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance.
Constructors
Constructor
new WorldClock(time: number): WorldClock;Defined in: animation/WorldClock.ts:66
Creating a Worldclock instance. Typically, you do not need to create Worldclock instance. When multiple Worldclock instances are running at different speeds, can achieving some specific animation effects, such as bullet time.
Parameters
| Parameter | Type | Default value |
|---|---|---|
time | number | 0.0 |
Returns
WorldClock
Properties
time
time: number = 0.0;Defined in: animation/WorldClock.ts:43
Current time. (In seconds)
timeScale
timeScale: number = 1.0;Defined in: animation/WorldClock.ts:54
The play speed, used to control animation speed-shift play. [0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play]
Default
1.0Methods
add()
add(value: IAnimatable): void;Defined in: animation/WorldClock.ts:150
Add IAnimatable instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | IAnimatable | The IAnimatable instance. |
Returns
void
advanceTime()
advanceTime(passedTime: number): void;Defined in: animation/WorldClock.ts:79
Advance time for all IAnimatable instances.
Parameters
| Parameter | Type | Description |
|---|---|---|
passedTime | number | Passed time. [-1: Automatically calculates the time difference between the current frame and the previous frame, [0~N): Passed time] (In seconds) |
Returns
void
clear()
clear(): void;Defined in: animation/WorldClock.ts:180
Clear all IAnimatable instances.
Returns
void
contains()
contains(value: IAnimatable): boolean;Defined in: animation/WorldClock.ts:137
Check whether contains a specific instance of IAnimatable.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | IAnimatable | The IAnimatable instance. |
Returns
boolean
remove()
remove(value: IAnimatable): void;Defined in: animation/WorldClock.ts:166
Removes a specified IAnimatable instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | IAnimatable | The IAnimatable instance. |
Returns
void
