[ODE] Re: Heightfield / Collision.

Clint Brewer clint at haptek.com
Tue Feb 18 10:32:02 2003


I'm doing height field collision right now too.

gl wrote:

>Another complication - heightfield triangle layout.   I use
>| \ | \ | \ |
>| \ | \ | \ |
>  
>

this is the same format I use.

the way I have mine set up currently,  I have 2 functions that can query 
the terrain,  1 to get a height value at a specific point, and 1 to get 
the normal at a specific point.  I then use that to do the collision.

so I like Erwin's suggestion of having a function that you call, then 
using that to build a small collision triangle.

or optionally, I was thinking you could have a function that asks the 
terrain for a set of triangles underneath a sample point.   Then the 
terrain can return a small set of triangles and you can collide the 
geometry against those triangles?  This would let the terrain give you 
the real triangles, which you might not get with your query for height 
samples,  and it would keep the format of the terrain completely up to 
the terrain.

-c