[ODE] Collision triangle culling

Jani Kajala jani at sumea.com
Wed Dec 5 16:02:02 2001


This is not really an aswer to your question but anyway... Usually racing games
don't go that far in simulating collisions. Usually the tracks are designed so
that 'invisible fence' starts at some distance, and other objects which get
collided against have some reasonable volume. You could for example require that
every collidable object must have at least 50cm radius. If you don't assume this
then you need accurate (continuous) collision checks.


Regards,
Jani Kajala

----- Original Message -----
From: "Ruud van Gaal" <ruud@marketgraph.nl>
To: <ode@q12.org>
Sent: Thursday, December 06, 2001 12:01 AM
Subject: [ODE] Collision triangle culling


> Hi all,
>
> I have the following situation: in my carsim I have tracks with fences that
are
> made of 2 polygons; one for each direction it faces (there are no doublesided
> faces).
> I have an (ODE) OBB for the car body and create an ODE plane when I detect a
> hit of the OBB with a track (or fence) triangle. This is done with AABBtrees
so
> it's quite ok; mostly 0 triangles are even checked, and the tree gets down to
> the correct potential triangles in O(logN).
>
> Now the car hits a fence; when colliding with the wrong side (polygon) of the
> fence, the normal is flipped, and ODE thinks the OBB is way inside the
triangle
> (understandably). The result is a fierce push dragging the car *through* the
> triangle.
> At first I thought I could solve this by checking the car's velocity w.r.t.
the
> triangle's normal (normal dot car linear velocity for a rough check). This
> works a little bit, but as ODE allows penetrations, the *next* step, the car
is
> still somewhat inside both fence triangles, but this time, it's moving OUT the
> fence (because of the previously generated contact points).
> Now, the reverse is happening. The car is moving into the other direction
> (correctly) but this causes my 'normal dot car velocity' to indicate the OTHER
> triangle should now be checked. Since the car isn't taken out of the
> penetration entirely, the next collision check indicates the car is very far
> into the triangle, and we still get an explosion.
>
> What I've done now is to check both the car's velocity (in the direction of
the
> fence triangle's normal), and  a penetration depth that looks weird; for
> example, if(penetration_depth>0.5 (meter) ) then forget about this contact
> point. Still, this looks awfully hacked.
> Does anybody have a suggestion on how to tackle this? Using just 1 polygon for
> the fence doesn't seem an option, as I must pick 1 face normal when the car
> hits the triangle from the one or the other side (btw I create the contact
> points using ODE's dCollide() with the OBB of the car and the plane of the
> triangle).
>
> Thanks, and I hope this is clear enough,
> Ruud
>
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode
>