Skip to content

Commit

Permalink
Update Timer.js
Browse files Browse the repository at this point in the history
Add description.
  • Loading branch information
Mugen87 authored Dec 17, 2023
1 parent c71a2d8 commit 46b6bb0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/jsm/misc/Timer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
/**
* This class is a new alternative to THREE.Clock with a different API design and behavior.
* The goal is to avoid the conceptual flaws that became apparent in THREE.Clock over time.
*
* - THREE.Timer has an update() method that updates its internal state. That makes it possible to call .getDeltaTime() and
* .getElapsedTime() multiple times per simulation step without getting different values.
* - 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).
* - It's possible to configure a fixed time delta and a time scale value (similar to Unity's Time interface).
*/
class Timer {

constructor() {
Expand Down

0 comments on commit 46b6bb0

Please sign in to comment.