diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_settings.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/spatial_editor_plugin.cpp | 36 | ||||
-rw-r--r-- | editor/plugins/tile_map_editor_plugin.cpp | 4 |
3 files changed, 28 insertions, 18 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 02a9999eae..cec3bc7f2d 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -690,11 +690,11 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { hints["editors/3d/navigation_feel/orbit_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); set("editors/3d/navigation_feel/translation_inertia", 0.15); hints["editors/3d/navigation_feel/translation_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); - set("editors/3d/navigation_feel/zoom_inertia", 0.1); + set("editors/3d/navigation_feel/zoom_inertia", 0.075); hints["editors/3d/navigation_feel/zoom_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/zoom_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); - set("editors/3d/navigation_feel/manipulation_orbit_inertia", 0.1); + set("editors/3d/navigation_feel/manipulation_orbit_inertia", 0.075); hints["editors/3d/navigation_feel/manipulation_orbit_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/manipulation_orbit_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); - set("editors/3d/navigation_feel/manipulation_translation_inertia", 0.1); + set("editors/3d/navigation_feel/manipulation_translation_inertia", 0.075); hints["editors/3d/navigation_feel/manipulation_translation_inertia"] = PropertyInfo(Variant::REAL, "editors/3d/navigation_feel/manipulation_translation_inertia", PROPERTY_HINT_RANGE, "0.0, 1, 0.01"); // freelook diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 008dcac2c1..bfdbdda8fe 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -70,20 +70,17 @@ #define MAX_FOV 179 void SpatialEditorViewport::_update_camera(float p_interp_delta) { - if (orthogonal) { - //camera->set_orthogonal(size.width*cursor.distance,get_znear(),get_zfar()); - camera->set_orthogonal(2 * cursor.distance, 0.1, 8192); - } else - camera->set_perspective(get_fov(), get_znear(), get_zfar()); + + bool is_orthogonal = camera->get_projection() == Camera::PROJECTION_ORTHOGONAL; //when not being manipulated, move softly - float free_orbit_inertia = EDITOR_DEF("editors/3d/navigation_feel/orbit_inertia", 0.15); - float free_translation_inertia = EDITOR_DEF("editors/3d/navigation_feel/translation_inertia", 0.15); + float free_orbit_inertia = EDITOR_GET("editors/3d/navigation_feel/orbit_inertia"); + float free_translation_inertia = EDITOR_GET("editors/3d/navigation_feel/translation_inertia"); //when being manipulated, move more quickly - float manip_orbit_inertia = EDITOR_DEF("editors/3d/navigation_feel/manipulation_orbit_inertia", 0.1); - float manip_translation_inertia = EDITOR_DEF("editors/3d/navigation_feel/manipulation_translation_inertia", 0.1); + float manip_orbit_inertia = EDITOR_GET("editors/3d/navigation_feel/manipulation_orbit_inertia"); + float manip_translation_inertia = EDITOR_GET("editors/3d/navigation_feel/manipulation_translation_inertia"); - float zoom_inertia = EDITOR_DEF("editors/3d/navigation_feel/zoom_inertia", 0.1); + float zoom_inertia = EDITOR_GET("editors/3d/navigation_feel/zoom_inertia"); //determine if being manipulated bool manipulated = (Input::get_singleton()->get_mouse_button_mask() & (2 | 4)) || Input::get_singleton()->is_key_pressed(KEY_SHIFT) || Input::get_singleton()->is_key_pressed(KEY_ALT) || Input::get_singleton()->is_key_pressed(KEY_CONTROL); @@ -104,21 +101,30 @@ void SpatialEditorViewport::_update_camera(float p_interp_delta) { camera_cursor = cursor; } - float tolerance = 0.0001; + float tolerance = 0.001; bool equal = true; - if (Math::abs(old_camera_cursor.x_rot - camera_cursor.x_rot) > tolerance || Math::abs(old_camera_cursor.y_rot - camera_cursor.y_rot) > tolerance) + if (Math::abs(old_camera_cursor.x_rot - camera_cursor.x_rot) > tolerance || Math::abs(old_camera_cursor.y_rot - camera_cursor.y_rot) > tolerance) { equal = false; + } - if (equal && old_camera_cursor.pos.distance_squared_to(camera_cursor.pos) > tolerance * tolerance) + if (equal && old_camera_cursor.pos.distance_squared_to(camera_cursor.pos) > tolerance * tolerance) { equal = false; + } - if (equal && Math::abs(old_camera_cursor.distance - camera_cursor.distance) > tolerance) + if (equal && Math::abs(old_camera_cursor.distance - camera_cursor.distance) > tolerance) { equal = false; + } - if (!equal || p_interp_delta == 0 || is_freelook_active()) { + if (!equal || p_interp_delta == 0 || is_freelook_active() || is_orthogonal != orthogonal) { camera->set_global_transform(to_camera_transform(camera_cursor)); update_transform_gizmo_view(); + + if (orthogonal) { + //camera->set_orthogonal(size.width*cursor.distance,get_znear(),get_zfar()); + camera->set_orthogonal(2 * cursor.distance, 0.1, 8192); + } else + camera->set_perspective(get_fov(), get_znear(), get_zfar()); } } diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index b85ffd6c67..328d07d7a8 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -351,6 +351,10 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era return PoolVector<Vector2>(); } + if (id == prev_id) { + return PoolVector<Vector2>(); + } + Rect2i r = node->get_item_rect(); r.position = r.position / node->get_cell_size(); r.size = r.size / node->get_cell_size(); |