[ODE] Huge world vs precision problems

Jon Watte (ODE) hplus-ode at mindcontrol.org
Thu Mar 9 10:27:02 MST 2006



Anders Olofsson wrote:

> What are my options?, I thought of partitioning up my world in smaller 
> chunks that floats can handle. But in practice I haven't figured out how to 
> do that, is it possible somehow? How small/large would those chunks be?. 
> (Or at around what huge number start floats to loose their precision? :) )

Floats typically start introducing jitter when you go beyond +/- 4 
kilometers (if you're at human scales). The reason is that you have 25 
bits of precision (with the sign bit and implicit leading 1) meaning the 
resolution quanta is (WORLD_SIZE / (1<<25)).

For larger coordinates, you need to use doubles. However, the trimesh 
code itself does not, internally, use doubles. Thus, you have to create 
trimeshes that are each less than a kilometer in size, and subtract the 
collider position from the trimesh center, and collide in a 
trimesh-centric coordinate system, for it to work reasonably. ODE may do 
some of that internally; I haven't checked; if it does, the main issue 
for you is to create small enough chunks of trimeshes.

Cheers,

			/ h+




More information about the ODE mailing list