From 4362033018358571b4db27759f3211bff9608841 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Wed, 16 Dec 2015 18:39:13 +0100 Subject: [PATCH] Add object margin to TriangleShape --- src/collision/shapes/TriangleShape.cpp | 4 ++-- src/collision/shapes/TriangleShape.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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();