[ODE] dHeightfield collider

Jon Watte (ODE) hplus-ode at mindcontrol.org
Sat Mar 25 08:54:03 MST 2006


First, you should be able to re-use your code using regular geom 
transformation, assuming you can transform the colliding primitive into 
terrain space. Disallow trimesh/terrain and terrain/terrain collisions...

Second, make sure you support variable terrain interpolation methods. 
While linear triangles between each sample is common, more advanced 
systems do things like cubic interpolation (sampling 16 heightfield 
samples), and subdivide a few vertices between each sample. This tends 
to look much better than angular linear terrain, unless you actually 
want an angular look.

Cheers,

			/ h+


Martijn Buijs wrote:
> I'm working on a general purpose heightfield collider, based on the "Terrain & Cone" contrib. It
> removes the terrain dimension limitations (supports non-square fields & grid spacing, NPOT dims) and
> allows deformable terrains (it should work great for animated water surfaces as well -- the reason I
> named it "dHeightfield" rather than "dTerrain"). A bunch of fixes are included (AABB patch, callback
> patch), and the geom creation interface has been changed to mimic the trimesh collider.
> 
> However, I'm not sure how I can make it to work with Z-up systems (I re-used dTerrainY code) without
> duplicating code, and in an elegant, efficient fashion. Any suggestions?
> 
> If it proves stable (which so far it has) I think this collider would make a nice addition for the
> next stable release. I'll do some more testing, write a readme etc. and try to post the code after
> the weekend. :)



More information about the ODE mailing list