[ODE] direction of contact normal

Rodrigo Hernandez kwizatz at aeongames.com
Fri Dec 30 22:10:13 MST 2005


 From the Manual (http://ode.org/ode-latest-userguide.html#sec_10_1_0):

"normal is a unit length vector that is, generally speaking, 
perpendicular to the contact surface.

g1 and g2 are the geometry objects that collided.

The convention is that if body 1 is moved along the normal vector by a 
distance depth (or equivalently if body 2 is moved the same distance in 
the opposite direction) then the contact depth will be reduced to zero. 
This means that the normal vector points "in" to body 1."

So it all depends on the order of the bodies in the dContactGeom structure.

Guru2012 wrote:

> I'm using ODE for a 2d engine, and I've written my own collision 
> detection. The problem I'm having is setting the normal so that the 
> objects separate instead of stick.
> What I'm finding is that if a certain normal for the contact joint 
> causes the two objects to separate, the negative of that normal 
> (scaled by -1) causes them to go flying into each other.
>  
> For example, when I drop a square on top of another square I find that 
> the normal needs to point downwards, but looking at the sample code, a 
> collision between a box and a plane gives a normal pointing upwards.
>  
> My question is how to choose the normal so that the objects separate 
> and what criteria determine separation.
>  
> Thanks,
> Andrew
>
>------------------------------------------------------------------------
>
>_______________________________________________
>ODE mailing list
>ODE at q12.org
>http://q12.org/mailman/listinfo/ode
>  
>



More information about the ODE mailing list