ft: 10: metals
This commit is contained in:
12
src/ray.rs
12
src/ray.rs
@@ -6,17 +6,17 @@ pub struct Ray {
|
||||
}
|
||||
|
||||
impl Ray {
|
||||
pub fn at(&self, t: f32) -> Vec3 {
|
||||
self.origin + t * self.dir
|
||||
}
|
||||
|
||||
pub fn new(origin: Vec3, dir: Vec3) -> Ray {
|
||||
Ray {
|
||||
pub fn new(origin: Vec3, dir: Vec3) -> Self {
|
||||
Self {
|
||||
origin: origin,
|
||||
dir: dir,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn at(&self, t: f32) -> Vec3 {
|
||||
self.origin + t * self.dir
|
||||
}
|
||||
|
||||
pub fn origin(&self) -> &Vec3 {
|
||||
&self.origin
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user