37 #ifndef GEOMETRIC_SHAPES_POINT_INCLUSION_ 38 #define GEOMETRIC_SHAPES_POINT_INCLUSION_ 110 updateInternalData();
123 updateInternalData();
135 useDimensions(shape);
136 updateInternalData();
149 virtual bool intersectsRay(
const tf::Vector3& origin,
const tf::Vector3 &dir, std::vector<tf::Vector3> *intersections = NULL,
unsigned int count = 0)
const = 0;
152 virtual bool containsPoint(
const tf::Vector3 &p,
bool verbose =
false)
const = 0;
156 virtual double computeVolume(
void)
const = 0;
160 virtual void computeBoundingSphere(
BoundingSphere &sphere)
const = 0;
164 virtual void updateInternalData(
void) = 0;
185 setDimensions(shape);
192 virtual bool containsPoint(
const tf::Vector3 &p,
bool verbose=
false)
const;
193 virtual double computeVolume(
void)
const;
195 virtual bool intersectsRay(
const tf::Vector3& origin,
const tf::Vector3 &dir, std::vector<tf::Vector3> *intersections = NULL,
unsigned int count = 0)
const;
200 virtual void updateInternalData(
void);
220 setDimensions(shape);
227 virtual bool containsPoint(
const tf::Vector3 &p,
bool verbose=
false)
const;
228 virtual double computeVolume(
void)
const;
230 virtual bool intersectsRay(
const tf::Vector3& origin,
const tf::Vector3 &dir, std::vector<tf::Vector3> *intersections = NULL,
unsigned int count = 0)
const;
235 virtual void updateInternalData(
void);
265 setDimensions(shape);
272 virtual bool containsPoint(
const tf::Vector3 &p,
bool verbose =
false)
const;
273 virtual double computeVolume(
void)
const;
275 virtual bool intersectsRay(
const tf::Vector3& origin,
const tf::Vector3 &dir, std::vector<tf::Vector3> *intersections = NULL,
unsigned int count = 0)
const;
280 virtual void updateInternalData(
void);
366 setDimensions(shape);
373 virtual bool containsPoint(
const tf::Vector3 &p,
bool verbose =
false)
const;
374 virtual double computeVolume(
void)
const;
377 virtual bool intersectsRay(
const tf::Vector3& origin,
const tf::Vector3 &dir, std::vector<tf::Vector3> *intersections = NULL,
unsigned int count = 0)
const;
382 virtual void updateInternalData(
void);
384 unsigned int countVerticesBehindPlane(
const tf::tfVector4& planeNormal)
const;
385 bool isPointInsidePlanes(
const tf::Vector3& point)
const;
double getScale(void) const
Retrieve the current scale.
shapes::ShapeType getType(void) const
Get the type of shape this body represents.
Definition of a cylinder.
virtual ~ConvexMesh(void)
Box(const shapes::Shape *shape)
void setScale(double scale)
If the dimension of the body should be scaled, this method sets the scale. Default is 1...
void setPose(const tf::Transform &pose)
Set the pose of the body. Default is identity.
Definition of a sphere that bounds another object.
std::vector< tf::tfVector4 > m_planes
void mergeBoundingSpheres(const std::vector< BoundingSphere > &spheres, BoundingSphere &mergedSphere)
Compute a bounding sphere to enclose a set of bounding spheres.
A basic definition of a shape. Shapes are considered centered at origin.
Definition of a convex mesh. Convex hull is computed for a given shape::Mesh.
double getPadding(void) const
Retrieve the current padding.
Body * createBodyFromShape(const shapes::Shape *shape)
Create a body from a given shape.
ShapeType
A list of known shape types.
bool containsPoint(double x, double y, double z) const
Check is a point is inside the body.
std::vector< unsigned int > m_triangles
Cylinder(const shapes::Shape *shape)
ConvexMesh(const shapes::Shape *shape)
void setDimensions(const shapes::Shape *shape)
Set the dimensions of the body (from corresponding shape)
Sphere(const shapes::Shape *shape)
const tf::Transform & getPose(void) const
Retrieve the pose of the body.
A body is a shape + its pose. Point inclusion, ray intersection can be tested, volumes and bounding s...
void setPadding(double padd)
If constant padding should be added to the body, this method sets the padding. Default is 0...
std::vector< tf::Vector3 > m_scaledVertices
std::vector< tf::Vector3 > m_vertices