[][src]Struct quick_maths::Ray

pub struct Ray<T, const N: usize> {
    pub pos: Vector<N, T>,
    pub dir: Vector<N, T>,
}

Fields

pos: Vector<N, T>dir: Vector<N, T>

Implementations

impl<const N: usize, T> Ray<T, N>[src]

pub fn new(pos: Vector<N, T>, dir: Vector<N, T>) -> Self[src]

Returns a new ray with the given position and direction

impl<const N: usize, T: Float> Ray<T, N>[src]

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

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

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

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

Flips the direction of this ray

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

Sets the length of this ray to the given amount

Trait Implementations

impl<T: Clone, const N: usize> Clone for Ray<T, N>[src]

impl<T: Copy, const N: usize> Copy for Ray<T, N>[src]

impl<T: Debug, const N: usize> Debug for Ray<T, N>[src]

impl<T: Eq, const N: usize> Eq for Ray<T, N>[src]

impl<T: PartialEq, const N: usize> PartialEq<Ray<T, N>> for Ray<T, N>[src]

impl<T, const N: usize> StructuralEq for Ray<T, N>[src]

impl<T, const N: usize> StructuralPartialEq for Ray<T, N>[src]

Auto Trait Implementations

impl<T, const N: usize> RefUnwindSafe for Ray<T, N> where
    T: RefUnwindSafe

impl<T, const N: usize> Send for Ray<T, N> where
    T: Send

impl<T, const N: usize> Sync for Ray<T, N> where
    T: Sync

impl<T, const N: usize> Unpin for Ray<T, N> where
    T: Unpin

impl<T, const N: usize> UnwindSafe for Ray<T, N> where
    T: 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.