Go to the documentation of this file.
3 #include <console_bridge/console.h>
25 double min_distance = t1;
31 const Shape& shape = *it->first;
36 if (shape.
intersect(r_t, t0, min_distance, d)) {
43 distance = min_distance;
57 if ((it->first)->intersect(p_t, radius)) {
71 const Shape& shape = *it->first;
124 std::string msg =
"CompositeShape::setMesh: can not set mesh for CompositeShape";
125 CONSOLE_BRIDGE_logError(msg.
c_str());
virtual bool intersect(const Ray &r, float t0, float t1, double &distance) const
intersect: currently always throws a logic error
bool contains(const Vector3 &p) const
Determines whether a point p lies within the shape.
CompositeShape * clone() const
std::shared_ptr< Shape > ShapePtr
const Vector3 & getOrigin() const
void add(const Mesh &mesh)
void addShape(const Shape &shape, const Pose3D &pose)
add a shape to the composite
virtual const Mesh & getMesh() const
return the mesh defining the shape
Box getBoundingBox() const
Returns the smallest box which includes all mesh points. Box is not rotated, but matches the axis of ...
bool intersect(const Ray &r, float t0, float t1, double &distance) const
intersect: currently always throws a logic error
Mesh getTransformed(const geo::Transform t) const
const std::vector< Triangle > & getTriangles() const
virtual ~CompositeShape()
bool intersect(const Ray &r, float t0, float t1, double &distance) const
intersect: currently always throws a logic error
double getMaxRadius() const
Calculate the maximum distance from the origin of the shape to any point of the shape.
void setMesh(const Mesh &mesh)
set the Mesh Any child classes should throw a std::logic_error in case the mesh should not be changed...
A geometric description of a shape as a union of other shapes.
virtual bool contains(const Vector3 &p) const
Determines whether a point p lies within the shape.
const Vector3 & getDirection() const
const std::vector< std::pair< ShapePtr, Transform > > & getShapes() const
Get all the child shapes and their inverse pose relative to the "origin" of the CompositeShape.
bool contains(const Vector3 &p) const
Determines whether a point p lies within the shape.
std::vector< std::pair< ShapePtr, Transform > > shapes_
Mesh mesh_
Should not be read or written to directly in general. Use setMesh and getMesh to write respectively r...
A geometric description of a shape.
virtual Shape * clone() const