diff options
| author | Marc Gilleron | 2017-05-01 20:57:35 +0200 |
|---|---|---|
| committer | Marc Gilleron | 2017-05-04 01:38:12 +0200 |
| commit | 442006b4bfd82247cf995bec6a33a2455cd21330 (patch) | |
| tree | 92511b91fa6f376eca2876cf0dbb34a060301851 /editor/plugins/spatial_editor_plugin.h | |
| parent | f527a6946285502f8d518f054b1bebc1d3fa564e (diff) | |
| download | godot-442006b4bfd82247cf995bec6a33a2455cd21330.tar.gz godot-442006b4bfd82247cf995bec6a33a2455cd21330.tar.zst godot-442006b4bfd82247cf995bec6a33a2455cd21330.zip | |
Added 3D freelook navigation mode
- Triggered by holding RMB
- Can look around in FPS style
- Can move with WASD
- Movement speed accelerates over time
- Can multiply speed with a modifier key to go faster or slower
- Configurable in editor settings and shortcuts
Diffstat (limited to 'editor/plugins/spatial_editor_plugin.h')
| -rw-r--r-- | editor/plugins/spatial_editor_plugin.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h index 430292742..c7336cef8 100644 --- a/editor/plugins/spatial_editor_plugin.h +++ b/editor/plugins/spatial_editor_plugin.h @@ -113,6 +113,7 @@ private: bool transforming; bool orthogonal; float gizmo_scale; + real_t freelook_speed; struct _RayResult { @@ -168,7 +169,8 @@ private: NAVIGATION_NONE, NAVIGATION_PAN, NAVIGATION_ZOOM, - NAVIGATION_ORBIT + NAVIGATION_ORBIT, + NAVIGATION_LOOK }; enum TransformMode { TRANSFORM_NONE, @@ -203,8 +205,6 @@ private: struct Cursor { - Vector3 cursor_pos; - Vector3 pos; float x_rot, y_rot, distance; bool region_select; @@ -227,10 +227,12 @@ private: // void _update_camera(); + Transform to_camera_transform(const Cursor &p_cursor) const; void _draw(); void _smouseenter(); void _sinput(const InputEvent &p_ie); + void _update_freelook(real_t delta); SpatialEditor *spatial_editor; Camera *previewing; @@ -385,7 +387,6 @@ private: }; Button *tool_button[TOOL_MAX]; - Button *instance_button; MenuButton *transform_menu; MenuButton *view_menu; |
