diff --git a/src/collision/shapes/TriangleShape.cpp b/src/collision/shapes/TriangleShape.cpp index f7f0b556..5fdd7b44 100644 --- a/src/collision/shapes/TriangleShape.cpp +++ b/src/collision/shapes/TriangleShape.cpp @@ -39,8 +39,8 @@ using namespace reactphysics3d; * @param point3 Third point of the triangle * @param margin The collision margin (in meters) around the collision shape */ -TriangleShape::TriangleShape(const Vector3& point1, const Vector3& point2, const Vector3& point3) - : ConvexShape(TRIANGLE, 0) { +TriangleShape::TriangleShape(const Vector3& point1, const Vector3& point2, const Vector3& point3, decimal margin) + : ConvexShape(TRIANGLE, margin) { mPoints[0] = point1; mPoints[1] = point2; mPoints[2] = point3; diff --git a/src/collision/shapes/TriangleShape.h b/src/collision/shapes/TriangleShape.h index 8ed971e3..a6cb7c7a 100644 --- a/src/collision/shapes/TriangleShape.h +++ b/src/collision/shapes/TriangleShape.h @@ -93,7 +93,8 @@ class TriangleShape : public ConvexShape { // -------------------- Methods -------------------- // /// Constructor - TriangleShape(const Vector3& point1, const Vector3& point2, const Vector3& point3); + TriangleShape(const Vector3& point1, const Vector3& point2, const Vector3& point3, + decimal margin = OBJECT_MARGIN); /// Destructor virtual ~TriangleShape();