Skip to main content

intersect_aabb3_aabb3

Function intersect_aabb3_aabb3 

Source
pub fn intersect_aabb3_aabb3<S>(a: Aabb3<S>, b: Aabb3<S>) -> Option<Aabb3<S>>
where S: Copy + PartialOrd + Debug,
Expand description

Boolean intersection computation of 3D axis-aligned bounding boxes.

AABBs that are merely touching return no intersection:

let a = Aabb3::with_minmax ([ 0.0, 0.0, 0.0].into(), [1.0, 1.0, 1.0].into())
  .unwrap();
let b = Aabb3::with_minmax ([-1.0, 0.0, 0.0].into(), [0.0, 1.0, 1.0].into())
  .unwrap();
assert!(intersect_aabb3_aabb3 (a, b).is_none());