From d5771f8eea9cd7529ca3cf194ef4c4262443387a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=BCndgens?= Date: Mon, 2 Mar 2015 17:17:06 +0100 Subject: [PATCH] Fixed a bug with shifting the heightmap. --- loader.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader.cc b/loader.cc index 5f23fe4..806f733 100644 --- a/loader.cc +++ b/loader.cc @@ -57,7 +57,7 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa float terrainShininess = queryFloat(terrainElement, "shininess"); Material terrainMaterial = Material(terrainTexture, terrainAmbientFactor, terrainDiffuseFactor, terrainSpecularFactor, terrainShininess); Object* terrainObject = new Object(terrainModel, terrainMaterial, - glm::vec3(-0.5*(float)level->getTerrain()->getHeightmapHeight(), 0.0f, -0.5f*(float)level->getTerrain()->getHeightmapWidth()), + glm::vec3(-0.5*((float)level->getTerrain()->getHeightmapHeight()-1), 0.0f, -0.5f*((float)level->getTerrain()->getHeightmapWidth()-1)), glm::vec3(0.0f, 0.0f, 0.0f), true); level->addObject(terrainObject); level->getPhysics()->addTerrain(level->getTerrain()->getHeightmapWidth(), level->getTerrain()->getHeightmapHeight(), level->getTerrain()->getHeightmap());