[][src]Struct tray_rust::linalg::ray::Ray

pub struct Ray {
    pub o: Point,
    pub d: Vector,
    pub min_t: f32,
    pub max_t: f32,
    pub depth: u32,
    pub time: f32,
}

Ray is a standard 3D ray, starting at origin o and heading in direction d The min and max points along the ray can be specified with min_t and max_t depth is the recursion depth of the ray

Fields

o: Point

Origin of the ray

d: Vector

Direction the ray is heading

min_t: f32

Point along the ray that the actual ray starts at, p = o + min_t * d

max_t: f32

Point along the ray at which it stops, will be inf if the ray is infinite

depth: u32

Recursion depth of the ray

time: f32

Time point sampled by this ray

Methods

impl Ray[src]

pub fn new(o: &Point, d: &Vector, time: f32) -> Ray[src]

Create a new ray from o heading in d with infinite length

pub fn segment(o: &Point, d: &Vector, min_t: f32, max_t: f32, time: f32) -> Ray[src]

Create a new segment ray from o + min_t * d to o + max_t * d

pub fn child(&self, o: &Point, d: &Vector) -> Ray[src]

Create a child ray from the parent starting at o and heading in d

pub fn child_segment(
    &self,
    o: &Point,
    d: &Vector,
    min_t: f32,
    max_t: f32
) -> Ray
[src]

Create a child ray segment from o + min_t * d to o + max_t * d

pub fn at(&self, t: f32) -> Point[src]

Evaulate the ray equation at some t value and return the point returns result of self.o + t * self.d

Trait Implementations

impl Clone for Ray[src]

impl Copy for Ray[src]

impl PartialEq<Ray> for Ray[src]

impl Debug for Ray[src]

impl Mul<Ray> for Transform[src]

type Output = Ray

The resulting type after applying the * operator.

fn mul(self, ray: Ray) -> Ray[src]

Multiply the ray by the transform to apply the transformation

impl StructuralPartialEq for Ray[src]

Auto Trait Implementations

impl Send for Ray

impl Sync for Ray

impl Unpin for Ray

impl UnwindSafe for Ray

impl RefUnwindSafe for Ray

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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

impl<T> SetParameter for T[src]