diff options
| author | Marc Gilleron | 2017-05-07 22:59:05 +0200 |
|---|---|---|
| committer | Marc Gilleron | 2017-05-08 02:57:20 +0200 |
| commit | aaf9cacf5ff4cbe8c097efacf347f7bde9839e36 (patch) | |
| tree | f6ea2a78058c686aa652b7743e4866c763506d2d /editor/plugins/spatial_editor_plugin.h | |
| parent | 66725d9b21dc50b0bb38baa4aa376b7bbb56e0e4 (diff) | |
| download | godot-aaf9cacf5ff4cbe8c097efacf347f7bde9839e36.tar.gz godot-aaf9cacf5ff4cbe8c097efacf347f7bde9839e36.tar.zst godot-aaf9cacf5ff4cbe8c097efacf347f7bde9839e36.zip | |
Improved freelook
- Fix movement input affecting all viewports even when clicking outside
- Freelook up movement is now relative
- Prevent tool shortcut conflict when moving
- De-hardcode tool shortcuts (select, move, rotate, scale, wireframe)
- Movement speed depends on zoom distance (like panning)
- Mouse wheel controls speed (Blender-style) due to above point
- Added zoom distance indicator, hides after short delay
Diffstat (limited to '')
| -rw-r--r-- | editor/plugins/spatial_editor_plugin.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index 9d178b710..01435028a 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -113,7 +113,8 @@ private: bool transforming; bool orthogonal; float gizmo_scale; - real_t freelook_speed; + + bool freelook_active; struct _RayResult { @@ -217,6 +218,10 @@ private: } } cursor; + void scale_cursor_distance(real_t scale); + + real_t zoom_indicator_delay; + RID move_gizmo_instance[3], rotate_gizmo_instance[3]; String last_message; @@ -258,6 +263,7 @@ public: void set_state(const Dictionary &p_state); Dictionary get_state() const; void reset(); + bool is_freelook_active() const { return freelook_active; } void focus_selection(); @@ -298,11 +304,13 @@ public: }; private: + static const unsigned int VIEWPORTS_COUNT = 4; + EditorNode *editor; EditorSelection *editor_selection; Control *viewport_base; - SpatialEditorViewport *viewports[4]; + SpatialEditorViewport *viewports[VIEWPORTS_COUNT]; VSplitContainer *shader_split; HSplitContainer *palette_split; @@ -458,6 +466,8 @@ private: void _update_default_light_angle(); void _default_light_angle_input(const InputEvent &p_event); + bool is_any_freelook_active() const; + protected: void _notification(int p_what); //void _gui_input(InputEvent p_event); |
