Skip to content

Commit

Permalink
Revert "Move Bullet physics query flush from Bullet space pre-tick ca…
Browse files Browse the repository at this point in the history
…llback to"

This reverts commit e7d8464.

Fixes #40508 regression.

This will be re-applied and the regression fixed for a future 3.2.x release.
  • Loading branch information
akien-mga committed Jul 28, 2020
1 parent ba3f0fa commit 10544f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 0 additions & 6 deletions modules/bullet/bullet_physics_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1572,12 +1572,6 @@ void BulletPhysicsServer::sync() {
}

void BulletPhysicsServer::flush_queries() {
if (!active)
return;

for (int i = 0; i < active_spaces_count; ++i) {
active_spaces[i]->flush_queries();
}
}

void BulletPhysicsServer::finish() {
Expand Down
5 changes: 5 additions & 0 deletions modules/bullet/space_bullet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,10 @@ void SpaceBullet::remove_all_collision_objects() {
}
}

void onBulletPreTickCallback(btDynamicsWorld *p_dynamicsWorld, btScalar timeStep) {
static_cast<SpaceBullet *>(p_dynamicsWorld->getWorldUserInfo())->flush_queries();
}

void onBulletTickCallback(btDynamicsWorld *p_dynamicsWorld, btScalar timeStep) {

const btCollisionObjectArray &colObjArray = p_dynamicsWorld->getCollisionObjectArray();
Expand Down Expand Up @@ -632,6 +636,7 @@ void SpaceBullet::create_empty_world(bool p_create_soft_world) {

dynamicsWorld->setWorldUserInfo(this);

dynamicsWorld->setInternalTickCallback(onBulletPreTickCallback, this, true);
dynamicsWorld->setInternalTickCallback(onBulletTickCallback, this, false);
dynamicsWorld->getBroadphase()->getOverlappingPairCache()->setInternalGhostPairCallback(ghostPairCallback); // Setup ghost check
dynamicsWorld->getPairCache()->setOverlapFilterCallback(godotFilterCallback);
Expand Down

0 comments on commit 10544f1

Please sign in to comment.