Skip navigation.
Home

IBDS patch: fixed step size for precise collisions

gazihan's picture

Right now, the binarySearch for collisions stop when the distance for the first contact is within the collision tolerance. For high tolerance values this seems to be ok, but high tolerance creates less accurate simulations.

When the tolerance is low, the while loop in Simulation::binarySearch() actually gets executed and the simulation ends up stepping lower than the real step size. This is easily verified by doing sim->getCollisionDetection ()->setTolerance (0.0001) in CollisionModel.cpp. As the bodies start hitting the ground, the actual timestep varies as can be seen by the time display on the render window. I think this is bad, since most applications would expect the simulation to have the same step size everytime it is stepped. Attached is a patch that forces Simulation::timeStep() not to return till the expected timestep is reached.

http://www.impulse-based.de/phpBB2/viewtopic.php?p=151

AttachmentSize
precisecollision.patch3.73 KB

Post new comment

The content of this field is kept private and will not be shown publicly.
Captcha
This question is used to make sure you are a human visitor and to prevent spam submissions.
Copy the characters (respecting upper/lower case) from the image.