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:
parent
9d6bdbc56e
commit
a53841021c
1 changed files with 7 additions and 2 deletions
|
@ -6639,8 +6639,13 @@ void fragment() {
|
||||||
|
|
||||||
for (int j = 0; j < 4; j++) {
|
for (int j = 0; j < 4; j++) {
|
||||||
Transform3D t = Transform3D();
|
Transform3D t = Transform3D();
|
||||||
|
if (distances[j] > 0.0) {
|
||||||
t = t.scaled(axis * distances[j + 1]);
|
t = t.scaled(axis * distances[j + 1]);
|
||||||
t = t.translated(axis * distances[j]);
|
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_transform(origin_multimesh, i * 4 + j, t);
|
||||||
RenderingServer::get_singleton()->multimesh_instance_set_color(origin_multimesh, i * 4 + j, origin_color);
|
RenderingServer::get_singleton()->multimesh_instance_set_color(origin_multimesh, i * 4 + j, origin_color);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue