Add Eq implementations for Plane and basic derives for PlaneIntersection
This commit is contained in:
parent
c57d94230e
commit
dafdbaf319
|
@ -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 struct PlaneIntersection {
|
||||||
pub planes: [Plane; 3],
|
pub planes: [Plane; 3],
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue