From bf1ffce5e6655cd5b432bd1abf6eb0fc2cd8f09e Mon Sep 17 00:00:00 2001 From: ghostly_zsh Date: Mon, 7 Jul 2025 12:54:12 -0500 Subject: [PATCH] sampling now clamps to the end of the spline correctly --- crates/unified/src/particles.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/unified/src/particles.rs b/crates/unified/src/particles.rs index 2503b1da57dfbf58138c06a16ae9eeb662c13560..8d36982b85e4b83b93f3e75f4c653267bd4aa63c 100644 --- a/crates/unified/src/particles.rs +++ b/crates/unified/src/particles.rs @@ -64,6 +64,10 @@ impl LifetimeCurve

{ r2.next()? }; + if a_key == b_key && b_key == self.0.iter().last().unwrap().0 { + return Some(*b_val); + } + // Calculate `t` (value from 0 - 1 indicating our progress from A to B) let t = (at - **a_key) / *(b_key - a_key);