Add halfspace check to plane
This commit is contained in:
parent
e1688f6841
commit
93266ed328
|
@ -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 {
|
pub fn into_vec4(&self) -> Vec4 {
|
||||||
glam::vec4(self.normal.x, self.normal.y, self.normal.z, -self.offset)
|
glam::vec4(self.normal.x, self.normal.y, self.normal.z, -self.offset)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue