[][src]Struct quick_maths::Ray

pub struct Ray<T = f32, V = Vec3<T>> {
    pub pos: V,
    pub dir: V,
    // some fields omitted
}

Fields

pos: Vdir: V

Implementations

impl<T, V> Ray<T, V>[src]

pub fn new(pos: V, dir: V) -> Self[src]

Returns a new ray with the given position and direction

impl<T: Float, V> Ray<T, V> where
    V: Add<Output = V> + Mul<T, Output = V> + Copy
[src]

pub fn at(&self, t: T) -> V[src]

Returns the position along a ray that corresponds to some parameter T

pub fn step(&mut self, t: T)[src]

impl<T: Float, const N: usize> Ray<T, Vector<T, N>> where
    [T; N]: LengthAtMost32
[src]

pub fn set_length(&mut self, t: T)[src]

Sets the length of this ray to the given amount

impl<T, V> Ray<T, V> where
    V: Neg<Output = V> + Copy
[src]

pub fn flip(&self) -> Self[src]

Flips the direction of this ray

Trait Implementations

impl<T: Clone, V: Clone> Clone for Ray<T, V>[src]

impl<T: Copy, V: Copy> Copy for Ray<T, V>[src]

impl<T: Debug, V: Debug> Debug for Ray<T, V>[src]

impl<T: Eq, V: Eq> Eq for Ray<T, V>[src]

impl<T: PartialEq, V: PartialEq> PartialEq<Ray<T, V>> for Ray<T, V>[src]

impl<T, V> StructuralEq for Ray<T, V>[src]

impl<T, V> StructuralPartialEq for Ray<T, V>[src]

Auto Trait Implementations

impl<T, V> RefUnwindSafe for Ray<T, V> where
    T: RefUnwindSafe,
    V: RefUnwindSafe

impl<T, V> Send for Ray<T, V> where
    T: Send,
    V: Send

impl<T, V> Sync for Ray<T, V> where
    T: Sync,
    V: Sync

impl<T, V> Unpin for Ray<T, V> where
    T: Unpin,
    V: Unpin

impl<T, V> UnwindSafe for Ray<T, V> where
    T: UnwindSafe,
    V: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.