Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix physics BVH pairing for teleported or fast moving objects #55036

Merged
merged 1 commit into from
Nov 17, 2021

Conversation

pouleyKetchoupp
Copy link
Contributor

Updating the broadphase to find new collision pairs was done after checking for collision islands, so it was working in most cases due to the pairing margin used in the BVH, but in case of teleported objects the narrowphase collision could be skipped.

Now it's done before checking for collision islands, so we can ensure that broadphase pairing has been done at the same time as objects are marked as moved so their collision can be checked properly.

This issue didn't happen in the Octree/HashGrid because they do nothing on update and trigger pairs directly when objects move instead.

Fixes #54898 on master
4.0 port of #54925

Updating the broadphase to find new collision pairs was done after
checking for collision islands, so it was working in most cases due to
the pairing margin used in the BVH, but in case of teleported objects
the narrowphase collision could be skipped.

Now it's done before checking for collision islands, so we can ensure
that broadphase pairing has been done at the same time as objects are
marked as moved so their collision can be checked properly.

This issue didn't happen in the Octree/HashGrid because they do nothing
on update and trigger pairs directly when objects move instead.
@pouleyKetchoupp pouleyKetchoupp merged commit 7d1b454 into godotengine:master Nov 17, 2021
@pouleyKetchoupp pouleyKetchoupp deleted the bvh-fix-update branch November 17, 2021 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Collision between small Area2D's fails when using BVH
2 participants