diff --git a/sources/reactphysics3d/collision/BroadPhaseAlgorithm.h b/sources/reactphysics3d/collision/BroadPhaseAlgorithm.h index 074b85de..d13b8c94 100644 --- a/sources/reactphysics3d/collision/BroadPhaseAlgorithm.h +++ b/sources/reactphysics3d/collision/BroadPhaseAlgorithm.h @@ -26,13 +26,18 @@ // Namespace ReactPhysics3D namespace reactphysics3d { -/* ------------------------------------------------------------------- +/* -------------------------------------------------------------------- Class BroadPhaseAlgorithm : This class is an abstract class that represents an algorithm - used to perform the broad phase of a collision detection. The - goal of the broad phase algorithm is to compute the bodies that - can collide. - ------------------------------------------------------------------- + used to perform the broad-phase of a collision detection. The + goal of the broad-phase algorithm is to compute the bodies that + can collide. But it's important to understand that the + broad-phase doesn't compute only body pairs that can collide but + also pairs of body that doesn't collide but are very close. The + goal of the broad-phase is to remove pairs of body that cannot + collide in order to avoid to much bodies to be tested in the + narrow-phase. + -------------------------------------------------------------------- */ class BroadPhaseAlgorithm { private : @@ -40,6 +45,7 @@ class BroadPhaseAlgorithm { public : BroadPhaseAlgorithm(); // Constructor virtual ~BroadPhaseAlgorithm(); // Destructor + virtual bool testCollisionPair(const BoundingVolume& boundingVolume1, const BoundingVolume& boundingVolume2)=0; // Return true is the two bounding volume can collide }; diff --git a/sources/reactphysics3d/collision/SeparatingAxis.cpp b/sources/reactphysics3d/collision/SeparatingAxis.cpp index 3651d196..4bb528b2 100644 --- a/sources/reactphysics3d/collision/SeparatingAxis.cpp +++ b/sources/reactphysics3d/collision/SeparatingAxis.cpp @@ -33,7 +33,8 @@ SeparatingAxis::~SeparatingAxis() { } -// Return true and compute a collision contact if the two bounding volume collide +// Return true and compute a collision contact if the two bounding volume collide. +// The method returns false if there is no collision between the two bounding volumes. bool SeparatingAxis::testCollision(const BoundingVolume& boundingVolume1, const BoundingVolume& boundingVolume2, Contact* const contact) { - + // TODO : Implement this method } diff --git a/sources/reactphysics3d/collision/SeparatingAxis.h b/sources/reactphysics3d/collision/SeparatingAxis.h index a03534d9..d843d781 100644 --- a/sources/reactphysics3d/collision/SeparatingAxis.h +++ b/sources/reactphysics3d/collision/SeparatingAxis.h @@ -22,7 +22,7 @@ // Libraries #include "NarrowPhaseAlgorithm.h" -#include "../Constraint/Contact.h" +#include "../constraint/Contact.h" #include "../body/OBB.h" // ReactPhysics3D namespace