diff --git a/csg/src/plane.rs b/csg/src/plane.rs index dbc4635..bc9db1d 100644 --- a/csg/src/plane.rs +++ b/csg/src/plane.rs @@ -22,6 +22,18 @@ impl Plane { } } +impl PartialEq for Plane { + fn eq(&self, other: &Self) -> bool { + (self.normal.x - other.normal.x).abs() < math::EPSILON + && (self.normal.y - other.normal.y).abs() < math::EPSILON + && (self.normal.z - other.normal.z).abs() < math::EPSILON + && (self.offset - other.offset).abs() < math::EPSILON + } +} + +impl Eq for Plane {} + +#[derive(Clone, Copy, Debug)] pub struct PlaneIntersection { pub planes: [Plane; 3], }