Add AABB intersection test to brushes

This commit is contained in:
Jarrod Doyle 2023-09-22 12:08:36 +01:00
parent bcf73c0251
commit 92249cf8c8
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 4 additions and 0 deletions

View File

@ -64,6 +64,10 @@ impl Brush {
self.aabb = Aabb::from_positions(&self.vertices); 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<Vec3> { pub fn get_vertices(&self) -> Vec<Vec3> {
self.vertices.clone() self.vertices.clone()
} }