Voxel Hit Detection Dilemma

My brief introduction.

Traditionally, you’d just instantiate a ton of tiny parts and check to see which one has been touched. I’m trying to do things differently. As I’m working on a project with a fair amount of destruction, I’m wanting to skip the voxel step all together, leading to cutting out the projected voxel in an imaginary table, then simply feeding the table into a greedy mesher. Of course, it’s not that easy.

Here’s the rundown!

In the image provided, I’ve separated my theory into three steps. These aren’t anything new, just the following. Step one suggests that a ray is casted onto a wall from a moving entity.

(This is the hard part!)

From there the position is somehow depicted by only the relation between the ray’s hit position and the wall’s center.

Next, I’m needing to take that extrapolated position (the hit point from step one) and round it a whole number (that way I can refer to it in a matrix). Past the point, step three, I just throw it into a greedy mesher (I’ve already done this one; step three).

Now, if you’ve somehow came up with an alternative way to get an accurate hit point on a wall, be my guest, surprise me! As of yet, this has not been an easy experiment.

Remember, we’re working with voxels here, people!

5 Likes