From 29bf51a0c46157bea68cfed8851c627728c29c22 Mon Sep 17 00:00:00 2001 From: "chappuis.daniel" Date: Sun, 22 Nov 2009 13:46:23 +0000 Subject: [PATCH] git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@216 92aac97c-a6ce-11dd-a772-7fcde58d38e6 --- sources/reactphysics3d/body/BoundingVolume.cpp | 2 +- sources/reactphysics3d/body/BoundingVolume.h | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sources/reactphysics3d/body/BoundingVolume.cpp b/sources/reactphysics3d/body/BoundingVolume.cpp index cd43b915..33b5ff1e 100644 --- a/sources/reactphysics3d/body/BoundingVolume.cpp +++ b/sources/reactphysics3d/body/BoundingVolume.cpp @@ -25,7 +25,7 @@ using namespace reactphysics3d; // Constructor BoundingVolume::BoundingVolume() { - + this->body = 0; } // Destructor diff --git a/sources/reactphysics3d/body/BoundingVolume.h b/sources/reactphysics3d/body/BoundingVolume.h index c42a1f25..317a8403 100644 --- a/sources/reactphysics3d/body/BoundingVolume.h +++ b/sources/reactphysics3d/body/BoundingVolume.h @@ -23,6 +23,7 @@ // Libraries #include "../mathematics/mathematics.h" #include "Body.h" +#include // ReactPhysics3D namespace namespace reactphysics3d { @@ -35,22 +36,24 @@ namespace reactphysics3d { ------------------------------------------------------------------- */ class BoundingVolume { - private : - Body* body; // Pointer to the body + protected : + Body* body; // Pointer to the body public : - BoundingVolume(); // Constructor - virtual ~BoundingVolume(); // Destructor + BoundingVolume(); // Constructor + virtual ~BoundingVolume(); // Destructor Body* getBodyPointer() const; // Return the body pointer void setBodyPointer(Body* body); // Set the body pointer - virtual void updateOrientation(const Vector3D& newCenter, const Quaternion& rotationQuaternion)=0; // Update the orientation of the bounding volume according to the new orientation of the body - virtual void draw() const =0; // Display the bounding volume (only for testing purpose) + virtual void updateOrientation(const Vector3D& newCenter, const Quaternion& rotationQuaternion)=0; // Update the orientation of the bounding volume according to the new orientation of the body + virtual int getExtremeVertices(const Vector3D projectionAxis, std::vector& extremeVertices) const=0; // Return all the vertices that are projected at the extreme of the projection of the bouding volume on the axis + virtual void draw() const=0; // Display the bounding volume (only for testing purpose) }; // Return the body pointer inline Body* BoundingVolume::getBodyPointer() const { + assert(body != 0); return body; }