Simox  2.3.74.0
simox::AxisAlignedBoundingBox Struct Reference

An axis-aligned (bounding-)box, defined by its limits in x-, y- and z- direction. More...

Public Member Functions

 AxisAlignedBoundingBox ()
 Construct an empty AABB centered at (0, 0, 0) with extents (0, 0, 0). More...
 
 AxisAlignedBoundingBox (const Eigen::Vector3f &min, const Eigen::Vector3f &max)
 Construct an AABB with minimal and maximal values. More...
 
 AxisAlignedBoundingBox (const Eigen::Vector2f &limits_x, const Eigen::Vector2f &limits_y, const Eigen::Vector2f &limits_z)
 Construct an AABB with axis-wise limits. More...
 
 AxisAlignedBoundingBox (float x_min, float x_max, float y_min, float y_max, float z_min, float z_max)
 Construct an AABB with given limits. More...
 
 AxisAlignedBoundingBox (const Eigen::Matrix32f &limits)
 Construct an AABB with limits in a 3x2 matrix. More...
 
Eigen::Matrix32f limits () const
 
Eigen::Matrix32flimits ()
 
void set_limits (const Eigen::Matrix32f &value)
 
Eigen::Vector3f min () const
 
Eigen::Matrix32f::ColXpr min ()
 
void set_min (const Eigen::Vector3f &value)
 
Eigen::Vector3f max () const
 
Eigen::Matrix32f::ColXpr max ()
 
void set_max (const Eigen::Vector3f &value)
 
Eigen::Vector3f center () const
 
void set_center (const Eigen::Vector3f &value)
 
Eigen::Vector3f extents () const
 
void set_extents (const Eigen::Vector3f &value)
 
Eigen::Vector2f limits_x () const
 
Eigen::Matrix32f::RowXpr limits_x ()
 
void set_limits_x (const Eigen::Vector2f &value)
 
Eigen::Vector2f limits_y () const
 
Eigen::Matrix32f::RowXpr limits_y ()
 
void set_limits_y (const Eigen::Vector2f &value)
 
Eigen::Vector2f limits_z () const
 
Eigen::Matrix32f::RowXpr limits_z ()
 
void set_limits_z (const Eigen::Vector2f &value)
 
float min_x () const
 
float & min_x ()
 
void set_min_x (float value)
 
float max_x () const
 
float & max_x ()
 
void set_max_x (float value)
 
float min_y () const
 
float & min_y ()
 
void set_min_y (float value)
 
float max_y () const
 
float & max_y ()
 
void set_max_y (float value)
 
float min_z () const
 
float & min_z ()
 
void set_min_z (float value)
 
float max_z () const
 
float & max_z ()
 
void set_max_z (float value)
 
bool empty (float prec=Eigen::NumTraits< float >::dummy_precision()) const
 Indicate whether this AABB is empty (i.e. has zero extents). More...
 
float central_distance (const AxisAlignedBoundingBox &other) const
 Return the distance between center of *this and other's center. More...
 
float central_squared_distance (const AxisAlignedBoundingBox &other) const
 Return the squared distance between *this center and other's center. More...
 
bool is_colliding (const AxisAlignedBoundingBox &other) const
 Checks whether *this is colliding (i.e. overlapping) with other. More...
 
template<class PointT >
bool is_inside (const PointT &p) const
 Indicates whether point is inside *this. More...
 
template<class PointT >
void expand_to (const PointT &point)
 Expand *this (in-place) to include point. Note that *this should be suitable initialized beforehand. More...
 
void expand_to (const Eigen::Vector3f &point)
 
template<class PointT >
void expanded_to (const PointT &point) const
 Return this AABB expanded to include point. Note that *this should be suitable initialized beforehand. More...
 
AxisAlignedBoundingBox expanded_to (const Eigen::Vector3f &point) const
 

Static Public Member Functions

static AxisAlignedBoundingBox from_points (const std::vector< Eigen::Vector3f > &points)
 Compute the AABB of the given points. More...
 
template<class PointT >
static AxisAlignedBoundingBox from_points (const std::vector< PointT > &points)
 Compute the AABB of the given points. PointT must have x, y, z member variables. More...
 

Detailed Description

