From 371e60c768cfd1a1383c5b05f1cab2078014ccea Mon Sep 17 00:00:00 2001 From: David Carlsson Date: Sat, 23 Jun 2018 00:02:10 +0200 Subject: [PATCH] bullet: Change the b2p sync-order to allow parenting BulletWheels to a BulletVehicle Parenting a BulletVehicle's wheels to the chassis-BulletRigidBodyNode now works as expected. Previously doing this would make the wheels appear to be positioned one frame ahead of the chassis, because the wheel's position were synced before the chassis' position. For more information see issue #250. Closes #349 --- panda/src/bullet/bulletWorld.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/src/bullet/bulletWorld.cxx b/panda/src/bullet/bulletWorld.cxx index 38186101d6..e1e416a2bb 100644 --- a/panda/src/bullet/bulletWorld.cxx +++ b/panda/src/bullet/bulletWorld.cxx @@ -276,10 +276,6 @@ do_sync_p2b(PN_stdfloat dt, int num_substeps) { void BulletWorld:: do_sync_b2p() { - for (BulletVehicle *vehicle : _vehicles) { - vehicle->do_sync_b2p(); - } - for (BulletRigidBodyNode *body : _bodies) { body->do_sync_b2p(); } @@ -295,6 +291,10 @@ do_sync_b2p() { for (BulletBaseCharacterControllerNode *character : _characters) { character->do_sync_b2p(); } + + for (BulletVehicle *vehicle : _vehicles) { + vehicle->do_sync_b2p(); + } } /**