Merge pull request #40184 from madmiraal/fix-37702
Move Bullet physics query flush from Bullet space pre-tick callback to Bullet physics flush_queries()
This commit is contained in:
commit
fb664c61f5
|
@ -1557,6 +1557,13 @@ void BulletPhysicsServer3D::sync() {
|
|||
}
|
||||
|
||||
void BulletPhysicsServer3D::flush_queries() {
|
||||
if (!active) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < active_spaces_count; ++i) {
|
||||
active_spaces[i]->flush_queries();
|
||||
}
|
||||
}
|
||||
|
||||
void BulletPhysicsServer3D::finish() {
|
||||
|
|
|
@ -579,10 +579,6 @@ 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();
|
||||
|
||||
|
@ -650,7 +646,6 @@ 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);
|
||||
|
|
Loading…
Reference in New Issue