From afcd62e622f645e430420eede33fdc8ef5799b74 Mon Sep 17 00:00:00 2001 From: Nathan Mande Date: Wed, 24 Apr 2024 19:42:52 +0200 Subject: [PATCH] fix: correct `timestep` update --- examples/jsm/physics/RapierPhysics.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/jsm/physics/RapierPhysics.js b/examples/jsm/physics/RapierPhysics.js index 690c67209faf17..3ac58d88091b3b 100644 --- a/examples/jsm/physics/RapierPhysics.js +++ b/examples/jsm/physics/RapierPhysics.js @@ -349,10 +349,11 @@ export class Physic { /** * @description Update the physic world. * - * @param {number | undefined} delta + * @param {number | undefined} timestep The timestep length, in seconds. */ - step(delta = undefined) { - this.world.step(delta); + step(timestep = undefined) { + if (typeof timestep === "number") this.world.timestep = timestep; + this.world.step(); for (let i = 0, l = this.dynamicObjects.length; i < l; i++) { const object = this.dynamicObjects[i];