Struct graphene::Triangle [−][src]
pub struct Triangle(_);
Expand description
A triangle.
Implementations
Computes the barycentric coordinates
of the given point p
.
The point p
must lie on the same plane as the triangle self
; if the
point is not coplanar, the result of this function is undefined.
If we place the origin in the coordinates of the triangle’s A point,
the barycentric coordinates are u
, which is on the AC vector; and v
which is on the AB vector:
The returned Vec2
contains the following values, in order:
res.x = u
res.y = v
p
a Point3D
Returns
true
if the barycentric coordinates are valid
res
return location for the vector with the barycentric coordinates
Computes the UV coordinates of the given point p
.
The point p
must lie on the same plane as the triangle self
; if the point
is not coplanar, the result of this function is undefined. If p
is None
,
the point will be set in (0, 0, 0).
The UV coordinates will be placed in the res
vector:
res.x = u
res.y = v
See also: barycoords()
p
a Point3D
uv_a
the UV coordinates of the first point
uv_b
the UV coordinates of the second point
uv_c
the UV coordinates of the third point
Returns
true
if the coordinates are valid
res
a vector containing the UV coordinates
of the given point p
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Returns the type identifier of Self
.
Auto Trait Implementations
impl RefUnwindSafe for Triangle
impl UnwindSafe for Triangle
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<'a, T, C> FromValueOptional<'a> for T where
C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,
T: FromValue<'a, Checker = C>,