diff --git a/csg/src/plane.rs b/csg/src/plane.rs index 1d44852..746567d 100644 --- a/csg/src/plane.rs +++ b/csg/src/plane.rs @@ -23,6 +23,10 @@ impl Plane { } } + pub fn point_in_halfspace(&self, point: Vec3) -> bool { + self.normal.dot(point) - self.offset <= math::EPSILON + } + pub fn into_vec4(&self) -> Vec4 { glam::vec4(self.normal.x, self.normal.y, self.normal.z, -self.offset) }