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.
This commit is contained in:
David Carlsson 2018-06-12 18:45:58 +02:00 committed by rdb
parent 29a08932ea
commit c18abad8c3

View File

@ -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;