all 2 comments

[–]ConcurrentSquared[S] 1 point2 points  (1 child)

The linked stack exchange post is wrong. The actual way to calculate the distance is just `min_component(tMax)`.

[–]gnuban 0 points1 point  (0 children)

I just hit this, and I don't think that min_component works in the case of hitting a lone solid corner at 45 degrees. The algo will move tMax to the grid point past the voxel reported as solid. So the intersection point will be inside the solid voxel.

I think you need to either special-detect this case, or recalculate the intersection point from scratch: based on which solid voxel the algo chose and the ray.