Shortcuts

nerfacc.ray_aabb_intersect

nerfacc.ray_aabb_intersect(rays_o, rays_d, aabbs, near_plane=-inf, far_plane=inf, miss_value=inf)

Ray-AABB intersection.

Parameters:
  • rays_o (Tensor) – (n_rays, 3) Ray origins.

  • rays_d (Tensor) – (n_rays, 3) Normalized ray directions.

  • aabbs (Tensor) – (m, 6) Axis-aligned bounding boxes {xmin, ymin, zmin, xmax, ymax, zmax}.

  • near_plane (float) – Optional. Near plane. Default to -infinity.

  • far_plane (float) – Optional. Far plane. Default to infinity.

  • miss_value (float) – Optional. Value to use for tmin and tmax when there is no intersection. Default to infinity.

Returns:

  • t_mins: (n_rays, m) tmin for each ray-AABB pair.

  • t_maxs: (n_rays, m) tmax for each ray-AABB pair.

  • hits: (n_rays, m) whether each ray-AABB pair intersects.

Return type:

A tuple of {Tensor, Tensor, BoolTensor}