all: s/f32/Float/g now using customer Float alias.

This commit is contained in:
2021-07-18 17:18:08 -07:00
parent 5d57304d95
commit 95de5863cc
9 changed files with 147 additions and 123 deletions

View File

@@ -1,4 +1,4 @@
use crate::{matrices::Matrix4x4, tuples::Tuple};
use crate::{matrices::Matrix4x4, tuples::Tuple, Float};
/// Rays have an origin and a direction. This datatype is the 'ray' in 'raytracer'.
pub struct Ray {
@@ -38,7 +38,7 @@ impl Ray {
/// assert_eq!(r.position(-1.), Tuple::point(1., 3., 4.));
/// assert_eq!(r.position(2.5), Tuple::point(4.5, 3., 4.));
/// ```
pub fn position(&self, t: f32) -> Tuple {
pub fn position(&self, t: Float) -> Tuple {
self.origin + self.direction * t
}