diff options
Diffstat (limited to 'scene/resources/primitive_meshes.cpp')
-rw-r--r-- | scene/resources/primitive_meshes.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index 46e8575018..99edf26dc1 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -35,7 +35,6 @@ PrimitiveMesh */ void PrimitiveMesh::_update() const { - Array arr; arr.resize(RS::ARRAY_MAX); _create_mesh_array(arr); @@ -47,13 +46,13 @@ void PrimitiveMesh::_update() const { int pc = points.size(); ERR_FAIL_COND(pc == 0); { - const Vector3 *r = points.ptr(); for (int i = 0; i < pc; i++) { - if (i == 0) + if (i == 0) { aabb.position = r[i]; - else + } else { aabb.expand_to(r[i]); + } } } @@ -63,7 +62,6 @@ void PrimitiveMesh::_update() const { Vector<Vector3> normals = arr[RS::ARRAY_NORMAL]; if (normals.size() && indices.size()) { - { int nc = normals.size(); Vector3 *w = normals.ptrw(); @@ -99,9 +97,9 @@ void PrimitiveMesh::_update() const { } void PrimitiveMesh::_request_update() { - - if (pending_request) + if (pending_request) { return; + } _update(); } @@ -142,8 +140,8 @@ Array PrimitiveMesh::surface_get_arrays(int p_surface) const { Dictionary PrimitiveMesh::surface_get_lods(int p_surface) const { return Dictionary(); //not really supported } -Array PrimitiveMesh::surface_get_blend_shape_arrays(int p_surface) const { +Array PrimitiveMesh::surface_get_blend_shape_arrays(int p_surface) const { return Array(); //not really supported } @@ -230,14 +228,12 @@ Array PrimitiveMesh::get_mesh_arrays() const { } void PrimitiveMesh::set_custom_aabb(const AABB &p_custom) { - custom_aabb = p_custom; RS::get_singleton()->mesh_set_custom_aabb(mesh, custom_aabb); emit_changed(); } AABB PrimitiveMesh::get_custom_aabb() const { - return custom_aabb; } @@ -251,7 +247,6 @@ bool PrimitiveMesh::get_flip_faces() const { } PrimitiveMesh::PrimitiveMesh() { - flip_faces = false; // defaults mesh = RenderingServer::get_singleton()->mesh_create(); @@ -1382,7 +1377,6 @@ void QuadMesh::_create_mesh_array(Array &p_arr) const { }; for (int i = 0; i < 6; i++) { - int j = indices[i]; faces.set(i, quad_faces[j]); normals.set(i, Vector3(0, 0, 1)); |