#[repr(C)]pub struct Projection<T> {
pub min: T,
pub max: T,
}Expand description
Represents the projection of a 2D shape on an axis.
This primitive does not contain the axis itself, merely the start and end bounds of the projection. This is used in overlap checks for convex shapes.
Fields§
§min: T§max: TImplementations§
Source§impl<T: Pod + NoUninit> Projection<T>
impl<T: Pod + NoUninit> Projection<T>
Source§impl<T: Copy + AbsDiffEq<Epsilon = T>> Projection<T>
impl<T: Copy + AbsDiffEq<Epsilon = T>> Projection<T>
Sourcepub fn abs_diff_eq(&self, other: &Self) -> bool
pub fn abs_diff_eq(&self, other: &Self) -> bool
Returns true if the two values are approximately equal according to the absolute difference between their components.
Source§impl<T: Copy + RelativeEq<Epsilon = T>> Projection<T>
impl<T: Copy + RelativeEq<Epsilon = T>> Projection<T>
Sourcepub fn relative_eq(&self, other: &Self) -> bool
pub fn relative_eq(&self, other: &Self) -> bool
Returns true if the two values are approximately equal according to the absolute difference between their components, as well as relative-based comparisons.
Source§impl<T: Copy + UlpsEq<Epsilon = T>> Projection<T>
impl<T: Copy + UlpsEq<Epsilon = T>> Projection<T>
Source§impl<T> Projection<T>
impl<T> Projection<T>
Source§impl<T: Num> Projection<T>
impl<T: Num> Projection<T>
Trait Implementations§
Source§impl<T> AbsDiffEq for Projection<T>
impl<T> AbsDiffEq for Projection<T>
Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::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.Source§impl<T: Copy + Add<T, Output = T>> Add<&Projection<T>> for &Projection<T>
impl<T: Copy + Add<T, Output = T>> Add<&Projection<T>> for &Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
+ operator.Source§impl<T: Copy + Add<T, Output = T>> Add<&Projection<T>> for Projection<T>
impl<T: Copy + Add<T, Output = T>> Add<&Projection<T>> for Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
+ operator.Source§impl<T: Copy + Add<T, Output = T>> Add<Projection<T>> for &Projection<T>
impl<T: Copy + Add<T, Output = T>> Add<Projection<T>> for &Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
+ operator.Source§impl<T: Add<T, Output = T>> Add for Projection<T>
impl<T: Add<T, Output = T>> Add for Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
+ operator.Source§impl<T: Copy + AddAssign<T>> AddAssign<&Projection<T>> for Projection<T>
impl<T: Copy + AddAssign<T>> AddAssign<&Projection<T>> for Projection<T>
Source§fn add_assign(&mut self, rhs: &Projection<T>)
fn add_assign(&mut self, rhs: &Projection<T>)
Performs the
+= operation. Read moreSource§impl<T: Copy + AddAssign<T>> AddAssign<&T> for Projection<T>
impl<T: Copy + AddAssign<T>> AddAssign<&T> for Projection<T>
Source§fn add_assign(&mut self, rhs: &T)
fn add_assign(&mut self, rhs: &T)
Performs the
+= operation. Read moreSource§impl<T: Copy + AddAssign<T>> AddAssign<T> for Projection<T>
impl<T: Copy + AddAssign<T>> AddAssign<T> for Projection<T>
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
Performs the
+= operation. Read moreSource§impl<T: AddAssign<T>> AddAssign for Projection<T>
impl<T: AddAssign<T>> AddAssign for Projection<T>
Source§fn add_assign(&mut self, rhs: Projection<T>)
fn add_assign(&mut self, rhs: Projection<T>)
Performs the
+= operation. Read moreSource§impl<T: Clone> Clone for Projection<T>
impl<T: Clone> Clone for Projection<T>
Source§fn clone(&self) -> Projection<T>
fn clone(&self) -> Projection<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for Projection<T>
impl<T: Debug> Debug for Projection<T>
Source§impl<'de, T: Deserialize<'de>> Deserialize<'de> for Projection<T>
impl<'de, T: Deserialize<'de>> Deserialize<'de> for Projection<T>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Copy + Div<T, Output = T>> Div<&Projection<T>> for &Projection<T>
impl<T: Copy + Div<T, Output = T>> Div<&Projection<T>> for &Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
/ operator.Source§impl<T: Copy + Div<T, Output = T>> Div<&Projection<T>> for Projection<T>
impl<T: Copy + Div<T, Output = T>> Div<&Projection<T>> for Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
/ operator.Source§impl<T: Copy + Div<T, Output = T>> Div<Projection<T>> for &Projection<T>
impl<T: Copy + Div<T, Output = T>> Div<Projection<T>> for &Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
/ operator.Source§impl<T: Div<T, Output = T>> Div for Projection<T>
impl<T: Div<T, Output = T>> Div for Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
/ operator.Source§impl<T: Copy + DivAssign<T>> DivAssign<&Projection<T>> for Projection<T>
impl<T: Copy + DivAssign<T>> DivAssign<&Projection<T>> for Projection<T>
Source§fn div_assign(&mut self, rhs: &Projection<T>)
fn div_assign(&mut self, rhs: &Projection<T>)
Performs the
/= operation. Read moreSource§impl<T: Copy + DivAssign<T>> DivAssign<&T> for Projection<T>
impl<T: Copy + DivAssign<T>> DivAssign<&T> for Projection<T>
Source§fn div_assign(&mut self, rhs: &T)
fn div_assign(&mut self, rhs: &T)
Performs the
/= operation. Read moreSource§impl<T: Copy + DivAssign<T>> DivAssign<T> for Projection<T>
impl<T: Copy + DivAssign<T>> DivAssign<T> for Projection<T>
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/= operation. Read moreSource§impl<T: DivAssign<T>> DivAssign for Projection<T>
impl<T: DivAssign<T>> DivAssign for Projection<T>
Source§fn div_assign(&mut self, rhs: Projection<T>)
fn div_assign(&mut self, rhs: Projection<T>)
Performs the
/= operation. Read moreSource§impl<T> From<[T; 2]> for Projection<T>
impl<T> From<[T; 2]> for Projection<T>
Source§impl<T> From<(T, T)> for Projection<T>
impl<T> From<(T, T)> for Projection<T>
Source§impl<T> From<Projection<T>> for [T; 2]
impl<T> From<Projection<T>> for [T; 2]
Source§fn from(_: Projection<T>) -> [T; 2]
fn from(_: Projection<T>) -> [T; 2]
Converts to this type from the input type.
Source§impl<T> From<Projection<T>> for (T, T)
impl<T> From<Projection<T>> for (T, T)
Source§fn from(_: Projection<T>) -> (T, T)
fn from(_: Projection<T>) -> (T, T)
Converts to this type from the input type.
Source§impl<T: Hash> Hash for Projection<T>
impl<T: Hash> Hash for Projection<T>
Source§impl<T: Copy + Mul<T, Output = T>> Mul<&Projection<T>> for &Projection<T>
impl<T: Copy + Mul<T, Output = T>> Mul<&Projection<T>> for &Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
* operator.Source§impl<T: Copy + Mul<T, Output = T>> Mul<&Projection<T>> for Projection<T>
impl<T: Copy + Mul<T, Output = T>> Mul<&Projection<T>> for Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
* operator.Source§impl<T: Copy + Mul<T, Output = T>> Mul<Projection<T>> for &Projection<T>
impl<T: Copy + Mul<T, Output = T>> Mul<Projection<T>> for &Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
* operator.Source§impl<T: Mul<T, Output = T>> Mul for Projection<T>
impl<T: Mul<T, Output = T>> Mul for Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
* operator.Source§impl<T: Copy + MulAssign<T>> MulAssign<&Projection<T>> for Projection<T>
impl<T: Copy + MulAssign<T>> MulAssign<&Projection<T>> for Projection<T>
Source§fn mul_assign(&mut self, rhs: &Projection<T>)
fn mul_assign(&mut self, rhs: &Projection<T>)
Performs the
*= operation. Read moreSource§impl<T: Copy + MulAssign<T>> MulAssign<&T> for Projection<T>
impl<T: Copy + MulAssign<T>> MulAssign<&T> for Projection<T>
Source§fn mul_assign(&mut self, rhs: &T)
fn mul_assign(&mut self, rhs: &T)
Performs the
*= operation. Read moreSource§impl<T: Copy + MulAssign<T>> MulAssign<T> for Projection<T>
impl<T: Copy + MulAssign<T>> MulAssign<T> for Projection<T>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*= operation. Read moreSource§impl<T: MulAssign<T>> MulAssign for Projection<T>
impl<T: MulAssign<T>> MulAssign for Projection<T>
Source§fn mul_assign(&mut self, rhs: Projection<T>)
fn mul_assign(&mut self, rhs: Projection<T>)
Performs the
*= operation. Read moreSource§impl<T: Neg<Output = T>> Neg for Projection<T>
impl<T: Neg<Output = T>> Neg for Projection<T>
Source§impl<T: Numeric<AsU8 = u8, AsU16 = u16, AsU32 = u32, AsU64 = u64, AsU128 = u128, AsUSize = usize, AsI8 = i8, AsI16 = i16, AsI32 = i32, AsI64 = i64, AsI128 = i128, AsISize = isize, AsF32 = f32, AsF64 = f64>> Numeric for Projection<T>
impl<T: Numeric<AsU8 = u8, AsU16 = u16, AsU32 = u32, AsU64 = u64, AsU128 = u128, AsUSize = usize, AsI8 = i8, AsI16 = i16, AsI32 = i32, AsI64 = i64, AsI128 = i128, AsISize = isize, AsF32 = f32, AsF64 = f64>> Numeric for Projection<T>
type AsU8 = Projection<u8>
type AsU16 = Projection<u16>
type AsU32 = Projection<u32>
type AsU64 = Projection<u64>
type AsU128 = Projection<u128>
type AsUSize = Projection<usize>
type AsI8 = Projection<i8>
type AsI16 = Projection<i16>
type AsI32 = Projection<i32>
type AsI64 = Projection<i64>
type AsI128 = Projection<i128>
type AsISize = Projection<isize>
type AsF32 = Projection<f32>
type AsF64 = Projection<f64>
fn to_u8(self) -> Projection<u8>
fn to_u16(self) -> Projection<u16>
fn to_u32(self) -> Projection<u32>
fn to_u64(self) -> Projection<u64>
fn to_u128(self) -> Projection<u128>
fn to_usize(self) -> Projection<usize>
fn to_i8(self) -> Projection<i8>
fn to_i16(self) -> Projection<i16>
fn to_i32(self) -> Projection<i32>
fn to_i64(self) -> Projection<i64>
fn to_i128(self) -> Projection<i128>
fn to_isize(self) -> Projection<isize>
fn to_f32(self) -> Projection<f32>
fn to_f64(self) -> Projection<f64>
Source§impl<T: Ord> Ord for Projection<T>
impl<T: Ord> Ord for Projection<T>
Source§fn cmp(&self, other: &Projection<T>) -> Ordering
fn cmp(&self, other: &Projection<T>) -> Ordering
1.21.0 · 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
Source§impl<T: PartialEq> PartialEq for Projection<T>
impl<T: PartialEq> PartialEq for Projection<T>
Source§impl<T: PartialOrd> PartialOrd for Projection<T>
impl<T: PartialOrd> PartialOrd for Projection<T>
Source§impl<T> RelativeEq for Projection<T>
impl<T> RelativeEq for Projection<T>
Source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
Source§fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::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: Copy + Rem<T, Output = T>> Rem<&Projection<T>> for &Projection<T>
impl<T: Copy + Rem<T, Output = T>> Rem<&Projection<T>> for &Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
% operator.Source§impl<T: Copy + Rem<T, Output = T>> Rem<&Projection<T>> for Projection<T>
impl<T: Copy + Rem<T, Output = T>> Rem<&Projection<T>> for Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
% operator.Source§impl<T: Copy + Rem<T, Output = T>> Rem<Projection<T>> for &Projection<T>
impl<T: Copy + Rem<T, Output = T>> Rem<Projection<T>> for &Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
% operator.Source§impl<T: Rem<T, Output = T>> Rem for Projection<T>
impl<T: Rem<T, Output = T>> Rem for Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
% operator.Source§impl<T: Copy + RemAssign<T>> RemAssign<&Projection<T>> for Projection<T>
impl<T: Copy + RemAssign<T>> RemAssign<&Projection<T>> for Projection<T>
Source§fn rem_assign(&mut self, rhs: &Projection<T>)
fn rem_assign(&mut self, rhs: &Projection<T>)
Performs the
%= operation. Read moreSource§impl<T: Copy + RemAssign<T>> RemAssign<&T> for Projection<T>
impl<T: Copy + RemAssign<T>> RemAssign<&T> for Projection<T>
Source§fn rem_assign(&mut self, rhs: &T)
fn rem_assign(&mut self, rhs: &T)
Performs the
%= operation. Read moreSource§impl<T: Copy + RemAssign<T>> RemAssign<T> for Projection<T>
impl<T: Copy + RemAssign<T>> RemAssign<T> for Projection<T>
Source§fn rem_assign(&mut self, rhs: T)
fn rem_assign(&mut self, rhs: T)
Performs the
%= operation. Read moreSource§impl<T: RemAssign<T>> RemAssign for Projection<T>
impl<T: RemAssign<T>> RemAssign for Projection<T>
Source§fn rem_assign(&mut self, rhs: Projection<T>)
fn rem_assign(&mut self, rhs: Projection<T>)
Performs the
%= operation. Read moreSource§impl<T: Serialize> Serialize for Projection<T>
impl<T: Serialize> Serialize for Projection<T>
Source§impl<T: Copy + Sub<T, Output = T>> Sub<&Projection<T>> for &Projection<T>
impl<T: Copy + Sub<T, Output = T>> Sub<&Projection<T>> for &Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
- operator.Source§impl<T: Copy + Sub<T, Output = T>> Sub<&Projection<T>> for Projection<T>
impl<T: Copy + Sub<T, Output = T>> Sub<&Projection<T>> for Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
- operator.Source§impl<T: Copy + Sub<T, Output = T>> Sub<Projection<T>> for &Projection<T>
impl<T: Copy + Sub<T, Output = T>> Sub<Projection<T>> for &Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
- operator.Source§impl<T: Sub<T, Output = T>> Sub for Projection<T>
impl<T: Sub<T, Output = T>> Sub for Projection<T>
Source§type Output = Projection<T>
type Output = Projection<T>
The resulting type after applying the
- operator.Source§impl<T: Copy + SubAssign<T>> SubAssign<&Projection<T>> for Projection<T>
impl<T: Copy + SubAssign<T>> SubAssign<&Projection<T>> for Projection<T>
Source§fn sub_assign(&mut self, rhs: &Projection<T>)
fn sub_assign(&mut self, rhs: &Projection<T>)
Performs the
-= operation. Read moreSource§impl<T: Copy + SubAssign<T>> SubAssign<&T> for Projection<T>
impl<T: Copy + SubAssign<T>> SubAssign<&T> for Projection<T>
Source§fn sub_assign(&mut self, rhs: &T)
fn sub_assign(&mut self, rhs: &T)
Performs the
-= operation. Read moreSource§impl<T: Copy + SubAssign<T>> SubAssign<T> for Projection<T>
impl<T: Copy + SubAssign<T>> SubAssign<T> for Projection<T>
Source§fn sub_assign(&mut self, rhs: T)
fn sub_assign(&mut self, rhs: T)
Performs the
-= operation. Read moreSource§impl<T: SubAssign<T>> SubAssign for Projection<T>
impl<T: SubAssign<T>> SubAssign for Projection<T>
Source§fn sub_assign(&mut self, rhs: Projection<T>)
fn sub_assign(&mut self, rhs: Projection<T>)
Performs the
-= operation. Read moreSource§impl<T> UlpsEq for Projection<T>
impl<T> UlpsEq for Projection<T>
Source§impl<T: Zeroable> Zeroable for Projection<T>
impl<T: Zeroable> Zeroable for Projection<T>
impl<T: Copy> Copy for Projection<T>
impl<T: Eq> Eq for Projection<T>
impl<T: Pod> Pod for Projection<T>
impl<T> StructuralPartialEq for Projection<T>
Auto Trait Implementations§
impl<T> Freeze for Projection<T>where
T: Freeze,
impl<T> RefUnwindSafe for Projection<T>where
T: RefUnwindSafe,
impl<T> Send for Projection<T>where
T: Send,
impl<T> Sync for Projection<T>where
T: Sync,
impl<T> Unpin for Projection<T>where
T: Unpin,
impl<T> UnsafeUnpin for Projection<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Projection<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
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.