git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@229 92aac97c-a6ce-11dd-a772-7fcde58d38e6
This commit is contained in:
parent
d0c95a9f1f
commit
8c92896ad8
|
@ -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.
|
// 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 {
|
std::vector<Vector3D> OBB::getExtremeVertices(const Vector3D axis) const {
|
||||||
assert(axis.length() != 0);
|
assert(axis.length() != 0);
|
||||||
|
|
||||||
|
@ -163,3 +164,13 @@ std::vector<Vector3D> OBB::getExtremeVertices(const Vector3D axis) const {
|
||||||
// Return the extreme vertices
|
// Return the extreme vertices
|
||||||
return extremeVertices;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
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
|
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
|
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
|
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
|
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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user