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 shape index in multiple physics queries with Bullet #55533

Merged
merged 1 commit into from
Dec 1, 2021

Conversation

pouleyKetchoupp
Copy link
Contributor

Two main changes:

  • Better handling of concave shapes to make sure the queries don't return a triangle index instead of shape index.
    Note: A concave shape within a compound shape will always return a shape index of 0 because of Bullet limitations.

  • Extra check for compound shapes in some queries to avoid undefined behavior, because the shape index can have an uninitialized value with convex shapes in some cases.

Fixes #47989
Fixes a bug discussed in chat with intersect_shape returning randomly wrong shape index (CC @Zylann)

Tested only on 3.x because Bullet is currently disabled on master, but the code is the same.

Two main changes:

- Better handling of concave shapes to make sure the queries don't
return a triangle index instead of shape index.
Note: A concave shape within a compound shape will always return a shape
index of 0 because of Bullet limitations.

- Extra check for compound shapes in some queries to avoid undefined
behavior, because the shape index can have an uninitialized value with
convex shapes in some cases.
@pouleyKetchoupp pouleyKetchoupp added bug topic:physics cherrypick:3.x Considered for cherry-picking into a future 3.x release topic:3d labels Dec 1, 2021
@pouleyKetchoupp pouleyKetchoupp added this to the 4.0 milestone Dec 1, 2021
@pouleyKetchoupp pouleyKetchoupp requested a review from a team December 1, 2021 21:38
@akien-mga akien-mga merged commit 7f7e546 into godotengine:master Dec 1, 2021
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.5.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Dec 1, 2021
@pouleyKetchoupp pouleyKetchoupp deleted the bullet-query-shape-index branch December 1, 2021 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants