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