fixed terrain offset
This commit is contained in:
parent
463181d484
commit
00182a509c
@ -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));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user