Skip to content

Commit a538410

Browse files
Jabberdrakeakien-mga
authored andcommitted
Fixes 3D axes flickering in the negative direction
When zooming out in the 3d node editor view, the negative half of all 3d axes starts flickering upon moving the camera. To fix this, the logic surrounding 3d transform "scaled" and "translated" calls has been altered so as to account for negative distance values. Fixes godotengine#89215.
1 parent 9d6bdbc commit a538410

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

editor/plugins/node_3d_editor_plugin.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6639,8 +6639,13 @@ void fragment() {
66396639

66406640
for (int j = 0; j < 4; j++) {
66416641
Transform3D t = Transform3D();
6642-
t = t.scaled(axis * distances[j + 1]);
6643-
t = t.translated(axis * distances[j]);
6642+
if (distances[j] > 0.0) {
6643+
t = t.scaled(axis * distances[j + 1]);
6644+
t = t.translated(axis * distances[j]);
6645+
} else {
6646+
t = t.scaled(axis * distances[j]);
6647+
t = t.translated(axis * distances[j + 1]);
6648+
}
66446649
RenderingServer::get_singleton()->multimesh_instance_set_transform(origin_multimesh, i * 4 + j, t);
66456650
RenderingServer::get_singleton()->multimesh_instance_set_color(origin_multimesh, i * 4 + j, origin_color);
66466651
}

0 commit comments

Comments
 (0)