[ODE] Re: trilist strategy

McEvoy, Nick nick.mcevoy at dsto.defence.gov.au
Wed Dec 11 16:26:02 2002


Norman wrote:
<...>
>I'd be curious about other approaches.

I don't use trilist (yet) ... but my approach to the problem where the player falls thru the terrain geometry is as follows:
- firstly I do the players bounding sphere check against the terrain (any hit triangles generate contacts)
- if there are no hits I then check the players bounding sphere height-over-terrain, if we are below the terrain then I determine the triangle directly above my player and use the players depth & triangle normal to generate the contact (which bounces the player back up above the terrain).

Works well so far. :)

Also when I generate contacts against a (terrain) triangle I use the triangle texture properties to determine contact surface properties eg. mu, bounce, slip, etc.  Thus you get different contacts for bitumen, dirt, snow, ice, grass, water, whatever.

If it is a car that I'm simulating I have:
- a 'parent' bounding sphere - around the car chassis & wheels (this first check gets all hit triangles)
- bounding sphere - for each wheel & chassis (only checks against the parent triangles hit)

The bounding sphere for the chassis is the unfortunate part ... it would be better as a box ... but I don't have any good code for box-tri collision to calculate points & depths of contact.

I wonder ... how does trilist do this ?  Or if anyone has an idea on box-tri code let me know.  :)

Nick
http://members.ozemail.com.au/~ndmcevoy/