38 #ifndef FCL_TRAVERSAL_BVHDISTANCETRAVERSALNODE_INL_H 39 #define FCL_TRAVERSAL_BVHDISTANCETRAVERSALNODE_INL_H 41 #include "fcl/narrowphase/detail/traversal/distance/bvh_distance_traversal_node.h" 50 template <
typename BV>
51 BVHDistanceTraversalNode<BV>::BVHDistanceTraversalNode()
52 : DistanceTraversalNodeBase<typename BV::S>()
59 query_time_seconds = 0.0;
63 template <
typename BV>
66 return model1->getBV(b).isLeaf();
70 template <
typename BV>
77 template <
typename BV>
80 S sz1 = model1->getBV(b1).bv.size();
83 bool l1 = model1->getBV(b1).isLeaf();
86 if(l2 || (!l1 && (sz1 > sz2)))
92 template <
typename BV>
95 return model1->getBV(b).leftChild();
99 template <
typename BV>
102 return model1->getBV(b).rightChild();
106 template <
typename BV>
113 template <
typename BV>
120 template <
typename BV>
124 return model1->getBV(b1).distance(model2->
getBV(b2));
bool enable_statistics
Whether stores statistics.
Definition: collision_traversal_node_base.h:78
Main namespace.
Definition: broadphase_bruteforce-inl.h:45
int rightChild() const
Return the index of the second child. The index is referred to the bounding volume array (i...
Definition: BV_node_base.cpp:62
int leftChild() const
Return the index of the first child. The index is referred to the bounding volume array (i...
Definition: BV_node_base.cpp:56
bool isSecondNodeLeaf(int b) const
Whether the BV node in the second BVH tree is leaf.
Definition: bvh_distance_traversal_node-inl.h:71
const BVNode< BV > & getBV(int id) const
We provide getBV() and getNumBVs() because BVH may be compressed (in future), so we must provide some...
Definition: BVH_model-inl.h:160
S BVTesting(int b1, int b2) const
BV culling test in one BVTT node.
Definition: bvh_distance_traversal_node-inl.h:121
bool isFirstNodeLeaf(int b) const
Whether the BV node in the first BVH tree is leaf.
Definition: bvh_distance_traversal_node-inl.h:64
int getSecondLeftChild(int b) const
Obtain the left child of BV node in the second BVH.
Definition: bvh_distance_traversal_node-inl.h:107
int getFirstLeftChild(int b) const
Obtain the left child of BV node in the first BVH.
Definition: bvh_distance_traversal_node-inl.h:93
BV bv
bounding volume storing the geometry
Definition: BV_node.h:57
int getFirstRightChild(int b) const
Obtain the right child of BV node in the first BVH.
Definition: bvh_distance_traversal_node-inl.h:100
int getSecondRightChild(int b) const
Obtain the right child of BV node in the second BVH.
Definition: bvh_distance_traversal_node-inl.h:114
bool firstOverSecond(int b1, int b2) const
Determine the traversal order, is the first BVTT subtree better.
Definition: bvh_distance_traversal_node-inl.h:78
bool isLeaf() const
Whether current node is a leaf node (i.e. contains a primitive index.
Definition: BV_node_base.cpp:44