From e07e2a5b140178b4bff35d16944b089fe3329b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=BCndgens?= Date: Mon, 2 Mar 2015 17:27:49 +0100 Subject: [PATCH] Removed shift of the physical heightmap, because the graphical heightmap is corect now. --- physics.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics.cc b/physics.cc index 9cc5374..ddf7499 100644 --- a/physics.cc +++ b/physics.cc @@ -157,7 +157,7 @@ void Physics::addTerrain(int width, int length, float** heightData) //The terrai info.m_restitution = 0; btRigidBody* tBody = new btRigidBody(info); - tBody->getWorldTransform().setOrigin(btVector3(-0.5,((float)highest)/2,-0.5)); //we have to move the origin of our rigid body down, because bullet sets the origin (0,0,0) at (width/2, height/2, length/2) in the map the x and z are correct in our level, but y needs to be addapted + tBody->getWorldTransform().setOrigin(btVector3(0,((float)highest)/2,0)); //we have to move the origin of our rigid body down, because bullet sets the origin (0,0,0) at (width/2, height/2, length/2) in the map the x and z are correct in our level, but y needs to be addapted terrainBody = tBody; if (world == NULL) {