38 #ifndef FCL_TRAVERSAL_RECURSE_INL_H 39 #define FCL_TRAVERSAL_RECURSE_INL_H 113 if(node->
canStop() && !front_list)
return;
125 if(node->
canStop() && !front_list)
return;
132 template <
typename S>
143 if(node->
BVTesting(b1, b2, R, T))
return;
171 if(node->
canStop() && !front_list)
return;
175 Rc.noalias() = R.transpose() * bv2.
axis;
177 Tc[0] = bv2.
axis.col(0).dot(temp);
178 Tc[1] = bv2.
axis.col(1).dot(temp);
179 Tc[2] = bv2.
axis.col(2).dot(temp);
190 temp.noalias() = R * bv1.
axis.col(0);
191 Rc(0, 0) = temp[0]; Rc(1, 0) = temp[1]; Rc(2, 0) = temp[2];
192 temp.noalias() = R * bv1.
axis.col(1);
193 Rc(0, 1) = temp[0]; Rc(1, 1) = temp[1]; Rc(2, 1) = temp[2];
194 temp.noalias() = R * bv1.
axis.col(2);
195 Rc(0, 2) = temp[0]; Rc(1, 2) = temp[1]; Rc(2, 2) = temp[2];
201 if(node->
canStop() && !front_list)
return;
204 temp.noalias() = R * bv2.
axis.col(0);
205 Rc(0, 0) = temp[0]; Rc(1, 0) = temp[1]; Rc(2, 0) = temp[2];
206 temp.noalias() = R * bv2.
axis.col(1);
207 Rc(0, 1) = temp[0]; Rc(1, 1) = temp[1]; Rc(2, 1) = temp[2];
208 temp.noalias() = R * bv2.
axis.col(2);
209 Rc(0, 2) = temp[0]; Rc(1, 2) = temp[1]; Rc(2, 2) = temp[2];
211 Tc.noalias() += R * bv2.
To;
218 template <
typename S>
236 template <
typename S>
248 if(node->
canStop() && !front_list)
return;
251 if(node->
canStop() && !front_list)
return;
257 template <
typename S>
320 template <
typename S>
332 template <
typename S>
337 return lhs.
d > rhs.
d;
342 template <
typename S>
374 return (pq.size() + 1 >= qsize);
384 template <
typename S>
422 bvt1.
b2 = min_test.
b2;
426 bvt2.
b2 = min_test.
b2;
433 bvt1.
b1 = min_test.
b1;
437 bvt2.
b1 = min_test.
b1;
450 min_test = bvtq.
top();
463 template <
typename S>
467 BVHFrontList::iterator front_iter;
469 for(front_iter = front_list->begin(); front_iter != front_list->end(); ++front_iter)
471 int b1 = front_iter->left;
472 int b2 = front_iter->right;
478 front_iter->valid =
false;
485 front_iter->valid =
false;
509 for(front_iter = front_list->begin(); front_iter != front_list->end();)
511 if(!front_iter->valid)
512 front_iter = front_list->erase(front_iter);
517 for(front_iter = append.begin(); front_iter != append.end(); ++front_iter)
519 front_list->push_back(*front_iter);
int b1
bv indices for a pair of bvs in two models
std::priority_queue< BVT< S >, std::vector< BVT< S > >, BVT_Comparer< S > > pq
const BVT< S > & top() const
virtual bool BVTesting(int b1, int b2) const
BV test between b1 and b2.
int getSecondLeftChild(int b) const
Obtain the left child of BV node in the second BVH.
template class FCL_EXPORT DistanceTraversalNodeBase< double >
void push(const BVT< S > &x)
virtual bool isSecondNodeLeaf(int b) const
Whether b is a leaf node in the second BVH tree.
Bounding volume test structure.
Eigen::Matrix< S, 3, 3 > Matrix3
template class FCL_EXPORT MeshCollisionTraversalNodeOBB< double >
template class FCL_EXPORT MeshCollisionTraversalNodeRSS< double >
virtual bool isFirstNodeLeaf(int b) const
Whether b is a leaf node in the first BVH tree.
int getFirstLeftChild(int b) const
Obtain the left child of BV node in the first BVH.
Eigen::Matrix< S, 3, 1 > Vector3
bool canStop() const
Whether the traversal process can stop early.
const BVHModel< OBB< S > > * model1
The first BVH model.
void leafTesting(int b1, int b2) const
Leaf test between node b1 and b2, if they are both leafs.
virtual bool canStop() const
Check whether the traversal can stop.
Comparer between two BVT.
Node structure encoding the information required for collision traversal.
Node structure encoding the information required for distance traversal.
template void selfCollisionRecurse(CollisionTraversalNodeBase< double > *node, int b, BVHFrontList *front_list)
virtual void leafTesting(int b1, int b2) const
Leaf test between node b1 and b2, if they are both leafs.
bool isSecondNodeLeaf(int b) const
Whether the BV node in the second BVH tree is leaf.
template void propagateBVHFrontListCollisionRecurse(CollisionTraversalNodeBase< double > *node, BVHFrontList *front_list)
FCL_EXPORT void updateFrontList(BVHFrontList *front_list, int b1, int b2)
Add new front node into the front list.
virtual int getFirstRightChild(int b) const
Get the right child of the node b in the first tree.
int getSecondRightChild(int b) const
Obtain the right child of BV node in the second BVH.
template class FCL_EXPORT CollisionTraversalNodeBase< double >
template void distanceRecurse(DistanceTraversalNodeBase< double > *node, int b1, int b2, BVHFrontList *front_list)
BV bv
bounding volume storing the geometry
virtual int getSecondLeftChild(int b) const
Get the left child of the node b in the second tree.
const BVNode< BV > & getBV(int id) const
We provide getBV() and getNumBVs() because BVH may be compressed (in future), so we must provide some...
Matrix3< S > axis
Orientation of OBB. The axes of the rotation matrix are the principle directions of the box...
virtual void leafTesting(int b1, int b2) const
Leaf test between node b1 and b2, if they are both leafs.
virtual S BVTesting(int b1, int b2) const
BV test between b1 and b2.
template void distanceQueueRecurse(DistanceTraversalNodeBase< double > *node, int b1, int b2, BVHFrontList *front_list, int qsize)
bool firstOverSecond(int b1, int b2) const
Determine the traversal order, is the first BVTT subtree better.
bool isFirstNodeLeaf(int b) const
Whether the BV node in the first BVH tree is leaf.
int getFirstRightChild(int b) const
Obtain the right child of BV node in the first BVH.
const BVHModel< OBB< S > > * model2
The second BVH model.
Vector3< S > To
Center of OBB.
virtual bool firstOverSecond(int b1, int b2) const
Traverse the subtree of the node in the first tree first.
std::list< BVHFrontNode > BVHFrontList
BVH front list is a list of front nodes.
unsigned int qsize
Queue size.
virtual int getSecondRightChild(int b) const
Get the right child of the node b in the second tree.
Traversal node for collision between two meshes if their underlying BVH node is oriented node (OBB...
virtual bool canStop(S c) const
Check whether the traversal can stop.
virtual int getFirstLeftChild(int b) const
Get the left child of the node b in the first tree.
bool BVTesting(int b1, int b2) const
BV test between b1 and b2.
template void collisionRecurse(CollisionTraversalNodeBase< double > *node, int b1, int b2, BVHFrontList *front_list)