Browse Source

bullet: Interpolate BulletVehicle-wheel transform before syncing it to panda

Bullet automatically interpolate most bodies for us (for example the "chassis"
of a BulletVehicle), but BulletVehicle-wheels must be manually interpolated by
calling 'updateWheelTransform()'. Otherwise they will slowly rubber-band
between their intended position and a position one frame ahead in time.

For more information see issue #250.
David Carlsson 7 years ago
parent
commit
c18abad8c3
1 changed files with 3 additions and 0 deletions
  1. 3 0
      panda/src/bullet/bulletVehicle.cxx

+ 3 - 0
panda/src/bullet/bulletVehicle.cxx

@@ -232,6 +232,9 @@ void BulletVehicle::
 do_sync_b2p() {
 
   for (int i=0; i < _vehicle->getNumWheels(); i++) {
+    // synchronize the wheels with the (interpolated) chassis worldtransform
+    _vehicle->updateWheelTransform(i, true);
+
     btWheelInfo info = _vehicle->getWheelInfo(i);
 
     PandaNode *node = (PandaNode *)info.m_clientInfo;