From 92249cf8c8ae42f05fe8209a149972de98c46ca5 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Fri, 22 Sep 2023 12:08:36 +0100 Subject: [PATCH] Add AABB intersection test to brushes --- csg/src/brush.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/csg/src/brush.rs b/csg/src/brush.rs index cc34a9f..a2a4d88 100644 --- a/csg/src/brush.rs +++ b/csg/src/brush.rs @@ -64,6 +64,10 @@ impl Brush { self.aabb = Aabb::from_positions(&self.vertices); } + pub fn aabb_intersects_with(&self, other: &Brush) -> bool { + self.aabb.intersects(other.get_aabb()) + } + pub fn get_vertices(&self) -> Vec { self.vertices.clone() }