50 for (
unsigned int j = 0; j < other.
num_spheres; ++j) {
53 if (o_dist > sum_r * sum_r)
return false;
57 return obb.overlap(other.
obb);
63 for (
unsigned int j = 0; j < other.
num_spheres; ++j) {
66 if (o_dist > sum_r * sum_r) {
67 o_dist = sqrt(o_dist) - sum_r;
68 sqrDistLowerBound = o_dist * o_dist;
74 return obb.overlap(other.
obb, request, sqrDistLowerBound);
80 if ((
spheres[i].o - p).squaredNorm() > r * r)
return false;
90 if (new_r_sqr > r * r) {
102 for (
unsigned int i = 0; i < new_num_spheres; ++i) {
125 long id_a = -1, id_b = -1;
127 for (
unsigned int j = 0; j < other.
num_spheres; ++j) {
141 if (id_a != -1 && id_b != -1) {
155 for (
unsigned int i = 0; i < b2_temp.
num_spheres; ++i) {
157 R0.transpose() * (b2_temp.
spheres[i].
o - T0);
160 b2_temp.
obb.
To.noalias() = R0.transpose() * (b2_temp.
obb.
To - T0);
161 b2_temp.
obb.
axes.applyOnTheLeft(R0.transpose());
170 for (
unsigned int i = 0; i < b2_temp.
num_spheres; ++i) {
172 R0.transpose() * (b2_temp.
spheres[i].
o - T0);
175 b2_temp.
obb.
To.noalias() = R0.transpose() * (b2_temp.
obb.
To - T0);
176 b2_temp.
obb.
axes.applyOnTheLeft(R0.transpose());
178 return b1.
overlap(b2_temp, request, sqrDistLowerBound);
184 for (
unsigned int i = 0; i < b2_temp.
num_spheres; ++i) {
kIOS_Sphere spheres[5]
The (at most) five spheres for intersection.
FCL_REAL width() const
Width of the kIOS.
FCL_REAL size() const
size of the kIOS (used in BV_Splitter to order two kIOSs)
static kIOS_Sphere encloseSphere(const kIOS_Sphere &s0, const kIOS_Sphere &s1)
generate one sphere enclosing two spheres
Eigen::Matrix< FCL_REAL, 3, 3 > Matrix3f
OBB obb
@ OBB related with kIOS
unsigned int num_spheres
The number of spheres, no larger than 5.
A class describing the kIOS collision structure, which is a set of spheres.
request to the collision algorithm
FCL_REAL height() const
Height of the kIOS.
FCL_REAL volume() const
Volume of the kIOS.
static AABB translate(const AABB &aabb, const Vec3f &t)
translate the center of AABB by t
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) const
Return the merged kIOS of current kIOS and the other one.
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
Matrix3f axes
Orientation of OBB. axis[i] is the ith column of the orientation matrix for the box; it is also the i...
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.