MCPcopy Create free account
hub / github.com/melonjs/melonJS / step

Method step

packages/melonjs/src/physics/world.js:340–349  ·  view source on GitHub ↗

* update the physics simulation by one step (called by the game world update method) * @param {number} dt - the time passed since the last frame update

(dt)

Source from the content-addressed store, hash-verified

338 * @param {number} dt - the time passed since the last frame update
339 */
340 step(dt) {
341 // `physic` is the active adapter's identifier ("builtin", "matter",
342 // etc.) or the sentinel "none" when physics is disabled. The step
343 // runs under any adapter; only "none" skips it.
344 if (this.physic !== "none") {
345 this.adapter.step(dt);
346 this.adapter.syncFromPhysics();
347 }
348 emit(WORLD_STEP, dt);
349 }
350}

Callers 1

updateMethod · 0.95

Calls 3

emitFunction · 0.90
stepMethod · 0.65
syncFromPhysicsMethod · 0.65

Tested by

no test coverage detected