Improved the branch pruning for the BVH