[ODE] ODE 0.6 and Terrain

Martijn buijs512 at planet.nl
Wed Jul 26 13:14:40 MST 2006


Mark Fournier wrote:
> I notice that a lot of posters on the mailing list seem to have worked
> terrain or heightmaps into collision detection, and I'm wondering how they
> did it. I'm hoping that, in some cases at least, it wasn't simply the raw
> conversion of the terrain mesh or heightmap into a trimesh.

It does not involve trimeshes in any way. It is a lot more efficient as 
well, and even more stable in some cases.

 > I would like to modify the ODE code so that I can just
> submit a heightmap to ODE and have it calculate the polys as needed--this
> would allow us to have a dynamically changing heightmap.

This is exactly how it works. You can feed ODE the raw heightmap, or 
simply pass a pointer to it, and ODE does the rest. I didn't written the 
actual collider, but from what I understand it emulates two planes (each 
  for every two triangles that make up a quad) and does vertical ray 
tests with whatever is colliding with it.

Dynamically changing heightmaps are possible if you pass a pointer to 
the data (or when using the callback). The terrain bounding box may have 
to be re-calculated in that case, some functions to update the min & max 
heixel extremes are provided.

So yes, dHeightfield is probably what you want. :)

Martijn


More information about the ODE mailing list