diff options
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionShapes/btBox2dShape.h')
-rw-r--r-- | extern/bullet2/src/BulletCollision/CollisionShapes/btBox2dShape.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionShapes/btBox2dShape.h b/extern/bullet2/src/BulletCollision/CollisionShapes/btBox2dShape.h index fc032069c03..f4a9ca03e5c 100644 --- a/extern/bullet2/src/BulletCollision/CollisionShapes/btBox2dShape.h +++ b/extern/bullet2/src/BulletCollision/CollisionShapes/btBox2dShape.h @@ -13,8 +13,8 @@ subject to the following restrictions: 3. This notice may not be removed or altered from any source distribution. */ -#ifndef OBB_BOX_2D_SHAPE_H -#define OBB_BOX_2D_SHAPE_H +#ifndef BT_OBB_BOX_2D_SHAPE_H +#define BT_OBB_BOX_2D_SHAPE_H #include "BulletCollision/CollisionShapes/btPolyhedralConvexShape.h" #include "BulletCollision/CollisionShapes/btCollisionMargin.h" @@ -83,6 +83,7 @@ public: } + ///a btBox2dShape is a flat 2D box in the X-Y plane (Z extents are zero) btBox2dShape( const btVector3& boxHalfExtents) : btPolyhedralConvexShape(), m_centroid(0,0,0) @@ -97,6 +98,11 @@ public: m_normals[2].setValue(0,1,0); m_normals[3].setValue(-1,0,0); + btScalar minDimension = boxHalfExtents.getX(); + if (minDimension>boxHalfExtents.getY()) + minDimension = boxHalfExtents.getY(); + setSafeMargin(minDimension); + m_shapeType = BOX_2D_SHAPE_PROXYTYPE; btVector3 margin(getMargin(),getMargin(),getMargin()); m_implicitShapeDimensions = (boxHalfExtents * m_localScaling) - margin; @@ -358,6 +364,6 @@ public: }; -#endif //OBB_BOX_2D_SHAPE_H +#endif //BT_OBB_BOX_2D_SHAPE_H |