pub struct Plane { /* private fields */ }Expand description
A plane in Hessian normal form: ax + by + cz + d = 0.
The normal [a, b, c] is always unit-length after extraction. The sign
convention is: positive distance_to_point
means the query point is on the inside (visible) half-space.
Implementations§
Source§impl Plane
impl Plane
Sourcepub fn new(normal: [f64; 3], d: f64) -> Self
pub fn new(normal: [f64; 3], d: f64) -> Self
Construct a plane from a unit normal and signed distance.
The caller is responsible for ensuring the normal is unit-length; no normalisation is performed here.
Sourcepub fn normal(&self) -> [f64; 3]
pub fn normal(&self) -> [f64; 3]
The inward-facing normal of this plane.
For frustum planes extracted via the Gribb/Hartmann method, this
normal points into the frustum volume. A positive
distance_to_point value means the
query point is on the inside (visible) side of the plane.
Sourcepub fn distance_to_point(&self, x: f64, y: f64, z: f64) -> f64
pub fn distance_to_point(&self, x: f64, y: f64, z: f64) -> f64
Signed distance from a point to this plane.
- Positive: the point is inside the frustum on this plane’s side.
- Zero: the point lies exactly on the plane.
- Negative: the point is outside.
Because the normal is unit-length, the returned value is a true metric distance in the same units as the input coordinates (meters).