Merge pull request #20848 from Calinou/improve-3d-manipulator-gizmo

Improve the 3D manipulator gizmo
This commit is contained in:
Rémi Verschelde 2018-08-14 15:43:52 +02:00 committed by GitHub
commit 892667878a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2824,7 +2824,7 @@ void SpatialEditorViewport::update_transform_gizmo_view() {
dd = 0.0001; dd = 0.0001;
float gsize = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_size"); float gsize = EditorSettings::get_singleton()->get("editors/3d/manipulator_gizmo_size");
gizmo_scale = (gsize / Math::abs(dd)); gizmo_scale = (gsize / Math::abs(dd)) * MAX(1, EDSCALE) / viewport_container->get_stretch_shrink();
Vector3 scale = Vector3(1, 1, 1) * gizmo_scale; Vector3 scale = Vector3(1, 1, 1) * gizmo_scale;
xform.basis.scale(scale); xform.basis.scale(scale);
@ -4517,9 +4517,9 @@ void SpatialEditor::_init_indicators() {
nivec * 0.0 + ivec * (GIZMO_ARROW_OFFSET + GIZMO_ARROW_SIZE), nivec * 0.0 + ivec * (GIZMO_ARROW_OFFSET + GIZMO_ARROW_SIZE),
}; };
int arrow_sides = 6; int arrow_sides = 16;
for (int k = 0; k < 6; k++) { for (int k = 0; k < arrow_sides; k++) {
Basis ma(ivec, Math_PI * 2 * float(k) / arrow_sides); Basis ma(ivec, Math_PI * 2 * float(k) / arrow_sides);
Basis mb(ivec, Math_PI * 2 * float(k + 1) / arrow_sides); Basis mb(ivec, Math_PI * 2 * float(k + 1) / arrow_sides);
@ -4603,10 +4603,10 @@ void SpatialEditor::_init_indicators() {
ivec * 0.02 + ivec2 * 0.02 + ivec2 * GIZMO_CIRCLE_SIZE, ivec * 0.02 + ivec2 * 0.02 + ivec2 * GIZMO_CIRCLE_SIZE,
}; };
for (int k = 0; k < 32; k++) { for (int k = 0; k < 64; k++) {
Basis ma(ivec, Math_PI * 2 * float(k) / 32); Basis ma(ivec, Math_PI * 2 * float(k) / 64);
Basis mb(ivec, Math_PI * 2 * float(k + 1) / 32); Basis mb(ivec, Math_PI * 2 * float(k + 1) / 64);
for (int j = 0; j < 4; j++) { for (int j = 0; j < 4; j++) {