#[repr(transparent)]pub struct Triangle<T>(pub [Vec2<T>; 3]);Expand description
A triangle, represented by 3 points.
Tuple Fields§
§0: [Vec2<T>; 3]Implementations§
Source§impl<T> Triangle<T>
impl<T> Triangle<T>
Sourcepub fn abs_diff_eq(&self, other: &Triangle<T>) -> bool
pub fn abs_diff_eq(&self, other: &Triangle<T>) -> bool
Returns true if the two values are approximately equal according to the absolute difference between their components.
Source§impl<T> Triangle<T>where
T: Copy + RelativeEq<Epsilon = T>,
impl<T> Triangle<T>where
T: Copy + RelativeEq<Epsilon = T>,
Sourcepub fn relative_eq(&self, other: &Triangle<T>) -> bool
pub fn relative_eq(&self, other: &Triangle<T>) -> bool
Returns true if the two values are approximately equal according to the absolute difference between their components, as well as relative-based comparisons.
Trait Implementations§
Source§impl<T> AbsDiffEq for Triangle<T>
impl<T> AbsDiffEq for Triangle<T>
Source§fn default_epsilon() -> <Triangle<T> as AbsDiffEq>::Epsilon
fn default_epsilon() -> <Triangle<T> as AbsDiffEq>::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(
&self,
other: &Triangle<T>,
epsilon: <Triangle<T> as AbsDiffEq>::Epsilon,
) -> bool
fn abs_diff_eq( &self, other: &Triangle<T>, epsilon: <Triangle<T> as AbsDiffEq>::Epsilon, ) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq.impl<T> Copy for Triangle<T>where
T: Copy,
Source§impl<'de, T> Deserialize<'de> for Triangle<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Triangle<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Triangle<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Triangle<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<T> Eq for Triangle<T>where
T: Eq,
Source§impl<T> Interp for Triangle<T>
impl<T> Interp for Triangle<T>
Source§fn lerp(
self,
target: Triangle<T>,
t: <Triangle<T> as Interp>::Factor,
) -> Triangle<T>
fn lerp( self, target: Triangle<T>, t: <Triangle<T> as Interp>::Factor, ) -> Triangle<T>
Linear interpolation.
Source§fn quad_bezier(
self,
control: Triangle<T>,
target: Triangle<T>,
t: <Triangle<T> as Interp>::Factor,
) -> Triangle<T>
fn quad_bezier( self, control: Triangle<T>, target: Triangle<T>, t: <Triangle<T> as Interp>::Factor, ) -> Triangle<T>
Quadratic bezier interpolation.
Source§fn cubic_bezier(
self,
control1: Triangle<T>,
control2: Triangle<T>,
target: Triangle<T>,
t: <Triangle<T> as Interp>::Factor,
) -> Triangle<T>
fn cubic_bezier( self, control1: Triangle<T>, control2: Triangle<T>, target: Triangle<T>, t: <Triangle<T> as Interp>::Factor, ) -> Triangle<T>
Cubic bezier interpolation.
Source§fn hermite(
self,
tangent1: <Triangle<T> as Interp>::Factor,
target: Triangle<T>,
tangent2: <Triangle<T> as Interp>::Factor,
t: <Triangle<T> as Interp>::Factor,
) -> Triangle<T>
fn hermite( self, tangent1: <Triangle<T> as Interp>::Factor, target: Triangle<T>, tangent2: <Triangle<T> as Interp>::Factor, t: <Triangle<T> as Interp>::Factor, ) -> Triangle<T>
Cubic Hermite interpolation. Read more
Source§impl<T> Numeric for Triangle<T>
impl<T> Numeric for Triangle<T>
type AsU8 = Triangle<u8>
type AsU16 = Triangle<u16>
type AsU32 = Triangle<u32>
type AsU64 = Triangle<u64>
type AsU128 = Triangle<u128>
type AsUSize = Triangle<usize>
type AsI8 = Triangle<i8>
type AsI16 = Triangle<i16>
type AsI32 = Triangle<i32>
type AsI64 = Triangle<i64>
type AsI128 = Triangle<i128>
type AsISize = Triangle<isize>
type AsF32 = Triangle<f32>
type AsF64 = Triangle<f64>
fn to_u8(self) -> Triangle<u8>
fn to_u16(self) -> Triangle<u16>
fn to_u32(self) -> Triangle<u32>
fn to_u64(self) -> Triangle<u64>
fn to_u128(self) -> Triangle<u128>
fn to_usize(self) -> Triangle<usize>
fn to_i8(self) -> Triangle<i8>
fn to_i16(self) -> Triangle<i16>
fn to_i32(self) -> Triangle<i32>
fn to_i64(self) -> Triangle<i64>
fn to_i128(self) -> Triangle<i128>
fn to_isize(self) -> Triangle<isize>
fn to_f32(self) -> Triangle<f32>
fn to_f64(self) -> Triangle<f64>
Source§impl<T> Ord for Triangle<T>where
T: Ord,
impl<T> Ord for Triangle<T>where
T: Ord,
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<T> PartialOrd for Triangle<T>where
T: PartialOrd,
impl<T> PartialOrd for Triangle<T>where
T: PartialOrd,
impl<T> Pod for Triangle<T>where
T: Pod,
Source§impl<T> RelativeEq for Triangle<T>
impl<T> RelativeEq for Triangle<T>
Source§fn default_max_relative() -> <Triangle<T> as AbsDiffEq>::Epsilon
fn default_max_relative() -> <Triangle<T> as AbsDiffEq>::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
Source§fn relative_eq(
&self,
other: &Triangle<T>,
epsilon: <Triangle<T> as AbsDiffEq>::Epsilon,
max_relative: <Triangle<T> as AbsDiffEq>::Epsilon,
) -> bool
fn relative_eq( &self, other: &Triangle<T>, epsilon: <Triangle<T> as AbsDiffEq>::Epsilon, max_relative: <Triangle<T> as AbsDiffEq>::Epsilon, ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
The inverse of
RelativeEq::relative_eq.Source§impl<T> Serialize for Triangle<T>where
T: Serialize,
impl<T> Serialize for Triangle<T>where
T: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T> StructuralPartialEq for Triangle<T>where
T: PartialEq,
Source§impl<T> UlpsEq for Triangle<T>
impl<T> UlpsEq for Triangle<T>
Source§fn default_max_ulps() -> u32
fn default_max_ulps() -> u32
The default ULPs to tolerate when testing values that are far-apart. Read more
Auto Trait Implementations§
impl<T> Forget for Triangle<T>
impl<T> Freeze for Triangle<T>
impl<T> RefUnwindSafe for Triangle<T>
impl<T> Send for Triangle<T>
impl<T> Sync for Triangle<T>
impl<T> Unpin for Triangle<T>
impl<T> UnsafeUnpin for Triangle<T>
impl<T> UnwindSafe for Triangle<T>
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> NoUninit for Twhere
T: Pod,
Source§impl<T, S> Polygonal<T> for S
impl<T, S> Polygonal<T> for S
Source§fn nearest_vertex(&self, source: Vec2<T>) -> Vec2<T>
fn nearest_vertex(&self, source: Vec2<T>) -> Vec2<T>
Get the nearest point on this polygon to the source point.
Source§fn all_edges<F>(&self, cond: F) -> bool
fn all_edges<F>(&self, cond: F) -> bool
Iterate all polygonal edges of the shape, returning true if
any of them satisfy the conditional function provided.
Source§fn all_normals<F>(&self, cond: F) -> bool
fn all_normals<F>(&self, cond: F) -> bool
Iterate all edge normals of the shape, returning true if
any of them satisfy the conditional function provided.
Source§fn visit_normals<F>(&self, plot: F)
fn visit_normals<F>(&self, plot: F)
Walk through every normal of the polygon.
Source§fn visit_edges<F>(&self, plot: F)
fn visit_edges<F>(&self, plot: F)
Walk through every edge of the polygon.
Source§impl<T, S> Shape<T> for S
impl<T, S> Shape<T> for S
Source§fn project_onto_axis(&self, axis: Vec2<T>) -> Projection<T>
fn project_onto_axis(&self, axis: Vec2<T>) -> Projection<T>
Project the shape onto the axis.
Source§fn project_point(&self, p: Vec2<T>) -> Vec2<T>
fn project_point(&self, p: Vec2<T>) -> Vec2<T>
Project a point onto the outside surface of the shape.
Source§fn overlaps_rect(&self, rect: &Rect<T>) -> bool
fn overlaps_rect(&self, rect: &Rect<T>) -> bool
If this shape overlaps the rectangle.
Source§fn overlaps_circ(&self, circ: &Circle<T>) -> bool
fn overlaps_circ(&self, circ: &Circle<T>) -> bool
If this shape overlaps the circle.
Source§fn overlaps_poly<P>(&self, poly: &P) -> boolwhere
P: Polygonal<T>,
fn overlaps_poly<P>(&self, poly: &P) -> boolwhere
P: Polygonal<T>,
If this shape overlaps the polygon.
Source§fn extract_from_circ(&self, circ: &Circle<T>) -> Option<Vec2<T>>
fn extract_from_circ(&self, circ: &Circle<T>) -> Option<Vec2<T>>
If this shape and the circle overlap, return a push-out
vector that can be used to extract them from each other.