pub struct Plane<T: Scalar> { /* private fields */ }Expand description
A plane defined by ax + by + cz + d = 0.
Implementations§
Source§impl<T: FloatScalar> Plane<T>
impl<T: FloatScalar> Plane<T>
Sourcepub fn new(n: &Vector3<T>, p: &Vector3<T>) -> Self
pub fn new(n: &Vector3<T>, p: &Vector3<T>) -> Self
Creates a plane from a normal and a point on the plane.
§Panics
Panics if n is too small to normalize. Use Plane::try_new when the
input may be degenerate.
Sourcepub fn try_new(n: &Vector3<T>, p: &Vector3<T>, epsilon: T) -> Option<Self>
pub fn try_new(n: &Vector3<T>, p: &Vector3<T>, epsilon: T) -> Option<Self>
Creates a plane from a normal and a point on the plane.
Returns None if n is too small to normalize.
Sourcepub fn from_tri(v0: &Vector3<T>, v1: &Vector3<T>, v2: &Vector3<T>) -> Self
pub fn from_tri(v0: &Vector3<T>, v1: &Vector3<T>, v2: &Vector3<T>) -> Self
Creates a plane from triangle vertices.
§Panics
Panics if the triangle is degenerate. Use Plane::try_from_tri when
the input may be degenerate.
Sourcepub fn try_from_tri(
v0: &Vector3<T>,
v1: &Vector3<T>,
v2: &Vector3<T>,
epsilon: T,
) -> Option<Self>
pub fn try_from_tri( v0: &Vector3<T>, v1: &Vector3<T>, v2: &Vector3<T>, epsilon: T, ) -> Option<Self>
Creates a plane from triangle vertices.
Returns None if the triangle is degenerate.
Sourcepub fn from_quad(
v0: &Vector3<T>,
v1: &Vector3<T>,
v2: &Vector3<T>,
v3: &Vector3<T>,
) -> Self
pub fn from_quad( v0: &Vector3<T>, v1: &Vector3<T>, v2: &Vector3<T>, v3: &Vector3<T>, ) -> Self
Creates a plane from quad vertices.
§Panics
Panics if the quad diagonals do not define a plane. Use
Plane::try_from_quad when the input may be degenerate.
Sourcepub fn try_from_quad(
v0: &Vector3<T>,
v1: &Vector3<T>,
v2: &Vector3<T>,
v3: &Vector3<T>,
epsilon: T,
) -> Option<Self>
pub fn try_from_quad( v0: &Vector3<T>, v1: &Vector3<T>, v2: &Vector3<T>, v3: &Vector3<T>, epsilon: T, ) -> Option<Self>
Creates a plane from quad vertices.
Returns None if the quad diagonals do not define a plane.
Trait Implementations§
impl<T: Copy + Scalar> Copy for Plane<T>
Auto Trait Implementations§
impl<T> Freeze for Plane<T>where
T: Freeze,
impl<T> RefUnwindSafe for Plane<T>where
T: RefUnwindSafe,
impl<T> Send for Plane<T>where
T: Send,
impl<T> Sync for Plane<T>where
T: Sync,
impl<T> Unpin for Plane<T>where
T: Unpin,
impl<T> UnsafeUnpin for Plane<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Plane<T>where
T: UnwindSafe,
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