diff options
| author | neikeq | 2015-11-04 22:39:07 +0100 |
|---|---|---|
| committer | neikeq | 2015-11-19 00:19:00 +0100 |
| commit | f84dc8e59da0f1b835a5c0017b965ad5dbc2ae13 (patch) | |
| tree | 9f620d91a35d2cdc2b57b4d56deed2db3fccae97 /tools/editor/plugins/spatial_editor_plugin.h | |
| parent | d123c89c5802777e02402108d9271ed2f29368fe (diff) | |
| download | godot-f84dc8e59da0f1b835a5c0017b965ad5dbc2ae13.tar.gz godot-f84dc8e59da0f1b835a5c0017b965ad5dbc2ae13.tar.zst godot-f84dc8e59da0f1b835a5c0017b965ad5dbc2ae13.zip | |
Added selection menu to spatial and canvas editors
Diffstat (limited to '')
| -rw-r--r-- | tools/editor/plugins/spatial_editor_plugin.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/editor/plugins/spatial_editor_plugin.h b/tools/editor/plugins/spatial_editor_plugin.h index ff8912fca..ebd3f77fe 100644 --- a/tools/editor/plugins/spatial_editor_plugin.h +++ b/tools/editor/plugins/spatial_editor_plugin.h @@ -111,12 +111,21 @@ private: bool orthogonal; float gizmo_scale; + struct _RayResult { + + Spatial* item; + float depth; + int handle; + _FORCE_INLINE_ bool operator<(const _RayResult& p_rr) const { return depth<p_rr.depth; } + }; + void _update_name(); void _compute_edit(const Point2& p_point); void _clear_selected(); void _select_clicked(bool p_append,bool p_single); void _select(Spatial *p_node, bool p_append,bool p_single); ObjectID _select_ray(const Point2& p_pos, bool p_append,bool &r_includes_current,int *r_gizmo_handle=NULL,bool p_alt_select=false); + void _find_items_at_pos(const Point2& p_pos,bool &r_includes_current,Vector<_RayResult> &results,bool p_alt_select=false); Vector3 _get_ray_pos(const Vector2& p_pos) const; Vector3 _get_ray(const Vector2& p_pos); Point2 _point_to_screen(const Vector3& p_point); @@ -136,9 +145,12 @@ private: float get_fov() const; ObjectID clicked; + Vector<_RayResult> selection_results; bool clicked_includes_current; bool clicked_wants_append; + PopupMenu *selection_menu; + enum NavigationScheme { NAVIGATION_GODOT, NAVIGATION_MAYA, @@ -225,6 +237,8 @@ private: void _toggle_camera_preview(bool); void _init_gizmo_instance(int p_idx); void _finish_gizmo_instances(); + void _selection_result_pressed(int); + void _selection_menu_hide(); protected: |
