-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Bullet crashes when a RigidBody's collision shape is changed just before the RigidBody is removed from the scene. #40283
Labels
Milestone
Comments
Confirmed in 3.2.2 and also 3.1 and 3.0.6 so it's not new. |
I can reproduce it on master too, with a different callstack:
Minimal repro project ported to 4.0: |
drwhut
added a commit
to drwhut/tabletop-club
that referenced
this issue
Jul 11, 2020
This is a workaround related to the bug found last commit where the engine would crash upon two stacks trying to merge. Issue related to the bug: godotengine/godot#40283
@pouleyKetchoupp The crash on master is a separate issue (which looks like a Bullet issue not a Godot issue) and needs it own issue, because it happens even with #40308. |
@madmiraal Added #40311 for the crash on master. |
akien-mga
changed the title
[3.2.2] Bullet crashes when a RigidBody's collision shape is changed just before the RigidBody is removed from the scene.
Bullet crashes when a RigidBody's collision shape is changed just before the RigidBody is removed from the scene.
Jul 13, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Godot version:
3.2.2
OS/device including version:
Linux/X11 (Linux Mint 20)
Issue description:
When changing a RigidBody's collision shape just before removing it from the scene, it crashes the engine.
Here is the backtrace:
Cause: I was going to try and make a pull request to fix this, but I don't feel that I know the physics engine well enough to try and fix it. But I think I may have found the culprit for anyone who wishes to try and fix this themselves in the hopes it will help:
By changing the collision shape, the following series of functions are called:
ShapeBullet::notifyShapeChanged()
RigidCollisionObjectBullet::shape_changed(int p_shape_index)
RigidBodyBullet::reload_shapes()
RigidBodyBullet::reload_body()
SpaceBullet::add_rigid_body(RigidBodyBullet *p_body)
RigidBodyBullet::scratch_space_override_modificator()
The last function sets a property of the rigid body,
isScratchedSpaceOverrideModificator
, totrue
. Because of this property being set totrue
, atrigid_body_bullet.cpp:379
the if statement returnstrue
and it runsreload_space_override_modificator()
. But because the rigid body has been removed from the scene, I assume that is why thespace
property at this point isNULL
, butreload_space_override_modificator()
relies onspace
to work.Steps to reproduce:
_body_entered
signal.Minimal reproduction project:
RigidBodyBugMinimal.zip
The text was updated successfully, but these errors were encountered: