Closed Fxlr8 closed 5 years ago
Actually, looks like this problem was already solved by https://github.com/schteppe/p2.js/commit/0b33d985d903d44a946616ecd116a58fc538c490 3 years ago. Please, publish updates to npm
Will publish a release to npm when the latest code has been tested enough. If you need this fix right now, point your package.json directly to github.
Hi, I am making a game, in which a moving player can shoot projectiles. I use fixed time stepping with interpolation for my world. Projectiles are just circles with mass=0.09 and radius=10. They are added to the world in a
postStep
event handler with player's position and some velocity.When they are added, their previousPosition appears to be [0, 0], when their current position is like [1000, 1200].
for example:
This makes p2.js interpolate it from [0, 0], which has no sence, and an object makes an ugly jump for one frame.