diff options
author | Juan Linietsky <reduzio@gmail.com> | 2020-03-27 13:47:15 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-27 13:47:15 -0300 |
commit | 307b1b3a5835ecdb477859785c673a07e248f904 (patch) | |
tree | cc0123bc7111e48775331d500452875c278cc13b /modules/gridmap | |
parent | f48aeeeeefa73d4c6e58ee2934eaf16bc0408df0 (diff) | |
parent | d1acbbce7f123c2b5fccdefc6417787dc91b6ced (diff) |
Merge pull request #37340 from reduz/rename-3d-nodes
Make 2D and 3D node names more explicit
Diffstat (limited to 'modules/gridmap')
-rw-r--r-- | modules/gridmap/grid_map.cpp | 8 | ||||
-rw-r--r-- | modules/gridmap/grid_map.h | 10 | ||||
-rw-r--r-- | modules/gridmap/grid_map_editor_plugin.cpp | 24 | ||||
-rw-r--r-- | modules/gridmap/grid_map_editor_plugin.h | 10 |
4 files changed, 26 insertions, 26 deletions
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 7273a014f0..61f18fbfee 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -32,7 +32,7 @@ #include "core/io/marshalls.h" #include "core/message_queue.h" -#include "scene/3d/light.h" +#include "scene/3d/light_3d.h" #include "scene/resources/mesh_library.h" #include "scene/resources/surface_tool.h" #include "scene/scene_string_names.h" @@ -667,14 +667,14 @@ void GridMap::_notification(int p_what) { case NOTIFICATION_ENTER_WORLD: { - Spatial *c = this; + Node3D *c = this; while (c) { - navigation = Object::cast_to<Navigation>(c); + navigation = Object::cast_to<Navigation3D>(c); if (navigation) { break; } - c = Object::cast_to<Spatial>(c->get_parent()); + c = Object::cast_to<Node3D>(c->get_parent()); } last_transform = get_global_transform(); diff --git a/modules/gridmap/grid_map.h b/modules/gridmap/grid_map.h index cc1c8c2923..43f4c09715 100644 --- a/modules/gridmap/grid_map.h +++ b/modules/gridmap/grid_map.h @@ -31,17 +31,17 @@ #ifndef GRID_MAP_H #define GRID_MAP_H -#include "scene/3d/navigation.h" -#include "scene/3d/spatial.h" +#include "scene/3d/navigation_3d.h" +#include "scene/3d/node_3d.h" #include "scene/resources/mesh_library.h" #include "scene/resources/multimesh.h" //heh heh, godotsphir!! this shares no code and the design is completely different with previous projects i've done.. //should scale better with hardware that supports instancing -class GridMap : public Spatial { +class GridMap : public Node3D { - GDCLASS(GridMap, Spatial); + GDCLASS(GridMap, Node3D); enum { MAP_DIRTY_TRANSFORMS = 1, @@ -147,7 +147,7 @@ class GridMap : public Spatial { int octant_size; bool center_x, center_y, center_z; float cell_scale; - Navigation *navigation; + Navigation3D *navigation; bool clip; bool clip_above; diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 1917a69388..a2479e764f 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -32,8 +32,8 @@ #include "core/input/input_filter.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" -#include "editor/plugins/spatial_editor_plugin.h" -#include "scene/3d/camera.h" +#include "editor/plugins/node_3d_editor_plugin.h" +#include "scene/3d/camera_3d.h" #include "core/math/geometry.h" #include "core/os/keyboard.h" @@ -362,7 +362,7 @@ void GridMapEditor::_set_selection(bool p_active, const Vector3 &p_begin, const options->get_popup()->set_item_disabled(options->get_popup()->get_item_index(MENU_OPTION_SELECTION_FILL), !selection.active); } -bool GridMapEditor::do_input_action(Camera *p_camera, const Point2 &p_point, bool p_click) { +bool GridMapEditor::do_input_action(Camera3D *p_camera, const Point2 &p_point, bool p_click) { if (!spatial_editor) return false; @@ -375,7 +375,7 @@ bool GridMapEditor::do_input_action(Camera *p_camera, const Point2 &p_point, boo if (input_action != INPUT_PICK && input_action != INPUT_SELECT && input_action != INPUT_PASTE && !mesh_library->has_item(selected_palette)) return false; - Camera *camera = p_camera; + Camera3D *camera = p_camera; Vector3 from = camera->project_ray_origin(p_point); Vector3 normal = camera->project_ray_normal(p_point); Transform local_xform = node->get_global_transform().affine_inverse(); @@ -639,7 +639,7 @@ void GridMapEditor::_do_paste() { _clear_clipboard_data(); } -bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<InputEvent> &p_event) { +bool GridMapEditor::forward_spatial_input_event(Camera3D *p_camera, const Ref<InputEvent> &p_event) { if (!node) { return false; } @@ -660,8 +660,8 @@ bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<Inpu } if (mb->is_pressed()) { - SpatialEditorViewport::NavigationScheme nav_scheme = (SpatialEditorViewport::NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation/navigation_scheme").operator int(); - if ((nav_scheme == SpatialEditorViewport::NAVIGATION_MAYA || nav_scheme == SpatialEditorViewport::NAVIGATION_MODO) && mb->get_alt()) { + Node3DEditorViewport::NavigationScheme nav_scheme = (Node3DEditorViewport::NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation/navigation_scheme").operator int(); + if ((nav_scheme == Node3DEditorViewport::NAVIGATION_MAYA || nav_scheme == Node3DEditorViewport::NAVIGATION_MODO) && mb->get_alt()) { input_action = INPUT_NONE; } else if (mb->get_button_index() == BUTTON_LEFT) { @@ -964,7 +964,7 @@ void GridMapEditor::edit(GridMap *p_gridmap) { _update_selection_transform(); _update_paste_indicator(); - spatial_editor = Object::cast_to<SpatialEditorPlugin>(editor->get_editor_plugin_screen()); + spatial_editor = Object::cast_to<Node3DEditorPlugin>(editor->get_editor_plugin_screen()); if (!node) { set_process(false); @@ -1140,7 +1140,7 @@ void GridMapEditor::_notification(int p_what) { p.d = edit_floor[edit_axis] * node->get_cell_size()[edit_axis]; p = node->get_transform().xform(p); // plane to snap - SpatialEditorPlugin *sep = Object::cast_to<SpatialEditorPlugin>(editor->get_editor_plugin_screen()); + Node3DEditorPlugin *sep = Object::cast_to<Node3DEditorPlugin>(editor->get_editor_plugin_screen()); if (sep) sep->snap_cursor_to_plane(p); } @@ -1217,7 +1217,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { spatial_editor_hb = memnew(HBoxContainer); spatial_editor_hb->set_h_size_flags(SIZE_EXPAND_FILL); spatial_editor_hb->set_alignment(BoxContainer::ALIGN_END); - SpatialEditor::get_singleton()->add_control_to_menu_panel(spatial_editor_hb); + Node3DEditor::get_singleton()->add_control_to_menu_panel(spatial_editor_hb); spin_box_label = memnew(Label); spin_box_label->set_text(TTR("Floor:")); @@ -1519,10 +1519,10 @@ void GridMapEditorPlugin::_notification(int p_what) { switch ((int)EditorSettings::get_singleton()->get("editors/grid_map/editor_side")) { case 0: { // Left. - SpatialEditor::get_singleton()->get_palette_split()->move_child(grid_map_editor, 0); + Node3DEditor::get_singleton()->get_palette_split()->move_child(grid_map_editor, 0); } break; case 1: { // Right. - SpatialEditor::get_singleton()->get_palette_split()->move_child(grid_map_editor, 1); + Node3DEditor::get_singleton()->get_palette_split()->move_child(grid_map_editor, 1); } break; } } diff --git a/modules/gridmap/grid_map_editor_plugin.h b/modules/gridmap/grid_map_editor_plugin.h index d6459cee0a..fd880e8b7b 100644 --- a/modules/gridmap/grid_map_editor_plugin.h +++ b/modules/gridmap/grid_map_editor_plugin.h @@ -36,7 +36,7 @@ #include "editor/pane_drag.h" #include "grid_map.h" -class SpatialEditorPlugin; +class Node3DEditorPlugin; class GridMapEditor : public VBoxContainer { GDCLASS(GridMapEditor, VBoxContainer); @@ -188,7 +188,7 @@ class GridMapEditor : public VBoxContainer { }; - SpatialEditorPlugin *spatial_editor; + Node3DEditorPlugin *spatial_editor; struct AreaDisplay { @@ -232,7 +232,7 @@ class GridMapEditor : public VBoxContainer { void _delete_selection(); void _fill_selection(); - bool do_input_action(Camera *p_camera, const Point2 &p_point, bool p_click); + bool do_input_action(Camera3D *p_camera, const Point2 &p_point, bool p_click); friend class GridMapEditorPlugin; @@ -242,7 +242,7 @@ protected: static void _bind_methods(); public: - bool forward_spatial_input_event(Camera *p_camera, const Ref<InputEvent> &p_event); + bool forward_spatial_input_event(Camera3D *p_camera, const Ref<InputEvent> &p_event); void edit(GridMap *p_gridmap); GridMapEditor() {} @@ -261,7 +261,7 @@ protected: void _notification(int p_what); public: - virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) { return grid_map_editor->forward_spatial_input_event(p_camera, p_event); } + virtual bool forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) { return grid_map_editor->forward_spatial_input_event(p_camera, p_event); } virtual String get_name() const { return "GridMap"; } bool has_main_screen() const { return false; } virtual void edit(Object *p_object); |