diff options
Diffstat (limited to 'scene/main/viewport.h')
-rw-r--r-- | scene/main/viewport.h | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 59715ebd0e..b5c49a8a97 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -50,6 +50,7 @@ class Label; class Timer; class Viewport; class CollisionObject3D; +class SceneTreeTimer; class ViewportTexture : public Texture2D { GDCLASS(ViewportTexture, Texture2D); @@ -214,7 +215,8 @@ private: } } camera_override; - Camera3D *camera = nullptr; + Camera3D *camera_3d = nullptr; + Camera2D *camera_2d = nullptr; Set<Camera3D *> cameras; Set<CanvasLayer *> canvas_layers; @@ -262,7 +264,7 @@ private: Transform3D physics_last_camera_transform; ObjectID physics_last_id; bool physics_has_last_mousepos = false; - Vector2 physics_last_mousepos = Vector2(Math_INF, Math_INF); + Vector2 physics_last_mousepos = Vector2(INFINITY, INFINITY); struct { bool alt = false; bool control = false; @@ -372,7 +374,7 @@ private: bool drag_attempted = false; Variant drag_data; ObjectID drag_preview_id; - float tooltip_timer = -1.0; + Ref<SceneTreeTimer> tooltip_timer; float tooltip_delay = 0.0; Transform2D focus_inv_xform; bool roots_order_dirty = false; @@ -403,7 +405,6 @@ private: void _gui_call_notification(Control *p_control, int p_what); void _gui_sort_roots(); - Control *_gui_find_control(const Point2 &p_global); Control *_gui_find_control_at_pos(CanvasItem *p_node, const Point2 &p_global, const Transform2D &p_xform, Transform2D &r_inv_xform); void _gui_input_event(Ref<InputEvent> p_event); @@ -450,11 +451,14 @@ private: void _listener_make_next_current(Listener3D *p_exclude); friend class Camera3D; - void _camera_transform_changed_notify(); - void _camera_set(Camera3D *p_camera); - bool _camera_add(Camera3D *p_camera); //true if first - void _camera_remove(Camera3D *p_camera); - void _camera_make_next_current(Camera3D *p_exclude); + void _camera_3d_transform_changed_notify(); + void _camera_3d_set(Camera3D *p_camera); + bool _camera_3d_add(Camera3D *p_camera); //true if first + void _camera_3d_remove(Camera3D *p_camera); + void _camera_3d_make_next_current(Camera3D *p_exclude); + + friend class Camera2D; + void _camera_2d_set(Camera2D *p_camera_2d); friend class CanvasLayer; void _canvas_layer_add(CanvasLayer *p_canvas_layer); @@ -497,7 +501,8 @@ public: uint64_t get_processed_events_count() const { return event_count; } Listener3D *get_listener() const; - Camera3D *get_camera() const; + Camera3D *get_camera_3d() const; + Camera2D *get_camera_2d() const; void enable_camera_override(bool p_enable); bool is_camera_override_enabled() const; @@ -624,6 +629,8 @@ public: bool gui_is_dragging() const; + Control *gui_find_control(const Point2 &p_global); + void set_sdf_oversize(SDFOversize p_sdf_oversize); SDFOversize get_sdf_oversize() const; |