46 if (
a->getAABB().min_[0] <
b->getAABB().min_[0])
return true;
54 if (
a->getAABB().min_[1] <
b->getAABB().min_[1])
return true;
62 if (
a->getAABB().min_[2] <
b->getAABB().min_[2])
return true;
84 auto pos_start1 =
objs_x.begin();
88 while (pos_start1 < pos_end1) {
89 if (*pos_start1 == obj) {
96 auto pos_start2 =
objs_y.begin();
100 while (pos_start2 < pos_end2) {
101 if (*pos_start2 == obj) {
108 auto pos_start3 =
objs_z.begin();
112 while (pos_start3 < pos_end3) {
113 if (*pos_start3 == obj) {
160 std::vector<CollisionObject*>& objs)
const {
161 objs.resize(
objs_x.size());
167 std::vector<CollisionObject*>::const_iterator pos_start,
168 std::vector<CollisionObject*>::const_iterator pos_end,
CollisionObject* obj,
170 while (pos_start < pos_end) {
171 if (*pos_start != obj)
173 if ((*pos_start)->getAABB().overlap(obj->
getAABB())) {
174 if ((*
callback)(*pos_start, obj))
return true;
184 typename std::vector<CollisionObject*>::const_iterator pos_start,
185 typename std::vector<CollisionObject*>::const_iterator pos_end,
188 while (pos_start < pos_end) {
189 if (*pos_start != obj)
191 if ((*pos_start)->getAABB().distance(obj->
getAABB()) < min_dist) {
192 if ((*
callback)(*pos_start, obj, min_dist))
return true;
205 if (
size() == 0)
return;
213 static const unsigned int CUTOFF = 100;
216 bool coll_res =
false;
218 const auto pos_start1 =
objs_x.begin();
219 const auto pos_end1 =
221 long d1 = pos_end1 - pos_start1;
224 const auto pos_start2 =
objs_y.begin();
225 const auto pos_end2 =
227 long d2 = pos_end2 - pos_start2;
230 const auto pos_start3 =
objs_z.begin();
231 const auto pos_end3 =
233 long d3 = pos_end3 - pos_start3;
236 if (d3 <= d2 && d3 <=
d1)
239 if (d2 <= d3 && d2 <=
d1)
258 if (
size() == 0)
return;
260 FCL_REAL min_dist = (std::numeric_limits<FCL_REAL>::max)();
268 static const unsigned int CUTOFF = 100;
271 if (min_dist < (std::numeric_limits<FCL_REAL>::max)())
272 dummy_vector +=
Vec3f(min_dist, min_dist, min_dist);
274 typename std::vector<CollisionObject*>::const_iterator pos_start1 =
276 typename std::vector<CollisionObject*>::const_iterator pos_start2 =
278 typename std::vector<CollisionObject*>::const_iterator pos_start3 =
280 typename std::vector<CollisionObject*>::const_iterator pos_end1 =
282 typename std::vector<CollisionObject*>::const_iterator pos_end2 =
284 typename std::vector<CollisionObject*>::const_iterator pos_end3 =
291 old_min_distance = min_dist;
296 long d1 = pos_end1 - pos_start1;
298 bool dist_res =
false;
303 long d2 = pos_end2 - pos_start2;
306 pos_end3 = std::upper_bound(pos_start3,
objs_z.end(), &dummyHigh,
308 long d3 = pos_end3 - pos_start3;
311 if (d3 <= d2 && d3 <=
d1)
314 if (d2 <= d3 && d2 <=
d1)
329 if (dist_res)
return true;
332 if (old_min_distance < (std::numeric_limits<FCL_REAL>::max)())
337 if (min_dist < old_min_distance) {
343 if (dummy_vector.isApprox(
346 dummy_vector = dummy_vector + delta;
348 dummy_vector = dummy_vector * 2 - obj->
getAABB().
max_;
356 }
else if (status == 0)
365 const std::vector<CollisionObject*>& objs_x,
366 const std::vector<CollisionObject*>& objs_y,
367 const std::vector<CollisionObject*>& objs_z,
368 typename std::vector<CollisionObject*>::const_iterator& it_beg,
369 typename std::vector<CollisionObject*>::const_iterator& it_end) {
372 (
objs_x[0])->getAABB().min_[0];
374 (
objs_y[0])->getAABB().min_[1];
376 (
objs_z[0])->getAABB().min_[2];
379 if (delta_y > delta_x && delta_y > delta_z)
381 else if (delta_z > delta_y && delta_z > delta_x)
405 if (
size() == 0)
return;
407 typename std::vector<CollisionObject*>::const_iterator
pos, run_pos, pos_end;
409 int axis2 = (
axis + 1 > 2) ? 0 : (
axis + 1);
410 int axis3 = (axis2 + 1 > 2) ? 0 : (axis2 + 1);
414 while ((run_pos < pos_end) && (
pos < pos_end)) {
420 if (run_pos == pos_end)
break;
428 if (run_pos < pos_end) {
429 typename std::vector<CollisionObject*>::const_iterator run_pos2 = run_pos;
443 if (run_pos2 == pos_end)
break;
452 if (
size() == 0)
return;
454 typename std::vector<CollisionObject*>::const_iterator it, it_end;
457 FCL_REAL min_dist = (std::numeric_limits<FCL_REAL>::max)();
458 for (; it != it_end; ++it) {
470 if ((
size() == 0) || (other_manager->
size() == 0))
return;
472 if (
this == other_manager) {
477 typename std::vector<CollisionObject*>::const_iterator it, end;
478 if (this->
size() < other_manager->
size()) {
479 for (it =
objs_x.begin(), end =
objs_x.end(); it != end; ++it)
482 for (it = other_manager->
objs_x.begin(), end = other_manager->
objs_x.end();
495 if ((
size() == 0) || (other_manager->
size() == 0))
return;
497 if (
this == other_manager) {
502 FCL_REAL min_dist = (std::numeric_limits<FCL_REAL>::max)();
503 typename std::vector<CollisionObject*>::const_iterator it, end;
504 if (this->
size() < other_manager->
size()) {
505 for (it =
objs_x.begin(), end =
objs_x.end(); it != end; ++it)
508 for (it = other_manager->
objs_x.begin(), end = other_manager->
objs_x.end();