alecjacobson/computer-graphics-bounding-volume-hierarchy

How do we find the closest distance between a bounding box and a point?

Closed this issue · 0 comments

to calculate point_box_squared_distance() we cannot simply just calculate from the center of the box to the query point right ?

Since this does not guarantee that all the points within that box is further away from query point (based on the center). This will then cause a problem when doing BFS traversal since it would just skip the bounding box, while actually still containing potential points closer to the query point than just the center coordinates value.

I was looking for any suggested method in the readme but couldn't find any. Am I approaching this question correctly?

Edit

Okay I think I figured it out.