70 :
min_(a.cwiseMin(b)),
max_(a.cwiseMax(b)) {}
78 :
min_(a.cwiseMin(b).cwiseMin(c)),
max_(a.cwiseMax(b).cwiseMax(c)) {}
103 if (p[0] <
min_[0] || p[0] >
max_[0])
return false;
104 if (p[1] <
min_[1] || p[1] >
max_[1])
return false;
105 if (p[2] <
min_[2] || p[2] >
max_[2])
return false;
112 if (
min_[0] > other.
max_[0])
return false;
113 if (
min_[1] > other.
max_[1])
return false;
114 if (
min_[2] > other.
max_[2])
return false;
116 if (
max_[0] < other.
min_[0])
return false;
117 if (
max_[1] < other.
min_[1])
return false;
118 if (
max_[2] < other.
min_[2])
return false;
200 if (
min_[axis_id] > other.
max_[axis_id])
return false;
201 if (
max_[axis_id] < other.
min_[axis_id])
return false;
217 min_.array() -= delta;
218 max_.array() += delta;
229 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
233static inline AABB translate(
const AABB& aabb,
const Vec3s& t) {
241 AABB res(R * aabb.min_);
242 Vec3s corner(aabb.min_);
243 const Eigen::DenseIndex bit[3] = {1, 2, 4};
244 for (Eigen::DenseIndex ic = 1; ic < 8;
246 for (Eigen::DenseIndex i = 0; i < 3; ++i) {
247 corner[i] = (ic & bit[i]) ? aabb.max_[i] : aabb.min_[i];
A class describing the AABB collision structure, which is a box in 3D space determined by two diagona...
Definition AABB.h:55
Half Space: this is equivalent to the Plane in ODE. A Half space has a priviledged direction: the dir...
Definition geometric_shapes.h:892
Infinite plane. A plane can be viewed as two half spaces; it has no priviledged direction....
Definition geometric_shapes.h:983
bool contain(const Vec3s &p) const
Check whether the AABB contains a point.
Definition AABB.h:102
Vec3s center() const
Center of the AABB.
Definition AABB.h:164
CoalScalar depth() const
Depth of the AABB.
Definition AABB.h:173
AABB(const Vec3s &v)
Creating an AABB at position v with zero size.
Definition AABB.h:66
AABB & operator+=(const Vec3s &p)
Merge the AABB and a point.
Definition AABB.h:141
CoalScalar distance(const AABB &other) const
Distance between two AABBs.
bool overlap(const AABB &other, AABB &overlap_part) const
Check whether two AABB are overlap and return the overlap part.
Definition AABB.h:188
bool overlap(const Plane &p) const
Check whether AABB overlaps a plane.
CoalScalar volume() const
Volume of the AABB.
Definition AABB.h:176
AABB & operator=(const AABB &other)=default
bool operator==(const AABB &other) const
Comparison operator.
Definition AABB.h:91
CoalScalar width() const
Width of the AABB.
Definition AABB.h:167
bool overlap(const Halfspace &hs) const
Check whether AABB overlaps a halfspace.
AABB(const AABB &other)=default
AABB operator+(const AABB &other) const
Return the merged AABB of current AABB and the other one.
Definition AABB.h:155
AABB & update(const Vec3s &a, const Vec3s &b)
Definition AABB.h:84
AABB & operator+=(const AABB &other)
Merge the AABB and another AABB.
Definition AABB.h:148
CoalScalar height() const
Height of the AABB.
Definition AABB.h:170
bool overlap(const AABB &other) const
Check whether two AABB are overlap.
Definition AABB.h:111
bool overlap(const Matrix3s &R0, const Vec3s &T0, const AABB &b1, const AABB &b2)
Check collision between two aabbs, b1 is in configuration (R0, T0) and b2 is in identity.
bool operator!=(const AABB &other) const
Definition AABB.h:95
AABB & expand(const AABB &core, CoalScalar ratio)
expand the aabb by increase the thickness of the plate by a ratio
Definition AABB.h:223
bool overlap(const AABB &other, const CollisionRequest &request, CoalScalar &sqrDistLowerBound) const
Check whether two AABB are overlap.
AABB()
Creating an AABB with zero size (low bound +inf, upper bound -inf)
AABB & expand(const Vec3s &delta)
expand the half size of the AABB by delta, and keep the center unchanged.
Definition AABB.h:208
AABB & expand(const CoalScalar delta)
expand the half size of the AABB by a scalar delta, and keep the center unchanged.
Definition AABB.h:216
CoalScalar size() const
Size of the AABB (used in BV_Splitter to order two AABBs)
Definition AABB.h:161
CoalScalar distance(const AABB &other, Vec3s *P, Vec3s *Q) const
Distance between two AABBs; P and Q, should not be NULL, return the nearest points.
AABB(const AABB &core, const Vec3s &delta)
Creating an AABB centered as core and is of half-dimension delta.
Definition AABB.h:73
bool axisOverlap(const AABB &other, int axis_id) const
Check whether two AABB are overlapped along specific axis.
Definition AABB.h:199
Vec3s min_
The min point in the AABB.
Definition AABB.h:58
Vec3s max_
The max point in the AABB.
Definition AABB.h:60
bool contain(const AABB &other) const
Check whether the AABB contains another AABB.
Definition AABB.h:181
AABB(const Vec3s &a, const Vec3s &b)
Creating an AABB with two endpoints a and b.
Definition AABB.h:69
AABB(const Vec3s &a, const Vec3s &b, const Vec3s &c)
Creating an AABB contains three points.
Definition AABB.h:77
Main namespace.
Definition broadphase_bruteforce.h:44
Eigen::Matrix< CoalScalar, 3, 3 > Matrix3s
Definition data_types.h:81
Eigen::Matrix< CoalScalar, 3, 1 > Vec3s
Definition data_types.h:77
double CoalScalar
Definition data_types.h:76
request to the collision algorithm
Definition collision_data.h:311