-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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 multiple 2D & 3D physics issues (2.1) #8999
Conversation
21c9304
to
06e2499
Compare
06e2499
to
3799935
Compare
I've tested my game and some 2D & 3D offical demos involving physics, and everything seems to be working OK.
|
3799935
to
8ae109d
Compare
8ae109d
to
e0183f7
Compare
e0183f7
to
a6de6c8
Compare
a6de6c8
to
83a1ed7
Compare
83a1ed7
to
07dd4cb
Compare
@akien-mga, please have a look at my last 'update' in this PR's description. |
By the way, any chance for this to make it into 2.1.4? If it's too late, it would be nice to have there at least the most straightforward fixes. I could make a separate PR out of them. |
I wanted to merge it for testing yesterday but you had tagged it as WIP so I refrained :) I'll try to have a cursory look at the current state and merge it. |
I'm trying to do the split to move the fixes I'm less confident about to
another PR.
El 18 jun. 2017 1:07 a. m., "Rémi Verschelde" <[email protected]>
escribió:
… I wanted to merge it for testing yesterday but you had tagged it as WIP so
I refrained :) I'll try to have a cursory look at the current state and
merge it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#8999 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALQCtmgf_ILKr72ahcuKHcpUeOZHMtN0ks5sFFoNgaJpZM4NqptB>
.
|
- Use `NOTIFICATION_ENTER`/`EXIT_WORLD` for `Area` (intead of `*_TREE`). - Now both bodies' and areas' constraints are cleaned up. - And now also that happens as soon as the space is set to null (i.e., when exiting the tree) instead of only at freeing time. - When clearing constraints, the loop goes on to the next if the current is already released, instead of breaking. - When one has been already released, no error is shown from now on, as it's something expected, since a pair (our kind of constraint of interest) can be freed by any of its involved collision objects and the other will try again. - Implement index shifting (or marking as -1) for shapes indices in collision pairs shapes are removed. - Standarize behavior of bodies and areas so that anything that invalidates a given pair gives the same result (collision mask, actual collision, etc); for instance, triggering area enter/exit signals. - Add missing member initializations. - Extend the new-space-equals-area/body-current-space test to every case. - Fix 3D ray-casts early accepting Areas (skipping the mask check). - Fix unpairing of large elements (2D's `BroadPhase2DHashGrid`). Some of these prevent random crashes caused by constraints with dangling pointers to involved objects. Fixes godotengine#8856. Fixes godotengine#7589. Fixes godotengine#6676. And maybe others.
07dd4cb
to
3e5e8b6
Compare
Sorry for the annoyance. The thing is that I've been auditing the code and I think everything should go together. |
I can't really assess all changes, but let's give it a spin and see how it goes. |
This affected both 2D & 3D physics and was a regression introduced by my physics mega-fix (godotengine#8999).
@akien-mga, I think some of these are needed for 3.0, but now I'm too busy. (And not forgetting #9518, which fixed a regression.) What can we do? Wait for me being not so busy (no estimated timeframe) or what? |
No problem. It's not that much. I'm porting them myself. |
NOTIFICATION_ENTER
/EXIT_WORLD
forArea
(intead of*_TREE
).BroadPhase2DHashGrid
).Some of these prevent random crashes caused by constraints with dangling pointers to involved objects.
Fixes #8856.
Fixes #7589.
Fixes #6676.
And maybe others.
NOTE:One of the issues is fixed by #9094, so I've worked on this with that one merged so it's a dependency.
UPDATE:I've started noticing an issue that can make the engine crash. Not sure if it's something directly due to my modifications or if I have uncovered a latent bug somehow. So still researching.
UPDATE:What I am being hit by is #6676. So I'm trying to hunt that bug and add a fix for it to this PR.
UPDATE:Now I know objects are being properly destroyed at the C++ level (AKA, the #9094 debacle), I'm looking in other places.
UPDATE:
On my part, this is ready to review and test.
Also someone should check the eligibility of some or all of these fixes for master as I currently don't have the time to do it.