Instead of a single function that handles all the BVH tree types, split the BVHTreeFromMesh creation to separate functions.