Hacker News new | ask | show | jobs
by spacehunt 1415 days ago
Collision detection is a major reason. If you only sample positions at the frame rate, you're going to have bullets go through walls without hitting anything.

Also, physics is costly to run, so usually it's not run on every frame.

2 comments

And you really want your collision detection to be reasonably deterministic. Reasonable frame rates range from 30fps to 240fps, which is nearly an order of magnitude, and you want your bullets to behave the same over that range.
You only need physics to run at a "fast enough" rate. Let me rephrase:

Why not just snap physics frames to graphics frames?

Frame rate is variable.