38 #ifndef HPP_FCL_KIOS_H 39 #define HPP_FCL_KIOS_H 49 struct CollisionRequest;
65 static kIOS_Sphere encloseSphere(
const kIOS_Sphere& s0,
const kIOS_Sphere& s1)
67 Vec3f d = s1.o - s0.o;
72 if(diff_r * diff_r >= dist2)
74 if(s1.r > s0.r)
return s1;
79 float dist = (float)std::sqrt(dist2);
81 s.r = dist + s0.r + s1.r;
83 s.o = s0.o + d * ((s.r - s0.r) / dist);
119 *
this = *
this + other;
kIOS_Sphere spheres[5]
The (at most) five spheres for intersection.
Definition: kIOS.h:92
FCL_REAL width() const
Width of the kIOS.
FCL_REAL size() const
size of the kIOS (used in BV_Splitter to order two kIOSs)
Main namespace.
Definition: AABB.h:43
Oriented bounding box class.
Definition: OBB.h:54
Eigen::Matrix< FCL_REAL, 3, 3 > Matrix3f
Definition: data_types.h:74
FCL_REAL r
Definition: kIOS.h:61
KDOP< N > translate(const KDOP< N > &bv, const Vec3f &t)
translate the KDOP BV
kIOS & operator+=(const Vec3f &p)
A simple way to merge the kIOS and a point.
OBB obb
@ OBB related with kIOS
Definition: kIOS.h:98
unsigned int num_spheres
The number of spheres, no larger than 5.
Definition: kIOS.h:95
A class describing the kIOS collision structure, which is a set of spheres.
Definition: kIOS.h:55
request to the collision algorithm
Definition: collision_data.h:150
double FCL_REAL
Definition: data_types.h:68
FCL_REAL height() const
Height of the kIOS.
FCL_REAL volume() const
Volume of the kIOS.
const Vec3f & center() const
Center of the kIOS.
Definition: kIOS.h:130
FCL_REAL depth() const
Depth of the kIOS.
kIOS operator+(const kIOS &other) const
Return the merged kIOS of current kIOS and the other one.
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
Definition: data_types.h:73
bool overlap(const kIOS &other) const
Check collision between two kIOS.
FCL_REAL distance(const kIOS &other, Vec3f *P=NULL, Vec3f *Q=NULL) const
The distance between two kIOS.
bool contain(const Vec3f &p) const
Check whether the kIOS contains a point.
Vec3f o
Definition: kIOS.h:60