From c18abad8c3373aff134dd02d099d476d094b0b69 Mon Sep 17 00:00:00 2001 From: David Carlsson Date: Tue, 12 Jun 2018 18:45:58 +0200 Subject: [PATCH] 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. --- panda/src/bullet/bulletVehicle.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/panda/src/bullet/bulletVehicle.cxx b/panda/src/bullet/bulletVehicle.cxx index 5575d6ff22..5dbb70cc7f 100644 --- a/panda/src/bullet/bulletVehicle.cxx +++ b/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;