37 #ifndef GEOMETRIC_SHAPES_POINT_INCLUSION_ 38 #define GEOMETRIC_SHAPES_POINT_INCLUSION_ 111 updateInternalData();
124 updateInternalData();
136 useDimensions(shape);
137 updateInternalData();
150 virtual bool intersectsRay(
const tf::Vector3& origin,
const tf::Vector3 &dir, std::vector<tf::Vector3> *intersections = NULL,
unsigned int count = 0)
const = 0;
153 virtual bool containsPoint(
const tf::Vector3 &p,
bool verbose =
false)
const = 0;
157 virtual double computeVolume(
void)
const = 0;
161 virtual void computeBoundingSphere(
BoundingSphere &sphere)
const = 0;
165 virtual void updateInternalData(
void) = 0;
186 setDimensions(shape);
193 virtual bool containsPoint(
const tf::Vector3 &p,
bool verbose=
false)
const;
194 virtual double computeVolume(
void)
const;
196 virtual bool intersectsRay(
const tf::Vector3& origin,
const tf::Vector3 &dir, std::vector<tf::Vector3> *intersections = NULL,
unsigned int count = 0)
const;
201 virtual void updateInternalData(
void);
221 setDimensions(shape);
228 virtual bool containsPoint(
const tf::Vector3 &p,
bool verbose=
false)
const;
229 virtual double computeVolume(
void)
const;
231 virtual bool intersectsRay(
const tf::Vector3& origin,
const tf::Vector3 &dir, std::vector<tf::Vector3> *intersections = NULL,
unsigned int count = 0)
const;
236 virtual void updateInternalData(
void);
266 setDimensions(shape);
273 virtual bool containsPoint(
const tf::Vector3 &p,
bool verbose =
false)
const;
274 virtual double computeVolume(
void)
const;
276 virtual bool intersectsRay(
const tf::Vector3& origin,
const tf::Vector3 &dir, std::vector<tf::Vector3> *intersections = NULL,
unsigned int count = 0)
const;
281 virtual void updateInternalData(
void);
367 setDimensions(shape);
374 virtual bool containsPoint(
const tf::Vector3 &p,
bool verbose =
false)
const;
375 virtual double computeVolume(
void)
const;
378 virtual bool intersectsRay(
const tf::Vector3& origin,
const tf::Vector3 &dir, std::vector<tf::Vector3> *intersections = NULL,
unsigned int count = 0)
const;
383 virtual void updateInternalData(
void);
385 unsigned int countVerticesBehindPlane(
const tf::tfVector4& planeNormal)
const;
386 bool isPointInsidePlanes(
const tf::Vector3& point)
const;
Sphere(const shapes::Shape *shape)
shapes::ShapeType getType(void) const
Get the type of shape this body represents.
const tf::Transform & getPose(void) const
Retrieve the pose of the body.
std::vector< tf::Vector3 > m_vertices
ShapeType
A list of known shape types.
Box(const shapes::Shape *shape)
Definition of a cylinder.
Definition of a sphere that bounds another object.
Definition of a convex mesh. Convex hull is computed for a given shape::Mesh.
Body * createBodyFromShape(const shapes::Shape *shape)
Create a body from a given shape.
void mergeBoundingSpheres(const std::vector< BoundingSphere > &spheres, BoundingSphere &mergedSphere)
Compute a bounding sphere to enclose a set of bounding spheres.
bool containsPoint(double x, double y, double z) const
Check is a point is inside the body.
virtual ~ConvexMesh(void)
double getPadding(void) const
Retrieve the current padding.
A body is a shape + its pose. Point inclusion, ray intersection can be tested, volumes and bounding s...
void setPose(const tf::Transform &pose)
Set the pose of the body. Default is identity.
void setPadding(double padd)
If constant padding should be added to the body, this method sets the padding. Default is 0...
std::vector< unsigned int > m_triangles
void setScale(double scale)
If the dimension of the body should be scaled, this method sets the scale. Default is 1...
std::vector< tf::Vector3 > m_scaledVertices
std::vector< tf::tfVector4 > m_planes
A basic definition of a shape. Shapes are considered centered at origin.
double getScale(void) const
Retrieve the current scale.
Cylinder(const shapes::Shape *shape)
void setDimensions(const shapes::Shape *shape)
Set the dimensions of the body (from corresponding shape)
ConvexMesh(const shapes::Shape *shape)