[][src]Struct ultraviolet::geometry::Planeu

#[repr(C)]pub struct Planeu {
    pub normal: Vec3u,
    pub bias: u32,
}

A plane which can be intersected by a ray.

Fields

normal: Vec3u

plane described as x,y,z normal

bias: u32

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

Methods

impl Planeu[src]

pub fn new(normal: Vec3u, bias: u32) -> Self[src]

Create a new Plane.

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

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

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

Create a new Plane from a point normal representation

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

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

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

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

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

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

pub fn normal(&self) -> Vec3u[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: Vec3u) -> u32[src]

Returns the dot product of this Plane and a provided Vec3

pub fn dot(&self, point: Vec3u) -> u32[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: Planeu) -> u32[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: Vec3u, direction: Vec3u) -> Option<u32>[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: Rayu) -> Option<u32>[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 Planeu[src]

impl Copy for Planeu[src]

impl Debug for Planeu[src]

impl Eq for Planeu[src]

impl Hash for Planeu[src]

impl PartialEq<Planeu> for Planeu[src]

impl StructuralEq for Planeu[src]

impl StructuralPartialEq for Planeu[src]

Auto Trait Implementations

impl RefUnwindSafe for Planeu

impl Send for Planeu

impl Sync for Planeu

impl Unpin for Planeu

impl UnwindSafe for Planeu

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.