diff --git a/src/coordinates/coordinate_transformer.cpp b/src/coordinates/coordinate_transformer.cpp index aac5248..1516135 100644 --- a/src/coordinates/coordinate_transformer.cpp +++ b/src/coordinates/coordinate_transformer.cpp @@ -2,6 +2,7 @@ #include "../config.h" #include "../logging/easylogging++.h" #include "../utilities/vector_utils.hpp" +#include // Initialize matrix const Eigen::Matrix CoordinateTransformer::worldToIsometricMatrix = @@ -12,9 +13,10 @@ const Eigen::Matrix CoordinateTransformer::worldToIsometricMatrix = ).finished(); // Same as above, but with SKEW = 0 and height positive +const auto rotateFactor = cos(M_PI / 4); const Eigen::Matrix CoordinateTransformer::worldToDiagonalMatrix = (Eigen::Matrix() << - WORLD_TO_ISO_SCALE, -WORLD_TO_ISO_SCALE, 0, + rotateFactor, -rotateFactor, 0, 0, 0, 1, 1, 1, 0 ).finished(); diff --git a/src/game/physics/holes/layouts/hole_description.hpp b/src/game/physics/holes/layouts/hole_description.hpp index 1a6e01e..e875050 100644 --- a/src/game/physics/holes/layouts/hole_description.hpp +++ b/src/game/physics/holes/layouts/hole_description.hpp @@ -33,11 +33,10 @@ struct HoleDescription } float chordLength = 2.f * std::sqrt(radius * radius - distance * distance); - float chordLengthInDiagonal = chordLength * WORLD_TO_ISO_SCALE; auto diagonalWorldCoords = CoordinateTransformer::worldToDiagonal(WorldCoordinates{worldPosition}); - return {playerId, diagonalWorldCoords.horizontal, chordLengthInDiagonal}; + return {playerId, diagonalWorldCoords.horizontal, chordLength}; } }; diff --git a/src/levels.hpp b/src/levels.hpp index 2465dd2..717fada 100644 --- a/src/levels.hpp +++ b/src/levels.hpp @@ -22,7 +22,7 @@ std::map const all_levels = { CollectableInLevel("box", {6, 7}), CollectableInLevel("box", {5, 5}), CollectableInLevel("box", {9, 5}), - CollectableInLevel("box", {7, 4}) + CollectableInLevel("box", {0, 1}) }, { // Blues