38 #ifndef HPP_FCL_AABB_H 39 #define HPP_FCL_AABB_H 79 max_(core.max_ + delta)
85 max_(a.cwiseMax(b).cwiseMax(c))
96 if(p[0] < min_[0] || p[0] > max_[0])
return false;
97 if(p[1] < min_[1] || p[1] > max_[1])
return false;
98 if(p[2] < min_[2] || p[2] > max_[2])
return false;
106 if(min_[0] > other.
max_[0])
return false;
107 if(min_[1] > other.
max_[1])
return false;
108 if(min_[2] > other.
max_[2])
return false;
110 if(max_[0] < other.
min_[0])
return false;
111 if(max_[1] < other.
min_[1])
return false;
112 if(max_[2] < other.
min_[2])
return false;
130 min_ = min_.cwiseMin(p);
131 max_ = max_.cwiseMax(p);
138 min_ = min_.cwiseMin(other.
min_);
139 max_ = max_.cwiseMax(other.
max_);
153 return (max_ - min_).squaredNorm();
159 return (min_ + max_) * 0.5;
165 return max_[0] - min_[0];
171 return max_[1] - min_[1];
177 return max_[2] - min_[2];
191 return (other.
min_[0] >= min_[0]) && (other.
max_[0] <= max_[0]) && (other.
min_[1] >= min_[1]) && (other.
max_[1] <= max_[1]) && (other.
min_[2] >= min_[2]) && (other.
max_[2] <= max_[2]);
202 overlap_part.
min_ = min_.cwiseMax(other.
min_);
203 overlap_part.
max_ = max_.cwiseMin(other.
max_);
218 min_ = min_ * ratio - core.
min_;
219 max_ = max_ * ratio - core.
max_;
225 static inline AABB translate(
const AABB& aabb,
const Vec3f& t)
237 const std::size_t bit[3] = { 1, 2, 4 };
238 for (std::size_t ic = 1; ic < 8; ++ic) {
239 for (std::size_t i = 0; i < 3; ++i) {
240 corner[i] = (ic && bit[i]) ? aabb.
max_[i] : aabb.
min_[i];
Vec3f min_
The min point in the AABB.
Definition: AABB.h:59
FCL_REAL height() const
Height of the AABB.
Definition: AABB.h:169
bool overlap(const AABB &other) const
Check whether two AABB are overlap.
Definition: AABB.h:104
Vec3f center() const
Center of the AABB.
Definition: AABB.h:157
bool contain(const AABB &other) const
Check whether the AABB contains another AABB.
Definition: AABB.h:189
Main namespace.
Definition: AABB.h:43
Eigen::Matrix< FCL_REAL, 3, 3 > Matrix3f
Definition: data_types.h:74
AABB(const Vec3f &a, const Vec3f &b)
Creating an AABB with two endpoints a and b.
Definition: AABB.h:72
FCL_REAL depth() const
Depth of the AABB.
Definition: AABB.h:175
bool overlap(const AABB &other, AABB &overlap_part) const
Check whether two AABB are overlap and return the overlap part.
Definition: AABB.h:195
FCL_REAL size() const
Size of the AABB (used in BV_Splitter to order two AABBs)
Definition: AABB.h:151
AABB()
Creating an AABB with zero size (low bound +inf, upper bound -inf)
request to the collision algorithm
Definition: collision_data.h:150
double FCL_REAL
Definition: data_types.h:68
A class describing the AABB collision structure, which is a box in 3D space determined by two diagona...
Definition: AABB.h:55
AABB & operator+=(const Vec3f &p)
Merge the AABB and a point.
Definition: AABB.h:128
Vec3f max_
The max point in the AABB.
Definition: AABB.h:61
AABB & expand(const AABB &core, FCL_REAL ratio)
expand the aabb by increase the thickness of the plate by a ratio
Definition: AABB.h:216
FCL_REAL volume() const
Volume of the AABB.
Definition: AABB.h:181
FCL_REAL width() const
Width of the AABB.
Definition: AABB.h:163
AABB(const AABB &core, const Vec3f &delta)
Creating an AABB centered as core and is of half-dimension delta.
Definition: AABB.h:78
AABB(const Vec3f &v)
Creating an AABB at position v with zero size.
Definition: AABB.h:67
FCL_REAL distance(const AABB &other) const
Distance between two AABBs.
bool contain(const Vec3f &p) const
Check whether the AABB contains a point.
Definition: AABB.h:94
AABB(const Vec3f &a, const Vec3f &b, const Vec3f &c)
Creating an AABB contains three points.
Definition: AABB.h:84
AABB & expand(const Vec3f &delta)
expand the half size of the AABB by delta, and keep the center unchanged.
Definition: AABB.h:208
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
Definition: data_types.h:73
AABB operator+(const AABB &other) const
Return the merged AABB of current AABB and the other one.
Definition: AABB.h:144