Positioning
Similarly, keeping all objects close to (0,0,0) in the world-space position will result in better floating-point accuracy, improving the consistency of the simulation. Space simulator and free-running games try to simulate incredibly large spaces and typically use a trick of either secretly teleporting the player back toward the center of the world or fixing their position there, in which case, either volumes of space are compartmentalized so that physics calculations are always calculated with values close to 0, or everything else is moved to simulate travel, and the player's motion is only an illusion.
Most games are not at risk of introducing floating-point inaccuracy, since most game levels tend to last around 10 to 30 minutes, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access