Definition of a cylinder. More...
#include <bodies.h>
Public Member Functions | |
virtual BodyPtr | cloneAt (const Eigen::Affine3d &pose, double padding, double scale) const |
Get a clone of this body, but one that is located at the pose pose and has possibly different passing and scaling: padding and scaling. This function is useful to implement thread safety, when bodies need to be moved around. | |
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 () const |
Compute the volume of the body. This method includes changes induced by scaling and padding. | |
virtual bool | containsPoint (const Eigen::Vector3d &p, bool verbose=false) const |
Check if a point is inside the body. | |
Cylinder () | |
Cylinder (const shapes::Shape *shape) | |
virtual std::vector< double > | getDimensions () const |
Get the radius & length of the cylinder. | |
virtual bool | intersectsRay (const Eigen::Vector3d &origin, const Eigen::Vector3d &dir, EigenSTL::vector_Vector3d *intersections=NULL, unsigned int count=0) const |
Check if 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 bool | samplePointInside (random_numbers::RandomNumberGenerator &rng, unsigned int max_attempts, Eigen::Vector3d &result) |
Sample a point that is included in the body using a given random number generator. Sometimes multiple attempts need to be generated; the function terminates with failure (returns false) after max_attempts attempts. If the call is successful (returns true) the point is written to result. | |
virtual | ~Cylinder () |
Protected Member Functions | |
virtual void | updateInternalData () |
This function is called every time a change to the body is made, so that intermediate values stored for efficiency reasons are kept up to date. | |
virtual void | useDimensions (const shapes::Shape *shape) |
Depending on the shape, this function copies the relevant data to the body. | |
Protected Attributes | |
Eigen::Vector3d | center_ |
double | d1_ |
double | d2_ |
double | length2_ |
double | length_ |
Eigen::Vector3d | normalB1_ |
Eigen::Vector3d | normalB2_ |
Eigen::Vector3d | normalH_ |
double | radius2_ |
double | radius_ |
double | radiusB_ |
double | radiusBSqr_ |
double | radiusU_ |
bodies::Cylinder::Cylinder | ( | ) | [inline] |
bodies::Cylinder::Cylinder | ( | const shapes::Shape * | shape | ) | [inline] |
virtual bodies::Cylinder::~Cylinder | ( | ) | [inline, virtual] |
boost::shared_ptr< bodies::Body > bodies::Cylinder::cloneAt | ( | const Eigen::Affine3d & | pose, |
double | padding, | ||
double | scaling | ||
) | const [virtual] |
Get a clone of this body, but one that is located at the pose pose and has possibly different passing and scaling: padding and scaling. This function is useful to implement thread safety, when bodies need to be moved around.
Implements bodies::Body.
Definition at line 326 of file bodies.cpp.
void bodies::Cylinder::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 349 of file bodies.cpp.
void bodies::Cylinder::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 343 of file bodies.cpp.
double bodies::Cylinder::computeVolume | ( | ) | const [virtual] |
Compute the volume of the body. This method includes changes induced by scaling and padding.
Implements bodies::Body.
Definition at line 338 of file bodies.cpp.
bool bodies::Cylinder::containsPoint | ( | const Eigen::Vector3d & | p, |
bool | verbose = false |
||
) | const [virtual] |
Check if a point is inside the body.
Implements bodies::Body.
Definition at line 258 of file bodies.cpp.
std::vector< double > bodies::Cylinder::getDimensions | ( | ) | const [virtual] |
Get the radius & length of the cylinder.
Implements bodies::Body.
Definition at line 284 of file bodies.cpp.
bool bodies::Cylinder::intersectsRay | ( | const Eigen::Vector3d & | origin, |
const Eigen::Vector3d & | dir, | ||
EigenSTL::vector_Vector3d * | intersections = NULL , |
||
unsigned int | count = 0 |
||
) | const [virtual] |
Check if 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 356 of file bodies.cpp.
bool bodies::Cylinder::samplePointInside | ( | random_numbers::RandomNumberGenerator & | rng, |
unsigned int | max_attempts, | ||
Eigen::Vector3d & | result | ||
) | [virtual] |
Sample a point that is included in the body using a given random number generator. Sometimes multiple attempts need to be generated; the function terminates with failure (returns false) after max_attempts attempts. If the call is successful (returns true) the point is written to result.
Reimplemented from bodies::Body.
Definition at line 311 of file bodies.cpp.
void bodies::Cylinder::updateInternalData | ( | ) | [protected, virtual] |
This function is called every time a change to the body is made, so that intermediate values stored for efficiency reasons are kept up to date.
Implements bodies::Body.
Definition at line 292 of file bodies.cpp.
void bodies::Cylinder::useDimensions | ( | const shapes::Shape * | shape | ) | [protected, virtual] |
Depending on the shape, this function copies the relevant data to the body.
Implements bodies::Body.
Definition at line 278 of file bodies.cpp.
Eigen::Vector3d bodies::Cylinder::center_ [protected] |
double bodies::Cylinder::d1_ [protected] |
double bodies::Cylinder::d2_ [protected] |
double bodies::Cylinder::length2_ [protected] |
double bodies::Cylinder::length_ [protected] |
Eigen::Vector3d bodies::Cylinder::normalB1_ [protected] |
Eigen::Vector3d bodies::Cylinder::normalB2_ [protected] |
Eigen::Vector3d bodies::Cylinder::normalH_ [protected] |
double bodies::Cylinder::radius2_ [protected] |
double bodies::Cylinder::radius_ [protected] |
double bodies::Cylinder::radiusB_ [protected] |
double bodies::Cylinder::radiusBSqr_ [protected] |
double bodies::Cylinder::radiusU_ [protected] |