[ODE] 2D Rectangle Geom??
Jeff Weber
jeffreyweber at hotmail.com
Wed Apr 30 05:30:02 2003
I like the idea of modifying the sphere-box collision to only test against
the upper plane. I'll look into that, and see what I can find. I don't think
being limited to rectangles is a big deal for me. I'm modeling highways, and
no single piece of road (even the curves) will be that far from rectangular.
If it's not exact, it's not too big an issue for my app.
I haven't messed much with the tri-collider yet. (had a hard enough time
getting ode compiled.) I did just read about how Racer uses splines for
it's track collision. Basically it's just a triangle strip. That seemed like
an interesting solution...
-jeff
----Original Message Follows----
From: "Aras Pranckevicius" <nearaz@interamotion.com>
To: <ODE@q12.org>
Subject: Re: [ODE] 2D Rectangle Geom??
Date: Wed, 30 Apr 2003 09:32:04 +0200
> 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/
_______________________________________________
ODE mailing list
ODE@q12.org
http://q12.org/mailman/listinfo/ode
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail