Use iter to simplify brush plane intersection validation

This commit is contained in:
Jarrod Doyle 2023-09-22 15:57:28 +01:00
parent 92249cf8c8
commit 4116ba40e5
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 2 additions and 9 deletions

View File

@ -104,15 +104,8 @@ impl Brush {
// TODO: No need to check against planes that are part of the intersection // TODO: No need to check against planes that are part of the intersection
let mut raw_vertices = vec![]; let mut raw_vertices = vec![];
for intersection in &intersections { for intersection in &intersections {
let mut valid = true; let mut iter = self.planes.iter();
for bplane in &self.planes { if iter.all(|bplane| intersection.in_halfspace_mat(&bplane.plane)) {
if !intersection.in_halfspace_mat(&bplane.plane) {
valid = false;
break;
}
}
if valid {
raw_vertices.push(*intersection); raw_vertices.push(*intersection);
} }
} }