only delete the BVH during re-scaling when we 'own' it.

Thanks Phil Knight for reporting!
This commit is contained in:
ejcoumans
2007-09-11 21:18:45 +00:00
parent a7841c7775
commit 2dd54dbfd0

View File

@@ -177,7 +177,8 @@ void btBvhTriangleMeshShape::setLocalScaling(const btVector3& scaling)
if ((getLocalScaling() -scaling).length2() > SIMD_EPSILON)
{
btTriangleMeshShape::setLocalScaling(scaling);
delete m_bvh;
if (m_ownsBvh)
delete m_bvh;
///m_localAabbMin/m_localAabbMax is already re-calculated in btTriangleMeshShape. We could just scale aabb, but this needs some more work
m_bvh = new btOptimizedBvh();
//rebuild the bvh...