-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
[3.x] Use Bullet's convex hull computer in place of QuickHull when available. #47307
Conversation
a9d05b9
to
e7b01ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good idea and it seems to work well!
There are just two things I would like to address before approving:
- This change adds a dependency to VHACD module in Godot Physics, so given that the old QuickHull code is very small, I'd like to keep it as an alternative in case the engine is compiled with VHACD disabled (see my review comment).
- Another PR needs to be opened on master to keep the codebase in sync. The usual process is to open a PR on master first, and then the changes can be cherry-picked on 3.x when possible. In this case the file names have changed on master, so it makes sense to keep this separate 3.x PR.
Superseded by #47332
I tend to make patches against 3.x, since that's what I use and where I encounter bugs that I want to fix. |
This PR can stay open, since it would still be nice to have this fixed on 3.4 as well and the file names have changed. |
And just to note I'm using quick hull in several modules (and I presume others are too) and also in the rooms / portals PR. So keeping the old version available would be very useful (any replacement would have to be a drop in replacement, and always available). |
That's the plan. QuickHull will remain available. |
e7b01ae
to
7f0a8c6
Compare
Does this VHACD have the same issue that the Mesh::convex_decompose() did? If I recall correctly, that also used the VHACD algorithm, and when "convcolonly" for mesh imports was updated to use that instead of quickhull, it would result in incorrect collision (ex: a simple box would have the verts slightly off). Edit: Actually, looking closer, it seems the VHACD algorithm uses btConvexHullComputer, and you included the VHACD version, so you could just skip the VHACD:: in front of that and use the bullet one directly. |
@jitspoe I have not done much testing, but I assume that this algorithm is precise. |
Superseded by #48533. |
Fixes #45946, maybe more.