btSphereSphereCollisionAlgorithm division by 0
Posted: Tue Nov 13, 2007 1:33 am
Hi Erwin,
While working on a project we have found that the btSphereSphereCollisionAlgorithm causes a crash when two spheres are in the same position.
I've patched the following code to include a check
to
I realise that this is something that doesn't tend to happen much and that we should be spawning our objects in different places. In the rare even that this happens the above patch fixes it
Thank you a million for bullet it is absolutely awesome!
-Sean Tasker
While working on a project we have found that the btSphereSphereCollisionAlgorithm causes a crash when two spheres are in the same position.
I've patched the following code to include a check
Code: Select all
btVector3 diff = col0->getWorldTransform().getOrigin()- col1->getWorldTransform().getOrigin();
btScalar len = diff.length();
btScalar radius0 = sphere0->getRadius();
btScalar radius1 = sphere1->getRadius();
Code: Select all
btVector3 diff = col0->getWorldTransform().getOrigin()- col1->getWorldTransform().getOrigin();
btScalar len = diff.length();
if(len==0.0f)
return;
btScalar radius0 = sphere0->getRadius();
btScalar radius1 = sphere1->getRadius();
Thank you a million for bullet it is absolutely awesome!
-Sean Tasker