Definition of a convex mesh. Convex hull is computed for a given shape::Mesh. More...
#include <bodies.h>
Public Member Functions | |
virtual void | computeBoundingCylinder (BoundingCylinder &cylinder) const |
Compute the bounding cylinder for the body, in its current pose. Scaling and padding are accounted for. | |
virtual void | computeBoundingSphere (BoundingSphere &sphere) const |
Compute the bounding radius for the body, in its current pose. Scaling and padding are accounted for. | |
virtual double | computeVolume (void) const |
Compute the volume of the body. This method includes changes induced by scaling and padding. | |
virtual bool | containsPoint (const tf::Vector3 &p, bool verbose=false) const |
Check is a point is inside the body. | |
ConvexMesh (void) | |
ConvexMesh (const shapes::Shape *shape) | |
const std::vector< tf::Vector3 > & | getScaledVertices () const |
const std::vector< unsigned int > & | getTriangles () const |
const std::vector< tf::Vector3 > & | getVertices () const |
virtual bool | intersectsRay (const tf::Vector3 &origin, const tf::Vector3 &dir, std::vector< tf::Vector3 > *intersections=NULL, unsigned int count=0) const |
Check is a ray intersects the body, and find the set of intersections, in order, along the ray. A maximum number of intersections can be specified as well. If that number is 0, all intersections are returned. | |
virtual | ~ConvexMesh (void) |
Protected Member Functions | |
unsigned int | countVerticesBehindPlane (const tf::tfVector4 &planeNormal) const |
bool | isPointInsidePlanes (const tf::Vector3 &point) const |
virtual void | updateInternalData (void) |
virtual void | useDimensions (const shapes::Shape *shape) |
Protected Attributes | |
Box | m_boundingBox |
BoundingCylinder | m_boundingCylinder |
tf::Vector3 | m_boxOffset |
tf::Vector3 | m_center |
tf::Transform | m_iPose |
tf::Vector3 | m_meshCenter |
double | m_meshRadiusB |
std::vector< tf::tfVector4 > | m_planes |
double | m_radiusB |
double | m_radiusBSqr |
std::vector< tf::Vector3 > | m_scaledVertices |
std::vector< unsigned int > | m_triangles |
std::vector< tf::Vector3 > | m_vertices |
Definition of a convex mesh. Convex hull is computed for a given shape::Mesh.
bodies::ConvexMesh::ConvexMesh | ( | void | ) | [inline] |
bodies::ConvexMesh::ConvexMesh | ( | const shapes::Shape * | shape | ) | [inline] |
virtual bodies::ConvexMesh::~ConvexMesh | ( | void | ) | [inline, virtual] |
void bodies::ConvexMesh::computeBoundingCylinder | ( | BoundingCylinder & | cylinder | ) | const [virtual] |
Compute the bounding cylinder for the body, in its current pose. Scaling and padding are accounted for.
Implements bodies::Body.
Definition at line 1049 of file bodies.cpp.
void bodies::ConvexMesh::computeBoundingSphere | ( | BoundingSphere & | sphere | ) | const [virtual] |
Compute the bounding radius for the body, in its current pose. Scaling and padding are accounted for.
Implements bodies::Body.
Definition at line 1043 of file bodies.cpp.
double bodies::ConvexMesh::computeVolume | ( | void | ) | const [virtual] |
Compute the volume of the body. This method includes changes induced by scaling and padding.
Implements bodies::Body.
Definition at line 1085 of file bodies.cpp.
bool bodies::ConvexMesh::containsPoint | ( | const tf::Vector3 & | p, |
bool | verbose = false |
||
) | const [virtual] |
Check is a point is inside the body.
Implements bodies::Body.
Definition at line 772 of file bodies.cpp.
unsigned int bodies::ConvexMesh::countVerticesBehindPlane | ( | const tf::tfVector4 & | planeNormal | ) | const [protected] |
Definition at line 1072 of file bodies.cpp.
const std::vector<tf::Vector3>& bodies::ConvexMesh::getScaledVertices | ( | ) | const [inline] |
const std::vector<unsigned int>& bodies::ConvexMesh::getTriangles | ( | ) | const [inline] |
const std::vector<tf::Vector3>& bodies::ConvexMesh::getVertices | ( | ) | const [inline] |
bool bodies::ConvexMesh::intersectsRay | ( | const tf::Vector3 & | origin, |
const tf::Vector3 & | dir, | ||
std::vector< tf::Vector3 > * | intersections = NULL , |
||
unsigned int | count = 0 |
||
) | const [virtual] |
Check is a ray intersects the body, and find the set of intersections, in order, along the ray. A maximum number of intersections can be specified as well. If that number is 0, all intersections are returned.
Implements bodies::Body.
Definition at line 1098 of file bodies.cpp.
bool bodies::ConvexMesh::isPointInsidePlanes | ( | const tf::Vector3 & | point | ) | const [protected] |
Definition at line 1059 of file bodies.cpp.
void bodies::ConvexMesh::updateInternalData | ( | void | ) | [protected, virtual] |
Implements bodies::Body.
Definition at line 1021 of file bodies.cpp.
void bodies::ConvexMesh::useDimensions | ( | const shapes::Shape * | shape | ) | [protected, virtual] |
Implements bodies::Body.
Definition at line 784 of file bodies.cpp.
Box bodies::ConvexMesh::m_boundingBox [protected] |
tf::Vector3 bodies::ConvexMesh::m_boxOffset [protected] |
tf::Vector3 bodies::ConvexMesh::m_center [protected] |
tf::Transform bodies::ConvexMesh::m_iPose [protected] |
tf::Vector3 bodies::ConvexMesh::m_meshCenter [protected] |
double bodies::ConvexMesh::m_meshRadiusB [protected] |
std::vector<tf::tfVector4> bodies::ConvexMesh::m_planes [protected] |
double bodies::ConvexMesh::m_radiusB [protected] |
double bodies::ConvexMesh::m_radiusBSqr [protected] |
std::vector<tf::Vector3> bodies::ConvexMesh::m_scaledVertices [protected] |
std::vector<unsigned int> bodies::ConvexMesh::m_triangles [protected] |
std::vector<tf::Vector3> bodies::ConvexMesh::m_vertices [protected] |