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 signal to inform joint that body has exited tree #44703

Merged
merged 1 commit into from
Dec 31, 2020

Conversation

madmiraal
Copy link
Contributor

Currently there is no way to inform a Joint that a PhysicsBody attached to it has been removed. This PR connects the tree_exiting signal from a PhysicsBody attached to a configured Joint to provide this information and update the Joint.

Fixes #44510

Note: This also addresses:

  1. The error message(s) raised in Bullet physics when trying to reconfigure a Joint that has had a PhysicsBody freed without first disconnecting it from the Joint; as described here.
  2. The warning message raised in Bullet physics when a scene was closed with a PhysicsBody attached to a Joint above it in the tree; as identified here.

This PR includes raising the warning message in Bullet physics to an error; since this should now never occur.

scene/2d/joints_2d.cpp Outdated Show resolved Hide resolved
scene/2d/joints_2d.cpp Outdated Show resolved Hide resolved
scene/2d/joints_2d.cpp Outdated Show resolved Hide resolved
scene/2d/joints_2d.cpp Show resolved Hide resolved
modules/bullet/space_bullet.cpp Show resolved Hide resolved
@pouleyKetchoupp
Copy link
Contributor

Everything seems to work fine now! It should be good to go after the last little coding style fix.

@akien-mga akien-mga merged commit 36c9432 into godotengine:master Dec 31, 2020
@akien-mga
Copy link
Member

Thanks!

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.

Crash in Godot Physics when removing a rigid body connected in a constraint
3 participants