bodies::Body Class Reference

A body is a shape + its pose. Point inclusion, ray intersection can be tested, volumes and bounding spheres can be computed. More...

#include <bodies.h>

Inheritance diagram for bodies::Body:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Body (void)
virtual void computeBoundingCylinder (BoundingCylinder &cylinder) const =0
 Compute the bounding cylinder for the body, in its current pose. Scaling and padding are accounted for.
virtual void computeBoundingSphere (BoundingSphere &sphere) const =0
 Compute the bounding radius for the body, in its current pose. Scaling and padding are accounted for.
virtual double computeVolume (void) const =0
 Compute the volume of the body. This method includes changes induced by scaling and padding.
virtual bool containsPoint (const btVector3 &p, bool verbose=false) const =0
 Check is a point is inside the body.
bool containsPoint (double x, double y, double z) const
 Check is a point is inside the body.
double getPadding (void) const
 Retrieve the current padding.
const btTransform & getPose (void) const
 Retrieve the pose of the body.
double getScale (void) const
 Retrieve the current scale.
shapes::ShapeType getType (void) const
 Get the type of shape this body represents.
virtual bool intersectsRay (const btVector3 &origin, const btVector3 &dir, std::vector< btVector3 > *intersections=NULL, unsigned int count=0) const =0
 Check is 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.
void setDimensions (const shapes::Shape *shape)
 Set the dimensions of the body (from corresponding shape).
void setPadding (double padd)
 If constant padding should be added to the body, this method sets the padding. Default is 0.0.
void setPose (const btTransform &pose)
 Set the pose of the body. Default is identity.
void setScale (double scale)
 If the dimension of the body should be scaled, this method sets the scale. Default is 1.0.
virtual ~Body (void)

Protected Member Functions

virtual void updateInternalData (void)=0
virtual void useDimensions (const shapes::Shape *shape)=0

Protected Attributes

double m_padding
btTransform m_pose
double m_scale
shapes::ShapeType m_type

Detailed Description

A body is a shape + its pose. Point inclusion, ray intersection can be tested, volumes and bounding spheres can be computed.

Definition at line 62 of file bodies.h.


Constructor & Destructor Documentation

bodies::Body::Body ( void   )  [inline]

Definition at line 66 of file bodies.h.

virtual bodies::Body::~Body ( void   )  [inline, virtual]

Definition at line 74 of file bodies.h.


Member Function Documentation

virtual void bodies::Body::computeBoundingCylinder ( BoundingCylinder cylinder  )  const [pure virtual]

Compute the bounding cylinder for the body, in its current pose. Scaling and padding are accounted for.

Implemented in bodies::Sphere, bodies::Cylinder, bodies::Box, and bodies::ConvexMesh.

virtual void bodies::Body::computeBoundingSphere ( BoundingSphere sphere  )  const [pure virtual]

Compute the bounding radius for the body, in its current pose. Scaling and padding are accounted for.

Implemented in bodies::Sphere, bodies::Cylinder, bodies::Box, and bodies::ConvexMesh.

virtual double bodies::Body::computeVolume ( void   )  const [pure virtual]

Compute the volume of the body. This method includes changes induced by scaling and padding.

Implemented in bodies::Sphere, bodies::Cylinder, bodies::Box, and bodies::ConvexMesh.

virtual bool bodies::Body::containsPoint ( const btVector3 &  p,
bool  verbose = false 
) const [pure virtual]

Check is a point is inside the body.

Implemented in bodies::Sphere, bodies::Cylinder, bodies::Box, and bodies::ConvexMesh.

bool bodies::Body::containsPoint ( double  x,
double  y,
double  z 
) const [inline]

Check is a point is inside the body.

Definition at line 133 of file bodies.h.

double bodies::Body::getPadding ( void   )  const [inline]

Retrieve the current padding.

Definition at line 107 of file bodies.h.

const btTransform& bodies::Body::getPose ( void   )  const [inline]

Retrieve the pose of the body.

Definition at line 120 of file bodies.h.

double bodies::Body::getScale ( void   )  const [inline]

Retrieve the current scale.

Definition at line 93 of file bodies.h.

shapes::ShapeType bodies::Body::getType ( void   )  const [inline]

Get the type of shape this body represents.

Definition at line 79 of file bodies.h.

virtual bool bodies::Body::intersectsRay ( const btVector3 &  origin,
const btVector3 &  dir,
std::vector< btVector3 > *  intersections = NULL,
unsigned int  count = 0 
) const [pure virtual]

Check is 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.

Implemented in bodies::Sphere, bodies::Cylinder, bodies::Box, and bodies::ConvexMesh.

void bodies::Body::setDimensions ( const shapes::Shape shape  )  [inline]

Set the dimensions of the body (from corresponding shape).

Definition at line 126 of file bodies.h.

void bodies::Body::setPadding ( double  padd  )  [inline]

If constant padding should be added to the body, this method sets the padding. Default is 0.0.

Definition at line 100 of file bodies.h.

void bodies::Body::setPose ( const btTransform &  pose  )  [inline]

Set the pose of the body. Default is identity.

Definition at line 113 of file bodies.h.

void bodies::Body::setScale ( double  scale  )  [inline]

If the dimension of the body should be scaled, this method sets the scale. Default is 1.0.

Definition at line 86 of file bodies.h.

virtual void bodies::Body::updateInternalData ( void   )  [protected, pure virtual]
virtual void bodies::Body::useDimensions ( const shapes::Shape shape  )  [protected, pure virtual]

Member Data Documentation

double bodies::Body::m_padding [protected]

Definition at line 167 of file bodies.h.

btTransform bodies::Body::m_pose [protected]

Definition at line 165 of file bodies.h.

double bodies::Body::m_scale [protected]

Definition at line 166 of file bodies.h.

Definition at line 164 of file bodies.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator


geometric_shapes
Author(s): Ioan Sucan
autogenerated on Fri Jan 11 09:51:08 2013