[ODE] Static objects start rotating?

Flavien Brebion f.brebion at vrcontext.com
Sun Aug 12 14:20:57 MST 2007


James Frye a écrit :
> The nearCallback code is
>
>   b1 = dGeomGetBody (o1);
>   b2 = dGeomGetBody (o2);
>
>   /* exit without doing anything if the two bodies are connected by a joint */
>
>   if (b1 && b2 && dAreConnected (b1, b2))
>     return;
>
>   contact.surface.mode = 0;
>   contact.surface.mu   = 0.1;
>   contact.surface.mu2  = 0.0;
>   if (dCollide (o1, o2, 0, &contact.geom, sizeof (dContactGeom)))
>   {
>     c = dJointCreateContact (world, contactgroup, &contact);
>     dJointAttach (c, b1, b2);
>   }
>
> This was copied straight out of one of the test programs.  (After, of
> course running it through indent to de-obfuscate it.).
>   
That looks seriously wrong IMO, unless it's a copy/paste error. You're 
only using one contact, while you should provide space for many contacts 
( 64 is a pretty good start choice ). Also, the third argument should 
not be zero, but the max number of contacts. Look again at the test 
programs.


More information about the ODE mailing list