[−][src]Struct ultraviolet::geometry::Planei
A plane which can be intersected by a ray.
Fields
normal: Vec3i
plane described as x,y,z normal
bias: i32
dot product of the point and normal, representing the plane position
Methods
impl Planei
[src]
pub fn new(normal: Vec3i, bias: i32) -> Self
[src]
Create a new Plane
.
pub fn from_point_normal(point: Vec3i, normal: Vec3i) -> Self
[src]
Create a new Plane
from a point normal representation. The normal parameter must already be normalized.
pub fn from_point_vectors(point: Vec3i, v1: Vec3i, v2: Vec3i) -> Self
[src]
Create a new Plane
from a point normal representation
pub fn with_x(x: i32) -> Self
[src]
Create a Plane
which is facing along the X-Axis at the provided coordinate.
pub fn with_y(y: i32) -> Self
[src]
Create a Plane
which is facing along the Y-Axis at the provided coordinate.
pub fn with_z(z: i32) -> Self
[src]
Create a Plane
which is facing along the Z-Axis at the provided coordinate.
pub fn normal(&self) -> Vec3i
[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: Vec3i) -> i32
[src]
Returns the dot product of this Plane
and a provided Vec3
pub fn dot(&self, point: Vec3i) -> i32
[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: Planei) -> i32
[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: Vec3i, direction: Vec3i) -> Option<i32>
[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: Rayi) -> Option<i32>
[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 Planei
[src]
impl Copy for Planei
[src]
impl Debug for Planei
[src]
impl Eq for Planei
[src]
impl Hash for Planei
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Planei> for Planei
[src]
impl StructuralEq for Planei
[src]
impl StructuralPartialEq for Planei
[src]
Auto Trait Implementations
impl RefUnwindSafe for Planei
impl Send for Planei
impl Sync for Planei
impl Unpin for Planei
impl UnwindSafe for Planei
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,