game engine: Revert to using regular gimpact for mesh shapes

This reverts part of r53019.
While the compound shape trick works well in some cases, overall it's
much slower and even causes crashes under certain conditions.

We could make this and option and fix the crashes, but it's better to
implement convex decomposition anyway so just reverting for now.

Fixes [#34353] Ray cast on Triangle mesh bounded Rigid Body Object causes blender crash to desktop without error.
This commit is contained in:
Sergej Reich
2013-02-22 14:47:11 +00:00
parent 4df5b943ed
commit c586159438

View File

@@ -24,7 +24,6 @@ subject to the following restrictions:
#include "btBulletDynamicsCommon.h"
#include "BulletCollision/CollisionDispatch/btGhostObject.h"
#include "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h"
#include "BulletCollision/Gimpact/btCompoundFromGimpact.h"
#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"
#include "PHY_IMotionState.h"
@@ -37,7 +36,6 @@ subject to the following restrictions:
#include "BulletSoftBody/btSoftBodyHelpers.h"
#include "LinearMath/btConvexHull.h"
#include "BulletCollision/Gimpact/btGImpactShape.h"
#include "BulletCollision/Gimpact/btGImpactShape.h"
#include "BulletSoftBody/btSoftRigidDynamicsWorld.h"
@@ -2232,13 +2230,7 @@ btCollisionShape* CcdShapeConstructionInfo::CreateBulletShape(btScalar margin, b
btGImpactMeshShape* gimpactShape = new btGImpactMeshShape(indexVertexArrays);
gimpactShape->setMargin(margin);
gimpactShape->updateBound();
//the depth value is how far along the triangle normal, the centroid is moved inwards
//to create surface tetrahedra for the btCompoundShape
//would be nice to expose this in the Blender user interfaceb
btScalar depth=btScalar(0.2);
collisionShape = btCreateCompoundFromGimpactShape(gimpactShape,depth);
delete gimpactShape;
collisionShape = gimpactShape;
} else