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

This commit is contained in:
chappuis.daniel 2009-12-21 22:57:36 +00:00
parent d0c95a9f1f
commit 8c92896ad8
3 changed files with 13 additions and 1 deletions

View File

@ -48,7 +48,7 @@ class BoundingVolume {
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<Vector3D>& 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)
virtual void draw() const=0; // Display the bounding volume (only for testing purpose)
};
// Return the body pointer

View File

@ -133,6 +133,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.
// Be careful when this method returns vertices of a polygonal face because vertices are not necessarly ordered.
std::vector<Vector3D> OBB::getExtremeVertices(const Vector3D axis) const {
assert(axis.length() != 0);
@ -163,3 +164,13 @@ std::vector<Vector3D> OBB::getExtremeVertices(const Vector3D axis) const {
// Return the extreme vertices
return extremeVertices;
}
// Return the 4 vertices the OBB's face in the direction of a given axis.
// This method returns the set of vertices of the face (vertices are ordered).
std::vector<Vector3D> OBB::getFace(Vector3D& axis) const {
std::vector<Vector3D> face;
assert(face.size() == 4);
return face;
}

View File

@ -55,6 +55,7 @@ class OBB : public BoundingVolume {
Vector3D getAxis(unsigned int index) const throw(std::invalid_argument) const; // Return an axis of the OBB
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) const; // Return a vertex of the OBB
std::vector<Vector3D> getFace(Vector3D& axis) const; // 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) const; // Return 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