forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When importing a mesh, allow the user to simplify the created physics…
… TriMesh with mesh optimizer. Adds a new simplification option to the model importer when the trimesh physics mesh mode is selected similar to how the options for convex decomposition are presented. Also adds GDScript exports to generate a convex shapes and trimesh shapes (both simplified and simplified) to ImportMesh match Mesh. Closes godotengine/godot-proposals#3603, tested with the example project posted there. Update doc/classes/MeshSimplificationSettings.xml Update doc/classes/MeshSimplificationSettings.xml Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro> Update editor/import/3d/resource_importer_scene.cpp Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
- Loading branch information
Showing
9 changed files
with
219 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="MeshSimplificationSettings" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> | ||
<brief_description> | ||
Parameters to be used with a [Mesh] simplification operation. | ||
</brief_description> | ||
<description> | ||
Parameters to be used with a [Mesh] simplification operation. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<members> | ||
<member name="sloppy" type="bool" setter="set_sloppy" getter="get_sloppy" default="true"> | ||
If [code]true[/code], use the sloppy simplification algorithm. The sloppy algorithm does not try to follow the topography of the original mesh. | ||
</member> | ||
<member name="target_error" type="float" setter="set_target_error" getter="get_target_error" default="0.01"> | ||
How much the simplified mesh should be allowed to deviate from the source mesh normalized to 0..1 range. For example, a value of [code]0.01[/code] will try to maintain the error to be below 1% of the mesh extents. | ||
</member> | ||
<member name="target_vertex_reduction" type="float" setter="set_target_vertex_reduction" getter="get_target_vertex_reduction" default="0.2"> | ||
Fraction of vertices that should be in the simplified mesh. | ||
</member> | ||
</members> | ||
</class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters