Still Going

Its been a while since my last post but rest assured the project is still going strong. Iv been very busy with my real job so I havent had lots of time to code but stay tuned for regula updates this month as I have been busy on the project.

For anyone of you who are technically minded today I will talk about raycasting in voxel worlds. You see raycasting calculations are expensive and take lots of cpu time, so when you have a world full of cubes, raycasting them all is not an option. Sure you could do a broadphase detection on each chunk and then each cube but this is still an expensive calculation to do. Luckily will can apply some mathematics and using an origin point, and a vector we can trace each and every cube that the ray will intersect with.

Now there is a very good paper theorising how to do it. http://www.cse.yorku.ca/~amana/research/grid.pdf

This however is only half the problem and you also need to know how far through the current block you are and if the vector is negative you have to alter the start equation.

This foxed my for a few days and was highly frustrating, but in the end I have  a very fast and perfectly accurate raycast that even tells me what side of the cube I enter from.

Still Going

Leave a Reply

Your email address will not be published. Required fields are marked *