From 2ec660bd424d8747c17eae5860c294a5380da833 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Wed, 13 May 2015 13:00:57 -0700 Subject: [PATCH] try out smaller collision margins --- libraries/physics/src/ShapeInfoUtil.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/physics/src/ShapeInfoUtil.cpp b/libraries/physics/src/ShapeInfoUtil.cpp index c6c76a98eb..484f17f060 100644 --- a/libraries/physics/src/ShapeInfoUtil.cpp +++ b/libraries/physics/src/ShapeInfoUtil.cpp @@ -14,6 +14,7 @@ #include "ShapeInfoUtil.h" #include "BulletUtil.h" +const float BULLET_COLLISION_MARGIN = 0.01; btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) { btCollisionShape* shape = NULL; @@ -44,6 +45,7 @@ btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) { btVector3 btPoint(point[0], point[1], point[2]); hull->addPoint(btPoint, false); } + hull->setMargin(BULLET_COLLISION_MARGIN); hull->recalcLocalAabb(); shape = hull; } else { @@ -60,6 +62,7 @@ btCollisionShape* ShapeInfoUtil::createShapeFromInfo(const ShapeInfo& info) { hull->recalcLocalAabb(); compound->addChildShape (trans, hull); } + compound->setMargin(BULLET_COLLISION_MARGIN); shape = compound; } }