schteppe / p2.js

JavaScript 2D physics library
Other
2.63k stars 330 forks source link

Fix World.step reverting to fixed time step with 0 timeSinceLastCalled #337

Open Grimeh opened 5 years ago

Grimeh commented 5 years ago

Calling World.step with a timeSinceLastCalled of 0 would cause it to revert to the fixed time step behaviour. This was due to the default value of timeSinceLastCalled being 0. This change checks for undefined, as opposed to 0.

maxSubSteps still has a default value of 10.

See issue #334 for more details.