[ODE] solid terrain representations that are still tunnelable?

David Black dblack at fastmail.fm
Tue Feb 22 20:09:15 MST 2005


Well what I do is decompose my terrain(and displacment mapped objects) 
into convex solids, eg a hill might become a kinda cone shape.

The decomposition is done at runtime(to reduce memory consumtion) and 
cached. The algorithm is relativly simple, just pick a flat 'ground' 
plane(ie x-z plane) and a vertex on the terrain, add all the face planes 
around that point until you reach one which would make the resulting 
solid non-convex, then if necasery add bounding planes around the edges 
of the solid.

By adjusting how far the ground plane is below the lowest point of your 
terrain geometry, you can control how thick the ground is.

The reason for all this... My physics code only handles convex polyhedra 
and is heavily optimized for them.

Not sure how the box thing would work... wouldnt you get box corners 
sticking out of the ground at peaks in the terrain?


Megan Fox wrote:

>Given my spec, I need a heightmap terrain that I can drop down through
>(caves, crevaces and the like), but I'm still not wild about the idea
>of a trimesh paper-thin collider for the entire thing.
>Given this, I'm wondering if anyone has tried something like a layer
>of thin boxes, one per heightmap grid, oriented to the grid's normal
>and sized to cover the grid entirely.  Seemingly, this would give you
>a terrain representation that had the advantages of a solid geom,
>while still allowing for the creation of holes through it and the
>existence of geometry under it.  You of course wouldn't actually have
>a separate geom per grid, this is just how you would treat the
>collision calculations.
>(this as opposed to a "anything under the heightmap is penetrating" approach)
>The one problem I can see with it would be a possibility of strange
>collisions on extreme external points in the heightmap terrain, though
>it would depend largely on the depth of the box representation.
>-Megan Fox
>ODE mailing list
>ODE at q12.org

More information about the ODE mailing list