Go to the documentation of this file.
38 #ifndef HPP_FCL_AABB_H
39 #define HPP_FCL_AABB_H
46 struct CollisionRequest;
54 class HPP_FCL_DLLAPI
AABB {
69 : min_(
a.cwiseMin(
b)), max_(
a.cwiseMax(
b)) {}
73 : min_(core.min_ - delta), max_(core.max_ + delta) {}
77 : min_(
a.cwiseMin(
b).cwiseMin(
c)), max_(
a.cwiseMax(
b).cwiseMax(
c)) {}
81 AABB& operator=(
const AABB& other) =
default;
91 return min_ == other.
min_ && max_ == other.
max_;
102 if (p[0] < min_[0] || p[0] > max_[0])
return false;
103 if (p[1] < min_[1] || p[1] > max_[1])
return false;
104 if (p[2] < min_[2] || p[2] > max_[2])
return false;
111 if (min_[0] > other.
max_[0])
return false;
112 if (min_[1] > other.
max_[1])
return false;
113 if (min_[2] > other.
max_[2])
return false;
115 if (max_[0] < other.
min_[0])
return false;
116 if (max_[1] < other.
min_[1])
return false;
117 if (max_[2] < other.
min_[2])
return false;
135 min_ = min_.cwiseMin(p);
136 max_ = max_.cwiseMax(p);
142 min_ = min_.cwiseMin(other.
min_);
143 max_ = max_.cwiseMax(other.
max_);
175 return (other.
min_[0] >= min_[0]) && (other.
max_[0] <= max_[0]) &&
176 (other.
min_[1] >= min_[1]) && (other.
max_[1] <= max_[1]) &&
177 (other.
min_[2] >= min_[2]) && (other.
max_[2] <= max_[2]);
186 overlap_part.
min_ = min_.cwiseMax(other.
min_);
187 overlap_part.
max_ = max_.cwiseMin(other.
max_);
193 if (min_[axis_id] > other.
max_[axis_id])
return false;
194 if (max_[axis_id] < other.
min_[axis_id])
return false;
210 min_.array() -= delta;
211 max_.array() += delta;
217 min_ = min_ * ratio - core.
min_;
218 max_ = max_ * ratio - core.
max_;
222 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
236 const Eigen::DenseIndex bit[3] = {1, 2, 4};
237 for (Eigen::DenseIndex ic = 1; ic < 8;
239 for (Eigen::DenseIndex i = 0; i < 3; ++i) {
240 corner[i] = (ic & bit[i]) ? aabb.
max_[i] : aabb.
min_[i];
255 const AABB& b2,
const CollisionRequest& request,
AABB & operator+=(const AABB &other)
Merge the AABB and another AABB.
bool axisOverlap(const AABB &other, int axis_id) const
Check whether two AABB are overlapped along specific axis.
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
bool overlap(const AABB &other) const
Check whether two AABB are overlap.
AABB(const Vec3f &a, const Vec3f &b)
Creating an AABB with two endpoints a and b.
bool contain(const AABB &other) const
Check whether the AABB contains another AABB.
FCL_REAL depth() const
Depth of the AABB.
Vec3f min_
The min point in the AABB.
Vec3f max_
The max point in the AABB.
HPP_FCL_DLLAPI FCL_REAL distance(const Matrix3f &R0, const Vec3f &T0, const kIOS &b1, const kIOS &b2, Vec3f *P=NULL, Vec3f *Q=NULL)
Approximate distance between two kIOS bounding volumes.
bool contain(const Vec3f &p) const
Check whether the AABB contains a point.
AABB & expand(const AABB &core, FCL_REAL ratio)
expand the aabb by increase the thickness of the plate by a ratio
FCL_REAL volume() const
Volume of the AABB.
AABB & expand(const FCL_REAL delta)
expand the half size of the AABB by a scalar delta, and keep the center unchanged.
request to the collision algorithm
static AABB rotate(const AABB &aabb, const Matrix3f &R)
A class describing the AABB collision structure, which is a box in 3D space determined by two diagona...
AABB & update(const Vec3f &a, const Vec3f &b)
bool overlap(const AABB &other, AABB &overlap_part) const
Check whether two AABB are overlap and return the overlap part.
AABB(const Vec3f &a, const Vec3f &b, const Vec3f &c)
Creating an AABB contains three points.
Eigen::Matrix< FCL_REAL, 3, 3 > Matrix3f
FCL_REAL size() const
Size of the AABB (used in BV_Splitter to order two AABBs)
FCL_REAL width() const
Width of the AABB.
AABB(const Vec3f &v)
Creating an AABB at position v with zero size.
AABB & operator+=(const Vec3f &p)
Merge the AABB and a point.
HPP_FCL_DLLAPI bool overlap(const Matrix3f &R0, const Vec3f &T0, const AABB &b1, const AABB &b2)
Check collision between two aabbs, b1 is in configuration (R0, T0) and b2 is in identity.
AABB(const AABB &core, const Vec3f &delta)
Creating an AABB centered as core and is of half-dimension delta.
static AABB translate(const AABB &aabb, const Vec3f &t)
translate the center of AABB by t
AABB & expand(const Vec3f &delta)
expand the half size of the AABB by delta, and keep the center unchanged.
FCL_REAL height() const
Height of the AABB.
Vec3f center() const
Center of the AABB.
bool operator==(const AABB &other) const
Comparison operator.
bool operator!=(const AABB &other) const
AABB operator+(const AABB &other) const
Return the merged AABB of current AABB and the other one.
hpp-fcl
Author(s):
autogenerated on Fri Aug 2 2024 02:45:12