[ODE] dWorldSetAutoDisableFlag doesn't work?

Joe Ante joe at uti.is
Tue May 25 22:52:16 MST 2004


> 
>> There is definitely discrepancy between how the defaults are set in
>> ODE (in dBodyCreate) and how the parameters are set for individual
>> objects.
> mohsin, can you please post a patch for how you think the code should
> be?
There is just a small bug in ode.cpp - dBodySetAutoDisableDefaults.

Eg.
b->adis.linear_threshold = dWorldGetAutoDisableLinearThreshold (w);

dWorldGetAutoDisableLinearThreshold () returns the sqrt of
adis.linear_threshold for obvious reasons. Thus the value should be squared
again when setting it in the body adis value.

It would however be simpler and faster to just replace
dBodySetAutoDisableDefaults with the following code, which instead of
calling functions to get the values from the adis, just copies the whole
adis struct.

void dBodySetAutoDisableDefaults (dBodyID b)
{
    dAASSERT(b);
    dWorldID w = b->world;
    dAASSERT(w);
    b->adis = w->adis;
    dBodySetAutoDisableFlag (b, w->adis_flag);
}

Joe Ante



More information about the ODE mailing list