summaryrefslogtreecommitdiff
path: root/editor/plugins/spatial_editor_plugin.h
diff options
context:
space:
mode:
authorMarc Gilleron <marc.gilleron@gmail.com>2017-10-08 02:43:57 +0200
committerMarc Gilleron <marc.gilleron@gmail.com>2017-10-10 02:38:17 +0200
commitde42e53671c50e6b98cbd1848be407c879d057c5 (patch)
treed2be78b3d9815ea31455cd31e741c0f972b3adc6 /editor/plugins/spatial_editor_plugin.h
parentbd10a002402de6e3a69a17af604784ea7f5b3330 (diff)
Freelook interpolation fixes
- Smooth freelook position more explicitely - Don't let orbit zoom produce translation when it shouldn't - Make base speed framerate-independent (and tweaked setting for that) - Don't rely on camera for calculations because it no longer reflect immediate state - Avoid potential divide-by-zero with zoom inertia - Make speed/zoom relation optional (if enabled, speed is adjusted from zoom) - Never change zoom distance when freelook is active - Orbit inertia also applies on freelook
Diffstat (limited to 'editor/plugins/spatial_editor_plugin.h')
-rw-r--r--editor/plugins/spatial_editor_plugin.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h
index 4f4c540048..a9dd1f1327 100644
--- a/editor/plugins/spatial_editor_plugin.h
+++ b/editor/plugins/spatial_editor_plugin.h
@@ -131,7 +131,7 @@ private:
float gizmo_scale;
bool freelook_active;
- Vector3 freelook_target_position;
+ real_t freelook_speed;
PanelContainer *info;
Label *info_label;
@@ -231,6 +231,7 @@ private:
Vector3 pos;
float x_rot, y_rot, distance;
+ Vector3 eye_pos; // Used in freelook mode
bool region_select;
Point2 region_begin, region_end;
@@ -239,10 +240,17 @@ private:
distance = 4;
region_select = false;
}
- } cursor, camera_cursor;
+ };
+ // Viewport camera supports movement smoothing,
+ // so one cursor is the real cursor, while the other can be an interpolated version.
+ Cursor cursor; // Immediate cursor
+ Cursor camera_cursor; // That one may be interpolated (don't modify this one except for smoothing purposes)
void scale_cursor_distance(real_t scale);
+ void set_freelook_active(bool active_now);
+ void scale_freelook_speed(real_t scale);
+
real_t zoom_indicator_delay;
RID move_gizmo_instance[3], move_plane_gizmo_instance[3], rotate_gizmo_instance[3], scale_gizmo_instance[3];