[ODE] Terrain colliders and/or Trimesh/OPCODE

Pierre Terdiman pierre.terdiman at novodex.com
Mon Feb 9 09:27:12 MST 2004


> Bottom line... I agree with John that OPCODE is effective (I used OPCODE
> for Juice's terrain), but I think that Benoit's code is probably better
> still.  OPCODE has extra storage and startup-time requirements, and (most
> importantly) once something passes through an OPCODE mesh, it stops
> colliding.  A heightmap has a notion of "beneath" that a mesh doesn't
> have, and Benoit has provided us with a nice implementation.

I modified OPCODE a bit for Novodex, and there's a way to fix that :
- extend the AABBs to infinity in the heightfield direction
- skip primitive tests with the appropriate flag

You then get back indices of triangles potentially colliding with objects,
and "all you have to do" is handle those as semi-infinite prisms instead of
just flat triangles. Of course you bypass OPCODE's final collision detection
stage, but you have to do that anyway for collision response.

So you can still use OPCODE for terrains, but indeed a dedicated terrain
implementation (say 2D-oriented) is obviously better.


Pierre Terdiman

- Novodex AG (www.novodex.com)
- Personal : www.codercorner.com






More information about the ODE mailing list