/** Recurse function for self collision * Make sure node is set correctly so that the first and second tree are the same */ void selfCollisionRecurse(CollisionTraversalNodeBase* node, int b, BVHFrontList* front_list) { bool l = node->isFirstNodeLeaf(b); if(l) return; int c1 = node->getFirstLeftChild(b); int c2 = node->getFirstRightChild(b); selfCollisionRecurse(node, c1, front_list); if(node->canStop() && !front_list) return; selfCollisionRecurse(node, c2, front_list); if(node->canStop() && !front_list) return; collisionRecurse(node, c1, c2, front_list); }
/** Recurse function for self collision * Make sure node is set correctly so that the first and second tree are the same */ void selfCollisionRecurse(CollisionTraversalNodeBase* node, int bv_node_id, BVHFrontList* front_list) { bool is_first_node_leaf = node->isFirstNodeLeaf(bv_node_id); if(is_first_node_leaf) return; int left_child = node->getFirstLeftChild(bv_node_id); int right_child = node->getFirstRightChild(bv_node_id); selfCollisionRecurse(node, left_child, front_list); if(node->canStop() && !front_list) return; selfCollisionRecurse(node, right_child, front_list); if(node->canStop() && !front_list) return; collisionRecurse(node, left_child, right_child, front_list); }
void selfCollide(CollisionTraversalNodeBase* node, BVHFrontList* front_list) { if(front_list && front_list->size() > 0) { propagateBVHFrontListCollisionRecurse(node, front_list); } else { selfCollisionRecurse(node, 0, front_list); } }
void selfCollide(CollisionTraversalNodeBase* node, BVHFrontList* front_list) { FCL_REAL sqrDistLowerBound = 0; if(front_list && front_list->size() > 0) { propagateBVHFrontListCollisionRecurse(node, front_list, sqrDistLowerBound); } else { selfCollisionRecurse(node, 0, front_list); } }