Physics and 64bits Worlds
Posted: Fri Sep 17, 2010 9:14 pm
Hi,
I have an issue I'm making some research for and wondering if you could be of any help.
I'm working on a game with a System wide scale meaning zillions of kms distances. For that reason, I'm currently using a Double precision positioning (I've created a DoubleVector3 for this sole requirement).
Therefore, my objects are positioned in space using real world scaled positions.
For rendering, I'm doing two things:
A. The meshes and shaders use a World Matrix that is built using the Camera position as the origin. Therefore, when getting back to single precision (float) for rendering, the objects never get precision issues.
B. Because of Z buffer precision issues, I'm also scaling down meshes based on the far plane distance of the Projection Matrix of the camera using a proportional algorithm to respect perspective.
Now, I would like to avoid implementing my own physics & collision engine but I, for now, do not see another way.
I first thought to use a similar trick but the Physics are computed first and applied to the Entity then to be rendered. Otherwise, it wouldn't work.
So any advice would be greatly appreciated
Thanks
Philippe
I have an issue I'm making some research for and wondering if you could be of any help.
I'm working on a game with a System wide scale meaning zillions of kms distances. For that reason, I'm currently using a Double precision positioning (I've created a DoubleVector3 for this sole requirement).
Therefore, my objects are positioned in space using real world scaled positions.
For rendering, I'm doing two things:
A. The meshes and shaders use a World Matrix that is built using the Camera position as the origin. Therefore, when getting back to single precision (float) for rendering, the objects never get precision issues.
B. Because of Z buffer precision issues, I'm also scaling down meshes based on the far plane distance of the Projection Matrix of the camera using a proportional algorithm to respect perspective.
Now, I would like to avoid implementing my own physics & collision engine but I, for now, do not see another way.
I first thought to use a similar trick but the Physics are computed first and applied to the Entity then to be rendered. Otherwise, it wouldn't work.
So any advice would be greatly appreciated
Thanks
Philippe