Struct fyrox_core::math::plane::Plane
source · pub struct Plane {
pub normal: Vector3<f32>,
pub d: f32,
}
Fields§
§normal: Vector3<f32>
§d: f32
Implementations§
source§impl Plane
impl Plane
sourcepub fn from_normal_and_point(
normal: &Vector3<f32>,
point: &Vector3<f32>
) -> Option<Self>
pub fn from_normal_and_point( normal: &Vector3<f32>, point: &Vector3<f32> ) -> Option<Self>
Creates plane from a point and normal vector at that point. May fail if normal is degenerated vector.
sourcepub fn from_triangle(
a: &Vector3<f32>,
b: &Vector3<f32>,
c: &Vector3<f32>
) -> Option<Self>
pub fn from_triangle( a: &Vector3<f32>, b: &Vector3<f32>, c: &Vector3<f32> ) -> Option<Self>
Tries to create a plane from three points (triangle). May fail if the triangle is degenerated (collapsed into a point or a line).
sourcepub fn from_abcd(a: f32, b: f32, c: f32, d: f32) -> Option<Self>
pub fn from_abcd(a: f32, b: f32, c: f32, d: f32) -> Option<Self>
Creates plane using coefficients of plane equation Ax + By + Cz + D = 0 May fail if length of normal vector is zero (normal is degenerated vector).
pub fn dot(&self, point: &Vector3<f32>) -> f32
pub fn distance(&self, point: &Vector3<f32>) -> f32
sourcepub fn project(&self, point: &Vector3<f32>) -> Vector3<f32>
pub fn project(&self, point: &Vector3<f32>) -> Vector3<f32>
Projects the given point onto the plane along the normal vector of the plane.
Trait Implementations§
source§impl PartialEq for Plane
impl PartialEq for Plane
impl Copy for Plane
impl StructuralPartialEq for Plane
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.