pub struct BarycentricCoords {
pub u: f64,
pub v: f64,
pub w: f64,
}Expand description
Barycentric coordinate utilities.
Fields§
§u: f64First barycentric coordinate.
v: f64Second barycentric coordinate.
w: f64Third barycentric coordinate.
Implementations§
Source§impl BarycentricCoords
impl BarycentricCoords
Sourcepub fn compute(v0: [f64; 3], v1: [f64; 3], v2: [f64; 3], p: [f64; 3]) -> Self
pub fn compute(v0: [f64; 3], v1: [f64; 3], v2: [f64; 3], p: [f64; 3]) -> Self
Compute barycentric coordinates of point p in triangle (v0,v1,v2).
Sourcepub fn is_inside(&self) -> bool
pub fn is_inside(&self) -> bool
Check if the barycentric coordinates represent a point inside the triangle.
Trait Implementations§
Source§impl Clone for BarycentricCoords
impl Clone for BarycentricCoords
Source§fn clone(&self) -> BarycentricCoords
fn clone(&self) -> BarycentricCoords
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BarycentricCoords
impl Debug for BarycentricCoords
impl Copy for BarycentricCoords
Auto Trait Implementations§
impl Freeze for BarycentricCoords
impl RefUnwindSafe for BarycentricCoords
impl Send for BarycentricCoords
impl Sync for BarycentricCoords
impl Unpin for BarycentricCoords
impl UnsafeUnpin for BarycentricCoords
impl UnwindSafe for BarycentricCoords
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§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 moreSource§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).Source§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.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.