[][src]Struct ultraviolet::geometry::Plane

#[repr(C)]pub struct Plane {
    pub normal: Vec3,
    pub bias: f32,
}

A plane which can be intersected by a ray.

Fields

normal: Vec3

plane described as x,y,z normal

bias: f32

dot product of the point and normal, representing the plane position

Methods

impl Plane[src]

pub fn new(normal: Vec3, bias: f32) -> Self[src]

Create a new Plane.

pub fn from_point_normal(point: Vec3, normal: Vec3) -> Self[src]

Create a new Plane from a point normal representation. The normal parameter must already be normalized.

pub fn from_point_vectors(point: Vec3, v1: Vec3, v2: Vec3) -> Self[src]

Create a new Plane from a point normal representation

pub fn with_x(x: f32) -> Self[src]

Create a Plane which is facing along the X-Axis at the provided coordinate.

pub fn with_y(y: f32) -> Self[src]

Create a Plane which is facing along the Y-Axis at the provided coordinate.

pub fn with_z(z: f32) -> Self[src]

Create a Plane which is facing along the Z-Axis at the provided coordinate.

pub fn normal(&self) -> Vec3[src]

f32his Plane normal

pub fn normalize(&mut self)[src]

Normalized representation of this Plane

pub fn normalized(&self) -> Self[src]

Normalized representation of this Plane

pub fn dot_point(&self, point: Vec3) -> f32[src]

Returns the dot product of this Plane and a provided Vec3

pub fn dot(&self, point: Vec3) -> f32[src]

Returns the dot product of this Plane and a provided Vec3, assumed to be a normal, computed with this planes normal.

pub fn dot_plane(&self, plane: Plane) -> f32[src]

Returns the dot product of this Plane with another Plane. This is computed against the two plane normals.

pub fn intersect_line(&self, point: Vec3, direction: Vec3) -> Option<f32>[src]

Returns the intersection distance of the provided line given a point and direction, or None if none occurs.

Warning: These intersection methods do not check for the ray never intersecting. This is up to the user to confirm.

pub fn intersect_ray(&self, ray: Ray) -> Option<f32>[src]

Returns the intersection distance of the provided Ray, or None if none occurs.

Warning: These intersection methods do not check for the ray never intersecting. This is up to the user to confirm.

Trait Implementations

impl Clone for Plane[src]

impl Copy for Plane[src]

impl Debug 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> 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.