[ODE] which method is best for large scale terrains?

Jon Watte (ODE) hplus-ode at mindcontrol.org
Tue Oct 3 10:05:11 MST 2006

I know of no commercial game that actually uses a 2048x2048 heightmap. 
That doesn't mean there isn't one, of course.

I wouldn't rule out the ODE trimesh code until you've actually 
benchmarked it as unacceptable.

If you need something better, you'd probably want to split the terrain 
in something like a quadtree, calculating min/max bounds of each node, 
and split it down some number of levels (say, until you have 8x8 block 
or so). Then run your ray through the bounding boxes of this quadtree to 
cut down on the primitive testing.

By the way: 200 rays for a single car sounds somewhat excessive compared 
to what most games do.


          / h+

Matthew Reid wrote:
> Hi.
> I need a way to do fast collision detection on large terrain (2048x2048 
> quads or more). I've tried the terrainY contribution, but performance with 
> this is very poor. A single ray check across the terrain can potentially 
> lead to millions of calls to the getHeight() callback, and even for a single 
> vehicle with about 200 calls, my game performance takes a huge hit (25% 
> performance drop).
> What's the most efficient method for doing collision checks on large 
> terrains? I've thought of using trimesh, but from previous experience with 
> another physics engine, loading and checking against a multi-million polygon 
> trimesh is out of the question. How is large scale terrain collision and ray 
> checking handled in commercial games such as battlefield 1942? Is there some 
> technique whereby the trimesh could be split up into a AABB tree...similar 
> to BSP collision?
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode

More information about the ODE mailing list