Function ray_aabb_intersect
Source pub fn ray_aabb_intersect(
origin: Vector3D,
dir: Vector3D,
aabb_min: Vector3D,
aabb_max: Vector3D,
) -> Option<(f64, f64, Vector3D)>
Expand description
Intersects a ray with an axis-aligned bounding box using the slab method.
§Arguments
Vector3D - The ray origin.
§Returns
Option<(f64, f64, Vector3D)> - (t_near, t_far, normal) on hit, or
None if the ray misses or is parallel to the slab.