[ODE] Contact Direction

Krystian Ligenza kxxl at poczta.onet.pl
Fri Oct 26 00:47:02 MST 2007


> I would like to know how to get the direction vector of a contact.
>
> In the Nearcallback, in the contact loop, I set the contact surface 
> mode to "dContactFDir1". Once the contact is created, I want to check 
> the position and the direction of the contact, the position 
> (contacts[i].geom.pos) is correct, but it seems that the direction 
> (contacts[i].fdir1) hasn't been set.
>
> What am I doing wrong here? Is that how I can get the direction of the 
> contact?
>
Look more carefully at contacts[i].geom. It is a dContactGeom, and 
besides of "pos" (contact position), it also have "normal", "depth", 
etc. I think that "normal" is vector that you are looking for.

Cheers,
Krystian


More information about the ODE mailing list