An axis-aligned (bounding-)box, defined by its limits in x-, y- and z- direction.

Constructor & Destructor Documentation

◆ AxisAlignedBoundingBox() [1/5]

simox::AxisAlignedBoundingBox::AxisAlignedBoundingBox ( )

Construct an empty AABB centered at (0, 0, 0) with extents (0, 0, 0).

◆ AxisAlignedBoundingBox() [2/5]

simox::AxisAlignedBoundingBox::AxisAlignedBoundingBox ( const Eigen::Vector3f &  min,
const Eigen::Vector3f &  max 
)

Construct an AABB with minimal and maximal values.

◆ AxisAlignedBoundingBox() [3/5]

simox::AxisAlignedBoundingBox::AxisAlignedBoundingBox ( const Eigen::Vector2f &  limits_x,
const Eigen::Vector2f &  limits_y,
const Eigen::Vector2f &  limits_z 
)

Construct an AABB with axis-wise limits.

◆ AxisAlignedBoundingBox() [4/5]

simox::AxisAlignedBoundingBox::AxisAlignedBoundingBox ( float  x_min,
float  x_max,
float  y_min,
float  y_max,
float  z_min,
float  z_max 
)

Construct an AABB with given limits.

◆ AxisAlignedBoundingBox() [5/5]

simox::AxisAlignedBoundingBox::AxisAlignedBoundingBox ( const Eigen::Matrix32f limits)

Construct an AABB with limits in a 3x2 matrix.

Member Function Documentation

◆ center()

Eigen::Vector3f simox::AxisAlignedBoundingBox::center ( ) const

◆ central_distance()

float simox::AxisAlignedBoundingBox::central_distance ( const AxisAlignedBoundingBox other) const

Return the distance between center of *this and other's center.

◆ central_squared_distance()

float simox::AxisAlignedBoundingBox::central_squared_distance ( const AxisAlignedBoundingBox other) const

Return the squared distance between *this center and other's center.

◆ empty()

bool simox::AxisAlignedBoundingBox::empty ( float  prec = Eigen::NumTraits<float>::dummy_precision()) const

Indicate whether this AABB is empty (i.e. has zero extents).

◆ expand_to() [1/2]

template<class PointT >
void simox::AxisAlignedBoundingBox::expand_to ( const PointT &  point)
inline

Expand *this (in-place) to include point. Note that *this should be suitable initialized beforehand.

See also
from_points()

◆ expand_to() [2/2]

void simox::AxisAlignedBoundingBox::expand_to ( const Eigen::Vector3f &  point)

◆ expanded_to() [1/2]

template<class PointT >
void simox::AxisAlignedBoundingBox::expanded_to ( const PointT &  point) const
inline

Return this AABB expanded to include point. Note that *this should be suitable initialized beforehand.

See also
from_points()

◆ expanded_to() [2/2]

AxisAlignedBoundingBox simox::AxisAlignedBoundingBox::expanded_to ( const Eigen::Vector3f &  point) const

◆ extents()

Eigen::Vector3f simox::AxisAlignedBoundingBox::extents ( ) const

◆ from_points() [1/2]

AxisAlignedBoundingBox simox::AxisAlignedBoundingBox::from_points ( const std::vector< Eigen::Vector3f > &  points)
static

Compute the AABB of the given points.

Exceptions
<tt>simox::error::SimoxError</tt>If points is empty.

◆ from_points() [2/2]

template<class PointT >
AxisAlignedBoundingBox simox::AxisAlignedBoundingBox::from_points ( const std::vector< PointT > &  points)
static

Compute the AABB of the given points. PointT must have x, y, z member variables.

Exceptions
<tt>simox::error::SimoxError</tt>If points is empty.

◆ is_colliding()

bool simox::AxisAlignedBoundingBox::is_colliding ( const AxisAlignedBoundingBox other) const

Checks whether *this is colliding (i.e. overlapping) with other.

◆ is_inside()

template<class PointT >
bool simox::AxisAlignedBoundingBox::is_inside ( const PointT &  p) const

Indicates whether point is inside *this.

◆ limits() [1/2]

Eigen::Matrix32f simox::AxisAlignedBoundingBox::limits ( ) const

