diff --git a/csg/src/brush.rs b/csg/src/brush.rs index 817c183..0bded9c 100644 --- a/csg/src/brush.rs +++ b/csg/src/brush.rs @@ -69,17 +69,18 @@ impl Brush { } pub fn planes_intersect_with(&self, other: &Brush) -> bool { - // TODO: Benchmark this // Check our vertices against their planes - for pi in &self.raw_vertices { - if other.planes.iter().all(|bp| pi.in_halfspace_mat(&bp.plane)) { + for v in &self.vertices { + let mut iter = other.planes.iter(); + if iter.all(|bp| bp.plane.point_in_halfspace(*v)) { return true; } } // Check their vertices against our planes - for pi in &other.raw_vertices { - if self.planes.iter().all(|bp| pi.in_halfspace_mat(&bp.plane)) { + for v in &other.vertices { + let mut iter = self.planes.iter(); + if iter.all(|bp| bp.plane.point_in_halfspace(*v)) { return true; } }