Simox  2.3.74.0
VirtualRobot::BoundingBox Class Reference

Public Member Functions

 BoundingBox ()
 
 BoundingBox (const std::vector< Eigen::Vector3f > &p)
 
bool planeGoesThrough (const VirtualRobot::MathTools::Plane &p)
 
std::vector< Eigen::Vector3f > getPoints () const
 
void print ()
 Print some info. More...
 
void addPoints (const std::vector< Eigen::Vector3f > &p)
 
void addPoints (const BoundingBox &bbox)
 
void addPoint (const Eigen::Vector3f &p)
 
Eigen::Vector3f getMin () const
 The axis oriented minimum value. More...
 
Eigen::Vector3f getMax () const
 The axis oriented maximum value. More...
 
void clear ()
 set min/max to NAN. More...
 
void transform (Eigen::Matrix4f &pose)
 
void scale (const Eigen::Vector3f &scaleFactor)
 
std::string toXML (int tabs=2, bool skipMatrixTag=false)
 
bool isInside (Eigen::Vector3f point) const
 isInside Checks whether the given point lies within the bounding box. The given vector can contain entries that are none, if this is the case the respective dimension is ignored and the point is only tested for the remaining non-nan dimensions. More...
 

Protected Attributes

Eigen::Vector3f min
 
Eigen::Vector3f max
 

Friends

class CollisionChecker
 

Detailed Description

An axis oriented bounding box. Todo: Some parts of this class are similar to MathTools::OOBB.

Constructor & Destructor Documentation

◆ BoundingBox() [1/2]

VirtualRobot::BoundingBox::BoundingBox ( )

◆ BoundingBox() [2/2]

VirtualRobot::BoundingBox::BoundingBox ( const std::vector< Eigen::Vector3f > &  p)

Member Function Documentation

◆ addPoint()

void VirtualRobot::BoundingBox::addPoint ( const Eigen::Vector3f &  p)

Consider this point for min/max calculation

◆ addPoints() [1/2]

void VirtualRobot::BoundingBox::addPoints ( const std::vector< Eigen::Vector3f > &  p)

Consider these points for min/max calculation

◆ addPoints() [2/2]

void VirtualRobot::BoundingBox::addPoints ( const BoundingBox bbox)

Consider these points for min/max calculation

◆ clear()

void VirtualRobot::BoundingBox::clear ( )

set min/max to NAN.

◆ getMax()

Eigen::Vector3f VirtualRobot::BoundingBox::getMax ( ) const

The axis oriented maximum value.

◆ getMin()

Eigen::Vector3f VirtualRobot::BoundingBox::getMin ( ) const

The axis oriented minimum value.

◆ getPoints()

std::vector< Eigen::Vector3f > VirtualRobot::BoundingBox::getPoints ( ) const

Returns 8 points that define the bounding box

◆ isInside()

bool VirtualRobot::BoundingBox::isInside ( Eigen::Vector3f  point) const

isInside Checks whether the given point lies within the bounding box. The given vector can contain entries that are none, if this is the case the respective dimension is ignored and the point is only tested for the remaining non-nan dimensions.

Parameters
pointthe point to test
Returns
True if the point lies within the bounding box. False if not.

◆ planeGoesThrough()

bool VirtualRobot::BoundingBox::planeGoesThrough ( const VirtualRobot::MathTools::Plane p)

Returns true, if plane "hits" this bounding box.

◆ print()

void VirtualRobot::BoundingBox::print ( )

Print some info.

◆ scale()

void VirtualRobot::BoundingBox::scale ( const Eigen::Vector3f &  scaleFactor)

◆ toXML()

std::string VirtualRobot::BoundingBox::toXML ( int  tabs = 2,
bool  skipMatrixTag = false 
)

◆ transform()

void VirtualRobot::BoundingBox::transform ( Eigen::Matrix4f &  pose)

Applies transformation to this bbox. Reorders min and max values according to pose.

Friends And Related Function Documentation

◆ CollisionChecker

friend class CollisionChecker
friend

Field Documentation

◆ max

Eigen::Vector3f VirtualRobot::BoundingBox::max
protected

◆ min

Eigen::Vector3f VirtualRobot::BoundingBox::min
protected