[][src]Struct mini_collide::Plane

pub struct Plane {
    pub normal: Vector,
    pub d: f32,
}

An infinite plane.

Fields

normal: Vector

The normal that liest perpendicular to the plane.

d: f32

The distance from the plane to the origin.

Methods

impl Plane[src]

pub fn new(normal: Vector, d: f32) -> Self[src]

Construct a plane given the components of the plan equation.

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

Constructs a plane from three points that lie on the plane.

pub fn from_point_and_normal(p: Point, normal: Vector) -> Self[src]

Constructs a plane from a point that lies on the plane, and the normal to the plane.

pub fn distance(&self, p: Point) -> f32[src]

Returns the signed distance between the plane and a given point.

pub fn point_closest_to(&self, p: Point) -> Point[src]

Returns the point on the plane that is closest to the given point.

Trait Implementations

impl Intersection<Ray> for Plane[src]

impl Intersection<Plane> for Ray[src]

impl Intersection<Sphere> for Plane[src]

impl Intersection<Plane> for Sphere[src]

impl<'_> From<&'_ Triangle> for Plane[src]

fn from(t: &Triangle) -> Self[src]

Convert a vector into a point

impl Debug for Plane[src]

Auto Trait Implementations

impl Send for Plane

impl Sync for Plane

impl Unpin for Plane

impl UnwindSafe for Plane

impl RefUnwindSafe for Plane

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]