pub struct ClipPlane {
pub equation: DVec4,
}Expand description
An oriented half-space clip plane in world space.
Points with plane · (pos, 1) < 0 are clipped (not rendered).
Up to 6 planes are supported simultaneously by the GPU shader.
Fields§
§equation: DVec4Plane equation as (nx, ny, nz, d) where nx·x + ny·y + nz·z + d = 0.
(nx, ny, nz) should be a unit normal.
Implementations§
Source§impl ClipPlane
impl ClipPlane
Sourcepub fn from_point_and_normal(point: DVec3, normal: DVec3) -> Self
pub fn from_point_and_normal(point: DVec3, normal: DVec3) -> Self
Create a clip plane from a point on the plane and an outward normal.
Points on the normal-facing side of the plane are kept; points behind are clipped.
Sourcepub fn signed_distance(&self, pos: DVec3) -> f64
pub fn signed_distance(&self, pos: DVec3) -> f64
Signed distance of pos from the plane (positive = kept side).
Trait Implementations§
impl Copy for ClipPlane
impl StructuralPartialEq for ClipPlane
Auto Trait Implementations§
impl Freeze for ClipPlane
impl RefUnwindSafe for ClipPlane
impl Send for ClipPlane
impl Sync for ClipPlane
impl Unpin for ClipPlane
impl UnsafeUnpin for ClipPlane
impl UnwindSafe for ClipPlane
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more