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

Add shape data to Bullet Area overlap data. #42711

Merged
merged 1 commit into from
Nov 20, 2021

Conversation

madmiraal
Copy link
Contributor

Currently, Bullet physics Areas' area_shape_entered, area_shape_exited, body_shape_entered and body_shape_exited signals always report 0 for the area_shape, body_shape and self_shape:

call_event_res[1] = p_otherObject->get_self(); // Other body
call_event_res[2] = p_otherObject->get_instance_id(); // instance ID
call_event_res[3] = 0; // other_body_shape ID
call_event_res[4] = 0; // self_shape ID

This PR adds the area_shape, body_shape and self_shape ids to the signals.
It also removes the use of friend and goto in the collision detection function, and renames variables used so the code is easier to read and understand.

Fixes #19290.

@madmiraal
Copy link
Contributor Author

Rebased following merge of #43952.

@pouleyKetchoupp
Copy link
Contributor

The code generally looks good, it just needs a rebase then testing again on 3.x.

@pouleyKetchoupp pouleyKetchoupp added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Nov 18, 2021
@madmiraal madmiraal requested a review from a team as a code owner November 20, 2021 08:12
@akien-mga akien-mga merged commit b187448 into godotengine:master Nov 20, 2021
@akien-mga
Copy link
Member

Thanks!

@madmiraal madmiraal deleted the fix-19290 branch November 20, 2021 10:09
@akien-mga
Copy link
Member

akien-mga commented Nov 20, 2021

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 Nov 20, 2021
@akien-mga
Copy link
Member

Cherry-picked for 3.5.

Actually no, there's more work needed as the cherry-pick doesn't build properly in 3.x (and this PR wouldn't build either in master if bullet could build :)), there's some changes following #42374 that need to be handled here too. I'll reopen #42712 to handle the cherry-pick for 3.x (though I do advise restarting from the master PR as too much changed style wise in 3.x since then - here's my WIP cherry-pick that doesn't compile: akien-mga@291a78f).

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.

[Bullet] area_shape is 0 in body_shape_entered and body_shape_exited
3 participants