summaryrefslogtreecommitdiffstats
path: root/scene/resources/mesh.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-09-14 14:34:22 +0200
committerGitHub <noreply@github.com>2021-09-14 14:34:22 +0200
commite13d8eda1b77fd55a711ed06848de6a369905d0c (patch)
treeb4a33110c44c2e712952a0eb85279f2c2c80a5b8 /scene/resources/mesh.cpp
parent0f7fe554fb65a7a7f319d1d6f51bb6060f99f246 (diff)
parente3a06c3a9ed8545e1ab5b807d106ebfb8a15e995 (diff)
downloadredot-engine-e13d8eda1b77fd55a711ed06848de6a369905d0c.tar.gz
Merge pull request #52266 from AndreaCatania/coll
Diffstat (limited to 'scene/resources/mesh.cpp')
-rw-r--r--scene/resources/mesh.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index 71d0c69d55..1edc3ff38b 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -224,7 +224,9 @@ Vector<Face3> Mesh::get_faces() const {
Ref<Shape3D> Mesh::create_convex_shape(bool p_clean, bool p_simplify) const {
if (p_simplify) {
- Vector<Ref<Shape3D>> decomposed = convex_decompose(1);
+ ConvexDecompositionSettings settings;
+ settings.max_convex_hulls = 1;
+ Vector<Ref<Shape3D>> decomposed = convex_decompose(settings);
if (decomposed.size() == 1) {
return decomposed[0];
} else {
@@ -565,12 +567,12 @@ void Mesh::clear_cache() const {
debug_lines.clear();
}
-Vector<Ref<Shape3D>> Mesh::convex_decompose(int p_max_convex_hulls) const {
+Vector<Ref<Shape3D>> Mesh::convex_decompose(const ConvexDecompositionSettings &p_settings) const {
ERR_FAIL_COND_V(!convex_composition_function, Vector<Ref<Shape3D>>());
const Vector<Face3> faces = get_faces();
- Vector<Vector<Face3>> decomposed = convex_composition_function(faces, p_max_convex_hulls);
+ const Vector<Vector<Face3>> decomposed = convex_composition_function(faces, p_settings);
Vector<Ref<Shape3D>> ret;