diff --git a/csg/src/plane.rs b/csg/src/plane.rs index aba3730..787f383 100644 --- a/csg/src/plane.rs +++ b/csg/src/plane.rs @@ -28,6 +28,15 @@ impl Plane { } } +impl From for Plane { + fn from(value: Vec4) -> Self { + Self { + normal: Vec3::new(value.x, value.y, value.z), + offset: -value.w, + } + } +} + impl PartialEq for Plane { fn eq(&self, other: &Self) -> bool { (self.normal.x - other.normal.x).abs() < math::EPSILON