Return the (square) distance from point to AABB.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(aabb_node_object), | intent(in) | :: | self | AABB. |
||
| type(vector_R8P), | intent(in) | :: | point | Point reference. |
Distance from point to AABB.
pure function distance(self, point)
!< Return the (square) distance from point to AABB.
class(aabb_node_object), intent(in) :: self !< AABB.
type(vector_R8P), intent(in) :: point !< Point reference.
real(R8P) :: distance !< Distance from point to AABB.
distance = MaxR8P
if (allocated(self%aabb)) distance = self%aabb%distance(point=point)
endfunction distance