Open the-brickster opened 5 years ago
Is there a reason why you suggested Bresenham specifically?
https://www.gamedev.net/blogs/entry/2265248-voxel-traversal-algorithm-ray-casting/
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.42.3443&rep=rep1&type=pdf
I have to add that you didn't really specify what you had planned this for beyond the "octree and chunk traversal".
If the indented use is for occlusion queries, as I suspect, then this is probably a wrong approach and we need to discuss about that.
However for uses like block picking by using the world data and camera location and calculating it from there (as opposed to using the mesh as we were doing in the past) this could be excellent.
Yes this is for things like physics and any other game logic related actions
Ray casting mechanism for octree traversal and chunk traversal.
For chunk traversal bresenham's line algorithm would need to be used
For octree traversal, it would need to be visited in front-to-back order, depth-first