summaryrefslogtreecommitdiff
path: root/scene/resources/primitive_meshes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/primitive_meshes.cpp')
-rw-r--r--scene/resources/primitive_meshes.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp
index 6a3ddde02a..2b8c0ddedd 100644
--- a/scene/resources/primitive_meshes.cpp
+++ b/scene/resources/primitive_meshes.cpp
@@ -1016,13 +1016,9 @@ void PrismMesh::_create_mesh_array(Array &p_arr) const {
for (j = 0; j <= (subdivide_h + 1); j++) {
float scale = (y - start_pos.y) / size.y;
float scaled_size_x = size.x * scale;
- float start_x = start_pos.x;
- float offset_front = 0.0;
- float offset_back = 0.0;
-
- start_x += (1.0 - scale) * size.x * left_to_right;
- offset_front += (1.0 - scale) * onethird * left_to_right;
- offset_back = (1.0 - scale) * onethird * (1.0 - left_to_right);
+ float start_x = start_pos.x + (1.0 - scale) * size.x * left_to_right;
+ float offset_front = (1.0 - scale) * onethird * left_to_right;
+ float offset_back = (1.0 - scale) * onethird * (1.0 - left_to_right);
x = 0.0;
for (i = 0; i <= (subdivide_w + 1); i++) {