[ODE] contact points

Jaroslav Sinecky jsinecky at tiscali.cz
Thu Apr 12 10:10:59 MST 2007

Hm, I think now I don't understand. If you are writing a collision 
routeen, you should just fill in the dContact structure, you don't "add 
contact points". User supplied contact callback should take care of 
creating the contact joint later, which typically creates contact joint 
between bodies connected to g1 and g2. If you fill in dContact correctly 
with correct normal orientation and it does not behave as expected, the 
problem is somewhere else.

And sure, there is enthusiasm for having collision for convex objects, 
no doubt!!


Lewis Foster wrote:
> Jaroslav,
> Yes that's correct and in my case it works fine in the situation where 
> the normal points in to the box that is in the air. What i found to 
> cause a problem was when the normal pointed toward the box on the 
> floor it was effectively adding contact points to the box on the floor 
> which had no effect as it couldn't move.
> The obvious solution is to add contact points to BOTH geoms with an 
> inverted normal on one, this seems to have fixed my problem although 
> they're still acting somewhat erratically. Is this how it should be 
> done, contacts on both geoms?
> David, good to hear some enthusiasm for it. I'm still not happy with 
> the collision behaviour and i dare say the code is quite inefficient 
> but i'll see where I can get with it. I'm going to test it with 
> different convex objects and see how it behaves then i'll post the 
> results.
> Thanks
> Lewis
> On 4/12/07, *Jaroslav Sinecky* <jsinecky at tiscali.cz 
> <mailto:jsinecky at tiscali.cz>> wrote:
>     Hi,
>     the orientation of normal has to be consistent with ordering of g1 and
>     g2 (as you say it yourself). If you save box1 into g1 field of
>     resulting
>     dContact structure and box2 into g2, normal should point from box2
>     into
>     box1. You can also save box1 into g2 and box2 into g1 and flip the
>     normal in that case (from box1 into box2).
>     The ode manual is very precise on this:
>     "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."
>     Hope this helps,
>     Jaroslav
>     Lewis Foster wrote:
>     > Hi all, i'm playing around with convex hull's at the minute and what
>     > i've got so far seems to be generating the correct contact
>     normal and
>     > so i've moved on to creating the contact points.
>     >
>     > The problem i'm having is that the contact points are either doing
>     > nothing, or if anything they are pulling one object into the
>     other, so
>     > you would think the normal was inverted. However the normal
>     should be
>     > able to be in either direction, so long as you have the correct
>     > ordering of g1 and g2.
>     >
>     > Picture this, box1 is dropping onto box2 which is resting on the
>     > floor. The normal correctly points from box1 toward box2, downwards.
>     >
>     > Cycling through the points of box2, two points are correctly
>     > identified as being behind the plane of box1 and so are added to
>     the
>     > contact array. The depth is correctly identified and is positive.
>     >
>     > Why then would box1 continue downwards into box2? It seems that as
>     > box2 is unable to move in the direction of the normal (due to the
>     > floor) it remains where it is and box1 simply continues to fall
>     > through....obviously the collision detection side of things doesn't
>     > need to know if there is an immovable object resisting one objects
>     > motion. In this case, how does the collision detection, or ODE, know
>     > to invert the normal and make the collision points act in the
>     opposite
>     > direction on the other object, that is free to move?
>     >
>     > I hope that makes sense. Any help would be greatly appreciated...I
>     > wonder if i'll finish this before Erwin finishes the bullet
>     > integration...my work will be obsolete otherwise.
>     >
>     > Thanks.
>     >
>     > Lewis
>     >
>     ------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > ODE mailing list
>     > ODE at ode.org <mailto:ODE at ode.org>
>     > http://mooshika.org/mailman/listinfo/ode

More information about the ODE mailing list