fix crash in btInternalEdgeUtility when a mesh is not the expected type
(don't wrap a mesh in a btCompoundShape if you want to use the edge utility)
This commit is contained in:
@@ -455,11 +455,20 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObjectWr
|
|||||||
btBvhTriangleMeshShape* trimesh = 0;
|
btBvhTriangleMeshShape* trimesh = 0;
|
||||||
|
|
||||||
if( colObj0Wrap->getCollisionObject()->getCollisionShape()->getShapeType() == SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE )
|
if( colObj0Wrap->getCollisionObject()->getCollisionShape()->getShapeType() == SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE )
|
||||||
trimesh = ((btScaledBvhTriangleMeshShape*)colObj0Wrap->getCollisionObject()->getCollisionShape())->getChildShape();
|
{
|
||||||
else
|
trimesh = ((btScaledBvhTriangleMeshShape*)colObj0Wrap->getCollisionObject()->getCollisionShape())->getChildShape();
|
||||||
trimesh = (btBvhTriangleMeshShape*)colObj0Wrap->getCollisionObject()->getCollisionShape();
|
}
|
||||||
|
else
|
||||||
btTriangleInfoMap* triangleInfoMapPtr = (btTriangleInfoMap*) trimesh->getTriangleInfoMap();
|
{
|
||||||
|
if (colObj0Wrap->getCollisionObject()->getCollisionShape()->getShapeType()==_TRIANGLE_MESH_SHAPE_PROXYTYPE)
|
||||||
|
{
|
||||||
|
trimesh = (btBvhTriangleMeshShape*)colObj0Wrap->getCollisionObject()->getCollisionShape();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (trimesh==0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
btTriangleInfoMap* triangleInfoMapPtr = (btTriangleInfoMap*) trimesh->getTriangleInfoMap();
|
||||||
if (!triangleInfoMapPtr)
|
if (!triangleInfoMapPtr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user