-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathClock.html
93 lines (77 loc) · 2.54 KB
/
Clock.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<p class="desc">
Object for keeping track of time. This uses
[link:https://developer.mozilla.org/en-US/docs/Web/API/Performance/now performance.now] if it is available, otherwise it reverts to the less
accurate
[link:https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date/now Date.now].
</p>
<h2>Constructor</h2>
<h3>[name]( [param:Boolean autoStart] )</h3>
<p>
autoStart — (optional) whether to automatically start the clock when
[page:.getDelta]() is called for the first time. Default is `true`.
</p>
<h2>Properties</h2>
<h3>[property:Boolean autoStart]</h3>
<p>
If set, starts the clock automatically when [page:.getDelta]() is called
for the first time. Default is `true`.
</p>
<h3>[property:Float startTime]</h3>
<p>
Holds the time at which the clock's [page:Clock.start start] method was
last called. Default is `0`.
</p>
<h3>[property:Float oldTime]</h3>
<p>
Holds the time at which the clock's [page:Clock.start start],
[page:.getElapsedTime]() or [page:.getDelta]() methods were last called.
Default is `0`.
</p>
<h3>[property:Float elapsedTime]</h3>
<p>
Keeps track of the total time that the clock has been running. Default is
`0`.
</p>
<h3>[property:Boolean running]</h3>
<p>Whether the clock is running or not. Default is `false`.</p>
<h2>Methods</h2>
<h3>[method:undefined start]()</h3>
<p>
Starts clock. Also sets the [page:.startTime] and [page:.oldTime] to the
current time, sets [page:.elapsedTime] to `0` and [page:.running] to
`true`.
</p>
<h3>[method:undefined stop]()</h3>
<p>
Stops clock and sets [page:Clock.oldTime oldTime] to the current time.
</p>
<h3>[method:Float getElapsedTime]()</h3>
<p>
Get the seconds passed since the clock started and sets [page:.oldTime] to
the current time.<br />
If [page:.autoStart] is `true` and the clock is not running, also starts
the clock.
</p>
<h3>[method:Float getDelta]()</h3>
<p>
Get the seconds passed since the time [page:.oldTime] was set and sets
[page:.oldTime] to the current time.<br />
If [page:.autoStart] is `true` and the clock is not running, also starts
the clock.
</p>
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</p>
</body>
</html>