fixed terrain offset

This commit is contained in:
Jasper 2014-11-17 18:54:19 +01:00
parent 463181d484
commit 00182a509c

View File

@ -51,6 +51,7 @@ void Physics::addTerrain(int width, int length, float** heightData)
} }
} }
highest++;
/* /*
heightfield[j*length+i] = heightData[i][j]; heightfield[j*length+i] = heightData[i][j];
if (heightData[i][j] > highest) if (heightData[i][j] > highest)
@ -61,7 +62,7 @@ void Physics::addTerrain(int width, int length, float** heightData)
btRigidBody* tBody = new btRigidBody(0,new btDefaultMotionState(),terrianShape); btRigidBody* tBody = new btRigidBody(0,new btDefaultMotionState(),terrianShape);
tBody->getWorldTransform().setOrigin(btVector3(0,highest/2,0)); tBody->getWorldTransform().setOrigin(btVector3(0,((float)highest - 1)/2,0));
//tBody->getWoorldTransform().setRotation(btQuaternion(0,0,0,1)); //tBody->getWoorldTransform().setRotation(btQuaternion(0,0,0,1));