File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -385,8 +385,8 @@ export class World extends EventTarget {
385
385
*
386
386
* @see http://bulletphysics.org/mediawiki-1.5.8/index.php/Stepping_The_World
387
387
*/
388
- step ( dt : number , timeSinceLastCalled = 0 , maxSubSteps = 10 ) : void {
389
- if ( timeSinceLastCalled === 0 ) {
388
+ step ( dt : number , timeSinceLastCalled ?: number , maxSubSteps = 10 ) : void {
389
+ if ( timeSinceLastCalled === undefined ) {
390
390
// Fixed, simple stepping
391
391
392
392
this . internalStep ( dt )
@@ -410,7 +410,9 @@ export class World extends EventTarget {
410
410
}
411
411
}
412
412
413
- const t = ( this . accumulator % dt ) / dt
413
+ this . accumulator = this . accumulator % dt
414
+
415
+ const t = this . accumulator / dt
414
416
for ( let j = 0 ; j !== this . bodies . length ; j ++ ) {
415
417
const b = this . bodies [ j ]
416
418
b . previousPosition . lerp ( b . position , t , b . interpolatedPosition )
You can’t perform that action at this time.
0 commit comments