combine the build/flatten BVH in one step(building linear version BVH tree directly to save the redundant new/delete)

.