* 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)
| 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 | } |
no test coverage detected