38 #ifndef HPP_FCL_KIOS_H
39 #define HPP_FCL_KIOS_H
46 struct CollisionRequest;
56 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
62 return o == other.o && r == other.r;
66 return !(*
this == other);
71 static kIOS_Sphere encloseSphere(
const kIOS_Sphere& s0,
72 const kIOS_Sphere& s1) {
73 Vec3f d = s1.o - s0.o;
78 if (diff_r * diff_r >= dist2) {
85 float dist = (float)std::sqrt(dist2);
87 s.r = dist + s0.r + s1.r;
89 s.o = s0.o + d * ((s.r - s0.r) / dist);
97 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
102 if (!res)
return false;
104 for (
size_t k = 0; k < num_spheres; ++k) {
105 if (spheres[k] != other.
spheres[k])
return false;
114 static constexpr
size_t max_num_spheres = 5;
117 kIOS_Sphere spheres[max_num_spheres];
143 *
this = *
this + other;
A class describing the kIOS collision structure, which is a set of spheres.
Definition: kIOS.h:53
#define HPP_FCL_DLLAPI
Definition: config.hh:88
bool operator!=(const kIOS &other) const
Difference operator.
Definition: kIOS.h:112
FCL_REAL depth() const
Depth of the kIOS.
kIOS & operator+=(const Vec3f &p)
A simple way to merge the kIOS and a point.
kIOS & operator+=(const kIOS &other)
Merge the kIOS and another kIOS.
Definition: kIOS.h:142
const Vec3f & center() const
Center of the kIOS.
Definition: kIOS.h:154
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 operator==(const kIOS_Sphere &other) const
Definition: kIOS.h:61
bool overlap(const kIOS &other) const
Check collision between two kIOS.
FCL_REAL width() const
Width of the kIOS.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW bool operator==(const kIOS &other) const
Equality operator.
Definition: kIOS.h:100
bool overlap(const kIOS &other, const CollisionRequest &, FCL_REAL &sqrDistLowerBound) const
Check collision between two kIOS.
FCL_REAL height() const
Height of the kIOS.
FCL_REAL r
Definition: kIOS.h:59
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Vec3f o
Definition: kIOS.h:58
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.
FCL_REAL volume() const
Volume of the kIOS.
bool contain(const Vec3f &p) const
Check whether the kIOS contains a point.
FCL_REAL size() const
size of the kIOS (used in BV_Splitter to order two kIOSs)
kIOS_Sphere spheres[max_num_spheres]
The (at most) five spheres for intersection.
Definition: kIOS.h:117
FCL_REAL distance(const kIOS &other, Vec3f *P=NULL, Vec3f *Q=NULL) const
The distance between two kIOS.
unsigned int num_spheres
The number of spheres, no larger than 5.
Definition: kIOS.h:120
OBB obb
@ OBB related with kIOS
Definition: kIOS.h:123
bool operator!=(const kIOS_Sphere &other) const
Definition: kIOS.h:65
kIOS operator+(const kIOS &other) const
Return the merged kIOS of current kIOS and the other one.
KDOP< N > translate(const KDOP< N > &bv, const Vec3f &t)
translate the KDOP BV
Eigen::Matrix< FCL_REAL, 3, 3 > Matrix3f
Definition: data_types.h:71
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
Definition: data_types.h:67
double FCL_REAL
Definition: data_types.h:66
Main namespace.
Definition: broadphase_bruteforce.h:44
request to the collision algorithm
Definition: collision_data.h:312
Oriented bounding box class.
Definition: OBB.h:52