-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
create_multiple_collision_shapes() does not do convex decomposition #67801
Comments
There are no 4.1/4.2/4.3 betas yet 🙂 You meant 4.0.beta1, 4.0.beta2 and 4.0.beta3 instead. |
That's what I meant |
You are asking to create a convex hull shape for a single torus triangle mesh while keeping the torus hole which is impossible.
|
No, "Create Multiple Convex Collisions" is supposed to create multiple convex collision shapes that approximately do what a trimesh collision shape would do, using convex decomposition using v-hacd. This bug isn't just happening with toruses but any concave mesh. The hole should not be closed to make the torus's collision shape be convex, it should have multiple collision shapes generated using v-hacd convex decomposition, whose union approximates what a trimesh collision shape does. |
and other rigid bodies should be then able to fall through the hole of the torus |
I agree for VHACD in general but VHACD has a wide range of bake parameters and those are set very low for both Editor Menu option as well as MeshInstance3D.create_multiple_convex_collisions(). So low in fact they have max_convex_hulls=1 set and this was done in 2021 (before it was set to infinite hulls) so it seemed like a deliberate choice but don't ask me why, not my area. Still even with this limits lifted in a custom build the torus has problems, might be the TriMesh creation or geometry parsing or something else I don't know but maybe someone else can use some of this info to fix it. |
The default option for the maximum number of convex hulls should probably be 10 or so, rather than 1. |
Why not have the max number of convex hulls be a parameter in MeshInstance3D.create_multiple_convex_collisions() function |
It is not only the hull count, there are a lot of parameters, to much for a function, needs to be wrapped if exposed. Lines 178 to 207 in 32997a5
|
It would be really helpful if this was exposed |
I think the ConvexDecompositionSettings could be exposed as a public property (serializable). Also, the user should be able to edit these settings in the editor: maybe displayed as a popup window when clicking on Mesh > Create Multiple Convex Collision Siblings. This should be added to the Godot 4.0 Issues Roadmap (Physics) since it's a breaking bug. |
When will this be exposed? |
Issues are resolved on a best-effort basis, so there's no ETA. A quick way to fix this would be to change the hardcoded hull count to something like 10 as I suggested, but this may introduce performance issues in certain situations. |
I can confirm this is behavior creates a regression in Godot 4.0. A simple concave shape mesh creates multiple convex collision shapes in Godot 3.5 when I use "Create Multiple Convex Collision Siblings", but in Godot 4.0 the same concave shape mesh creates one single convex block. I'm annexing a simple project with the shape in question. I haven't tested the PR yet, but it's weird that the default values for creating convex shapes in Godot 4.0 is worse than Godot 3.5; the behavior for a simple mesh like this should be the same. |
Godot version
4.0 dev( 4.1 beta, 4.2 beta, 4.3 beta)
System information
OS Version : MacOS Monterrey, Hardware : Mac OS Silicon
Issue description
When trying to automatically create multiple convex collision shapes from a concave MeshInstance3D, only one convex collision shape is created instead of multiple. This happens in the editor and when calling create_multiple_convex_collisions() in code on a MeshInstance3D.
Steps to reproduce
In editor:
In code:
Minimal reproduction project
ExampleOfBug.zip
The text was updated successfully, but these errors were encountered: