diff --git a/sources/reactphysics3d/constraint/Contact.cpp b/sources/reactphysics3d/constraint/Contact.cpp index 70a80979..c504962d 100644 --- a/sources/reactphysics3d/constraint/Contact.cpp +++ b/sources/reactphysics3d/constraint/Contact.cpp @@ -19,6 +19,8 @@ // Libraries #include "Contact.h" +#include // TODO : Remove this in the final version +#include // TODO : Remove this in the final version // We want to use the ReactPhysics3D namespace using namespace reactphysics3d; @@ -33,3 +35,9 @@ Contact::Contact(Body* const body1, Body* const body2, const Vector3D& normal, d Contact::~Contact() { } + +// TODO : Delete this (Used to debug collision detection) +void Contact::draw() const { + glColor3f(1.0, 0.0, 0.0); + glutSolidSphere(0.5, 20, 20); +} diff --git a/sources/reactphysics3d/constraint/Contact.h b/sources/reactphysics3d/constraint/Contact.h index 8fb90f50..c6de5569 100644 --- a/sources/reactphysics3d/constraint/Contact.h +++ b/sources/reactphysics3d/constraint/Contact.h @@ -47,6 +47,9 @@ class Contact : public Constraint { virtual ~Contact(); // Destructor Vector3D getNormal() const; // Return the normal vector of the contact + std::vector getPoints() const; // Return the contact points + + void draw() const; // TODO : Delete this (Used to debug collision detection) }; // Return the normal vector of the contact @@ -54,6 +57,12 @@ inline Vector3D Contact::getNormal() const { return normal; } +// Return the contact points +inline std::vector Contact::getPoints() const { + return points; +} + + } // End of the ReactPhysics3D namespace #endif