Skip to content

Commit f9ff444

Browse files
committed
Impl Lerp for arrays
1 parent b18d8b5 commit f9ff444

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/src/math.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,9 @@ impl<U: Lerp, V: Lerp> Lerp for (U, V) {
179179
(self.0.lerp(u, t), self.1.lerp(v, t))
180180
}
181181
}
182+
183+
impl<T: Lerp, const N: usize> Lerp for [T; N] {
184+
fn lerp(&self, other: &Self, t: f32) -> Self {
185+
core::array::from_fn(|i| self[i].lerp(&other[i], t))
186+
}
187+
}

0 commit comments

Comments
 (0)