[ODE] 2D Rectangle Geom??

Aras Pranckevicius nearaz at interamotion.com
Tue Apr 29 23:32:02 2003


> How about the ode/contrib/tri-collider? A box with a zeroed dimension
> sounds pretty sketchy.

>From my experience, the tri-collider isn't as precise as native box-box or
box-sphere colliders - this can be caused by OPCODE that uses single
precision; or from the fact that tri-something collision is much more
complicated than, say, sphere-box collision.

> > I'm currently using BoxGeoms for roads for my vehicles.  I'm wondering
> > if there is a more performant solution.
> > All I really need is a 2D rectangle to collided against, or put another
> > way, a bounded plane!

You can have several problems with boxes: first, when you have several
adjacent boxes, you obtain several contacts when the wheel hits the
boundary - you'll have to implement merging of these contacts yourself (or
the car will jump slightly on the boundaries).

Second - you usually need to collide with only the "top" face of the box
(that is, a bounded plane). If you use plain box and the wheel approaches
the edge of the box, the contact normal may go not in the "up" direction,
but in the "side" direction (when there's smaller distance to the box side
than to the up face").

For my car simulation I was considering adding additional code to the ODE's
native box geometry: eg. a flag "collide with upper face only", and modify
box-sphere collider (and possibly the others as well, but they don't matter
much for a car sim). That's pretty easy to do, as it just projects the
sphere onto the box axes and chooses minimal depth (well, I thing there's a
bug - in some cases it chooses the maximal depth). You just have to modify
it so it always projects onto the top face.


Aras Pranckevicius aka NeARAZ
http://www.gim.ktu.lt/nesnausk/nearaz/