[ODE] Average Velocity feature and 'Disabling islands problem'
David Walters
hidden.asbestos at googlemail.com
Thu Nov 2 17:37:05 MST 2006
Hi, thanks for your contribution Christoph. I have added this patch to
SVN (#1125) as I feel that it provides a good system for a much better
quality auto-disabling of bodies, and its overhead when disabled
seemed so minimal (44/52 bytes and an 'if' in util.cpp for each body)
compared to the flexibility it brings.
NOTE: I have taken the liberty of renaming your new API very slightly:
the word 'Size' with 'SamplesCount' which, although a more verbose
name, I felt was much more descriptive to someone who does not know
about the internals of its implementation. I hope you agree :-)
The revised API is therefore:
//
// Default values for newly created bodies.
// (defaults match the standard thresholds)
//
// *** How many samples to take before evaluating?
ODE_API int dWorldGetAutoDisableAverageSamplesCount (dWorldID);
ODE_API void dWorldSetAutoDisableAverageSamplesCount (dWorldID,
int average_samples_count );
// *** Threshold for average linear velocity
ODE_API dReal dWorldGetAutoDisableLinearAverageThreshold (dWorldID);
ODE_API void dWorldSetAutoDisableLinearAverageThreshold (dWorldID,
dReal linear_average_threshold );
// *** Threshold for average angular velocity
ODE_API dReal dWorldGetAutoDisableAngularAverageThreshold (dWorldID);
ODE_API void dWorldSetAutoDisableAngularAverageThreshold (dWorldID,
dReal angular_average_threshold );
//
// Per-body adjustment, at any time.
//
// *** How many samples to take before evaluating?
ODE_API int dBodyGetAutoDisableAverageSamplesCount (dBodyID);
ODE_API void dBodySetAutoDisableAverageSamplesCount (dBodyID,
int average_samples_count );
// *** Threshold for average linear velocity
ODE_API dReal dBodyGetAutoDisableLinearAverageThreshold (dBodyID);
ODE_API void dBodySetAutoDisableLinearAverageThreshold (dBodyID,
dReal linear_average_threshold );
// *** Threshold for average angular velocity
ODE_API dReal dBodyGetAutoDisableAngularAverageThreshold (dBodyID);
ODE_API void dBodySetAutoDisableAngularAverageThreshold (dBodyID,
dReal angular_average_threshold );
NOTE: If you set the samples count to 1 the behaviour is the same as
of the traditional auto-disabling system.
Would it be a good idea to collapse these two approaches together
because in my mind there is redundant work being carried out here,
albiet in a slightly more optimal fashion.
In the current system, any spike in velocity over the standard
thresholds will result in a body remaining enabled, can we discuss
examples that would make it not a sensible idea to collapse the
standard auto-disable system into a specialisation of the averaging
system with a sample size of 1? right now that sounds like a pretty
good idea...
Regards,
David
More information about the ODE
mailing list