From 045bd3d515bf3d50bf6922089923e0bda9d9602e Mon Sep 17 00:00:00 2001 From: "chappuis.daniel" Date: Thu, 2 Jul 2009 21:21:19 +0000 Subject: [PATCH] git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@158 92aac97c-a6ce-11dd-a772-7fcde58d38e6 --- .../collision/BroadPhaseAlgorithm.cpp | 34 ++++++++++++++ .../collision/BroadPhaseAlgorithm.h | 46 ++++++++++++++++++ .../collision/NarrowPhaseAlgorithm.cpp | 34 ++++++++++++++ .../collision/NarrowPhaseAlgorithm.h | 47 +++++++++++++++++++ 4 files changed, 161 insertions(+) create mode 100644 sources/reactphysics3d/collision/BroadPhaseAlgorithm.cpp create mode 100644 sources/reactphysics3d/collision/BroadPhaseAlgorithm.h create mode 100644 sources/reactphysics3d/collision/NarrowPhaseAlgorithm.cpp create mode 100644 sources/reactphysics3d/collision/NarrowPhaseAlgorithm.h diff --git a/sources/reactphysics3d/collision/BroadPhaseAlgorithm.cpp b/sources/reactphysics3d/collision/BroadPhaseAlgorithm.cpp new file mode 100644 index 00000000..a6822f84 --- /dev/null +++ b/sources/reactphysics3d/collision/BroadPhaseAlgorithm.cpp @@ -0,0 +1,34 @@ +/**************************************************************************** +* Copyright (C) 2009 Daniel Chappuis * +**************************************************************************** +* This file is part of ReactPhysics3D. * +* * +* ReactPhysics3D is free software: you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as published * +* by the Free Software Foundation, either version 3 of the License, or * +* (at your option) any later version. * +* * +* ReactPhysics3D is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public License * +* along with ReactPhysics3D. If not, see . * +***************************************************************************/ + +// Libraries +#include "BroadPhaseAlgorithm.h" + +// We want to use the ReactPhysics3D namespace +using namespace reactphysics3d; + +// Constructor +BroadPhaseAlgorithm::BroadPhaseAlgorithm() { + +} + +// Destructor +BroadPhaseAlgorithm::~BroadPhaseAlgorithm() { + +} diff --git a/sources/reactphysics3d/collision/BroadPhaseAlgorithm.h b/sources/reactphysics3d/collision/BroadPhaseAlgorithm.h new file mode 100644 index 00000000..bf856bed --- /dev/null +++ b/sources/reactphysics3d/collision/BroadPhaseAlgorithm.h @@ -0,0 +1,46 @@ +/**************************************************************************** +* Copyright (C) 2009 Daniel Chappuis * +**************************************************************************** +* This file is part of ReactPhysics3D. * +* * +* ReactPhysics3D is free software: you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as published * +* by the Free Software Foundation, either version 3 of the License, or * +* (at your option) any later version. * +* * +* ReactPhysics3D is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public License * +* along with ReactPhysics3D. If not, see . * +***************************************************************************/ + +#ifndef BROADPHASEALGORITHM_H +#define BROADPHASEALGORITHM_H + +// 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. + ------------------------------------------------------------------- +*/ +class BroadPhaseAlgorithm { + private : + + 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 +}; + +} // End of reactphysics3d namespace + +#endif + diff --git a/sources/reactphysics3d/collision/NarrowPhaseAlgorithm.cpp b/sources/reactphysics3d/collision/NarrowPhaseAlgorithm.cpp new file mode 100644 index 00000000..cc462920 --- /dev/null +++ b/sources/reactphysics3d/collision/NarrowPhaseAlgorithm.cpp @@ -0,0 +1,34 @@ +/**************************************************************************** +* Copyright (C) 2009 Daniel Chappuis * +**************************************************************************** +* This file is part of ReactPhysics3D. * +* * +* ReactPhysics3D is free software: you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as published * +* by the Free Software Foundation, either version 3 of the License, or * +* (at your option) any later version. * +* * +* ReactPhysics3D is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public License * +* along with ReactPhysics3D. If not, see . * +***************************************************************************/ + +// Libraries +#include "NarrowPhaseAlgorithm.h" + +// We want to use the ReactPhysics3D namespace +using namespace reactphysics3d; + +// Constructor +NarrowPhaseAlgorithm::NarrowPhaseAlgorithm() { + +} + +// Destructor +NarrowPhaseAlgorithm::~NarrowPhaseAlgorithm() { + +} diff --git a/sources/reactphysics3d/collision/NarrowPhaseAlgorithm.h b/sources/reactphysics3d/collision/NarrowPhaseAlgorithm.h new file mode 100644 index 00000000..778fccbd --- /dev/null +++ b/sources/reactphysics3d/collision/NarrowPhaseAlgorithm.h @@ -0,0 +1,47 @@ +/**************************************************************************** +* Copyright (C) 2009 Daniel Chappuis * +**************************************************************************** +* This file is part of ReactPhysics3D. * +* * +* ReactPhysics3D is free software: you can redistribute it and/or modify * +* it under the terms of the GNU Lesser General Public License as published * +* by the Free Software Foundation, either version 3 of the License, or * +* (at your option) any later version. * +* * +* ReactPhysics3D is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU Lesser General Public License for more details. * +* * +* You should have received a copy of the GNU Lesser General Public License * +* along with ReactPhysics3D. If not, see . * +***************************************************************************/ + +#ifndef NARROWPHASEALGORITHM_H +#define NARROWPHASEALGORITHM_H + +// Namespace ReactPhysics3D +namespace reactphysics3d { + +/* ------------------------------------------------------------------- + Class NarrowPhaseAlgorithm : + This class is an abstract class that represents an algorithm + used to perform the narrow phase of a collision detection. The + goal of the narrow phase algorithm is to compute contact + informations of a collision between two bodies. + ------------------------------------------------------------------- +*/ +class NarrowPhaseAlgorithm { + private : + + public : + NarrowPhaseAlgorithm(); // Constructor + virtual ~NarrowPhaseAlgorithm(); // Destructor + virtual bool testCollisionPair(const BoundingVolume& boundingVolume1, const BoundingVolume& boundingVolume2)=0; // Return true is the two bounding volume can collide +}; + +} // End of reactphysics3d namespace + +#endif + +