mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-01 14:38:50 +00:00
Rework interpolation & add Hermite interpolation
This commit is contained in:
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)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user