starandserpent / java-TerraServer

Terra - Voxel octree of chunks, made for Rituals of the old
MIT License
17 stars 2 forks source link

Ray traversal mechanism #69

Open the-brickster opened 5 years ago

the-brickster commented 5 years ago

Ray casting mechanism for octree traversal and chunk traversal.

Pilvinen commented 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

Pilvinen commented 5 years ago

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.

the-brickster commented 5 years ago

Yes this is for things like physics and any other game logic related actions