# [ODE] solid terrain representations that are still tunnelable?

Megan Fox shalinor at gmail.com
Tue Feb 22 13:47:01 MST 2005

```Right - the box corner poking through thing is what I meant by the
problems you'd get at particularly pointy areas of the terrain.  So
long as the terrain was fairly level, a/o you kept the boxes fairly
thin, they wouldn't be apparent, but at any point where the terrain
had a particularly pointy spot, the box edges would point through.
You could derive an equation to check for the case and dynamically
adjust the box depth, or a few other things, but I'm not sure it'd be
worthwhile.

... as for convex solids, though, that would of course be preferable.

Is there a convex bounding hull collider available for ODE I'm just
unaware of, or did you roll your own?  (and assuming you did, is it
either available somewhere, or do you have any particularly good
recommendations for reading material on them)

Thanks,
-Megan Fox

> Hi,
>
> 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?
```