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 #89215.
This commit is contained in:
Miguel Coelho 2024-04-05 10:20:17 +01:00 committed by Rémi Verschelde
parent 9d6bdbc56e
commit a53841021c
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -6639,8 +6639,13 @@ void fragment() {
for (int j = 0; j < 4; j++) {
Transform3D t = Transform3D();
t = t.scaled(axis * distances[j + 1]);
t = t.translated(axis * distances[j]);
if (distances[j] > 0.0) {
t = t.scaled(axis * distances[j + 1]);
t = t.translated(axis * distances[j]);
} else {
t = t.scaled(axis * distances[j]);
t = t.translated(axis * distances[j + 1]);
}
RenderingServer::get_singleton()->multimesh_instance_set_transform(origin_multimesh, i * 4 + j, t);
RenderingServer::get_singleton()->multimesh_instance_set_color(origin_multimesh, i * 4 + j, origin_color);
}