summaryrefslogtreecommitdiff
path: root/src/lerp.rs
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2021-01-19 09:06:32 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2021-01-19 09:15:02 -0300
commit4998f5936dc7da36aba0cd018de2a1a6127dda08 (patch)
tree1363045387c3730d33fbed10f682662e3a635860 /src/lerp.rs
parentbe18a9a0503fa09318b5d99452a3407a92db4366 (diff)
downloadbezier-4998f5936dc7da36aba0cd018de2a1a6127dda08.tar.gz
bezier-4998f5936dc7da36aba0cd018de2a1a6127dda08.zip
Make shader sample intervals uniform
Diffstat (limited to 'src/lerp.rs')
-rw-r--r--src/lerp.rs8
1 files changed, 3 insertions, 5 deletions
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<Lerp>, Box<Lerp>),
@@ -9,7 +7,7 @@ pub enum Lerp {
}
impl Lerp {
- pub fn new(v: Vec<f32>) -> Box<Lerp> {
+ pub fn new(v: &Vec<f32>) -> Box<Lerp> {
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()
}
}
}