diff --git a/src/util/Clock.js b/src/util/Clock.js index 51143d35..f103c604 100644 --- a/src/util/Clock.js +++ b/src/util/Clock.js @@ -135,6 +135,19 @@ export class Clock extends MonotonicClock } /** + * Progress the current time of the clock. + * + * @param {number} [deltaTime] the time (s) to be added to the clock's current time + */ + addTime(deltaTime) + { + this._timeAtLastReset -= deltaTime; + } + + /** + * DEPRECATED: Clock.add() is deprecated in favor of .addTime() due to the counterintuitive + * design (it added time to the baseline, which reduced the values returned from getTime() ) + * * Add more time to the clock's 'start' time (t0). * *
Note: by adding time to t0, the current time is pushed forward (it becomes