diff --git a/Demos/VehicleDemo/VehicleDemo.cpp b/Demos/VehicleDemo/VehicleDemo.cpp index 662995157..bc69ad78f 100644 --- a/Demos/VehicleDemo/VehicleDemo.cpp +++ b/Demos/VehicleDemo/VehicleDemo.cpp @@ -130,7 +130,10 @@ void VehicleDemo::setupPhysics() m_dynamicsWorld->setDebugDrawer(&debugDrawer); //m_dynamicsWorld->setGravity(btVector3(0,0,0)); +btTransform tr; +tr.setIdentity(); +//either use heightfield or triangle mesh //#define USE_TRIMESH_GROUND 1 #ifdef USE_TRIMESH_GROUND int i; @@ -199,28 +202,53 @@ const float TRIANGLE_SIZE=20.f; bool useQuantizedAabbCompression = true; groundShape = new btBvhTriangleMeshShape(indexVertexArrays,useQuantizedAabbCompression); + tr.setOrigin(btVector3(0,-4.5f,0)); + #else //testing btHeightfieldTerrainShape int width=128; int length=128; unsigned char* heightfieldData = new unsigned char[width*length]; + { + for (int i=0;isetLocalScaling(localScaling); + tr.setOrigin(btVector3(0,-64.5f,0)); + #endif // - btTransform tr; - tr.setIdentity(); - tr.setOrigin(btVector3(0,-4.5f,0)); + +