More GJK degeneracy fixes, thanks Jacob Langford for the feedback:
http://code.google.com/p/bullet/issues/detail?id=250 Added missing files for Maya Dynamica plugin Thanks Herbert Law for the patch, and damrit and others for the report http://code.google.com/p/bullet/issues/detail?id=231 Fix btQuaternion shortestArcQuat, thanks Stan Melax for original fix and shogun for reminder http://bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1989 Implemented btDiscreteDynamicsWorld::removeCollisionObject (and btSoftBodyDynamicsWorld) to avoid crashes. Thanks Jacob Langford for bringing that up. Minor sphere-debug drawing issue (spheres were drawn inside-out (wrong face winding)
This commit is contained in:
@@ -208,7 +208,7 @@ void btGjkPairDetector::getClosestPoints(const ClosestPointInput& input,Result&
|
||||
{
|
||||
m_degenerateSimplex = 7;
|
||||
squaredDistance = previousSquaredDistance;
|
||||
checkSimplex = true;
|
||||
checkSimplex = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -315,13 +315,11 @@ void btGjkPairDetector::getClosestPoints(const ClosestPointInput& input,Result&
|
||||
if (lenSqr > (SIMD_EPSILON*SIMD_EPSILON))
|
||||
{
|
||||
tmpNormalInB /= btSqrt(lenSqr);
|
||||
btScalar distance2 = -(tmpPointOnA-tmpPointOnB).length()-margin;
|
||||
btScalar distance2 = -(tmpPointOnA-tmpPointOnB).length();
|
||||
//only replace valid penetrations when the result is deeper (check)
|
||||
if (!isValid || (distance2 < distance))
|
||||
{
|
||||
distance = distance2;
|
||||
pointOnA -= m_cachedSeparatingAxis * (marginA / distance);
|
||||
pointOnB += m_cachedSeparatingAxis * (marginB / distance);
|
||||
pointOnA = tmpPointOnA;
|
||||
pointOnB = tmpPointOnB;
|
||||
normalInB = tmpNormalInB;
|
||||
@@ -349,13 +347,15 @@ void btGjkPairDetector::getClosestPoints(const ClosestPointInput& input,Result&
|
||||
if (lenSqr > (SIMD_EPSILON*SIMD_EPSILON))
|
||||
{
|
||||
tmpNormalInB /= btSqrt(lenSqr);
|
||||
btScalar distance2 = (tmpPointOnA-tmpPointOnB).length();
|
||||
btScalar distance2 = (tmpPointOnA-tmpPointOnB).length()-margin;
|
||||
//only replace valid distances when the distance is less
|
||||
if (!isValid || (distance2 < distance))
|
||||
{
|
||||
distance = distance2;
|
||||
pointOnA = tmpPointOnA;
|
||||
pointOnB = tmpPointOnB;
|
||||
pointOnA -= tmpNormalInB * marginA ;
|
||||
pointOnB += tmpNormalInB * marginB ;
|
||||
normalInB = tmpNormalInB;
|
||||
isValid = true;
|
||||
m_lastUsedMethod = 6;
|
||||
|
||||
Reference in New Issue
Block a user