diff --git a/app/src/main/java/chess/view/DDDrender/DDDPlacement.java b/app/src/main/java/chess/view/DDDrender/DDDPlacement.java index 81275b8..ce0cc19 100644 --- a/app/src/main/java/chess/view/DDDrender/DDDPlacement.java +++ b/app/src/main/java/chess/view/DDDrender/DDDPlacement.java @@ -5,15 +5,15 @@ import org.joml.Vector2f; import chess.model.Coordinate; class DDDPlacement { - public static Vector2f coordinates_to_vector(Coordinate coo) { - return coordinates_to_vector(coo.getX(), coo.getY()); + public static Vector2f coordinatesToVector(Coordinate coo) { + return coordinatesToVector(coo.getX(), coo.getY()); } - public static Vector2f coordinates_to_vector(float x, float y) { + public static Vector2f coordinatesToVector(float x, float y) { return new Vector2f(1.0f - 0.125f - x * 0.250f, 1.0f - 0.125f - y * 0.250f); } - public static Coordinate vector_to_coordinates(Vector2f pos) { + public static Coordinate vectorToCoordinates(Vector2f pos) { int x = (int) ((1.0f - pos.x) * 4.0f); int y = (int) ((1.0f - pos.y) * 4.0f); return new Coordinate(x, y); diff --git a/app/src/main/java/chess/view/DDDrender/DDDView.java b/app/src/main/java/chess/view/DDDrender/DDDView.java index d37bc26..73156f0 100644 --- a/app/src/main/java/chess/view/DDDrender/DDDView.java +++ b/app/src/main/java/chess/view/DDDrender/DDDView.java @@ -87,7 +87,7 @@ public class DDDView extends GameAdaptator { if (piece == null) continue; - Vector2f pieceBoardPos = DDDPlacement.coordinates_to_vector(pos); + Vector2f pieceBoardPos = DDDPlacement.coordinatesToVector(pos); Vector3f pieceWorldPos = new Vector3f(pieceBoardPos.x(), 0, pieceBoardPos.y()); PieceEntity entity = new PieceEntity(piece, pieceWorldPos, diff --git a/app/src/main/java/chess/view/DDDrender/Window.java b/app/src/main/java/chess/view/DDDrender/Window.java index 5ae081b..0e31865 100644 --- a/app/src/main/java/chess/view/DDDrender/Window.java +++ b/app/src/main/java/chess/view/DDDrender/Window.java @@ -151,7 +151,7 @@ public class Window { double y[] = new double[1]; glfwGetCursorPos(this.window, x, y); Vector2f cursorPos = this.cam.getCursorWorldFloorPos(new Vector2f((float) x[0], (float) y[0]), windowWidth, windowHeight); - Coordinate selectedCell = DDDPlacement.vector_to_coordinates(cursorPos); + Coordinate selectedCell = DDDPlacement.vectorToCoordinates(cursorPos); if (this.lastCell == null) { this.lastCell = selectedCell; if (selectedCell.isValid())