[ODE] (Second Try) Problem with contact joints

Kris kris at kolos.math.uni.lodz.pl
Fri Mar 18 16:53:30 MST 2005


Hi

try those settings, it it sill won't work properly you can be sure that
parameters are ok :D

		 contact[i].surface.mode = dContactBounce | dContactSoftERP | dContactSoftCFM | dContactApprox1;
                 contact[i].surface.mu = 0.7f;
                 contact[i].surface.bounce = 0.01f;
                 contact[i].surface.slip1 = 0.2;
                 contact[i].surface.slip2 = 0.2;
                 contact[i].surface.soft_erp = 0.7f;
                 contact[i].surface.soft_cfm = 0.001f;

maybe you have put sphere into another space, then you have to call
dSpaceCollide2, for now i'm running out of ideas...

On Fri, 18 Mar 2005, Rodrigo Hernandez wrote:
> Hi,
> Well, I tried to set the step to a smaller amount, my max contacts is
> 40, but dCollide returns only one collision, still no change at runtime,
> the sphere just passes through.
>
> I am going to try tracing into ODE's dWorldStep function and find
> whether or not the contact makes any difference, so what is the function
> that applies contact forces? what should I be looking for?
>
> Here is the code for the simloop and the near callback I am using just
> in case.
> The Near callback is an object static function, in case you're wondering:
>
> void CWorld::OnPrepare()
> {
>     dSpaceCollide(ODESpace,0,&ODENearCallback);
>     dWorldStep(ODEWorld,0.01);
>     dJointGroupEmpty(ODEContactGroup);
> }
>
> void CWorld::ODENearCallback (void *data, dGeomID o1, dGeomID o2)
> {
>  CWorld *World=CWorld::GetWorld();
>   // exit without doing anything if the two bodies are connected by a joint
>   dBodyID b1 = dGeomGetBody(o1);
>   dBodyID b2 = dGeomGetBody(o2);
>   if (b1 && b2 && dAreConnectedExcluding (b1,b2,dJointTypeContact)) return;
>
>   dContact contact[40];   // up to MAX_CONTACTS contacts per box-box
>   for (int i=0; i<40; i++)
>   {
>     contact[i].surface.mode = dContactBounce | dContactSoftCFM;
>     contact[i].surface.mu = dInfinity;
>     contact[i].surface.mu2 = 0;
>     contact[i].surface.bounce = 1.0f;
>     contact[i].surface.bounce_vel = 0.0f;
>     contact[i].surface.soft_cfm = 0.01f;
>   }
>   if (int numc = dCollide (o1,o2,40,&contact[0].geom,sizeof(dContact)))
>   {
>     for (int i=0; i<numc; ++i)
>     {
>         dWorldID world = World->GetODEWorld();
>         dJointGroupID cg=World->GetODEContactGroup();
>         dJointID c = dJointCreateContact (world,cg,&contact[i]);
>         dJointAttach(c,b1,b2);
>     }
>   }
> }
>
> Thanks for looking :).
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>

Pozdr __DEVELOPER_TRINITY_CREEZ_H__
-- 
===========================================
                 GG: 1271378
-------------[ PROJECT TRINITY ]-----------
  [ http://trinity.glt.pl ]   [ Trinity ]
        [ The post-nuclear cRPG ]
===========================================



More information about the ODE mailing list