mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
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
This commit is contained in:
parent
c18abad8c3
commit
371e60c768
@ -276,10 +276,6 @@ do_sync_p2b(PN_stdfloat dt, int num_substeps) {
|
|||||||
void BulletWorld::
|
void BulletWorld::
|
||||||
do_sync_b2p() {
|
do_sync_b2p() {
|
||||||
|
|
||||||
for (BulletVehicle *vehicle : _vehicles) {
|
|
||||||
vehicle->do_sync_b2p();
|
|
||||||
}
|
|
||||||
|
|
||||||
for (BulletRigidBodyNode *body : _bodies) {
|
for (BulletRigidBodyNode *body : _bodies) {
|
||||||
body->do_sync_b2p();
|
body->do_sync_b2p();
|
||||||
}
|
}
|
||||||
@ -295,6 +291,10 @@ do_sync_b2p() {
|
|||||||
for (BulletBaseCharacterControllerNode *character : _characters) {
|
for (BulletBaseCharacterControllerNode *character : _characters) {
|
||||||
character->do_sync_b2p();
|
character->do_sync_b2p();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (BulletVehicle *vehicle : _vehicles) {
|
||||||
|
vehicle->do_sync_b2p();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user