diff --git a/panda/src/bullet/bulletVehicle.cxx b/panda/src/bullet/bulletVehicle.cxx index f4321cd911..ba7ee35d6d 100644 --- a/panda/src/bullet/bulletVehicle.cxx +++ b/panda/src/bullet/bulletVehicle.cxx @@ -235,10 +235,13 @@ 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); - btWheelInfo info = _vehicle->getWheelInfo(i); + // synchronize the wheels with the (interpolated) chassis worldtransform. + // It resets the m_isInContact flag, so restore that afterwards. + bool in_contact = info.m_raycastInfo.m_isInContact; + _vehicle->updateWheelTransform(i, true); + info.m_raycastInfo.m_isInContact = in_contact; PandaNode *node = (PandaNode *)info.m_clientInfo; if (node) {