pub struct Plane3 {
pub point: Vec3,
pub normal: Vec3,
}Expand description
Infinite plane defined by a point on the plane and a (unit) normal.
Fields§
§point: Vec3A point on the plane.
normal: Vec3Unit normal.
Implementations§
Source§impl Plane3
impl Plane3
Sourcepub fn horizontal(z: f64) -> Self
pub fn horizontal(z: f64) -> Self
Constructs a horizontal plane at height z.
Sourcepub fn signed_distance(&self, p: Vec3) -> f64
pub fn signed_distance(&self, p: Vec3) -> f64
Signed distance from p to the plane (positive on normal side).
Sourcepub fn intersect_ray(&self, ray: &Ray3) -> Option<f64>
pub fn intersect_ray(&self, ray: &Ray3) -> Option<f64>
Intersect with a ray. Returns the non-negative t of intersection
or None if parallel or behind the ray origin.
Trait Implementations§
impl Copy for Plane3
impl StructuralPartialEq for Plane3
Auto Trait Implementations§
impl Freeze for Plane3
impl RefUnwindSafe for Plane3
impl Send for Plane3
impl Sync for Plane3
impl Unpin for Plane3
impl UnsafeUnpin for Plane3
impl UnwindSafe for Plane3
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