◆ limits() [2/2]

Eigen::Matrix32f & simox::AxisAlignedBoundingBox::limits ( )

◆ limits_x() [1/2]

Eigen::Vector2f simox::AxisAlignedBoundingBox::limits_x ( ) const

◆ limits_x() [2/2]

Eigen::Matrix32f::RowXpr simox::AxisAlignedBoundingBox::limits_x ( )

◆ limits_y() [1/2]

Eigen::Vector2f simox::AxisAlignedBoundingBox::limits_y ( ) const

◆ limits_y() [2/2]

Eigen::Matrix32f::RowXpr simox::AxisAlignedBoundingBox::limits_y ( )

◆ limits_z() [1/2]

Eigen::Vector2f simox::AxisAlignedBoundingBox::limits_z ( ) const

◆ limits_z() [2/2]

Eigen::Matrix32f::RowXpr simox::AxisAlignedBoundingBox::limits_z ( )

◆ max() [1/2]

Eigen::Vector3f simox::AxisAlignedBoundingBox::max ( ) const

◆ max() [2/2]

Eigen::Matrix32f::ColXpr simox::AxisAlignedBoundingBox::max ( )

◆ max_x() [1/2]

float simox::AxisAlignedBoundingBox::max_x ( ) const

◆ max_x() [2/2]

float & simox::AxisAlignedBoundingBox::max_x ( )

◆ max_y() [1/2]

float simox::AxisAlignedBoundingBox::max_y ( ) const

◆ max_y() [2/2]

float & simox::AxisAlignedBoundingBox::max_y ( )

◆ max_z() [1/2]

float simox::AxisAlignedBoundingBox::max_z ( ) const

◆ max_z() [2/2]

float & simox::AxisAlignedBoundingBox::max_z ( )

◆ min() [1/2]

Eigen::Vector3f simox::AxisAlignedBoundingBox::min ( ) const

◆ min() [2/2]

Eigen::Matrix32f::ColXpr simox::AxisAlignedBoundingBox::min ( )

◆ min_x() [1/2]

float simox::AxisAlignedBoundingBox::min_x ( ) const

◆ min_x() [2/2]

float & simox::AxisAlignedBoundingBox::min_x ( )

◆ min_y() [1/2]

float simox::AxisAlignedBoundingBox::min_y ( ) const

◆ min_y() [2/2]

float & simox::AxisAlignedBoundingBox::min_y ( )

◆ min_z() [1/2]

float simox::AxisAlignedBoundingBox::min_z ( ) const

◆ min_z() [2/2]

float & simox::AxisAlignedBoundingBox::min_z ( )

◆ set_center()

void simox::AxisAlignedBoundingBox::set_center ( const Eigen::Vector3f &  value)

◆ set_extents()

void simox::AxisAlignedBoundingBox::set_extents ( const Eigen::Vector3f &  value)

◆ set_limits()

void simox::AxisAlignedBoundingBox::set_limits ( const Eigen::Matrix32f value)

◆ set_limits_x()

void simox::AxisAlignedBoundingBox::set_limits_x ( const Eigen::Vector2f &  value)

◆ set_limits_y()

void simox::AxisAlignedBoundingBox::set_limits_y ( const Eigen::Vector2f &  value)

◆ set_limits_z()

void simox::AxisAlignedBoundingBox::set_limits_z ( const Eigen::Vector2f &  value)

◆ set_max()

void simox::AxisAlignedBoundingBox::set_max ( const Eigen::Vector3f &  value)

◆ set_max_x()

void simox::AxisAlignedBoundingBox::set_max_x ( float  value)

◆ set_max_y()

void simox::AxisAlignedBoundingBox::set_max_y ( float  value)

◆ set_max_z()

void simox::AxisAlignedBoundingBox::set_max_z ( float  value)

◆ set_min()

void simox::AxisAlignedBoundingBox::set_min ( const Eigen::Vector3f &  value)

◆ set_min_x()

void simox::AxisAlignedBoundingBox::set_min_x ( float  value)

◆ set_min_y()

void simox::AxisAlignedBoundingBox::set_min_y ( float  value)

◆ set_min_z()

void simox::AxisAlignedBoundingBox::set_min_z ( float  value)