Rework interpolation & add Hermite interpolation

This commit is contained in:
Moulberry committed 2024-12-30 00:56:16 -05:00
1 parent 2a8ac10ec2
commit 797287e490
38 files changed
+653 -364

No files matched your search

@@ -0,0 +1,20 @@
package com.moulberry.flashback.keyframe.change;
import com.moulberry.flashback.Interpolation;
import com.moulberry.flashback.keyframe.handler.KeyframeHandler;
public record KeyframeChangeTickrate(float tickrate) implements KeyframeChange {
@Override
public void apply(KeyframeHandler keyframeHandler) {
keyframeHandler.applyTickrate(this.tickrate);
}
@Override
public KeyframeChange interpolate(KeyframeChange to, double amount) {
KeyframeChangeTickrate other = (KeyframeChangeTickrate) to;
return new KeyframeChangeTickrate(
(float) Interpolation.linear(this.tickrate, other.tickrate, amount)
);
}
}