Skip to content

Commit

Permalink
fix: correct timestep update
Browse files Browse the repository at this point in the history
  • Loading branch information
Neosoulink committed Apr 24, 2024
1 parent 8636675 commit afcd62e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/jsm/physics/RapierPhysics.js
Expand Up @@ -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];
Expand Down

0 comments on commit afcd62e

Please sign in to comment.