Add linear interpolation to simplepathing

This commit is contained in:
johni0702
2016-09-03 13:32:17 +02:00
parent dca1131d49
commit ef00c45068
4 changed files with 15 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ import com.replaymod.replaystudio.pathing.property.Property;
import com.replaymod.replaystudio.util.EntityPositionTracker;
import com.replaymod.replaystudio.util.Location;
import com.replaymod.simplepathing.ReplayModSimplePathing;
import com.replaymod.simplepathing.Setting;
import de.johni0702.minecraft.gui.GuiRenderer;
import de.johni0702.minecraft.gui.RenderInfo;
import de.johni0702.minecraft.gui.container.GuiContainer;
@@ -531,6 +532,7 @@ public class GuiPathing {
}
public Change updateInterpolators() {
boolean linearInterpolation = mod.getCore().getSettingsRegistry().get(Setting.LINEAR_INTERPOLATION);
List<Change> changes = new ArrayList<>();
Interpolator interpolator = null;
boolean isSpectatorInterpolator = false;
@@ -548,7 +550,7 @@ public class GuiPathing {
// Normal segment
if (isSpectatorInterpolator || interpolator == null) {
isSpectatorInterpolator = false;
interpolator = new CubicSplineInterpolator();
interpolator = linearInterpolation ? new LinearInterpolator() : new CubicSplineInterpolator();
interpolator.registerProperty(CameraProperties.POSITION);
interpolator.registerProperty(CameraProperties.ROTATION);
}