~starkingdoms/starkingdoms

bf1ffce5e6655cd5b432bd1abf6eb0fc2cd8f09e — ghostly_zsh 5 months ago 4f93bd0
sampling now clamps to the end of the spline correctly
1 files changed, 4 insertions(+), 0 deletions(-)

M crates/unified/src/particles.rs
M crates/unified/src/particles.rs => crates/unified/src/particles.rs +4 -0
@@ 64,6 64,10 @@ impl<P: Lerp + Copy> LifetimeCurve<P> {
            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);