Merge pull request #36977 from lupoDharkael/decompose-copy

Mesh::convex_decompose: Remove unneeded vector copy
This commit is contained in:
Rémi Verschelde 2020-03-11 15:12:15 +01:00 committed by GitHub
commit 98cdf50a55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 8 deletions

View File

@ -545,15 +545,9 @@ Vector<Ref<Shape> > Mesh::convex_decompose() const {
ERR_FAIL_COND_V(!convex_composition_function, Vector<Ref<Shape> >()); ERR_FAIL_COND_V(!convex_composition_function, Vector<Ref<Shape> >());
Vector<Face3> faces = get_faces(); const 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];
}
Vector<Vector<Face3> > decomposed = convex_composition_function(f3); Vector<Vector<Face3> > decomposed = convex_composition_function(faces);
Vector<Ref<Shape> > ret; Vector<Ref<Shape> > ret;