summaryrefslogtreecommitdiff
path: root/Demos/VehicleDemo
diff options
context:
space:
mode:
authorejcoumans <ejcoumans@08e121b0-ae19-0410-a57b-3be3395fd4fd>2006-11-10 04:00:16 +0000
committerejcoumans <ejcoumans@08e121b0-ae19-0410-a57b-3be3395fd4fd>2006-11-10 04:00:16 +0000
commit56e135874bd697e33f23e98b2aad9af24f87a9b8 (patch)
tree64ca94c6a72b3d7faffc19dc62a23751d08ea06b /Demos/VehicleDemo
parent442ce2ec09baeebb1a169da0c9262889816478d0 (diff)
downloadbullet3-56e135874bd697e33f23e98b2aad9af24f87a9b8.tar.gz
added angular limits to the Generic D6 constraint. Works for small angles. Will add a check for different combinations, and use different extraction of ordering of rotation from the diff quaternion.
Improved vehicle interpolation of wheels, and added Z-up axis option for the Demo made 'getWorldTransform' const method in btMotionState added future 'deactivationCallback'(not used yet)
Diffstat (limited to 'Demos/VehicleDemo')
-rw-r--r--Demos/VehicleDemo/VehicleDemo.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/Demos/VehicleDemo/VehicleDemo.cpp b/Demos/VehicleDemo/VehicleDemo.cpp
index 575755029..f2e7f6983 100644
--- a/Demos/VehicleDemo/VehicleDemo.cpp
+++ b/Demos/VehicleDemo/VehicleDemo.cpp
@@ -301,7 +301,7 @@ void VehicleDemo::renderme()
for (i=0;i<m_vehicle->getNumWheels();i++)
{
//synchronize the wheels with the (interpolated) chassis worldtransform
- m_vehicle->updateWheelTransform(i);
+ m_vehicle->updateWheelTransform(i,true);
//draw wheels (cylinders)
m_vehicle->getWheelInfo(i).m_worldTransform.getOpenGLMatrix(m);
GL_ShapeDrawer::drawOpenGL(m,&wheelShape,wheelColor,getDebugMode());
@@ -323,11 +323,14 @@ void VehicleDemo::clientMoveAndDisplay()
if (m_dynamicsWorld)
{
//during idle mode, just run 1 simulation step maximum
- int maxSimSubSteps = m_idle ? 1 : 1;
+ int maxSimSubSteps = m_idle ? 1 : 2;
if (m_idle)
dt = 1.0/420.f;
int numSimSteps = m_dynamicsWorld->stepSimulation(dt,maxSimSubSteps);
+
+#define VERBOSE_FEEDBACK
+#ifdef VERBOSE_FEEDBACK
if (!numSimSteps)
printf("Interpolated transforms\n");
else
@@ -341,6 +344,7 @@ void VehicleDemo::clientMoveAndDisplay()
printf("Simulated (%i) steps\n",numSimSteps);
}
}
+#endif //VERBOSE_FEEDBACK
}
@@ -384,16 +388,20 @@ void VehicleDemo::clientMoveAndDisplay()
void VehicleDemo::displayCallback(void)
{
+ clientMoveAndDisplay();
+ return;
+
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- m_dynamicsWorld->updateAabbs();
+ //m_dynamicsWorld->updateAabbs();
+
//draw contactpoints
//m_physicsEnvironmentPtr->CallbackTriggers();
- renderme();
+ //renderme();
glFlush();
@@ -416,7 +424,7 @@ void VehicleDemo::clientResetScene()
for (int i=0;i<m_vehicle->getNumWheels();i++)
{
//synchronize the wheels with the (interpolated) chassis worldtransform
- m_vehicle->updateWheelTransform(i);
+ m_vehicle->updateWheelTransform(i,true);
}
}