diff --git a/src/main/java/de/legoshi/parkourcalculator/file/CSVUtils.java b/src/main/java/de/legoshi/parkourcalculator/file/CSVUtils.java index 8b94147..f452e45 100644 --- a/src/main/java/de/legoshi/parkourcalculator/file/CSVUtils.java +++ b/src/main/java/de/legoshi/parkourcalculator/file/CSVUtils.java @@ -29,7 +29,7 @@ public static void saveTicksToCSV(List inputTicks, String filePath) { Vec3 p = tick.getPosition(); Vec3 v = tick.getVelocity(); writer.write(String.format(Locale.US, "%.15f,%.15f,%.15f,%.5f,%.5f,%.1f,%.1f,%b,%b,%b,%b,%b,%b,%b,%b,%b,%.15f,%.15f,%.15f", - p.x, p.y, p.z, iTick.YAW, 90.0, iTick.YAW, 0.0, iTick.W, iTick.A, iTick.S, iTick.D, iTick.SPRINT, iTick.SNEAK, iTick.JUMP, false, false, v.x, v.y, v.z)); + -p.x, p.y, p.z, iTick.YAW, 90.0, iTick.YAW, 0.0, iTick.W, iTick.A, iTick.S, iTick.D, iTick.SPRINT, iTick.SNEAK, iTick.JUMP, false, false, -v.x, v.y, v.z)); writer.newLine(); } } catch (IOException e) { @@ -60,8 +60,8 @@ public static List loadTicksFromCSV(String filePath) { Float.parseFloat(tokens[3]) ); - Vec3 position = new Vec3(Double.parseDouble(tokens[0]), Double.parseDouble(tokens[1]), Double.parseDouble(tokens[2])); - Vec3 velocity = new Vec3(Double.parseDouble(tokens[16]), Double.parseDouble(tokens[17]), Double.parseDouble(tokens[18])); + Vec3 position = new Vec3(-Double.parseDouble(tokens[0]), Double.parseDouble(tokens[1]), Double.parseDouble(tokens[2])); + Vec3 velocity = new Vec3(-Double.parseDouble(tokens[16]), Double.parseDouble(tokens[17]), Double.parseDouble(tokens[18])); inputData.setInputTick(tick); inputData.setPosition(position); diff --git a/src/main/java/de/legoshi/parkourcalculator/gui/debug/menu/PlayerSettings.java b/src/main/java/de/legoshi/parkourcalculator/gui/debug/menu/PlayerSettings.java index e63af80..e8055b5 100644 --- a/src/main/java/de/legoshi/parkourcalculator/gui/debug/menu/PlayerSettings.java +++ b/src/main/java/de/legoshi/parkourcalculator/gui/debug/menu/PlayerSettings.java @@ -16,9 +16,11 @@ import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; +import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.scene.text.Text; +import lombok.Getter; import java.awt.*; import java.awt.datatransfer.Clipboard; @@ -37,7 +39,7 @@ public class PlayerSettings extends TitledPane { private final TextField yVelField; private final TextField zVelField; - private final TextField facingYaw; + @Getter private final TextField facingYaw; private final TextField facingPitch; public PlayerSettings(CoordinateScreen coordinateScreen, MovementEngine movementEngine, PositionVisualizer positionVisualizer) { @@ -100,7 +102,7 @@ public PlayerSettings(CoordinateScreen coordinateScreen, MovementEngine movement gridPane.add(zVelField, 1, 5); // Create the button to apply values - Button getButton = new Button("Get values"); + Button getButton = new Button("Get Pos. & Vel."); getButton.setOnAction(event -> updatePlayerSettings()); Button copyButton = new Button("Copy to Clipboard"); @@ -143,7 +145,7 @@ public void updatePlayerSettings() { this.xPosField.setText(replaceNegZero(startPos.x*(-1))+ ""); this.yPosField.setText(startPos.y + ""); this.zPosField.setText(startPos.z + ""); - this.facingYaw.setText(replaceNegZero(movementEngine.player.getStartYAW()*(-1)) + ""); + this.facingYaw.setText(replaceNegZero(movementEngine.player.getStartYAW()) + ""); Player player = movementEngine.player; this.xVelField.setText(replaceNegZero(startVel.x*(-1)) + "");