diff options
author | lupoDharkael <izhe@hotmail.es> | 2020-03-11 00:14:29 +0100 |
---|---|---|
committer | lupoDharkael <izhe@hotmail.es> | 2020-03-11 00:14:29 +0100 |
commit | 97d1149c3bd237584dbd10ee22b6fe707d1ae03b (patch) | |
tree | 4cc92eaca06e3d4a1071d2324306122d25a79215 | |
parent | cdbf0332902d34cfb3be7899fb738b5447bbb755 (diff) |
Mesh::convex_decompose: Remove unneeded vector copy
-rw-r--r-- | scene/resources/mesh.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index a063b7f74f..27016db14d 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -543,15 +543,9 @@ Vector<Ref<Shape> > Mesh::convex_decompose() const { ERR_FAIL_COND_V(!convex_composition_function, Vector<Ref<Shape> >()); - Vector<Face3> faces = get_faces(); - Vector<Face3> f3; - f3.resize(faces.size()); - const Face3 *f = faces.ptr(); - for (int i = 0; i < f3.size(); i++) { - f3.write[i] = f[i]; - } + const Vector<Face3> faces = get_faces(); - Vector<Vector<Face3> > decomposed = convex_composition_function(f3); + Vector<Vector<Face3> > decomposed = convex_composition_function(faces); Vector<Ref<Shape> > ret; |