Godot: No more option to generate a single Convex Shape for a MeshInstance?

Created on 29 Jan 2020  路  5Comments  路  Source: godotengine/godot

Godot version:
3.2.stable.official

OS/device including version:
Not applicable.

Issue description:
The option to just have Godot generate a single Convex CollisionShape for a MeshInstance is no longer available, it seems to be replaced by the new Convex decomposition method in 3.2.
I get that this is a needed addition, but why remove the older option?
Wouldn't it make more sense to have both options available in the drop-down menu?
I realize that this is still possible to do with a tool script, but it seems illogical to me to directly replace it in the editor, was this done for a specific reason?

Congrats on the 3.2 release by the way!

discussion enhancement editor

Most helpful comment

So what I'm proposing is to just have the old functionality available next to the new decomposition option, 2 menu options, no need for additional dialogs.

Re-adding the old library just for this is probably a no-go, but maybe we can make the new library behave like the old one and give a single shape.

Edit: It turns out the quickhull code is still present, so we can use it as-is.

All 5 comments

Out of curiosity, why do you specifically need a single convex shape to be generated? If this is really needed, I suppose we could had a dialog to set the maximum number of convex shapes to generate. However, this would require one additional click for users who don't care about the number of shapes generated.

@Calinou
One example of where this could be needed is when you want to generate a collision shape for say, a stairs mesh, you don't always want the shape to exactly match the Mesh, for example when you want to have the player move over it smoothy without it possibly getting stuck on the steps.

Here's a picture of what I mean:
00:24:03-2020-01-30
At times like these more then one Convex shape makes little sense.

So what I'm proposing is to just have the old functionality available next to the new decomposition option, 2 menu options, no need for additional dialogs.

So what I'm proposing is to just have the old functionality available next to the new decomposition option, 2 menu options, no need for additional dialogs.

Re-adding the old library just for this is probably a no-go, but maybe we can make the new library behave like the old one and give a single shape.

Edit: It turns out the quickhull code is still present, so we can use it as-is.

Is this the same behavior that the create_convex_collision function would do?

This helper creates a StaticBody child node with a ConvexPolygonShape collision shape calculated from the mesh geometry.

If I understand how the collision generator helpers work, you might be able to create a trimesh static body and then a convex collision sibling, and re-parent the sibling shape with the static's child.

Is this the same behavior that the create_convex_collision function would do?

Correct, you can still call this method from a tool script to get the same result, so it should be easy to put this back into the Mesh menu.

Was this page helpful?
0 / 5 - 0 ratings