We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c71a2d8 commit 46b6bb0Copy full SHA for 46b6bb0
examples/jsm/misc/Timer.js
@@ -1,3 +1,12 @@
1
+/**
2
+ * This class is a new alternative to THREE.Clock with a different API design and behavior.
3
+ * The goal is to avoid the conceptual flaws that became apparent in THREE.Clock over time.
4
+ *
5
+ * - THREE.Timer has an update() method that updates its internal state. That makes it possible to call .getDeltaTime() and
6
+ * .getElapsedTime() multiple times per simulation step without getting different values.
7
+ * - The class uses the Page Visibility API to avoid large time delta values when the app is inactive (e.g. tab switched or browser hidden).
8
+ * - It's possible to configure a fixed time delta and a time scale value (similar to Unity's Time interface).
9
+ */
10
class Timer {
11
12
constructor() {
0 commit comments