Plane

Struct Plane 

Source
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

Source

pub fn new(normal: Vector3, d: f32) -> Self

Construct a plane given the components of the plan equation

Source

pub fn from_points(p0: Point, p1: Point, p2: Point) -> Self

Constructs a plane from three points that lie on the plane

Source

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

Source§

fn closest_point(&self, other: &Point) -> Point

The closest point to another object
Source§

impl ClosestPoint<Ray> for Plane

Source§

fn closest_point(&self, other: &Ray) -> Point

The closest point to another object
Source§

impl Debug for Plane

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Distance<Point> for Plane

Source§

fn distance(&self, p: &Point) -> f32

The distance between two objects
Source§

impl From<&Triangle> for Plane

Source§

fn from(t: &Triangle) -> Self

Converts to this type from the input type.
Source§

impl Intersection<Plane> for Ray

Source§

fn intersects(&self, plane: &Plane) -> bool

Whether this shape intersect with the other
Source§

impl Intersection<Plane> for Sphere

Source§

fn intersects(&self, plane: &Plane) -> bool

Whether this shape intersect with the other
Source§

impl Intersection<Ray> for Plane

Source§

fn intersects(&self, ray: &Ray) -> bool

Whether this shape intersect with the other
Source§

impl Intersection<Sphere> for Plane

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.