#[repr(C)]pub struct RayHit<T> {
pub normal: Vec2<T>,
pub distance: T,
}Expand description
A raycast hit on the surface of a shape.
Contains the distance along the ray the hit occurred, and the
normal of the edge the ray intersected.
Fields§
§normal: Vec2<T>§distance: TImplementations§
Source§impl<T: Copy + AbsDiffEq<Epsilon = T>> RayHit<T>
impl<T: Copy + AbsDiffEq<Epsilon = T>> RayHit<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>> RayHit<T>
impl<T: Copy + RelativeEq<Epsilon = T>> RayHit<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.
Trait Implementations§
Source§impl<T> AbsDiffEq for RayHit<T>
impl<T> AbsDiffEq for RayHit<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<'de, T> Deserialize<'de> for RayHit<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for RayHit<T>where
T: Deserialize<'de>,
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: 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 RayHit<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 RayHit<T>
type AsU8 = RayHit<u8>
type AsU16 = RayHit<u16>
type AsU32 = RayHit<u32>
type AsU64 = RayHit<u64>
type AsU128 = RayHit<u128>
type AsUSize = RayHit<usize>
type AsI8 = RayHit<i8>
type AsI16 = RayHit<i16>
type AsI32 = RayHit<i32>
type AsI64 = RayHit<i64>
type AsI128 = RayHit<i128>
type AsISize = RayHit<isize>
type AsF32 = RayHit<f32>
type AsF64 = RayHit<f64>
fn to_u8(self) -> RayHit<u8>
fn to_u16(self) -> RayHit<u16>
fn to_u32(self) -> RayHit<u32>
fn to_u64(self) -> RayHit<u64>
fn to_u128(self) -> RayHit<u128>
fn to_usize(self) -> RayHit<usize>
fn to_i8(self) -> RayHit<i8>
fn to_i16(self) -> RayHit<i16>
fn to_i32(self) -> RayHit<i32>
fn to_i64(self) -> RayHit<i64>
fn to_i128(self) -> RayHit<i128>
fn to_isize(self) -> RayHit<isize>
fn to_f32(self) -> RayHit<f32>
fn to_f64(self) -> RayHit<f64>
Source§impl<T: Ord> Ord for RayHit<T>
impl<T: Ord> Ord for RayHit<T>
Source§impl<T: PartialOrd> PartialOrd for RayHit<T>
impl<T: PartialOrd> PartialOrd for RayHit<T>
Source§impl<T> RelativeEq for RayHit<T>
impl<T> RelativeEq for RayHit<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> UlpsEq for RayHit<T>
impl<T> UlpsEq for RayHit<T>
impl<T: Copy> Copy for RayHit<T>
impl<T: Eq> Eq for RayHit<T>
impl<T: Pod> Pod for RayHit<T>
impl<T> StructuralPartialEq for RayHit<T>
Auto Trait Implementations§
impl<T> Freeze for RayHit<T>where
T: Freeze,
impl<T> RefUnwindSafe for RayHit<T>where
T: RefUnwindSafe,
impl<T> Send for RayHit<T>where
T: Send,
impl<T> Sync for RayHit<T>where
T: Sync,
impl<T> Unpin for RayHit<T>where
T: Unpin,
impl<T> UnsafeUnpin for RayHit<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for RayHit<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.