38 #ifndef FCL_TRAVERSAL_MESHCONTINUOUSCOLLISIONTRAVERSALNODE_INL_H
39 #define FCL_TRAVERSAL_MESHCONTINUOUSCOLLISIONTRAVERSALNODE_INL_H
53 struct BVHContinuousCollisionPair<double>;
65 int id1_,
int id2_, S time)
66 : id1(id1_), id2(id2_), collision_time(time)
72 template <
typename BV>
89 template <
typename BV>
92 if(this->enable_statistics) this->num_leaf_tests++;
94 const BVNode<BV>& node1 = this->model1->getBV(b1);
95 const BVNode<BV>& node2 = this->model2->getBV(b2);
103 const Triangle& tri_id1 = tri_indices1[primitive_id1];
104 const Triangle& tri_id2 = tri_indices2[primitive_id2];
111 for(
int i = 0; i < 3; ++i)
113 S0[i] = prev_vertices1 + tri_id1[i];
114 S1[i] = vertices1 + tri_id1[i];
115 T0[i] = prev_vertices2 + tri_id2[i];
116 T1[i] = vertices2 + tri_id2[i];
123 for(
int i = 0; i < 3; ++i)
125 if(this->enable_statistics) num_vf_tests++;
128 if(collision_time > tmp)
130 collision_time = tmp; collision_pos = tmpv;
134 if(this->enable_statistics) num_vf_tests++;
137 if(collision_time > tmp)
139 collision_time = tmp; collision_pos = tmpv;
145 for(
int i = 0; i < 3; ++i)
149 if(S_id2 == 3) S_id2 = 0;
150 for(
int j = 0; j < 3; ++j)
154 if(T_id2 == 3) T_id2 = 0;
157 if(
Intersect<S>::intersect_EE(*(S0[S_id1]), *(S0[S_id2]), *(T0[T_id1]), *(T0[T_id2]), *(S1[S_id1]), *(S1[S_id2]), *(T1[T_id1]), *(T1[T_id2]), &tmp, &tmpv))
159 if(collision_time > tmp)
161 collision_time = tmp; collision_pos = tmpv;
167 if(!(collision_time > 1))
169 pairs.emplace_back(primitive_id1, primitive_id2, collision_time);
170 time_of_contact =
std::min(time_of_contact, collision_time);
175 template <
typename BV>
178 return (pairs.size() > 0) && (this->request.num_max_contacts <= pairs.size());
182 template <
typename BV>