diff --git a/src/game/Level.cpp b/src/game/Level.cpp index 647cd1a..2fd5cab 100644 --- a/src/game/Level.cpp +++ b/src/game/Level.cpp @@ -241,10 +241,26 @@ namespace Game float fracOffsetY = scaledOffset.z - offsetY; int32_t xPos = (int32_t)(fracOffsetX * heightmap.Width); int32_t yPos = (int32_t)(fracOffsetY * heightmap.Height); - uint8_t height = heightmap.Values[yPos * heightmap.Width + xPos]; - LOG("Height: %u", height); - return height > 230; + uint8_t height = 0; + switch (card.Rotation) + { + case 0: + height = heightmap.Values[yPos * heightmap.Width + xPos]; + break; + case 1: + height = heightmap.Values[(heightmap.Height - xPos - 1) * heightmap.Width + yPos]; + break; + case 2: + height = + heightmap + .Values[(heightmap.Height - yPos - 1) * heightmap.Width + (heightmap.Width - xPos - 1)]; + break; + default: + height = heightmap.Values[xPos * heightmap.Width + (heightmap.Height - yPos - 1)]; + break; + } + return height >= 110 && height <= 125; } } return false; diff --git a/src/game/Mesh.cpp b/src/game/Mesh.cpp index 9da2b1a..4d15187 100644 --- a/src/game/Mesh.cpp +++ b/src/game/Mesh.cpp @@ -117,6 +117,8 @@ namespace Game } LOG("min/max: %lli", bx::getHPCounter() - startTime); + mesh.MinPos = {-5.0f, -5.0f, -5.0f}; + mesh.MaxPos = {5.0f, 5.0f, 5.0f}; mesh.Size = mesh.MaxPos - mesh.MinPos; startTime = bx::getHPCounter();