1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
use mini_math::{Point, Vector}; /// An infinite ray. pub struct Ray { /// The starting point of the ray. pub origin: Point, /// The direction of the ray. pub direction: Vector, } impl Ray { /// Construct a ray from a starting point and direction. pub fn new(origin: Point, direction: Vector) -> Self { Self { origin, direction } } }