dasom 0.1.1

A toy ray tracing engine based on Ray Tracing In One Weekend in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::{ Real, Vector };

#[derive(Clone, Copy, Debug)]
pub struct Ray {
    pub ori: Vector,
    pub dir: Vector
}

impl Ray {
    pub fn new(ori: Vector, dir: Vector) -> Self {
        Self { ori, dir }
    }

    pub fn at(&self, t: Real) -> Vector {
        self.ori + t * self.dir
    }
}