Re:Fix Your Timestep
by bogwog on Friday June 26, 2020 @10:03AM
(#23652056)
The only way to reliably prevent the situation where fast moving objects from moving through thin walls (or even thick walls) is to use continuous collision detection. Even if you step the physics engine at a ridiculously high rate (say 1000 frames per second), objects will still pass through each other if they're moving fast enough.
[ Parent
| on HN ]
Re:Fix Your Timestep
by munificent on Friday June 26, 2020 @01:17PM
(#23654403)
You can always just limit the maximum velocity of objects.
Re:Fix Your Timestep
by jfkebwjsbx on Friday June 26, 2020 @04:26PM
(#23656593)
I guess most games cap velocities for most objects if not all, so I doubt that is an issue.
That's not practical. If you cap velocities, you'll also need to enforce a minimum size for all objects. If you don't do this, it will still be possible for objects to pass through each other. So you can either have really small but really slow objects, or really large but really fast objects.
What most games do is enable continuous collision detection for important fast objects only, like the player or projectiles.