[][src]Struct gdnative::prelude::Plane

#[repr(C)]pub struct Plane {
    pub normal: Vector3D<f32, UnknownUnit>,
    pub d: f32,
}

Plane in hessian form.

Fields

normal: Vector3D<f32, UnknownUnit>d: f32

Implementations

impl Plane[src]

pub fn new(normal: Vector3D<f32, UnknownUnit>, d: f32) -> Plane[src]

Creates a new Plane from the 'Vector3' normal and the distance from the origin.

pub fn from_coordinates(a: f32, b: f32, c: f32, d: f32) -> Plane[src]

Creates a new Plane from four floats. a, b, c are used for the normal 'Vector3'. d is the distance from the origin.

pub fn from_points(
    a: Vector3D<f32, UnknownUnit>,
    b: Vector3D<f32, UnknownUnit>,
    c: Vector3D<f32, UnknownUnit>
) -> Option<Plane>
[src]

Creates a new Plane from three Vector3, given in clockwise order. If all three points are collinear, returns None.

pub fn center(&self) -> Vector3D<f32, UnknownUnit>[src]

Returns the center of the Plane.

pub fn distance_to(&self, point: Vector3D<f32, UnknownUnit>) -> f32[src]

Returns the shortest distance from the Plane to point.

pub fn has_point(&self, point: Vector3D<f32, UnknownUnit>, epsilon: f32) -> bool[src]

Returns true if point is inside the Plane. epislon specifies the minimum threshold to be considered inside the Plane.

pub fn intersect_3(
    &self,
    b: Plane,
    c: Plane
) -> Option<Vector3D<f32, UnknownUnit>>
[src]

Returns the intersection point of the three planes b, c and this Plane. Returns None if the 'Plane's don't intersect.

pub fn intersects_ray(
    &self,
    from: Vector3D<f32, UnknownUnit>,
    dir: Vector3D<f32, UnknownUnit>
) -> Option<Vector3D<f32, UnknownUnit>>
[src]

Returns the intersection point of a ray consisting of the position from and the direction normal dir with this plane/ Returns None if the ray doesn't intersect.

pub fn intersects_segment(
    &self,
    begin: Vector3D<f32, UnknownUnit>,
    end: Vector3D<f32, UnknownUnit>
) -> Option<Vector3D<f32, UnknownUnit>>
[src]

Returns the intersection point of a segment from begin to end with this Plane. Returns None if the the segment doesn't intersect.

pub fn approx_eq(&self, other: Plane) -> bool[src]

Returns true if this Plane and other are approximately equal. Determined by running approx_eq on both normal and d.

pub fn is_point_over(&self, point: Vector3D<f32, UnknownUnit>) -> bool[src]

Returns true if point is above the Plane.

pub fn normalize(self) -> Plane[src]

Returns the Plane normalized.

pub fn project(
    &self,
    point: Vector3D<f32, UnknownUnit>
) -> Vector3D<f32, UnknownUnit>
[src]

Returns the orthogonal projection of point into a point in the Plane.

Trait Implementations

impl Clone for Plane[src]

impl Copy for Plane[src]

impl Debug for Plane[src]

impl Export for Plane[src]

type Hint = ()

A type-specific hint type that is valid for the type being exported.

impl FromVariant for Plane[src]

impl PartialEq<Plane> for Plane[src]

impl StructuralPartialEq for Plane[src]

impl ToVariant for Plane[src]

Auto Trait Implementations

impl RefUnwindSafe for Plane

impl Send for Plane

impl Sync for Plane

impl Unpin for Plane

impl UnwindSafe for Plane

Blanket Implementations

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

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

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

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

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

impl<T> OwnedToVariant for T where
    T: ToVariant
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.