Class BodyVector

Class Documentation

class BodyVector

A vector of Body objects.

Public Functions

BodyVector()
BodyVector(const std::vector<shapes::Shape*> &shapes, const EigenSTL::vector_Isometry3d &poses, double padding = 0.0)

Construct a body vector from a vector of shapes, a vector of poses and a padding.

~BodyVector()
void addBody(Body *body)

Add a body.

void addBody(const shapes::Shape *shape, const Eigen::Isometry3d &pose, double padding = 0.0)

Add a body from a shape, a pose for the body and a padding.

void clear()

Clear all bodies from the vector.

void setPose(unsigned int i, const Eigen::Isometry3d &pose)

Set the pose of a particular body in the vector of bodies.

std::size_t getCount() const

Get the number of bodies in this vector.

bool containsPoint(const Eigen::Vector3d &p, bool verbose = false) const

Check if any body in the vector contains the input point.

bool containsPoint(const Eigen::Vector3d &p, std::size_t &index, bool verbose = false) const

Check if any body contains the input point, and report the first body’s index if so.

bool intersectsRay(const Eigen::Vector3d &origin, const Eigen::Vector3d &dir, std::size_t &index, EigenSTL::vector_Vector3d *intersections = nullptr, unsigned int count = 0) const

Check if any of the bodies intersects the ray defined by origin and dir. When the first intersection is found, this function terminates. The index of the body that does intersect the ray is set to index (unset if no intersections were found). Optionally, the intersection points are computed and set to intersections (only for the first body that is found to intersect the ray)

const Body *getBody(unsigned int i) const

Get the i body in the vector.