Make BVH more safe to use
As for now, there is no way to verify the _get_vertex
function. Maybe make an "insurance" that the iterators and vertices will always be valid. Or pass them every time to the intersection functions.
Idea:
- bool flag in sort(...) to determine whether the iters and vertices will be kept valid manually.
- Manual reassign of iterators and get_vertex function with size check.
- Or add a flag like
gfx::bvh_mode::persistent
in the constructor to tell that the iterators and function references will not be invalidated.