fixed terrain offset

This commit is contained in:
Jasper 2014-11-17 18:54:19 +01:00
parent c403814cd6
commit 10f51db60f

View File

@ -51,6 +51,7 @@ void Physics::addTerrain(int width, int length, float** heightData)
}
}
highest++;
/*
heightfield[j*length+i] = heightData[i][j];
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);
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));