Changed to f64 floating point

This commit is contained in:
STP
2023-11-25 14:35:11 -05:00
parent 348be665c9
commit 4721a3cc09
10 changed files with 326 additions and 273 deletions

View File

@@ -2,20 +2,20 @@ use nalgebra::{Point3, Vector3};
#[derive(Clone)]
pub struct Light {
pub position: Point3<f32>,
pub colour: Vector3<f32>,
pub falloff: Vector3<f32>,
pub position: Point3<f64>,
pub colour: Vector3<f64>,
pub falloff: Vector3<f64>,
}
impl Light {
pub fn new(position: Point3<f32>, colour: Vector3<f32>, falloff: Vector3<f32>) -> Self {
pub fn new(position: Point3<f64>, colour: Vector3<f64>, falloff: Vector3<f64>) -> Self {
Light {
position,
colour,
falloff,
}
}
pub fn white(position: Point3<f32>) -> Self {
pub fn white(position: Point3<f64>) -> Self {
let colour = Vector3::new(1.0, 1.0, 1.0);
let falloff = Vector3::new(1.0, 0.0, 0.0);
Light::new(position, colour, falloff)