try out smaller collision margins

This commit is contained in:
Seth Alves 2015-05-13 13:00:57 -07:00
parent 80749195e6
commit 2ec660bd42

View file

@ -14,6 +14,7 @@
#include "ShapeInfoUtil.h" #include "ShapeInfoUtil.h"
#include "BulletUtil.h" #include "BulletUtil.h"
const float BULLET_COLLISION_MARGIN = 0.01;
btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) { btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) {
btCollisionShape* shape = NULL; btCollisionShape* shape = NULL;
@ -44,6 +45,7 @@ btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) {
btVector3 btPoint(point[0], point[1], point[2]); btVector3 btPoint(point[0], point[1], point[2]);
hull->addPoint(btPoint, false); hull->addPoint(btPoint, false);
} }
hull->setMargin(BULLET_COLLISION_MARGIN);
hull->recalcLocalAabb(); hull->recalcLocalAabb();
shape = hull; shape = hull;
} else { } else {
@ -60,6 +62,7 @@ btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) {
hull->recalcLocalAabb(); hull->recalcLocalAabb();
compound->addChildShape (trans, hull); compound->addChildShape (trans, hull);
} }
compound->setMargin(BULLET_COLLISION_MARGIN);
shape = compound; shape = compound;
} }
} }