From 4998f5936dc7da36aba0cd018de2a1a6127dda08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Tue, 19 Jan 2021 09:06:32 -0300 Subject: Make shader sample intervals uniform --- src/lerp.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/lerp.rs') diff --git a/src/lerp.rs b/src/lerp.rs index b613620..4c829a1 100644 --- a/src/lerp.rs +++ b/src/lerp.rs @@ -1,6 +1,4 @@ -pub mod poly; - -use poly::Poly; +use crate::poly::Poly; pub enum Lerp { Node(Box, Box), @@ -9,7 +7,7 @@ pub enum Lerp { } impl Lerp { - pub fn new(v: Vec) -> Box { + pub fn new(v: &Vec) -> Box { Lerp::new_s(&v[..]) } @@ -33,7 +31,7 @@ impl Lerp { let a = a.to_poly(); let b = b.to_poly(); let c = &b - &a; - &a + &(&c * &Poly::new(vec![0.0, 1.0])) + &a + &c.shift() } } } -- cgit v1.2.3