Implement From<Vec4> for Plane
This commit is contained in:
parent
edb70037d6
commit
0c6fd180f3
|
@ -28,6 +28,15 @@ impl Plane {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<Vec4> 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
|
||||
|
|
Loading…
Reference in New Issue