From b69886fdb35a61acd234e8d618b978dd5660504d Mon Sep 17 00:00:00 2001 From: "chappuis.daniel" Date: Wed, 8 Jul 2009 14:53:39 +0000 Subject: [PATCH] git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@169 92aac97c-a6ce-11dd-a772-7fcde58d38e6 --- .../collision/BroadPhaseAlgorithm.h | 16 +++++++++++----- .../reactphysics3d/collision/SeparatingAxis.cpp | 5 +++-- .../reactphysics3d/collision/SeparatingAxis.h | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) 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