gl-draw 0.15.21 → 0.15.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WebGPULineSegments2.js +1 -1
- package/dist/WebGPULineSegments2.module.js +22 -16
- package/dist/core/Pencil.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.module.js +427 -332
- package/dist/objects/line/meshLine/MeshLineMaterial.d.ts +2 -0
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +10 -10
- package/dist/utils/Timer.d.ts +72 -0
- package/package.json +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export class Timer {
|
|
2
|
+
_previousTime: number;
|
|
3
|
+
_currentTime: number;
|
|
4
|
+
_startTime: number;
|
|
5
|
+
_delta: number;
|
|
6
|
+
_elapsed: number;
|
|
7
|
+
_timescale: number;
|
|
8
|
+
_document: Document | null;
|
|
9
|
+
_pageVisibilityHandler: typeof handleVisibilityChange | null;
|
|
10
|
+
/**
|
|
11
|
+
* Connect the timer to the given document.Calling this method is not mandatory to
|
|
12
|
+
* use the timer but enables the usage of the Page Visibility API to avoid large time
|
|
13
|
+
* delta values.
|
|
14
|
+
*
|
|
15
|
+
* @param {Document} document - The document.
|
|
16
|
+
*/
|
|
17
|
+
connect(document: Document): void;
|
|
18
|
+
/**
|
|
19
|
+
* Disconnects the timer from the DOM and also disables the usage of the Page Visibility API.
|
|
20
|
+
*/
|
|
21
|
+
disconnect(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the time delta in seconds.
|
|
24
|
+
*
|
|
25
|
+
* @return {number} The time delta in second.
|
|
26
|
+
*/
|
|
27
|
+
getDelta(): number;
|
|
28
|
+
/**
|
|
29
|
+
* Returns the elapsed time in seconds.
|
|
30
|
+
*
|
|
31
|
+
* @return {number} The elapsed time in second.
|
|
32
|
+
*/
|
|
33
|
+
getElapsed(): number;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the timescale.
|
|
36
|
+
*
|
|
37
|
+
* @return {number} The timescale.
|
|
38
|
+
*/
|
|
39
|
+
getTimescale(): number;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the given timescale which scale the time delta computation
|
|
42
|
+
* in `update()`.
|
|
43
|
+
*
|
|
44
|
+
* @param {number} timescale - The timescale to set.
|
|
45
|
+
* @return {Timer} A reference to this timer.
|
|
46
|
+
*/
|
|
47
|
+
setTimescale(timescale: number): Timer;
|
|
48
|
+
/**
|
|
49
|
+
* Resets the time computation for the current simulation step.
|
|
50
|
+
*
|
|
51
|
+
* @return {Timer} A reference to this timer.
|
|
52
|
+
*/
|
|
53
|
+
reset(): Timer;
|
|
54
|
+
/**
|
|
55
|
+
* Can be used to free all internal resources. Usually called when
|
|
56
|
+
* the timer instance isn't required anymore.
|
|
57
|
+
*/
|
|
58
|
+
dispose(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Updates the internal state of the timer. This method should be called
|
|
61
|
+
* once per simulation step and before you perform queries against the timer
|
|
62
|
+
* (e.g. via `getDelta()`).
|
|
63
|
+
*
|
|
64
|
+
* @param {number} timestamp - The current time in milliseconds. Can be obtained
|
|
65
|
+
* from the `requestAnimationFrame` callback argument. If not provided, the current
|
|
66
|
+
* time will be determined with `performance.now`.
|
|
67
|
+
* @return {Timer} A reference to this timer.
|
|
68
|
+
*/
|
|
69
|
+
update(timestamp: number): Timer;
|
|
70
|
+
}
|
|
71
|
+
declare function handleVisibilityChange(): void;
|
|
72
|
+
export {};
|