38 #ifndef HPP_FCL_KIOS_H 39 #define HPP_FCL_KIOS_H 49 struct CollisionRequest;
65 return o == other.o && r == other.r;
70 return !(*
this == other);
75 static kIOS_Sphere encloseSphere(
const kIOS_Sphere& s0,
const kIOS_Sphere& s1)
77 Vec3f d = s1.o - s0.o;
82 if(diff_r * diff_r >= dist2)
84 if(s1.r > s0.r)
return s1;
89 float dist = (float)std::sqrt(dist2);
91 s.r = dist + s0.r + s1.r;
93 s.o = s0.o + d * ((s.r - s0.r) / dist);
108 for(
size_t k = 0; k < num_spheres; ++k)
110 if(spheres[k] != other.
spheres[k])
120 return !(*
this == other);
124 kIOS_Sphere spheres[5];
133 bool contain(
const Vec3f& p)
const;
151 *
this = *
this + other;
156 kIOS operator + (
const kIOS& other)
const;
kIOS_Sphere spheres[5]
The (at most) five spheres for intersection.
Definition: kIOS.h:124
Main namespace.
Definition: AABB.h:43
bool operator!=(const kIOS_Sphere &other) const
Definition: kIOS.h:68
Eigen::Matrix< FCL_REAL, 3, 3 > Matrix3f
Definition: data_types.h:68
FCL_REAL r
Definition: kIOS.h:61
KDOP< N > translate(const KDOP< N > &bv, const Vec3f &t)
translate the KDOP BV
OBB obb
@ OBB related with kIOS
Definition: kIOS.h:130
bool operator==(const kIOS &other) const
Equality operator.
Definition: kIOS.h:102
unsigned int num_spheres
The number of spheres, no larger than 5.
Definition: kIOS.h:127
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:203
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.
double FCL_REAL
Definition: data_types.h:66
const Vec3f & center() const
Center of the kIOS.
Definition: kIOS.h:162
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.
bool operator!=(const kIOS &other) const
Difference operator.
Definition: kIOS.h:118
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
Definition: data_types.h:67
bool operator==(const kIOS_Sphere &other) const
Definition: kIOS.h:63
#define HPP_FCL_DLLAPI
Definition: config.hh:64
Vec3f o
Definition: kIOS.h:60
Oriented bounding box class.
Definition: OBB.h:54