pub struct Plane {
pub normal: Vector3,
pub d: f32,
}
Expand description
An infinite plane
Fields§
§normal: Vector3
The normal that lies perpendicular to the plane
d: f32
The distance from the plane to the origin
Implementations§
Source§impl Plane
impl Plane
Sourcepub fn new(normal: Vector3, d: f32) -> Self
pub fn new(normal: Vector3, d: f32) -> Self
Construct a plane given the components of the plan equation
Sourcepub fn from_points(p0: Point, p1: Point, p2: Point) -> Self
pub fn from_points(p0: Point, p1: Point, p2: Point) -> Self
Constructs a plane from three points that lie on the plane
Sourcepub fn from_point_and_normal(p: Point, normal: Vector3) -> Self
pub fn from_point_and_normal(p: Point, normal: Vector3) -> Self
Constructs a plane from a point that lies on the plane, and the normal to the plane
Trait Implementations§
Source§impl ClosestPoint<Point> for Plane
impl ClosestPoint<Point> for Plane
Source§fn closest_point(&self, other: &Point) -> Point
fn closest_point(&self, other: &Point) -> Point
The closest point to another object
Source§impl ClosestPoint<Ray> for Plane
impl ClosestPoint<Ray> for Plane
Source§fn closest_point(&self, other: &Ray) -> Point
fn closest_point(&self, other: &Ray) -> Point
The closest point to another object
Source§impl Intersection<Plane> for Ray
impl Intersection<Plane> for Ray
Source§fn intersects(&self, plane: &Plane) -> bool
fn intersects(&self, plane: &Plane) -> bool
Whether this shape intersect with the other
Source§impl Intersection<Plane> for Sphere
impl Intersection<Plane> for Sphere
Source§fn intersects(&self, plane: &Plane) -> bool
fn intersects(&self, plane: &Plane) -> bool
Whether this shape intersect with the other
Source§impl Intersection<Ray> for Plane
impl Intersection<Ray> for Plane
Source§fn intersects(&self, ray: &Ray) -> bool
fn intersects(&self, ray: &Ray) -> bool
Whether this shape intersect with the other
Source§impl Intersection<Sphere> for Plane
impl Intersection<Sphere> for Plane
Source§fn intersects(&self, sphere: &Sphere) -> bool
fn intersects(&self, sphere: &Sphere) -> bool
Whether this shape intersect with the other
Auto Trait Implementations§
impl Freeze for Plane
impl RefUnwindSafe for Plane
impl Send for Plane
impl Sync for Plane
impl Unpin for Plane
impl UnwindSafe for Plane
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