catch invalid mass/inertia instead of division by zero/nan. also, avoid indexing <0
This commit is contained in:
@@ -118,9 +118,13 @@ static btVector3 convexHullSupport (const btVector3& localDirOrg, const btVector
|
||||
return supVec;
|
||||
#else
|
||||
|
||||
btScalar maxDot;
|
||||
long ptIndex = vec.maxDot( points, numPoints, maxDot);
|
||||
btScalar maxDot;
|
||||
long ptIndex = vec.maxDot( points, numPoints, maxDot);
|
||||
btAssert(ptIndex >= 0);
|
||||
if (ptIndex<0)
|
||||
{
|
||||
ptIndex = 0;
|
||||
}
|
||||
btVector3 supVec = points[ptIndex] * localScaling;
|
||||
return supVec;
|
||||
#endif //__SPU__
|
||||
|
||||
Reference in New Issue
Block a user