From 325c80dd4985b72ec2a4eaa9f9ec9b5caff1862d Mon Sep 17 00:00:00 2001 From: "chappuis.daniel" Date: Wed, 23 Dec 2009 10:06:34 +0000 Subject: [PATCH] git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@233 92aac97c-a6ce-11dd-a772-7fcde58d38e6 --- .../collision/NarrowPhaseSATAlgorithm.cpp | 11 ++++++----- .../collision/NarrowPhaseSATAlgorithm.h | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sources/reactphysics3d/collision/NarrowPhaseSATAlgorithm.cpp b/sources/reactphysics3d/collision/NarrowPhaseSATAlgorithm.cpp index fbfdd577..07d052d1 100644 --- a/sources/reactphysics3d/collision/NarrowPhaseSATAlgorithm.cpp +++ b/sources/reactphysics3d/collision/NarrowPhaseSATAlgorithm.cpp @@ -36,6 +36,8 @@ // We want to use the ReactPhysics3D namespace using namespace reactphysics3d; +// TODO : Remove all the std::cout + // TODO : Check and modify all comments on this file in order that //  everything have to do with the new SAT algorithm @@ -279,10 +281,10 @@ bool NarrowPhaseSATAlgorithm::computeCollisionTest(const OBB* const obb1, const //std::cout << "Current -- 1 -- MIN Points : " << currentInterval1.getMinProjectedPoints().size() << " MAX : " << currentInterval1.getMaxProjectedPoints().size() << std::endl; //std::cout << "Current -- 1 -- min : " << currentInterval1.getMin() << std::endl; //std::cout << "Timefirst : " << timeFirst.getValue() << std::endl; - std::cout << "CONTACT FOUND AND TIMEFIRST IS " << timeFirst.getValue() << std::endl; + std::cout << "CONTACT FOUND " << std::endl; - // TODO : The normal has to be unit before passing it to the computeContact() method - computeContact(currentInterval1, currentInterval2, velocity1, velocity2, timeFirst, side, contact); + // Compute the collision contact + computeContact(obb1, obb2, normal.getUnit(), minPenetrationDepth, obb1->getExtremeVertices(normal), obb2->getExtremeVertices(normal.getOpposite()), contact) //std::cout << "Contact 1 : " << contact << std::endl; assert(*contact != 0); @@ -457,8 +459,7 @@ bool NarrowPhaseSATAlgorithm::computeCollisionTest(const OBB* const obb1, const std::cout << "CONTACT FOUND AND TIMEFIRST IS " << timeFirst.getValue() << std::endl; // Compute the collision contact - // TODO : The normal has to be unit before passing it to the computeContact() method - computeContact(obb1, obb2, normal.getUnit(), minPenetrationDepth, obb1->getExtremeVertices(normal), obb2->getExtremeVertices(normal.getOpposite()), Contact** contact) + computeContact(obb1, obb2, normal.getUnit(), minPenetrationDepth, obb1->getExtremeVertices(normal), obb2->getExtremeVertices(normal.getOpposite()), contact) // We have found no separation axis, therefore the two OBBs must collide assert(*contact != 0); diff --git a/sources/reactphysics3d/collision/NarrowPhaseSATAlgorithm.h b/sources/reactphysics3d/collision/NarrowPhaseSATAlgorithm.h index dde70107..2def697c 100644 --- a/sources/reactphysics3d/collision/NarrowPhaseSATAlgorithm.h +++ b/sources/reactphysics3d/collision/NarrowPhaseSATAlgorithm.h @@ -49,6 +49,7 @@ class NarrowPhaseSATAlgorithm : public NarrowPhaseAlgorithm { void computeContact(const OBB* const obb1, const OBB* const obb2, const Vector3D normal, double penetrationDepth, const std::vector& obb1ExtremePoints, const std::vector& obb2ExtremePoints, Contact** contact) const; // Compute a new contact // Compute a new collision contact between two projection intervals Vector3D computeContactNormal(const Vector3D& axis, const Vector3D& distanceOfOBBs) const; // Compute a contact normal + public : NarrowPhaseSATAlgorithm(); // Constructor ~NarrowPhaseSATAlgorithm(); // Destructor