git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@273 92aac97c-a6ce-11dd-a772-7fcde58d38e6

This commit is contained in:
chappuis.daniel 2010-02-08 19:06:27 +00:00
parent 7ffeeaf003
commit 1fb0912ed2
2 changed files with 3 additions and 4 deletions

View File

@ -24,7 +24,6 @@
#include <GL/gl.h> // TODO : Remove this in the final version #include <GL/gl.h> // TODO : Remove this in the final version
#include <cassert> #include <cassert>
#include <cstdlib> #include <cstdlib>
#include <iostream> // TODO : Delete this
// We want to use the ReactPhysics3D namespace // We want to use the ReactPhysics3D namespace
using namespace reactphysics3d; using namespace reactphysics3d;
@ -116,7 +115,7 @@ void OBB::draw() const {
} }
// Return all the vertices that are projected at the extreme of the projection of the bouding volume on the axis. // Return all the vertices that are projected at the extreme of the projection of the bouding volume on the axis.
// Be careful when this method returns vertices of a polygonal face because vertices are not necessarly ordered. // If the extreme vertices are part of a face of the OBB, the returned vertices will be ordered according to the face.
std::vector<Vector3D> OBB::getExtremeVertices(const Vector3D& directionAxis) const { std::vector<Vector3D> OBB::getExtremeVertices(const Vector3D& directionAxis) const {
assert(directionAxis.length() != 0); assert(directionAxis.length() != 0);
@ -180,7 +179,7 @@ std::vector<Vector3D> OBB::getExtremeVertices(const Vector3D& directionAxis) con
// Return the 4 vertices of a face of the OBB. The 4 vertices will be ordered. The convention is that the index 0 corresponds to // Return the 4 vertices of a face of the OBB. The 4 vertices will be ordered. The convention is that the index 0 corresponds to
// the face in the direction of the axis[0], 1 corresponds to the face in the opposite direction of the axis[0], 2 corresponds to // the face in the direction of the axis[0], 1 corresponds to the face in the opposite direction of the axis[0], 2 corresponds to
// the face in the direction of the axis[1], etc. // the face in the direction of the axis[1], etc.
std::vector<Vector3D> OBB::getFace(int index) const throw(std::invalid_argument) { std::vector<Vector3D> OBB::getFace(unsigned int index) const throw(std::invalid_argument) {
// Check the argument // Check the argument
if (index >=0 && index <6) { if (index >=0 && index <6) {
std::vector<Vector3D> vertices; std::vector<Vector3D> vertices;

View File

@ -54,7 +54,7 @@ class OBB : public BoundingVolume {
Vector3D getAxis(unsigned int index) const throw(std::invalid_argument); // Return an axis of the OBB Vector3D getAxis(unsigned int index) const throw(std::invalid_argument); // Return an axis of the OBB
void setAxis(unsigned int index, const Vector3D& axis) throw(std::invalid_argument); // Set an axis void setAxis(unsigned int index, const Vector3D& axis) throw(std::invalid_argument); // Set an axis
Vector3D getVertex(unsigned int index) const throw (std::invalid_argument); // Return a vertex of the OBB Vector3D getVertex(unsigned int index) const throw (std::invalid_argument); // Return a vertex of the OBB
std::vector<Vector3D> getFace(int index) const throw(std::invalid_argument); // Return the 4 vertices the OBB's face in the direction of a given axis std::vector<Vector3D> getFace(unsigned int index) const throw(std::invalid_argument); // Return the 4 vertices the OBB's face in the direction of a given axis
double getExtent(unsigned int index) const throw(std::invalid_argument); // Return an extent value double getExtent(unsigned int index) const throw(std::invalid_argument); // Return an extent value
void setExtent(unsigned int index, double extent) throw(std::invalid_argument); // Set an extent value void setExtent(unsigned int index, double extent) throw(std::invalid_argument); // Set an extent value
virtual std::vector<Vector3D> getExtremeVertices(const Vector3D& axis) const; // Return all the vertices that are projected at the extreme of the projection of the bouding volume on the axis virtual std::vector<Vector3D> getExtremeVertices(const Vector3D& axis) const; // Return all the vertices that are projected at the extreme of the projection of the bouding volume on the axis