summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/animation_track_editor.cpp10
-rw-r--r--editor/animation_track_editor.h2
-rw-r--r--editor/animation_track_editor_plugins.cpp16
-rw-r--r--editor/debugger/script_editor_debugger.cpp8
-rw-r--r--editor/editor_inspector.cpp2
-rw-r--r--editor/editor_node.cpp12
-rw-r--r--editor/editor_node.h2
-rw-r--r--editor/editor_plugin.cpp38
-rw-r--r--editor/editor_plugin.h12
-rw-r--r--editor/icons/AnimatedSprite2D.svg (renamed from editor/icons/AnimatedSprite.svg)0
-rw-r--r--editor/icons/Area3D.svg (renamed from editor/icons/Area.svg)0
-rw-r--r--editor/icons/BoneAttachment3D.svg (renamed from editor/icons/BoneAttachment.svg)0
-rw-r--r--editor/icons/CPUParticles3D.svg (renamed from editor/icons/CPUParticles.svg)0
-rw-r--r--editor/icons/Camera3D.svg (renamed from editor/icons/Camera.svg)0
-rw-r--r--editor/icons/CapsuleShape3D.svg (renamed from editor/icons/CapsuleShape.svg)0
-rw-r--r--editor/icons/CollisionPolygon3D.svg (renamed from editor/icons/CollisionPolygon.svg)0
-rw-r--r--editor/icons/CollisionShape3D.svg (renamed from editor/icons/CollisionShape.svg)0
-rw-r--r--editor/icons/ConcavePolygonShape3D.svg (renamed from editor/icons/ConcavePolygonShape.svg)0
-rw-r--r--editor/icons/ConeTwistJoint3D.svg (renamed from editor/icons/ConeTwistJoint.svg)0
-rw-r--r--editor/icons/ConvexPolygonShape3D.svg (renamed from editor/icons/ConvexPolygonShape.svg)0
-rw-r--r--editor/icons/CylinderShape3D.svg (renamed from editor/icons/CylinderShape.svg)0
-rw-r--r--editor/icons/DirectionalLight3D.svg (renamed from editor/icons/DirectionalLight.svg)0
-rw-r--r--editor/icons/GPUParticles2D.svg (renamed from editor/icons/Particles2D.svg)0
-rw-r--r--editor/icons/GPUParticles3D.svg (renamed from editor/icons/Particles.svg)0
-rw-r--r--editor/icons/Generic6DOFJoint3D.svg (renamed from editor/icons/Generic6DOFJoint.svg)0
-rw-r--r--editor/icons/Gizmo3DSamplePlayer.svg (renamed from editor/icons/GizmoSpatialSamplePlayer.svg)0
-rw-r--r--editor/icons/HingeJoint3D.svg (renamed from editor/icons/HingeJoint.svg)0
-rw-r--r--editor/icons/ImmediateGeometry3D.svg (renamed from editor/icons/ImmediateGeometry.svg)0
-rw-r--r--editor/icons/KinematicBody3D.svg (renamed from editor/icons/KinematicBody.svg)0
-rw-r--r--editor/icons/Listener3D.svg (renamed from editor/icons/Listener.svg)0
-rw-r--r--editor/icons/MeshInstance3D.svg (renamed from editor/icons/MeshInstance.svg)0
-rw-r--r--editor/icons/MultiMeshInstance3D.svg (renamed from editor/icons/MultiMeshInstance.svg)0
-rw-r--r--editor/icons/Navigation3D.svg (renamed from editor/icons/Navigation.svg)0
-rw-r--r--editor/icons/NavigationAgent3D.svg (renamed from editor/icons/NavigationAgent.svg)0
-rw-r--r--editor/icons/NavigationObstacle3D.svg (renamed from editor/icons/NavigationObstacle.svg)0
-rw-r--r--editor/icons/NavigationRegion3D.svg (renamed from editor/icons/NavigationRegion.svg)0
-rw-r--r--editor/icons/Node3D.svg (renamed from editor/icons/Spatial.svg)0
-rw-r--r--editor/icons/OmniLight3D.svg (renamed from editor/icons/OmniLight.svg)0
-rw-r--r--editor/icons/Path3D.svg (renamed from editor/icons/Path.svg)0
-rw-r--r--editor/icons/PathFollow3D.svg (renamed from editor/icons/PathFollow.svg)0
-rw-r--r--editor/icons/PhysicalBone3D.svg (renamed from editor/icons/PhysicalBone.svg)0
-rw-r--r--editor/icons/PinJoint3D.svg (renamed from editor/icons/PinJoint.svg)0
-rw-r--r--editor/icons/ProximityGroup3D.svg (renamed from editor/icons/ProximityGroup.svg)0
-rw-r--r--editor/icons/RayCast3D.svg (renamed from editor/icons/RayCast.svg)0
-rw-r--r--editor/icons/RayShape3D.svg (renamed from editor/icons/RayShape.svg)0
-rw-r--r--editor/icons/RemoteTransform3D.svg (renamed from editor/icons/RemoteTransform.svg)0
-rw-r--r--editor/icons/RigidBody3D.svg (renamed from editor/icons/RigidBody.svg)0
-rw-r--r--editor/icons/Skeleton3D.svg (renamed from editor/icons/Skeleton.svg)0
-rw-r--r--editor/icons/SkeletonIK3D.svg (renamed from editor/icons/SkeletonIK.svg)0
-rw-r--r--editor/icons/SliderJoint3D.svg (renamed from editor/icons/SliderJoint.svg)0
-rw-r--r--editor/icons/SoftBody3D.svg (renamed from editor/icons/SoftBody.svg)0
-rw-r--r--editor/icons/SphereShape3D.svg (renamed from editor/icons/SphereShape.svg)0
-rw-r--r--editor/icons/SpotLight3D.svg (renamed from editor/icons/SpotLight.svg)0
-rw-r--r--editor/icons/SpringArm3D.svg (renamed from editor/icons/SpringArm.svg)0
-rw-r--r--editor/icons/Sprite2D.svg (renamed from editor/icons/Sprite.svg)0
-rw-r--r--editor/icons/StaticBody3D.svg (renamed from editor/icons/StaticBody.svg)0
-rw-r--r--editor/icons/VisibilityEnabler3D.svg (renamed from editor/icons/VisibilityEnabler.svg)0
-rw-r--r--editor/icons/VisibilityNotifier3D.svg (renamed from editor/icons/VisibilityNotifier.svg)0
-rw-r--r--editor/import/editor_import_collada.cpp78
-rw-r--r--editor/import/editor_scene_importer_gltf.cpp50
-rw-r--r--editor/import/editor_scene_importer_gltf.h24
-rw-r--r--editor/import/resource_importer_obj.cpp8
-rw-r--r--editor/import/resource_importer_scene.cpp122
-rw-r--r--editor/import/resource_importer_scene.h4
-rw-r--r--editor/inspector_dock.cpp2
-rw-r--r--editor/plugins/animation_blend_tree_editor_plugin.cpp6
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp12
-rw-r--r--editor/plugins/camera_editor_plugin.cpp18
-rw-r--r--editor/plugins/camera_editor_plugin.h4
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp6
-rw-r--r--editor/plugins/collision_polygon_editor_plugin.cpp20
-rw-r--r--editor/plugins/collision_polygon_editor_plugin.h16
-rw-r--r--editor/plugins/cpu_particles_editor_plugin.cpp12
-rw-r--r--editor/plugins/cpu_particles_editor_plugin.h6
-rw-r--r--editor/plugins/material_editor_plugin.cpp10
-rw-r--r--editor/plugins/material_editor_plugin.h16
-rw-r--r--editor/plugins/mesh_editor_plugin.cpp10
-rw-r--r--editor/plugins/mesh_editor_plugin.h16
-rw-r--r--editor/plugins/mesh_instance_editor_plugin.cpp48
-rw-r--r--editor/plugins/mesh_instance_editor_plugin.h8
-rw-r--r--editor/plugins/mesh_library_editor_plugin.cpp26
-rw-r--r--editor/plugins/multimesh_editor_plugin.cpp16
-rw-r--r--editor/plugins/multimesh_editor_plugin.h8
-rw-r--r--editor/plugins/particles_2d_editor_plugin.cpp2
-rw-r--r--editor/plugins/particles_editor_plugin.cpp20
-rw-r--r--editor/plugins/particles_editor_plugin.h8
-rw-r--r--editor/plugins/path_editor_plugin.cpp62
-rw-r--r--editor/plugins/path_editor_plugin.h28
-rw-r--r--editor/plugins/physical_bone_plugin.cpp10
-rw-r--r--editor/plugins/physical_bone_plugin.h10
-rw-r--r--editor/plugins/root_motion_editor_plugin.cpp6
-rw-r--r--editor/plugins/skeleton_editor_plugin.cpp30
-rw-r--r--editor/plugins/skeleton_editor_plugin.h14
-rw-r--r--editor/plugins/skeleton_ik_editor_plugin.cpp4
-rw-r--r--editor/plugins/skeleton_ik_editor_plugin.h4
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp850
-rw-r--r--editor/plugins/spatial_editor_plugin.h180
-rw-r--r--editor/plugins/sprite_editor_plugin.cpp6
-rw-r--r--editor/plugins/sprite_editor_plugin.h6
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp17
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.h2
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp6
-rw-r--r--editor/plugins/texture_region_editor_plugin.h6
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp8
-rw-r--r--editor/plugins/tile_set_editor_plugin.h4
-rw-r--r--editor/scene_tree_dock.cpp22
-rw-r--r--editor/scene_tree_editor.cpp12
-rw-r--r--editor/spatial_editor_gizmos.cpp908
-rw-r--r--editor/spatial_editor_gizmos.h290
109 files changed, 1586 insertions, 1577 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 182b406705..4f06a753a7 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -3554,7 +3554,7 @@ void AnimationTrackEditor::_insert_delay() {
insert_queue = false;
}
-void AnimationTrackEditor::insert_transform_key(Spatial *p_node, const String &p_sub, const Transform &p_xform) {
+void AnimationTrackEditor::insert_transform_key(Node3D *p_node, const String &p_sub, const Transform &p_xform) {
if (!keying)
return;
@@ -4446,8 +4446,8 @@ void AnimationTrackEditor::_new_track_node_selected(NodePath p_path) {
ERR_FAIL_COND(!node);
NodePath path_to = root->get_path_to(node);
- if (adding_track_type == Animation::TYPE_TRANSFORM && !node->is_class("Spatial")) {
- EditorNode::get_singleton()->show_warning(TTR("Transform tracks only apply to Spatial-based nodes."));
+ if (adding_track_type == Animation::TYPE_TRANSFORM && !node->is_class("Node3D")) {
+ EditorNode::get_singleton()->show_warning(TTR("Transform tracks only apply to 3D-based nodes."));
return;
}
@@ -4638,10 +4638,10 @@ void AnimationTrackEditor::_insert_key_from_track(float p_ofs, int p_track) {
EditorNode::get_singleton()->show_warning(TTR("Track path is invalid, so can't add a key."));
return;
}
- Spatial *base = Object::cast_to<Spatial>(root->get_node(animation->track_get_path(p_track)));
+ Node3D *base = Object::cast_to<Node3D>(root->get_node(animation->track_get_path(p_track)));
if (!base) {
- EditorNode::get_singleton()->show_warning(TTR("Track is not of type Spatial, can't insert key"));
+ EditorNode::get_singleton()->show_warning(TTR("Track is not of type Node3D, can't insert key"));
return;
}
diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h
index 7f13716b67..7c4cc6db53 100644
--- a/editor/animation_track_editor.h
+++ b/editor/animation_track_editor.h
@@ -513,7 +513,7 @@ public:
void set_anim_pos(float p_pos);
void insert_node_value_key(Node *p_node, const String &p_property, const Variant &p_value, bool p_only_if_exists = false);
void insert_value_key(const String &p_property, const Variant &p_value, bool p_advance);
- void insert_transform_key(Spatial *p_node, const String &p_sub, const Transform &p_xform);
+ void insert_transform_key(Node3D *p_node, const String &p_sub, const Transform &p_xform);
void show_select_node_warning(bool p_show);
diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp
index 7effe114ca..ea0d7511fe 100644
--- a/editor/animation_track_editor_plugins.cpp
+++ b/editor/animation_track_editor_plugins.cpp
@@ -33,8 +33,8 @@
#include "editor/audio_stream_preview.h"
#include "editor_resource_preview.h"
#include "editor_scale.h"
-#include "scene/2d/animated_sprite.h"
-#include "scene/2d/sprite.h"
+#include "scene/2d/animated_sprite_2d.h"
+#include "scene/2d/sprite_2d.h"
#include "scene/3d/sprite_3d.h"
#include "scene/animation/animation_player.h"
#include "servers/audio/audio_stream.h"
@@ -357,7 +357,7 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se
Size2 size;
- if (Object::cast_to<Sprite>(object) || Object::cast_to<Sprite3D>(object)) {
+ if (Object::cast_to<Sprite2D>(object) || Object::cast_to<Sprite3D>(object)) {
Ref<Texture2D> texture = object->call("get_texture");
if (!texture.is_valid()) {
@@ -379,7 +379,7 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se
if (vframes > 1) {
size.y /= vframes;
}
- } else if (Object::cast_to<AnimatedSprite>(object) || Object::cast_to<AnimatedSprite3D>(object)) {
+ } else if (Object::cast_to<AnimatedSprite2D>(object) || Object::cast_to<AnimatedSprite3D>(object)) {
Ref<SpriteFrames> sf = object->call("get_sprite_frames");
if (sf.is_null()) {
@@ -436,7 +436,7 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in
Ref<Texture2D> texture;
Rect2 region;
- if (Object::cast_to<Sprite>(object) || Object::cast_to<Sprite3D>(object)) {
+ if (Object::cast_to<Sprite2D>(object) || Object::cast_to<Sprite3D>(object)) {
texture = object->call("get_texture");
if (!texture.is_valid()) {
@@ -473,7 +473,7 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in
region.position.x += region.size.x * coords.x;
region.position.y += region.size.y * coords.y;
- } else if (Object::cast_to<AnimatedSprite>(object) || Object::cast_to<AnimatedSprite3D>(object)) {
+ } else if (Object::cast_to<AnimatedSprite2D>(object) || Object::cast_to<AnimatedSprite3D>(object)) {
Ref<SpriteFrames> sf = object->call("get_sprite_frames");
if (sf.is_null()) {
@@ -1300,14 +1300,14 @@ AnimationTrackEdit *AnimationTrackEditDefaultPlugin::create_value_track_edit(Obj
return audio;
}
- if (p_property == "frame" && (p_object->is_class("Sprite") || p_object->is_class("Sprite3D") || p_object->is_class("AnimatedSprite") || p_object->is_class("AnimatedSprite3D"))) {
+ if (p_property == "frame" && (p_object->is_class("Sprite2D") || p_object->is_class("Sprite3D") || p_object->is_class("AnimatedSprite2D") || p_object->is_class("AnimatedSprite3D"))) {
AnimationTrackEditSpriteFrame *sprite = memnew(AnimationTrackEditSpriteFrame);
sprite->set_node(p_object);
return sprite;
}
- if (p_property == "frame_coords" && (p_object->is_class("Sprite") || p_object->is_class("Sprite3D"))) {
+ if (p_property == "frame_coords" && (p_object->is_class("Sprite2D") || p_object->is_class("Sprite3D"))) {
AnimationTrackEditSpriteFrame *sprite = memnew(AnimationTrackEditSpriteFrame);
sprite->set_as_coords();
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp
index 7526111eef..41ba7343d2 100644
--- a/editor/debugger/script_editor_debugger.cpp
+++ b/editor/debugger/script_editor_debugger.cpp
@@ -45,7 +45,7 @@
#include "editor/plugins/spatial_editor_plugin.h"
#include "editor/property_editor.h"
#include "main/performance.h"
-#include "scene/3d/camera.h"
+#include "scene/3d/camera_3d.h"
#include "scene/debugger/scene_debugger.h"
#include "scene/gui/dialogs.h"
#include "scene/gui/label.h"
@@ -791,12 +791,12 @@ void ScriptEditorDebugger::_notification(int p_what) {
} else if (camera_override >= CameraOverride::OVERRIDE_3D_1) {
int viewport_idx = camera_override - CameraOverride::OVERRIDE_3D_1;
- SpatialEditorViewport *viewport = SpatialEditor::get_singleton()->get_editor_viewport(viewport_idx);
- Camera *const cam = viewport->get_camera();
+ Node3DEditorViewport *viewport = Node3DEditor::get_singleton()->get_editor_viewport(viewport_idx);
+ Camera3D *const cam = viewport->get_camera();
Array msg;
msg.push_back(cam->get_camera_transform());
- if (cam->get_projection() == Camera::PROJECTION_ORTHOGONAL) {
+ if (cam->get_projection() == Camera3D::PROJECTION_ORTHOGONAL) {
msg.push_back(false);
msg.push_back(cam->get_size());
} else {
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index ba02f8e99f..181811207c 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -646,7 +646,7 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) {
emit_signal("property_keyed", property, use_keying_next());
if (use_keying_next()) {
- if (property == "frame_coords" && (object->is_class("Sprite") || object->is_class("Sprite3D"))) {
+ if (property == "frame_coords" && (object->is_class("Sprite2D") || object->is_class("Sprite3D"))) {
Vector2 new_coords = object->get(property);
new_coords.x++;
if (new_coords.x >= object->get("hframes").operator int64_t()) {
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 86d4b76ee2..70ee45f845 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -1107,7 +1107,7 @@ void EditorNode::_find_node_types(Node *p_node, int &count_2d, int &count_3d) {
if (p_node->is_class("CanvasItem"))
count_2d++;
- else if (p_node->is_class("Spatial"))
+ else if (p_node->is_class("Node3D"))
count_3d++;
for (int i = 0; i < p_node->get_child_count(); i++)
@@ -1139,7 +1139,7 @@ void EditorNode::_save_scene_with_preview(String p_file, int p_idx) {
if (is2d) {
img = scene_root->get_texture()->get_data();
} else {
- img = SpatialEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_data();
+ img = Node3DEditor::get_singleton()->get_editor_viewport(0)->get_viewport_node()->get_texture()->get_data();
}
if (img.is_valid()) {
@@ -3595,8 +3595,8 @@ void EditorNode::register_editor_types() {
ClassDB::register_class<EditorSelection>();
ClassDB::register_class<EditorFileDialog>();
ClassDB::register_virtual_class<EditorSettings>();
- ClassDB::register_class<EditorSpatialGizmo>();
- ClassDB::register_class<EditorSpatialGizmoPlugin>();
+ ClassDB::register_class<EditorNode3DGizmo>();
+ ClassDB::register_class<EditorNode3DGizmoPlugin>();
ClassDB::register_virtual_class<EditorResourcePreview>();
ClassDB::register_class<EditorResourcePreviewGenerator>();
ClassDB::register_virtual_class<EditorFileSystem>();
@@ -6571,7 +6571,7 @@ EditorNode::EditorNode() {
add_editor_plugin(memnew(DebuggerEditorPlugin(this, debug_menu)));
add_editor_plugin(memnew(AnimationPlayerEditorPlugin(this)));
add_editor_plugin(memnew(CanvasItemEditorPlugin(this)));
- add_editor_plugin(memnew(SpatialEditorPlugin(this)));
+ add_editor_plugin(memnew(Node3DEditorPlugin(this)));
add_editor_plugin(memnew(ScriptEditorPlugin(this)));
EditorAudioBuses *audio_bus_editor = EditorAudioBuses::register_editor();
@@ -6851,7 +6851,7 @@ bool EditorPluginList::forward_gui_input(const Ref<InputEvent> &p_event) {
return discard;
}
-bool EditorPluginList::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event, bool serve_when_force_input_enabled) {
+bool EditorPluginList::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event, bool serve_when_force_input_enabled) {
bool discard = false;
for (int i = 0; i < plugins_list.size(); i++) {
diff --git a/editor/editor_node.h b/editor/editor_node.h
index 21025f2a50..9d251690d2 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -894,7 +894,7 @@ public:
bool forward_gui_input(const Ref<InputEvent> &p_event);
void forward_canvas_draw_over_viewport(Control *p_overlay);
void forward_canvas_force_draw_over_viewport(Control *p_overlay);
- bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event, bool serve_when_force_input_enabled);
+ bool forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event, bool serve_when_force_input_enabled);
void forward_spatial_draw_over_viewport(Control *p_overlay);
void forward_spatial_force_draw_over_viewport(Control *p_overlay);
void add_plugin(EditorPlugin *p_plugin);
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 07a63c39ba..2ddd86f4fb 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -39,7 +39,7 @@
#include "main/main.h"
#include "plugins/canvas_item_editor_plugin.h"
#include "plugins/spatial_editor_plugin.h"
-#include "scene/3d/camera.h"
+#include "scene/3d/camera_3d.h"
#include "scene/gui/popup_menu.h"
#include "servers/visual_server.h"
@@ -371,24 +371,24 @@ void EditorPlugin::add_control_to_container(CustomControlContainer p_location, C
case CONTAINER_SPATIAL_EDITOR_MENU: {
- SpatialEditor::get_singleton()->add_control_to_menu_panel(p_control);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(p_control);
} break;
case CONTAINER_SPATIAL_EDITOR_SIDE_LEFT: {
- SpatialEditor::get_singleton()->get_palette_split()->add_child(p_control);
- SpatialEditor::get_singleton()->get_palette_split()->move_child(p_control, 0);
+ Node3DEditor::get_singleton()->get_palette_split()->add_child(p_control);
+ Node3DEditor::get_singleton()->get_palette_split()->move_child(p_control, 0);
} break;
case CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT: {
- SpatialEditor::get_singleton()->get_palette_split()->add_child(p_control);
- SpatialEditor::get_singleton()->get_palette_split()->move_child(p_control, 1);
+ Node3DEditor::get_singleton()->get_palette_split()->add_child(p_control);
+ Node3DEditor::get_singleton()->get_palette_split()->move_child(p_control, 1);
} break;
case CONTAINER_SPATIAL_EDITOR_BOTTOM: {
- SpatialEditor::get_singleton()->get_shader_split()->add_child(p_control);
+ Node3DEditor::get_singleton()->get_shader_split()->add_child(p_control);
} break;
case CONTAINER_CANVAS_EDITOR_MENU: {
@@ -445,18 +445,18 @@ void EditorPlugin::remove_control_from_container(CustomControlContainer p_locati
case CONTAINER_SPATIAL_EDITOR_MENU: {
- SpatialEditor::get_singleton()->remove_control_from_menu_panel(p_control);
+ Node3DEditor::get_singleton()->remove_control_from_menu_panel(p_control);
} break;
case CONTAINER_SPATIAL_EDITOR_SIDE_LEFT:
case CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT: {
- SpatialEditor::get_singleton()->get_palette_split()->remove_child(p_control);
+ Node3DEditor::get_singleton()->get_palette_split()->remove_child(p_control);
} break;
case CONTAINER_SPATIAL_EDITOR_BOTTOM: {
- SpatialEditor::get_singleton()->get_shader_split()->remove_child(p_control);
+ Node3DEditor::get_singleton()->get_shader_split()->remove_child(p_control);
} break;
case CONTAINER_CANVAS_EDITOR_MENU: {
@@ -562,10 +562,10 @@ void EditorPlugin::forward_canvas_force_draw_over_viewport(Control *p_overlay) {
// Updates the overlays of the 2D viewport or, if in 3D mode, of every 3D viewport.
int EditorPlugin::update_overlays() const {
- if (SpatialEditor::get_singleton()->is_visible()) {
+ if (Node3DEditor::get_singleton()->is_visible()) {
int count = 0;
- for (uint32_t i = 0; i < SpatialEditor::VIEWPORTS_COUNT; i++) {
- SpatialEditorViewport *vp = SpatialEditor::get_singleton()->get_editor_viewport(i);
+ for (uint32_t i = 0; i < Node3DEditor::VIEWPORTS_COUNT; i++) {
+ Node3DEditorViewport *vp = Node3DEditor::get_singleton()->get_editor_viewport(i);
if (vp->is_visible()) {
vp->update_surface();
count++;
@@ -579,7 +579,7 @@ int EditorPlugin::update_overlays() const {
}
}
-bool EditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) {
+bool EditorPlugin::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) {
if (get_script_instance() && get_script_instance()->has_method("forward_spatial_gui_input")) {
return get_script_instance()->call("forward_spatial_gui_input", p_camera, p_event);
@@ -724,12 +724,12 @@ void EditorPlugin::remove_export_plugin(const Ref<EditorExportPlugin> &p_exporte
EditorExport::get_singleton()->remove_export_plugin(p_exporter);
}
-void EditorPlugin::add_spatial_gizmo_plugin(const Ref<EditorSpatialGizmoPlugin> &p_gizmo_plugin) {
- SpatialEditor::get_singleton()->add_gizmo_plugin(p_gizmo_plugin);
+void EditorPlugin::add_spatial_gizmo_plugin(const Ref<EditorNode3DGizmoPlugin> &p_gizmo_plugin) {
+ Node3DEditor::get_singleton()->add_gizmo_plugin(p_gizmo_plugin);
}
-void EditorPlugin::remove_spatial_gizmo_plugin(const Ref<EditorSpatialGizmoPlugin> &p_gizmo_plugin) {
- SpatialEditor::get_singleton()->remove_gizmo_plugin(p_gizmo_plugin);
+void EditorPlugin::remove_spatial_gizmo_plugin(const Ref<EditorNode3DGizmoPlugin> &p_gizmo_plugin) {
+ Node3DEditor::get_singleton()->remove_gizmo_plugin(p_gizmo_plugin);
}
void EditorPlugin::add_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin) {
@@ -865,7 +865,7 @@ void EditorPlugin::_bind_methods() {
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_canvas_gui_input", PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_canvas_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control")));
ClassDB::add_virtual_method(get_class_static(), MethodInfo("forward_canvas_force_draw_over_viewport", PropertyInfo(Variant::OBJECT, "overlay", PROPERTY_HINT_RESOURCE_TYPE, "Control")));
- ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_spatial_gui_input", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
+ ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "forward_spatial_gui_input", PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"), PropertyInfo(Variant::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::STRING, "get_plugin_name"));
ClassDB::add_virtual_method(get_class_static(), MethodInfo(PropertyInfo(Variant::OBJECT, "icon", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "get_plugin_icon"));
ClassDB::add_virtual_method(get_class_static(), MethodInfo(Variant::BOOL, "has_main_screen"));
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index cd3f4d0638..12b042d0e5 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -42,14 +42,14 @@
#include "scene/resources/texture.h"
class EditorNode;
-class Spatial;
-class Camera;
+class Node3D;
+class Camera3D;
class EditorSelection;
class EditorExport;
class EditorSettings;
class EditorImportPlugin;
class EditorExportPlugin;
-class EditorSpatialGizmoPlugin;
+class EditorNode3DGizmoPlugin;
class EditorResourcePreview;
class EditorFileSystem;
class EditorToolAddons;
@@ -185,7 +185,7 @@ public:
virtual void forward_canvas_draw_over_viewport(Control *p_overlay);
virtual void forward_canvas_force_draw_over_viewport(Control *p_overlay);
- virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event);
+ virtual bool forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event);
virtual void forward_spatial_draw_over_viewport(Control *p_overlay);
virtual void forward_spatial_force_draw_over_viewport(Control *p_overlay);
@@ -227,8 +227,8 @@ public:
void add_export_plugin(const Ref<EditorExportPlugin> &p_exporter);
void remove_export_plugin(const Ref<EditorExportPlugin> &p_exporter);
- void add_spatial_gizmo_plugin(const Ref<EditorSpatialGizmoPlugin> &p_gizmo_plugin);
- void remove_spatial_gizmo_plugin(const Ref<EditorSpatialGizmoPlugin> &p_gizmo_plugin);
+ void add_spatial_gizmo_plugin(const Ref<EditorNode3DGizmoPlugin> &p_gizmo_plugin);
+ void remove_spatial_gizmo_plugin(const Ref<EditorNode3DGizmoPlugin> &p_gizmo_plugin);
void add_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin);
void remove_inspector_plugin(const Ref<EditorInspectorPlugin> &p_plugin);
diff --git a/editor/icons/AnimatedSprite.svg b/editor/icons/AnimatedSprite2D.svg
index 411ddda015..411ddda015 100644
--- a/editor/icons/AnimatedSprite.svg
+++ b/editor/icons/AnimatedSprite2D.svg
diff --git a/editor/icons/Area.svg b/editor/icons/Area3D.svg
index 21ebe3c251..21ebe3c251 100644
--- a/editor/icons/Area.svg
+++ b/editor/icons/Area3D.svg
diff --git a/editor/icons/BoneAttachment.svg b/editor/icons/BoneAttachment3D.svg
index 0b7dede0b6..0b7dede0b6 100644
--- a/editor/icons/BoneAttachment.svg
+++ b/editor/icons/BoneAttachment3D.svg
diff --git a/editor/icons/CPUParticles.svg b/editor/icons/CPUParticles3D.svg
index af4115c93f..af4115c93f 100644
--- a/editor/icons/CPUParticles.svg
+++ b/editor/icons/CPUParticles3D.svg
diff --git a/editor/icons/Camera.svg b/editor/icons/Camera3D.svg
index af1cb8a2e9..af1cb8a2e9 100644
--- a/editor/icons/Camera.svg
+++ b/editor/icons/Camera3D.svg
diff --git a/editor/icons/CapsuleShape.svg b/editor/icons/CapsuleShape3D.svg
index ba035ca196..ba035ca196 100644
--- a/editor/icons/CapsuleShape.svg
+++ b/editor/icons/CapsuleShape3D.svg
diff --git a/editor/icons/CollisionPolygon.svg b/editor/icons/CollisionPolygon3D.svg
index 5e849ae4e3..5e849ae4e3 100644
--- a/editor/icons/CollisionPolygon.svg
+++ b/editor/icons/CollisionPolygon3D.svg
diff --git a/editor/icons/CollisionShape.svg b/editor/icons/CollisionShape3D.svg
index 8f14996a97..8f14996a97 100644
--- a/editor/icons/CollisionShape.svg
+++ b/editor/icons/CollisionShape3D.svg
diff --git a/editor/icons/ConcavePolygonShape.svg b/editor/icons/ConcavePolygonShape3D.svg
index 001ab82826..001ab82826 100644
--- a/editor/icons/ConcavePolygonShape.svg
+++ b/editor/icons/ConcavePolygonShape3D.svg
diff --git a/editor/icons/ConeTwistJoint.svg b/editor/icons/ConeTwistJoint3D.svg
index 0e5e98a17b..0e5e98a17b 100644
--- a/editor/icons/ConeTwistJoint.svg
+++ b/editor/icons/ConeTwistJoint3D.svg
diff --git a/editor/icons/ConvexPolygonShape.svg b/editor/icons/ConvexPolygonShape3D.svg
index bfb9230586..bfb9230586 100644
--- a/editor/icons/ConvexPolygonShape.svg
+++ b/editor/icons/ConvexPolygonShape3D.svg
diff --git a/editor/icons/CylinderShape.svg b/editor/icons/CylinderShape3D.svg
index f0aa5833d2..f0aa5833d2 100644
--- a/editor/icons/CylinderShape.svg
+++ b/editor/icons/CylinderShape3D.svg
diff --git a/editor/icons/DirectionalLight.svg b/editor/icons/DirectionalLight3D.svg
index faac2be134..faac2be134 100644
--- a/editor/icons/DirectionalLight.svg
+++ b/editor/icons/DirectionalLight3D.svg
diff --git a/editor/icons/Particles2D.svg b/editor/icons/GPUParticles2D.svg
index 7151194e36..7151194e36 100644
--- a/editor/icons/Particles2D.svg
+++ b/editor/icons/GPUParticles2D.svg
diff --git a/editor/icons/Particles.svg b/editor/icons/GPUParticles3D.svg
index f1378e3f8c..f1378e3f8c 100644
--- a/editor/icons/Particles.svg
+++ b/editor/icons/GPUParticles3D.svg
diff --git a/editor/icons/Generic6DOFJoint.svg b/editor/icons/Generic6DOFJoint3D.svg
index 30d892e7a1..30d892e7a1 100644
--- a/editor/icons/Generic6DOFJoint.svg
+++ b/editor/icons/Generic6DOFJoint3D.svg
diff --git a/editor/icons/GizmoSpatialSamplePlayer.svg b/editor/icons/Gizmo3DSamplePlayer.svg
index ee471124dc..ee471124dc 100644
--- a/editor/icons/GizmoSpatialSamplePlayer.svg
+++ b/editor/icons/Gizmo3DSamplePlayer.svg
diff --git a/editor/icons/HingeJoint.svg b/editor/icons/HingeJoint3D.svg
index 21b3e29cb5..21b3e29cb5 100644
--- a/editor/icons/HingeJoint.svg
+++ b/editor/icons/HingeJoint3D.svg
diff --git a/editor/icons/ImmediateGeometry.svg b/editor/icons/ImmediateGeometry3D.svg
index 5679d5906f..5679d5906f 100644
--- a/editor/icons/ImmediateGeometry.svg
+++ b/editor/icons/ImmediateGeometry3D.svg
diff --git a/editor/icons/KinematicBody.svg b/editor/icons/KinematicBody3D.svg
index 16078fbdec..16078fbdec 100644
--- a/editor/icons/KinematicBody.svg
+++ b/editor/icons/KinematicBody3D.svg
diff --git a/editor/icons/Listener.svg b/editor/icons/Listener3D.svg
index 96eaeaffa9..96eaeaffa9 100644
--- a/editor/icons/Listener.svg
+++ b/editor/icons/Listener3D.svg
diff --git a/editor/icons/MeshInstance.svg b/editor/icons/MeshInstance3D.svg
index 68344b7dbd..68344b7dbd 100644
--- a/editor/icons/MeshInstance.svg
+++ b/editor/icons/MeshInstance3D.svg
diff --git a/editor/icons/MultiMeshInstance.svg b/editor/icons/MultiMeshInstance3D.svg
index c114a725db..c114a725db 100644
--- a/editor/icons/MultiMeshInstance.svg
+++ b/editor/icons/MultiMeshInstance3D.svg
diff --git a/editor/icons/Navigation.svg b/editor/icons/Navigation3D.svg
index d5a8f8618b..d5a8f8618b 100644
--- a/editor/icons/Navigation.svg
+++ b/editor/icons/Navigation3D.svg
diff --git a/editor/icons/NavigationAgent.svg b/editor/icons/NavigationAgent3D.svg
index 44c991d44c..44c991d44c 100644
--- a/editor/icons/NavigationAgent.svg
+++ b/editor/icons/NavigationAgent3D.svg
diff --git a/editor/icons/NavigationObstacle.svg b/editor/icons/NavigationObstacle3D.svg
index 42481a6067..42481a6067 100644
--- a/editor/icons/NavigationObstacle.svg
+++ b/editor/icons/NavigationObstacle3D.svg
diff --git a/editor/icons/NavigationRegion.svg b/editor/icons/NavigationRegion3D.svg
index 61f43497b4..61f43497b4 100644
--- a/editor/icons/NavigationRegion.svg
+++ b/editor/icons/NavigationRegion3D.svg
diff --git a/editor/icons/Spatial.svg b/editor/icons/Node3D.svg
index 6a469dde13..6a469dde13 100644
--- a/editor/icons/Spatial.svg
+++ b/editor/icons/Node3D.svg
diff --git a/editor/icons/OmniLight.svg b/editor/icons/OmniLight3D.svg
index 6fa0454e8c..6fa0454e8c 100644
--- a/editor/icons/OmniLight.svg
+++ b/editor/icons/OmniLight3D.svg
diff --git a/editor/icons/Path.svg b/editor/icons/Path3D.svg
index cde9a06903..cde9a06903 100644
--- a/editor/icons/Path.svg
+++ b/editor/icons/Path3D.svg
diff --git a/editor/icons/PathFollow.svg b/editor/icons/PathFollow3D.svg
index 8e904ab5a5..8e904ab5a5 100644
--- a/editor/icons/PathFollow.svg
+++ b/editor/icons/PathFollow3D.svg
diff --git a/editor/icons/PhysicalBone.svg b/editor/icons/PhysicalBone3D.svg
index 0a34eb6e48..0a34eb6e48 100644
--- a/editor/icons/PhysicalBone.svg
+++ b/editor/icons/PhysicalBone3D.svg
diff --git a/editor/icons/PinJoint.svg b/editor/icons/PinJoint3D.svg
index 147553d316..147553d316 100644
--- a/editor/icons/PinJoint.svg
+++ b/editor/icons/PinJoint3D.svg
diff --git a/editor/icons/ProximityGroup.svg b/editor/icons/ProximityGroup3D.svg
index 7df1cc9093..7df1cc9093 100644
--- a/editor/icons/ProximityGroup.svg
+++ b/editor/icons/ProximityGroup3D.svg
diff --git a/editor/icons/RayCast.svg b/editor/icons/RayCast3D.svg
index e782b27e9f..e782b27e9f 100644
--- a/editor/icons/RayCast.svg
+++ b/editor/icons/RayCast3D.svg
diff --git a/editor/icons/RayShape.svg b/editor/icons/RayShape3D.svg
index 37c2206740..37c2206740 100644
--- a/editor/icons/RayShape.svg
+++ b/editor/icons/RayShape3D.svg
diff --git a/editor/icons/RemoteTransform.svg b/editor/icons/RemoteTransform3D.svg
index 2bdf8cd858..2bdf8cd858 100644
--- a/editor/icons/RemoteTransform.svg
+++ b/editor/icons/RemoteTransform3D.svg
diff --git a/editor/icons/RigidBody.svg b/editor/icons/RigidBody3D.svg
index 5d766f7c3d..5d766f7c3d 100644
--- a/editor/icons/RigidBody.svg
+++ b/editor/icons/RigidBody3D.svg
diff --git a/editor/icons/Skeleton.svg b/editor/icons/Skeleton3D.svg
index 015c842125..015c842125 100644
--- a/editor/icons/Skeleton.svg
+++ b/editor/icons/Skeleton3D.svg
diff --git a/editor/icons/SkeletonIK.svg b/editor/icons/SkeletonIK3D.svg
index e69f6e8bf3..e69f6e8bf3 100644
--- a/editor/icons/SkeletonIK.svg
+++ b/editor/icons/SkeletonIK3D.svg
diff --git a/editor/icons/SliderJoint.svg b/editor/icons/SliderJoint3D.svg
index fdd7487bbf..fdd7487bbf 100644
--- a/editor/icons/SliderJoint.svg
+++ b/editor/icons/SliderJoint3D.svg
diff --git a/editor/icons/SoftBody.svg b/editor/icons/SoftBody3D.svg
index 2c907df847..2c907df847 100644
--- a/editor/icons/SoftBody.svg
+++ b/editor/icons/SoftBody3D.svg
diff --git a/editor/icons/SphereShape.svg b/editor/icons/SphereShape3D.svg
index 4da18a1a38..4da18a1a38 100644
--- a/editor/icons/SphereShape.svg
+++ b/editor/icons/SphereShape3D.svg
diff --git a/editor/icons/SpotLight.svg b/editor/icons/SpotLight3D.svg
index 6a35ee3890..6a35ee3890 100644
--- a/editor/icons/SpotLight.svg
+++ b/editor/icons/SpotLight3D.svg
diff --git a/editor/icons/SpringArm.svg b/editor/icons/SpringArm3D.svg
index eb0c1ebd7d..eb0c1ebd7d 100644
--- a/editor/icons/SpringArm.svg
+++ b/editor/icons/SpringArm3D.svg
diff --git a/editor/icons/Sprite.svg b/editor/icons/Sprite2D.svg
index 26a10625fc..26a10625fc 100644
--- a/editor/icons/Sprite.svg
+++ b/editor/icons/Sprite2D.svg
diff --git a/editor/icons/StaticBody.svg b/editor/icons/StaticBody3D.svg
index de819bd76b..de819bd76b 100644
--- a/editor/icons/StaticBody.svg
+++ b/editor/icons/StaticBody3D.svg
diff --git a/editor/icons/VisibilityEnabler.svg b/editor/icons/VisibilityEnabler3D.svg
index 70e4f081c2..70e4f081c2 100644
--- a/editor/icons/VisibilityEnabler.svg
+++ b/editor/icons/VisibilityEnabler3D.svg
diff --git a/editor/icons/VisibilityNotifier.svg b/editor/icons/VisibilityNotifier3D.svg
index c908d5c99d..c908d5c99d 100644
--- a/editor/icons/VisibilityNotifier.svg
+++ b/editor/icons/VisibilityNotifier3D.svg
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index f7da8c27f9..e67dd37b88 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -33,12 +33,12 @@
#include "core/os/os.h"
#include "editor/editor_node.h"
#include "editor/import/collada.h"
-#include "scene/3d/camera.h"
-#include "scene/3d/light.h"
-#include "scene/3d/mesh_instance.h"
-#include "scene/3d/path.h"
-#include "scene/3d/skeleton.h"
-#include "scene/3d/spatial.h"
+#include "scene/3d/camera_3d.h"
+#include "scene/3d/light_3d.h"
+#include "scene/3d/mesh_instance_3d.h"
+#include "scene/3d/node_3d.h"
+#include "scene/3d/path_3d.h"
+#include "scene/3d/skeleton_3d.h"
#include "scene/animation/animation_player.h"
#include "scene/resources/animation.h"
#include "scene/resources/packed_scene.h"
@@ -47,13 +47,13 @@
struct ColladaImport {
Collada collada;
- Spatial *scene;
+ Node3D *scene;
Vector<Ref<Animation>> animations;
struct NodeMap {
//String path;
- Spatial *node;
+ Node3D *node;
int bone;
List<int> anim_tracks;
@@ -76,17 +76,17 @@ struct ColladaImport {
Map<String, Ref<ArrayMesh>> mesh_cache;
Map<String, Ref<Curve3D>> curve_cache;
Map<String, Ref<Material>> material_cache;
- Map<Collada::Node *, Skeleton *> skeleton_map;
+ Map<Collada::Node *, Skeleton3D *> skeleton_map;
- Map<Skeleton *, Map<String, int>> skeleton_bone_map;
+ Map<Skeleton3D *, Map<String, int>> skeleton_bone_map;
Set<String> valid_animated_nodes;
Vector<int> valid_animated_properties;
Map<String, bool> bones_with_animation;
- Error _populate_skeleton(Skeleton *p_skeleton, Collada::Node *p_node, int &r_bone, int p_parent);
+ Error _populate_skeleton(Skeleton3D *p_skeleton, Collada::Node *p_node, int &r_bone, int p_parent);
Error _create_scene_skeletons(Collada::Node *p_node);
- Error _create_scene(Collada::Node *p_node, Spatial *p_parent);
+ Error _create_scene(Collada::Node *p_node, Node3D *p_parent);
Error _create_resources(Collada::Node *p_node, bool p_use_compression);
Error _create_material(const String &p_target);
Error _create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_mesh, const Map<String, Collada::NodeGeometry::Material> &p_material_map, const Collada::MeshData &meshdata, const Transform &p_local_xform, const Vector<int> &bone_remap, const Collada::SkinControllerData *p_skin_controller, const Collada::MorphControllerData *p_morph_data, Vector<Ref<ArrayMesh>> p_morph_meshes = Vector<Ref<ArrayMesh>>(), bool p_use_compression = false, bool p_use_mesh_material = false);
@@ -110,7 +110,7 @@ struct ColladaImport {
}
};
-Error ColladaImport::_populate_skeleton(Skeleton *p_skeleton, Collada::Node *p_node, int &r_bone, int p_parent) {
+Error ColladaImport::_populate_skeleton(Skeleton3D *p_skeleton, Collada::Node *p_node, int &r_bone, int p_parent) {
if (p_node->type != Collada::Node::TYPE_JOINT)
return OK;
@@ -174,7 +174,7 @@ Error ColladaImport::_create_scene_skeletons(Collada::Node *p_node) {
if (p_node->type == Collada::Node::TYPE_SKELETON) {
- Skeleton *sk = memnew(Skeleton);
+ Skeleton3D *sk = memnew(Skeleton3D);
int bone = 0;
for (int i = 0; i < p_node->children.size(); i++) {
@@ -193,15 +193,15 @@ Error ColladaImport::_create_scene_skeletons(Collada::Node *p_node) {
return OK;
}
-Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) {
+Error ColladaImport::_create_scene(Collada::Node *p_node, Node3D *p_parent) {
- Spatial *node = NULL;
+ Node3D *node = NULL;
switch (p_node->type) {
case Collada::Node::TYPE_NODE: {
- node = memnew(Spatial);
+ node = memnew(Node3D);
} break;
case Collada::Node::TYPE_JOINT: {
@@ -223,7 +223,7 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) {
if (!bool(GLOBAL_DEF("collada/use_ambient", false)))
return OK;
//well, it's an ambient light..
- Light *l = memnew(DirectionalLight);
+ Light3D *l = memnew(DirectionalLight3D);
//l->set_color(Light::COLOR_AMBIENT,ld.color);
//l->set_color(Light::COLOR_DIFFUSE,Color(0,0,0));
//l->set_color(Light::COLOR_SPECULAR,Color(0,0,0));
@@ -232,7 +232,7 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) {
} else if (ld.mode == Collada::LightData::MODE_DIRECTIONAL) {
//well, it's an ambient light..
- Light *l = memnew(DirectionalLight);
+ Light3D *l = memnew(DirectionalLight3D);
/*
if (found_ambient) //use it here
l->set_color(Light::COLOR_AMBIENT,ambient);
@@ -243,12 +243,12 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) {
node = l;
} else {
- Light *l;
+ Light3D *l;
if (ld.mode == Collada::LightData::MODE_OMNI)
- l = memnew(OmniLight);
+ l = memnew(OmniLight3D);
else {
- l = memnew(SpotLight);
+ l = memnew(SpotLight3D);
//l->set_parameter(Light::PARAM_SPOT_ANGLE,ld.spot_angle);
//l->set_parameter(Light::PARAM_SPOT_ATTENUATION,ld.spot_exp);
}
@@ -262,13 +262,13 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) {
} else {
- node = memnew(Spatial);
+ node = memnew(Node3D);
}
} break;
case Collada::Node::TYPE_CAMERA: {
Collada::NodeCamera *cam = static_cast<Collada::NodeCamera *>(p_node);
- Camera *camera = memnew(Camera);
+ Camera3D *camera = memnew(Camera3D);
if (collada.state.camera_data_map.has(cam->camera)) {
@@ -280,12 +280,12 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) {
if (cd.orthogonal.y_mag) {
- camera->set_keep_aspect_mode(Camera::KEEP_HEIGHT);
+ camera->set_keep_aspect_mode(Camera3D::KEEP_HEIGHT);
camera->set_orthogonal(cd.orthogonal.y_mag * 2.0, cd.z_near, cd.z_far);
} else if (!cd.orthogonal.y_mag && cd.orthogonal.x_mag) {
- camera->set_keep_aspect_mode(Camera::KEEP_WIDTH);
+ camera->set_keep_aspect_mode(Camera3D::KEEP_WIDTH);
camera->set_orthogonal(cd.orthogonal.x_mag * 2.0, cd.z_near, cd.z_far);
}
@@ -314,17 +314,17 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) {
if (collada.state.curve_data_map.has(ng->source)) {
- node = memnew(Path);
+ node = memnew(Path3D);
} else {
//mesh since nothing else
- node = memnew(MeshInstance);
+ node = memnew(MeshInstance3D);
//Object::cast_to<MeshInstance>(node)->set_flag(GeometryInstance::FLAG_USE_BAKED_LIGHT, true);
}
} break;
case Collada::Node::TYPE_SKELETON: {
ERR_FAIL_COND_V(!skeleton_map.has(p_node), ERR_CANT_CREATE);
- Skeleton *sk = skeleton_map[p_node];
+ Skeleton3D *sk = skeleton_map[p_node];
node = sk;
} break;
}
@@ -1010,12 +1010,12 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres
if (p_node->type == Collada::Node::TYPE_GEOMETRY && node_map.has(p_node->id)) {
- Spatial *node = node_map[p_node->id].node;
+ Node3D *node = node_map[p_node->id].node;
Collada::NodeGeometry *ng = static_cast<Collada::NodeGeometry *>(p_node);
- if (Object::cast_to<Path>(node)) {
+ if (Object::cast_to<Path3D>(node)) {
- Path *path = Object::cast_to<Path>(node);
+ Path3D *path = Object::cast_to<Path3D>(node);
if (curve_cache.has(ng->source)) {
@@ -1083,11 +1083,11 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres
}
}
- if (Object::cast_to<MeshInstance>(node)) {
+ if (Object::cast_to<MeshInstance3D>(node)) {
Collada::NodeGeometry *ng2 = static_cast<Collada::NodeGeometry *>(p_node);
- MeshInstance *mi = Object::cast_to<MeshInstance>(node);
+ MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(node);
ERR_FAIL_COND_V(!mi, ERR_BUG);
@@ -1114,7 +1114,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres
String skname = skeletons[0];
ERR_FAIL_COND_V(!node_map.has(skname), ERR_INVALID_DATA);
NodeMap nmsk = node_map[skname];
- Skeleton *sk = Object::cast_to<Skeleton>(nmsk.node);
+ Skeleton3D *sk = Object::cast_to<Skeleton3D>(nmsk.node);
ERR_FAIL_COND_V(!sk, ERR_INVALID_DATA);
ERR_FAIL_COND_V(!skeleton_bone_map.has(sk), ERR_INVALID_DATA);
Map<String, int> &bone_remap_map = skeleton_bone_map[sk];
@@ -1265,7 +1265,7 @@ Error ColladaImport::load(const String &p_path, int p_flags, bool p_force_make_t
ERR_FAIL_COND_V(!collada.state.visual_scene_map.has(collada.state.root_visual_scene), ERR_INVALID_DATA);
Collada::VisualScene &vs = collada.state.visual_scene_map[collada.state.root_visual_scene];
- scene = memnew(Spatial); // root
+ scene = memnew(Node3D); // root
//determine what's going on with the lights
for (int i = 0; i < vs.root_nodes.size(); i++) {
@@ -1530,7 +1530,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
String path = scene->get_path_to(nm.node);
if (nm.bone >= 0) {
- Skeleton *sk = static_cast<Skeleton *>(nm.node);
+ Skeleton3D *sk = static_cast<Skeleton3D *>(nm.node);
String name = sk->get_bone_name(nm.bone);
path = path + ":" + name;
}
@@ -1621,7 +1621,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
if (nm.bone >= 0) {
//make bone transform relative to rest (in case of skeleton)
- Skeleton *sk = Object::cast_to<Skeleton>(nm.node);
+ Skeleton3D *sk = Object::cast_to<Skeleton3D>(nm.node);
if (sk) {
xform = sk->get_bone_rest(nm.bone).affine_inverse() * xform;
@@ -1662,7 +1662,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
NodeMap &nm = node_map[E->key()];
String path = scene->get_path_to(nm.node);
ERR_CONTINUE(nm.bone < 0);
- Skeleton *sk = static_cast<Skeleton *>(nm.node);
+ Skeleton3D *sk = static_cast<Skeleton3D *>(nm.node);
String name = sk->get_bone_name(nm.bone);
path = path + ":" + name;
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp
index 398fc9ff49..208dc8fc26 100644
--- a/editor/import/editor_scene_importer_gltf.cpp
+++ b/editor/import/editor_scene_importer_gltf.cpp
@@ -37,9 +37,9 @@
#include "core/os/file_access.h"
#include "core/os/os.h"
#include "modules/regex/regex.h"
-#include "scene/3d/bone_attachment.h"
-#include "scene/3d/camera.h"
-#include "scene/3d/mesh_instance.h"
+#include "scene/3d/bone_attachment_3d.h"
+#include "scene/3d/camera_3d.h"
+#include "scene/3d/mesh_instance_3d.h"
#include "scene/animation/animation_player.h"
#include "scene/resources/surface_tool.h"
@@ -2108,7 +2108,7 @@ Error EditorSceneImporterGLTF::_create_skeletons(GLTFState &state) {
GLTFSkeleton &gltf_skeleton = state.skeletons.write[skel_i];
- Skeleton *skeleton = memnew(Skeleton);
+ Skeleton3D *skeleton = memnew(Skeleton3D);
gltf_skeleton.godot_skeleton = skeleton;
// Make a unique name, no gltf node represents this skeleton
@@ -2485,12 +2485,12 @@ void EditorSceneImporterGLTF::_assign_scene_names(GLTFState &state) {
}
}
-BoneAttachment *EditorSceneImporterGLTF::_generate_bone_attachment(GLTFState &state, Skeleton *skeleton, const GLTFNodeIndex node_index) {
+BoneAttachment3D *EditorSceneImporterGLTF::_generate_bone_attachment(GLTFState &state, Skeleton3D *skeleton, const GLTFNodeIndex node_index) {
const GLTFNode *gltf_node = state.nodes[node_index];
const GLTFNode *bone_node = state.nodes[gltf_node->parent];
- BoneAttachment *bone_attachment = memnew(BoneAttachment);
+ BoneAttachment3D *bone_attachment = memnew(BoneAttachment3D);
print_verbose("glTF: Creating bone attachment for: " + gltf_node->name);
ERR_FAIL_COND_V(!bone_node->joint, nullptr);
@@ -2500,12 +2500,12 @@ BoneAttachment *EditorSceneImporterGLTF::_generate_bone_attachment(GLTFState &st
return bone_attachment;
}
-MeshInstance *EditorSceneImporterGLTF::_generate_mesh_instance(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index) {
+MeshInstance3D *EditorSceneImporterGLTF::_generate_mesh_instance(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index) {
const GLTFNode *gltf_node = state.nodes[node_index];
ERR_FAIL_INDEX_V(gltf_node->mesh, state.meshes.size(), nullptr);
- MeshInstance *mi = memnew(MeshInstance);
+ MeshInstance3D *mi = memnew(MeshInstance3D);
print_verbose("glTF: Creating mesh for: " + gltf_node->name);
GLTFMesh &mesh = state.meshes.write[gltf_node->mesh];
@@ -2522,12 +2522,12 @@ MeshInstance *EditorSceneImporterGLTF::_generate_mesh_instance(GLTFState &state,
return mi;
}
-Camera *EditorSceneImporterGLTF::_generate_camera(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index) {
+Camera3D *EditorSceneImporterGLTF::_generate_camera(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index) {
const GLTFNode *gltf_node = state.nodes[node_index];
ERR_FAIL_INDEX_V(gltf_node->camera, state.cameras.size(), nullptr);
- Camera *camera = memnew(Camera);
+ Camera3D *camera = memnew(Camera3D);
print_verbose("glTF: Creating camera for: " + gltf_node->name);
const GLTFCamera &c = state.cameras[gltf_node->camera];
@@ -2540,26 +2540,26 @@ Camera *EditorSceneImporterGLTF::_generate_camera(GLTFState &state, Node *scene_
return camera;
}
-Spatial *EditorSceneImporterGLTF::_generate_spatial(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index) {
+Node3D *EditorSceneImporterGLTF::_generate_spatial(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index) {
const GLTFNode *gltf_node = state.nodes[node_index];
- Spatial *spatial = memnew(Spatial);
+ Node3D *spatial = memnew(Node3D);
print_verbose("glTF: Creating spatial for: " + gltf_node->name);
return spatial;
}
-void EditorSceneImporterGLTF::_generate_scene_node(GLTFState &state, Node *scene_parent, Spatial *scene_root, const GLTFNodeIndex node_index) {
+void EditorSceneImporterGLTF::_generate_scene_node(GLTFState &state, Node *scene_parent, Node3D *scene_root, const GLTFNodeIndex node_index) {
const GLTFNode *gltf_node = state.nodes[node_index];
- Spatial *current_node = nullptr;
+ Node3D *current_node = nullptr;
// Is our parent a skeleton
- Skeleton *active_skeleton = Object::cast_to<Skeleton>(scene_parent);
+ Skeleton3D *active_skeleton = Object::cast_to<Skeleton3D>(scene_parent);
if (gltf_node->skeleton >= 0) {
- Skeleton *skeleton = state.skeletons[gltf_node->skeleton].godot_skeleton;
+ Skeleton3D *skeleton = state.skeletons[gltf_node->skeleton].godot_skeleton;
if (active_skeleton != skeleton) {
ERR_FAIL_COND_MSG(active_skeleton != nullptr, "glTF: Generating scene detected direct parented Skeletons");
@@ -2577,7 +2577,7 @@ void EditorSceneImporterGLTF::_generate_scene_node(GLTFState &state, Node *scene
// If we have an active skeleton, and the node is node skinned, we need to create a bone attachment
if (current_node == nullptr && active_skeleton != nullptr && gltf_node->skin < 0) {
- BoneAttachment *bone_attachment = _generate_bone_attachment(state, active_skeleton, node_index);
+ BoneAttachment3D *bone_attachment = _generate_bone_attachment(state, active_skeleton, node_index);
scene_parent->add_child(bone_attachment);
bone_attachment->set_owner(scene_root);
@@ -2776,7 +2776,7 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye
const GLTFNode *node = state.nodes[E->key()];
if (node->skeleton >= 0) {
- const Skeleton *sk = Object::cast_to<Skeleton>(state.scene_nodes.find(node_index)->get());
+ const Skeleton3D *sk = Object::cast_to<Skeleton3D>(state.scene_nodes.find(node_index)->get());
ERR_FAIL_COND(sk == nullptr);
const String path = ap->get_parent()->get_path_to(sk);
@@ -2853,7 +2853,7 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye
xform.basis.set_quat_scale(rot, scale);
xform.origin = pos;
- const Skeleton *skeleton = state.skeletons[node->skeleton].godot_skeleton;
+ const Skeleton3D *skeleton = state.skeletons[node->skeleton].godot_skeleton;
const int bone_idx = skeleton->find_bone(node->name);
xform = skeleton->get_bone_rest(bone_idx).affine_inverse() * xform;
@@ -2922,7 +2922,7 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye
ap->add_animation(name, animation);
}
-void EditorSceneImporterGLTF::_process_mesh_instances(GLTFState &state, Spatial *scene_root) {
+void EditorSceneImporterGLTF::_process_mesh_instances(GLTFState &state, Node3D *scene_root) {
for (GLTFNodeIndex node_i = 0; node_i < state.nodes.size(); ++node_i) {
const GLTFNode *node = state.nodes[node_i];
@@ -2930,12 +2930,12 @@ void EditorSceneImporterGLTF::_process_mesh_instances(GLTFState &state, Spatial
const GLTFSkinIndex skin_i = node->skin;
Map<GLTFNodeIndex, Node *>::Element *mi_element = state.scene_nodes.find(node_i);
- MeshInstance *mi = Object::cast_to<MeshInstance>(mi_element->get());
+ MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(mi_element->get());
ERR_FAIL_COND(mi == nullptr);
const GLTFSkeletonIndex skel_i = state.skins[node->skin].skeleton;
const GLTFSkeleton &gltf_skeleton = state.skeletons[skel_i];
- Skeleton *skeleton = gltf_skeleton.godot_skeleton;
+ Skeleton3D *skeleton = gltf_skeleton.godot_skeleton;
ERR_FAIL_COND(skeleton == nullptr);
mi->get_parent()->remove_child(mi);
@@ -2949,9 +2949,9 @@ void EditorSceneImporterGLTF::_process_mesh_instances(GLTFState &state, Spatial
}
}
-Spatial *EditorSceneImporterGLTF::_generate_scene(GLTFState &state, const int p_bake_fps) {
+Node3D *EditorSceneImporterGLTF::_generate_scene(GLTFState &state, const int p_bake_fps) {
- Spatial *root = memnew(Spatial);
+ Node3D *root = memnew(Node3D);
// scene_name is already unique
root->set_name(state.scene_name);
@@ -3084,7 +3084,7 @@ Node *EditorSceneImporterGLTF::import_scene(const String &p_path, uint32_t p_fla
_assign_scene_names(state);
/* STEP 17 MAKE SCENE! */
- Spatial *scene = _generate_scene(state, p_bake_fps);
+ Node3D *scene = _generate_scene(state, p_bake_fps);
return scene;
}
diff --git a/editor/import/editor_scene_importer_gltf.h b/editor/import/editor_scene_importer_gltf.h
index 9f354fde2d..79395cca93 100644
--- a/editor/import/editor_scene_importer_gltf.h
+++ b/editor/import/editor_scene_importer_gltf.h
@@ -32,12 +32,12 @@
#define EDITOR_SCENE_IMPORTER_GLTF_H
#include "editor/import/resource_importer_scene.h"
-#include "scene/3d/skeleton.h"
-#include "scene/3d/spatial.h"
+#include "scene/3d/node_3d.h"
+#include "scene/3d/skeleton_3d.h"
class AnimationPlayer;
-class BoneAttachment;
-class MeshInstance;
+class BoneAttachment3D;
+class MeshInstance3D;
class EditorSceneImporterGLTF : public EditorSceneImporter {
@@ -192,7 +192,7 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
Vector<GLTFNodeIndex> roots;
// The created Skeleton for the scene
- Skeleton *godot_skeleton;
+ Skeleton3D *godot_skeleton;
// Set of unique bone names for the skeleton
Set<String> unique_names;
@@ -395,15 +395,15 @@ class EditorSceneImporterGLTF : public EditorSceneImporter {
Error _parse_animations(GLTFState &state);
- BoneAttachment *_generate_bone_attachment(GLTFState &state, Skeleton *skeleton, const GLTFNodeIndex node_index);
- MeshInstance *_generate_mesh_instance(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index);
- Camera *_generate_camera(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index);
- Spatial *_generate_spatial(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index);
+ BoneAttachment3D *_generate_bone_attachment(GLTFState &state, Skeleton3D *skeleton, const GLTFNodeIndex node_index);
+ MeshInstance3D *_generate_mesh_instance(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index);
+ Camera3D *_generate_camera(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index);
+ Node3D *_generate_spatial(GLTFState &state, Node *scene_parent, const GLTFNodeIndex node_index);
- void _generate_scene_node(GLTFState &state, Node *scene_parent, Spatial *scene_root, const GLTFNodeIndex node_index);
- Spatial *_generate_scene(GLTFState &state, const int p_bake_fps);
+ void _generate_scene_node(GLTFState &state, Node *scene_parent, Node3D *scene_root, const GLTFNodeIndex node_index);
+ Node3D *_generate_scene(GLTFState &state, const int p_bake_fps);
- void _process_mesh_instances(GLTFState &state, Spatial *scene_root);
+ void _process_mesh_instances(GLTFState &state, Node3D *scene_root);
void _assign_scene_names(GLTFState &state);
diff --git a/editor/import/resource_importer_obj.cpp b/editor/import/resource_importer_obj.cpp
index fb1782cb65..4be6f2ed80 100644
--- a/editor/import/resource_importer_obj.cpp
+++ b/editor/import/resource_importer_obj.cpp
@@ -32,8 +32,8 @@
#include "core/io/resource_saver.h"
#include "core/os/file_access.h"
-#include "scene/3d/mesh_instance.h"
-#include "scene/3d/spatial.h"
+#include "scene/3d/mesh_instance_3d.h"
+#include "scene/3d/node_3d.h"
#include "scene/resources/mesh.h"
#include "scene/resources/surface_tool.h"
@@ -431,11 +431,11 @@ Node *EditorOBJImporter::import_scene(const String &p_path, uint32_t p_flags, in
return NULL;
}
- Spatial *scene = memnew(Spatial);
+ Node3D *scene = memnew(Node3D);
for (List<Ref<Mesh>>::Element *E = meshes.front(); E; E = E->next()) {
- MeshInstance *mi = memnew(MeshInstance);
+ MeshInstance3D *mi = memnew(MeshInstance3D);
mi->set_mesh(E->get());
mi->set_name(E->get()->get_name());
scene->add_child(mi);
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index 94a6fee6b7..16b5c00969 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -32,19 +32,19 @@
#include "core/io/resource_saver.h"
#include "editor/editor_node.h"
-#include "scene/3d/collision_shape.h"
-#include "scene/3d/mesh_instance.h"
-#include "scene/3d/navigation.h"
-#include "scene/3d/physics_body.h"
+#include "scene/3d/collision_shape_3d.h"
+#include "scene/3d/mesh_instance_3d.h"
+#include "scene/3d/navigation_3d.h"
+#include "scene/3d/physics_body_3d.h"
#include "scene/3d/vehicle_body.h"
#include "scene/animation/animation_player.h"
#include "scene/resources/animation.h"
-#include "scene/resources/box_shape.h"
+#include "scene/resources/box_shape_3d.h"
#include "scene/resources/packed_scene.h"
#include "scene/resources/ray_shape.h"
#include "scene/resources/resource_format_text.h"
-#include "scene/resources/sphere_shape.h"
-#include "scene/resources/world_margin_shape.h"
+#include "scene/resources/sphere_shape_3d.h"
+#include "scene/resources/world_margin_shape_3d.h"
uint32_t EditorSceneImporter::get_import_flags() const {
@@ -276,15 +276,15 @@ static String _fixstr(const String &p_what, const String &p_str) {
return what;
}
-static void _gen_shape_list(const Ref<Mesh> &mesh, List<Ref<Shape>> &r_shape_list, bool p_convex) {
+static void _gen_shape_list(const Ref<Mesh> &mesh, List<Ref<Shape3D>> &r_shape_list, bool p_convex) {
if (!p_convex) {
- Ref<Shape> shape = mesh->create_trimesh_shape();
+ Ref<Shape3D> shape = mesh->create_trimesh_shape();
r_shape_list.push_back(shape);
} else {
- Vector<Ref<Shape>> cd = mesh->convex_decompose();
+ Vector<Ref<Shape3D>> cd = mesh->convex_decompose();
if (cd.size()) {
for (int i = 0; i < cd.size(); i++) {
r_shape_list.push_back(cd[i]);
@@ -293,7 +293,7 @@ static void _gen_shape_list(const Ref<Mesh> &mesh, List<Ref<Shape>> &r_shape_lis
}
}
-Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>, List<Ref<Shape>>> &collision_map, LightBakeMode p_light_bake_mode) {
+Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>, List<Ref<Shape3D>>> &collision_map, LightBakeMode p_light_bake_mode) {
// children first
for (int i = 0; i < p_node->get_child_count(); i++) {
@@ -314,9 +314,9 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
return NULL;
}
- if (Object::cast_to<MeshInstance>(p_node)) {
+ if (Object::cast_to<MeshInstance3D>(p_node)) {
- MeshInstance *mi = Object::cast_to<MeshInstance>(p_node);
+ MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(p_node);
Ref<ArrayMesh> m = mi->get_mesh();
@@ -344,7 +344,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
if (p_light_bake_mode != LIGHT_BAKE_DISABLED) {
- mi->set_flag(GeometryInstance::FLAG_USE_BAKED_LIGHT, true);
+ mi->set_flag(GeometryInstance3D::FLAG_USE_BAKED_LIGHT, true);
}
}
@@ -377,12 +377,12 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
if (isroot)
return p_node;
- MeshInstance *mi = Object::cast_to<MeshInstance>(p_node);
+ MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(p_node);
if (mi) {
Ref<Mesh> mesh = mi->get_mesh();
if (mesh.is_valid()) {
- List<Ref<Shape>> shapes;
+ List<Ref<Shape3D>> shapes;
String fixed_name;
if (collision_map.has(mesh)) {
shapes = collision_map[mesh];
@@ -404,7 +404,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
if (shapes.size()) {
- StaticBody *col = memnew(StaticBody);
+ StaticBody3D *col = memnew(StaticBody3D);
col->set_transform(mi->get_transform());
col->set_name(fixed_name);
p_node->replace_by(col);
@@ -412,9 +412,9 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
p_node = col;
int idx = 0;
- for (List<Ref<Shape>>::Element *E = shapes.front(); E; E = E->next()) {
+ for (List<Ref<Shape3D>>::Element *E = shapes.front(); E; E = E->next()) {
- CollisionShape *cshape = memnew(CollisionShape);
+ CollisionShape3D *cshape = memnew(CollisionShape3D);
cshape->set_shape(E->get());
col->add_child(cshape);
@@ -427,55 +427,55 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
} else if (p_node->has_meta("empty_draw_type")) {
String empty_draw_type = String(p_node->get_meta("empty_draw_type"));
- StaticBody *sb = memnew(StaticBody);
+ StaticBody3D *sb = memnew(StaticBody3D);
sb->set_name(_fixstr(name, "colonly"));
- Object::cast_to<Spatial>(sb)->set_transform(Object::cast_to<Spatial>(p_node)->get_transform());
+ Object::cast_to<Node3D>(sb)->set_transform(Object::cast_to<Node3D>(p_node)->get_transform());
p_node->replace_by(sb);
memdelete(p_node);
p_node = NULL;
- CollisionShape *colshape = memnew(CollisionShape);
+ CollisionShape3D *colshape = memnew(CollisionShape3D);
if (empty_draw_type == "CUBE") {
- BoxShape *boxShape = memnew(BoxShape);
+ BoxShape3D *boxShape = memnew(BoxShape3D);
boxShape->set_extents(Vector3(1, 1, 1));
colshape->set_shape(boxShape);
- colshape->set_name("BoxShape");
+ colshape->set_name("BoxShape3D");
} else if (empty_draw_type == "SINGLE_ARROW") {
- RayShape *rayShape = memnew(RayShape);
+ RayShape3D *rayShape = memnew(RayShape3D);
rayShape->set_length(1);
colshape->set_shape(rayShape);
- colshape->set_name("RayShape");
- Object::cast_to<Spatial>(sb)->rotate_x(Math_PI / 2);
+ colshape->set_name("RayShape3D");
+ Object::cast_to<Node3D>(sb)->rotate_x(Math_PI / 2);
} else if (empty_draw_type == "IMAGE") {
- WorldMarginShape *world_margin_shape = memnew(WorldMarginShape);
+ WorldMarginShape3D *world_margin_shape = memnew(WorldMarginShape3D);
colshape->set_shape(world_margin_shape);
colshape->set_name("WorldMarginShape");
} else {
- SphereShape *sphereShape = memnew(SphereShape);
+ SphereShape3D *sphereShape = memnew(SphereShape3D);
sphereShape->set_radius(1);
colshape->set_shape(sphereShape);
- colshape->set_name("SphereShape");
+ colshape->set_name("SphereShape3D");
}
sb->add_child(colshape);
colshape->set_owner(sb->get_owner());
}
- } else if (_teststr(name, "rigid") && Object::cast_to<MeshInstance>(p_node)) {
+ } else if (_teststr(name, "rigid") && Object::cast_to<MeshInstance3D>(p_node)) {
if (isroot)
return p_node;
- MeshInstance *mi = Object::cast_to<MeshInstance>(p_node);
+ MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(p_node);
Ref<Mesh> mesh = mi->get_mesh();
if (mesh.is_valid()) {
- List<Ref<Shape>> shapes;
+ List<Ref<Shape3D>> shapes;
if (collision_map.has(mesh)) {
shapes = collision_map[mesh];
} else {
_gen_shape_list(mesh, shapes, true);
}
- RigidBody *rigid_body = memnew(RigidBody);
+ RigidBody3D *rigid_body = memnew(RigidBody3D);
rigid_body->set_name(_fixstr(name, "rigid"));
p_node->replace_by(rigid_body);
rigid_body->set_transform(mi->get_transform());
@@ -486,9 +486,9 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
mi->set_owner(rigid_body->get_owner());
int idx = 0;
- for (List<Ref<Shape>>::Element *E = shapes.front(); E; E = E->next()) {
+ for (List<Ref<Shape3D>>::Element *E = shapes.front(); E; E = E->next()) {
- CollisionShape *cshape = memnew(CollisionShape);
+ CollisionShape3D *cshape = memnew(CollisionShape3D);
cshape->set_shape(E->get());
rigid_body->add_child(cshape);
@@ -498,14 +498,14 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
}
}
- } else if ((_teststr(name, "col") || (_teststr(name, "convcol"))) && Object::cast_to<MeshInstance>(p_node)) {
+ } else if ((_teststr(name, "col") || (_teststr(name, "convcol"))) && Object::cast_to<MeshInstance3D>(p_node)) {
- MeshInstance *mi = Object::cast_to<MeshInstance>(p_node);
+ MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(p_node);
Ref<Mesh> mesh = mi->get_mesh();
if (mesh.is_valid()) {
- List<Ref<Shape>> shapes;
+ List<Ref<Shape3D>> shapes;
String fixed_name;
if (collision_map.has(mesh)) {
shapes = collision_map[mesh];
@@ -530,15 +530,15 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
}
if (shapes.size()) {
- StaticBody *col = memnew(StaticBody);
+ StaticBody3D *col = memnew(StaticBody3D);
col->set_name("static_collision");
mi->add_child(col);
col->set_owner(mi->get_owner());
int idx = 0;
- for (List<Ref<Shape>>::Element *E = shapes.front(); E; E = E->next()) {
+ for (List<Ref<Shape3D>>::Element *E = shapes.front(); E; E = E->next()) {
- CollisionShape *cshape = memnew(CollisionShape);
+ CollisionShape3D *cshape = memnew(CollisionShape3D);
cshape->set_shape(E->get());
col->add_child(cshape);
@@ -550,22 +550,22 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
}
}
- } else if (_teststr(name, "navmesh") && Object::cast_to<MeshInstance>(p_node)) {
+ } else if (_teststr(name, "navmesh") && Object::cast_to<MeshInstance3D>(p_node)) {
if (isroot)
return p_node;
- MeshInstance *mi = Object::cast_to<MeshInstance>(p_node);
+ MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(p_node);
Ref<ArrayMesh> mesh = mi->get_mesh();
ERR_FAIL_COND_V(mesh.is_null(), NULL);
- NavigationRegion *nmi = memnew(NavigationRegion);
+ NavigationRegion3D *nmi = memnew(NavigationRegion3D);
nmi->set_name(_fixstr(name, "navmesh"));
Ref<NavigationMesh> nmesh = memnew(NavigationMesh);
nmesh->create_from_mesh(mesh);
nmi->set_navigation_mesh(nmesh);
- Object::cast_to<Spatial>(nmi)->set_transform(mi->get_transform());
+ Object::cast_to<Node3D>(nmi)->set_transform(mi->get_transform());
p_node->replace_by(nmi);
memdelete(p_node);
p_node = nmi;
@@ -575,7 +575,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
return p_node;
Node *owner = p_node->get_owner();
- Spatial *s = Object::cast_to<Spatial>(p_node);
+ Node3D *s = Object::cast_to<Node3D>(p_node);
VehicleBody *bv = memnew(VehicleBody);
String n = _fixstr(p_node->get_name(), "vehicle");
bv->set_name(n);
@@ -595,7 +595,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
return p_node;
Node *owner = p_node->get_owner();
- Spatial *s = Object::cast_to<Spatial>(p_node);
+ Node3D *s = Object::cast_to<Node3D>(p_node);
VehicleWheel *bv = memnew(VehicleWheel);
String n = _fixstr(p_node->get_name(), "wheel");
bv->set_name(n);
@@ -609,16 +609,16 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
p_node = bv;
- } else if (Object::cast_to<MeshInstance>(p_node)) {
+ } else if (Object::cast_to<MeshInstance3D>(p_node)) {
//last attempt, maybe collision inside the mesh data
- MeshInstance *mi = Object::cast_to<MeshInstance>(p_node);
+ MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(p_node);
Ref<ArrayMesh> mesh = mi->get_mesh();
if (!mesh.is_null()) {
- List<Ref<Shape>> shapes;
+ List<Ref<Shape3D>> shapes;
if (collision_map.has(mesh)) {
shapes = collision_map[mesh];
} else if (_teststr(mesh->get_name(), "col")) {
@@ -632,15 +632,15 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
}
if (shapes.size()) {
- StaticBody *col = memnew(StaticBody);
+ StaticBody3D *col = memnew(StaticBody3D);
col->set_name("static_collision");
p_node->add_child(col);
col->set_owner(p_node->get_owner());
int idx = 0;
- for (List<Ref<Shape>>::Element *E = shapes.front(); E; E = E->next()) {
+ for (List<Ref<Shape3D>>::Element *E = shapes.front(); E; E = E->next()) {
- CollisionShape *cshape = memnew(CollisionShape);
+ CollisionShape3D *cshape = memnew(CollisionShape3D);
cshape->set_shape(E->get());
col->add_child(cshape);
@@ -934,14 +934,14 @@ void ResourceImporterScene::_find_meshes(Node *p_node, Map<Ref<ArrayMesh>, Trans
List<PropertyInfo> pi;
p_node->get_property_list(&pi);
- MeshInstance *mi = Object::cast_to<MeshInstance>(p_node);
+ MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(p_node);
if (mi) {
Ref<ArrayMesh> mesh = mi->get_mesh();
if (mesh.is_valid() && !meshes.has(mesh)) {
- Spatial *s = mi;
+ Node3D *s = mi;
Transform transform;
while (s) {
transform = transform * s->get_transform();
@@ -1141,7 +1141,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String
void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, int p_preset) const {
- r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "nodes/root_type", PROPERTY_HINT_TYPE_STRING, "Node"), "Spatial"));
+ r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "nodes/root_type", PROPERTY_HINT_TYPE_STRING, "Node"), "Node3D"));
r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "nodes/root_name"), "Scene Root"));
List<String> script_extentions;
@@ -1333,7 +1333,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
root_type = ScriptServer::get_global_class_base(root_type);
}
- if (root_type != "Spatial") {
+ if (root_type != "Node3D") {
Node *base_node = Object::cast_to<Node>(ClassDB::instance(root_type));
if (base_node) {
@@ -1348,9 +1348,9 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
scene->set_script(Variant(root_script));
}
- if (Object::cast_to<Spatial>(scene)) {
+ if (Object::cast_to<Node3D>(scene)) {
float root_scale = p_options["nodes/root_scale"];
- Object::cast_to<Spatial>(scene)->scale(Vector3(root_scale, root_scale, root_scale));
+ Object::cast_to<Node3D>(scene)->scale(Vector3(root_scale, root_scale, root_scale));
}
if (p_options["nodes/root_name"] != "Scene Root")
@@ -1368,7 +1368,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
float anim_optimizer_maxang = p_options["animation/optimizer/max_angle"];
int light_bake_mode = p_options["meshes/light_baking"];
- Map<Ref<Mesh>, List<Ref<Shape>>> collision_map;
+ Map<Ref<Mesh>, List<Ref<Shape3D>>> collision_map;
scene = _fix_node(scene, scene, collision_map, LightBakeMode(light_bake_mode));
diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h
index 6d1043eb28..bb01725854 100644
--- a/editor/import/resource_importer_scene.h
+++ b/editor/import/resource_importer_scene.h
@@ -34,7 +34,7 @@
#include "core/io/resource_importer.h"
#include "scene/resources/animation.h"
#include "scene/resources/mesh.h"
-#include "scene/resources/shape.h"
+#include "scene/resources/shape_3d.h"
class Material;
@@ -147,7 +147,7 @@ public:
void _make_external_resources(Node *p_node, const String &p_base_path, bool p_make_animations, bool p_animations_as_text, bool p_keep_animations, bool p_make_materials, bool p_materials_as_text, bool p_keep_materials, bool p_make_meshes, bool p_meshes_as_text, Map<Ref<Animation>, Ref<Animation>> &p_animations, Map<Ref<Material>, Ref<Material>> &p_materials, Map<Ref<ArrayMesh>, Ref<ArrayMesh>> &p_meshes);
- Node *_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>, List<Ref<Shape>>> &collision_map, LightBakeMode p_light_bake_mode);
+ Node *_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>, List<Ref<Shape3D>>> &collision_map, LightBakeMode p_light_bake_mode);
void _create_clips(Node *scene, const Array &p_clips, bool p_bake_all);
void _filter_anim_tracks(Ref<Animation> anim, Set<String> &keep);
diff --git a/editor/inspector_dock.cpp b/editor/inspector_dock.cpp
index 916ebd27ab..223e7a841f 100644
--- a/editor/inspector_dock.cpp
+++ b/editor/inspector_dock.cpp
@@ -310,7 +310,7 @@ void InspectorDock::_property_keyed(const String &p_keyed, const Variant &p_valu
}
void InspectorDock::_transform_keyed(Object *sp, const String &p_sub, const Transform &p_key) {
- Spatial *s = Object::cast_to<Spatial>(sp);
+ Node3D *s = Object::cast_to<Node3D>(sp);
if (!s)
return;
AnimationPlayerEditor::singleton->get_track_editor()->insert_transform_key(s, p_sub, p_key);
diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp
index 03b48f1c15..4491c002e3 100644
--- a/editor/plugins/animation_blend_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp
@@ -619,7 +619,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano
String concat = path.get_concatenated_subnames();
- Skeleton *skeleton = Object::cast_to<Skeleton>(node);
+ Skeleton3D *skeleton = Object::cast_to<Skeleton3D>(node);
if (skeleton && skeleton->find_bone(concat) != -1) {
//path in skeleton
const String &bone = concat;
@@ -643,7 +643,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano
ti->set_text(0, F->get());
ti->set_selectable(0, false);
ti->set_editable(0, false);
- ti->set_icon(0, get_theme_icon("BoneAttachment", "EditorIcons"));
+ ti->set_icon(0, get_theme_icon("BoneAttachment3D", "EditorIcons"));
} else {
ti = parenthood[accum];
}
@@ -654,7 +654,7 @@ bool AnimationNodeBlendTreeEditor::_update_filters(const Ref<AnimationNode> &ano
ti->set_cell_mode(0, TreeItem::CELL_MODE_CHECK);
ti->set_text(0, concat);
ti->set_checked(0, anode->is_path_filtered(path));
- ti->set_icon(0, get_theme_icon("BoneAttachment", "EditorIcons"));
+ ti->set_icon(0, get_theme_icon("BoneAttachment3D", "EditorIcons"));
ti->set_metadata(0, path);
} else {
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 4b75f09cf5..b75c56dd47 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -1385,9 +1385,9 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
// Hide superfluous elements that would make the overlay unnecessary cluttered.
Dictionary canvas_edit_state;
Dictionary spatial_edit_state;
- if (SpatialEditor::get_singleton()->is_visible()) {
+ if (Node3DEditor::get_singleton()->is_visible()) {
// 3D
- spatial_edit_state = SpatialEditor::get_singleton()->get_state();
+ spatial_edit_state = Node3DEditor::get_singleton()->get_state();
Dictionary new_state = spatial_edit_state.duplicate();
new_state["show_grid"] = false;
new_state["show_origin"] = false;
@@ -1404,7 +1404,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
}
new_state["viewports"] = vp;
// TODO: Save/restore only affected entries.
- SpatialEditor::get_singleton()->set_state(new_state);
+ Node3DEditor::get_singleton()->set_state(new_state);
} else { // CanvasItemEditor
// 2D
canvas_edit_state = CanvasItemEditor::get_singleton()->get_state();
@@ -1465,7 +1465,7 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
onion.captures_valid.write[cidx] = valid;
if (valid) {
player->seek(pos, true);
- get_tree()->flush_transform_notifications(); // Needed for transforms of Spatials.
+ get_tree()->flush_transform_notifications(); // Needed for transforms of Node3Ds.
values_backup.update_skeletons(); // Needed for Skeletons (2D & 3D).
VS::get_singleton()->viewport_set_active(onion.captures[cidx], true);
@@ -1489,9 +1489,9 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
player->restore_animated_values(values_backup);
// Restore state of main editors.
- if (SpatialEditor::get_singleton()->is_visible()) {
+ if (Node3DEditor::get_singleton()->is_visible()) {
// 3D
- SpatialEditor::get_singleton()->set_state(spatial_edit_state);
+ Node3DEditor::get_singleton()->set_state(spatial_edit_state);
} else { // CanvasItemEditor
// 2D
CanvasItemEditor::get_singleton()->set_state(canvas_edit_state);
diff --git a/editor/plugins/camera_editor_plugin.cpp b/editor/plugins/camera_editor_plugin.cpp
index 8726c8c552..2b6dd379e2 100644
--- a/editor/plugins/camera_editor_plugin.cpp
+++ b/editor/plugins/camera_editor_plugin.cpp
@@ -36,7 +36,7 @@ void CameraEditor::_node_removed(Node *p_node) {
if (p_node == node) {
node = NULL;
- SpatialEditor::get_singleton()->set_custom_camera(NULL);
+ Node3DEditor::get_singleton()->set_custom_camera(NULL);
hide();
}
}
@@ -44,7 +44,7 @@ void CameraEditor::_node_removed(Node *p_node) {
void CameraEditor::_pressed() {
Node *sn = (node && preview->is_pressed()) ? node : NULL;
- SpatialEditor::get_singleton()->set_custom_camera(sn);
+ Node3DEditor::get_singleton()->set_custom_camera(sn);
}
void CameraEditor::_bind_methods() {
@@ -56,13 +56,13 @@ void CameraEditor::edit(Node *p_camera) {
if (!node) {
preview->set_pressed(false);
- SpatialEditor::get_singleton()->set_custom_camera(NULL);
+ Node3DEditor::get_singleton()->set_custom_camera(NULL);
} else {
if (preview->is_pressed())
- SpatialEditor::get_singleton()->set_custom_camera(p_camera);
+ Node3DEditor::get_singleton()->set_custom_camera(p_camera);
else
- SpatialEditor::get_singleton()->set_custom_camera(NULL);
+ Node3DEditor::get_singleton()->set_custom_camera(NULL);
}
}
@@ -84,21 +84,21 @@ CameraEditor::CameraEditor() {
void CameraEditorPlugin::edit(Object *p_object) {
- SpatialEditor::get_singleton()->set_can_preview(Object::cast_to<Camera>(p_object));
+ Node3DEditor::get_singleton()->set_can_preview(Object::cast_to<Camera3D>(p_object));
//camera_editor->edit(Object::cast_to<Node>(p_object));
}
bool CameraEditorPlugin::handles(Object *p_object) const {
- return p_object->is_class("Camera");
+ return p_object->is_class("Camera3D");
}
void CameraEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
- //SpatialEditor::get_singleton()->set_can_preview(Object::cast_to<Camera>(p_object));
+ //Node3DEditor::get_singleton()->set_can_preview(Object::cast_to<Camera>(p_object));
} else {
- SpatialEditor::get_singleton()->set_can_preview(NULL);
+ Node3DEditor::get_singleton()->set_can_preview(NULL);
}
}
diff --git a/editor/plugins/camera_editor_plugin.h b/editor/plugins/camera_editor_plugin.h
index 9758a1ffbd..3e59d49371 100644
--- a/editor/plugins/camera_editor_plugin.h
+++ b/editor/plugins/camera_editor_plugin.h
@@ -33,7 +33,7 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
-#include "scene/3d/camera.h"
+#include "scene/3d/camera_3d.h"
class CameraEditor : public Control {
@@ -62,7 +62,7 @@ class CameraEditorPlugin : public EditorPlugin {
EditorNode *editor;
public:
- virtual String get_name() const { return "Camera"; }
+ virtual String get_name() const { return "Camera3D"; }
bool has_main_screen() const { return false; }
virtual void edit(Object *p_object);
virtual bool handles(Object *p_object) const;
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 4cc0bd4780..dbd1f68f00 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -44,7 +44,7 @@
#include "scene/2d/particles_2d.h"
#include "scene/2d/polygon_2d.h"
#include "scene/2d/skeleton_2d.h"
-#include "scene/2d/sprite.h"
+#include "scene/2d/sprite_2d.h"
#include "scene/2d/touch_screen_button.h"
#include "scene/gui/grid_container.h"
#include "scene/gui/nine_patch_rect.h"
@@ -5888,7 +5888,7 @@ void CanvasItemEditorViewport::_create_preview(const Vector<String> &files) cons
Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res));
if (texture != NULL || scene != NULL) {
if (texture != NULL) {
- Sprite *sprite = memnew(Sprite);
+ Sprite2D *sprite = memnew(Sprite2D);
sprite->set_texture(texture);
sprite->set_modulate(Color(1, 1, 1, 0.7f));
preview_node->add_child(sprite);
@@ -6094,7 +6094,7 @@ void CanvasItemEditorViewport::_perform_drop_data() {
else if (default_type == "NinePatchRect")
child = memnew(NinePatchRect);
else
- child = memnew(Sprite); // default
+ child = memnew(Sprite2D); // default
_create_nodes(target_node, child, path, drop_pos);
}
diff --git a/editor/plugins/collision_polygon_editor_plugin.cpp b/editor/plugins/collision_polygon_editor_plugin.cpp
index 93295e6ab5..98bd655a03 100644
--- a/editor/plugins/collision_polygon_editor_plugin.cpp
+++ b/editor/plugins/collision_polygon_editor_plugin.cpp
@@ -35,7 +35,7 @@
#include "core/os/file_access.h"
#include "core/os/keyboard.h"
#include "editor/editor_settings.h"
-#include "scene/3d/camera.h"
+#include "scene/3d/camera_3d.h"
#include "spatial_editor_plugin.h"
void Polygon3DEditor::_notification(int p_what) {
@@ -109,7 +109,7 @@ void Polygon3DEditor::_wip_close() {
undo_redo->commit_action();
}
-bool Polygon3DEditor::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) {
+bool Polygon3DEditor::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) {
if (!node)
return false;
@@ -346,10 +346,10 @@ bool Polygon3DEditor::forward_spatial_gui_input(Camera *p_camera, const Ref<Inpu
snap_ignore = false;
}
- if (!snap_ignore && SpatialEditor::get_singleton()->is_snap_enabled()) {
+ if (!snap_ignore && Node3DEditor::get_singleton()->is_snap_enabled()) {
cpoint = cpoint.snapped(Vector2(
- SpatialEditor::get_singleton()->get_translate_snap(),
- SpatialEditor::get_singleton()->get_translate_snap()));
+ Node3DEditor::get_singleton()->get_translate_snap(),
+ Node3DEditor::get_singleton()->get_translate_snap()));
}
edited_point_pos = cpoint;
@@ -493,7 +493,7 @@ void Polygon3DEditor::edit(Node *p_collision_polygon) {
if (p_collision_polygon) {
- node = Object::cast_to<Spatial>(p_collision_polygon);
+ node = Object::cast_to<Node3D>(p_collision_polygon);
//Enable the pencil tool if the polygon is empty
if (Vector<Vector2>(node->call("get_polygon")).size() == 0) {
_menu_option(MODE_CREATE);
@@ -540,7 +540,7 @@ Polygon3DEditor::Polygon3DEditor(EditorNode *p_editor) {
mode = MODE_EDIT;
wip_active = false;
- imgeom = memnew(ImmediateGeometry);
+ imgeom = memnew(ImmediateGeometry3D);
imgeom->set_transform(Transform(Basis(), Vector3(0, 0, 0.00001)));
line_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
@@ -560,7 +560,7 @@ Polygon3DEditor::Polygon3DEditor(EditorNode *p_editor) {
handle_material->set_point_size(handle->get_width());
handle_material->set_texture(StandardMaterial3D::TEXTURE_ALBEDO, handle);
- pointsm = memnew(MeshInstance);
+ pointsm = memnew(MeshInstance3D);
imgeom->add_child(pointsm);
m.instance();
pointsm->set_mesh(m);
@@ -581,7 +581,7 @@ void Polygon3DEditorPlugin::edit(Object *p_object) {
bool Polygon3DEditorPlugin::handles(Object *p_object) const {
- return Object::cast_to<Spatial>(p_object) && bool(p_object->call("_is_editable_3d_polygon"));
+ return Object::cast_to<Node3D>(p_object) && bool(p_object->call("_is_editable_3d_polygon"));
}
void Polygon3DEditorPlugin::make_visible(bool p_visible) {
@@ -599,7 +599,7 @@ Polygon3DEditorPlugin::Polygon3DEditorPlugin(EditorNode *p_node) {
editor = p_node;
collision_polygon_editor = memnew(Polygon3DEditor(p_node));
- SpatialEditor::get_singleton()->add_control_to_menu_panel(collision_polygon_editor);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(collision_polygon_editor);
collision_polygon_editor->hide();
}
diff --git a/editor/plugins/collision_polygon_editor_plugin.h b/editor/plugins/collision_polygon_editor_plugin.h
index 3b6c25ac17..169b07b673 100644
--- a/editor/plugins/collision_polygon_editor_plugin.h
+++ b/editor/plugins/collision_polygon_editor_plugin.h
@@ -33,9 +33,9 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
-#include "scene/3d/collision_polygon.h"
-#include "scene/3d/immediate_geometry.h"
-#include "scene/3d/mesh_instance.h"
+#include "scene/3d/collision_polygon_3d.h"
+#include "scene/3d/immediate_geometry_3d.h"
+#include "scene/3d/mesh_instance_3d.h"
#include "scene/gui/tool_button.h"
class CanvasItemEditor;
@@ -62,9 +62,9 @@ class Polygon3DEditor : public HBoxContainer {
EditorNode *editor;
Panel *panel;
- Spatial *node;
- ImmediateGeometry *imgeom;
- MeshInstance *pointsm;
+ Node3D *node;
+ ImmediateGeometry3D *imgeom;
+ MeshInstance3D *pointsm;
Ref<ArrayMesh> m;
MenuButton *options;
@@ -90,7 +90,7 @@ protected:
static void _bind_methods();
public:
- virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event);
+ virtual bool forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event);
void edit(Node *p_collision_polygon);
Polygon3DEditor(EditorNode *p_editor);
~Polygon3DEditor();
@@ -104,7 +104,7 @@ class Polygon3DEditorPlugin : public EditorPlugin {
EditorNode *editor;
public:
- virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) { return collision_polygon_editor->forward_spatial_gui_input(p_camera, p_event); }
+ virtual bool forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) { return collision_polygon_editor->forward_spatial_gui_input(p_camera, p_event); }
virtual String get_name() const { return "Polygon3DEditor"; }
bool has_main_screen() const { return false; }
diff --git a/editor/plugins/cpu_particles_editor_plugin.cpp b/editor/plugins/cpu_particles_editor_plugin.cpp
index 1388b9ca10..4674903256 100644
--- a/editor/plugins/cpu_particles_editor_plugin.cpp
+++ b/editor/plugins/cpu_particles_editor_plugin.cpp
@@ -65,7 +65,7 @@ void CPUParticlesEditor::_menu_option(int p_option) {
}
}
-void CPUParticlesEditor::edit(CPUParticles *p_particles) {
+void CPUParticlesEditor::edit(CPUParticles3D *p_particles) {
base_node = p_particles;
node = p_particles;
@@ -82,10 +82,10 @@ void CPUParticlesEditor::_generate_emission_points() {
}
if (normals.size() == 0) {
- node->set_emission_shape(CPUParticles::EMISSION_SHAPE_POINTS);
+ node->set_emission_shape(CPUParticles3D::EMISSION_SHAPE_POINTS);
node->set_emission_points(points);
} else {
- node->set_emission_shape(CPUParticles::EMISSION_SHAPE_DIRECTED_POINTS);
+ node->set_emission_shape(CPUParticles3D::EMISSION_SHAPE_DIRECTED_POINTS);
node->set_emission_points(points);
node->set_emission_normals(normals);
}
@@ -97,7 +97,7 @@ void CPUParticlesEditor::_bind_methods() {
CPUParticlesEditor::CPUParticlesEditor() {
particles_editor_hb = memnew(HBoxContainer);
- SpatialEditor::get_singleton()->add_control_to_menu_panel(particles_editor_hb);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(particles_editor_hb);
options = memnew(MenuButton);
options->set_switch_on_hover(true);
particles_editor_hb->add_child(options);
@@ -112,12 +112,12 @@ CPUParticlesEditor::CPUParticlesEditor() {
void CPUParticlesEditorPlugin::edit(Object *p_object) {
- particles_editor->edit(Object::cast_to<CPUParticles>(p_object));
+ particles_editor->edit(Object::cast_to<CPUParticles3D>(p_object));
}
bool CPUParticlesEditorPlugin::handles(Object *p_object) const {
- return p_object->is_class("CPUParticles");
+ return p_object->is_class("CPUParticles3D");
}
void CPUParticlesEditorPlugin::make_visible(bool p_visible) {
diff --git a/editor/plugins/cpu_particles_editor_plugin.h b/editor/plugins/cpu_particles_editor_plugin.h
index 4cf143fc0c..ed47ed1436 100644
--- a/editor/plugins/cpu_particles_editor_plugin.h
+++ b/editor/plugins/cpu_particles_editor_plugin.h
@@ -32,7 +32,7 @@
#define CPU_PARTICLES_EDITOR_PLUGIN_H
#include "editor/plugins/particles_editor_plugin.h"
-#include "scene/3d/cpu_particles.h"
+#include "scene/3d/cpu_particles_3d.h"
class CPUParticlesEditor : public ParticlesEditorBase {
@@ -46,7 +46,7 @@ class CPUParticlesEditor : public ParticlesEditorBase {
};
- CPUParticles *node;
+ CPUParticles3D *node;
void _menu_option(int);
@@ -60,7 +60,7 @@ protected:
static void _bind_methods();
public:
- void edit(CPUParticles *p_particles);
+ void edit(CPUParticles3D *p_particles);
CPUParticlesEditor();
};
diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp
index 74588d4439..9fe9675c69 100644
--- a/editor/plugins/material_editor_plugin.cpp
+++ b/editor/plugins/material_editor_plugin.cpp
@@ -123,25 +123,25 @@ MaterialEditor::MaterialEditor() {
viewport->set_transparent_background(true);
viewport->set_msaa(Viewport::MSAA_4X);
- camera = memnew(Camera);
+ camera = memnew(Camera3D);
camera->set_transform(Transform(Basis(), Vector3(0, 0, 3)));
camera->set_perspective(45, 0.1, 10);
camera->make_current();
viewport->add_child(camera);
- light1 = memnew(DirectionalLight);
+ light1 = memnew(DirectionalLight3D);
light1->set_transform(Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0)));
viewport->add_child(light1);
- light2 = memnew(DirectionalLight);
+ light2 = memnew(DirectionalLight3D);
light2->set_transform(Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1)));
light2->set_color(Color(0.7, 0.7, 0.7));
viewport->add_child(light2);
- sphere_instance = memnew(MeshInstance);
+ sphere_instance = memnew(MeshInstance3D);
viewport->add_child(sphere_instance);
- box_instance = memnew(MeshInstance);
+ box_instance = memnew(MeshInstance3D);
viewport->add_child(box_instance);
Transform box_xform;
diff --git a/editor/plugins/material_editor_plugin.h b/editor/plugins/material_editor_plugin.h
index 895c3f80bd..0938e79ca2 100644
--- a/editor/plugins/material_editor_plugin.h
+++ b/editor/plugins/material_editor_plugin.h
@@ -36,9 +36,9 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
-#include "scene/3d/camera.h"
-#include "scene/3d/light.h"
-#include "scene/3d/mesh_instance.h"
+#include "scene/3d/camera_3d.h"
+#include "scene/3d/light_3d.h"
+#include "scene/3d/mesh_instance_3d.h"
#include "scene/resources/material.h"
class ViewportContainer;
@@ -49,11 +49,11 @@ class MaterialEditor : public Control {
ViewportContainer *vc;
SubViewport *viewport;
- MeshInstance *sphere_instance;
- MeshInstance *box_instance;
- DirectionalLight *light1;
- DirectionalLight *light2;
- Camera *camera;
+ MeshInstance3D *sphere_instance;
+ MeshInstance3D *box_instance;
+ DirectionalLight3D *light1;
+ DirectionalLight3D *light2;
+ Camera3D *camera;
Ref<SphereMesh> sphere_mesh;
Ref<CubeMesh> box_mesh;
diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp
index 352997d6fa..d7dd777cd3 100644
--- a/editor/plugins/mesh_editor_plugin.cpp
+++ b/editor/plugins/mesh_editor_plugin.cpp
@@ -123,23 +123,23 @@ MeshEditor::MeshEditor() {
viewport->set_disable_input(true);
viewport->set_msaa(Viewport::MSAA_2X);
set_stretch(true);
- camera = memnew(Camera);
+ camera = memnew(Camera3D);
camera->set_transform(Transform(Basis(), Vector3(0, 0, 1.1)));
camera->set_perspective(45, 0.1, 10);
viewport->add_child(camera);
- light1 = memnew(DirectionalLight);
+ light1 = memnew(DirectionalLight3D);
light1->set_transform(Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0)));
viewport->add_child(light1);
- light2 = memnew(DirectionalLight);
+ light2 = memnew(DirectionalLight3D);
light2->set_transform(Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1)));
light2->set_color(Color(0.7, 0.7, 0.7));
viewport->add_child(light2);
- rotation = memnew(Spatial);
+ rotation = memnew(Node3D);
viewport->add_child(rotation);
- mesh_instance = memnew(MeshInstance);
+ mesh_instance = memnew(MeshInstance3D);
rotation->add_child(mesh_instance);
set_custom_minimum_size(Size2(1, 150) * EDSCALE);
diff --git a/editor/plugins/mesh_editor_plugin.h b/editor/plugins/mesh_editor_plugin.h
index 6d39d49de1..59810517d9 100644
--- a/editor/plugins/mesh_editor_plugin.h
+++ b/editor/plugins/mesh_editor_plugin.h
@@ -33,9 +33,9 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
-#include "scene/3d/camera.h"
-#include "scene/3d/light.h"
-#include "scene/3d/mesh_instance.h"
+#include "scene/3d/camera_3d.h"
+#include "scene/3d/light_3d.h"
+#include "scene/3d/mesh_instance_3d.h"
#include "scene/gui/viewport_container.h"
#include "scene/resources/material.h"
@@ -47,11 +47,11 @@ class MeshEditor : public ViewportContainer {
float rot_y;
SubViewport *viewport;
- MeshInstance *mesh_instance;
- Spatial *rotation;
- DirectionalLight *light1;
- DirectionalLight *light2;
- Camera *camera;
+ MeshInstance3D *mesh_instance;
+ Node3D *rotation;
+ DirectionalLight3D *light1;
+ DirectionalLight3D *light2;
+ Camera3D *camera;
Ref<Mesh> mesh;
diff --git a/editor/plugins/mesh_instance_editor_plugin.cpp b/editor/plugins/mesh_instance_editor_plugin.cpp
index 3fdda36177..dce69e53ca 100644
--- a/editor/plugins/mesh_instance_editor_plugin.cpp
+++ b/editor/plugins/mesh_instance_editor_plugin.cpp
@@ -31,9 +31,9 @@
#include "mesh_instance_editor_plugin.h"
#include "editor/editor_scale.h"
-#include "scene/3d/collision_shape.h"
-#include "scene/3d/navigation_region.h"
-#include "scene/3d/physics_body.h"
+#include "scene/3d/collision_shape_3d.h"
+#include "scene/3d/navigation_region_3d.h"
+#include "scene/3d/physics_body_3d.h"
#include "scene/gui/box_container.h"
#include "spatial_editor_plugin.h"
@@ -45,7 +45,7 @@ void MeshInstanceEditor::_node_removed(Node *p_node) {
}
}
-void MeshInstanceEditor::edit(MeshInstance *p_mesh) {
+void MeshInstanceEditor::edit(MeshInstance3D *p_mesh) {
node = p_mesh;
}
@@ -68,16 +68,16 @@ void MeshInstanceEditor::_menu_option(int p_option) {
List<Node *> selection = editor_selection->get_selected_node_list();
if (selection.empty()) {
- Ref<Shape> shape = mesh->create_trimesh_shape();
+ Ref<Shape3D> shape = mesh->create_trimesh_shape();
if (shape.is_null()) {
err_dialog->set_text(TTR("Couldn't create a Trimesh collision shape."));
err_dialog->popup_centered();
return;
}
- CollisionShape *cshape = memnew(CollisionShape);
+ CollisionShape3D *cshape = memnew(CollisionShape3D);
cshape->set_shape(shape);
- StaticBody *body = memnew(StaticBody);
+ StaticBody3D *body = memnew(StaticBody3D);
body->add_child(cshape);
Node *owner = node == get_tree()->get_edited_scene_root() ? node : node->get_owner();
@@ -96,7 +96,7 @@ void MeshInstanceEditor::_menu_option(int p_option) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- MeshInstance *instance = Object::cast_to<MeshInstance>(E->get());
+ MeshInstance3D *instance = Object::cast_to<MeshInstance3D>(E->get());
if (!instance)
continue;
@@ -104,13 +104,13 @@ void MeshInstanceEditor::_menu_option(int p_option) {
if (m.is_null())
continue;
- Ref<Shape> shape = m->create_trimesh_shape();
+ Ref<Shape3D> shape = m->create_trimesh_shape();
if (shape.is_null())
continue;
- CollisionShape *cshape = memnew(CollisionShape);
+ CollisionShape3D *cshape = memnew(CollisionShape3D);
cshape->set_shape(shape);
- StaticBody *body = memnew(StaticBody);
+ StaticBody3D *body = memnew(StaticBody3D);
body->add_child(cshape);
Node *owner = instance == get_tree()->get_edited_scene_root() ? instance : instance->get_owner();
@@ -134,11 +134,11 @@ void MeshInstanceEditor::_menu_option(int p_option) {
return;
}
- Ref<Shape> shape = mesh->create_trimesh_shape();
+ Ref<Shape3D> shape = mesh->create_trimesh_shape();
if (shape.is_null())
return;
- CollisionShape *cshape = memnew(CollisionShape);
+ CollisionShape3D *cshape = memnew(CollisionShape3D);
cshape->set_shape(shape);
Node *owner = node->get_owner();
@@ -162,7 +162,7 @@ void MeshInstanceEditor::_menu_option(int p_option) {
return;
}
- Ref<Shape> shape = mesh->create_convex_shape();
+ Ref<Shape3D> shape = mesh->create_convex_shape();
if (shape.is_null()) {
err_dialog->set_text(TTR("Couldn't create a single convex collision shape."));
@@ -173,7 +173,7 @@ void MeshInstanceEditor::_menu_option(int p_option) {
ur->create_action(TTR("Create Single Convex Shape"));
- CollisionShape *cshape = memnew(CollisionShape);
+ CollisionShape3D *cshape = memnew(CollisionShape3D);
cshape->set_shape(shape);
cshape->set_transform(node->get_transform());
@@ -196,7 +196,7 @@ void MeshInstanceEditor::_menu_option(int p_option) {
return;
}
- Vector<Ref<Shape>> shapes = mesh->convex_decompose();
+ Vector<Ref<Shape3D>> shapes = mesh->convex_decompose();
if (!shapes.size()) {
err_dialog->set_text(TTR("Couldn't create any collision shapes."));
@@ -209,7 +209,7 @@ void MeshInstanceEditor::_menu_option(int p_option) {
for (int i = 0; i < shapes.size(); i++) {
- CollisionShape *cshape = memnew(CollisionShape);
+ CollisionShape3D *cshape = memnew(CollisionShape3D);
cshape->set_shape(shapes[i]);
cshape->set_transform(node->get_transform());
@@ -233,7 +233,7 @@ void MeshInstanceEditor::_menu_option(int p_option) {
return;
nmesh->create_from_mesh(mesh);
- NavigationRegion *nmi = memnew(NavigationRegion);
+ NavigationRegion3D *nmi = memnew(NavigationRegion3D);
nmi->set_navigation_mesh(nmesh);
Node *owner = node == get_tree()->get_edited_scene_root() ? node : node->get_owner();
@@ -415,7 +415,7 @@ void MeshInstanceEditor::_create_outline_mesh() {
return;
}
- MeshInstance *mi = memnew(MeshInstance);
+ MeshInstance3D *mi = memnew(MeshInstance3D);
mi->set_mesh(mesho);
Node *owner = node->get_owner();
if (get_tree()->get_edited_scene_root() == node) {
@@ -441,10 +441,10 @@ MeshInstanceEditor::MeshInstanceEditor() {
options = memnew(MenuButton);
options->set_switch_on_hover(true);
- SpatialEditor::get_singleton()->add_control_to_menu_panel(options);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(options);
options->set_text(TTR("Mesh"));
- options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("MeshInstance", "EditorIcons"));
+ options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("MeshInstance3D", "EditorIcons"));
options->get_popup()->add_item(TTR("Create Trimesh Static Body"), MENU_OPTION_CREATE_STATIC_TRIMESH_BODY);
options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a StaticBody and assigns a polygon-based collision shape to it automatically.\nThis is the most accurate (but slowest) option for collision detection."));
@@ -459,7 +459,7 @@ MeshInstanceEditor::MeshInstanceEditor() {
options->get_popup()->add_item(TTR("Create Navigation Mesh"), MENU_OPTION_CREATE_NAVMESH);
options->get_popup()->add_separator();
options->get_popup()->add_item(TTR("Create Outline Mesh..."), MENU_OPTION_CREATE_OUTLINE_MESH);
- options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a static outline mesh. The outline mesh will have its normals flipped automatically.\nThis can be used instead of the SpatialMaterial Grow property when using that property isn't possible."));
+ options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a static outline mesh. The outline mesh will have its normals flipped automatically.\nThis can be used instead of the StandardMaterial Grow property when using that property isn't possible."));
options->get_popup()->add_separator();
options->get_popup()->add_item(TTR("View UV1"), MENU_OPTION_DEBUG_UV1);
options->get_popup()->add_item(TTR("View UV2"), MENU_OPTION_DEBUG_UV2);
@@ -499,12 +499,12 @@ MeshInstanceEditor::MeshInstanceEditor() {
void MeshInstanceEditorPlugin::edit(Object *p_object) {
- mesh_editor->edit(Object::cast_to<MeshInstance>(p_object));
+ mesh_editor->edit(Object::cast_to<MeshInstance3D>(p_object));
}
bool MeshInstanceEditorPlugin::handles(Object *p_object) const {
- return p_object->is_class("MeshInstance");
+ return p_object->is_class("MeshInstance3D");
}
void MeshInstanceEditorPlugin::make_visible(bool p_visible) {
diff --git a/editor/plugins/mesh_instance_editor_plugin.h b/editor/plugins/mesh_instance_editor_plugin.h
index 5ca9aa3fec..68354388ba 100644
--- a/editor/plugins/mesh_instance_editor_plugin.h
+++ b/editor/plugins/mesh_instance_editor_plugin.h
@@ -33,7 +33,7 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
-#include "scene/3d/mesh_instance.h"
+#include "scene/3d/mesh_instance_3d.h"
#include "scene/gui/spin_box.h"
class MeshInstanceEditor : public Control {
@@ -53,7 +53,7 @@ class MeshInstanceEditor : public Control {
MENU_OPTION_DEBUG_UV2,
};
- MeshInstance *node;
+ MeshInstance3D *node;
MenuButton *options;
@@ -79,7 +79,7 @@ protected:
static void _bind_methods();
public:
- void edit(MeshInstance *p_mesh);
+ void edit(MeshInstance3D *p_mesh);
MeshInstanceEditor();
};
@@ -91,7 +91,7 @@ class MeshInstanceEditorPlugin : public EditorPlugin {
EditorNode *editor;
public:
- virtual String get_name() const { return "MeshInstance"; }
+ virtual String get_name() const { return "MeshInstance3D"; }
bool has_main_screen() const { return false; }
virtual void edit(Object *p_object);
virtual bool handles(Object *p_object) const;
diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp
index 32099c1364..88a6254c5c 100644
--- a/editor/plugins/mesh_library_editor_plugin.cpp
+++ b/editor/plugins/mesh_library_editor_plugin.cpp
@@ -33,9 +33,9 @@
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "main/main.h"
-#include "scene/3d/mesh_instance.h"
-#include "scene/3d/navigation_region.h"
-#include "scene/3d/physics_body.h"
+#include "scene/3d/mesh_instance_3d.h"
+#include "scene/3d/navigation_region_3d.h"
+#include "scene/3d/physics_body_3d.h"
#include "scene/main/window.h"
#include "scene/resources/packed_scene.h"
#include "spatial_editor_plugin.h"
@@ -71,16 +71,16 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library,
if (!p_merge)
p_library->clear();
- Map<int, MeshInstance *> mesh_instances;
+ Map<int, MeshInstance3D *> mesh_instances;
for (int i = 0; i < p_scene->get_child_count(); i++) {
Node *child = p_scene->get_child(i);
- if (!Object::cast_to<MeshInstance>(child)) {
+ if (!Object::cast_to<MeshInstance3D>(child)) {
if (child->get_child_count() > 0) {
child = child->get_child(0);
- if (!Object::cast_to<MeshInstance>(child)) {
+ if (!Object::cast_to<MeshInstance3D>(child)) {
continue;
}
@@ -88,7 +88,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library,
continue;
}
- MeshInstance *mi = Object::cast_to<MeshInstance>(child);
+ MeshInstance3D *mi = Object::cast_to<MeshInstance3D>(child);
Ref<Mesh> mesh = mi->get_mesh();
if (mesh.is_null())
continue;
@@ -118,10 +118,10 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library,
for (int j = 0; j < mi->get_child_count(); j++) {
Node *child2 = mi->get_child(j);
- if (!Object::cast_to<StaticBody>(child2))
+ if (!Object::cast_to<StaticBody3D>(child2))
continue;
- StaticBody *sb = Object::cast_to<StaticBody>(child2);
+ StaticBody3D *sb = Object::cast_to<StaticBody3D>(child2);
List<uint32_t> shapes;
sb->get_shape_owners(&shapes);
@@ -135,7 +135,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library,
for (int k = 0; k < sb->shape_owner_get_shape_count(E->get()); k++) {
- Ref<Shape> collision = sb->shape_owner_get_shape(E->get(), k);
+ Ref<Shape3D> collision = sb->shape_owner_get_shape(E->get(), k);
if (!collision.is_valid())
continue;
MeshLibrary::ShapeData shape_data;
@@ -152,9 +152,9 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library,
Transform navmesh_transform;
for (int j = 0; j < mi->get_child_count(); j++) {
Node *child2 = mi->get_child(j);
- if (!Object::cast_to<NavigationRegion>(child2))
+ if (!Object::cast_to<NavigationRegion3D>(child2))
continue;
- NavigationRegion *sb = Object::cast_to<NavigationRegion>(child2);
+ NavigationRegion3D *sb = Object::cast_to<NavigationRegion3D>(child2);
navmesh = sb->get_navigation_mesh();
navmesh_transform = sb->get_transform();
if (!navmesh.is_null())
@@ -267,7 +267,7 @@ MeshLibraryEditor::MeshLibraryEditor(EditorNode *p_editor) {
file->connect("file_selected", callable_mp(this, &MeshLibraryEditor::_import_scene_cbk));
menu = memnew(MenuButton);
- SpatialEditor::get_singleton()->add_control_to_menu_panel(menu);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(menu);
menu->set_position(Point2(1, 1));
menu->set_text(TTR("Mesh Library"));
menu->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("MeshLibrary", "EditorIcons"));
diff --git a/editor/plugins/multimesh_editor_plugin.cpp b/editor/plugins/multimesh_editor_plugin.cpp
index dcae59bbe8..dd2781aea7 100644
--- a/editor/plugins/multimesh_editor_plugin.cpp
+++ b/editor/plugins/multimesh_editor_plugin.cpp
@@ -30,7 +30,7 @@
#include "multimesh_editor_plugin.h"
-#include "scene/3d/mesh_instance.h"
+#include "scene/3d/mesh_instance_3d.h"
#include "scene/gui/box_container.h"
#include "spatial_editor_plugin.h"
@@ -78,7 +78,7 @@ void MultiMeshEditor::_populate() {
return;
}
- MeshInstance *ms_instance = Object::cast_to<MeshInstance>(ms_node);
+ MeshInstance3D *ms_instance = Object::cast_to<MeshInstance3D>(ms_node);
if (!ms_instance) {
@@ -113,7 +113,7 @@ void MultiMeshEditor::_populate() {
return;
}
- GeometryInstance *ss_instance = Object::cast_to<MeshInstance>(ss_node);
+ GeometryInstance3D *ss_instance = Object::cast_to<MeshInstance3D>(ss_node);
if (!ss_instance) {
@@ -124,7 +124,7 @@ void MultiMeshEditor::_populate() {
Transform geom_xform = node->get_global_transform().affine_inverse() * ss_instance->get_global_transform();
- Vector<Face3> geometry = ss_instance->get_faces(VisualInstance::FACES_SOLID);
+ Vector<Face3> geometry = ss_instance->get_faces(VisualInstance3D::FACES_SOLID);
if (geometry.size() == 0) {
@@ -261,7 +261,7 @@ void MultiMeshEditor::_menu_option(int p_option) {
}
}
-void MultiMeshEditor::edit(MultiMeshInstance *p_multimesh) {
+void MultiMeshEditor::edit(MultiMeshInstance3D *p_multimesh) {
node = p_multimesh;
}
@@ -284,7 +284,7 @@ MultiMeshEditor::MultiMeshEditor() {
options = memnew(MenuButton);
options->set_switch_on_hover(true);
- SpatialEditor::get_singleton()->add_control_to_menu_panel(options);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(options);
options->set_text("MultiMesh");
options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("MultiMeshInstance", "EditorIcons"));
@@ -379,12 +379,12 @@ MultiMeshEditor::MultiMeshEditor() {
void MultiMeshEditorPlugin::edit(Object *p_object) {
- multimesh_editor->edit(Object::cast_to<MultiMeshInstance>(p_object));
+ multimesh_editor->edit(Object::cast_to<MultiMeshInstance3D>(p_object));
}
bool MultiMeshEditorPlugin::handles(Object *p_object) const {
- return p_object->is_class("MultiMeshInstance");
+ return p_object->is_class("MultiMeshInstance3D");
}
void MultiMeshEditorPlugin::make_visible(bool p_visible) {
diff --git a/editor/plugins/multimesh_editor_plugin.h b/editor/plugins/multimesh_editor_plugin.h
index 2c7b98cfbc..15c9b91fee 100644
--- a/editor/plugins/multimesh_editor_plugin.h
+++ b/editor/plugins/multimesh_editor_plugin.h
@@ -33,7 +33,7 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
-#include "scene/3d/multimesh_instance.h"
+#include "scene/3d/multimesh_instance_3d.h"
#include "scene/gui/spin_box.h"
class MultiMeshEditor : public Control {
@@ -44,11 +44,11 @@ class MultiMeshEditor : public Control {
AcceptDialog *err_dialog;
MenuButton *options;
- MultiMeshInstance *_last_pp_node;
+ MultiMeshInstance3D *_last_pp_node;
bool browsing_source;
Panel *panel;
- MultiMeshInstance *node;
+ MultiMeshInstance3D *node;
LineEdit *surface_source;
LineEdit *mesh_source;
@@ -78,7 +78,7 @@ protected:
static void _bind_methods();
public:
- void edit(MultiMeshInstance *p_multimesh);
+ void edit(MultiMeshInstance3D *p_multimesh);
MultiMeshEditor();
};
diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp
index 744424a3fa..b018ef383e 100644
--- a/editor/plugins/particles_2d_editor_plugin.cpp
+++ b/editor/plugins/particles_2d_editor_plugin.cpp
@@ -43,7 +43,7 @@ void Particles2DEditorPlugin::edit(Object *p_object) {
bool Particles2DEditorPlugin::handles(Object *p_object) const {
- return p_object->is_class("Particles2D");
+ return p_object->is_class("GPUParticles2D");
}
void Particles2DEditorPlugin::make_visible(bool p_visible) {
diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp
index 63acf7cfb6..628eb4a7fe 100644
--- a/editor/plugins/particles_editor_plugin.cpp
+++ b/editor/plugins/particles_editor_plugin.cpp
@@ -32,7 +32,7 @@
#include "core/io/resource_loader.h"
#include "editor/plugins/spatial_editor_plugin.h"
-#include "scene/3d/cpu_particles.h"
+#include "scene/3d/cpu_particles_3d.h"
#include "scene/resources/particles_material.h"
bool ParticlesEditorBase::_generate(Vector<Vector3> &points, Vector<Vector3> &normals) {
@@ -167,20 +167,20 @@ void ParticlesEditorBase::_node_selected(const NodePath &p_path) {
if (!sel)
return;
- if (!sel->is_class("Spatial")) {
+ if (!sel->is_class("Node3D")) {
- EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't inherit from Spatial."), sel->get_name()));
+ EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't inherit from Node3D."), sel->get_name()));
return;
}
- VisualInstance *vi = Object::cast_to<VisualInstance>(sel);
+ VisualInstance3D *vi = Object::cast_to<VisualInstance3D>(sel);
if (!vi) {
EditorNode::get_singleton()->show_warning(vformat(TTR("\"%s\" doesn't contain geometry."), sel->get_name()));
return;
}
- geometry = vi->get_faces(VisualInstance::FACES_SOLID);
+ geometry = vi->get_faces(VisualInstance3D::FACES_SOLID);
if (geometry.size() == 0) {
@@ -274,7 +274,7 @@ void ParticlesEditor::_menu_option(int p_option) {
} break;
case MENU_OPTION_CONVERT_TO_CPU_PARTICLES: {
- CPUParticles *cpu_particles = memnew(CPUParticles);
+ CPUParticles3D *cpu_particles = memnew(CPUParticles3D);
cpu_particles->convert_from_particles(node);
cpu_particles->set_name(node->get_name());
cpu_particles->set_transform(node->get_transform());
@@ -340,7 +340,7 @@ void ParticlesEditor::_generate_aabb() {
ur->commit_action();
}
-void ParticlesEditor::edit(Particles *p_particles) {
+void ParticlesEditor::edit(GPUParticles3D *p_particles) {
base_node = p_particles;
node = p_particles;
@@ -426,7 +426,7 @@ ParticlesEditor::ParticlesEditor() {
node = NULL;
particles_editor_hb = memnew(HBoxContainer);
- SpatialEditor::get_singleton()->add_control_to_menu_panel(particles_editor_hb);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(particles_editor_hb);
options = memnew(MenuButton);
options->set_switch_on_hover(true);
particles_editor_hb->add_child(options);
@@ -460,12 +460,12 @@ ParticlesEditor::ParticlesEditor() {
void ParticlesEditorPlugin::edit(Object *p_object) {
- particles_editor->edit(Object::cast_to<Particles>(p_object));
+ particles_editor->edit(Object::cast_to<GPUParticles3D>(p_object));
}
bool ParticlesEditorPlugin::handles(Object *p_object) const {
- return p_object->is_class("Particles");
+ return p_object->is_class("GPUParticles3D");
}
void ParticlesEditorPlugin::make_visible(bool p_visible) {
diff --git a/editor/plugins/particles_editor_plugin.h b/editor/plugins/particles_editor_plugin.h
index fb5ce17560..773f305a2b 100644
--- a/editor/plugins/particles_editor_plugin.h
+++ b/editor/plugins/particles_editor_plugin.h
@@ -33,7 +33,7 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
-#include "scene/3d/particles.h"
+#include "scene/3d/gpu_particles_3d.h"
#include "scene/gui/spin_box.h"
class ParticlesEditorBase : public Control {
@@ -41,7 +41,7 @@ class ParticlesEditorBase : public Control {
GDCLASS(ParticlesEditorBase, Control);
protected:
- Spatial *base_node;
+ Node3D *base_node;
Panel *panel;
MenuButton *options;
HBoxContainer *particles_editor_hb;
@@ -70,7 +70,7 @@ class ParticlesEditor : public ParticlesEditorBase {
ConfirmationDialog *generate_aabb;
SpinBox *generate_seconds;
- Particles *node;
+ GPUParticles3D *node;
enum Menu {
@@ -96,7 +96,7 @@ protected:
static void _bind_methods();
public:
- void edit(Particles *p_particles);
+ void edit(GPUParticles3D *p_particles);
ParticlesEditor();
};
diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp
index b6842be76c..e54fd17a5b 100644
--- a/editor/plugins/path_editor_plugin.cpp
+++ b/editor/plugins/path_editor_plugin.cpp
@@ -34,7 +34,7 @@
#include "scene/resources/curve.h"
#include "spatial_editor_plugin.h"
-String PathSpatialGizmo::get_handle_name(int p_idx) const {
+String PathNode3DGizmo::get_handle_name(int p_idx) const {
Ref<Curve3D> c = path->get_curve();
if (c.is_null())
@@ -57,7 +57,7 @@ String PathSpatialGizmo::get_handle_name(int p_idx) const {
return n;
}
-Variant PathSpatialGizmo::get_handle_value(int p_idx) {
+Variant PathNode3DGizmo::get_handle_value(int p_idx) {
Ref<Curve3D> c = path->get_curve();
if (c.is_null())
@@ -84,7 +84,7 @@ Variant PathSpatialGizmo::get_handle_value(int p_idx) {
return ofs;
}
-void PathSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_point) {
+void PathNode3DGizmo::set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_point) {
Ref<Curve3D> c = path->get_curve();
if (c.is_null())
@@ -104,8 +104,8 @@ void PathSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_p
if (p.intersects_ray(ray_from, ray_dir, &inters)) {
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- float snap = SpatialEditor::get_singleton()->get_translate_snap();
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ float snap = Node3DEditor::get_singleton()->get_translate_snap();
inters.snap(Vector3(snap, snap, snap));
}
@@ -137,8 +137,8 @@ void PathSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_p
}
Vector3 local = gi.xform(inters) - base;
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- float snap = SpatialEditor::get_singleton()->get_translate_snap();
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ float snap = Node3DEditor::get_singleton()->get_translate_snap();
local.snap(Vector3(snap, snap, snap));
}
@@ -154,13 +154,13 @@ void PathSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_p
}
}
-void PathSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) {
+void PathNode3DGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) {
Ref<Curve3D> c = path->get_curve();
if (c.is_null())
return;
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
if (p_idx < c->get_point_count()) {
@@ -217,7 +217,7 @@ void PathSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p
}
}
-void PathSpatialGizmo::redraw() {
+void PathNode3DGizmo::redraw() {
clear();
@@ -286,13 +286,13 @@ void PathSpatialGizmo::redraw() {
}
}
-PathSpatialGizmo::PathSpatialGizmo(Path *p_path) {
+PathNode3DGizmo::PathNode3DGizmo(Path3D *p_path) {
path = p_path;
set_spatial_node(p_path);
}
-bool PathEditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) {
+bool PathEditorPlugin::forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event) {
if (!path)
return false;
@@ -451,7 +451,7 @@ bool PathEditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<Inp
void PathEditorPlugin::edit(Object *p_object) {
if (p_object) {
- path = Object::cast_to<Path>(p_object);
+ path = Object::cast_to<Path3D>(p_object);
if (path) {
if (path->get_curve().is_valid()) {
@@ -459,7 +459,7 @@ void PathEditorPlugin::edit(Object *p_object) {
}
}
} else {
- Path *pre = path;
+ Path3D *pre = path;
path = NULL;
if (pre) {
pre->get_curve()->emit_signal("changed");
@@ -470,7 +470,7 @@ void PathEditorPlugin::edit(Object *p_object) {
bool PathEditorPlugin::handles(Object *p_object) const {
- return p_object->is_class("Path");
+ return p_object->is_class("Path3D");
}
void PathEditorPlugin::make_visible(bool p_visible) {
@@ -493,7 +493,7 @@ void PathEditorPlugin::make_visible(bool p_visible) {
sep->hide();
{
- Path *pre = path;
+ Path3D *pre = path;
path = NULL;
if (pre && pre->get_curve().is_valid()) {
pre->get_curve()->emit_signal("changed");
@@ -563,47 +563,47 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) {
mirror_handle_angle = true;
mirror_handle_length = true;
- Ref<PathSpatialGizmoPlugin> gizmo_plugin;
+ Ref<PathNode3DGizmoPlugin> gizmo_plugin;
gizmo_plugin.instance();
- SpatialEditor::get_singleton()->add_gizmo_plugin(gizmo_plugin);
+ Node3DEditor::get_singleton()->add_gizmo_plugin(gizmo_plugin);
sep = memnew(VSeparator);
sep->hide();
- SpatialEditor::get_singleton()->add_control_to_menu_panel(sep);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(sep);
curve_edit = memnew(ToolButton);
curve_edit->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveEdit", "EditorIcons"));
curve_edit->set_toggle_mode(true);
curve_edit->hide();
curve_edit->set_focus_mode(Control::FOCUS_NONE);
curve_edit->set_tooltip(TTR("Select Points") + "\n" + TTR("Shift+Drag: Select Control Points") + "\n" + keycode_get_string(KEY_MASK_CMD) + TTR("Click: Add Point") + "\n" + TTR("Right Click: Delete Point"));
- SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_edit);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(curve_edit);
curve_create = memnew(ToolButton);
curve_create->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveCreate", "EditorIcons"));
curve_create->set_toggle_mode(true);
curve_create->hide();
curve_create->set_focus_mode(Control::FOCUS_NONE);
curve_create->set_tooltip(TTR("Add Point (in empty space)") + "\n" + TTR("Split Segment (in curve)"));
- SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_create);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(curve_create);
curve_del = memnew(ToolButton);
curve_del->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveDelete", "EditorIcons"));
curve_del->set_toggle_mode(true);
curve_del->hide();
curve_del->set_focus_mode(Control::FOCUS_NONE);
curve_del->set_tooltip(TTR("Delete Point"));
- SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_del);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(curve_del);
curve_close = memnew(ToolButton);
curve_close->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("CurveClose", "EditorIcons"));
curve_close->hide();
curve_close->set_focus_mode(Control::FOCUS_NONE);
curve_close->set_tooltip(TTR("Close Curve"));
- SpatialEditor::get_singleton()->add_control_to_menu_panel(curve_close);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(curve_close);
PopupMenu *menu;
handle_menu = memnew(MenuButton);
handle_menu->set_text(TTR("Options"));
handle_menu->hide();
- SpatialEditor::get_singleton()->add_control_to_menu_panel(handle_menu);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(handle_menu);
menu = handle_menu->get_popup();
menu->add_check_item(TTR("Mirror Handle Angles"));
@@ -627,24 +627,24 @@ PathEditorPlugin::PathEditorPlugin(EditorNode *p_node) {
PathEditorPlugin::~PathEditorPlugin() {
}
-Ref<EditorSpatialGizmo> PathSpatialGizmoPlugin::create_gizmo(Spatial *p_spatial) {
- Ref<PathSpatialGizmo> ref;
+Ref<EditorNode3DGizmo> PathNode3DGizmoPlugin::create_gizmo(Node3D *p_spatial) {
+ Ref<PathNode3DGizmo> ref;
- Path *path = Object::cast_to<Path>(p_spatial);
- if (path) ref = Ref<PathSpatialGizmo>(memnew(PathSpatialGizmo(path)));
+ Path3D *path = Object::cast_to<Path3D>(p_spatial);
+ if (path) ref = Ref<PathNode3DGizmo>(memnew(PathNode3DGizmo(path)));
return ref;
}
-String PathSpatialGizmoPlugin::get_name() const {
+String PathNode3DGizmoPlugin::get_name() const {
return "Path";
}
-int PathSpatialGizmoPlugin::get_priority() const {
+int PathNode3DGizmoPlugin::get_priority() const {
return -1;
}
-PathSpatialGizmoPlugin::PathSpatialGizmoPlugin() {
+PathNode3DGizmoPlugin::PathNode3DGizmoPlugin() {
Color path_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/path", Color(0.5, 0.5, 1.0, 0.8));
create_material("path_material", path_color);
diff --git a/editor/plugins/path_editor_plugin.h b/editor/plugins/path_editor_plugin.h
index 8ff83911f8..0a27e1068e 100644
--- a/editor/plugins/path_editor_plugin.h
+++ b/editor/plugins/path_editor_plugin.h
@@ -32,13 +32,13 @@
#define PATH_EDITOR_PLUGIN_H
#include "editor/spatial_editor_gizmos.h"
-#include "scene/3d/path.h"
+#include "scene/3d/path_3d.h"
-class PathSpatialGizmo : public EditorSpatialGizmo {
+class PathNode3DGizmo : public EditorNode3DGizmo {
- GDCLASS(PathSpatialGizmo, EditorSpatialGizmo);
+ GDCLASS(PathNode3DGizmo, EditorNode3DGizmo);
- Path *path;
+ Path3D *path;
mutable Vector3 original;
mutable float orig_in_length;
mutable float orig_out_length;
@@ -46,24 +46,24 @@ class PathSpatialGizmo : public EditorSpatialGizmo {
public:
virtual String get_handle_name(int p_idx) const;
virtual Variant get_handle_value(int p_idx);
- virtual void set_handle(int p_idx, Camera *p_camera, const Point2 &p_point);
+ virtual void set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_point);
virtual void commit_handle(int p_idx, const Variant &p_restore, bool p_cancel = false);
virtual void redraw();
- PathSpatialGizmo(Path *p_path = NULL);
+ PathNode3DGizmo(Path3D *p_path = NULL);
};
-class PathSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class PathNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(PathSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(PathNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
protected:
- Ref<EditorSpatialGizmo> create_gizmo(Spatial *p_spatial);
+ Ref<EditorNode3DGizmo> create_gizmo(Node3D *p_spatial);
public:
String get_name() const;
int get_priority() const;
- PathSpatialGizmoPlugin();
+ PathNode3DGizmoPlugin();
};
class PathEditorPlugin : public EditorPlugin {
@@ -79,7 +79,7 @@ class PathEditorPlugin : public EditorPlugin {
EditorNode *editor;
- Path *path;
+ Path3D *path;
void _mode_changed(int p_idx);
void _close_curve();
@@ -98,13 +98,13 @@ protected:
static void _bind_methods();
public:
- Path *get_edited_path() { return path; }
+ Path3D *get_edited_path() { return path; }
static PathEditorPlugin *singleton;
- virtual bool forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event);
+ virtual bool forward_spatial_gui_input(Camera3D *p_camera, const Ref<InputEvent> &p_event);
//virtual bool forward_gui_input(const InputEvent& p_event) { return collision_polygon_editor->forward_gui_input(p_event); }
- //virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial *p_spatial);
+ //virtual Ref<Node3DEditorGizmo> create_spatial_gizmo(Spatial *p_spatial);
virtual String get_name() const { return "Path"; }
bool has_main_screen() const { return false; }
virtual void edit(Object *p_object);
diff --git a/editor/plugins/physical_bone_plugin.cpp b/editor/plugins/physical_bone_plugin.cpp
index ec29310029..d827472353 100644
--- a/editor/plugins/physical_bone_plugin.cpp
+++ b/editor/plugins/physical_bone_plugin.cpp
@@ -30,7 +30,7 @@
#include "physical_bone_plugin.h"
#include "editor/plugins/spatial_editor_plugin.h"
-#include "scene/3d/physics_body.h"
+#include "scene/3d/physics_body_3d.h"
void PhysicalBoneEditor::_bind_methods() {
}
@@ -53,7 +53,7 @@ PhysicalBoneEditor::PhysicalBoneEditor(EditorNode *p_editor) :
spatial_editor_hb = memnew(HBoxContainer);
spatial_editor_hb->set_h_size_flags(Control::SIZE_EXPAND_FILL);
spatial_editor_hb->set_alignment(BoxContainer::ALIGN_BEGIN);
- SpatialEditor::get_singleton()->add_control_to_menu_panel(spatial_editor_hb);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(spatial_editor_hb);
spatial_editor_hb->add_child(memnew(VSeparator));
@@ -61,7 +61,7 @@ PhysicalBoneEditor::PhysicalBoneEditor(EditorNode *p_editor) :
spatial_editor_hb->add_child(button_transform_joint);
button_transform_joint->set_text(TTR("Move Joint"));
- button_transform_joint->set_icon(SpatialEditor::get_singleton()->get_theme_icon("PhysicalBone", "EditorIcons"));
+ button_transform_joint->set_icon(Node3DEditor::get_singleton()->get_theme_icon("PhysicalBone", "EditorIcons"));
button_transform_joint->set_toggle_mode(true);
button_transform_joint->connect("toggled", callable_mp(this, &PhysicalBoneEditor::_on_toggle_button_transform_joint));
@@ -70,7 +70,7 @@ PhysicalBoneEditor::PhysicalBoneEditor(EditorNode *p_editor) :
PhysicalBoneEditor::~PhysicalBoneEditor() {}
-void PhysicalBoneEditor::set_selected(PhysicalBone *p_pb) {
+void PhysicalBoneEditor::set_selected(PhysicalBone3D *p_pb) {
button_transform_joint->set_pressed(false);
@@ -105,7 +105,7 @@ void PhysicalBonePlugin::make_visible(bool p_visible) {
}
void PhysicalBonePlugin::edit(Object *p_node) {
- selected = static_cast<PhysicalBone *>(p_node); // Trust it
+ selected = static_cast<PhysicalBone3D *>(p_node); // Trust it
ERR_FAIL_COND(!selected);
physical_bone_editor.set_selected(selected);
diff --git a/editor/plugins/physical_bone_plugin.h b/editor/plugins/physical_bone_plugin.h
index 459a67db05..0d4aa7138d 100644
--- a/editor/plugins/physical_bone_plugin.h
+++ b/editor/plugins/physical_bone_plugin.h
@@ -40,7 +40,7 @@ class PhysicalBoneEditor : public Object {
HBoxContainer *spatial_editor_hb;
ToolButton *button_transform_joint;
- PhysicalBone *selected;
+ PhysicalBone3D *selected;
protected:
static void _bind_methods();
@@ -53,7 +53,7 @@ public:
PhysicalBoneEditor(EditorNode *p_editor);
~PhysicalBoneEditor();
- void set_selected(PhysicalBone *p_pb);
+ void set_selected(PhysicalBone3D *p_pb);
void hide();
void show();
@@ -63,12 +63,12 @@ class PhysicalBonePlugin : public EditorPlugin {
GDCLASS(PhysicalBonePlugin, EditorPlugin);
EditorNode *editor;
- PhysicalBone *selected;
+ PhysicalBone3D *selected;
PhysicalBoneEditor physical_bone_editor;
public:
- virtual String get_name() const { return "PhysicalBone"; }
- virtual bool handles(Object *p_object) const { return p_object->is_class("PhysicalBone"); }
+ virtual String get_name() const { return "PhysicalBone3D"; }
+ virtual bool handles(Object *p_object) const { return p_object->is_class("PhysicalBone3D"); }
virtual void make_visible(bool p_visible);
virtual void edit(Object *p_node);
diff --git a/editor/plugins/root_motion_editor_plugin.cpp b/editor/plugins/root_motion_editor_plugin.cpp
index 0f803218ea..516c52a8a4 100644
--- a/editor/plugins/root_motion_editor_plugin.cpp
+++ b/editor/plugins/root_motion_editor_plugin.cpp
@@ -128,7 +128,7 @@ void EditorPropertyRootMotion::_node_assign() {
String concat = path.get_concatenated_subnames();
- Skeleton *skeleton = Object::cast_to<Skeleton>(node);
+ Skeleton3D *skeleton = Object::cast_to<Skeleton3D>(node);
if (skeleton && skeleton->find_bone(concat) != -1) {
//path in skeleton
const String &bone = concat;
@@ -152,7 +152,7 @@ void EditorPropertyRootMotion::_node_assign() {
ti->set_text(0, F->get());
ti->set_selectable(0, true);
ti->set_editable(0, false);
- ti->set_icon(0, get_theme_icon("BoneAttachment", "EditorIcons"));
+ ti->set_icon(0, get_theme_icon("BoneAttachment3D", "EditorIcons"));
ti->set_metadata(0, accum);
} else {
ti = parenthood[accum];
@@ -161,7 +161,7 @@ void EditorPropertyRootMotion::_node_assign() {
ti->set_selectable(0, true);
ti->set_text(0, concat);
- ti->set_icon(0, get_theme_icon("BoneAttachment", "EditorIcons"));
+ ti->set_icon(0, get_theme_icon("BoneAttachment3D", "EditorIcons"));
ti->set_metadata(0, path);
if (path == current) {
ti->select(0);
diff --git a/editor/plugins/skeleton_editor_plugin.cpp b/editor/plugins/skeleton_editor_plugin.cpp
index ac9980b79f..941461bb64 100644
--- a/editor/plugins/skeleton_editor_plugin.cpp
+++ b/editor/plugins/skeleton_editor_plugin.cpp
@@ -30,11 +30,11 @@
#include "skeleton_editor_plugin.h"
-#include "scene/3d/collision_shape.h"
-#include "scene/3d/physics_body.h"
-#include "scene/3d/physics_joint.h"
-#include "scene/resources/capsule_shape.h"
-#include "scene/resources/sphere_shape.h"
+#include "scene/3d/collision_shape_3d.h"
+#include "scene/3d/physics_body_3d.h"
+#include "scene/3d/physics_joint_3d.h"
+#include "scene/resources/capsule_shape_3d.h"
+#include "scene/resources/sphere_shape_3d.h"
#include "spatial_editor_plugin.h"
void SkeletonEditor::_on_click_option(int p_option) {
@@ -94,25 +94,25 @@ void SkeletonEditor::create_physical_skeleton() {
/// Create joint between parent of parent
if (-1 != parent_parent) {
- bones_infos[parent].physical_bone->set_joint_type(PhysicalBone::JOINT_TYPE_PIN);
+ bones_infos[parent].physical_bone->set_joint_type(PhysicalBone3D::JOINT_TYPE_PIN);
}
}
}
}
}
-PhysicalBone *SkeletonEditor::create_physical_bone(int bone_id, int bone_child_id, const Vector<BoneInfo> &bones_infos) {
+PhysicalBone3D *SkeletonEditor::create_physical_bone(int bone_id, int bone_child_id, const Vector<BoneInfo> &bones_infos) {
const Transform child_rest = skeleton->get_bone_rest(bone_child_id);
const real_t half_height(child_rest.origin.length() * 0.5);
const real_t radius(half_height * 0.2);
- CapsuleShape *bone_shape_capsule = memnew(CapsuleShape);
+ CapsuleShape3D *bone_shape_capsule = memnew(CapsuleShape3D);
bone_shape_capsule->set_height((half_height - radius) * 2);
bone_shape_capsule->set_radius(radius);
- CollisionShape *bone_shape = memnew(CollisionShape);
+ CollisionShape3D *bone_shape = memnew(CollisionShape3D);
bone_shape->set_shape(bone_shape_capsule);
Transform body_transform;
@@ -122,7 +122,7 @@ PhysicalBone *SkeletonEditor::create_physical_bone(int bone_id, int bone_child_i
Transform joint_transform;
joint_transform.origin = Vector3(0, 0, half_height);
- PhysicalBone *physical_bone = memnew(PhysicalBone);
+ PhysicalBone3D *physical_bone = memnew(PhysicalBone3D);
physical_bone->add_child(bone_shape);
physical_bone->set_name("Physical Bone " + skeleton->get_bone_name(bone_id));
physical_bone->set_body_offset(body_transform);
@@ -130,7 +130,7 @@ PhysicalBone *SkeletonEditor::create_physical_bone(int bone_id, int bone_child_i
return physical_bone;
}
-void SkeletonEditor::edit(Skeleton *p_node) {
+void SkeletonEditor::edit(Skeleton3D *p_node) {
skeleton = p_node;
}
@@ -155,10 +155,10 @@ void SkeletonEditor::_bind_methods() {
SkeletonEditor::SkeletonEditor() {
skeleton = NULL;
options = memnew(MenuButton);
- SpatialEditor::get_singleton()->add_control_to_menu_panel(options);
+ Node3DEditor::get_singleton()->add_control_to_menu_panel(options);
options->set_text(TTR("Skeleton"));
- options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Skeleton", "EditorIcons"));
+ options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_theme_icon("Skeleton3D", "EditorIcons"));
options->get_popup()->add_item(TTR("Create physical skeleton"), MENU_OPTION_CREATE_PHYSICAL_SKELETON);
@@ -169,11 +169,11 @@ SkeletonEditor::SkeletonEditor() {
SkeletonEditor::~SkeletonEditor() {}
void SkeletonEditorPlugin::edit(Object *p_object) {
- skeleton_editor->edit(Object::cast_to<Skeleton>(p_object));
+ skeleton_editor->edit(Object::cast_to<Skeleton3D>(p_object));
}
bool SkeletonEditorPlugin::handles(Object *p_object) const {
- return p_object->is_class("Skeleton");
+ return p_object->is_class("Skeleton3D");
}
void SkeletonEditorPlugin::make_visible(bool p_visible) {
diff --git a/editor/plugins/skeleton_editor_plugin.h b/editor/plugins/skeleton_editor_plugin.h
index 1dce6d12ed..91e244285d 100644
--- a/editor/plugins/skeleton_editor_plugin.h
+++ b/editor/plugins/skeleton_editor_plugin.h
@@ -33,10 +33,10 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
-#include "scene/3d/skeleton.h"
+#include "scene/3d/skeleton_3d.h"
-class PhysicalBone;
-class Joint;
+class PhysicalBone3D;
+class Joint3D;
class SkeletonEditor : public Node {
GDCLASS(SkeletonEditor, Node);
@@ -46,13 +46,13 @@ class SkeletonEditor : public Node {
};
struct BoneInfo {
- PhysicalBone *physical_bone;
+ PhysicalBone3D *physical_bone;
Transform relative_rest; // Relative to skeleton node
BoneInfo() :
physical_bone(NULL) {}
};
- Skeleton *skeleton;
+ Skeleton3D *skeleton;
MenuButton *options;
@@ -66,10 +66,10 @@ protected:
static void _bind_methods();
void create_physical_skeleton();
- PhysicalBone *create_physical_bone(int bone_id, int bone_child_id, const Vector<BoneInfo> &bones_infos);
+ PhysicalBone3D *create_physical_bone(int bone_id, int bone_child_id, const Vector<BoneInfo> &bones_infos);
public:
- void edit(Skeleton *p_node);
+ void edit(Skeleton3D *p_node);
SkeletonEditor();
~SkeletonEditor();
diff --git a/editor/plugins/skeleton_ik_editor_plugin.cpp b/editor/plugins/skeleton_ik_editor_plugin.cpp
index 8b120e9543..548cbe9470 100644
--- a/editor/plugins/skeleton_ik_editor_plugin.cpp
+++ b/editor/plugins/skeleton_ik_editor_plugin.cpp
@@ -57,7 +57,7 @@ void SkeletonIKEditorPlugin::edit(Object *p_object) {
}
}
- SkeletonIK *s = Object::cast_to<SkeletonIK>(p_object);
+ SkeletonIK3D *s = Object::cast_to<SkeletonIK3D>(p_object);
if (!s)
return;
@@ -66,7 +66,7 @@ void SkeletonIKEditorPlugin::edit(Object *p_object) {
bool SkeletonIKEditorPlugin::handles(Object *p_object) const {
- return p_object->is_class("SkeletonIK");
+ return p_object->is_class("SkeletonIK3D");
}
void SkeletonIKEditorPlugin::make_visible(bool p_visible) {
diff --git a/editor/plugins/skeleton_ik_editor_plugin.h b/editor/plugins/skeleton_ik_editor_plugin.h
index 814eb8ff5b..8895a548fe 100644
--- a/editor/plugins/skeleton_ik_editor_plugin.h
+++ b/editor/plugins/skeleton_ik_editor_plugin.h
@@ -34,13 +34,13 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
-class SkeletonIK;
+class SkeletonIK3D;
class SkeletonIKEditorPlugin : public EditorPlugin {
GDCLASS(SkeletonIKEditorPlugin, EditorPlugin);
- SkeletonIK *skeleton_ik;
+ SkeletonIK3D *skeleton_ik;
Button *play_btn;
EditorNode *editor;
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index f0730f0144..318f3d6b09 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -43,11 +43,11 @@
#include "editor/plugins/animation_player_editor_plugin.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor/spatial_editor_gizmos.h"
-#include "scene/3d/camera.h"
-#include "scene/3d/collision_shape.h"
-#include "scene/3d/mesh_instance.h"
-#include "scene/3d/physics_body.h"
-#include "scene/3d/visual_instance.h"
+#include "scene/3d/camera_3d.h"
+#include "scene/3d/collision_shape_3d.h"
+#include "scene/3d/mesh_instance_3d.h"
+#include "scene/3d/physics_body_3d.h"
+#include "scene/3d/visual_instance_3d.h"
#include "scene/gui/viewport_container.h"
#include "scene/resources/packed_scene.h"
#include "scene/resources/surface_tool.h"
@@ -81,12 +81,12 @@ void ViewportRotationControl::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
axis_menu_options.clear();
- axis_menu_options.push_back(SpatialEditorViewport::VIEW_RIGHT);
- axis_menu_options.push_back(SpatialEditorViewport::VIEW_TOP);
- axis_menu_options.push_back(SpatialEditorViewport::VIEW_FRONT);
- axis_menu_options.push_back(SpatialEditorViewport::VIEW_LEFT);
- axis_menu_options.push_back(SpatialEditorViewport::VIEW_BOTTOM);
- axis_menu_options.push_back(SpatialEditorViewport::VIEW_REAR);
+ axis_menu_options.push_back(Node3DEditorViewport::VIEW_RIGHT);
+ axis_menu_options.push_back(Node3DEditorViewport::VIEW_TOP);
+ axis_menu_options.push_back(Node3DEditorViewport::VIEW_FRONT);
+ axis_menu_options.push_back(Node3DEditorViewport::VIEW_LEFT);
+ axis_menu_options.push_back(Node3DEditorViewport::VIEW_BOTTOM);
+ axis_menu_options.push_back(Node3DEditorViewport::VIEW_REAR);
axis_colors.clear();
axis_colors.push_back(get_theme_color("axis_x_color", "Editor"));
@@ -239,7 +239,7 @@ void ViewportRotationControl::_on_mouse_exited() {
update();
}
-void ViewportRotationControl::set_viewport(SpatialEditorViewport *p_viewport) {
+void ViewportRotationControl::set_viewport(Node3DEditorViewport *p_viewport) {
viewport = p_viewport;
}
@@ -247,9 +247,9 @@ void ViewportRotationControl::_bind_methods() {
ClassDB::bind_method(D_METHOD("_gui_input"), &ViewportRotationControl::_gui_input);
}
-void SpatialEditorViewport::_update_camera(float p_interp_delta) {
+void Node3DEditorViewport::_update_camera(float p_interp_delta) {
- bool is_orthogonal = camera->get_projection() == Camera::PROJECTION_ORTHOGONAL;
+ bool is_orthogonal = camera->get_projection() == Camera3D::PROJECTION_ORTHOGONAL;
Cursor old_camera_cursor = camera_cursor;
camera_cursor = cursor;
@@ -357,7 +357,7 @@ void SpatialEditorViewport::_update_camera(float p_interp_delta) {
}
}
-Transform SpatialEditorViewport::to_camera_transform(const Cursor &p_cursor) const {
+Transform Node3DEditorViewport::to_camera_transform(const Cursor &p_cursor) const {
Transform camera_transform;
camera_transform.translate(p_cursor.pos);
camera_transform.basis.rotate(Vector3(1, 0, 0), -p_cursor.x_rot);
@@ -371,7 +371,7 @@ Transform SpatialEditorViewport::to_camera_transform(const Cursor &p_cursor) con
return camera_transform;
}
-int SpatialEditorViewport::get_selected_count() const {
+int Node3DEditorViewport::get_selected_count() const {
Map<Node *, Object *> &selection = editor_selection->get_selection();
@@ -379,11 +379,11 @@ int SpatialEditorViewport::get_selected_count() const {
for (Map<Node *, Object *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->key());
+ Node3D *sp = Object::cast_to<Node3D>(E->key());
if (!sp)
continue;
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp);
if (!se)
continue;
@@ -393,68 +393,68 @@ int SpatialEditorViewport::get_selected_count() const {
return count;
}
-float SpatialEditorViewport::get_znear() const {
+float Node3DEditorViewport::get_znear() const {
return CLAMP(spatial_editor->get_znear(), MIN_Z, MAX_Z);
}
-float SpatialEditorViewport::get_zfar() const {
+float Node3DEditorViewport::get_zfar() const {
return CLAMP(spatial_editor->get_zfar(), MIN_Z, MAX_Z);
}
-float SpatialEditorViewport::get_fov() const {
+float Node3DEditorViewport::get_fov() const {
return CLAMP(spatial_editor->get_fov(), MIN_FOV, MAX_FOV);
}
-Transform SpatialEditorViewport::_get_camera_transform() const {
+Transform Node3DEditorViewport::_get_camera_transform() const {
return camera->get_global_transform();
}
-Vector3 SpatialEditorViewport::_get_camera_position() const {
+Vector3 Node3DEditorViewport::_get_camera_position() const {
return _get_camera_transform().origin;
}
-Point2 SpatialEditorViewport::_point_to_screen(const Vector3 &p_point) {
+Point2 Node3DEditorViewport::_point_to_screen(const Vector3 &p_point) {
return camera->unproject_position(p_point) * viewport_container->get_stretch_shrink();
}
-Vector3 SpatialEditorViewport::_get_ray_pos(const Vector2 &p_pos) const {
+Vector3 Node3DEditorViewport::_get_ray_pos(const Vector2 &p_pos) const {
return camera->project_ray_origin(p_pos / viewport_container->get_stretch_shrink());
}
-Vector3 SpatialEditorViewport::_get_camera_normal() const {
+Vector3 Node3DEditorViewport::_get_camera_normal() const {
return -_get_camera_transform().basis.get_axis(2);
}
-Vector3 SpatialEditorViewport::_get_ray(const Vector2 &p_pos) const {
+Vector3 Node3DEditorViewport::_get_ray(const Vector2 &p_pos) const {
return camera->project_ray_normal(p_pos / viewport_container->get_stretch_shrink());
}
-void SpatialEditorViewport::_clear_selected() {
+void Node3DEditorViewport::_clear_selected() {
editor_selection->clear();
}
-void SpatialEditorViewport::_select_clicked(bool p_append, bool p_single, bool p_allow_locked) {
+void Node3DEditorViewport::_select_clicked(bool p_append, bool p_single, bool p_allow_locked) {
if (clicked.is_null())
return;
Node *node = Object::cast_to<Node>(ObjectDB::get_instance(clicked));
- Spatial *selected = Object::cast_to<Spatial>(node);
+ Node3D *selected = Object::cast_to<Node3D>(node);
if (!selected)
return;
if (!p_allow_locked) {
// Replace the node by the group if grouped
while (node && node != editor->get_edited_scene()->get_parent()) {
- Spatial *selected_tmp = Object::cast_to<Spatial>(node);
+ Node3D *selected_tmp = Object::cast_to<Node3D>(node);
if (selected_tmp && node->has_meta("_edit_group_")) {
selected = selected_tmp;
}
@@ -467,7 +467,7 @@ void SpatialEditorViewport::_select_clicked(bool p_append, bool p_single, bool p
}
}
-void SpatialEditorViewport::_select(Node *p_node, bool p_append, bool p_single) {
+void Node3DEditorViewport::_select(Node *p_node, bool p_append, bool p_single) {
if (!p_append) {
editor_selection->clear();
@@ -487,7 +487,7 @@ void SpatialEditorViewport::_select(Node *p_node, bool p_append, bool p_single)
}
}
-ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, bool &r_includes_current, int *r_gizmo_handle, bool p_alt_select) {
+ObjectID Node3DEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, bool &r_includes_current, int *r_gizmo_handle, bool p_alt_select) {
if (r_gizmo_handle)
*r_gizmo_handle = -1;
@@ -497,7 +497,7 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append,
Vector2 shrinked_pos = p_pos / viewport_container->get_stretch_shrink();
Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario());
- Set<Ref<EditorSpatialGizmo>> found_gizmos;
+ Set<Ref<EditorNode3DGizmo>> found_gizmos;
Node *edited_scene = get_tree()->get_edited_scene_root();
ObjectID closest;
@@ -507,12 +507,12 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append,
for (int i = 0; i < instances.size(); i++) {
- Spatial *spat = Object::cast_to<Spatial>(ObjectDB::get_instance(instances[i]));
+ Node3D *spat = Object::cast_to<Node3D>(ObjectDB::get_instance(instances[i]));
if (!spat)
continue;
- Ref<EditorSpatialGizmo> seg = spat->get_gizmo();
+ Ref<EditorNode3DGizmo> seg = spat->get_gizmo();
if ((!seg.is_valid()) || found_gizmos.has(seg)) {
continue;
@@ -558,24 +558,24 @@ ObjectID SpatialEditorViewport::_select_ray(const Point2 &p_pos, bool p_append,
return closest;
}
-void SpatialEditorViewport::_find_items_at_pos(const Point2 &p_pos, bool &r_includes_current, Vector<_RayResult> &results, bool p_alt_select) {
+void Node3DEditorViewport::_find_items_at_pos(const Point2 &p_pos, bool &r_includes_current, Vector<_RayResult> &results, bool p_alt_select) {
Vector3 ray = _get_ray(p_pos);
Vector3 pos = _get_ray_pos(p_pos);
Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario());
- Set<Ref<EditorSpatialGizmo>> found_gizmos;
+ Set<Ref<EditorNode3DGizmo>> found_gizmos;
r_includes_current = false;
for (int i = 0; i < instances.size(); i++) {
- Spatial *spat = Object::cast_to<Spatial>(ObjectDB::get_instance(instances[i]));
+ Node3D *spat = Object::cast_to<Node3D>(ObjectDB::get_instance(instances[i]));
if (!spat)
continue;
- Ref<EditorSpatialGizmo> seg = spat->get_gizmo();
+ Ref<EditorNode3DGizmo> seg = spat->get_gizmo();
if (!seg.is_valid())
continue;
@@ -614,7 +614,7 @@ void SpatialEditorViewport::_find_items_at_pos(const Point2 &p_pos, bool &r_incl
results.sort();
}
-Vector3 SpatialEditorViewport::_get_screen_to_space(const Vector3 &p_vector3) {
+Vector3 Node3DEditorViewport::_get_screen_to_space(const Vector3 &p_vector3) {
CameraMatrix cm;
if (orthogonal) {
@@ -633,7 +633,7 @@ Vector3 SpatialEditorViewport::_get_screen_to_space(const Vector3 &p_vector3) {
return camera_transform.xform(Vector3(((p_vector3.x / get_size().width) * 2.0 - 1.0) * screen_he.x, ((1.0 - (p_vector3.y / get_size().height)) * 2.0 - 1.0) * screen_he.y, -(get_znear() + p_vector3.z)));
}
-void SpatialEditorViewport::_select_region() {
+void Node3DEditorViewport::_select_region() {
if (cursor.region_begin == cursor.region_end)
return; //nothing really
@@ -693,7 +693,7 @@ void SpatialEditorViewport::_select_region() {
for (int i = 0; i < instances.size(); i++) {
- Spatial *sp = Object::cast_to<Spatial>(ObjectDB::get_instance(instances[i]));
+ Node3D *sp = Object::cast_to<Node3D>(ObjectDB::get_instance(instances[i]));
if (!sp || _is_node_locked(sp))
continue;
@@ -703,10 +703,10 @@ void SpatialEditorViewport::_select_region() {
}
// Replace the node by the group if grouped
- if (item->is_class("Spatial")) {
- Spatial *sel = Object::cast_to<Spatial>(item);
+ if (item->is_class("Node3D")) {
+ Node3D *sel = Object::cast_to<Node3D>(item);
while (item && item != editor->get_edited_scene()->get_parent()) {
- Spatial *selected_tmp = Object::cast_to<Spatial>(item);
+ Node3D *selected_tmp = Object::cast_to<Node3D>(item);
if (selected_tmp && item->has_meta("_edit_group_")) {
sel = selected_tmp;
}
@@ -719,7 +719,7 @@ void SpatialEditorViewport::_select_region() {
if (_is_node_locked(item)) continue;
- Ref<EditorSpatialGizmo> seg = sp->get_gizmo();
+ Ref<EditorNode3DGizmo> seg = sp->get_gizmo();
if (!seg.is_valid())
continue;
@@ -735,7 +735,7 @@ void SpatialEditorViewport::_select_region() {
}
}
-void SpatialEditorViewport::_update_name() {
+void Node3DEditorViewport::_update_name() {
String view_mode = orthogonal ? TTR("Orthogonal") : TTR("Perspective");
@@ -751,7 +751,7 @@ void SpatialEditorViewport::_update_name() {
view_menu->set_size(Vector2(0, 0)); // resets the button size
}
-void SpatialEditorViewport::_compute_edit(const Point2 &p_point) {
+void Node3DEditorViewport::_compute_edit(const Point2 &p_point) {
_edit.click_ray = _get_ray(Vector2(p_point.x, p_point.y));
_edit.click_ray_pos = _get_ray_pos(Vector2(p_point.x, p_point.y));
@@ -763,11 +763,11 @@ void SpatialEditorViewport::_compute_edit(const Point2 &p_point) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->get());
+ Node3D *sp = Object::cast_to<Node3D>(E->get());
if (!sp)
continue;
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp);
if (!se)
continue;
@@ -801,7 +801,7 @@ static int _get_key_modifier(Ref<InputEventWithModifiers> e) {
return 0;
}
-bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_highlight_only) {
+bool Node3DEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_highlight_only) {
if (!spatial_editor->is_gizmo_visible())
return false;
@@ -817,7 +817,7 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_hig
Transform gt = spatial_editor->get_gizmo_transform();
float gs = gizmo_scale;
- if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_MOVE) {
+ if (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE) {
int col_axis = -1;
float col_d = 1e20;
@@ -886,7 +886,7 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_hig
}
}
- if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_ROTATE) {
+ if (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE) {
int col_axis = -1;
float col_d = 1e20;
@@ -925,7 +925,7 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_hig
}
}
- if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SCALE) {
+ if (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE) {
int col_axis = -1;
float col_d = 1e20;
@@ -1000,37 +1000,37 @@ bool SpatialEditorViewport::_gizmo_select(const Vector2 &p_screenpos, bool p_hig
return false;
}
-void SpatialEditorViewport::_surface_mouse_enter() {
+void Node3DEditorViewport::_surface_mouse_enter() {
if (!surface->has_focus() && (!get_focus_owner() || !get_focus_owner()->is_text_field()))
surface->grab_focus();
}
-void SpatialEditorViewport::_surface_mouse_exit() {
+void Node3DEditorViewport::_surface_mouse_exit() {
_remove_preview();
}
-void SpatialEditorViewport::_surface_focus_enter() {
+void Node3DEditorViewport::_surface_focus_enter() {
view_menu->set_disable_shortcuts(false);
}
-void SpatialEditorViewport::_surface_focus_exit() {
+void Node3DEditorViewport::_surface_focus_exit() {
view_menu->set_disable_shortcuts(true);
}
-bool SpatialEditorViewport ::_is_node_locked(const Node *p_node) {
+bool Node3DEditorViewport ::_is_node_locked(const Node *p_node) {
return p_node->has_meta("_edit_lock_") && p_node->get_meta("_edit_lock_");
}
-void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
+void Node3DEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
_find_items_at_pos(b->get_position(), clicked_includes_current, selection_results, b->get_shift());
Node *scene = editor->get_edited_scene();
for (int i = 0; i < selection_results.size(); i++) {
- Spatial *item = selection_results[i].item;
+ Node3D *item = selection_results[i].item;
if (item != scene && item->get_owner() != scene && !scene->is_editable_instance(item->get_owner())) {
//invalid result
selection_results.remove(i);
@@ -1046,7 +1046,7 @@ void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
selection_results.clear();
if (clicked.is_valid()) {
- _select_clicked(clicked_wants_append, true, spatial_editor->get_tool_mode() != SpatialEditor::TOOL_MODE_LIST_SELECT);
+ _select_clicked(clicked_wants_append, true, spatial_editor->get_tool_mode() != Node3DEditor::TOOL_MODE_LIST_SELECT);
clicked = ObjectID();
}
@@ -1057,7 +1057,7 @@ void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
for (int i = 0; i < selection_results.size(); i++) {
- Spatial *spat = selection_results[i].item;
+ Node3D *spat = selection_results[i].item;
Ref<Texture2D> icon = EditorNode::get_singleton()->get_object_icon(spat, "Node");
@@ -1071,7 +1071,7 @@ void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
Node *node = spat;
while (node && node != ed_scene->get_parent()) {
- Spatial *selected_tmp = Object::cast_to<Spatial>(node);
+ Node3D *selected_tmp = Object::cast_to<Node3D>(node);
if (selected_tmp && node->has_meta("_edit_group_")) {
locked = 2;
}
@@ -1096,7 +1096,7 @@ void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
}
}
-void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
+void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (previewing)
return; //do NONE
@@ -1149,7 +1149,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (b->is_pressed() && _edit.gizmo.is_valid()) {
//restore
_edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_initial_value, true);
- _edit.gizmo = Ref<EditorSpatialGizmo>();
+ _edit.gizmo = Ref<EditorNode3DGizmo>();
}
if (_edit.mode == TRANSFORM_NONE && b->is_pressed()) {
@@ -1172,11 +1172,11 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->get());
+ Node3D *sp = Object::cast_to<Node3D>(E->get());
if (!sp)
continue;
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp);
if (!se)
continue;
@@ -1251,7 +1251,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
break;
}
- if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_LIST_SELECT) {
+ if (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_LIST_SELECT) {
_list_select(b);
break;
}
@@ -1271,7 +1271,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (can_select_gizmos && spatial_editor->get_selected()) {
- Ref<EditorSpatialGizmo> seg = spatial_editor->get_selected()->get_gizmo();
+ Ref<EditorNode3DGizmo> seg = spatial_editor->get_selected()->get_gizmo();
if (seg.is_valid()) {
int handle = -1;
Vector3 point;
@@ -1293,7 +1293,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
clicked = ObjectID();
clicked_includes_current = false;
- if ((spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SELECT && b->get_control()) || spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_ROTATE) {
+ if ((spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT && b->get_control()) || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE) {
/* HANDLE ROTATION */
if (get_selected_count() == 0)
@@ -1304,7 +1304,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
break;
}
- if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_MOVE) {
+ if (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE) {
if (get_selected_count() == 0)
break; //bye
@@ -1314,7 +1314,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
break;
}
- if (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SCALE) {
+ if (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE) {
if (get_selected_count() == 0)
break; //bye
@@ -1347,10 +1347,10 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (clicked.is_valid() && gizmo_handle >= 0) {
- Spatial *spa = Object::cast_to<Spatial>(ObjectDB::get_instance(clicked));
+ Node3D *spa = Object::cast_to<Node3D>(ObjectDB::get_instance(clicked));
if (spa) {
- Ref<EditorSpatialGizmo> seg = spa->get_gizmo();
+ Ref<EditorNode3DGizmo> seg = spa->get_gizmo();
if (seg.is_valid()) {
_edit.gizmo = seg;
@@ -1367,7 +1367,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (_edit.gizmo.is_valid()) {
_edit.gizmo->commit_handle(_edit.gizmo_handle, _edit.gizmo_initial_value, false);
- _edit.gizmo = Ref<EditorSpatialGizmo>();
+ _edit.gizmo = Ref<EditorNode3DGizmo>();
break;
}
if (clicked.is_valid()) {
@@ -1394,11 +1394,11 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->get());
+ Node3D *sp = Object::cast_to<Node3D>(E->get());
if (!sp)
continue;
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp);
if (!se)
continue;
@@ -1425,7 +1425,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (spatial_editor->get_selected()) {
- Ref<EditorSpatialGizmo> seg = spatial_editor->get_selected()->get_gizmo();
+ Ref<EditorNode3DGizmo> seg = spatial_editor->get_selected()->get_gizmo();
if (seg.is_valid()) {
int selected_handle = -1;
@@ -1593,12 +1593,12 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->get());
+ Node3D *sp = Object::cast_to<Node3D>(E->get());
if (!sp) {
continue;
}
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp);
if (!se) {
continue;
}
@@ -1718,12 +1718,12 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->get());
+ Node3D *sp = Object::cast_to<Node3D>(E->get());
if (!sp) {
continue;
}
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp);
if (!se) {
continue;
}
@@ -1816,11 +1816,11 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->get());
+ Node3D *sp = Object::cast_to<Node3D>(E->get());
if (!sp)
continue;
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp);
if (!se)
continue;
@@ -2054,7 +2054,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->get());
+ Node3D *sp = Object::cast_to<Node3D>(E->get());
if (!sp)
continue;
@@ -2083,7 +2083,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
accept_event();
}
-void SpatialEditorViewport::_nav_pan(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) {
+void Node3DEditorViewport::_nav_pan(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) {
const NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation/navigation_scheme").operator int();
@@ -2103,7 +2103,7 @@ void SpatialEditorViewport::_nav_pan(Ref<InputEventWithModifiers> p_event, const
cursor.pos = camera_transform.origin;
}
-void SpatialEditorViewport::_nav_zoom(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) {
+void Node3DEditorViewport::_nav_zoom(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) {
const NavigationScheme nav_scheme = (NavigationScheme)EditorSettings::get_singleton()->get("editors/3d/navigation/navigation_scheme").operator int();
@@ -2126,7 +2126,7 @@ void SpatialEditorViewport::_nav_zoom(Ref<InputEventWithModifiers> p_event, cons
}
}
-void SpatialEditorViewport::_nav_orbit(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) {
+void Node3DEditorViewport::_nav_orbit(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) {
if (lock_rotation) {
_nav_pan(p_event, p_relative);
@@ -2155,7 +2155,7 @@ void SpatialEditorViewport::_nav_orbit(Ref<InputEventWithModifiers> p_event, con
_update_name();
}
-void SpatialEditorViewport::_nav_look(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) {
+void Node3DEditorViewport::_nav_look(Ref<InputEventWithModifiers> p_event, const Vector2 &p_relative) {
if (orthogonal) {
_nav_pan(p_event, p_relative);
@@ -2195,7 +2195,7 @@ void SpatialEditorViewport::_nav_look(Ref<InputEventWithModifiers> p_event, cons
_update_name();
}
-void SpatialEditorViewport::set_freelook_active(bool active_now) {
+void Node3DEditorViewport::set_freelook_active(bool active_now) {
if (!freelook_active && active_now) {
// Sync camera cursor to cursor to "cut" interpolation jumps due to changing referential
@@ -2227,7 +2227,7 @@ void SpatialEditorViewport::set_freelook_active(bool active_now) {
freelook_active = active_now;
}
-void SpatialEditorViewport::scale_cursor_distance(real_t scale) {
+void Node3DEditorViewport::scale_cursor_distance(real_t scale) {
// Prevents zero distance which would short-circuit any scaling
if (cursor.distance < ZOOM_MIN_DISTANCE)
@@ -2242,7 +2242,7 @@ void SpatialEditorViewport::scale_cursor_distance(real_t scale) {
surface->update();
}
-void SpatialEditorViewport::scale_freelook_speed(real_t scale) {
+void Node3DEditorViewport::scale_freelook_speed(real_t scale) {
// Prevents zero distance which would short-circuit any scaling
if (freelook_speed < FREELOOK_MIN_SPEED)
@@ -2257,7 +2257,7 @@ void SpatialEditorViewport::scale_freelook_speed(real_t scale) {
surface->update();
}
-Point2i SpatialEditorViewport::_get_warped_mouse_motion(const Ref<InputEventMouseMotion> &p_ev_mouse_motion) const {
+Point2i Node3DEditorViewport::_get_warped_mouse_motion(const Ref<InputEventMouseMotion> &p_ev_mouse_motion) const {
Point2i relative;
if (bool(EDITOR_DEF("editors/3d/navigation/warped_mouse_panning", false))) {
relative = InputFilter::get_singleton()->warp_mouse_motion(p_ev_mouse_motion, surface->get_global_rect());
@@ -2281,7 +2281,7 @@ static bool is_shortcut_pressed(const String &p_path) {
return input.is_key_pressed(keycode);
}
-void SpatialEditorViewport::_update_freelook(real_t delta) {
+void Node3DEditorViewport::_update_freelook(real_t delta) {
if (!is_freelook_active()) {
return;
@@ -2326,22 +2326,22 @@ void SpatialEditorViewport::_update_freelook(real_t delta) {
cursor.eye_pos += motion;
}
-void SpatialEditorViewport::set_message(String p_message, float p_time) {
+void Node3DEditorViewport::set_message(String p_message, float p_time) {
message = p_message;
message_time = p_time;
}
-void SpatialEditorPlugin::edited_scene_changed() {
- for (uint32_t i = 0; i < SpatialEditor::VIEWPORTS_COUNT; i++) {
- SpatialEditorViewport *viewport = SpatialEditor::get_singleton()->get_editor_viewport(i);
+void Node3DEditorPlugin::edited_scene_changed() {
+ for (uint32_t i = 0; i < Node3DEditor::VIEWPORTS_COUNT; i++) {
+ Node3DEditorViewport *viewport = Node3DEditor::get_singleton()->get_editor_viewport(i);
if (viewport->is_visible()) {
viewport->notification(Control::NOTIFICATION_VISIBILITY_CHANGED);
}
}
}
-void SpatialEditorViewport::_notification(int p_what) {
+void Node3DEditorViewport::_notification(int p_what) {
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
@@ -2387,14 +2387,14 @@ void SpatialEditorViewport::_notification(int p_what) {
Node *scene_root = editor->get_scene_tree_dock()->get_editor_data()->get_edited_scene_root();
if (previewing_cinema && scene_root != NULL) {
- Camera *cam = scene_root->get_viewport()->get_camera();
+ Camera3D *cam = scene_root->get_viewport()->get_camera();
if (cam != NULL && cam != previewing) {
//then switch the viewport's camera to the scene's viewport camera
if (previewing != NULL) {
- previewing->disconnect("tree_exited", callable_mp(this, &SpatialEditorViewport::_preview_exited_scene));
+ previewing->disconnect("tree_exited", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
}
previewing = cam;
- previewing->connect("tree_exited", callable_mp(this, &SpatialEditorViewport::_preview_exited_scene));
+ previewing->connect("tree_exited", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), cam->get_camera());
surface->update();
}
@@ -2409,11 +2409,11 @@ void SpatialEditorViewport::_notification(int p_what) {
for (Map<Node *, Object *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->key());
+ Node3D *sp = Object::cast_to<Node3D>(E->key());
if (!sp)
continue;
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp);
if (!se)
continue;
@@ -2426,7 +2426,7 @@ void SpatialEditorViewport::_notification(int p_what) {
se->last_xform_dirty = false;
se->last_xform = t;
- VisualInstance *vi = Object::cast_to<VisualInstance>(sp);
+ VisualInstance3D *vi = Object::cast_to<VisualInstance3D>(sp);
se->aabb = vi ? vi->get_aabb() : _calculate_spatial_bounds(sp);
@@ -2484,7 +2484,7 @@ void SpatialEditorViewport::_notification(int p_what) {
bool show_info = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_INFORMATION));
info_label->set_visible(show_info);
- Camera *current_camera;
+ Camera3D *current_camera;
if (previewing) {
current_camera = previewing;
@@ -2538,12 +2538,12 @@ void SpatialEditorViewport::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
- surface->connect("draw", callable_mp(this, &SpatialEditorViewport::_draw));
- surface->connect("gui_input", callable_mp(this, &SpatialEditorViewport::_sinput));
- surface->connect("mouse_entered", callable_mp(this, &SpatialEditorViewport::_surface_mouse_enter));
- surface->connect("mouse_exited", callable_mp(this, &SpatialEditorViewport::_surface_mouse_exit));
- surface->connect("focus_entered", callable_mp(this, &SpatialEditorViewport::_surface_focus_enter));
- surface->connect("focus_exited", callable_mp(this, &SpatialEditorViewport::_surface_focus_exit));
+ surface->connect("draw", callable_mp(this, &Node3DEditorViewport::_draw));
+ surface->connect("gui_input", callable_mp(this, &Node3DEditorViewport::_sinput));
+ surface->connect("mouse_entered", callable_mp(this, &Node3DEditorViewport::_surface_mouse_enter));
+ surface->connect("mouse_exited", callable_mp(this, &Node3DEditorViewport::_surface_mouse_exit));
+ surface->connect("focus_entered", callable_mp(this, &Node3DEditorViewport::_surface_focus_enter));
+ surface->connect("focus_exited", callable_mp(this, &Node3DEditorViewport::_surface_focus_exit));
_init_gizmo_instance(index);
}
@@ -2556,7 +2556,7 @@ void SpatialEditorViewport::_notification(int p_what) {
if (p_what == NOTIFICATION_THEME_CHANGED) {
view_menu->set_icon(get_theme_icon("GuiTabMenu", "EditorIcons"));
- preview_camera->set_icon(get_theme_icon("Camera", "EditorIcons"));
+ preview_camera->set_icon(get_theme_icon("Camera3D", "EditorIcons"));
view_menu->add_theme_style_override("normal", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
view_menu->add_theme_style_override("hover", editor->get_gui_base()->get_theme_stylebox("Information3dViewport", "EditorStyles"));
@@ -2598,7 +2598,7 @@ static void draw_indicator_bar(Control &surface, real_t fill, Ref<Texture2D> ico
surface.draw_texture(icon, icon_pos);
}
-void SpatialEditorViewport::_draw() {
+void Node3DEditorViewport::_draw() {
EditorPluginList *over_plugin_list = EditorNode::get_singleton()->get_editor_plugins_over();
if (!over_plugin_list->empty()) {
@@ -2659,14 +2659,14 @@ void SpatialEditorViewport::_draw() {
Rect2 draw_rect;
switch (previewing->get_keep_aspect_mode()) {
- case Camera::KEEP_WIDTH: {
+ case Camera3D::KEEP_WIDTH: {
draw_rect.size = Size2(s.width, s.width / aspect);
draw_rect.position.x = 0;
draw_rect.position.y = (s.height - draw_rect.size.y) * 0.5;
} break;
- case Camera::KEEP_HEIGHT: {
+ case Camera3D::KEEP_HEIGHT: {
draw_rect.size = Size2(s.height * aspect, s.height);
draw_rect.position.y = 0;
@@ -2723,7 +2723,7 @@ void SpatialEditorViewport::_draw() {
}
}
-void SpatialEditorViewport::_menu_option(int p_option) {
+void Node3DEditorViewport::_menu_option(int p_option) {
switch (p_option) {
@@ -2810,11 +2810,11 @@ void SpatialEditorViewport::_menu_option(int p_option) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->get());
+ Node3D *sp = Object::cast_to<Node3D>(E->get());
if (!sp)
continue;
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp);
if (!se)
continue;
@@ -2846,11 +2846,11 @@ void SpatialEditorViewport::_menu_option(int p_option) {
undo_redo->create_action(TTR("Align Rotation with View"));
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->get());
+ Node3D *sp = Object::cast_to<Node3D>(E->get());
if (!sp)
continue;
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp);
if (!se)
continue;
@@ -2870,7 +2870,7 @@ void SpatialEditorViewport::_menu_option(int p_option) {
camera->set_environment(RES());
} else {
- camera->set_environment(SpatialEditor::get_singleton()->get_viewport_environment());
+ camera->set_environment(Node3DEditor::get_singleton()->get_viewport_environment());
}
view_menu->get_popup()->set_item_checked(idx, current);
@@ -2934,7 +2934,7 @@ void SpatialEditorViewport::_menu_option(int p_option) {
int idx = view_menu->get_popup()->get_item_index(VIEW_AUDIO_DOPPLER);
bool current = view_menu->get_popup()->is_item_checked(idx);
current = !current;
- camera->set_doppler_tracking(current ? Camera::DOPPLER_TRACKING_IDLE_STEP : Camera::DOPPLER_TRACKING_DISABLED);
+ camera->set_doppler_tracking(current ? Camera3D::DOPPLER_TRACKING_IDLE_STEP : Camera3D::DOPPLER_TRACKING_DISABLED);
view_menu->get_popup()->set_item_checked(idx, current);
} break;
@@ -3061,23 +3061,23 @@ void SpatialEditorViewport::_menu_option(int p_option) {
}
}
-void SpatialEditorViewport::_set_auto_orthogonal() {
+void Node3DEditorViewport::_set_auto_orthogonal() {
if (!orthogonal && view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_AUTO_ORTHOGONAL))) {
_menu_option(VIEW_ORTHOGONAL);
auto_orthogonal = true;
}
}
-void SpatialEditorViewport::_preview_exited_scene() {
+void Node3DEditorViewport::_preview_exited_scene() {
- preview_camera->disconnect("toggled", callable_mp(this, &SpatialEditorViewport::_toggle_camera_preview));
+ preview_camera->disconnect("toggled", callable_mp(this, &Node3DEditorViewport::_toggle_camera_preview));
preview_camera->set_pressed(false);
_toggle_camera_preview(false);
- preview_camera->connect("toggled", callable_mp(this, &SpatialEditorViewport::_toggle_camera_preview));
+ preview_camera->connect("toggled", callable_mp(this, &Node3DEditorViewport::_toggle_camera_preview));
view_menu->show();
}
-void SpatialEditorViewport::_init_gizmo_instance(int p_idx) {
+void Node3DEditorViewport::_init_gizmo_instance(int p_idx) {
uint32_t layer = 1 << (GIZMO_BASE_LAYER + p_idx);
@@ -3119,7 +3119,7 @@ void SpatialEditorViewport::_init_gizmo_instance(int p_idx) {
}
}
-void SpatialEditorViewport::_finish_gizmo_instances() {
+void Node3DEditorViewport::_finish_gizmo_instances() {
for (int i = 0; i < 3; i++) {
VS::get_singleton()->free(move_gizmo_instance[i]);
@@ -3129,14 +3129,14 @@ void SpatialEditorViewport::_finish_gizmo_instances() {
VS::get_singleton()->free(scale_plane_gizmo_instance[i]);
}
}
-void SpatialEditorViewport::_toggle_camera_preview(bool p_activate) {
+void Node3DEditorViewport::_toggle_camera_preview(bool p_activate) {
ERR_FAIL_COND(p_activate && !preview);
ERR_FAIL_COND(!p_activate && !previewing);
if (!p_activate) {
- previewing->disconnect("tree_exiting", callable_mp(this, &SpatialEditorViewport::_preview_exited_scene));
+ previewing->disconnect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
previewing = NULL;
VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore
if (!preview)
@@ -3147,18 +3147,18 @@ void SpatialEditorViewport::_toggle_camera_preview(bool p_activate) {
} else {
previewing = preview;
- previewing->connect("tree_exiting", callable_mp(this, &SpatialEditorViewport::_preview_exited_scene));
+ previewing->connect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), preview->get_camera()); //replace
view_menu->set_disabled(true);
surface->update();
}
}
-void SpatialEditorViewport::_toggle_cinema_preview(bool p_activate) {
+void Node3DEditorViewport::_toggle_cinema_preview(bool p_activate) {
previewing_cinema = p_activate;
if (!previewing_cinema) {
if (previewing != NULL)
- previewing->disconnect("tree_exited", callable_mp(this, &SpatialEditorViewport::_preview_exited_scene));
+ previewing->disconnect("tree_exited", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
previewing = NULL;
VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore
@@ -3173,7 +3173,7 @@ void SpatialEditorViewport::_toggle_cinema_preview(bool p_activate) {
}
}
-void SpatialEditorViewport::_selection_result_pressed(int p_result) {
+void Node3DEditorViewport::_selection_result_pressed(int p_result) {
if (selection_results.size() <= p_result)
return;
@@ -3181,19 +3181,19 @@ void SpatialEditorViewport::_selection_result_pressed(int p_result) {
clicked = selection_results[p_result].item->get_instance_id();
if (clicked.is_valid()) {
- _select_clicked(clicked_wants_append, true, spatial_editor->get_tool_mode() != SpatialEditor::TOOL_MODE_LIST_SELECT);
+ _select_clicked(clicked_wants_append, true, spatial_editor->get_tool_mode() != Node3DEditor::TOOL_MODE_LIST_SELECT);
clicked = ObjectID();
}
}
-void SpatialEditorViewport::_selection_menu_hide() {
+void Node3DEditorViewport::_selection_menu_hide() {
selection_results.clear();
selection_menu->clear();
selection_menu->set_size(Vector2(0, 0));
}
-void SpatialEditorViewport::set_can_preview(Camera *p_preview) {
+void Node3DEditorViewport::set_can_preview(Camera3D *p_preview) {
preview = p_preview;
@@ -3201,7 +3201,7 @@ void SpatialEditorViewport::set_can_preview(Camera *p_preview) {
preview_camera->set_visible(p_preview);
}
-void SpatialEditorViewport::update_transform_gizmo_view() {
+void Node3DEditorViewport::update_transform_gizmo_view() {
if (!is_visible_in_tree())
return;
@@ -3245,19 +3245,19 @@ void SpatialEditorViewport::update_transform_gizmo_view() {
for (int i = 0; i < 3; i++) {
VisualServer::get_singleton()->instance_set_transform(move_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_MOVE));
+ VisualServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE));
VisualServer::get_singleton()->instance_set_transform(move_plane_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_MOVE));
+ VisualServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE));
VisualServer::get_singleton()->instance_set_transform(rotate_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_ROTATE));
+ VisualServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE));
VisualServer::get_singleton()->instance_set_transform(scale_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SCALE));
+ VisualServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE));
VisualServer::get_singleton()->instance_set_transform(scale_plane_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == SpatialEditor::TOOL_MODE_SCALE));
+ VisualServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE));
}
}
-void SpatialEditorViewport::set_state(const Dictionary &p_state) {
+void Node3DEditorViewport::set_state(const Dictionary &p_state) {
if (p_state.has("position"))
cursor.pos = p_state["position"];
@@ -3318,7 +3318,7 @@ void SpatialEditorViewport::set_state(const Dictionary &p_state) {
bool doppler = p_state["doppler"];
int idx = view_menu->get_popup()->get_item_index(VIEW_AUDIO_DOPPLER);
- camera->set_doppler_tracking(doppler ? Camera::DOPPLER_TRACKING_IDLE_STEP : Camera::DOPPLER_TRACKING_DISABLED);
+ camera->set_doppler_tracking(doppler ? Camera3D::DOPPLER_TRACKING_IDLE_STEP : Camera3D::DOPPLER_TRACKING_DISABLED);
view_menu->get_popup()->set_item_checked(idx, doppler);
}
if (p_state.has("gizmos")) {
@@ -3355,14 +3355,14 @@ void SpatialEditorViewport::set_state(const Dictionary &p_state) {
view_menu->get_popup()->set_item_checked(idx, previewing_cinema);
}
- if (preview_camera->is_connected("toggled", callable_mp(this, &SpatialEditorViewport::_toggle_camera_preview))) {
- preview_camera->disconnect("toggled", callable_mp(this, &SpatialEditorViewport::_toggle_camera_preview));
+ if (preview_camera->is_connected("toggled", callable_mp(this, &Node3DEditorViewport::_toggle_camera_preview))) {
+ preview_camera->disconnect("toggled", callable_mp(this, &Node3DEditorViewport::_toggle_camera_preview));
}
if (p_state.has("previewing")) {
Node *pv = EditorNode::get_singleton()->get_edited_scene()->get_node(p_state["previewing"]);
- if (Object::cast_to<Camera>(pv)) {
- previewing = Object::cast_to<Camera>(pv);
- previewing->connect("tree_exiting", callable_mp(this, &SpatialEditorViewport::_preview_exited_scene));
+ if (Object::cast_to<Camera3D>(pv)) {
+ previewing = Object::cast_to<Camera3D>(pv);
+ previewing->connect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), previewing->get_camera()); //replace
view_menu->set_disabled(true);
surface->update();
@@ -3370,10 +3370,10 @@ void SpatialEditorViewport::set_state(const Dictionary &p_state) {
preview_camera->show();
}
}
- preview_camera->connect("toggled", callable_mp(this, &SpatialEditorViewport::_toggle_camera_preview));
+ preview_camera->connect("toggled", callable_mp(this, &Node3DEditorViewport::_toggle_camera_preview));
}
-Dictionary SpatialEditorViewport::get_state() const {
+Dictionary Node3DEditorViewport::get_state() const {
Dictionary d;
d["position"] = cursor.pos;
@@ -3381,7 +3381,7 @@ Dictionary SpatialEditorViewport::get_state() const {
d["y_rotation"] = cursor.y_rot;
d["distance"] = cursor.distance;
d["use_environment"] = camera->get_environment().is_valid();
- d["use_orthogonal"] = camera->get_projection() == Camera::PROJECTION_ORTHOGONAL;
+ d["use_orthogonal"] = camera->get_projection() == Camera3D::PROJECTION_ORTHOGONAL;
d["view_name"] = name;
d["auto_orthogonal"] = auto_orthogonal;
d["auto_orthogonal_enabled"] = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_AUTO_ORTHOGONAL));
@@ -3408,17 +3408,17 @@ Dictionary SpatialEditorViewport::get_state() const {
return d;
}
-void SpatialEditorViewport::_bind_methods() {
+void Node3DEditorViewport::_bind_methods() {
- ClassDB::bind_method(D_METHOD("update_transform_gizmo_view"), &SpatialEditorViewport::update_transform_gizmo_view); // Used by call_deferred.
- ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &SpatialEditorViewport::can_drop_data_fw);
- ClassDB::bind_method(D_METHOD("drop_data_fw"), &SpatialEditorViewport::drop_data_fw);
+ ClassDB::bind_method(D_METHOD("update_transform_gizmo_view"), &Node3DEditorViewport::update_transform_gizmo_view); // Used by call_deferred.
+ ClassDB::bind_method(D_METHOD("can_drop_data_fw"), &Node3DEditorViewport::can_drop_data_fw);
+ ClassDB::bind_method(D_METHOD("drop_data_fw"), &Node3DEditorViewport::drop_data_fw);
ADD_SIGNAL(MethodInfo("toggle_maximize_view", PropertyInfo(Variant::OBJECT, "viewport")));
ADD_SIGNAL(MethodInfo("clicked", PropertyInfo(Variant::OBJECT, "viewport")));
}
-void SpatialEditorViewport::reset() {
+void Node3DEditorViewport::reset() {
orthogonal = false;
auto_orthogonal = false;
@@ -3436,7 +3436,7 @@ void SpatialEditorViewport::reset() {
_update_name();
}
-void SpatialEditorViewport::focus_selection() {
+void Node3DEditorViewport::focus_selection() {
if (!get_selected_count())
return;
@@ -3447,11 +3447,11 @@ void SpatialEditorViewport::focus_selection() {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->get());
+ Node3D *sp = Object::cast_to<Node3D>(E->get());
if (!sp)
continue;
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp);
if (!se)
continue;
@@ -3466,20 +3466,20 @@ void SpatialEditorViewport::focus_selection() {
cursor.pos = center;
}
-void SpatialEditorViewport::assign_pending_data_pointers(Spatial *p_preview_node, AABB *p_preview_bounds, AcceptDialog *p_accept) {
+void Node3DEditorViewport::assign_pending_data_pointers(Node3D *p_preview_node, AABB *p_preview_bounds, AcceptDialog *p_accept) {
preview_node = p_preview_node;
preview_bounds = p_preview_bounds;
accept = p_accept;
}
-Vector3 SpatialEditorViewport::_get_instance_position(const Point2 &p_pos) const {
+Vector3 Node3DEditorViewport::_get_instance_position(const Point2 &p_pos) const {
const float MAX_DISTANCE = 10;
Vector3 world_ray = _get_ray(p_pos);
Vector3 world_pos = _get_ray_pos(p_pos);
Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(world_pos, world_ray, get_tree()->get_root()->get_world()->get_scenario());
- Set<Ref<EditorSpatialGizmo>> found_gizmos;
+ Set<Ref<EditorNode3DGizmo>> found_gizmos;
float closest_dist = MAX_DISTANCE;
@@ -3488,12 +3488,12 @@ Vector3 SpatialEditorViewport::_get_instance_position(const Point2 &p_pos) const
for (int i = 0; i < instances.size(); i++) {
- MeshInstance *mesh_instance = Object::cast_to<MeshInstance>(ObjectDB::get_instance(instances[i]));
+ MeshInstance3D *mesh_instance = Object::cast_to<MeshInstance3D>(ObjectDB::get_instance(instances[i]));
if (!mesh_instance)
continue;
- Ref<EditorSpatialGizmo> seg = mesh_instance->get_gizmo();
+ Ref<EditorNode3DGizmo> seg = mesh_instance->get_gizmo();
if ((!seg.is_valid()) || found_gizmos.has(seg)) {
continue;
@@ -3529,20 +3529,20 @@ Vector3 SpatialEditorViewport::_get_instance_position(const Point2 &p_pos) const
return point + offset;
}
-AABB SpatialEditorViewport::_calculate_spatial_bounds(const Spatial *p_parent, bool p_exclude_toplevel_transform) {
+AABB Node3DEditorViewport::_calculate_spatial_bounds(const Node3D *p_parent, bool p_exclude_toplevel_transform) {
AABB bounds;
- const MeshInstance *mesh_instance = Object::cast_to<MeshInstance>(p_parent);
+ const MeshInstance3D *mesh_instance = Object::cast_to<MeshInstance3D>(p_parent);
if (mesh_instance) {
bounds = mesh_instance->get_aabb();
}
for (int i = 0; i < p_parent->get_child_count(); i++) {
- Spatial *child = Object::cast_to<Spatial>(p_parent->get_child(i));
+ Node3D *child = Object::cast_to<Node3D>(p_parent->get_child(i));
if (child) {
AABB child_bounds = _calculate_spatial_bounds(child, false);
- if (bounds.size == Vector3() && p_parent->get_class_name() == StringName("Spatial")) {
+ if (bounds.size == Vector3() && p_parent->get_class_name() == StringName("Node3D")) {
bounds = child_bounds;
} else {
bounds.merge_with(child_bounds);
@@ -3550,7 +3550,7 @@ AABB SpatialEditorViewport::_calculate_spatial_bounds(const Spatial *p_parent, b
}
}
- if (bounds.size == Vector3() && p_parent->get_class_name() != StringName("Spatial")) {
+ if (bounds.size == Vector3() && p_parent->get_class_name() != StringName("Node3D")) {
bounds = AABB(Vector3(-0.2, -0.2, -0.2), Vector3(0.4, 0.4, 0.4));
}
@@ -3561,7 +3561,7 @@ AABB SpatialEditorViewport::_calculate_spatial_bounds(const Spatial *p_parent, b
return bounds;
}
-void SpatialEditorViewport::_create_preview(const Vector<String> &files) const {
+void Node3DEditorViewport::_create_preview(const Vector<String> &files) const {
for (int i = 0; i < files.size(); i++) {
String path = files[i];
RES res = ResourceLoader::load(path);
@@ -3570,7 +3570,7 @@ void SpatialEditorViewport::_create_preview(const Vector<String> &files) const {
Ref<Mesh> mesh = Ref<Mesh>(Object::cast_to<Mesh>(*res));
if (mesh != NULL || scene != NULL) {
if (mesh != NULL) {
- MeshInstance *mesh_instance = memnew(MeshInstance);
+ MeshInstance3D *mesh_instance = memnew(MeshInstance3D);
mesh_instance->set_mesh(mesh);
preview_node->add_child(mesh_instance);
} else {
@@ -3587,7 +3587,7 @@ void SpatialEditorViewport::_create_preview(const Vector<String> &files) const {
*preview_bounds = _calculate_spatial_bounds(preview_node);
}
-void SpatialEditorViewport::_remove_preview() {
+void Node3DEditorViewport::_remove_preview() {
if (preview_node->get_parent()) {
for (int i = preview_node->get_child_count() - 1; i >= 0; i--) {
Node *node = preview_node->get_child(i);
@@ -3598,7 +3598,7 @@ void SpatialEditorViewport::_remove_preview() {
}
}
-bool SpatialEditorViewport::_cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node) {
+bool Node3DEditorViewport::_cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node) {
if (p_desired_node->get_filename() == p_target_scene_path) {
return true;
}
@@ -3613,7 +3613,7 @@ bool SpatialEditorViewport::_cyclical_dependency_exists(const String &p_target_s
return false;
}
-bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const Point2 &p_point) {
+bool Node3DEditorViewport::_create_instance(Node *parent, String &path, const Point2 &p_point) {
RES res = ResourceLoader::load(path);
ERR_FAIL_COND_V(res.is_null(), false);
@@ -3624,7 +3624,7 @@ bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const P
if (mesh != NULL || scene != NULL) {
if (mesh != NULL) {
- MeshInstance *mesh_instance = memnew(MeshInstance);
+ MeshInstance3D *mesh_instance = memnew(MeshInstance3D);
mesh_instance->set_mesh(mesh);
mesh_instance->set_name(path.get_file().get_basename());
instanced_scene = mesh_instance;
@@ -3663,7 +3663,7 @@ bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const P
editor_data->get_undo_redo().add_undo_method(ed, "live_debug_remove_node", NodePath(String(editor->get_edited_scene()->get_path_to(parent)) + "/" + new_name));
Transform global_transform;
- Spatial *parent_spatial = Object::cast_to<Spatial>(parent);
+ Node3D *parent_spatial = Object::cast_to<Node3D>(parent);
if (parent_spatial)
global_transform = parent_spatial->get_global_gizmo_transform();
@@ -3674,7 +3674,7 @@ bool SpatialEditorViewport::_create_instance(Node *parent, String &path, const P
return true;
}
-void SpatialEditorViewport::_perform_drop_data() {
+void Node3DEditorViewport::_perform_drop_data() {
_remove_preview();
Vector<String> error_files;
@@ -3710,7 +3710,7 @@ void SpatialEditorViewport::_perform_drop_data() {
}
}
-bool SpatialEditorViewport::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const {
+bool Node3DEditorViewport::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const {
bool can_instance = false;
@@ -3767,7 +3767,7 @@ bool SpatialEditorViewport::can_drop_data_fw(const Point2 &p_point, const Varian
return can_instance;
}
-void SpatialEditorViewport::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
+void Node3DEditorViewport::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
if (!can_drop_data_fw(p_point, p_data, p_from))
return;
@@ -3807,7 +3807,7 @@ void SpatialEditorViewport::drop_data_fw(const Point2 &p_point, const Variant &p
_perform_drop_data();
}
-SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, EditorNode *p_editor, int p_index) {
+Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, EditorNode *p_editor, int p_index) {
_edit.mode = TRANSFORM_NONE;
_edit.plane = TRANSFORM_VIEW;
@@ -3843,7 +3843,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
add_child(surface);
surface->set_anchors_and_margins_preset(Control::PRESET_WIDE);
surface->set_clip_contents(true);
- camera = memnew(Camera);
+ camera = memnew(Camera3D);
camera->set_disable_gizmo(true);
camera->set_cull_mask(((1 << 20) - 1) | (1 << (GIZMO_BASE_LAYER + p_index)) | (1 << GIZMO_EDIT_LAYER) | (1 << GIZMO_GRID_LAYER));
viewport->add_child(camera);
@@ -3924,8 +3924,8 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/focus_selection"), VIEW_CENTER_TO_SELECTION);
view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/align_transform_with_view"), VIEW_ALIGN_TRANSFORM_WITH_VIEW);
view_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("spatial_editor/align_rotation_with_view"), VIEW_ALIGN_ROTATION_WITH_VIEW);
- view_menu->get_popup()->connect("id_pressed", callable_mp(this, &SpatialEditorViewport::_menu_option));
- display_submenu->connect("id_pressed", callable_mp(this, &SpatialEditorViewport::_menu_option));
+ view_menu->get_popup()->connect("id_pressed", callable_mp(this, &Node3DEditorViewport::_menu_option));
+ display_submenu->connect("id_pressed", callable_mp(this, &Node3DEditorViewport::_menu_option));
view_menu->set_disable_shortcuts(true);
#ifndef _MSC_VER
#warning this needs to be fixed
@@ -3963,7 +3963,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
vbox->add_child(preview_camera);
preview_camera->set_h_size_flags(0);
preview_camera->hide();
- preview_camera->connect("toggled", callable_mp(this, &SpatialEditorViewport::_toggle_camera_preview));
+ preview_camera->connect("toggled", callable_mp(this, &Node3DEditorViewport::_toggle_camera_preview));
previewing = NULL;
gizmo_scale = 1.0;
@@ -4038,8 +4038,8 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
selection_menu = memnew(PopupMenu);
add_child(selection_menu);
selection_menu->set_min_size(Size2(100, 0) * EDSCALE);
- selection_menu->connect("id_pressed", callable_mp(this, &SpatialEditorViewport::_selection_result_pressed));
- selection_menu->connect("popup_hide", callable_mp(this, &SpatialEditorViewport::_selection_menu_hide));
+ selection_menu->connect("id_pressed", callable_mp(this, &Node3DEditorViewport::_selection_result_pressed));
+ selection_menu->connect("popup_hide", callable_mp(this, &Node3DEditorViewport::_selection_menu_hide));
if (p_index == 0) {
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_AUDIO_LISTENER), true);
@@ -4049,12 +4049,12 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
name = "";
_update_name();
- EditorSettings::get_singleton()->connect("settings_changed", callable_mp(this, &SpatialEditorViewport::update_transform_gizmo_view));
+ EditorSettings::get_singleton()->connect("settings_changed", callable_mp(this, &Node3DEditorViewport::update_transform_gizmo_view));
}
//////////////////////////////////////////////////////////////
-void SpatialEditorViewportContainer::_gui_input(const Ref<InputEvent> &p_event) {
+void Node3DEditorViewportContainer::_gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventMouseButton> mb = p_event;
@@ -4147,7 +4147,7 @@ void SpatialEditorViewportContainer::_gui_input(const Ref<InputEvent> &p_event)
}
}
-void SpatialEditorViewportContainer::_notification(int p_what) {
+void Node3DEditorViewportContainer::_notification(int p_what) {
if (p_what == NOTIFICATION_MOUSE_ENTER || p_what == NOTIFICATION_MOUSE_EXIT) {
@@ -4243,10 +4243,10 @@ void SpatialEditorViewportContainer::_notification(int p_what) {
if (p_what == NOTIFICATION_SORT_CHILDREN) {
- SpatialEditorViewport *viewports[4];
+ Node3DEditorViewport *viewports[4];
int vc = 0;
for (int i = 0; i < get_child_count(); i++) {
- viewports[vc] = Object::cast_to<SpatialEditorViewport>(get_child(i));
+ viewports[vc] = Object::cast_to<Node3DEditorViewport>(get_child(i));
if (viewports[vc]) {
vc++;
}
@@ -4362,23 +4362,23 @@ void SpatialEditorViewportContainer::_notification(int p_what) {
}
}
-void SpatialEditorViewportContainer::set_view(View p_view) {
+void Node3DEditorViewportContainer::set_view(View p_view) {
view = p_view;
queue_sort();
}
-SpatialEditorViewportContainer::View SpatialEditorViewportContainer::get_view() {
+Node3DEditorViewportContainer::View Node3DEditorViewportContainer::get_view() {
return view;
}
-void SpatialEditorViewportContainer::_bind_methods() {
+void Node3DEditorViewportContainer::_bind_methods() {
- ClassDB::bind_method("_gui_input", &SpatialEditorViewportContainer::_gui_input);
+ ClassDB::bind_method("_gui_input", &Node3DEditorViewportContainer::_gui_input);
}
-SpatialEditorViewportContainer::SpatialEditorViewportContainer() {
+Node3DEditorViewportContainer::Node3DEditorViewportContainer() {
set_clip_contents(true);
view = VIEW_USE_1_VIEWPORT;
@@ -4393,15 +4393,15 @@ SpatialEditorViewportContainer::SpatialEditorViewportContainer() {
///////////////////////////////////////////////////////////////////
-SpatialEditor *SpatialEditor::singleton = NULL;
+Node3DEditor *Node3DEditor::singleton = NULL;
-SpatialEditorSelectedItem::~SpatialEditorSelectedItem() {
+Node3DEditorSelectedItem::~Node3DEditorSelectedItem() {
if (sbox_instance.is_valid())
VisualServer::get_singleton()->free(sbox_instance);
}
-void SpatialEditor::select_gizmo_highlight_axis(int p_axis) {
+void Node3DEditor::select_gizmo_highlight_axis(int p_axis) {
for (int i = 0; i < 3; i++) {
@@ -4413,7 +4413,7 @@ void SpatialEditor::select_gizmo_highlight_axis(int p_axis) {
}
}
-void SpatialEditor::update_transform_gizmo() {
+void Node3DEditor::update_transform_gizmo() {
List<Node *> &selection = editor_selection->get_selected_node_list();
AABB center;
@@ -4424,11 +4424,11 @@ void SpatialEditor::update_transform_gizmo() {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->get());
+ Node3D *sp = Object::cast_to<Node3D>(E->get());
if (!sp)
continue;
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp);
if (!se)
continue;
@@ -4459,7 +4459,7 @@ void SpatialEditor::update_transform_gizmo() {
void _update_all_gizmos(Node *p_node) {
for (int i = p_node->get_child_count() - 1; 0 <= i; --i) {
- Spatial *spatial_node = Object::cast_to<Spatial>(p_node->get_child(i));
+ Node3D *spatial_node = Object::cast_to<Node3D>(p_node->get_child(i));
if (spatial_node) {
spatial_node->update_gizmo();
}
@@ -4468,20 +4468,20 @@ void _update_all_gizmos(Node *p_node) {
}
}
-void SpatialEditor::update_all_gizmos(Node *p_node) {
+void Node3DEditor::update_all_gizmos(Node *p_node) {
if (!p_node) {
p_node = SceneTree::get_singleton()->get_root();
}
_update_all_gizmos(p_node);
}
-Object *SpatialEditor::_get_editor_data(Object *p_what) {
+Object *Node3DEditor::_get_editor_data(Object *p_what) {
- Spatial *sp = Object::cast_to<Spatial>(p_what);
+ Node3D *sp = Object::cast_to<Node3D>(p_what);
if (!sp)
return NULL;
- SpatialEditorSelectedItem *si = memnew(SpatialEditorSelectedItem);
+ Node3DEditorSelectedItem *si = memnew(Node3DEditorSelectedItem);
si->sp = sp;
si->sbox_instance = VisualServer::get_singleton()->instance_create2(selection_box->get_rid(), sp->get_world()->get_scenario());
@@ -4490,7 +4490,7 @@ Object *SpatialEditor::_get_editor_data(Object *p_what) {
return si;
}
-void SpatialEditor::_generate_selection_box() {
+void Node3DEditor::_generate_selection_box() {
AABB aabb(Vector3(), Vector3(1, 1, 1));
aabb.grow_by(aabb.get_longest_axis_size() / 20.0);
@@ -4524,7 +4524,7 @@ void SpatialEditor::_generate_selection_box() {
selection_box = st->commit();
}
-Dictionary SpatialEditor::get_state() const {
+Dictionary Node3DEditor::get_state() const {
Dictionary d;
@@ -4575,7 +4575,7 @@ Dictionary SpatialEditor::get_state() const {
return d;
}
-void SpatialEditor::set_state(const Dictionary &p_state) {
+void Node3DEditor::set_state(const Dictionary &p_state) {
Dictionary d = p_state;
@@ -4660,7 +4660,7 @@ void SpatialEditor::set_state(const Dictionary &p_state) {
for (int j = 0; j < gizmo_plugins_by_name.size(); ++j) {
if (!gizmo_plugins_by_name[j]->can_be_hidden()) continue;
- int state = EditorSpatialGizmoPlugin::VISIBLE;
+ int state = EditorNode3DGizmoPlugin::VISIBLE;
for (int i = 0; i < keys.size(); i++) {
if (gizmo_plugins_by_name.write[j]->get_name() == keys[i]) {
state = gizmos_status[keys[i]];
@@ -4674,12 +4674,12 @@ void SpatialEditor::set_state(const Dictionary &p_state) {
}
}
-void SpatialEditor::edit(Spatial *p_spatial) {
+void Node3DEditor::edit(Node3D *p_spatial) {
if (p_spatial != selected) {
if (selected) {
- Ref<EditorSpatialGizmo> seg = selected->get_gizmo();
+ Ref<EditorNode3DGizmo> seg = selected->get_gizmo();
if (seg.is_valid()) {
seg->set_selected(false);
selected->update_gizmo();
@@ -4691,7 +4691,7 @@ void SpatialEditor::edit(Spatial *p_spatial) {
if (selected) {
- Ref<EditorSpatialGizmo> seg = selected->get_gizmo();
+ Ref<EditorNode3DGizmo> seg = selected->get_gizmo();
if (seg.is_valid()) {
seg->set_selected(true);
selected->update_gizmo();
@@ -4700,21 +4700,21 @@ void SpatialEditor::edit(Spatial *p_spatial) {
}
}
-void SpatialEditor::_snap_changed() {
+void Node3DEditor::_snap_changed() {
snap_translate_value = snap_translate->get_text().to_double();
snap_rotate_value = snap_rotate->get_text().to_double();
snap_scale_value = snap_scale->get_text().to_double();
}
-void SpatialEditor::_snap_update() {
+void Node3DEditor::_snap_update() {
snap_translate->set_text(String::num(snap_translate_value));
snap_rotate->set_text(String::num(snap_rotate_value));
snap_scale->set_text(String::num(snap_scale_value));
}
-void SpatialEditor::_xform_dialog_action() {
+void Node3DEditor::_xform_dialog_action() {
Transform t;
//translation
@@ -4738,11 +4738,11 @@ void SpatialEditor::_xform_dialog_action() {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->get());
+ Node3D *sp = Object::cast_to<Node3D>(E->get());
if (!sp)
continue;
- SpatialEditorSelectedItem *se = editor_selection->get_node_editor_data<SpatialEditorSelectedItem>(sp);
+ Node3DEditorSelectedItem *se = editor_selection->get_node_editor_data<Node3DEditorSelectedItem>(sp);
if (!se)
continue;
@@ -4763,7 +4763,7 @@ void SpatialEditor::_xform_dialog_action() {
undo_redo->commit_action();
}
-void SpatialEditor::_menu_item_toggled(bool pressed, int p_option) {
+void Node3DEditor::_menu_item_toggled(bool pressed, int p_option) {
switch (p_option) {
case MENU_TOOL_LOCAL_COORDS: {
@@ -4792,7 +4792,7 @@ void SpatialEditor::_menu_item_toggled(bool pressed, int p_option) {
}
}
-void SpatialEditor::_menu_gizmo_toggled(int p_option) {
+void Node3DEditor::_menu_gizmo_toggled(int p_option) {
const int idx = gizmos_menu->get_item_index(p_option);
gizmos_menu->toggle_item_multistate(idx);
@@ -4800,13 +4800,13 @@ void SpatialEditor::_menu_gizmo_toggled(int p_option) {
// Change icon
const int state = gizmos_menu->get_item_state(idx);
switch (state) {
- case EditorSpatialGizmoPlugin::VISIBLE:
+ case EditorNode3DGizmoPlugin::VISIBLE:
gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_theme_icon("visibility_visible"));
break;
- case EditorSpatialGizmoPlugin::ON_TOP:
+ case EditorNode3DGizmoPlugin::ON_TOP:
gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_theme_icon("visibility_xray"));
break;
- case EditorSpatialGizmoPlugin::HIDDEN:
+ case EditorNode3DGizmoPlugin::HIDDEN:
gizmos_menu->set_item_icon(idx, view_menu->get_popup()->get_theme_icon("visibility_hidden"));
break;
}
@@ -4816,7 +4816,7 @@ void SpatialEditor::_menu_gizmo_toggled(int p_option) {
update_all_gizmos();
}
-void SpatialEditor::_update_camera_override_button(bool p_game_running) {
+void Node3DEditor::_update_camera_override_button(bool p_game_running) {
Button *const button = tool_option_button[TOOL_OPT_OVERRIDE_CAMERA];
if (p_game_running) {
@@ -4829,8 +4829,8 @@ void SpatialEditor::_update_camera_override_button(bool p_game_running) {
}
}
-void SpatialEditor::_update_camera_override_viewport(Object *p_viewport) {
- SpatialEditorViewport *current_viewport = Object::cast_to<SpatialEditorViewport>(p_viewport);
+void Node3DEditor::_update_camera_override_viewport(Object *p_viewport) {
+ Node3DEditorViewport *current_viewport = Object::cast_to<Node3DEditorViewport>(p_viewport);
if (!current_viewport)
return;
@@ -4845,7 +4845,7 @@ void SpatialEditor::_update_camera_override_viewport(Object *p_viewport) {
}
}
-void SpatialEditor::_menu_item_pressed(int p_option) {
+void Node3DEditor::_menu_item_pressed(int p_option) {
switch (p_option) {
@@ -4879,7 +4879,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} break;
case MENU_VIEW_USE_1_VIEWPORT: {
- viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_1_VIEWPORT);
+ viewport_base->set_view(Node3DEditorViewportContainer::VIEW_USE_1_VIEWPORT);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), true);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false);
@@ -4891,7 +4891,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} break;
case MENU_VIEW_USE_2_VIEWPORTS: {
- viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_2_VIEWPORTS);
+ viewport_base->set_view(Node3DEditorViewportContainer::VIEW_USE_2_VIEWPORTS);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), true);
@@ -4903,7 +4903,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} break;
case MENU_VIEW_USE_2_VIEWPORTS_ALT: {
- viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_2_VIEWPORTS_ALT);
+ viewport_base->set_view(Node3DEditorViewportContainer::VIEW_USE_2_VIEWPORTS_ALT);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false);
@@ -4915,7 +4915,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} break;
case MENU_VIEW_USE_3_VIEWPORTS: {
- viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_3_VIEWPORTS);
+ viewport_base->set_view(Node3DEditorViewportContainer::VIEW_USE_3_VIEWPORTS);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false);
@@ -4927,7 +4927,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} break;
case MENU_VIEW_USE_3_VIEWPORTS_ALT: {
- viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_3_VIEWPORTS_ALT);
+ viewport_base->set_view(Node3DEditorViewportContainer::VIEW_USE_3_VIEWPORTS_ALT);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false);
@@ -4939,7 +4939,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} break;
case MENU_VIEW_USE_4_VIEWPORTS: {
- viewport_base->set_view(SpatialEditorViewportContainer::VIEW_USE_4_VIEWPORTS);
+ viewport_base->set_view(Node3DEditorViewportContainer::VIEW_USE_4_VIEWPORTS);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), false);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), false);
@@ -4991,7 +4991,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *spatial = Object::cast_to<Spatial>(E->get());
+ Node3D *spatial = Object::cast_to<Node3D>(E->get());
if (!spatial || !spatial->is_visible_in_tree())
continue;
@@ -5015,7 +5015,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *spatial = Object::cast_to<Spatial>(E->get());
+ Node3D *spatial = Object::cast_to<Node3D>(E->get());
if (!spatial || !spatial->is_visible_in_tree())
continue;
@@ -5039,7 +5039,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *spatial = Object::cast_to<Spatial>(E->get());
+ Node3D *spatial = Object::cast_to<Node3D>(E->get());
if (!spatial || !spatial->is_visible_in_tree())
continue;
@@ -5062,7 +5062,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *spatial = Object::cast_to<Spatial>(E->get());
+ Node3D *spatial = Object::cast_to<Node3D>(E->get());
if (!spatial || !spatial->is_visible_in_tree())
continue;
@@ -5082,7 +5082,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
}
}
-void SpatialEditor::_init_indicators() {
+void Node3DEditor::_init_indicators() {
{
origin_enabled = true;
@@ -5139,7 +5139,7 @@ void SpatialEditor::_init_indicators() {
VisualServer::get_singleton()->mesh_surface_set_material(origin, 0, indicator_mat->get_rid());
origin_instance = VisualServer::get_singleton()->instance_create2(origin, get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_set_layer_mask(origin_instance, 1 << SpatialEditorViewport::GIZMO_GRID_LAYER);
+ VS::get_singleton()->instance_set_layer_mask(origin_instance, 1 << Node3DEditorViewport::GIZMO_GRID_LAYER);
VisualServer::get_singleton()->instance_geometry_set_cast_shadows_setting(origin_instance, VS::SHADOW_CASTING_SETTING_OFF);
}
@@ -5419,7 +5419,7 @@ void SpatialEditor::_init_indicators() {
_generate_selection_box();
}
-void SpatialEditor::_update_gizmos_menu() {
+void Node3DEditor::_update_gizmos_menu() {
gizmos_menu->clear();
@@ -5430,39 +5430,39 @@ void SpatialEditor::_update_gizmos_menu() {
gizmos_menu->add_multistate_item(TTR(plugin_name), 3, plugin_state, i);
const int idx = gizmos_menu->get_item_index(i);
switch (plugin_state) {
- case EditorSpatialGizmoPlugin::VISIBLE:
+ case EditorNode3DGizmoPlugin::VISIBLE:
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_visible"));
break;
- case EditorSpatialGizmoPlugin::ON_TOP:
+ case EditorNode3DGizmoPlugin::ON_TOP:
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_xray"));
break;
- case EditorSpatialGizmoPlugin::HIDDEN:
+ case EditorNode3DGizmoPlugin::HIDDEN:
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_hidden"));
break;
}
}
}
-void SpatialEditor::_update_gizmos_menu_theme() {
+void Node3DEditor::_update_gizmos_menu_theme() {
for (int i = 0; i < gizmo_plugins_by_name.size(); ++i) {
if (!gizmo_plugins_by_name[i]->can_be_hidden()) continue;
const int plugin_state = gizmo_plugins_by_name[i]->get_state();
const int idx = gizmos_menu->get_item_index(i);
switch (plugin_state) {
- case EditorSpatialGizmoPlugin::VISIBLE:
+ case EditorNode3DGizmoPlugin::VISIBLE:
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_visible"));
break;
- case EditorSpatialGizmoPlugin::ON_TOP:
+ case EditorNode3DGizmoPlugin::ON_TOP:
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_xray"));
break;
- case EditorSpatialGizmoPlugin::HIDDEN:
+ case EditorNode3DGizmoPlugin::HIDDEN:
gizmos_menu->set_item_icon(idx, gizmos_menu->get_theme_icon("visibility_hidden"));
break;
}
}
}
-void SpatialEditor::_init_grid() {
+void Node3DEditor::_init_grid() {
Vector<Color> grid_colors[3];
Vector<Vector3> grid_points[3];
@@ -5517,11 +5517,11 @@ void SpatialEditor::_init_grid() {
VisualServer::get_singleton()->instance_set_visible(grid_instance[i], grid_visible[i]);
VisualServer::get_singleton()->instance_geometry_set_cast_shadows_setting(grid_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
- VS::get_singleton()->instance_set_layer_mask(grid_instance[i], 1 << SpatialEditorViewport::GIZMO_GRID_LAYER);
+ VS::get_singleton()->instance_set_layer_mask(grid_instance[i], 1 << Node3DEditorViewport::GIZMO_GRID_LAYER);
}
}
-void SpatialEditor::_finish_indicators() {
+void Node3DEditor::_finish_indicators() {
VisualServer::get_singleton()->free(origin_instance);
VisualServer::get_singleton()->free(origin);
@@ -5529,14 +5529,14 @@ void SpatialEditor::_finish_indicators() {
_finish_grid();
}
-void SpatialEditor::_finish_grid() {
+void Node3DEditor::_finish_grid() {
for (int i = 0; i < 3; i++) {
VisualServer::get_singleton()->free(grid_instance[i]);
VisualServer::get_singleton()->free(grid[i]);
}
}
-bool SpatialEditor::is_any_freelook_active() const {
+bool Node3DEditor::is_any_freelook_active() const {
for (unsigned int i = 0; i < VIEWPORTS_COUNT; ++i) {
if (viewports[i]->is_freelook_active())
return true;
@@ -5544,7 +5544,7 @@ bool SpatialEditor::is_any_freelook_active() const {
return false;
}
-void SpatialEditor::_refresh_menu_icons() {
+void Node3DEditor::_refresh_menu_icons() {
bool all_locked = true;
bool all_grouped = true;
@@ -5556,13 +5556,13 @@ void SpatialEditor::_refresh_menu_icons() {
all_grouped = false;
} else {
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- if (Object::cast_to<Spatial>(E->get()) && !Object::cast_to<Spatial>(E->get())->has_meta("_edit_lock_")) {
+ if (Object::cast_to<Node3D>(E->get()) && !Object::cast_to<Node3D>(E->get())->has_meta("_edit_lock_")) {
all_locked = false;
break;
}
}
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- if (Object::cast_to<Spatial>(E->get()) && !Object::cast_to<Spatial>(E->get())->has_meta("_edit_group_")) {
+ if (Object::cast_to<Node3D>(E->get()) && !Object::cast_to<Node3D>(E->get())->has_meta("_edit_group_")) {
all_grouped = false;
break;
}
@@ -5599,35 +5599,35 @@ Set<T *> _get_child_nodes(Node *parent_node) {
Set<RID> _get_physics_bodies_rid(Node *node) {
Set<RID> rids = Set<RID>();
- PhysicsBody *pb = Node::cast_to<PhysicsBody>(node);
+ PhysicsBody3D *pb = Node::cast_to<PhysicsBody3D>(node);
if (pb) {
rids.insert(pb->get_rid());
}
- Set<PhysicsBody *> child_nodes = _get_child_nodes<PhysicsBody>(node);
- for (Set<PhysicsBody *>::Element *I = child_nodes.front(); I; I = I->next()) {
+ Set<PhysicsBody3D *> child_nodes = _get_child_nodes<PhysicsBody3D>(node);
+ for (Set<PhysicsBody3D *>::Element *I = child_nodes.front(); I; I = I->next()) {
rids.insert(I->get()->get_rid());
}
return rids;
}
-void SpatialEditor::snap_selected_nodes_to_floor() {
+void Node3DEditor::snap_selected_nodes_to_floor() {
List<Node *> &selection = editor_selection->get_selected_node_list();
Dictionary snap_data;
for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
- Spatial *sp = Object::cast_to<Spatial>(E->get());
+ Node3D *sp = Object::cast_to<Node3D>(E->get());
if (sp) {
Vector3 from = Vector3();
Vector3 position_offset = Vector3();
// Priorities for snapping to floor are CollisionShapes, VisualInstances and then origin
- Set<VisualInstance *> vi = _get_child_nodes<VisualInstance>(sp);
- Set<CollisionShape *> cs = _get_child_nodes<CollisionShape>(sp);
+ Set<VisualInstance3D *> vi = _get_child_nodes<VisualInstance3D>(sp);
+ Set<CollisionShape3D *> cs = _get_child_nodes<CollisionShape3D>(sp);
if (cs.size()) {
AABB aabb = sp->get_global_transform().xform(cs.front()->get()->get_shape()->get_debug_mesh()->get_aabb());
- for (Set<CollisionShape *>::Element *I = cs.front(); I; I = I->next()) {
+ for (Set<CollisionShape3D *>::Element *I = cs.front(); I; I = I->next()) {
aabb.merge_with(sp->get_global_transform().xform(I->get()->get_shape()->get_debug_mesh()->get_aabb()));
}
Vector3 size = aabb.size * Vector3(0.5, 0.0, 0.5);
@@ -5635,7 +5635,7 @@ void SpatialEditor::snap_selected_nodes_to_floor() {
position_offset.y = from.y - sp->get_global_transform().origin.y;
} else if (vi.size()) {
AABB aabb = vi.front()->get()->get_transformed_aabb();
- for (Set<VisualInstance *>::Element *I = vi.front(); I; I = I->next()) {
+ for (Set<VisualInstance3D *>::Element *I = vi.front(); I; I = I->next()) {
aabb.merge_with(I->get()->get_transformed_aabb());
}
Vector3 size = aabb.size * Vector3(0.5, 0.0, 0.5);
@@ -5674,7 +5674,7 @@ void SpatialEditor::snap_selected_nodes_to_floor() {
// We need to check this before snapping to register the undo/redo action only if needed.
for (int i = 0; i < keys.size(); i++) {
Node *node = keys[i];
- Spatial *sp = Object::cast_to<Spatial>(node);
+ Node3D *sp = Object::cast_to<Node3D>(node);
Dictionary d = snap_data[node];
Vector3 from = d["from"];
Vector3 to = from - Vector3(0.0, max_snap_height, 0.0);
@@ -5691,7 +5691,7 @@ void SpatialEditor::snap_selected_nodes_to_floor() {
// Perform snapping if at least one node can be snapped
for (int i = 0; i < keys.size(); i++) {
Node *node = keys[i];
- Spatial *sp = Object::cast_to<Spatial>(node);
+ Node3D *sp = Object::cast_to<Node3D>(node);
Dictionary d = snap_data[node];
Vector3 from = d["from"];
Vector3 to = from - Vector3(0.0, max_snap_height, 0.0);
@@ -5716,30 +5716,30 @@ void SpatialEditor::snap_selected_nodes_to_floor() {
}
}
-void SpatialEditor::_unhandled_key_input(Ref<InputEvent> p_event) {
+void Node3DEditor::_unhandled_key_input(Ref<InputEvent> p_event) {
if (!is_visible_in_tree())
return;
snap_key_enabled = InputFilter::get_singleton()->is_key_pressed(KEY_CONTROL);
}
-void SpatialEditor::_notification(int p_what) {
+void Node3DEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_READY) {
- tool_button[SpatialEditor::TOOL_MODE_SELECT]->set_icon(get_theme_icon("ToolSelect", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_MODE_MOVE]->set_icon(get_theme_icon("ToolMove", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_MODE_ROTATE]->set_icon(get_theme_icon("ToolRotate", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_MODE_SCALE]->set_icon(get_theme_icon("ToolScale", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_MODE_LIST_SELECT]->set_icon(get_theme_icon("ListSelect", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_LOCK_SELECTED]->set_icon(get_theme_icon("Lock", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_UNLOCK_SELECTED]->set_icon(get_theme_icon("Unlock", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_GROUP_SELECTED]->set_icon(get_theme_icon("Group", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_UNGROUP_SELECTED]->set_icon(get_theme_icon("Ungroup", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_MODE_SELECT]->set_icon(get_theme_icon("ToolSelect", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_MODE_MOVE]->set_icon(get_theme_icon("ToolMove", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_MODE_ROTATE]->set_icon(get_theme_icon("ToolRotate", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_MODE_SCALE]->set_icon(get_theme_icon("ToolScale", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_MODE_LIST_SELECT]->set_icon(get_theme_icon("ListSelect", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_LOCK_SELECTED]->set_icon(get_theme_icon("Lock", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_UNLOCK_SELECTED]->set_icon(get_theme_icon("Unlock", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_GROUP_SELECTED]->set_icon(get_theme_icon("Group", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_UNGROUP_SELECTED]->set_icon(get_theme_icon("Ungroup", "EditorIcons"));
- tool_option_button[SpatialEditor::TOOL_OPT_LOCAL_COORDS]->set_icon(get_theme_icon("Object", "EditorIcons"));
- tool_option_button[SpatialEditor::TOOL_OPT_USE_SNAP]->set_icon(get_theme_icon("Snap", "EditorIcons"));
- tool_option_button[SpatialEditor::TOOL_OPT_OVERRIDE_CAMERA]->set_icon(get_theme_icon("Camera", "EditorIcons"));
+ tool_option_button[Node3DEditor::TOOL_OPT_LOCAL_COORDS]->set_icon(get_theme_icon("Object", "EditorIcons"));
+ tool_option_button[Node3DEditor::TOOL_OPT_USE_SNAP]->set_icon(get_theme_icon("Snap", "EditorIcons"));
+ tool_option_button[Node3DEditor::TOOL_OPT_OVERRIDE_CAMERA]->set_icon(get_theme_icon("Camera3D", "EditorIcons"));
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_theme_icon("Panels1", "EditorIcons"));
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_theme_icon("Panels2", "EditorIcons"));
@@ -5752,12 +5752,12 @@ void SpatialEditor::_notification(int p_what) {
_refresh_menu_icons();
- get_tree()->connect("node_removed", callable_mp(this, &SpatialEditor::_node_removed));
- EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor()->connect("node_changed", callable_mp(this, &SpatialEditor::_refresh_menu_icons));
- editor_selection->connect("selection_changed", callable_mp(this, &SpatialEditor::_refresh_menu_icons));
+ get_tree()->connect("node_removed", callable_mp(this, &Node3DEditor::_node_removed));
+ EditorNode::get_singleton()->get_scene_tree_dock()->get_tree_editor()->connect("node_changed", callable_mp(this, &Node3DEditor::_refresh_menu_icons));
+ editor_selection->connect("selection_changed", callable_mp(this, &Node3DEditor::_refresh_menu_icons));
- editor->connect("stop_pressed", callable_mp(this, &SpatialEditor::_update_camera_override_button), make_binds(false));
- editor->connect("play_pressed", callable_mp(this, &SpatialEditor::_update_camera_override_button), make_binds(true));
+ editor->connect("stop_pressed", callable_mp(this, &Node3DEditor::_update_camera_override_button), make_binds(false));
+ editor->connect("play_pressed", callable_mp(this, &Node3DEditor::_update_camera_override_button), make_binds(true));
} else if (p_what == NOTIFICATION_ENTER_TREE) {
_register_all_gizmos();
@@ -5769,18 +5769,18 @@ void SpatialEditor::_notification(int p_what) {
_finish_indicators();
} else if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
- tool_button[SpatialEditor::TOOL_MODE_SELECT]->set_icon(get_theme_icon("ToolSelect", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_MODE_MOVE]->set_icon(get_theme_icon("ToolMove", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_MODE_ROTATE]->set_icon(get_theme_icon("ToolRotate", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_MODE_SCALE]->set_icon(get_theme_icon("ToolScale", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_MODE_LIST_SELECT]->set_icon(get_theme_icon("ListSelect", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_LOCK_SELECTED]->set_icon(get_theme_icon("Lock", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_UNLOCK_SELECTED]->set_icon(get_theme_icon("Unlock", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_GROUP_SELECTED]->set_icon(get_theme_icon("Group", "EditorIcons"));
- tool_button[SpatialEditor::TOOL_UNGROUP_SELECTED]->set_icon(get_theme_icon("Ungroup", "EditorIcons"));
-
- tool_option_button[SpatialEditor::TOOL_OPT_LOCAL_COORDS]->set_icon(get_theme_icon("Object", "EditorIcons"));
- tool_option_button[SpatialEditor::TOOL_OPT_USE_SNAP]->set_icon(get_theme_icon("Snap", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_MODE_SELECT]->set_icon(get_theme_icon("ToolSelect", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_MODE_MOVE]->set_icon(get_theme_icon("ToolMove", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_MODE_ROTATE]->set_icon(get_theme_icon("ToolRotate", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_MODE_SCALE]->set_icon(get_theme_icon("ToolScale", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_MODE_LIST_SELECT]->set_icon(get_theme_icon("ListSelect", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_LOCK_SELECTED]->set_icon(get_theme_icon("Lock", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_UNLOCK_SELECTED]->set_icon(get_theme_icon("Unlock", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_GROUP_SELECTED]->set_icon(get_theme_icon("Group", "EditorIcons"));
+ tool_button[Node3DEditor::TOOL_UNGROUP_SELECTED]->set_icon(get_theme_icon("Ungroup", "EditorIcons"));
+
+ tool_option_button[Node3DEditor::TOOL_OPT_LOCAL_COORDS]->set_icon(get_theme_icon("Object", "EditorIcons"));
+ tool_option_button[Node3DEditor::TOOL_OPT_USE_SNAP]->set_icon(get_theme_icon("Snap", "EditorIcons"));
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_1_VIEWPORT), get_theme_icon("Panels1", "EditorIcons"));
view_menu->get_popup()->set_item_icon(view_menu->get_popup()->get_item_index(MENU_VIEW_USE_2_VIEWPORTS), get_theme_icon("Panels2", "EditorIcons"));
@@ -5802,41 +5802,41 @@ void SpatialEditor::_notification(int p_what) {
}
}
-void SpatialEditor::add_control_to_menu_panel(Control *p_control) {
+void Node3DEditor::add_control_to_menu_panel(Control *p_control) {
hbc_menu->add_child(p_control);
}
-void SpatialEditor::remove_control_from_menu_panel(Control *p_control) {
+void Node3DEditor::remove_control_from_menu_panel(Control *p_control) {
hbc_menu->remove_child(p_control);
}
-void SpatialEditor::set_can_preview(Camera *p_preview) {
+void Node3DEditor::set_can_preview(Camera3D *p_preview) {
for (int i = 0; i < 4; i++) {
viewports[i]->set_can_preview(p_preview);
}
}
-VSplitContainer *SpatialEditor::get_shader_split() {
+VSplitContainer *Node3DEditor::get_shader_split() {
return shader_split;
}
-HSplitContainer *SpatialEditor::get_palette_split() {
+HSplitContainer *Node3DEditor::get_palette_split() {
return palette_split;
}
-void SpatialEditor::_request_gizmo(Object *p_obj) {
+void Node3DEditor::_request_gizmo(Object *p_obj) {
- Spatial *sp = Object::cast_to<Spatial>(p_obj);
+ Node3D *sp = Object::cast_to<Node3D>(p_obj);
if (!sp)
return;
if (editor->get_edited_scene() && (sp == editor->get_edited_scene() || (sp->get_owner() && editor->get_edited_scene()->is_a_parent_of(sp)))) {
- Ref<EditorSpatialGizmo> seg;
+ Ref<EditorNode3DGizmo> seg;
for (int i = 0; i < gizmo_plugins_by_priority.size(); ++i) {
seg = gizmo_plugins_by_priority.write[i]->get_gizmo(sp);
@@ -5855,9 +5855,9 @@ void SpatialEditor::_request_gizmo(Object *p_obj) {
}
}
-void SpatialEditor::_toggle_maximize_view(Object *p_viewport) {
+void Node3DEditor::_toggle_maximize_view(Object *p_viewport) {
if (!p_viewport) return;
- SpatialEditorViewport *current_viewport = Object::cast_to<SpatialEditorViewport>(p_viewport);
+ Node3DEditorViewport *current_viewport = Object::cast_to<Node3DEditorViewport>(p_viewport);
if (!current_viewport) return;
int index = -1;
@@ -5900,49 +5900,49 @@ void SpatialEditor::_toggle_maximize_view(Object *p_viewport) {
}
}
-void SpatialEditor::_node_removed(Node *p_node) {
+void Node3DEditor::_node_removed(Node *p_node) {
if (p_node == selected)
selected = NULL;
}
-void SpatialEditor::_register_all_gizmos() {
- add_gizmo_plugin(Ref<CameraSpatialGizmoPlugin>(memnew(CameraSpatialGizmoPlugin)));
- add_gizmo_plugin(Ref<LightSpatialGizmoPlugin>(memnew(LightSpatialGizmoPlugin)));
- add_gizmo_plugin(Ref<AudioStreamPlayer3DSpatialGizmoPlugin>(memnew(AudioStreamPlayer3DSpatialGizmoPlugin)));
- add_gizmo_plugin(Ref<MeshInstanceSpatialGizmoPlugin>(memnew(MeshInstanceSpatialGizmoPlugin)));
- add_gizmo_plugin(Ref<SoftBodySpatialGizmoPlugin>(memnew(SoftBodySpatialGizmoPlugin)));
- add_gizmo_plugin(Ref<Sprite3DSpatialGizmoPlugin>(memnew(Sprite3DSpatialGizmoPlugin)));
- add_gizmo_plugin(Ref<SkeletonSpatialGizmoPlugin>(memnew(SkeletonSpatialGizmoPlugin)));
- add_gizmo_plugin(Ref<Position3DSpatialGizmoPlugin>(memnew(Position3DSpatialGizmoPlugin)));
- add_gizmo_plugin(Ref<RayCastSpatialGizmoPlugin>(memnew(RayCastSpatialGizmoPlugin)));
- add_gizmo_plugin(Ref<SpringArmSpatialGizmoPlugin>(memnew(SpringArmSpatialGizmoPlugin)));
- add_gizmo_plugin(Ref<VehicleWheelSpatialGizmoPlugin>(memnew(VehicleWheelSpatialGizmoPlugin)));
+void Node3DEditor::_register_all_gizmos() {
+ add_gizmo_plugin(Ref<CameraNode3DGizmoPlugin>(memnew(CameraNode3DGizmoPlugin)));
+ add_gizmo_plugin(Ref<LightNode3DGizmoPlugin>(memnew(LightNode3DGizmoPlugin)));
+ add_gizmo_plugin(Ref<AudioStreamPlayer3DNode3DGizmoPlugin>(memnew(AudioStreamPlayer3DNode3DGizmoPlugin)));
+ add_gizmo_plugin(Ref<MeshInstanceNode3DGizmoPlugin>(memnew(MeshInstanceNode3DGizmoPlugin)));
+ add_gizmo_plugin(Ref<SoftBodyNode3DGizmoPlugin>(memnew(SoftBodyNode3DGizmoPlugin)));
+ add_gizmo_plugin(Ref<Sprite3DNode3DGizmoPlugin>(memnew(Sprite3DNode3DGizmoPlugin)));
+ add_gizmo_plugin(Ref<SkeletonNode3DGizmoPlugin>(memnew(SkeletonNode3DGizmoPlugin)));
+ add_gizmo_plugin(Ref<Position3DNode3DGizmoPlugin>(memnew(Position3DNode3DGizmoPlugin)));
+ add_gizmo_plugin(Ref<RayCastNode3DGizmoPlugin>(memnew(RayCastNode3DGizmoPlugin)));
+ add_gizmo_plugin(Ref<SpringArmNode3DGizmoPlugin>(memnew(SpringArmNode3DGizmoPlugin)));
+ add_gizmo_plugin(Ref<VehicleWheelNode3DGizmoPlugin>(memnew(VehicleWheelNode3DGizmoPlugin)));
add_gizmo_plugin(Ref<VisibilityNotifierGizmoPlugin>(memnew(VisibilityNotifierGizmoPlugin)));
add_gizmo_plugin(Ref<ParticlesGizmoPlugin>(memnew(ParticlesGizmoPlugin)));
add_gizmo_plugin(Ref<CPUParticlesGizmoPlugin>(memnew(CPUParticlesGizmoPlugin)));
add_gizmo_plugin(Ref<ReflectionProbeGizmoPlugin>(memnew(ReflectionProbeGizmoPlugin)));
add_gizmo_plugin(Ref<GIProbeGizmoPlugin>(memnew(GIProbeGizmoPlugin)));
// add_gizmo_plugin(Ref<BakedIndirectLightGizmoPlugin>(memnew(BakedIndirectLightGizmoPlugin)));
- add_gizmo_plugin(Ref<CollisionShapeSpatialGizmoPlugin>(memnew(CollisionShapeSpatialGizmoPlugin)));
- add_gizmo_plugin(Ref<CollisionPolygonSpatialGizmoPlugin>(memnew(CollisionPolygonSpatialGizmoPlugin)));
- add_gizmo_plugin(Ref<NavigationMeshSpatialGizmoPlugin>(memnew(NavigationMeshSpatialGizmoPlugin)));
- add_gizmo_plugin(Ref<JointSpatialGizmoPlugin>(memnew(JointSpatialGizmoPlugin)));
- add_gizmo_plugin(Ref<PhysicalBoneSpatialGizmoPlugin>(memnew(PhysicalBoneSpatialGizmoPlugin)));
+ add_gizmo_plugin(Ref<CollisionShapeNode3DGizmoPlugin>(memnew(CollisionShapeNode3DGizmoPlugin)));
+ add_gizmo_plugin(Ref<CollisionPolygonNode3DGizmoPlugin>(memnew(CollisionPolygonNode3DGizmoPlugin)));
+ add_gizmo_plugin(Ref<NavigationMeshNode3DGizmoPlugin>(memnew(NavigationMeshNode3DGizmoPlugin)));
+ add_gizmo_plugin(Ref<JointNode3DGizmoPlugin>(memnew(JointNode3DGizmoPlugin)));
+ add_gizmo_plugin(Ref<PhysicalBoneNode3DGizmoPlugin>(memnew(PhysicalBoneNode3DGizmoPlugin)));
}
-void SpatialEditor::_bind_methods() {
+void Node3DEditor::_bind_methods() {
- ClassDB::bind_method("_unhandled_key_input", &SpatialEditor::_unhandled_key_input);
- ClassDB::bind_method("_get_editor_data", &SpatialEditor::_get_editor_data);
- ClassDB::bind_method("_request_gizmo", &SpatialEditor::_request_gizmo);
+ ClassDB::bind_method("_unhandled_key_input", &Node3DEditor::_unhandled_key_input);
+ ClassDB::bind_method("_get_editor_data", &Node3DEditor::_get_editor_data);
+ ClassDB::bind_method("_request_gizmo", &Node3DEditor::_request_gizmo);
ADD_SIGNAL(MethodInfo("transform_key_request"));
ADD_SIGNAL(MethodInfo("item_lock_status_changed"));
ADD_SIGNAL(MethodInfo("item_group_status_changed"));
}
-void SpatialEditor::clear() {
+void Node3DEditor::clear() {
settings_fov->set_value(EDITOR_DEF("editors/3d/default_fov", 70.0));
settings_znear->set_value(EDITOR_DEF("editors/3d/default_z_near", 0.05));
@@ -5963,14 +5963,14 @@ void SpatialEditor::clear() {
for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) {
- viewports[i]->view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(SpatialEditorViewport::VIEW_AUDIO_LISTENER), i == 0);
+ viewports[i]->view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(Node3DEditorViewport::VIEW_AUDIO_LISTENER), i == 0);
viewports[i]->viewport->set_as_audio_listener(i == 0);
}
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_GRID), true);
}
-SpatialEditor::SpatialEditor(EditorNode *p_editor) {
+Node3DEditor::Node3DEditor(EditorNode *p_editor) {
gizmo.visible = true;
gizmo.scale = 1.0;
@@ -6004,7 +6004,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
tool_button[TOOL_MODE_SELECT]->set_flat(true);
tool_button[TOOL_MODE_SELECT]->set_pressed(true);
button_binds.write[0] = MENU_TOOL_SELECT;
- tool_button[TOOL_MODE_SELECT]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds);
+ tool_button[TOOL_MODE_SELECT]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds);
tool_button[TOOL_MODE_SELECT]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_select", TTR("Select Mode"), KEY_Q));
tool_button[TOOL_MODE_SELECT]->set_tooltip(keycode_get_string(KEY_MASK_CMD) + TTR("Drag: Rotate\nAlt+Drag: Move\nAlt+RMB: Depth list selection"));
@@ -6015,7 +6015,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
tool_button[TOOL_MODE_MOVE]->set_toggle_mode(true);
tool_button[TOOL_MODE_MOVE]->set_flat(true);
button_binds.write[0] = MENU_TOOL_MOVE;
- tool_button[TOOL_MODE_MOVE]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds);
+ tool_button[TOOL_MODE_MOVE]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds);
tool_button[TOOL_MODE_MOVE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_move", TTR("Move Mode"), KEY_W));
tool_button[TOOL_MODE_ROTATE] = memnew(ToolButton);
@@ -6023,7 +6023,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
tool_button[TOOL_MODE_ROTATE]->set_toggle_mode(true);
tool_button[TOOL_MODE_ROTATE]->set_flat(true);
button_binds.write[0] = MENU_TOOL_ROTATE;
- tool_button[TOOL_MODE_ROTATE]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds);
+ tool_button[TOOL_MODE_ROTATE]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds);
tool_button[TOOL_MODE_ROTATE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_rotate", TTR("Rotate Mode"), KEY_E));
tool_button[TOOL_MODE_SCALE] = memnew(ToolButton);
@@ -6031,7 +6031,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
tool_button[TOOL_MODE_SCALE]->set_toggle_mode(true);
tool_button[TOOL_MODE_SCALE]->set_flat(true);
button_binds.write[0] = MENU_TOOL_SCALE;
- tool_button[TOOL_MODE_SCALE]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds);
+ tool_button[TOOL_MODE_SCALE]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds);
tool_button[TOOL_MODE_SCALE]->set_shortcut(ED_SHORTCUT("spatial_editor/tool_scale", TTR("Scale Mode"), KEY_R));
hbc_menu->add_child(memnew(VSeparator));
@@ -6041,31 +6041,31 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
tool_button[TOOL_MODE_LIST_SELECT]->set_toggle_mode(true);
tool_button[TOOL_MODE_LIST_SELECT]->set_flat(true);
button_binds.write[0] = MENU_TOOL_LIST_SELECT;
- tool_button[TOOL_MODE_LIST_SELECT]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds);
+ tool_button[TOOL_MODE_LIST_SELECT]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds);
tool_button[TOOL_MODE_LIST_SELECT]->set_tooltip(TTR("Show a list of all objects at the position clicked\n(same as Alt+RMB in select mode)."));
tool_button[TOOL_LOCK_SELECTED] = memnew(ToolButton);
hbc_menu->add_child(tool_button[TOOL_LOCK_SELECTED]);
button_binds.write[0] = MENU_LOCK_SELECTED;
- tool_button[TOOL_LOCK_SELECTED]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds);
+ tool_button[TOOL_LOCK_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds);
tool_button[TOOL_LOCK_SELECTED]->set_tooltip(TTR("Lock the selected object in place (can't be moved)."));
tool_button[TOOL_UNLOCK_SELECTED] = memnew(ToolButton);
hbc_menu->add_child(tool_button[TOOL_UNLOCK_SELECTED]);
button_binds.write[0] = MENU_UNLOCK_SELECTED;
- tool_button[TOOL_UNLOCK_SELECTED]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds);
+ tool_button[TOOL_UNLOCK_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds);
tool_button[TOOL_UNLOCK_SELECTED]->set_tooltip(TTR("Unlock the selected object (can be moved)."));
tool_button[TOOL_GROUP_SELECTED] = memnew(ToolButton);
hbc_menu->add_child(tool_button[TOOL_GROUP_SELECTED]);
button_binds.write[0] = MENU_GROUP_SELECTED;
- tool_button[TOOL_GROUP_SELECTED]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds);
+ tool_button[TOOL_GROUP_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds);
tool_button[TOOL_GROUP_SELECTED]->set_tooltip(TTR("Makes sure the object's children are not selectable."));
tool_button[TOOL_UNGROUP_SELECTED] = memnew(ToolButton);
hbc_menu->add_child(tool_button[TOOL_UNGROUP_SELECTED]);
button_binds.write[0] = MENU_UNGROUP_SELECTED;
- tool_button[TOOL_UNGROUP_SELECTED]->connect("pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed), button_binds);
+ tool_button[TOOL_UNGROUP_SELECTED]->connect("pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed), button_binds);
tool_button[TOOL_UNGROUP_SELECTED]->set_tooltip(TTR("Restores the object's children's ability to be selected."));
hbc_menu->add_child(memnew(VSeparator));
@@ -6075,7 +6075,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_toggle_mode(true);
tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_flat(true);
button_binds.write[0] = MENU_TOOL_LOCAL_COORDS;
- tool_option_button[TOOL_OPT_LOCAL_COORDS]->connect("toggled", callable_mp(this, &SpatialEditor::_menu_item_toggled), button_binds);
+ tool_option_button[TOOL_OPT_LOCAL_COORDS]->connect("toggled", callable_mp(this, &Node3DEditor::_menu_item_toggled), button_binds);
tool_option_button[TOOL_OPT_LOCAL_COORDS]->set_shortcut(ED_SHORTCUT("spatial_editor/local_coords", TTR("Use Local Space"), KEY_T));
tool_option_button[TOOL_OPT_USE_SNAP] = memnew(ToolButton);
@@ -6083,7 +6083,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
tool_option_button[TOOL_OPT_USE_SNAP]->set_toggle_mode(true);
tool_option_button[TOOL_OPT_USE_SNAP]->set_flat(true);
button_binds.write[0] = MENU_TOOL_USE_SNAP;
- tool_option_button[TOOL_OPT_USE_SNAP]->connect("toggled", callable_mp(this, &SpatialEditor::_menu_item_toggled), button_binds);
+ tool_option_button[TOOL_OPT_USE_SNAP]->connect("toggled", callable_mp(this, &Node3DEditor::_menu_item_toggled), button_binds);
tool_option_button[TOOL_OPT_USE_SNAP]->set_shortcut(ED_SHORTCUT("spatial_editor/snap", TTR("Use Snap"), KEY_Y));
hbc_menu->add_child(memnew(VSeparator));
@@ -6094,13 +6094,13 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->set_flat(true);
tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->set_disabled(true);
button_binds.write[0] = MENU_TOOL_OVERRIDE_CAMERA;
- tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->connect("toggled", callable_mp(this, &SpatialEditor::_menu_item_toggled), button_binds);
+ tool_option_button[TOOL_OPT_OVERRIDE_CAMERA]->connect("toggled", callable_mp(this, &Node3DEditor::_menu_item_toggled), button_binds);
_update_camera_override_button(false);
hbc_menu->add_child(memnew(VSeparator));
// Drag and drop support;
- preview_node = memnew(Spatial);
+ preview_node = memnew(Node3D);
preview_bounds = AABB();
ED_SHORTCUT("spatial_editor/bottom_view", TTR("Bottom View"), KEY_MASK_ALT + KEY_KP_7);
@@ -6131,7 +6131,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
p->add_separator();
p->add_shortcut(ED_SHORTCUT("spatial_editor/configure_snap", TTR("Configure Snap...")), MENU_TRANSFORM_CONFIGURE_SNAP);
- p->connect("id_pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed));
+ p->connect("id_pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed));
view_menu = memnew(MenuButton);
view_menu->set_text(TTR("View"));
@@ -6163,13 +6163,13 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
p->set_item_checked(p->get_item_index(MENU_VIEW_ORIGIN), true);
p->set_item_checked(p->get_item_index(MENU_VIEW_GRID), true);
- p->connect("id_pressed", callable_mp(this, &SpatialEditor::_menu_item_pressed));
+ p->connect("id_pressed", callable_mp(this, &Node3DEditor::_menu_item_pressed));
gizmos_menu = memnew(PopupMenu);
p->add_child(gizmos_menu);
gizmos_menu->set_name("GizmosMenu");
gizmos_menu->set_hide_on_checkable_item_selection(false);
- gizmos_menu->connect("id_pressed", callable_mp(this, &SpatialEditor::_menu_gizmo_toggled));
+ gizmos_menu->connect("id_pressed", callable_mp(this, &Node3DEditor::_menu_gizmo_toggled));
/* REST OF MENU */
@@ -6180,14 +6180,14 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
shader_split = memnew(VSplitContainer);
shader_split->set_h_size_flags(SIZE_EXPAND_FILL);
palette_split->add_child(shader_split);
- viewport_base = memnew(SpatialEditorViewportContainer);
+ viewport_base = memnew(Node3DEditorViewportContainer);
shader_split->add_child(viewport_base);
viewport_base->set_v_size_flags(SIZE_EXPAND_FILL);
for (uint32_t i = 0; i < VIEWPORTS_COUNT; i++) {
- viewports[i] = memnew(SpatialEditorViewport(this, editor, i));
- viewports[i]->connect("toggle_maximize_view", callable_mp(this, &SpatialEditor::_toggle_maximize_view));
- viewports[i]->connect("clicked", callable_mp(this, &SpatialEditor::_update_camera_override_viewport));
+ viewports[i] = memnew(Node3DEditorViewport(this, editor, i));
+ viewports[i]->connect("toggle_maximize_view", callable_mp(this, &Node3DEditor::_toggle_maximize_view));
+ viewports[i]->connect("clicked", callable_mp(this, &Node3DEditor::_update_camera_override_viewport));
viewports[i]->assign_pending_data_pointers(preview_node, &preview_bounds, accept);
viewport_base->add_child(viewports[i]);
}
@@ -6201,8 +6201,8 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
snap_dialog = memnew(ConfirmationDialog);
snap_dialog->set_title(TTR("Snap Settings"));
add_child(snap_dialog);
- snap_dialog->connect("confirmed", callable_mp(this, &SpatialEditor::_snap_changed));
- snap_dialog->get_cancel()->connect("pressed", callable_mp(this, &SpatialEditor::_snap_update));
+ snap_dialog->connect("confirmed", callable_mp(this, &Node3DEditor::_snap_changed));
+ snap_dialog->get_cancel()->connect("pressed", callable_mp(this, &Node3DEditor::_snap_update));
VBoxContainer *snap_dialog_vbc = memnew(VBoxContainer);
snap_dialog->add_child(snap_dialog_vbc);
@@ -6249,7 +6249,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
settings_vbc->add_margin_child(TTR("View Z-Far:"), settings_zfar);
for (uint32_t i = 0; i < VIEWPORTS_COUNT; ++i) {
- settings_dialog->connect("confirmed", callable_mp(viewports[i], &SpatialEditorViewport::_update_camera), varray(0.0));
+ settings_dialog->connect("confirmed", callable_mp(viewports[i], &Node3DEditorViewport::_update_camera), varray(0.0));
}
/* XFORM DIALOG */
@@ -6311,7 +6311,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
xform_type->add_item(TTR("Post"));
xform_vbc->add_child(xform_type);
- xform_dialog->connect("confirmed", callable_mp(this, &SpatialEditor::_xform_dialog_action));
+ xform_dialog->connect("confirmed", callable_mp(this, &Node3DEditor::_xform_dialog_action));
scenario_debug = VisualServer::SCENARIO_DEBUG_DISABLED;
@@ -6329,11 +6329,11 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
over_gizmo_handle = -1;
}
-SpatialEditor::~SpatialEditor() {
+Node3DEditor::~Node3DEditor() {
memdelete(preview_node);
}
-void SpatialEditorPlugin::make_visible(bool p_visible) {
+void Node3DEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
@@ -6346,31 +6346,31 @@ void SpatialEditorPlugin::make_visible(bool p_visible) {
spatial_editor->set_process(false);
}
}
-void SpatialEditorPlugin::edit(Object *p_object) {
+void Node3DEditorPlugin::edit(Object *p_object) {
- spatial_editor->edit(Object::cast_to<Spatial>(p_object));
+ spatial_editor->edit(Object::cast_to<Node3D>(p_object));
}
-bool SpatialEditorPlugin::handles(Object *p_object) const {
+bool Node3DEditorPlugin::handles(Object *p_object) const {
- return p_object->is_class("Spatial");
+ return p_object->is_class("Node3D");
}
-Dictionary SpatialEditorPlugin::get_state() const {
+Dictionary Node3DEditorPlugin::get_state() const {
return spatial_editor->get_state();
}
-void SpatialEditorPlugin::set_state(const Dictionary &p_state) {
+void Node3DEditorPlugin::set_state(const Dictionary &p_state) {
spatial_editor->set_state(p_state);
}
-void SpatialEditor::snap_cursor_to_plane(const Plane &p_plane) {
+void Node3DEditor::snap_cursor_to_plane(const Plane &p_plane) {
//cursor.pos=p_plane.project(cursor.pos);
}
-Vector3 SpatialEditor::snap_point(Vector3 p_target, Vector3 p_start) const {
+Vector3 Node3DEditor::snap_point(Vector3 p_target, Vector3 p_start) const {
if (is_snap_enabled()) {
p_target.x = Math::snap_scalar(0.0, get_translate_snap(), p_target.x);
p_target.y = Math::snap_scalar(0.0, get_translate_snap(), p_target.y);
@@ -6379,7 +6379,7 @@ Vector3 SpatialEditor::snap_point(Vector3 p_target, Vector3 p_start) const {
return p_target;
}
-float SpatialEditor::get_translate_snap() const {
+float Node3DEditor::get_translate_snap() const {
float snap_value;
if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) {
snap_value = snap_translate->get_text().to_double() / 10.0;
@@ -6390,7 +6390,7 @@ float SpatialEditor::get_translate_snap() const {
return snap_value;
}
-float SpatialEditor::get_rotate_snap() const {
+float Node3DEditor::get_rotate_snap() const {
float snap_value;
if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) {
snap_value = snap_rotate->get_text().to_double() / 3.0;
@@ -6401,7 +6401,7 @@ float SpatialEditor::get_rotate_snap() const {
return snap_value;
}
-float SpatialEditor::get_scale_snap() const {
+float Node3DEditor::get_scale_snap() const {
float snap_value;
if (InputFilter::get_singleton()->is_key_pressed(KEY_SHIFT)) {
snap_value = snap_scale->get_text().to_double() / 2.0;
@@ -6412,19 +6412,19 @@ float SpatialEditor::get_scale_snap() const {
return snap_value;
}
-void SpatialEditorPlugin::_bind_methods() {
+void Node3DEditorPlugin::_bind_methods() {
- ClassDB::bind_method("snap_cursor_to_plane", &SpatialEditorPlugin::snap_cursor_to_plane);
+ ClassDB::bind_method("snap_cursor_to_plane", &Node3DEditorPlugin::snap_cursor_to_plane);
}
-void SpatialEditorPlugin::snap_cursor_to_plane(const Plane &p_plane) {
+void Node3DEditorPlugin::snap_cursor_to_plane(const Plane &p_plane) {
spatial_editor->snap_cursor_to_plane(p_plane);
}
struct _GizmoPluginPriorityComparator {
- bool operator()(const Ref<EditorSpatialGizmoPlugin> &p_a, const Ref<EditorSpatialGizmoPlugin> &p_b) const {
+ bool operator()(const Ref<EditorNode3DGizmoPlugin> &p_a, const Ref<EditorNode3DGizmoPlugin> &p_b) const {
if (p_a->get_priority() == p_b->get_priority()) {
return p_a->get_name() < p_b->get_name();
}
@@ -6434,12 +6434,12 @@ struct _GizmoPluginPriorityComparator {
struct _GizmoPluginNameComparator {
- bool operator()(const Ref<EditorSpatialGizmoPlugin> &p_a, const Ref<EditorSpatialGizmoPlugin> &p_b) const {
+ bool operator()(const Ref<EditorNode3DGizmoPlugin> &p_a, const Ref<EditorNode3DGizmoPlugin> &p_b) const {
return p_a->get_name() < p_b->get_name();
}
};
-void SpatialEditor::add_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> p_plugin) {
+void Node3DEditor::add_gizmo_plugin(Ref<EditorNode3DGizmoPlugin> p_plugin) {
ERR_FAIL_NULL(p_plugin.ptr());
gizmo_plugins_by_priority.push_back(p_plugin);
@@ -6449,19 +6449,19 @@ void SpatialEditor::add_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> p_plugin) {
gizmo_plugins_by_name.sort_custom<_GizmoPluginNameComparator>();
_update_gizmos_menu();
- SpatialEditor::get_singleton()->update_all_gizmos();
+ Node3DEditor::get_singleton()->update_all_gizmos();
}
-void SpatialEditor::remove_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> p_plugin) {
+void Node3DEditor::remove_gizmo_plugin(Ref<EditorNode3DGizmoPlugin> p_plugin) {
gizmo_plugins_by_priority.erase(p_plugin);
gizmo_plugins_by_name.erase(p_plugin);
_update_gizmos_menu();
}
-SpatialEditorPlugin::SpatialEditorPlugin(EditorNode *p_node) {
+Node3DEditorPlugin::Node3DEditorPlugin(EditorNode *p_node) {
editor = p_node;
- spatial_editor = memnew(SpatialEditor(p_node));
+ spatial_editor = memnew(Node3DEditor(p_node));
spatial_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
editor->get_viewport()->add_child(spatial_editor);
@@ -6469,10 +6469,10 @@ SpatialEditorPlugin::SpatialEditorPlugin(EditorNode *p_node) {
spatial_editor->connect_compat("transform_key_request", editor->get_inspector_dock(), "_transform_keyed");
}
-SpatialEditorPlugin::~SpatialEditorPlugin() {
+Node3DEditorPlugin::~Node3DEditorPlugin() {
}
-void EditorSpatialGizmoPlugin::create_material(const String &p_name, const Color &p_color, bool p_billboard, bool p_on_top, bool p_use_vertex_color) {
+void EditorNode3DGizmoPlugin::create_material(const String &p_name, const Color &p_color, bool p_billboard, bool p_on_top, bool p_use_vertex_color) {
Color instanced_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/instanced", Color(0.7, 0.7, 0.7, 0.6));
@@ -6514,7 +6514,7 @@ void EditorSpatialGizmoPlugin::create_material(const String &p_name, const Color
materials[p_name] = mats;
}
-void EditorSpatialGizmoPlugin::create_icon_material(const String &p_name, const Ref<Texture2D> &p_texture, bool p_on_top, const Color &p_albedo) {
+void EditorNode3DGizmoPlugin::create_icon_material(const String &p_name, const Ref<Texture2D> &p_texture, bool p_on_top, const Color &p_albedo) {
Color instanced_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/instanced", Color(0.7, 0.7, 0.7, 0.6));
@@ -6555,12 +6555,12 @@ void EditorSpatialGizmoPlugin::create_icon_material(const String &p_name, const
materials[p_name] = icons;
}
-void EditorSpatialGizmoPlugin::create_handle_material(const String &p_name, bool p_billboard) {
+void EditorNode3DGizmoPlugin::create_handle_material(const String &p_name, bool p_billboard) {
Ref<StandardMaterial3D> handle_material = Ref<StandardMaterial3D>(memnew(StandardMaterial3D));
handle_material->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
handle_material->set_flag(StandardMaterial3D::FLAG_USE_POINT_SIZE, true);
- Ref<Texture2D> handle_t = SpatialEditor::get_singleton()->get_theme_icon("Editor3DHandle", "EditorIcons");
+ Ref<Texture2D> handle_t = Node3DEditor::get_singleton()->get_theme_icon("Editor3DHandle", "EditorIcons");
handle_material->set_point_size(handle_t->get_width());
handle_material->set_texture(StandardMaterial3D::TEXTURE_ALBEDO, handle_t);
handle_material->set_albedo(Color(1, 1, 1));
@@ -6577,12 +6577,12 @@ void EditorSpatialGizmoPlugin::create_handle_material(const String &p_name, bool
materials[p_name].push_back(handle_material);
}
-void EditorSpatialGizmoPlugin::add_material(const String &p_name, Ref<StandardMaterial3D> p_material) {
+void EditorNode3DGizmoPlugin::add_material(const String &p_name, Ref<StandardMaterial3D> p_material) {
materials[p_name] = Vector<Ref<StandardMaterial3D>>();
materials[p_name].push_back(p_material);
}
-Ref<StandardMaterial3D> EditorSpatialGizmoPlugin::get_material(const String &p_name, const Ref<EditorSpatialGizmo> &p_gizmo) {
+Ref<StandardMaterial3D> EditorNode3DGizmoPlugin::get_material(const String &p_name, const Ref<EditorNode3DGizmo> &p_gizmo) {
ERR_FAIL_COND_V(!materials.has(p_name), Ref<StandardMaterial3D>());
ERR_FAIL_COND_V(materials[p_name].size() == 0, Ref<StandardMaterial3D>());
@@ -6601,27 +6601,27 @@ Ref<StandardMaterial3D> EditorSpatialGizmoPlugin::get_material(const String &p_n
return mat;
}
-String EditorSpatialGizmoPlugin::get_name() const {
+String EditorNode3DGizmoPlugin::get_name() const {
if (get_script_instance() && get_script_instance()->has_method("get_name")) {
return get_script_instance()->call("get_name");
}
return TTR("Nameless gizmo");
}
-int EditorSpatialGizmoPlugin::get_priority() const {
+int EditorNode3DGizmoPlugin::get_priority() const {
if (get_script_instance() && get_script_instance()->has_method("get_priority")) {
return get_script_instance()->call("get_priority");
}
return 0;
}
-Ref<EditorSpatialGizmo> EditorSpatialGizmoPlugin::get_gizmo(Spatial *p_spatial) {
+Ref<EditorNode3DGizmo> EditorNode3DGizmoPlugin::get_gizmo(Node3D *p_spatial) {
if (get_script_instance() && get_script_instance()->has_method("get_gizmo")) {
return get_script_instance()->call("get_gizmo", p_spatial);
}
- Ref<EditorSpatialGizmo> ref = create_gizmo(p_spatial);
+ Ref<EditorNode3DGizmo> ref = create_gizmo(p_spatial);
if (ref.is_null()) return ref;
@@ -6633,18 +6633,18 @@ Ref<EditorSpatialGizmo> EditorSpatialGizmoPlugin::get_gizmo(Spatial *p_spatial)
return ref;
}
-void EditorSpatialGizmoPlugin::_bind_methods() {
-#define GIZMO_REF PropertyInfo(Variant::OBJECT, "gizmo", PROPERTY_HINT_RESOURCE_TYPE, "EditorSpatialGizmo")
+void EditorNode3DGizmoPlugin::_bind_methods() {
+#define GIZMO_REF PropertyInfo(Variant::OBJECT, "gizmo", PROPERTY_HINT_RESOURCE_TYPE, "EditorNode3DGizmo")
- BIND_VMETHOD(MethodInfo(Variant::BOOL, "has_gizmo", PropertyInfo(Variant::OBJECT, "spatial", PROPERTY_HINT_RESOURCE_TYPE, "Spatial")));
- BIND_VMETHOD(MethodInfo(GIZMO_REF, "create_gizmo", PropertyInfo(Variant::OBJECT, "spatial", PROPERTY_HINT_RESOURCE_TYPE, "Spatial")));
+ BIND_VMETHOD(MethodInfo(Variant::BOOL, "has_gizmo", PropertyInfo(Variant::OBJECT, "spatial", PROPERTY_HINT_RESOURCE_TYPE, "Node3D")));
+ BIND_VMETHOD(MethodInfo(GIZMO_REF, "create_gizmo", PropertyInfo(Variant::OBJECT, "spatial", PROPERTY_HINT_RESOURCE_TYPE, "Node3D")));
- ClassDB::bind_method(D_METHOD("create_material", "name", "color", "billboard", "on_top", "use_vertex_color"), &EditorSpatialGizmoPlugin::create_material, DEFVAL(false), DEFVAL(false), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("create_icon_material", "name", "texture", "on_top", "color"), &EditorSpatialGizmoPlugin::create_icon_material, DEFVAL(false), DEFVAL(Color(1, 1, 1, 1)));
- ClassDB::bind_method(D_METHOD("create_handle_material", "name", "billboard"), &EditorSpatialGizmoPlugin::create_handle_material, DEFVAL(false));
- ClassDB::bind_method(D_METHOD("add_material", "name", "material"), &EditorSpatialGizmoPlugin::add_material);
+ ClassDB::bind_method(D_METHOD("create_material", "name", "color", "billboard", "on_top", "use_vertex_color"), &EditorNode3DGizmoPlugin::create_material, DEFVAL(false), DEFVAL(false), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("create_icon_material", "name", "texture", "on_top", "color"), &EditorNode3DGizmoPlugin::create_icon_material, DEFVAL(false), DEFVAL(Color(1, 1, 1, 1)));
+ ClassDB::bind_method(D_METHOD("create_handle_material", "name", "billboard"), &EditorNode3DGizmoPlugin::create_handle_material, DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("add_material", "name", "material"), &EditorNode3DGizmoPlugin::add_material);
- ClassDB::bind_method(D_METHOD("get_material", "name", "gizmo"), &EditorSpatialGizmoPlugin::get_material); //, DEFVAL(Ref<EditorSpatialGizmo>()));
+ ClassDB::bind_method(D_METHOD("get_material", "name", "gizmo"), &EditorNode3DGizmoPlugin::get_material); //, DEFVAL(Ref<EditorNode3DGizmo>()));
BIND_VMETHOD(MethodInfo(Variant::STRING, "get_name"));
BIND_VMETHOD(MethodInfo(Variant::STRING, "get_priority"));
@@ -6658,7 +6658,7 @@ void EditorSpatialGizmoPlugin::_bind_methods() {
hvget.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT;
BIND_VMETHOD(hvget);
- BIND_VMETHOD(MethodInfo("set_handle", GIZMO_REF, PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera"), PropertyInfo(Variant::VECTOR2, "point")));
+ BIND_VMETHOD(MethodInfo("set_handle", GIZMO_REF, PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"), PropertyInfo(Variant::VECTOR2, "point")));
MethodInfo cm = MethodInfo("commit_handle", GIZMO_REF, PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::NIL, "restore"), PropertyInfo(Variant::BOOL, "cancel"));
cm.default_arguments.push_back(false);
BIND_VMETHOD(cm);
@@ -6668,103 +6668,103 @@ void EditorSpatialGizmoPlugin::_bind_methods() {
#undef GIZMO_REF
}
-bool EditorSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
+bool EditorNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
if (get_script_instance() && get_script_instance()->has_method("has_gizmo")) {
return get_script_instance()->call("has_gizmo", p_spatial);
}
return false;
}
-Ref<EditorSpatialGizmo> EditorSpatialGizmoPlugin::create_gizmo(Spatial *p_spatial) {
+Ref<EditorNode3DGizmo> EditorNode3DGizmoPlugin::create_gizmo(Node3D *p_spatial) {
if (get_script_instance() && get_script_instance()->has_method("create_gizmo")) {
return get_script_instance()->call("create_gizmo", p_spatial);
}
- Ref<EditorSpatialGizmo> ref;
+ Ref<EditorNode3DGizmo> ref;
if (has_gizmo(p_spatial)) ref.instance();
return ref;
}
-bool EditorSpatialGizmoPlugin::can_be_hidden() const {
+bool EditorNode3DGizmoPlugin::can_be_hidden() const {
if (get_script_instance() && get_script_instance()->has_method("can_be_hidden")) {
return get_script_instance()->call("can_be_hidden");
}
return true;
}
-bool EditorSpatialGizmoPlugin::is_selectable_when_hidden() const {
+bool EditorNode3DGizmoPlugin::is_selectable_when_hidden() const {
if (get_script_instance() && get_script_instance()->has_method("is_selectable_when_hidden")) {
return get_script_instance()->call("is_selectable_when_hidden");
}
return false;
}
-void EditorSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void EditorNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
if (get_script_instance() && get_script_instance()->has_method("redraw")) {
- Ref<EditorSpatialGizmo> ref(p_gizmo);
+ Ref<EditorNode3DGizmo> ref(p_gizmo);
get_script_instance()->call("redraw", ref);
}
}
-String EditorSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const {
+String EditorNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const {
if (get_script_instance() && get_script_instance()->has_method("get_handle_name")) {
return get_script_instance()->call("get_handle_name", p_gizmo, p_idx);
}
return "";
}
-Variant EditorSpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const {
+Variant EditorNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const {
if (get_script_instance() && get_script_instance()->has_method("get_handle_value")) {
return get_script_instance()->call("get_handle_value", p_gizmo, p_idx);
}
return Variant();
}
-void EditorSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) {
+void EditorNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) {
if (get_script_instance() && get_script_instance()->has_method("set_handle")) {
get_script_instance()->call("set_handle", p_gizmo, p_idx, p_camera, p_point);
}
}
-void EditorSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
+void EditorNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
if (get_script_instance() && get_script_instance()->has_method("commit_handle")) {
get_script_instance()->call("commit_handle", p_gizmo, p_idx, p_restore, p_cancel);
}
}
-bool EditorSpatialGizmoPlugin::is_handle_highlighted(const EditorSpatialGizmo *p_gizmo, int p_idx) const {
+bool EditorNode3DGizmoPlugin::is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int p_idx) const {
if (get_script_instance() && get_script_instance()->has_method("is_handle_highlighted")) {
return get_script_instance()->call("is_handle_highlighted", p_gizmo, p_idx);
}
return false;
}
-void EditorSpatialGizmoPlugin::set_state(int p_state) {
+void EditorNode3DGizmoPlugin::set_state(int p_state) {
current_state = p_state;
for (int i = 0; i < current_gizmos.size(); ++i) {
current_gizmos[i]->set_hidden(current_state == HIDDEN);
}
}
-int EditorSpatialGizmoPlugin::get_state() const {
+int EditorNode3DGizmoPlugin::get_state() const {
return current_state;
}
-void EditorSpatialGizmoPlugin::unregister_gizmo(EditorSpatialGizmo *p_gizmo) {
+void EditorNode3DGizmoPlugin::unregister_gizmo(EditorNode3DGizmo *p_gizmo) {
current_gizmos.erase(p_gizmo);
}
-EditorSpatialGizmoPlugin::EditorSpatialGizmoPlugin() {
+EditorNode3DGizmoPlugin::EditorNode3DGizmoPlugin() {
current_state = VISIBLE;
}
-EditorSpatialGizmoPlugin::~EditorSpatialGizmoPlugin() {
+EditorNode3DGizmoPlugin::~EditorNode3DGizmoPlugin() {
for (int i = 0; i < current_gizmos.size(); ++i) {
current_gizmos[i]->set_plugin(NULL);
current_gizmos[i]->get_spatial_node()->set_gizmo(NULL);
}
- if (SpatialEditor::get_singleton()) {
- SpatialEditor::get_singleton()->update_all_gizmos();
+ if (Node3DEditor::get_singleton()) {
+ Node3DEditor::get_singleton()->update_all_gizmos();
}
}
diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h
index 9dad66b647..819178408b 100644
--- a/editor/plugins/spatial_editor_plugin.h
+++ b/editor/plugins/spatial_editor_plugin.h
@@ -34,20 +34,20 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
#include "editor/editor_scale.h"
-#include "scene/3d/immediate_geometry.h"
-#include "scene/3d/light.h"
-#include "scene/3d/visual_instance.h"
+#include "scene/3d/immediate_geometry_3d.h"
+#include "scene/3d/light_3d.h"
+#include "scene/3d/visual_instance_3d.h"
#include "scene/gui/panel_container.h"
-class Camera;
-class SpatialEditor;
-class EditorSpatialGizmoPlugin;
-class SpatialEditorViewport;
+class Camera3D;
+class Node3DEditor;
+class EditorNode3DGizmoPlugin;
+class Node3DEditorViewport;
class ViewportContainer;
-class EditorSpatialGizmo : public SpatialGizmo {
+class EditorNode3DGizmo : public Node3DGizmo {
- GDCLASS(EditorSpatialGizmo, SpatialGizmo);
+ GDCLASS(EditorNode3DGizmo, Node3DGizmo);
bool selected;
bool instanced;
@@ -75,7 +75,7 @@ public:
extra_margin = false;
}
- void create_instance(Spatial *p_base, bool p_hidden = false);
+ void create_instance(Node3D *p_base, bool p_hidden = false);
};
Vector<Vector3> collision_segments;
@@ -93,12 +93,12 @@ public:
bool valid;
bool hidden;
- Spatial *base;
+ Node3D *base;
Vector<Instance> instances;
- Spatial *spatial_node;
- EditorSpatialGizmoPlugin *gizmo_plugin;
+ Node3D *spatial_node;
+ EditorNode3DGizmoPlugin *gizmo_plugin;
- void _set_spatial_node(Node *p_node) { set_spatial_node(Object::cast_to<Spatial>(p_node)); }
+ void _set_spatial_node(Node *p_node) { set_spatial_node(Object::cast_to<Node3D>(p_node)); }
protected:
static void _bind_methods();
@@ -115,15 +115,15 @@ public:
virtual bool is_handle_highlighted(int p_idx) const;
virtual String get_handle_name(int p_idx) const;
virtual Variant get_handle_value(int p_idx);
- virtual void set_handle(int p_idx, Camera *p_camera, const Point2 &p_point);
+ virtual void set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_point);
virtual void commit_handle(int p_idx, const Variant &p_restore, bool p_cancel = false);
- void set_spatial_node(Spatial *p_node);
- Spatial *get_spatial_node() const { return spatial_node; }
- Ref<EditorSpatialGizmoPlugin> get_plugin() const { return gizmo_plugin; }
+ void set_spatial_node(Node3D *p_node);
+ Node3D *get_spatial_node() const { return spatial_node; }
+ Ref<EditorNode3DGizmoPlugin> get_plugin() const { return gizmo_plugin; }
Vector3 get_handle_pos(int p_idx) const;
- bool intersect_frustum(const Camera *p_camera, const Vector<Plane> &p_frustum);
- bool intersect_ray(Camera *p_camera, const Point2 &p_point, Vector3 &r_pos, Vector3 &r_normal, int *r_gizmo_handle = NULL, bool p_sec_first = false);
+ bool intersect_frustum(const Camera3D *p_camera, const Vector<Plane> &p_frustum);
+ bool intersect_ray(Camera3D *p_camera, const Point2 &p_point, Vector3 &r_pos, Vector3 &r_normal, int *r_gizmo_handle = NULL, bool p_sec_first = false);
virtual void clear();
virtual void create();
@@ -134,10 +134,10 @@ public:
virtual bool is_editable() const;
void set_hidden(bool p_hidden);
- void set_plugin(EditorSpatialGizmoPlugin *p_plugin);
+ void set_plugin(EditorNode3DGizmoPlugin *p_plugin);
- EditorSpatialGizmo();
- ~EditorSpatialGizmo();
+ EditorNode3DGizmo();
+ ~EditorNode3DGizmo();
};
class ViewportRotationControl : public Control {
@@ -155,7 +155,7 @@ class ViewportRotationControl : public Control {
}
};
- SpatialEditorViewport *viewport = nullptr;
+ Node3DEditorViewport *viewport = nullptr;
Vector<Color> axis_colors;
Vector<int> axis_menu_options;
bool orbiting = false;
@@ -174,13 +174,13 @@ protected:
void _on_mouse_exited();
public:
- void set_viewport(SpatialEditorViewport *p_viewport);
+ void set_viewport(Node3DEditorViewport *p_viewport);
};
-class SpatialEditorViewport : public Control {
+class Node3DEditorViewport : public Control {
- GDCLASS(SpatialEditorViewport, Control);
- friend class SpatialEditor;
+ GDCLASS(Node3DEditorViewport, Control);
+ friend class Node3DEditor;
friend class ViewportRotationControl;
enum {
@@ -242,7 +242,7 @@ private:
String name;
void _menu_option(int p_option);
void _set_auto_orthogonal();
- Spatial *preview_node;
+ Node3D *preview_node;
AABB *preview_bounds;
Vector<String> selected_files;
AcceptDialog *accept;
@@ -263,7 +263,7 @@ private:
Control *surface;
SubViewport *viewport;
- Camera *camera;
+ Camera3D *camera;
bool transforming;
bool orthogonal;
bool auto_orthogonal;
@@ -284,7 +284,7 @@ private:
struct _RayResult {
- Spatial *item;
+ Node3D *item;
float depth;
int handle;
_FORCE_INLINE_ bool operator<(const _RayResult &p_rr) const { return depth < p_rr.depth; }
@@ -366,7 +366,7 @@ private:
int edited_gizmo;
Point2 mouse_pos;
bool snap;
- Ref<EditorSpatialGizmo> gizmo;
+ Ref<EditorNode3DGizmo> gizmo;
int gizmo_handle;
Variant gizmo_initial_value;
Vector3 gizmo_initial_pos;
@@ -418,10 +418,10 @@ private:
void _sinput(const Ref<InputEvent> &p_event);
void _update_freelook(real_t delta);
- SpatialEditor *spatial_editor;
+ Node3DEditor *spatial_editor;
- Camera *previewing;
- Camera *preview;
+ Camera3D *previewing;
+ Camera3D *preview;
bool previewing_cinema;
bool _is_node_locked(const Node *p_node);
@@ -436,7 +436,7 @@ private:
Point2i _get_warped_mouse_motion(const Ref<InputEventMouseMotion> &p_ev_mouse_motion) const;
Vector3 _get_instance_position(const Point2 &p_pos) const;
- static AABB _calculate_spatial_bounds(const Spatial *p_parent, bool p_exclude_toplevel_transform = true);
+ static AABB _calculate_spatial_bounds(const Node3D *p_parent, bool p_exclude_toplevel_transform = true);
void _create_preview(const Vector<String> &files) const;
void _remove_preview();
bool _cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node);
@@ -454,7 +454,7 @@ public:
void update_surface() { surface->update(); }
void update_transform_gizmo_view();
- void set_can_preview(Camera *p_preview);
+ void set_can_preview(Camera3D *p_preview);
void set_state(const Dictionary &p_state);
Dictionary get_state() const;
void reset();
@@ -463,19 +463,19 @@ public:
void focus_selection();
void assign_pending_data_pointers(
- Spatial *p_preview_node,
+ Node3D *p_preview_node,
AABB *p_preview_bounds,
AcceptDialog *p_accept);
SubViewport *get_viewport_node() { return viewport; }
- Camera *get_camera() { return camera; } // return the default camera object.
+ Camera3D *get_camera() { return camera; } // return the default camera object.
- SpatialEditorViewport(SpatialEditor *p_spatial_editor, EditorNode *p_editor, int p_index);
+ Node3DEditorViewport(Node3DEditor *p_spatial_editor, EditorNode *p_editor, int p_index);
};
-class SpatialEditorSelectedItem : public Object {
+class Node3DEditorSelectedItem : public Object {
- GDCLASS(SpatialEditorSelectedItem, Object);
+ GDCLASS(Node3DEditorSelectedItem, Object);
public:
AABB aabb;
@@ -483,19 +483,19 @@ public:
Transform original_local;
Transform last_xform; // last transform
bool last_xform_dirty;
- Spatial *sp;
+ Node3D *sp;
RID sbox_instance;
- SpatialEditorSelectedItem() {
+ Node3DEditorSelectedItem() {
sp = NULL;
last_xform_dirty = true;
}
- ~SpatialEditorSelectedItem();
+ ~Node3DEditorSelectedItem();
};
-class SpatialEditorViewportContainer : public Container {
+class Node3DEditorViewportContainer : public Container {
- GDCLASS(SpatialEditorViewportContainer, Container);
+ GDCLASS(Node3DEditorViewportContainer, Container);
public:
enum View {
@@ -531,12 +531,12 @@ public:
void set_view(View p_view);
View get_view();
- SpatialEditorViewportContainer();
+ Node3DEditorViewportContainer();
};
-class SpatialEditor : public VBoxContainer {
+class Node3DEditor : public VBoxContainer {
- GDCLASS(SpatialEditor, VBoxContainer);
+ GDCLASS(Node3DEditor, VBoxContainer);
public:
static const unsigned int VIEWPORTS_COUNT = 4;
@@ -568,8 +568,8 @@ private:
EditorNode *editor;
EditorSelection *editor_selection;
- SpatialEditorViewportContainer *viewport_base;
- SpatialEditorViewport *viewports[VIEWPORTS_COUNT];
+ Node3DEditorViewportContainer *viewport_base;
+ Node3DEditorViewport *viewports[VIEWPORTS_COUNT];
VSplitContainer *shader_split;
HSplitContainer *palette_split;
@@ -609,7 +609,7 @@ private:
Ref<StandardMaterial3D> cursor_material;
// Scene drag and drop support
- Spatial *preview_node;
+ Node3D *preview_node;
AABB preview_bounds;
struct Gizmo {
@@ -709,19 +709,19 @@ private:
Ref<Environment> viewport_environment;
- Spatial *selected;
+ Node3D *selected;
void _request_gizmo(Object *p_obj);
- static SpatialEditor *singleton;
+ static Node3DEditor *singleton;
void _node_removed(Node *p_node);
- Vector<Ref<EditorSpatialGizmoPlugin>> gizmo_plugins_by_priority;
- Vector<Ref<EditorSpatialGizmoPlugin>> gizmo_plugins_by_name;
+ Vector<Ref<EditorNode3DGizmoPlugin>> gizmo_plugins_by_priority;
+ Vector<Ref<EditorNode3DGizmoPlugin>> gizmo_plugins_by_name;
void _register_all_gizmos();
- SpatialEditor();
+ Node3DEditor();
bool is_any_freelook_active() const;
@@ -735,7 +735,7 @@ protected:
static void _bind_methods();
public:
- static SpatialEditor *get_singleton() { return singleton; }
+ static Node3DEditor *get_singleton() { return singleton; }
void snap_cursor_to_plane(const Plane &p_plane);
Vector3 snap_point(Vector3 p_target, Vector3 p_start = Vector3(0, 0, 0)) const;
@@ -748,7 +748,7 @@ public:
bool is_gizmo_visible() const { return gizmo.visible; }
ToolMode get_tool_mode() const { return tool_mode; }
- bool are_local_coords_enabled() const { return tool_option_button[SpatialEditor::TOOL_OPT_LOCAL_COORDS]->is_pressed(); }
+ bool are_local_coords_enabled() const { return tool_option_button[Node3DEditor::TOOL_OPT_LOCAL_COORDS]->is_pressed(); }
bool is_snap_enabled() const { return snap_enabled ^ snap_key_enabled; }
float get_translate_snap() const;
float get_rotate_snap() const;
@@ -780,33 +780,33 @@ public:
VSplitContainer *get_shader_split();
HSplitContainer *get_palette_split();
- Spatial *get_selected() { return selected; }
+ Node3D *get_selected() { return selected; }
int get_over_gizmo_handle() const { return over_gizmo_handle; }
void set_over_gizmo_handle(int idx) { over_gizmo_handle = idx; }
- void set_can_preview(Camera *p_preview);
+ void set_can_preview(Camera3D *p_preview);
- SpatialEditorViewport *get_editor_viewport(int p_idx) {
+ Node3DEditorViewport *get_editor_viewport(int p_idx) {
ERR_FAIL_INDEX_V(p_idx, static_cast<int>(VIEWPORTS_COUNT), NULL);
return viewports[p_idx];
}
- void add_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> p_plugin);
- void remove_gizmo_plugin(Ref<EditorSpatialGizmoPlugin> p_plugin);
+ void add_gizmo_plugin(Ref<EditorNode3DGizmoPlugin> p_plugin);
+ void remove_gizmo_plugin(Ref<EditorNode3DGizmoPlugin> p_plugin);
- void edit(Spatial *p_spatial);
+ void edit(Node3D *p_spatial);
void clear();
- SpatialEditor(EditorNode *p_editor);
- ~SpatialEditor();
+ Node3DEditor(EditorNode *p_editor);
+ ~Node3DEditor();
};
-class SpatialEditorPlugin : public EditorPlugin {
+class Node3DEditorPlugin : public EditorPlugin {
- GDCLASS(SpatialEditorPlugin, EditorPlugin);
+ GDCLASS(Node3DEditorPlugin, EditorPlugin);
- SpatialEditor *spatial_editor;
+ Node3DEditor *spatial_editor;
EditorNode *editor;
protected:
@@ -815,7 +815,7 @@ protected:
public:
void snap_cursor_to_plane(const Plane &p_plane);
- SpatialEditor *get_spatial_editor() { return spatial_editor; }
+ Node3DEditor *get_spatial_editor() { return spatial_editor; }
virtual String get_name() const { return "3D"; }
bool has_main_screen() const { return true; }
virtual void make_visible(bool p_visible);
@@ -828,13 +828,13 @@ public:
virtual void edited_scene_changed();
- SpatialEditorPlugin(EditorNode *p_node);
- ~SpatialEditorPlugin();
+ Node3DEditorPlugin(EditorNode *p_node);
+ ~Node3DEditorPlugin();
};
-class EditorSpatialGizmoPlugin : public Resource {
+class EditorNode3DGizmoPlugin : public Resource {
- GDCLASS(EditorSpatialGizmoPlugin, Resource);
+ GDCLASS(EditorNode3DGizmoPlugin, Resource);
public:
static const int VISIBLE = 0;
@@ -843,13 +843,13 @@ public:
private:
int current_state;
- List<EditorSpatialGizmo *> current_gizmos;
+ List<EditorNode3DGizmo *> current_gizmos;
HashMap<String, Vector<Ref<StandardMaterial3D>>> materials;
protected:
static void _bind_methods();
- virtual bool has_gizmo(Spatial *p_spatial);
- virtual Ref<EditorSpatialGizmo> create_gizmo(Spatial *p_spatial);
+ virtual bool has_gizmo(Node3D *p_spatial);
+ virtual Ref<EditorNode3DGizmo> create_gizmo(Node3D *p_spatial);
public:
void create_material(const String &p_name, const Color &p_color, bool p_billboard = false, bool p_on_top = false, bool p_use_vertex_color = false);
@@ -857,27 +857,27 @@ public:
void create_handle_material(const String &p_name, bool p_billboard = false);
void add_material(const String &p_name, Ref<StandardMaterial3D> p_material);
- Ref<StandardMaterial3D> get_material(const String &p_name, const Ref<EditorSpatialGizmo> &p_gizmo = Ref<EditorSpatialGizmo>());
+ Ref<StandardMaterial3D> get_material(const String &p_name, const Ref<EditorNode3DGizmo> &p_gizmo = Ref<EditorNode3DGizmo>());
virtual String get_name() const;
virtual int get_priority() const;
virtual bool can_be_hidden() const;
virtual bool is_selectable_when_hidden() const;
- virtual void redraw(EditorSpatialGizmo *p_gizmo);
- virtual String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const;
- virtual Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const;
- virtual void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point);
- virtual void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
- virtual bool is_handle_highlighted(const EditorSpatialGizmo *p_gizmo, int p_idx) const;
+ virtual void redraw(EditorNode3DGizmo *p_gizmo);
+ virtual String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ virtual Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ virtual void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point);
+ virtual void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
+ virtual bool is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int p_idx) const;
- Ref<EditorSpatialGizmo> get_gizmo(Spatial *p_spatial);
+ Ref<EditorNode3DGizmo> get_gizmo(Node3D *p_spatial);
void set_state(int p_state);
int get_state() const;
- void unregister_gizmo(EditorSpatialGizmo *p_gizmo);
+ void unregister_gizmo(EditorNode3DGizmo *p_gizmo);
- EditorSpatialGizmoPlugin();
- virtual ~EditorSpatialGizmoPlugin();
+ EditorNode3DGizmoPlugin();
+ virtual ~EditorNode3DGizmoPlugin();
};
#endif
diff --git a/editor/plugins/sprite_editor_plugin.cpp b/editor/plugins/sprite_editor_plugin.cpp
index 251957eaa5..3eb76946a6 100644
--- a/editor/plugins/sprite_editor_plugin.cpp
+++ b/editor/plugins/sprite_editor_plugin.cpp
@@ -47,7 +47,7 @@ void SpriteEditor::_node_removed(Node *p_node) {
}
}
-void SpriteEditor::edit(Sprite *p_sprite) {
+void SpriteEditor::edit(Sprite2D *p_sprite) {
node = p_sprite;
}
@@ -578,12 +578,12 @@ SpriteEditor::SpriteEditor() {
void SpriteEditorPlugin::edit(Object *p_object) {
- sprite_editor->edit(Object::cast_to<Sprite>(p_object));
+ sprite_editor->edit(Object::cast_to<Sprite2D>(p_object));
}
bool SpriteEditorPlugin::handles(Object *p_object) const {
- return p_object->is_class("Sprite");
+ return p_object->is_class("Sprite2D");
}
void SpriteEditorPlugin::make_visible(bool p_visible) {
diff --git a/editor/plugins/sprite_editor_plugin.h b/editor/plugins/sprite_editor_plugin.h
index 998851b6ad..b55446469c 100644
--- a/editor/plugins/sprite_editor_plugin.h
+++ b/editor/plugins/sprite_editor_plugin.h
@@ -33,7 +33,7 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
-#include "scene/2d/sprite.h"
+#include "scene/2d/sprite_2d.h"
#include "scene/gui/spin_box.h"
class SpriteEditor : public Control {
@@ -49,7 +49,7 @@ class SpriteEditor : public Control {
Menu selected_menu_item;
- Sprite *node;
+ Sprite2D *node;
MenuButton *options;
@@ -92,7 +92,7 @@ protected:
static void _bind_methods();
public:
- void edit(Sprite *p_sprite);
+ void edit(Sprite2D *p_sprite);
SpriteEditor();
};
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index 776b80d73b..76e60bb014 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -485,7 +485,7 @@ static void _find_anim_sprites(Node *p_node, List<Node *> *r_nodes, Ref<SpriteFr
return;
{
- AnimatedSprite *as = Object::cast_to<AnimatedSprite>(p_node);
+ AnimatedSprite2D *as = Object::cast_to<AnimatedSprite2D>(p_node);
if (as && as->get_sprite_frames() == p_sfames) {
r_nodes->push_back(p_node);
}
@@ -1068,11 +1068,17 @@ void SpriteFramesEditorPlugin::edit(Object *p_object) {
frames_editor->set_undo_redo(&get_undo_redo());
SpriteFrames *s;
- AnimatedSprite *animated_sprite = Object::cast_to<AnimatedSprite>(p_object);
+ AnimatedSprite2D *animated_sprite = Object::cast_to<AnimatedSprite2D>(p_object);
if (animated_sprite) {
s = *animated_sprite->get_sprite_frames();
} else {
- s = Object::cast_to<SpriteFrames>(p_object);
+ AnimatedSprite3D *animated_sprite_3d = Object::cast_to<AnimatedSprite3D>(p_object);
+ if (animated_sprite_3d) {
+ s = *animated_sprite_3d->get_sprite_frames();
+ } else {
+
+ s = Object::cast_to<SpriteFrames>(p_object);
+ }
}
frames_editor->edit(s);
@@ -1080,9 +1086,12 @@ void SpriteFramesEditorPlugin::edit(Object *p_object) {
bool SpriteFramesEditorPlugin::handles(Object *p_object) const {
- AnimatedSprite *animated_sprite = Object::cast_to<AnimatedSprite>(p_object);
+ AnimatedSprite2D *animated_sprite = Object::cast_to<AnimatedSprite2D>(p_object);
+ AnimatedSprite3D *animated_sprite_3d = Object::cast_to<AnimatedSprite3D>(p_object);
if (animated_sprite && *animated_sprite->get_sprite_frames()) {
return true;
+ } else if (animated_sprite_3d && *animated_sprite_3d->get_sprite_frames()) {
+ return true;
} else {
return p_object->is_class("SpriteFrames");
}
diff --git a/editor/plugins/sprite_frames_editor_plugin.h b/editor/plugins/sprite_frames_editor_plugin.h
index 1fa93b5c47..89d9bc6fd3 100644
--- a/editor/plugins/sprite_frames_editor_plugin.h
+++ b/editor/plugins/sprite_frames_editor_plugin.h
@@ -33,7 +33,7 @@
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
-#include "scene/2d/animated_sprite.h"
+#include "scene/2d/animated_sprite_2d.h"
#include "scene/gui/dialogs.h"
#include "scene/gui/file_dialog.h"
#include "scene/gui/split_container.h"
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index 2186c7d5c3..029159180c 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -800,7 +800,7 @@ Sprite3D *TextureRegionEditor::get_sprite_3d() {
return node_sprite_3d;
}
-Sprite *TextureRegionEditor::get_sprite() {
+Sprite2D *TextureRegionEditor::get_sprite() {
return node_sprite;
}
@@ -816,7 +816,7 @@ void TextureRegionEditor::edit(Object *p_obj) {
if (atlas_tex.is_valid())
atlas_tex->remove_change_receptor(this);
if (p_obj) {
- node_sprite = Object::cast_to<Sprite>(p_obj);
+ node_sprite = Object::cast_to<Sprite2D>(p_obj);
node_sprite_3d = Object::cast_to<Sprite3D>(p_obj);
node_ninepatch = Object::cast_to<NinePatchRect>(p_obj);
if (Object::cast_to<StyleBoxTexture>(p_obj))
@@ -1037,7 +1037,7 @@ void TextureRegionEditorPlugin::edit(Object *p_object) {
}
bool TextureRegionEditorPlugin::handles(Object *p_object) const {
- return p_object->is_class("Sprite") || p_object->is_class("Sprite3D") || p_object->is_class("NinePatchRect") || p_object->is_class("StyleBoxTexture") || p_object->is_class("AtlasTexture");
+ return p_object->is_class("Sprite2D") || p_object->is_class("Sprite3D") || p_object->is_class("NinePatchRect") || p_object->is_class("StyleBoxTexture") || p_object->is_class("AtlasTexture");
}
void TextureRegionEditorPlugin::_editor_visiblity_changed() {
diff --git a/editor/plugins/texture_region_editor_plugin.h b/editor/plugins/texture_region_editor_plugin.h
index edc55071b7..c6cd648842 100644
--- a/editor/plugins/texture_region_editor_plugin.h
+++ b/editor/plugins/texture_region_editor_plugin.h
@@ -34,7 +34,7 @@
#include "canvas_item_editor_plugin.h"
#include "editor/editor_node.h"
#include "editor/editor_plugin.h"
-#include "scene/2d/sprite.h"
+#include "scene/2d/sprite_2d.h"
#include "scene/3d/sprite_3d.h"
#include "scene/gui/nine_patch_rect.h"
#include "scene/resources/style_box.h"
@@ -84,7 +84,7 @@ class TextureRegionEditor : public VBoxContainer {
Vector2 snap_step;
Vector2 snap_separation;
- Sprite *node_sprite;
+ Sprite2D *node_sprite;
Sprite3D *node_sprite_3d;
NinePatchRect *node_ninepatch;
Ref<StyleBoxTexture> obj_styleBox;
@@ -136,7 +136,7 @@ public:
bool is_atlas_texture();
bool is_ninepatch();
Sprite3D *get_sprite_3d();
- Sprite *get_sprite();
+ Sprite2D *get_sprite();
void edit(Object *p_obj);
TextureRegionEditor(EditorNode *p_editor);
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index 5d13b834cf..f5ffcc1a28 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -35,7 +35,7 @@
#include "editor/editor_scale.h"
#include "editor/plugins/canvas_item_editor_plugin.h"
#include "scene/2d/physics_body_2d.h"
-#include "scene/2d/sprite.h"
+#include "scene/2d/sprite_2d.h"
void TileSetEditor::edit(const Ref<TileSet> &p_tileset) {
@@ -53,7 +53,7 @@ void TileSetEditor::_import_node(Node *p_node, Ref<TileSet> p_library) {
Node *child = p_node->get_child(i);
- if (!Object::cast_to<Sprite>(child)) {
+ if (!Object::cast_to<Sprite2D>(child)) {
if (child->get_child_count() > 0) {
_import_node(child, p_library);
}
@@ -61,7 +61,7 @@ void TileSetEditor::_import_node(Node *p_node, Ref<TileSet> p_library) {
continue;
}
- Sprite *mi = Object::cast_to<Sprite>(child);
+ Sprite2D *mi = Object::cast_to<Sprite2D>(child);
Ref<Texture2D> texture = mi->get_texture();
Ref<Texture2D> normal_map = mi->get_normal_map();
Ref<ShaderMaterial> material = mi->get_material();
@@ -601,7 +601,7 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
workspace->set_draw_behind_parent(true);
workspace_overlay->add_child(workspace);
- preview = memnew(Sprite);
+ preview = memnew(Sprite2D);
workspace->add_child(preview);
preview->set_centered(false);
preview->set_draw_behind_parent(true);
diff --git a/editor/plugins/tile_set_editor_plugin.h b/editor/plugins/tile_set_editor_plugin.h
index 0d106ed454..53f8e8c4d6 100644
--- a/editor/plugins/tile_set_editor_plugin.h
+++ b/editor/plugins/tile_set_editor_plugin.h
@@ -32,7 +32,7 @@
#define TILE_SET_EDITOR_PLUGIN_H
#include "editor/editor_node.h"
-#include "scene/2d/sprite.h"
+#include "scene/2d/sprite_2d.h"
#include "scene/resources/concave_polygon_shape_2d.h"
#include "scene/resources/convex_polygon_shape_2d.h"
#include "scene/resources/tile_set.h"
@@ -136,7 +136,7 @@ class TileSetEditor : public HSplitContainer {
Ref<NavigationPolygon> edited_navigation_shape;
int current_item_index;
- Sprite *preview;
+ Sprite2D *preview;
ScrollContainer *scroll;
Label *empty_message;
Control *workspace_container;
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 613ba53fed..186a569183 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -367,8 +367,8 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
if (ClassDB::is_parent_class(current_edited_scene_root->get_class_name(), "Node2D"))
preferred = "Node2D";
- else if (ClassDB::is_parent_class(current_edited_scene_root->get_class_name(), "Spatial"))
- preferred = "Spatial";
+ else if (ClassDB::is_parent_class(current_edited_scene_root->get_class_name(), "Node3D"))
+ preferred = "Node3D";
}
create_dialog->set_preferred_search_result_type(preferred);
create_dialog->popup_create(true);
@@ -984,7 +984,7 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) {
} else {
switch (p_tool) {
case TOOL_CREATE_2D_SCENE: new_node = memnew(Node2D); break;
- case TOOL_CREATE_3D_SCENE: new_node = memnew(Spatial); break;
+ case TOOL_CREATE_3D_SCENE: new_node = memnew(Node3D); break;
case TOOL_CREATE_USER_INTERFACE: {
Control *node = memnew(Control);
node->set_anchors_and_margins_preset(PRESET_WIDE); //more useful for resizable UIs.
@@ -1053,7 +1053,7 @@ void SceneTreeDock::_notification(int p_what) {
scene_tree->connect("node_changed", callable_mp((CanvasItem *)canvas_item_plugin->get_canvas_item_editor()->get_viewport_control(), &CanvasItem::update));
}
- SpatialEditorPlugin *spatial_editor_plugin = Object::cast_to<SpatialEditorPlugin>(editor_data->get_editor("3D"));
+ Node3DEditorPlugin *spatial_editor_plugin = Object::cast_to<Node3DEditorPlugin>(editor_data->get_editor("3D"));
spatial_editor_plugin->get_spatial_editor()->connect_compat("item_lock_status_changed", scene_tree, "_update_tree");
spatial_editor_plugin->get_spatial_editor()->connect_compat("item_group_status_changed", scene_tree, "_update_tree");
@@ -1102,7 +1102,7 @@ void SceneTreeDock::_notification(int p_what) {
button_3d = memnew(Button);
beginner_node_shortcuts->add_child(button_3d);
button_3d->set_text(TTR("3D Scene"));
- button_3d->set_icon(get_theme_icon("Spatial", "EditorIcons"));
+ button_3d->set_icon(get_theme_icon("Node3D", "EditorIcons"));
button_3d->connect("pressed", callable_mp(this, &SceneTreeDock::_tool_selected), make_binds(TOOL_CREATE_3D_SCENE, false));
Button *button_ui = memnew(Button);
@@ -1614,8 +1614,8 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V
if (p_keep_global_xform) {
if (Object::cast_to<Node2D>(node))
editor_data->get_undo_redo().add_do_method(node, "set_global_transform", Object::cast_to<Node2D>(node)->get_global_transform());
- if (Object::cast_to<Spatial>(node))
- editor_data->get_undo_redo().add_do_method(node, "set_global_transform", Object::cast_to<Spatial>(node)->get_global_transform());
+ if (Object::cast_to<Node3D>(node))
+ editor_data->get_undo_redo().add_do_method(node, "set_global_transform", Object::cast_to<Node3D>(node)->get_global_transform());
if (Object::cast_to<Control>(node))
editor_data->get_undo_redo().add_do_method(node, "set_global_position", Object::cast_to<Control>(node)->get_global_position());
}
@@ -1655,8 +1655,8 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V
if (p_keep_global_xform) {
if (Object::cast_to<Node2D>(node))
editor_data->get_undo_redo().add_undo_method(node, "set_transform", Object::cast_to<Node2D>(node)->get_transform());
- if (Object::cast_to<Spatial>(node))
- editor_data->get_undo_redo().add_undo_method(node, "set_transform", Object::cast_to<Spatial>(node)->get_transform());
+ if (Object::cast_to<Node3D>(node))
+ editor_data->get_undo_redo().add_undo_method(node, "set_transform", Object::cast_to<Node3D>(node)->get_transform());
if (Object::cast_to<Control>(node))
editor_data->get_undo_redo().add_undo_method(node, "set_position", Object::cast_to<Control>(node)->get_position());
}
@@ -1777,7 +1777,7 @@ void SceneTreeDock::_toggle_editable_children(Node *p_node) {
if (editable)
p_node->set_scene_instance_load_placeholder(false);
- SpatialEditor::get_singleton()->update_all_gizmos(p_node);
+ Node3DEditor::get_singleton()->update_all_gizmos(p_node);
scene_tree->update_tree();
}
@@ -2568,7 +2568,7 @@ void SceneTreeDock::_focus_node() {
CanvasItemEditorPlugin *editor = Object::cast_to<CanvasItemEditorPlugin>(editor_data->get_editor("2D"));
editor->get_canvas_item_editor()->focus_selection();
} else {
- SpatialEditorPlugin *editor = Object::cast_to<SpatialEditorPlugin>(editor_data->get_editor("3D"));
+ Node3DEditorPlugin *editor = Object::cast_to<Node3DEditorPlugin>(editor_data->get_editor("3D"));
editor->get_spatial_editor()->get_editor_viewport(0)->focus_selection();
}
}
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index a290e57a4e..831b7b6775 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -92,7 +92,7 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i
} else if (p_id == BUTTON_LOCK) {
undo_redo->create_action(TTR("Unlock Node"));
- if (n->is_class("CanvasItem") || n->is_class("Spatial")) {
+ if (n->is_class("CanvasItem") || n->is_class("Node3D")) {
undo_redo->add_do_method(n, "remove_meta", "_edit_lock_");
undo_redo->add_undo_method(n, "set_meta", "_edit_lock_", true);
@@ -112,7 +112,7 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i
} else if (p_id == BUTTON_GROUP) {
undo_redo->create_action(TTR("Button Group"));
- if (n->is_class("CanvasItem") || n->is_class("Spatial")) {
+ if (n->is_class("CanvasItem") || n->is_class("Node3D")) {
undo_redo->add_do_method(n, "remove_meta", "_edit_group_");
undo_redo->add_undo_method(n, "set_meta", "_edit_group_", true);
@@ -354,7 +354,7 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
p_node->connect("visibility_changed", callable_mp(this, &SceneTreeEditor::_node_visibility_changed), varray(p_node));
_update_visibility_color(p_node, item);
- } else if (p_node->is_class("Spatial")) {
+ } else if (p_node->is_class("Node3D")) {
bool is_locked = p_node->has_meta("_edit_lock_");
if (is_locked)
@@ -457,7 +457,7 @@ void SceneTreeEditor::_node_visibility_changed(Node *p_node) {
if (p_node->is_class("CanvasItem")) {
visible = p_node->call("is_visible");
CanvasItemEditor::get_singleton()->get_viewport_control()->update();
- } else if (p_node->is_class("Spatial")) {
+ } else if (p_node->is_class("Node3D")) {
visible = p_node->call("is_visible");
}
@@ -470,7 +470,7 @@ void SceneTreeEditor::_node_visibility_changed(Node *p_node) {
}
void SceneTreeEditor::_update_visibility_color(Node *p_node, TreeItem *p_item) {
- if (p_node->is_class("CanvasItem") || p_node->is_class("Spatial")) {
+ if (p_node->is_class("CanvasItem") || p_node->is_class("Node3D")) {
Color color(1, 1, 1, 1);
bool visible_on_screen = p_node->call("is_visible_in_tree");
if (!visible_on_screen) {
@@ -498,7 +498,7 @@ void SceneTreeEditor::_node_removed(Node *p_node) {
if (p_node->is_connected("script_changed", callable_mp(this, &SceneTreeEditor::_node_script_changed)))
p_node->disconnect("script_changed", callable_mp(this, &SceneTreeEditor::_node_script_changed));
- if (p_node->is_class("Spatial") || p_node->is_class("CanvasItem")) {
+ if (p_node->is_class("Node3D") || p_node->is_class("CanvasItem")) {
if (p_node->is_connected("visibility_changed", callable_mp(this, &SceneTreeEditor::_node_visibility_changed)))
p_node->disconnect("visibility_changed", callable_mp(this, &SceneTreeEditor::_node_visibility_changed));
}
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index a3030e7380..a7d014be33 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -34,39 +34,39 @@
#include "core/math/quick_hull.h"
#include "scene/3d/audio_stream_player_3d.h"
#include "scene/3d/baked_lightmap.h"
-#include "scene/3d/collision_polygon.h"
-#include "scene/3d/collision_shape.h"
-#include "scene/3d/cpu_particles.h"
+#include "scene/3d/collision_polygon_3d.h"
+#include "scene/3d/collision_shape_3d.h"
+#include "scene/3d/cpu_particles_3d.h"
#include "scene/3d/gi_probe.h"
-#include "scene/3d/light.h"
-#include "scene/3d/listener.h"
-#include "scene/3d/mesh_instance.h"
-#include "scene/3d/navigation_region.h"
-#include "scene/3d/particles.h"
-#include "scene/3d/physics_joint.h"
+#include "scene/3d/gpu_particles_3d.h"
+#include "scene/3d/light_3d.h"
+#include "scene/3d/listener_3d.h"
+#include "scene/3d/mesh_instance_3d.h"
+#include "scene/3d/navigation_region_3d.h"
+#include "scene/3d/physics_joint_3d.h"
#include "scene/3d/position_3d.h"
-#include "scene/3d/ray_cast.h"
+#include "scene/3d/ray_cast_3d.h"
#include "scene/3d/reflection_probe.h"
-#include "scene/3d/soft_body.h"
-#include "scene/3d/spring_arm.h"
+#include "scene/3d/soft_body_3d.h"
+#include "scene/3d/spring_arm_3d.h"
#include "scene/3d/sprite_3d.h"
#include "scene/3d/vehicle_body.h"
-#include "scene/3d/visibility_notifier.h"
-#include "scene/resources/box_shape.h"
-#include "scene/resources/capsule_shape.h"
-#include "scene/resources/concave_polygon_shape.h"
-#include "scene/resources/convex_polygon_shape.h"
-#include "scene/resources/cylinder_shape.h"
+#include "scene/3d/visibility_notifier_3d.h"
+#include "scene/resources/box_shape_3d.h"
+#include "scene/resources/capsule_shape_3d.h"
+#include "scene/resources/concave_polygon_shape_3d.h"
+#include "scene/resources/convex_polygon_shape_3d.h"
+#include "scene/resources/cylinder_shape_3d.h"
#include "scene/resources/height_map_shape.h"
#include "scene/resources/primitive_meshes.h"
#include "scene/resources/ray_shape.h"
-#include "scene/resources/sphere_shape.h"
+#include "scene/resources/sphere_shape_3d.h"
#include "scene/resources/surface_tool.h"
-#include "scene/resources/world_margin_shape.h"
+#include "scene/resources/world_margin_shape_3d.h"
#define HANDLE_HALF_SIZE 9.5
-bool EditorSpatialGizmo::is_editable() const {
+bool EditorNode3DGizmo::is_editable() const {
ERR_FAIL_COND_V(!spatial_node, false);
Node *edited_root = spatial_node->get_tree()->get_edited_scene_root();
@@ -81,7 +81,7 @@ bool EditorSpatialGizmo::is_editable() const {
return false;
}
-void EditorSpatialGizmo::clear() {
+void EditorNode3DGizmo::clear() {
for (int i = 0; i < instances.size(); i++) {
@@ -97,7 +97,7 @@ void EditorSpatialGizmo::clear() {
secondary_handles.clear();
}
-void EditorSpatialGizmo::redraw() {
+void EditorNode3DGizmo::redraw() {
if (get_script_instance() && get_script_instance()->has_method("redraw")) {
get_script_instance()->call("redraw");
@@ -108,7 +108,7 @@ void EditorSpatialGizmo::redraw() {
gizmo_plugin->redraw(this);
}
-String EditorSpatialGizmo::get_handle_name(int p_idx) const {
+String EditorNode3DGizmo::get_handle_name(int p_idx) const {
if (get_script_instance() && get_script_instance()->has_method("get_handle_name")) {
return get_script_instance()->call("get_handle_name", p_idx);
@@ -118,7 +118,7 @@ String EditorSpatialGizmo::get_handle_name(int p_idx) const {
return gizmo_plugin->get_handle_name(this, p_idx);
}
-bool EditorSpatialGizmo::is_handle_highlighted(int p_idx) const {
+bool EditorNode3DGizmo::is_handle_highlighted(int p_idx) const {
if (get_script_instance() && get_script_instance()->has_method("is_handle_highlighted")) {
return get_script_instance()->call("is_handle_highlighted", p_idx);
@@ -128,7 +128,7 @@ bool EditorSpatialGizmo::is_handle_highlighted(int p_idx) const {
return gizmo_plugin->is_handle_highlighted(this, p_idx);
}
-Variant EditorSpatialGizmo::get_handle_value(int p_idx) {
+Variant EditorNode3DGizmo::get_handle_value(int p_idx) {
if (get_script_instance() && get_script_instance()->has_method("get_handle_value")) {
return get_script_instance()->call("get_handle_value", p_idx);
@@ -138,7 +138,7 @@ Variant EditorSpatialGizmo::get_handle_value(int p_idx) {
return gizmo_plugin->get_handle_value(this, p_idx);
}
-void EditorSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_point) {
+void EditorNode3DGizmo::set_handle(int p_idx, Camera3D *p_camera, const Point2 &p_point) {
if (get_script_instance() && get_script_instance()->has_method("set_handle")) {
get_script_instance()->call("set_handle", p_idx, p_camera, p_point);
@@ -149,7 +149,7 @@ void EditorSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p
gizmo_plugin->set_handle(this, p_idx, p_camera, p_point);
}
-void EditorSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) {
+void EditorNode3DGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) {
if (get_script_instance() && get_script_instance()->has_method("commit_handle")) {
get_script_instance()->call("commit_handle", p_idx, p_restore, p_cancel);
@@ -160,13 +160,13 @@ void EditorSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool
gizmo_plugin->commit_handle(this, p_idx, p_restore, p_cancel);
}
-void EditorSpatialGizmo::set_spatial_node(Spatial *p_node) {
+void EditorNode3DGizmo::set_spatial_node(Node3D *p_node) {
ERR_FAIL_NULL(p_node);
spatial_node = p_node;
}
-void EditorSpatialGizmo::Instance::create_instance(Spatial *p_base, bool p_hidden) {
+void EditorNode3DGizmo::Instance::create_instance(Node3D *p_base, bool p_hidden) {
instance = VS::get_singleton()->instance_create2(mesh->get_rid(), p_base->get_world()->get_scenario());
VS::get_singleton()->instance_attach_object_instance_id(instance, p_base->get_instance_id());
@@ -176,11 +176,11 @@ void EditorSpatialGizmo::Instance::create_instance(Spatial *p_base, bool p_hidde
if (extra_margin)
VS::get_singleton()->instance_set_extra_visibility_margin(instance, 1);
VS::get_singleton()->instance_geometry_set_cast_shadows_setting(instance, VS::SHADOW_CASTING_SETTING_OFF);
- int layer = p_hidden ? 0 : 1 << SpatialEditorViewport::GIZMO_EDIT_LAYER;
+ int layer = p_hidden ? 0 : 1 << Node3DEditorViewport::GIZMO_EDIT_LAYER;
VS::get_singleton()->instance_set_layer_mask(instance, layer); //gizmos are 26
}
-void EditorSpatialGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard, const Ref<SkinReference> &p_skin_reference, const Ref<Material> &p_material) {
+void EditorNode3DGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard, const Ref<SkinReference> &p_skin_reference, const Ref<Material> &p_material) {
ERR_FAIL_COND(!spatial_node);
Instance ins;
@@ -200,7 +200,7 @@ void EditorSpatialGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard
instances.push_back(ins);
}
-void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Material> &p_material, bool p_billboard, const Color &p_modulate) {
+void EditorNode3DGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Material> &p_material, bool p_billboard, const Color &p_modulate) {
if (p_lines.empty()) {
return;
}
@@ -252,7 +252,7 @@ void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mat
instances.push_back(ins);
}
-void EditorSpatialGizmo::add_unscaled_billboard(const Ref<Material> &p_material, float p_scale, const Color &p_modulate) {
+void EditorNode3DGizmo::add_unscaled_billboard(const Ref<Material> &p_material, float p_scale, const Color &p_modulate) {
ERR_FAIL_COND(!spatial_node);
Instance ins;
@@ -318,11 +318,11 @@ void EditorSpatialGizmo::add_unscaled_billboard(const Ref<Material> &p_material,
instances.push_back(ins);
}
-void EditorSpatialGizmo::add_collision_triangles(const Ref<TriangleMesh> &p_tmesh) {
+void EditorNode3DGizmo::add_collision_triangles(const Ref<TriangleMesh> &p_tmesh) {
collision_mesh = p_tmesh;
}
-void EditorSpatialGizmo::add_collision_segments(const Vector<Vector3> &p_lines) {
+void EditorNode3DGizmo::add_collision_segments(const Vector<Vector3> &p_lines) {
int from = collision_segments.size();
collision_segments.resize(from + p_lines.size());
@@ -332,7 +332,7 @@ void EditorSpatialGizmo::add_collision_segments(const Vector<Vector3> &p_lines)
}
}
-void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref<Material> &p_material, bool p_billboard, bool p_secondary) {
+void EditorNode3DGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref<Material> &p_material, bool p_billboard, bool p_secondary) {
billboard_handle = p_billboard;
@@ -358,7 +358,7 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref
if (is_handle_highlighted(i))
col = Color(0, 0, 1, 0.9);
- if (SpatialEditor::get_singleton()->get_over_gizmo_handle() != i)
+ if (Node3DEditor::get_singleton()->get_over_gizmo_handle() != i)
col.a = 0.8;
w[i] = col;
@@ -403,7 +403,7 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref
}
}
-void EditorSpatialGizmo::add_solid_box(Ref<Material> &p_material, Vector3 p_size, Vector3 p_position) {
+void EditorNode3DGizmo::add_solid_box(Ref<Material> &p_material, Vector3 p_size, Vector3 p_position) {
ERR_FAIL_COND(!spatial_node);
CubeMesh cubem;
@@ -425,7 +425,7 @@ void EditorSpatialGizmo::add_solid_box(Ref<Material> &p_material, Vector3 p_size
add_mesh(m);
}
-bool EditorSpatialGizmo::intersect_frustum(const Camera *p_camera, const Vector<Plane> &p_frustum) {
+bool EditorNode3DGizmo::intersect_frustum(const Camera3D *p_camera, const Vector<Plane> &p_frustum) {
ERR_FAIL_COND_V(!spatial_node, false);
ERR_FAIL_COND_V(!valid, false);
@@ -497,7 +497,7 @@ bool EditorSpatialGizmo::intersect_frustum(const Camera *p_camera, const Vector<
return false;
}
-bool EditorSpatialGizmo::intersect_ray(Camera *p_camera, const Point2 &p_point, Vector3 &r_pos, Vector3 &r_normal, int *r_gizmo_handle, bool p_sec_first) {
+bool EditorNode3DGizmo::intersect_ray(Camera3D *p_camera, const Point2 &p_point, Vector3 &r_pos, Vector3 &r_normal, int *r_gizmo_handle, bool p_sec_first) {
ERR_FAIL_COND_V(!spatial_node, false);
ERR_FAIL_COND_V(!valid, false);
@@ -574,7 +574,7 @@ bool EditorSpatialGizmo::intersect_ray(Camera *p_camera, const Point2 &p_point,
float scale = t.origin.distance_to(p_camera->get_camera_transform().origin);
- if (p_camera->get_projection() == Camera::PROJECTION_ORTHOGONAL) {
+ if (p_camera->get_projection() == Camera3D::PROJECTION_ORTHOGONAL) {
float aspect = p_camera->get_viewport()->get_visible_rect().size.aspect();
float size = p_camera->get_size();
scale = size / aspect;
@@ -689,7 +689,7 @@ bool EditorSpatialGizmo::intersect_ray(Camera *p_camera, const Point2 &p_point,
return false;
}
-void EditorSpatialGizmo::create() {
+void EditorNode3DGizmo::create() {
ERR_FAIL_COND(!spatial_node);
ERR_FAIL_COND(valid);
@@ -703,7 +703,7 @@ void EditorSpatialGizmo::create() {
transform();
}
-void EditorSpatialGizmo::transform() {
+void EditorNode3DGizmo::transform() {
ERR_FAIL_COND(!spatial_node);
ERR_FAIL_COND(!valid);
@@ -712,7 +712,7 @@ void EditorSpatialGizmo::transform() {
}
}
-void EditorSpatialGizmo::free() {
+void EditorNode3DGizmo::free() {
ERR_FAIL_COND(!spatial_node);
ERR_FAIL_COND(!valid);
@@ -729,31 +729,31 @@ void EditorSpatialGizmo::free() {
valid = false;
}
-void EditorSpatialGizmo::set_hidden(bool p_hidden) {
+void EditorNode3DGizmo::set_hidden(bool p_hidden) {
hidden = p_hidden;
- int layer = hidden ? 0 : 1 << SpatialEditorViewport::GIZMO_EDIT_LAYER;
+ int layer = hidden ? 0 : 1 << Node3DEditorViewport::GIZMO_EDIT_LAYER;
for (int i = 0; i < instances.size(); ++i) {
VS::get_singleton()->instance_set_layer_mask(instances[i].instance, layer);
}
}
-void EditorSpatialGizmo::set_plugin(EditorSpatialGizmoPlugin *p_plugin) {
+void EditorNode3DGizmo::set_plugin(EditorNode3DGizmoPlugin *p_plugin) {
gizmo_plugin = p_plugin;
}
-void EditorSpatialGizmo::_bind_methods() {
+void EditorNode3DGizmo::_bind_methods() {
- ClassDB::bind_method(D_METHOD("add_lines", "lines", "material", "billboard", "modulate"), &EditorSpatialGizmo::add_lines, DEFVAL(false), DEFVAL(Color(1, 1, 1)));
- ClassDB::bind_method(D_METHOD("add_mesh", "mesh", "billboard", "skeleton", "material"), &EditorSpatialGizmo::add_mesh, DEFVAL(false), DEFVAL(Ref<SkinReference>()), DEFVAL(Variant()));
- ClassDB::bind_method(D_METHOD("add_collision_segments", "segments"), &EditorSpatialGizmo::add_collision_segments);
- ClassDB::bind_method(D_METHOD("add_collision_triangles", "triangles"), &EditorSpatialGizmo::add_collision_triangles);
- ClassDB::bind_method(D_METHOD("add_unscaled_billboard", "material", "default_scale", "modulate"), &EditorSpatialGizmo::add_unscaled_billboard, DEFVAL(1), DEFVAL(Color(1, 1, 1)));
- ClassDB::bind_method(D_METHOD("add_handles", "handles", "material", "billboard", "secondary"), &EditorSpatialGizmo::add_handles, DEFVAL(false), DEFVAL(false));
- ClassDB::bind_method(D_METHOD("set_spatial_node", "node"), &EditorSpatialGizmo::_set_spatial_node);
- ClassDB::bind_method(D_METHOD("get_spatial_node"), &EditorSpatialGizmo::get_spatial_node);
- ClassDB::bind_method(D_METHOD("get_plugin"), &EditorSpatialGizmo::get_plugin);
- ClassDB::bind_method(D_METHOD("clear"), &EditorSpatialGizmo::clear);
- ClassDB::bind_method(D_METHOD("set_hidden", "hidden"), &EditorSpatialGizmo::set_hidden);
+ ClassDB::bind_method(D_METHOD("add_lines", "lines", "material", "billboard", "modulate"), &EditorNode3DGizmo::add_lines, DEFVAL(false), DEFVAL(Color(1, 1, 1)));
+ ClassDB::bind_method(D_METHOD("add_mesh", "mesh", "billboard", "skeleton", "material"), &EditorNode3DGizmo::add_mesh, DEFVAL(false), DEFVAL(Ref<SkinReference>()), DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("add_collision_segments", "segments"), &EditorNode3DGizmo::add_collision_segments);
+ ClassDB::bind_method(D_METHOD("add_collision_triangles", "triangles"), &EditorNode3DGizmo::add_collision_triangles);
+ ClassDB::bind_method(D_METHOD("add_unscaled_billboard", "material", "default_scale", "modulate"), &EditorNode3DGizmo::add_unscaled_billboard, DEFVAL(1), DEFVAL(Color(1, 1, 1)));
+ ClassDB::bind_method(D_METHOD("add_handles", "handles", "material", "billboard", "secondary"), &EditorNode3DGizmo::add_handles, DEFVAL(false), DEFVAL(false));
+ ClassDB::bind_method(D_METHOD("set_spatial_node", "node"), &EditorNode3DGizmo::_set_spatial_node);
+ ClassDB::bind_method(D_METHOD("get_spatial_node"), &EditorNode3DGizmo::get_spatial_node);
+ ClassDB::bind_method(D_METHOD("get_plugin"), &EditorNode3DGizmo::get_plugin);
+ ClassDB::bind_method(D_METHOD("clear"), &EditorNode3DGizmo::clear);
+ ClassDB::bind_method(D_METHOD("set_hidden", "hidden"), &EditorNode3DGizmo::set_hidden);
BIND_VMETHOD(MethodInfo("redraw"));
BIND_VMETHOD(MethodInfo(Variant::STRING, "get_handle_name", PropertyInfo(Variant::INT, "index")));
@@ -763,13 +763,13 @@ void EditorSpatialGizmo::_bind_methods() {
hvget.return_val.usage |= PROPERTY_USAGE_NIL_IS_VARIANT;
BIND_VMETHOD(hvget);
- BIND_VMETHOD(MethodInfo("set_handle", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera"), PropertyInfo(Variant::VECTOR2, "point")));
+ BIND_VMETHOD(MethodInfo("set_handle", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::OBJECT, "camera", PROPERTY_HINT_RESOURCE_TYPE, "Camera3D"), PropertyInfo(Variant::VECTOR2, "point")));
MethodInfo cm = MethodInfo("commit_handle", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::NIL, "restore"), PropertyInfo(Variant::BOOL, "cancel"));
cm.default_arguments.push_back(false);
BIND_VMETHOD(cm);
}
-EditorSpatialGizmo::EditorSpatialGizmo() {
+EditorNode3DGizmo::EditorNode3DGizmo() {
valid = false;
billboard_handle = false;
hidden = false;
@@ -781,13 +781,13 @@ EditorSpatialGizmo::EditorSpatialGizmo() {
selectable_icon_size = -1.0f;
}
-EditorSpatialGizmo::~EditorSpatialGizmo() {
+EditorNode3DGizmo::~EditorNode3DGizmo() {
if (gizmo_plugin != NULL) gizmo_plugin->unregister_gizmo(this);
clear();
}
-Vector3 EditorSpatialGizmo::get_handle_pos(int p_idx) const {
+Vector3 EditorNode3DGizmo::get_handle_pos(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, handles.size(), Vector3());
@@ -796,34 +796,34 @@ Vector3 EditorSpatialGizmo::get_handle_pos(int p_idx) const {
//// light gizmo
-LightSpatialGizmoPlugin::LightSpatialGizmoPlugin() {
+LightNode3DGizmoPlugin::LightNode3DGizmoPlugin() {
// Enable vertex colors for the materials below as the gizmo color depends on the light color.
create_material("lines_primary", Color(1, 1, 1), false, false, true);
create_material("lines_secondary", Color(1, 1, 1, 0.35), false, false, true);
create_material("lines_billboard", Color(1, 1, 1), true, false, true);
- create_icon_material("light_directional_icon", SpatialEditor::get_singleton()->get_theme_icon("GizmoDirectionalLight", "EditorIcons"));
- create_icon_material("light_omni_icon", SpatialEditor::get_singleton()->get_theme_icon("GizmoLight", "EditorIcons"));
- create_icon_material("light_spot_icon", SpatialEditor::get_singleton()->get_theme_icon("GizmoSpotLight", "EditorIcons"));
+ create_icon_material("light_directional_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoDirectionalLight", "EditorIcons"));
+ create_icon_material("light_omni_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoLight", "EditorIcons"));
+ create_icon_material("light_spot_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoSpotLight", "EditorIcons"));
create_handle_material("handles");
create_handle_material("handles_billboard", true);
}
-bool LightSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<Light>(p_spatial) != NULL;
+bool LightNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<Light3D>(p_spatial) != NULL;
}
-String LightSpatialGizmoPlugin::get_name() const {
+String LightNode3DGizmoPlugin::get_name() const {
return "Lights";
}
-int LightSpatialGizmoPlugin::get_priority() const {
+int LightNode3DGizmoPlugin::get_priority() const {
return -1;
}
-String LightSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const {
+String LightNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const {
if (p_idx == 0)
return "Radius";
@@ -831,13 +831,13 @@ String LightSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizm
return "Aperture";
}
-Variant LightSpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const {
+Variant LightNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const {
- Light *light = Object::cast_to<Light>(p_gizmo->get_spatial_node());
+ Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node());
if (p_idx == 0)
- return light->get_param(Light::PARAM_RANGE);
+ return light->get_param(Light3D::PARAM_RANGE);
if (p_idx == 1)
- return light->get_param(Light::PARAM_SPOT_ANGLE);
+ return light->get_param(Light3D::PARAM_SPOT_ANGLE);
return Variant();
}
@@ -871,9 +871,9 @@ static float _find_closest_angle_to_half_pi_arc(const Vector3 &p_from, const Vec
return a * 180.0 / Math_PI;
}
-void LightSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) {
+void LightNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) {
- Light *light = Object::cast_to<Light>(p_gizmo->get_spatial_node());
+ Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node());
Transform gt = light->get_global_transform();
Transform gi = gt.affine_inverse();
@@ -883,20 +883,20 @@ void LightSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx,
Vector3 s[2] = { gi.xform(ray_from), gi.xform(ray_from + ray_dir * 4096) };
if (p_idx == 0) {
- if (Object::cast_to<SpotLight>(light)) {
+ if (Object::cast_to<SpotLight3D>(light)) {
Vector3 ra, rb;
Geometry::get_closest_points_between_segments(Vector3(), Vector3(0, 0, -4096), s[0], s[1], ra, rb);
float d = -ra.z;
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
if (d <= 0) // Equal is here for negative zero.
d = 0;
- light->set_param(Light::PARAM_RANGE, d);
- } else if (Object::cast_to<OmniLight>(light)) {
+ light->set_param(Light3D::PARAM_RANGE, d);
+ } else if (Object::cast_to<OmniLight3D>(light)) {
Plane cp = Plane(gt.origin, p_camera->get_transform().basis.get_axis(2));
@@ -904,48 +904,48 @@ void LightSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx,
if (cp.intersects_ray(ray_from, ray_dir, &inters)) {
float r = inters.distance_to(gt.origin);
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- r = Math::stepify(r, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ r = Math::stepify(r, Node3DEditor::get_singleton()->get_translate_snap());
}
- light->set_param(Light::PARAM_RANGE, r);
+ light->set_param(Light3D::PARAM_RANGE, r);
}
}
} else if (p_idx == 1) {
- float a = _find_closest_angle_to_half_pi_arc(s[0], s[1], light->get_param(Light::PARAM_RANGE), gt);
- light->set_param(Light::PARAM_SPOT_ANGLE, CLAMP(a, 0.01, 89.99));
+ float a = _find_closest_angle_to_half_pi_arc(s[0], s[1], light->get_param(Light3D::PARAM_RANGE), gt);
+ light->set_param(Light3D::PARAM_SPOT_ANGLE, CLAMP(a, 0.01, 89.99));
}
}
-void LightSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
+void LightNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
- Light *light = Object::cast_to<Light>(p_gizmo->get_spatial_node());
+ Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node());
if (p_cancel) {
- light->set_param(p_idx == 0 ? Light::PARAM_RANGE : Light::PARAM_SPOT_ANGLE, p_restore);
+ light->set_param(p_idx == 0 ? Light3D::PARAM_RANGE : Light3D::PARAM_SPOT_ANGLE, p_restore);
} else if (p_idx == 0) {
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Light Radius"));
- ur->add_do_method(light, "set_param", Light::PARAM_RANGE, light->get_param(Light::PARAM_RANGE));
- ur->add_undo_method(light, "set_param", Light::PARAM_RANGE, p_restore);
+ ur->add_do_method(light, "set_param", Light3D::PARAM_RANGE, light->get_param(Light3D::PARAM_RANGE));
+ ur->add_undo_method(light, "set_param", Light3D::PARAM_RANGE, p_restore);
ur->commit_action();
} else if (p_idx == 1) {
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Light Radius"));
- ur->add_do_method(light, "set_param", Light::PARAM_SPOT_ANGLE, light->get_param(Light::PARAM_SPOT_ANGLE));
- ur->add_undo_method(light, "set_param", Light::PARAM_SPOT_ANGLE, p_restore);
+ ur->add_do_method(light, "set_param", Light3D::PARAM_SPOT_ANGLE, light->get_param(Light3D::PARAM_SPOT_ANGLE));
+ ur->add_undo_method(light, "set_param", Light3D::PARAM_SPOT_ANGLE, p_restore);
ur->commit_action();
}
}
-void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void LightNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
- Light *light = Object::cast_to<Light>(p_gizmo->get_spatial_node());
+ Light3D *light = Object::cast_to<Light3D>(p_gizmo->get_spatial_node());
Color color = light->get_color();
// Make the gizmo color as bright as possible for better visibility
@@ -953,7 +953,7 @@ void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->clear();
- if (Object::cast_to<DirectionalLight>(light)) {
+ if (Object::cast_to<DirectionalLight3D>(light)) {
Ref<Material> material = get_material("lines_primary", p_gizmo);
Ref<Material> icon = get_material("light_directional_icon", p_gizmo);
@@ -991,15 +991,15 @@ void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->add_unscaled_billboard(icon, 0.05, color);
}
- if (Object::cast_to<OmniLight>(light)) {
+ if (Object::cast_to<OmniLight3D>(light)) {
// Use both a billboard circle and 3 non-billboard circles for a better sphere-like representation
const Ref<Material> lines_material = get_material("lines_secondary", p_gizmo);
const Ref<Material> lines_billboard_material = get_material("lines_billboard", p_gizmo);
const Ref<Material> icon = get_material("light_omni_icon", p_gizmo);
- OmniLight *on = Object::cast_to<OmniLight>(light);
- const float r = on->get_param(Light::PARAM_RANGE);
+ OmniLight3D *on = Object::cast_to<OmniLight3D>(light);
+ const float r = on->get_param(Light3D::PARAM_RANGE);
Vector<Vector3> points;
Vector<Vector3> points_billboard;
@@ -1033,7 +1033,7 @@ void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->add_handles(handles, get_material("handles_billboard"), true);
}
- if (Object::cast_to<SpotLight>(light)) {
+ if (Object::cast_to<SpotLight3D>(light)) {
const Ref<Material> material_primary = get_material("lines_primary", p_gizmo);
const Ref<Material> material_secondary = get_material("lines_secondary", p_gizmo);
@@ -1041,11 +1041,11 @@ void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
Vector<Vector3> points_primary;
Vector<Vector3> points_secondary;
- SpotLight *sl = Object::cast_to<SpotLight>(light);
+ SpotLight3D *sl = Object::cast_to<SpotLight3D>(light);
- float r = sl->get_param(Light::PARAM_RANGE);
- float w = r * Math::sin(Math::deg2rad(sl->get_param(Light::PARAM_SPOT_ANGLE)));
- float d = r * Math::cos(Math::deg2rad(sl->get_param(Light::PARAM_SPOT_ANGLE)));
+ float r = sl->get_param(Light3D::PARAM_RANGE);
+ float w = r * Math::sin(Math::deg2rad(sl->get_param(Light3D::PARAM_SPOT_ANGLE)));
+ float d = r * Math::cos(Math::deg2rad(sl->get_param(Light3D::PARAM_SPOT_ANGLE)));
for (int i = 0; i < 120; i++) {
@@ -1086,39 +1086,39 @@ void LightSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
//////
//// player gizmo
-AudioStreamPlayer3DSpatialGizmoPlugin::AudioStreamPlayer3DSpatialGizmoPlugin() {
+AudioStreamPlayer3DNode3DGizmoPlugin::AudioStreamPlayer3DNode3DGizmoPlugin() {
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/stream_player_3d", Color(0.4, 0.8, 1));
- create_icon_material("stream_player_3d_icon", SpatialEditor::get_singleton()->get_theme_icon("GizmoSpatialSamplePlayer", "EditorIcons"));
+ create_icon_material("stream_player_3d_icon", Node3DEditor::get_singleton()->get_theme_icon("Gizmo3DSamplePlayer", "EditorIcons"));
create_material("stream_player_3d_material_primary", gizmo_color);
create_material("stream_player_3d_material_secondary", gizmo_color * Color(1, 1, 1, 0.35));
create_handle_material("handles");
}
-bool AudioStreamPlayer3DSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
+bool AudioStreamPlayer3DNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
return Object::cast_to<AudioStreamPlayer3D>(p_spatial) != NULL;
}
-String AudioStreamPlayer3DSpatialGizmoPlugin::get_name() const {
+String AudioStreamPlayer3DNode3DGizmoPlugin::get_name() const {
return "AudioStreamPlayer3D";
}
-int AudioStreamPlayer3DSpatialGizmoPlugin::get_priority() const {
+int AudioStreamPlayer3DNode3DGizmoPlugin::get_priority() const {
return -1;
}
-String AudioStreamPlayer3DSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const {
+String AudioStreamPlayer3DNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const {
return "Emission Radius";
}
-Variant AudioStreamPlayer3DSpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const {
+Variant AudioStreamPlayer3DNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const {
AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node());
return player->get_emission_angle();
}
-void AudioStreamPlayer3DSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) {
+void AudioStreamPlayer3DNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) {
AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node());
@@ -1157,7 +1157,7 @@ void AudioStreamPlayer3DSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_giz
}
}
-void AudioStreamPlayer3DSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
+void AudioStreamPlayer3DNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node());
@@ -1167,7 +1167,7 @@ void AudioStreamPlayer3DSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_
} else {
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change AudioStreamPlayer3D Emission Angle"));
ur->add_do_method(player, "set_emission_angle", player->get_emission_angle());
ur->add_undo_method(player, "set_emission_angle", p_restore);
@@ -1175,7 +1175,7 @@ void AudioStreamPlayer3DSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_
}
}
-void AudioStreamPlayer3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void AudioStreamPlayer3DNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
const AudioStreamPlayer3D *player = Object::cast_to<AudioStreamPlayer3D>(p_gizmo->get_spatial_node());
@@ -1233,7 +1233,7 @@ void AudioStreamPlayer3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo)
//////
-CameraSpatialGizmoPlugin::CameraSpatialGizmoPlugin() {
+CameraNode3DGizmoPlugin::CameraNode3DGizmoPlugin() {
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/camera", Color(0.8, 0.4, 0.8));
@@ -1241,34 +1241,34 @@ CameraSpatialGizmoPlugin::CameraSpatialGizmoPlugin() {
create_handle_material("handles");
}
-bool CameraSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<Camera>(p_spatial) != NULL;
+bool CameraNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<Camera3D>(p_spatial) != NULL;
}
-String CameraSpatialGizmoPlugin::get_name() const {
- return "Camera";
+String CameraNode3DGizmoPlugin::get_name() const {
+ return "Camera3D";
}
-int CameraSpatialGizmoPlugin::get_priority() const {
+int CameraNode3DGizmoPlugin::get_priority() const {
return -1;
}
-String CameraSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const {
+String CameraNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const {
- Camera *camera = Object::cast_to<Camera>(p_gizmo->get_spatial_node());
+ Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node());
- if (camera->get_projection() == Camera::PROJECTION_PERSPECTIVE) {
+ if (camera->get_projection() == Camera3D::PROJECTION_PERSPECTIVE) {
return "FOV";
} else {
return "Size";
}
}
-Variant CameraSpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const {
+Variant CameraNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const {
- Camera *camera = Object::cast_to<Camera>(p_gizmo->get_spatial_node());
+ Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node());
- if (camera->get_projection() == Camera::PROJECTION_PERSPECTIVE) {
+ if (camera->get_projection() == Camera3D::PROJECTION_PERSPECTIVE) {
return camera->get_fov();
} else {
@@ -1276,9 +1276,9 @@ Variant CameraSpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo,
}
}
-void CameraSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) {
+void CameraNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) {
- Camera *camera = Object::cast_to<Camera>(p_gizmo->get_spatial_node());
+ Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node());
Transform gt = camera->get_global_transform();
Transform gi = gt.affine_inverse();
@@ -1288,7 +1288,7 @@ void CameraSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx
Vector3 s[2] = { gi.xform(ray_from), gi.xform(ray_from + ray_dir * 4096) };
- if (camera->get_projection() == Camera::PROJECTION_PERSPECTIVE) {
+ if (camera->get_projection() == Camera3D::PROJECTION_PERSPECTIVE) {
Transform gt2 = camera->get_global_transform();
float a = _find_closest_angle_to_half_pi_arc(s[0], s[1], 1.0, gt2);
camera->set("fov", CLAMP(a * 2.0, 1, 179));
@@ -1297,8 +1297,8 @@ void CameraSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx
Vector3 ra, rb;
Geometry::get_closest_points_between_segments(Vector3(0, 0, -1), Vector3(4096, 0, -1), s[0], s[1], ra, rb);
float d = ra.x * 2.0;
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
d = CLAMP(d, 0.1, 16384);
@@ -1307,17 +1307,17 @@ void CameraSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx
}
}
-void CameraSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
+void CameraNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
- Camera *camera = Object::cast_to<Camera>(p_gizmo->get_spatial_node());
+ Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node());
- if (camera->get_projection() == Camera::PROJECTION_PERSPECTIVE) {
+ if (camera->get_projection() == Camera3D::PROJECTION_PERSPECTIVE) {
if (p_cancel) {
camera->set("fov", p_restore);
} else {
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Camera FOV"));
ur->add_do_property(camera, "fov", camera->get_fov());
ur->add_undo_property(camera, "fov", p_restore);
@@ -1330,7 +1330,7 @@ void CameraSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_
camera->set("size", p_restore);
} else {
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Camera Size"));
ur->add_do_property(camera, "size", camera->get_size());
ur->add_undo_property(camera, "size", p_restore);
@@ -1339,9 +1339,9 @@ void CameraSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_
}
}
-void CameraSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void CameraNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
- Camera *camera = Object::cast_to<Camera>(p_gizmo->get_spatial_node());
+ Camera3D *camera = Object::cast_to<Camera3D>(p_gizmo->get_spatial_node());
p_gizmo->clear();
@@ -1374,7 +1374,7 @@ void CameraSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
switch (camera->get_projection()) {
- case Camera::PROJECTION_PERSPECTIVE: {
+ case Camera3D::PROJECTION_PERSPECTIVE: {
// The real FOV is halved for accurate representation
float fov = camera->get_fov() / 2.0;
@@ -1396,7 +1396,7 @@ void CameraSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
ADD_TRIANGLE(tup, side + up, nside + up);
} break;
- case Camera::PROJECTION_ORTHOGONAL: {
+ case Camera3D::PROJECTION_ORTHOGONAL: {
float size = camera->get_size();
@@ -1418,7 +1418,7 @@ void CameraSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
ADD_TRIANGLE(tup, right + up + back, -right + up + back);
} break;
- case Camera::PROJECTION_FRUSTUM: {
+ case Camera3D::PROJECTION_FRUSTUM: {
float hsize = camera->get_size() / 2.0;
Vector3 side = Vector3(hsize, 0, -camera->get_znear()).normalized();
@@ -1447,7 +1447,7 @@ void CameraSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
ClippedCamera *clipcam = Object::cast_to<ClippedCamera>(camera);
if (clipcam) {
- Spatial *parent = Object::cast_to<Spatial>(camera->get_parent());
+ Node3D *parent = Object::cast_to<Node3D>(camera->get_parent());
if (!parent) {
return;
}
@@ -1489,28 +1489,28 @@ void CameraSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
//////
-MeshInstanceSpatialGizmoPlugin::MeshInstanceSpatialGizmoPlugin() {
+MeshInstanceNode3DGizmoPlugin::MeshInstanceNode3DGizmoPlugin() {
}
-bool MeshInstanceSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<MeshInstance>(p_spatial) != NULL && Object::cast_to<SoftBody>(p_spatial) == NULL;
+bool MeshInstanceNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<MeshInstance3D>(p_spatial) != NULL && Object::cast_to<SoftBody3D>(p_spatial) == NULL;
}
-String MeshInstanceSpatialGizmoPlugin::get_name() const {
- return "MeshInstance";
+String MeshInstanceNode3DGizmoPlugin::get_name() const {
+ return "MeshInstance3D";
}
-int MeshInstanceSpatialGizmoPlugin::get_priority() const {
+int MeshInstanceNode3DGizmoPlugin::get_priority() const {
return -1;
}
-bool MeshInstanceSpatialGizmoPlugin::can_be_hidden() const {
+bool MeshInstanceNode3DGizmoPlugin::can_be_hidden() const {
return false;
}
-void MeshInstanceSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void MeshInstanceNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
- MeshInstance *mesh = Object::cast_to<MeshInstance>(p_gizmo->get_spatial_node());
+ MeshInstance3D *mesh = Object::cast_to<MeshInstance3D>(p_gizmo->get_spatial_node());
p_gizmo->clear();
@@ -1526,26 +1526,26 @@ void MeshInstanceSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
}
/////
-Sprite3DSpatialGizmoPlugin::Sprite3DSpatialGizmoPlugin() {
+Sprite3DNode3DGizmoPlugin::Sprite3DNode3DGizmoPlugin() {
}
-bool Sprite3DSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
+bool Sprite3DNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
return Object::cast_to<Sprite3D>(p_spatial) != NULL;
}
-String Sprite3DSpatialGizmoPlugin::get_name() const {
+String Sprite3DNode3DGizmoPlugin::get_name() const {
return "Sprite3D";
}
-int Sprite3DSpatialGizmoPlugin::get_priority() const {
+int Sprite3DNode3DGizmoPlugin::get_priority() const {
return -1;
}
-bool Sprite3DSpatialGizmoPlugin::can_be_hidden() const {
+bool Sprite3DNode3DGizmoPlugin::can_be_hidden() const {
return false;
}
-void Sprite3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void Sprite3DNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
Sprite3D *sprite = Object::cast_to<Sprite3D>(p_gizmo->get_spatial_node());
@@ -1559,7 +1559,7 @@ void Sprite3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
///
-Position3DSpatialGizmoPlugin::Position3DSpatialGizmoPlugin() {
+Position3DNode3DGizmoPlugin::Position3DNode3DGizmoPlugin() {
pos3d_mesh = Ref<ArrayMesh>(memnew(ArrayMesh));
cursor_points = Vector<Vector3>();
@@ -1592,19 +1592,19 @@ Position3DSpatialGizmoPlugin::Position3DSpatialGizmoPlugin() {
pos3d_mesh->surface_set_material(0, mat);
}
-bool Position3DSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
+bool Position3DNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
return Object::cast_to<Position3D>(p_spatial) != NULL;
}
-String Position3DSpatialGizmoPlugin::get_name() const {
+String Position3DNode3DGizmoPlugin::get_name() const {
return "Position3D";
}
-int Position3DSpatialGizmoPlugin::get_priority() const {
+int Position3DNode3DGizmoPlugin::get_priority() const {
return -1;
}
-void Position3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void Position3DNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
p_gizmo->clear();
p_gizmo->add_mesh(pos3d_mesh);
@@ -1613,27 +1613,27 @@ void Position3DSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
/////
-SkeletonSpatialGizmoPlugin::SkeletonSpatialGizmoPlugin() {
+SkeletonNode3DGizmoPlugin::SkeletonNode3DGizmoPlugin() {
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/skeleton", Color(1, 0.8, 0.4));
create_material("skeleton_material", gizmo_color);
}
-bool SkeletonSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<Skeleton>(p_spatial) != NULL;
+bool SkeletonNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<Skeleton3D>(p_spatial) != NULL;
}
-String SkeletonSpatialGizmoPlugin::get_name() const {
- return "Skeleton";
+String SkeletonNode3DGizmoPlugin::get_name() const {
+ return "Skeleton3D";
}
-int SkeletonSpatialGizmoPlugin::get_priority() const {
+int SkeletonNode3DGizmoPlugin::get_priority() const {
return -1;
}
-void SkeletonSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void SkeletonNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
- Skeleton *skel = Object::cast_to<Skeleton>(p_gizmo->get_spatial_node());
+ Skeleton3D *skel = Object::cast_to<Skeleton3D>(p_gizmo->get_spatial_node());
p_gizmo->clear();
@@ -1822,54 +1822,54 @@ void SkeletonSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
////
-PhysicalBoneSpatialGizmoPlugin::PhysicalBoneSpatialGizmoPlugin() {
+PhysicalBoneNode3DGizmoPlugin::PhysicalBoneNode3DGizmoPlugin() {
create_material("joint_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1)));
}
-bool PhysicalBoneSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<PhysicalBone>(p_spatial) != NULL;
+bool PhysicalBoneNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<PhysicalBone3D>(p_spatial) != NULL;
}
-String PhysicalBoneSpatialGizmoPlugin::get_name() const {
+String PhysicalBoneNode3DGizmoPlugin::get_name() const {
return "PhysicalBones";
}
-int PhysicalBoneSpatialGizmoPlugin::get_priority() const {
+int PhysicalBoneNode3DGizmoPlugin::get_priority() const {
return -1;
}
-void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void PhysicalBoneNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
p_gizmo->clear();
- PhysicalBone *physical_bone = Object::cast_to<PhysicalBone>(p_gizmo->get_spatial_node());
+ PhysicalBone3D *physical_bone = Object::cast_to<PhysicalBone3D>(p_gizmo->get_spatial_node());
if (!physical_bone)
return;
- Skeleton *sk(physical_bone->find_skeleton_parent());
+ Skeleton3D *sk(physical_bone->find_skeleton_parent());
if (!sk)
return;
- PhysicalBone *pb(sk->get_physical_bone(physical_bone->get_bone_id()));
+ PhysicalBone3D *pb(sk->get_physical_bone(physical_bone->get_bone_id()));
if (!pb)
return;
- PhysicalBone *pbp(sk->get_physical_bone_parent(physical_bone->get_bone_id()));
+ PhysicalBone3D *pbp(sk->get_physical_bone_parent(physical_bone->get_bone_id()));
if (!pbp)
return;
Vector<Vector3> points;
switch (physical_bone->get_joint_type()) {
- case PhysicalBone::JOINT_TYPE_PIN: {
+ case PhysicalBone3D::JOINT_TYPE_PIN: {
- JointSpatialGizmoPlugin::CreatePinJointGizmo(physical_bone->get_joint_offset(), points);
+ JointNode3DGizmoPlugin::CreatePinJointGizmo(physical_bone->get_joint_offset(), points);
} break;
- case PhysicalBone::JOINT_TYPE_CONE: {
+ case PhysicalBone3D::JOINT_TYPE_CONE: {
- const PhysicalBone::ConeJointData *cjd(static_cast<const PhysicalBone::ConeJointData *>(physical_bone->get_joint_data()));
- JointSpatialGizmoPlugin::CreateConeTwistJointGizmo(
+ const PhysicalBone3D::ConeJointData *cjd(static_cast<const PhysicalBone3D::ConeJointData *>(physical_bone->get_joint_data()));
+ JointNode3DGizmoPlugin::CreateConeTwistJointGizmo(
physical_bone->get_joint_offset(),
physical_bone->get_global_transform() * physical_bone->get_joint_offset(),
pb->get_global_transform(),
@@ -1879,10 +1879,10 @@ void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
&points,
&points);
} break;
- case PhysicalBone::JOINT_TYPE_HINGE: {
+ case PhysicalBone3D::JOINT_TYPE_HINGE: {
- const PhysicalBone::HingeJointData *hjd(static_cast<const PhysicalBone::HingeJointData *>(physical_bone->get_joint_data()));
- JointSpatialGizmoPlugin::CreateHingeJointGizmo(
+ const PhysicalBone3D::HingeJointData *hjd(static_cast<const PhysicalBone3D::HingeJointData *>(physical_bone->get_joint_data()));
+ JointNode3DGizmoPlugin::CreateHingeJointGizmo(
physical_bone->get_joint_offset(),
physical_bone->get_global_transform() * physical_bone->get_joint_offset(),
pb->get_global_transform(),
@@ -1894,10 +1894,10 @@ void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
&points,
&points);
} break;
- case PhysicalBone::JOINT_TYPE_SLIDER: {
+ case PhysicalBone3D::JOINT_TYPE_SLIDER: {
- const PhysicalBone::SliderJointData *sjd(static_cast<const PhysicalBone::SliderJointData *>(physical_bone->get_joint_data()));
- JointSpatialGizmoPlugin::CreateSliderJointGizmo(
+ const PhysicalBone3D::SliderJointData *sjd(static_cast<const PhysicalBone3D::SliderJointData *>(physical_bone->get_joint_data()));
+ JointNode3DGizmoPlugin::CreateSliderJointGizmo(
physical_bone->get_joint_offset(),
physical_bone->get_global_transform() * physical_bone->get_joint_offset(),
pb->get_global_transform(),
@@ -1910,10 +1910,10 @@ void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
&points,
&points);
} break;
- case PhysicalBone::JOINT_TYPE_6DOF: {
+ case PhysicalBone3D::JOINT_TYPE_6DOF: {
- const PhysicalBone::SixDOFJointData *sdofjd(static_cast<const PhysicalBone::SixDOFJointData *>(physical_bone->get_joint_data()));
- JointSpatialGizmoPlugin::CreateGeneric6DOFJointGizmo(
+ const PhysicalBone3D::SixDOFJointData *sdofjd(static_cast<const PhysicalBone3D::SixDOFJointData *>(physical_bone->get_joint_data()));
+ JointNode3DGizmoPlugin::CreateGeneric6DOFJointGizmo(
physical_bone->get_joint_offset(),
physical_bone->get_global_transform() * physical_bone->get_joint_offset(),
@@ -1957,7 +1957,7 @@ void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
/////
-RayCastSpatialGizmoPlugin::RayCastSpatialGizmoPlugin() {
+RayCastNode3DGizmoPlugin::RayCastNode3DGizmoPlugin() {
const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1));
create_material("shape_material", gizmo_color);
@@ -1966,21 +1966,21 @@ RayCastSpatialGizmoPlugin::RayCastSpatialGizmoPlugin() {
create_material("shape_material_disabled", gizmo_color_disabled);
}
-bool RayCastSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<RayCast>(p_spatial) != NULL;
+bool RayCastNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<RayCast3D>(p_spatial) != NULL;
}
-String RayCastSpatialGizmoPlugin::get_name() const {
+String RayCastNode3DGizmoPlugin::get_name() const {
return "RayCast";
}
-int RayCastSpatialGizmoPlugin::get_priority() const {
+int RayCastNode3DGizmoPlugin::get_priority() const {
return -1;
}
-void RayCastSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void RayCastNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
- RayCast *raycast = Object::cast_to<RayCast>(p_gizmo->get_spatial_node());
+ RayCast3D *raycast = Object::cast_to<RayCast3D>(p_gizmo->get_spatial_node());
p_gizmo->clear();
@@ -1998,9 +1998,9 @@ void RayCastSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
/////
-void SpringArmSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void SpringArmNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
- SpringArm *spring_arm = Object::cast_to<SpringArm>(p_gizmo->get_spatial_node());
+ SpringArm3D *spring_arm = Object::cast_to<SpringArm3D>(p_gizmo->get_spatial_node());
p_gizmo->clear();
@@ -2015,44 +2015,44 @@ void SpringArmSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->add_collision_segments(lines);
}
-SpringArmSpatialGizmoPlugin::SpringArmSpatialGizmoPlugin() {
+SpringArmNode3DGizmoPlugin::SpringArmNode3DGizmoPlugin() {
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1));
create_material("shape_material", gizmo_color);
}
-bool SpringArmSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<SpringArm>(p_spatial) != NULL;
+bool SpringArmNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<SpringArm3D>(p_spatial) != NULL;
}
-String SpringArmSpatialGizmoPlugin::get_name() const {
+String SpringArmNode3DGizmoPlugin::get_name() const {
return "SpringArm";
}
-int SpringArmSpatialGizmoPlugin::get_priority() const {
+int SpringArmNode3DGizmoPlugin::get_priority() const {
return -1;
}
/////
-VehicleWheelSpatialGizmoPlugin::VehicleWheelSpatialGizmoPlugin() {
+VehicleWheelNode3DGizmoPlugin::VehicleWheelNode3DGizmoPlugin() {
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1));
create_material("shape_material", gizmo_color);
}
-bool VehicleWheelSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
+bool VehicleWheelNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
return Object::cast_to<VehicleWheel>(p_spatial) != NULL;
}
-String VehicleWheelSpatialGizmoPlugin::get_name() const {
+String VehicleWheelNode3DGizmoPlugin::get_name() const {
return "VehicleWheel";
}
-int VehicleWheelSpatialGizmoPlugin::get_priority() const {
+int VehicleWheelNode3DGizmoPlugin::get_priority() const {
return -1;
}
-void VehicleWheelSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void VehicleWheelNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
VehicleWheel *car_wheel = Object::cast_to<VehicleWheel>(p_gizmo->get_spatial_node());
@@ -2108,30 +2108,30 @@ void VehicleWheelSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
///////////
-SoftBodySpatialGizmoPlugin::SoftBodySpatialGizmoPlugin() {
+SoftBodyNode3DGizmoPlugin::SoftBodyNode3DGizmoPlugin() {
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1));
create_material("shape_material", gizmo_color);
create_handle_material("handles");
}
-bool SoftBodySpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<SoftBody>(p_spatial) != NULL;
+bool SoftBodyNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<SoftBody3D>(p_spatial) != NULL;
}
-String SoftBodySpatialGizmoPlugin::get_name() const {
+String SoftBodyNode3DGizmoPlugin::get_name() const {
return "SoftBody";
}
-int SoftBodySpatialGizmoPlugin::get_priority() const {
+int SoftBodyNode3DGizmoPlugin::get_priority() const {
return -1;
}
-bool SoftBodySpatialGizmoPlugin::is_selectable_when_hidden() const {
+bool SoftBodyNode3DGizmoPlugin::is_selectable_when_hidden() const {
return true;
}
-void SoftBodySpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
- SoftBody *soft_body = Object::cast_to<SoftBody>(p_gizmo->get_spatial_node());
+void SoftBodyNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
+ SoftBody3D *soft_body = Object::cast_to<SoftBody3D>(p_gizmo->get_spatial_node());
p_gizmo->clear();
@@ -2161,22 +2161,22 @@ void SoftBodySpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->add_collision_triangles(tm);
}
-String SoftBodySpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const {
+String SoftBodyNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const {
return "SoftBody pin point";
}
-Variant SoftBodySpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const {
- SoftBody *soft_body = Object::cast_to<SoftBody>(p_gizmo->get_spatial_node());
+Variant SoftBodyNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const {
+ SoftBody3D *soft_body = Object::cast_to<SoftBody3D>(p_gizmo->get_spatial_node());
return Variant(soft_body->is_point_pinned(p_idx));
}
-void SoftBodySpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
- SoftBody *soft_body = Object::cast_to<SoftBody>(p_gizmo->get_spatial_node());
+void SoftBodyNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
+ SoftBody3D *soft_body = Object::cast_to<SoftBody3D>(p_gizmo->get_spatial_node());
soft_body->pin_point_toggle(p_idx);
}
-bool SoftBodySpatialGizmoPlugin::is_handle_highlighted(const EditorSpatialGizmo *p_gizmo, int idx) const {
- SoftBody *soft_body = Object::cast_to<SoftBody>(p_gizmo->get_spatial_node());
+bool SoftBodyNode3DGizmoPlugin::is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int idx) const {
+ SoftBody3D *soft_body = Object::cast_to<SoftBody3D>(p_gizmo->get_spatial_node());
return soft_body->is_point_pinned(idx);
}
@@ -2190,8 +2190,8 @@ VisibilityNotifierGizmoPlugin::VisibilityNotifierGizmoPlugin() {
create_handle_material("handles");
}
-bool VisibilityNotifierGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<VisibilityNotifier>(p_spatial) != NULL;
+bool VisibilityNotifierGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<VisibilityNotifier3D>(p_spatial) != NULL;
}
String VisibilityNotifierGizmoPlugin::get_name() const {
@@ -2202,7 +2202,7 @@ int VisibilityNotifierGizmoPlugin::get_priority() const {
return -1;
}
-String VisibilityNotifierGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const {
+String VisibilityNotifierGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const {
switch (p_idx) {
case 0: return "Size X";
@@ -2216,14 +2216,14 @@ String VisibilityNotifierGizmoPlugin::get_handle_name(const EditorSpatialGizmo *
return "";
}
-Variant VisibilityNotifierGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const {
+Variant VisibilityNotifierGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const {
- VisibilityNotifier *notifier = Object::cast_to<VisibilityNotifier>(p_gizmo->get_spatial_node());
+ VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node());
return notifier->get_aabb();
}
-void VisibilityNotifierGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) {
+void VisibilityNotifierGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) {
- VisibilityNotifier *notifier = Object::cast_to<VisibilityNotifier>(p_gizmo->get_spatial_node());
+ VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node());
Transform gt = notifier->get_global_transform();
@@ -2249,8 +2249,8 @@ void VisibilityNotifierGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int
Geometry::get_closest_points_between_segments(ofs - axis * 4096, ofs + axis * 4096, sg[0], sg[1], ra, rb);
float d = ra[p_idx];
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
aabb.position[p_idx] = d - 1.0 - aabb.size[p_idx] * 0.5;
@@ -2261,8 +2261,8 @@ void VisibilityNotifierGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int
Geometry::get_closest_points_between_segments(ofs, ofs + axis * 4096, sg[0], sg[1], ra, rb);
float d = ra[p_idx] - ofs[p_idx];
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
if (d < 0.001)
@@ -2274,25 +2274,25 @@ void VisibilityNotifierGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int
}
}
-void VisibilityNotifierGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
+void VisibilityNotifierGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
- VisibilityNotifier *notifier = Object::cast_to<VisibilityNotifier>(p_gizmo->get_spatial_node());
+ VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node());
if (p_cancel) {
notifier->set_aabb(p_restore);
return;
}
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Notifier AABB"));
ur->add_do_method(notifier, "set_aabb", notifier->get_aabb());
ur->add_undo_method(notifier, "set_aabb", p_restore);
ur->commit_action();
}
-void VisibilityNotifierGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void VisibilityNotifierGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
- VisibilityNotifier *notifier = Object::cast_to<VisibilityNotifier>(p_gizmo->get_spatial_node());
+ VisibilityNotifier3D *notifier = Object::cast_to<VisibilityNotifier3D>(p_gizmo->get_spatial_node());
p_gizmo->clear();
@@ -2343,11 +2343,11 @@ void VisibilityNotifierGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
////
CPUParticlesGizmoPlugin::CPUParticlesGizmoPlugin() {
- create_icon_material("particles_icon", SpatialEditor::get_singleton()->get_theme_icon("GizmoCPUParticles", "EditorIcons"));
+ create_icon_material("particles_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoCPUParticles", "EditorIcons"));
}
-bool CPUParticlesGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<CPUParticles>(p_spatial) != NULL;
+bool CPUParticlesGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<CPUParticles3D>(p_spatial) != NULL;
}
String CPUParticlesGizmoPlugin::get_name() const {
@@ -2362,7 +2362,7 @@ bool CPUParticlesGizmoPlugin::is_selectable_when_hidden() const {
return true;
}
-void CPUParticlesGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void CPUParticlesGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
Ref<Material> icon = get_material("particles_icon", p_gizmo);
p_gizmo->add_unscaled_billboard(icon, 0.05);
}
@@ -2374,12 +2374,12 @@ ParticlesGizmoPlugin::ParticlesGizmoPlugin() {
create_material("particles_material", gizmo_color);
gizmo_color.a = 0.1;
create_material("particles_solid_material", gizmo_color);
- create_icon_material("particles_icon", SpatialEditor::get_singleton()->get_theme_icon("GizmoParticles", "EditorIcons"));
+ create_icon_material("particles_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoParticles", "EditorIcons"));
create_handle_material("handles");
}
-bool ParticlesGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<Particles>(p_spatial) != NULL;
+bool ParticlesGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<GPUParticles3D>(p_spatial) != NULL;
}
String ParticlesGizmoPlugin::get_name() const {
@@ -2394,7 +2394,7 @@ bool ParticlesGizmoPlugin::is_selectable_when_hidden() const {
return true;
}
-String ParticlesGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const {
+String ParticlesGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const {
switch (p_idx) {
case 0: return "Size X";
@@ -2407,14 +2407,14 @@ String ParticlesGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo,
return "";
}
-Variant ParticlesGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const {
+Variant ParticlesGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const {
- Particles *particles = Object::cast_to<Particles>(p_gizmo->get_spatial_node());
+ GPUParticles3D *particles = Object::cast_to<GPUParticles3D>(p_gizmo->get_spatial_node());
return particles->get_visibility_aabb();
}
-void ParticlesGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) {
+void ParticlesGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) {
- Particles *particles = Object::cast_to<Particles>(p_gizmo->get_spatial_node());
+ GPUParticles3D *particles = Object::cast_to<GPUParticles3D>(p_gizmo->get_spatial_node());
Transform gt = particles->get_global_transform();
Transform gi = gt.affine_inverse();
@@ -2439,8 +2439,8 @@ void ParticlesGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Ca
Geometry::get_closest_points_between_segments(ofs - axis * 4096, ofs + axis * 4096, sg[0], sg[1], ra, rb);
float d = ra[p_idx];
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
aabb.position[p_idx] = d - 1.0 - aabb.size[p_idx] * 0.5;
@@ -2451,8 +2451,8 @@ void ParticlesGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Ca
Geometry::get_closest_points_between_segments(ofs, ofs + axis * 4096, sg[0], sg[1], ra, rb);
float d = ra[p_idx] - ofs[p_idx];
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
if (d < 0.001)
@@ -2464,25 +2464,25 @@ void ParticlesGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Ca
}
}
-void ParticlesGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
+void ParticlesGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
- Particles *particles = Object::cast_to<Particles>(p_gizmo->get_spatial_node());
+ GPUParticles3D *particles = Object::cast_to<GPUParticles3D>(p_gizmo->get_spatial_node());
if (p_cancel) {
particles->set_visibility_aabb(p_restore);
return;
}
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Particles AABB"));
ur->add_do_method(particles, "set_visibility_aabb", particles->get_visibility_aabb());
ur->add_undo_method(particles, "set_visibility_aabb", p_restore);
ur->commit_action();
}
-void ParticlesGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void ParticlesGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
- Particles *particles = Object::cast_to<Particles>(p_gizmo->get_spatial_node());
+ GPUParticles3D *particles = Object::cast_to<GPUParticles3D>(p_gizmo->get_spatial_node());
p_gizmo->clear();
@@ -2543,11 +2543,11 @@ ReflectionProbeGizmoPlugin::ReflectionProbeGizmoPlugin() {
gizmo_color.a = 0.1;
create_material("reflection_probe_solid_material", gizmo_color);
- create_icon_material("reflection_probe_icon", SpatialEditor::get_singleton()->get_theme_icon("GizmoReflectionProbe", "EditorIcons"));
+ create_icon_material("reflection_probe_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoReflectionProbe", "EditorIcons"));
create_handle_material("handles");
}
-bool ReflectionProbeGizmoPlugin::has_gizmo(Spatial *p_spatial) {
+bool ReflectionProbeGizmoPlugin::has_gizmo(Node3D *p_spatial) {
return Object::cast_to<ReflectionProbe>(p_spatial) != NULL;
}
@@ -2559,7 +2559,7 @@ int ReflectionProbeGizmoPlugin::get_priority() const {
return -1;
}
-String ReflectionProbeGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const {
+String ReflectionProbeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const {
switch (p_idx) {
case 0: return "Extents X";
@@ -2572,12 +2572,12 @@ String ReflectionProbeGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_g
return "";
}
-Variant ReflectionProbeGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const {
+Variant ReflectionProbeGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const {
ReflectionProbe *probe = Object::cast_to<ReflectionProbe>(p_gizmo->get_spatial_node());
return AABB(probe->get_extents(), probe->get_origin_offset());
}
-void ReflectionProbeGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) {
+void ReflectionProbeGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) {
ReflectionProbe *probe = Object::cast_to<ReflectionProbe>(p_gizmo->get_spatial_node());
Transform gt = probe->get_global_transform();
@@ -2598,8 +2598,8 @@ void ReflectionProbeGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_i
Vector3 ra, rb;
Geometry::get_closest_points_between_segments(Vector3(), axis * 16384, sg[0], sg[1], ra, rb);
float d = ra[p_idx];
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
if (d < 0.001)
@@ -2626,8 +2626,8 @@ void ReflectionProbeGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_i
Geometry::get_closest_points_between_segments(origin - axis * 16384, origin + axis * 16384, sg[0], sg[1], ra, rb);
// Adjust the actual position to account for the gizmo handle position
float d = ra[p_idx] + 0.25;
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
origin[p_idx] = d;
@@ -2635,7 +2635,7 @@ void ReflectionProbeGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_i
}
}
-void ReflectionProbeGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
+void ReflectionProbeGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
ReflectionProbe *probe = Object::cast_to<ReflectionProbe>(p_gizmo->get_spatial_node());
@@ -2647,7 +2647,7 @@ void ReflectionProbeGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int
return;
}
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Probe Extents"));
ur->add_do_method(probe, "set_extents", probe->get_extents());
ur->add_do_method(probe, "set_origin_offset", probe->get_origin_offset());
@@ -2656,7 +2656,7 @@ void ReflectionProbeGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int
ur->commit_action();
}
-void ReflectionProbeGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void ReflectionProbeGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
ReflectionProbe *probe = Object::cast_to<ReflectionProbe>(p_gizmo->get_spatial_node());
@@ -2731,11 +2731,11 @@ GIProbeGizmoPlugin::GIProbeGizmoPlugin() {
gizmo_color.a = 0.05;
create_material("gi_probe_solid_material", gizmo_color);
- create_icon_material("gi_probe_icon", SpatialEditor::get_singleton()->get_theme_icon("GizmoGIProbe", "EditorIcons"));
+ create_icon_material("gi_probe_icon", Node3DEditor::get_singleton()->get_theme_icon("GizmoGIProbe", "EditorIcons"));
create_handle_material("handles");
}
-bool GIProbeGizmoPlugin::has_gizmo(Spatial *p_spatial) {
+bool GIProbeGizmoPlugin::has_gizmo(Node3D *p_spatial) {
return Object::cast_to<GIProbe>(p_spatial) != NULL;
}
@@ -2747,7 +2747,7 @@ int GIProbeGizmoPlugin::get_priority() const {
return -1;
}
-String GIProbeGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const {
+String GIProbeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const {
switch (p_idx) {
case 0: return "Extents X";
@@ -2757,12 +2757,12 @@ String GIProbeGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, in
return "";
}
-Variant GIProbeGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const {
+Variant GIProbeGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const {
GIProbe *probe = Object::cast_to<GIProbe>(p_gizmo->get_spatial_node());
return probe->get_extents();
}
-void GIProbeGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) {
+void GIProbeGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) {
GIProbe *probe = Object::cast_to<GIProbe>(p_gizmo->get_spatial_node());
@@ -2782,8 +2782,8 @@ void GIProbeGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Came
Vector3 ra, rb;
Geometry::get_closest_points_between_segments(Vector3(), axis * 16384, sg[0], sg[1], ra, rb);
float d = ra[p_idx];
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
if (d < 0.001)
@@ -2793,7 +2793,7 @@ void GIProbeGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Came
probe->set_extents(extents);
}
-void GIProbeGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
+void GIProbeGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
GIProbe *probe = Object::cast_to<GIProbe>(p_gizmo->get_spatial_node());
@@ -2804,14 +2804,14 @@ void GIProbeGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, c
return;
}
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Probe Extents"));
ur->add_do_method(probe, "set_extents", probe->get_extents());
ur->add_undo_method(probe, "set_extents", restore);
ur->commit_action();
}
-void GIProbeGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void GIProbeGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
GIProbe *probe = Object::cast_to<GIProbe>(p_gizmo->get_spatial_node());
@@ -2911,11 +2911,11 @@ BakedIndirectLightGizmoPlugin::BakedIndirectLightGizmoPlugin() {
gizmo_color.a = 0.1;
create_material("baked_indirect_light_internal_material", gizmo_color);
- create_icon_material("baked_indirect_light_icon", SpatialEditor::get_singleton()->get_icon("GizmoBakedLightmap", "EditorIcons"));
+ create_icon_material("baked_indirect_light_icon", Node3DEditor::get_singleton()->get_icon("GizmoBakedLightmap", "EditorIcons"));
create_handle_material("handles");
}
-String BakedIndirectLightGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const {
+String BakedIndirectLightGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const {
switch (p_idx) {
case 0: return "Extents X";
@@ -2925,12 +2925,12 @@ String BakedIndirectLightGizmoPlugin::get_handle_name(const EditorSpatialGizmo *
return "";
}
-Variant BakedIndirectLightGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const {
+Variant BakedIndirectLightGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const {
BakedLightmap *baker = Object::cast_to<BakedLightmap>(p_gizmo->get_spatial_node());
return baker->get_extents();
}
-void BakedIndirectLightGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) {
+void BakedIndirectLightGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) {
BakedLightmap *baker = Object::cast_to<BakedLightmap>(p_gizmo->get_spatial_node());
@@ -2950,8 +2950,8 @@ void BakedIndirectLightGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int
Vector3 ra, rb;
Geometry::get_closest_points_between_segments(Vector3(), axis * 16384, sg[0], sg[1], ra, rb);
float d = ra[p_idx];
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
if (d < 0.001)
@@ -2961,7 +2961,7 @@ void BakedIndirectLightGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int
baker->set_extents(extents);
}
-void BakedIndirectLightGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
+void BakedIndirectLightGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
BakedLightmap *baker = Object::cast_to<BakedLightmap>(p_gizmo->get_spatial_node());
@@ -2972,7 +2972,7 @@ void BakedIndirectLightGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, i
return;
}
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Probe Extents"));
ur->add_do_method(baker, "set_extents", baker->get_extents());
ur->add_undo_method(baker, "set_extents", restore);
@@ -2991,7 +2991,7 @@ int BakedIndirectLightGizmoPlugin::get_priority() const {
return -1;
}
-void BakedIndirectLightGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void BakedIndirectLightGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
BakedLightmap *baker = Object::cast_to<BakedLightmap>(p_gizmo->get_spatial_node());
@@ -3034,7 +3034,7 @@ void BakedIndirectLightGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
#endif
////
-CollisionShapeSpatialGizmoPlugin::CollisionShapeSpatialGizmoPlugin() {
+CollisionShapeNode3DGizmoPlugin::CollisionShapeNode3DGizmoPlugin() {
const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1));
create_material("shape_material", gizmo_color);
const float gizmo_value = gizmo_color.get_v();
@@ -3043,47 +3043,47 @@ CollisionShapeSpatialGizmoPlugin::CollisionShapeSpatialGizmoPlugin() {
create_handle_material("handles");
}
-bool CollisionShapeSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<CollisionShape>(p_spatial) != NULL;
+bool CollisionShapeNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<CollisionShape3D>(p_spatial) != NULL;
}
-String CollisionShapeSpatialGizmoPlugin::get_name() const {
- return "CollisionShape";
+String CollisionShapeNode3DGizmoPlugin::get_name() const {
+ return "CollisionShape3D";
}
-int CollisionShapeSpatialGizmoPlugin::get_priority() const {
+int CollisionShapeNode3DGizmoPlugin::get_priority() const {
return -1;
}
-String CollisionShapeSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const {
+String CollisionShapeNode3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const {
- const CollisionShape *cs = Object::cast_to<CollisionShape>(p_gizmo->get_spatial_node());
+ const CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node());
- Ref<Shape> s = cs->get_shape();
+ Ref<Shape3D> s = cs->get_shape();
if (s.is_null())
return "";
- if (Object::cast_to<SphereShape>(*s)) {
+ if (Object::cast_to<SphereShape3D>(*s)) {
return "Radius";
}
- if (Object::cast_to<BoxShape>(*s)) {
+ if (Object::cast_to<BoxShape3D>(*s)) {
return "Extents";
}
- if (Object::cast_to<CapsuleShape>(*s)) {
+ if (Object::cast_to<CapsuleShape3D>(*s)) {
return p_idx == 0 ? "Radius" : "Height";
}
- if (Object::cast_to<CylinderShape>(*s)) {
+ if (Object::cast_to<CylinderShape3D>(*s)) {
return p_idx == 0 ? "Radius" : "Height";
}
- if (Object::cast_to<RayShape>(*s)) {
+ if (Object::cast_to<RayShape3D>(*s)) {
return "Length";
}
@@ -3091,51 +3091,51 @@ String CollisionShapeSpatialGizmoPlugin::get_handle_name(const EditorSpatialGizm
return "";
}
-Variant CollisionShapeSpatialGizmoPlugin::get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const {
+Variant CollisionShapeNode3DGizmoPlugin::get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const {
- CollisionShape *cs = Object::cast_to<CollisionShape>(p_gizmo->get_spatial_node());
+ CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node());
- Ref<Shape> s = cs->get_shape();
+ Ref<Shape3D> s = cs->get_shape();
if (s.is_null())
return Variant();
- if (Object::cast_to<SphereShape>(*s)) {
+ if (Object::cast_to<SphereShape3D>(*s)) {
- Ref<SphereShape> ss = s;
+ Ref<SphereShape3D> ss = s;
return ss->get_radius();
}
- if (Object::cast_to<BoxShape>(*s)) {
+ if (Object::cast_to<BoxShape3D>(*s)) {
- Ref<BoxShape> bs = s;
+ Ref<BoxShape3D> bs = s;
return bs->get_extents();
}
- if (Object::cast_to<CapsuleShape>(*s)) {
+ if (Object::cast_to<CapsuleShape3D>(*s)) {
- Ref<CapsuleShape> cs2 = s;
+ Ref<CapsuleShape3D> cs2 = s;
return p_idx == 0 ? cs2->get_radius() : cs2->get_height();
}
- if (Object::cast_to<CylinderShape>(*s)) {
+ if (Object::cast_to<CylinderShape3D>(*s)) {
- Ref<CylinderShape> cs2 = s;
+ Ref<CylinderShape3D> cs2 = s;
return p_idx == 0 ? cs2->get_radius() : cs2->get_height();
}
- if (Object::cast_to<RayShape>(*s)) {
+ if (Object::cast_to<RayShape3D>(*s)) {
- Ref<RayShape> cs2 = s;
+ Ref<RayShape3D> cs2 = s;
return cs2->get_length();
}
return Variant();
}
-void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point) {
+void CollisionShapeNode3DGizmoPlugin::set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point) {
- CollisionShape *cs = Object::cast_to<CollisionShape>(p_gizmo->get_spatial_node());
+ CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node());
- Ref<Shape> s = cs->get_shape();
+ Ref<Shape3D> s = cs->get_shape();
if (s.is_null())
return;
@@ -3147,14 +3147,14 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i
Vector3 sg[2] = { gi.xform(ray_from), gi.xform(ray_from + ray_dir * 4096) };
- if (Object::cast_to<SphereShape>(*s)) {
+ if (Object::cast_to<SphereShape3D>(*s)) {
- Ref<SphereShape> ss = s;
+ Ref<SphereShape3D> ss = s;
Vector3 ra, rb;
Geometry::get_closest_points_between_segments(Vector3(), Vector3(4096, 0, 0), sg[0], sg[1], ra, rb);
float d = ra.x;
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
if (d < 0.001)
@@ -3163,14 +3163,14 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i
ss->set_radius(d);
}
- if (Object::cast_to<RayShape>(*s)) {
+ if (Object::cast_to<RayShape3D>(*s)) {
- Ref<RayShape> rs = s;
+ Ref<RayShape3D> rs = s;
Vector3 ra, rb;
Geometry::get_closest_points_between_segments(Vector3(), Vector3(0, 0, 4096), sg[0], sg[1], ra, rb);
float d = ra.z;
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
if (d < 0.001)
@@ -3179,16 +3179,16 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i
rs->set_length(d);
}
- if (Object::cast_to<BoxShape>(*s)) {
+ if (Object::cast_to<BoxShape3D>(*s)) {
Vector3 axis;
axis[p_idx] = 1.0;
- Ref<BoxShape> bs = s;
+ Ref<BoxShape3D> bs = s;
Vector3 ra, rb;
Geometry::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb);
float d = ra[p_idx];
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
if (d < 0.001)
@@ -3199,19 +3199,19 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i
bs->set_extents(he);
}
- if (Object::cast_to<CapsuleShape>(*s)) {
+ if (Object::cast_to<CapsuleShape3D>(*s)) {
Vector3 axis;
axis[p_idx == 0 ? 0 : 2] = 1.0;
- Ref<CapsuleShape> cs2 = s;
+ Ref<CapsuleShape3D> cs2 = s;
Vector3 ra, rb;
Geometry::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb);
float d = axis.dot(ra);
if (p_idx == 1)
d -= cs2->get_radius();
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
if (d < 0.001)
@@ -3223,16 +3223,16 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i
cs2->set_height(d * 2.0);
}
- if (Object::cast_to<CylinderShape>(*s)) {
+ if (Object::cast_to<CylinderShape3D>(*s)) {
Vector3 axis;
axis[p_idx == 0 ? 0 : 1] = 1.0;
- Ref<CylinderShape> cs2 = s;
+ Ref<CylinderShape3D> cs2 = s;
Vector3 ra, rb;
Geometry::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb);
float d = axis.dot(ra);
- if (SpatialEditor::get_singleton()->is_snap_enabled()) {
- d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
+ if (Node3DEditor::get_singleton()->is_snap_enabled()) {
+ d = Math::stepify(d, Node3DEditor::get_singleton()->get_translate_snap());
}
if (d < 0.001)
@@ -3244,47 +3244,47 @@ void CollisionShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, i
cs2->set_height(d * 2.0);
}
}
-void CollisionShapeSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
+void CollisionShapeNode3DGizmoPlugin::commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel) {
- CollisionShape *cs = Object::cast_to<CollisionShape>(p_gizmo->get_spatial_node());
+ CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node());
- Ref<Shape> s = cs->get_shape();
+ Ref<Shape3D> s = cs->get_shape();
if (s.is_null())
return;
- if (Object::cast_to<SphereShape>(*s)) {
+ if (Object::cast_to<SphereShape3D>(*s)) {
- Ref<SphereShape> ss = s;
+ Ref<SphereShape3D> ss = s;
if (p_cancel) {
ss->set_radius(p_restore);
return;
}
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Sphere Shape Radius"));
ur->add_do_method(ss.ptr(), "set_radius", ss->get_radius());
ur->add_undo_method(ss.ptr(), "set_radius", p_restore);
ur->commit_action();
}
- if (Object::cast_to<BoxShape>(*s)) {
+ if (Object::cast_to<BoxShape3D>(*s)) {
- Ref<BoxShape> ss = s;
+ Ref<BoxShape3D> ss = s;
if (p_cancel) {
ss->set_extents(p_restore);
return;
}
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Box Shape Extents"));
ur->add_do_method(ss.ptr(), "set_extents", ss->get_extents());
ur->add_undo_method(ss.ptr(), "set_extents", p_restore);
ur->commit_action();
}
- if (Object::cast_to<CapsuleShape>(*s)) {
+ if (Object::cast_to<CapsuleShape3D>(*s)) {
- Ref<CapsuleShape> ss = s;
+ Ref<CapsuleShape3D> ss = s;
if (p_cancel) {
if (p_idx == 0)
ss->set_radius(p_restore);
@@ -3293,7 +3293,7 @@ void CollisionShapeSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo
return;
}
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
if (p_idx == 0) {
ur->create_action(TTR("Change Capsule Shape Radius"));
ur->add_do_method(ss.ptr(), "set_radius", ss->get_radius());
@@ -3307,9 +3307,9 @@ void CollisionShapeSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo
ur->commit_action();
}
- if (Object::cast_to<CylinderShape>(*s)) {
+ if (Object::cast_to<CylinderShape3D>(*s)) {
- Ref<CylinderShape> ss = s;
+ Ref<CylinderShape3D> ss = s;
if (p_cancel) {
if (p_idx == 0)
ss->set_radius(p_restore);
@@ -3318,7 +3318,7 @@ void CollisionShapeSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo
return;
}
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
if (p_idx == 0) {
ur->create_action(TTR("Change Cylinder Shape Radius"));
ur->add_do_method(ss.ptr(), "set_radius", ss->get_radius());
@@ -3336,28 +3336,28 @@ void CollisionShapeSpatialGizmoPlugin::commit_handle(EditorSpatialGizmo *p_gizmo
ur->commit_action();
}
- if (Object::cast_to<RayShape>(*s)) {
+ if (Object::cast_to<RayShape3D>(*s)) {
- Ref<RayShape> ss = s;
+ Ref<RayShape3D> ss = s;
if (p_cancel) {
ss->set_length(p_restore);
return;
}
- UndoRedo *ur = SpatialEditor::get_singleton()->get_undo_redo();
+ UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
ur->create_action(TTR("Change Ray Shape Length"));
ur->add_do_method(ss.ptr(), "set_length", ss->get_length());
ur->add_undo_method(ss.ptr(), "set_length", p_restore);
ur->commit_action();
}
}
-void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void CollisionShapeNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
- CollisionShape *cs = Object::cast_to<CollisionShape>(p_gizmo->get_spatial_node());
+ CollisionShape3D *cs = Object::cast_to<CollisionShape3D>(p_gizmo->get_spatial_node());
p_gizmo->clear();
- Ref<Shape> s = cs->get_shape();
+ Ref<Shape3D> s = cs->get_shape();
if (s.is_null())
return;
@@ -3365,9 +3365,9 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
get_material(!cs->is_disabled() ? "shape_material" : "shape_material_disabled", p_gizmo);
Ref<Material> handles_material = get_material("handles");
- if (Object::cast_to<SphereShape>(*s)) {
+ if (Object::cast_to<SphereShape3D>(*s)) {
- Ref<SphereShape> sp = s;
+ Ref<SphereShape3D> sp = s;
float r = sp->get_radius();
Vector<Vector3> points;
@@ -3411,9 +3411,9 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->add_handles(handles, handles_material);
}
- if (Object::cast_to<BoxShape>(*s)) {
+ if (Object::cast_to<BoxShape3D>(*s)) {
- Ref<BoxShape> bs = s;
+ Ref<BoxShape3D> bs = s;
Vector<Vector3> lines;
AABB aabb;
aabb.position = -bs->get_extents();
@@ -3440,9 +3440,9 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->add_handles(handles, handles_material);
}
- if (Object::cast_to<CapsuleShape>(*s)) {
+ if (Object::cast_to<CapsuleShape3D>(*s)) {
- Ref<CapsuleShape> cs2 = s;
+ Ref<CapsuleShape3D> cs2 = s;
float radius = cs2->get_radius();
float height = cs2->get_height();
@@ -3515,9 +3515,9 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->add_handles(handles, handles_material);
}
- if (Object::cast_to<CylinderShape>(*s)) {
+ if (Object::cast_to<CylinderShape3D>(*s)) {
- Ref<CylinderShape> cs2 = s;
+ Ref<CylinderShape3D> cs2 = s;
float radius = cs2->get_radius();
float height = cs2->get_height();
@@ -3576,9 +3576,9 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->add_handles(handles, handles_material);
}
- if (Object::cast_to<WorldMarginShape>(*s)) {
+ if (Object::cast_to<WorldMarginShape3D>(*s)) {
- Ref<WorldMarginShape> ps = s;
+ Ref<WorldMarginShape3D> ps = s;
Plane p = ps->get_plane();
Vector<Vector3> points;
@@ -3607,9 +3607,9 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->add_collision_segments(points);
}
- if (Object::cast_to<ConvexPolygonShape>(*s)) {
+ if (Object::cast_to<ConvexPolygonShape3D>(*s)) {
- Vector<Vector3> points = Object::cast_to<ConvexPolygonShape>(*s)->get_points();
+ Vector<Vector3> points = Object::cast_to<ConvexPolygonShape3D>(*s)->get_points();
if (points.size() > 3) {
@@ -3630,17 +3630,17 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
}
}
- if (Object::cast_to<ConcavePolygonShape>(*s)) {
+ if (Object::cast_to<ConcavePolygonShape3D>(*s)) {
- Ref<ConcavePolygonShape> cs2 = s;
+ Ref<ConcavePolygonShape3D> cs2 = s;
Ref<ArrayMesh> mesh = cs2->get_debug_mesh();
p_gizmo->add_mesh(mesh, false, Ref<SkinReference>(), material);
p_gizmo->add_collision_segments(cs2->get_debug_mesh_lines());
}
- if (Object::cast_to<RayShape>(*s)) {
+ if (Object::cast_to<RayShape3D>(*s)) {
- Ref<RayShape> rs = s;
+ Ref<RayShape3D> rs = s;
Vector<Vector3> points;
points.push_back(Vector3());
@@ -3663,7 +3663,7 @@ void CollisionShapeSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
/////
-CollisionPolygonSpatialGizmoPlugin::CollisionPolygonSpatialGizmoPlugin() {
+CollisionPolygonNode3DGizmoPlugin::CollisionPolygonNode3DGizmoPlugin() {
const Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/shape", Color(0.5, 0.7, 1));
create_material("shape_material", gizmo_color);
const float gizmo_value = gizmo_color.get_v();
@@ -3671,21 +3671,21 @@ CollisionPolygonSpatialGizmoPlugin::CollisionPolygonSpatialGizmoPlugin() {
create_material("shape_material_disabled", gizmo_color_disabled);
}
-bool CollisionPolygonSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<CollisionPolygon>(p_spatial) != NULL;
+bool CollisionPolygonNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<CollisionPolygon3D>(p_spatial) != NULL;
}
-String CollisionPolygonSpatialGizmoPlugin::get_name() const {
- return "CollisionPolygon";
+String CollisionPolygonNode3DGizmoPlugin::get_name() const {
+ return "CollisionPolygon3D";
}
-int CollisionPolygonSpatialGizmoPlugin::get_priority() const {
+int CollisionPolygonNode3DGizmoPlugin::get_priority() const {
return -1;
}
-void CollisionPolygonSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void CollisionPolygonNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
- CollisionPolygon *polygon = Object::cast_to<CollisionPolygon>(p_gizmo->get_spatial_node());
+ CollisionPolygon3D *polygon = Object::cast_to<CollisionPolygon3D>(p_gizmo->get_spatial_node());
p_gizmo->clear();
@@ -3713,28 +3713,28 @@ void CollisionPolygonSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
////
-NavigationMeshSpatialGizmoPlugin::NavigationMeshSpatialGizmoPlugin() {
+NavigationMeshNode3DGizmoPlugin::NavigationMeshNode3DGizmoPlugin() {
create_material("navigation_edge_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_edge", Color(0.5, 1, 1)));
create_material("navigation_edge_material_disabled", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_edge_disabled", Color(0.7, 0.7, 0.7)));
create_material("navigation_solid_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_solid", Color(0.5, 1, 1, 0.4)));
create_material("navigation_solid_material_disabled", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/navigation_solid_disabled", Color(0.7, 0.7, 0.7, 0.4)));
}
-bool NavigationMeshSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<NavigationRegion>(p_spatial) != NULL;
+bool NavigationMeshNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<NavigationRegion3D>(p_spatial) != NULL;
}
-String NavigationMeshSpatialGizmoPlugin::get_name() const {
+String NavigationMeshNode3DGizmoPlugin::get_name() const {
return "NavigationRegion";
}
-int NavigationMeshSpatialGizmoPlugin::get_priority() const {
+int NavigationMeshNode3DGizmoPlugin::get_priority() const {
return -1;
}
-void NavigationMeshSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
+void NavigationMeshNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
- NavigationRegion *navmesh = Object::cast_to<NavigationRegion>(p_gizmo->get_spatial_node());
+ NavigationRegion3D *navmesh = Object::cast_to<NavigationRegion3D>(p_gizmo->get_spatial_node());
Ref<Material> edge_material = get_material("navigation_edge_material", p_gizmo);
Ref<Material> edge_material_disabled = get_material("navigation_edge_material_disabled", p_gizmo);
@@ -4078,37 +4078,37 @@ void JointGizmosDrawer::draw_cone(const Transform &p_offset, const Basis &p_base
////
-JointSpatialGizmoPlugin::JointSpatialGizmoPlugin() {
+JointNode3DGizmoPlugin::JointNode3DGizmoPlugin() {
create_material("joint_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint", Color(0.5, 0.8, 1)));
create_material("joint_body_a_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint_body_a", Color(0.6, 0.8, 1)));
create_material("joint_body_b_material", EDITOR_DEF("editors/3d_gizmos/gizmo_colors/joint_body_b", Color(0.6, 0.9, 1)));
}
-bool JointSpatialGizmoPlugin::has_gizmo(Spatial *p_spatial) {
- return Object::cast_to<Joint>(p_spatial) != NULL;
+bool JointNode3DGizmoPlugin::has_gizmo(Node3D *p_spatial) {
+ return Object::cast_to<Joint3D>(p_spatial) != NULL;
}
-String JointSpatialGizmoPlugin::get_name() const {
+String JointNode3DGizmoPlugin::get_name() const {
return "Joints";
}
-int JointSpatialGizmoPlugin::get_priority() const {
+int JointNode3DGizmoPlugin::get_priority() const {
return -1;
}
-void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
- Joint *joint = Object::cast_to<Joint>(p_gizmo->get_spatial_node());
+void JointNode3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
+ Joint3D *joint = Object::cast_to<Joint3D>(p_gizmo->get_spatial_node());
p_gizmo->clear();
- Spatial *node_body_a = NULL;
+ Node3D *node_body_a = NULL;
if (!joint->get_node_a().is_empty()) {
- node_body_a = Object::cast_to<Spatial>(joint->get_node(joint->get_node_a()));
+ node_body_a = Object::cast_to<Node3D>(joint->get_node(joint->get_node_a()));
}
- Spatial *node_body_b = NULL;
+ Node3D *node_body_b = NULL;
if (!joint->get_node_b().is_empty()) {
- node_body_b = Object::cast_to<Spatial>(joint->get_node(joint->get_node_b()));
+ node_body_b = Object::cast_to<Node3D>(joint->get_node(joint->get_node_b()));
}
if (!node_body_a && !node_body_b) {
@@ -4123,13 +4123,13 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
Vector<Vector3> body_a_points;
Vector<Vector3> body_b_points;
- if (Object::cast_to<PinJoint>(joint)) {
+ if (Object::cast_to<PinJoint3D>(joint)) {
CreatePinJointGizmo(Transform(), points);
p_gizmo->add_collision_segments(points);
p_gizmo->add_lines(points, common_material);
}
- HingeJoint *hinge = Object::cast_to<HingeJoint>(joint);
+ HingeJoint3D *hinge = Object::cast_to<HingeJoint3D>(joint);
if (hinge) {
CreateHingeJointGizmo(
@@ -4137,9 +4137,9 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
hinge->get_global_transform(),
node_body_a ? node_body_a->get_global_transform() : Transform(),
node_body_b ? node_body_b->get_global_transform() : Transform(),
- hinge->get_param(HingeJoint::PARAM_LIMIT_LOWER),
- hinge->get_param(HingeJoint::PARAM_LIMIT_UPPER),
- hinge->get_flag(HingeJoint::FLAG_USE_LIMIT),
+ hinge->get_param(HingeJoint3D::PARAM_LIMIT_LOWER),
+ hinge->get_param(HingeJoint3D::PARAM_LIMIT_UPPER),
+ hinge->get_flag(HingeJoint3D::FLAG_USE_LIMIT),
points,
node_body_a ? &body_a_points : NULL,
node_body_b ? &body_b_points : NULL);
@@ -4153,7 +4153,7 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->add_lines(body_b_points, body_b_material);
}
- SliderJoint *slider = Object::cast_to<SliderJoint>(joint);
+ SliderJoint3D *slider = Object::cast_to<SliderJoint3D>(joint);
if (slider) {
CreateSliderJointGizmo(
@@ -4161,10 +4161,10 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
slider->get_global_transform(),
node_body_a ? node_body_a->get_global_transform() : Transform(),
node_body_b ? node_body_b->get_global_transform() : Transform(),
- slider->get_param(SliderJoint::PARAM_ANGULAR_LIMIT_LOWER),
- slider->get_param(SliderJoint::PARAM_ANGULAR_LIMIT_UPPER),
- slider->get_param(SliderJoint::PARAM_LINEAR_LIMIT_LOWER),
- slider->get_param(SliderJoint::PARAM_LINEAR_LIMIT_UPPER),
+ slider->get_param(SliderJoint3D::PARAM_ANGULAR_LIMIT_LOWER),
+ slider->get_param(SliderJoint3D::PARAM_ANGULAR_LIMIT_UPPER),
+ slider->get_param(SliderJoint3D::PARAM_LINEAR_LIMIT_LOWER),
+ slider->get_param(SliderJoint3D::PARAM_LINEAR_LIMIT_UPPER),
points,
node_body_a ? &body_a_points : NULL,
node_body_b ? &body_b_points : NULL);
@@ -4178,7 +4178,7 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->add_lines(body_b_points, body_b_material);
}
- ConeTwistJoint *cone = Object::cast_to<ConeTwistJoint>(joint);
+ ConeTwistJoint3D *cone = Object::cast_to<ConeTwistJoint3D>(joint);
if (cone) {
CreateConeTwistJointGizmo(
@@ -4186,8 +4186,8 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
cone->get_global_transform(),
node_body_a ? node_body_a->get_global_transform() : Transform(),
node_body_b ? node_body_b->get_global_transform() : Transform(),
- cone->get_param(ConeTwistJoint::PARAM_SWING_SPAN),
- cone->get_param(ConeTwistJoint::PARAM_TWIST_SPAN),
+ cone->get_param(ConeTwistJoint3D::PARAM_SWING_SPAN),
+ cone->get_param(ConeTwistJoint3D::PARAM_TWIST_SPAN),
node_body_a ? &body_a_points : NULL,
node_body_b ? &body_b_points : NULL);
@@ -4198,7 +4198,7 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
p_gizmo->add_lines(body_b_points, body_b_material);
}
- Generic6DOFJoint *gen = Object::cast_to<Generic6DOFJoint>(joint);
+ Generic6DOFJoint3D *gen = Object::cast_to<Generic6DOFJoint3D>(joint);
if (gen) {
CreateGeneric6DOFJointGizmo(
@@ -4207,26 +4207,26 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
node_body_a ? node_body_a->get_global_transform() : Transform(),
node_body_b ? node_body_b->get_global_transform() : Transform(),
- gen->get_param_x(Generic6DOFJoint::PARAM_ANGULAR_LOWER_LIMIT),
- gen->get_param_x(Generic6DOFJoint::PARAM_ANGULAR_UPPER_LIMIT),
- gen->get_param_x(Generic6DOFJoint::PARAM_LINEAR_LOWER_LIMIT),
- gen->get_param_x(Generic6DOFJoint::PARAM_LINEAR_UPPER_LIMIT),
- gen->get_flag_x(Generic6DOFJoint::FLAG_ENABLE_ANGULAR_LIMIT),
- gen->get_flag_x(Generic6DOFJoint::FLAG_ENABLE_LINEAR_LIMIT),
-
- gen->get_param_y(Generic6DOFJoint::PARAM_ANGULAR_LOWER_LIMIT),
- gen->get_param_y(Generic6DOFJoint::PARAM_ANGULAR_UPPER_LIMIT),
- gen->get_param_y(Generic6DOFJoint::PARAM_LINEAR_LOWER_LIMIT),
- gen->get_param_y(Generic6DOFJoint::PARAM_LINEAR_UPPER_LIMIT),
- gen->get_flag_y(Generic6DOFJoint::FLAG_ENABLE_ANGULAR_LIMIT),
- gen->get_flag_y(Generic6DOFJoint::FLAG_ENABLE_LINEAR_LIMIT),
-
- gen->get_param_z(Generic6DOFJoint::PARAM_ANGULAR_LOWER_LIMIT),
- gen->get_param_z(Generic6DOFJoint::PARAM_ANGULAR_UPPER_LIMIT),
- gen->get_param_z(Generic6DOFJoint::PARAM_LINEAR_LOWER_LIMIT),
- gen->get_param_z(Generic6DOFJoint::PARAM_LINEAR_UPPER_LIMIT),
- gen->get_flag_z(Generic6DOFJoint::FLAG_ENABLE_ANGULAR_LIMIT),
- gen->get_flag_z(Generic6DOFJoint::FLAG_ENABLE_LINEAR_LIMIT),
+ gen->get_param_x(Generic6DOFJoint3D::PARAM_ANGULAR_LOWER_LIMIT),
+ gen->get_param_x(Generic6DOFJoint3D::PARAM_ANGULAR_UPPER_LIMIT),
+ gen->get_param_x(Generic6DOFJoint3D::PARAM_LINEAR_LOWER_LIMIT),
+ gen->get_param_x(Generic6DOFJoint3D::PARAM_LINEAR_UPPER_LIMIT),
+ gen->get_flag_x(Generic6DOFJoint3D::FLAG_ENABLE_ANGULAR_LIMIT),
+ gen->get_flag_x(Generic6DOFJoint3D::FLAG_ENABLE_LINEAR_LIMIT),
+
+ gen->get_param_y(Generic6DOFJoint3D::PARAM_ANGULAR_LOWER_LIMIT),
+ gen->get_param_y(Generic6DOFJoint3D::PARAM_ANGULAR_UPPER_LIMIT),
+ gen->get_param_y(Generic6DOFJoint3D::PARAM_LINEAR_LOWER_LIMIT),
+ gen->get_param_y(Generic6DOFJoint3D::PARAM_LINEAR_UPPER_LIMIT),
+ gen->get_flag_y(Generic6DOFJoint3D::FLAG_ENABLE_ANGULAR_LIMIT),
+ gen->get_flag_y(Generic6DOFJoint3D::FLAG_ENABLE_LINEAR_LIMIT),
+
+ gen->get_param_z(Generic6DOFJoint3D::PARAM_ANGULAR_LOWER_LIMIT),
+ gen->get_param_z(Generic6DOFJoint3D::PARAM_ANGULAR_UPPER_LIMIT),
+ gen->get_param_z(Generic6DOFJoint3D::PARAM_LINEAR_LOWER_LIMIT),
+ gen->get_param_z(Generic6DOFJoint3D::PARAM_LINEAR_UPPER_LIMIT),
+ gen->get_flag_z(Generic6DOFJoint3D::FLAG_ENABLE_ANGULAR_LIMIT),
+ gen->get_flag_z(Generic6DOFJoint3D::FLAG_ENABLE_LINEAR_LIMIT),
points,
node_body_a ? &body_a_points : NULL,
@@ -4242,7 +4242,7 @@ void JointSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) {
}
}
-void JointSpatialGizmoPlugin::CreatePinJointGizmo(const Transform &p_offset, Vector<Vector3> &r_cursor_points) {
+void JointNode3DGizmoPlugin::CreatePinJointGizmo(const Transform &p_offset, Vector<Vector3> &r_cursor_points) {
float cs = 0.25;
r_cursor_points.push_back(p_offset.translated(Vector3(+cs, 0, 0)).origin);
@@ -4253,7 +4253,7 @@ void JointSpatialGizmoPlugin::CreatePinJointGizmo(const Transform &p_offset, Vec
r_cursor_points.push_back(p_offset.translated(Vector3(0, 0, -cs)).origin);
}
-void JointSpatialGizmoPlugin::CreateHingeJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_limit_lower, real_t p_limit_upper, bool p_use_limit, Vector<Vector3> &r_common_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) {
+void JointNode3DGizmoPlugin::CreateHingeJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_limit_lower, real_t p_limit_upper, bool p_use_limit, Vector<Vector3> &r_common_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) {
r_common_points.push_back(p_offset.translated(Vector3(0, 0, 0.5)).origin);
r_common_points.push_back(p_offset.translated(Vector3(0, 0, -0.5)).origin);
@@ -4285,7 +4285,7 @@ void JointSpatialGizmoPlugin::CreateHingeJointGizmo(const Transform &p_offset, c
}
}
-void JointSpatialGizmoPlugin::CreateSliderJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_angular_limit_lower, real_t p_angular_limit_upper, real_t p_linear_limit_lower, real_t p_linear_limit_upper, Vector<Vector3> &r_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) {
+void JointNode3DGizmoPlugin::CreateSliderJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_angular_limit_lower, real_t p_angular_limit_upper, real_t p_linear_limit_lower, real_t p_linear_limit_upper, Vector<Vector3> &r_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) {
p_linear_limit_lower = -p_linear_limit_lower;
p_linear_limit_upper = -p_linear_limit_upper;
@@ -4345,7 +4345,7 @@ void JointSpatialGizmoPlugin::CreateSliderJointGizmo(const Transform &p_offset,
true);
}
-void JointSpatialGizmoPlugin::CreateConeTwistJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_swing, real_t p_twist, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) {
+void JointNode3DGizmoPlugin::CreateConeTwistJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_swing, real_t p_twist, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points) {
if (r_body_a_points)
JointGizmosDrawer::draw_cone(
@@ -4364,7 +4364,7 @@ void JointSpatialGizmoPlugin::CreateConeTwistJointGizmo(const Transform &p_offse
*r_body_b_points);
}
-void JointSpatialGizmoPlugin::CreateGeneric6DOFJointGizmo(
+void JointNode3DGizmoPlugin::CreateGeneric6DOFJointGizmo(
const Transform &p_offset,
const Transform &p_trs_joint,
const Transform &p_trs_body_a,
diff --git a/editor/spatial_editor_gizmos.h b/editor/spatial_editor_gizmos.h
index b786aa2b50..86926b38d2 100644
--- a/editor/spatial_editor_gizmos.h
+++ b/editor/spatial_editor_gizmos.h
@@ -32,328 +32,328 @@
#define SPATIAL_EDITOR_GIZMOS_H
#include "editor/plugins/spatial_editor_plugin.h"
-#include "scene/3d/camera.h"
+#include "scene/3d/camera_3d.h"
-class Camera;
+class Camera3D;
-class LightSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class LightNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(LightSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(LightNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const;
- Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const;
- void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point);
- void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
- void redraw(EditorSpatialGizmo *p_gizmo);
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point);
+ void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- LightSpatialGizmoPlugin();
+ LightNode3DGizmoPlugin();
};
-class AudioStreamPlayer3DSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class AudioStreamPlayer3DNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(AudioStreamPlayer3DSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(AudioStreamPlayer3DNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const;
- Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const;
- void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point);
- void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
- void redraw(EditorSpatialGizmo *p_gizmo);
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point);
+ void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- AudioStreamPlayer3DSpatialGizmoPlugin();
+ AudioStreamPlayer3DNode3DGizmoPlugin();
};
-class CameraSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class CameraNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(CameraSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(CameraNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const;
- Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const;
- void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point);
- void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
- void redraw(EditorSpatialGizmo *p_gizmo);
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point);
+ void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- CameraSpatialGizmoPlugin();
+ CameraNode3DGizmoPlugin();
};
-class MeshInstanceSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class MeshInstanceNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(MeshInstanceSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(MeshInstanceNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
bool can_be_hidden() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- MeshInstanceSpatialGizmoPlugin();
+ MeshInstanceNode3DGizmoPlugin();
};
-class Sprite3DSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class Sprite3DNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(Sprite3DSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(Sprite3DNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
bool can_be_hidden() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- Sprite3DSpatialGizmoPlugin();
+ Sprite3DNode3DGizmoPlugin();
};
-class Position3DSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class Position3DNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(Position3DSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(Position3DNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
Ref<ArrayMesh> pos3d_mesh;
Vector<Vector3> cursor_points;
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- Position3DSpatialGizmoPlugin();
+ Position3DNode3DGizmoPlugin();
};
-class SkeletonSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class SkeletonNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(SkeletonSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(SkeletonNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- SkeletonSpatialGizmoPlugin();
+ SkeletonNode3DGizmoPlugin();
};
-class PhysicalBoneSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class PhysicalBoneNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(PhysicalBoneSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(PhysicalBoneNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- PhysicalBoneSpatialGizmoPlugin();
+ PhysicalBoneNode3DGizmoPlugin();
};
-class RayCastSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class RayCastNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(RayCastSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(RayCastNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- RayCastSpatialGizmoPlugin();
+ RayCastNode3DGizmoPlugin();
};
-class SpringArmSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class SpringArmNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(SpringArmSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(SpringArmNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- SpringArmSpatialGizmoPlugin();
+ SpringArmNode3DGizmoPlugin();
};
-class VehicleWheelSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class VehicleWheelNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(VehicleWheelSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(VehicleWheelNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- VehicleWheelSpatialGizmoPlugin();
+ VehicleWheelNode3DGizmoPlugin();
};
-class SoftBodySpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class SoftBodyNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(SoftBodySpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(SoftBodyNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
bool is_selectable_when_hidden() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const;
- Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const;
- void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel);
- bool is_handle_highlighted(const EditorSpatialGizmo *p_gizmo, int idx) const;
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel);
+ bool is_handle_highlighted(const EditorNode3DGizmo *p_gizmo, int idx) const;
- SoftBodySpatialGizmoPlugin();
+ SoftBodyNode3DGizmoPlugin();
};
-class VisibilityNotifierGizmoPlugin : public EditorSpatialGizmoPlugin {
+class VisibilityNotifierGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(VisibilityNotifierGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(VisibilityNotifierGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const;
- Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const;
- void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point);
- void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point);
+ void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
VisibilityNotifierGizmoPlugin();
};
-class CPUParticlesGizmoPlugin : public EditorSpatialGizmoPlugin {
- GDCLASS(CPUParticlesGizmoPlugin, EditorSpatialGizmoPlugin);
+class CPUParticlesGizmoPlugin : public EditorNode3DGizmoPlugin {
+ GDCLASS(CPUParticlesGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
bool is_selectable_when_hidden() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
CPUParticlesGizmoPlugin();
};
-class ParticlesGizmoPlugin : public EditorSpatialGizmoPlugin {
+class ParticlesGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(ParticlesGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(ParticlesGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
bool is_selectable_when_hidden() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const;
- Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const;
- void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point);
- void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point);
+ void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
ParticlesGizmoPlugin();
};
-class ReflectionProbeGizmoPlugin : public EditorSpatialGizmoPlugin {
+class ReflectionProbeGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(ReflectionProbeGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(ReflectionProbeGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const;
- Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const;
- void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point);
- void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point);
+ void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
ReflectionProbeGizmoPlugin();
};
-class GIProbeGizmoPlugin : public EditorSpatialGizmoPlugin {
+class GIProbeGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(GIProbeGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(GIProbeGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const;
- Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const;
- void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point);
- void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point);
+ void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
GIProbeGizmoPlugin();
};
#if 0
-class BakedIndirectLightGizmoPlugin : public EditorSpatialGizmoPlugin {
+class BakedIndirectLightGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(BakedIndirectLightGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(BakedIndirectLightGizmoPlugin, EditorNode3DGizmoPlugin);
public:
bool has_gizmo(Spatial *p_spatial);
String get_name() const;
int get_priority() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const;
- Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const;
- void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point);
- void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point);
+ void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
BakedIndirectLightGizmoPlugin();
};
#endif
-class CollisionShapeSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class CollisionShapeNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(CollisionShapeSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(CollisionShapeNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- String get_handle_name(const EditorSpatialGizmo *p_gizmo, int p_idx) const;
- Variant get_handle_value(EditorSpatialGizmo *p_gizmo, int p_idx) const;
- void set_handle(EditorSpatialGizmo *p_gizmo, int p_idx, Camera *p_camera, const Point2 &p_point);
- void commit_handle(EditorSpatialGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
+ String get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ Variant get_handle_value(EditorNode3DGizmo *p_gizmo, int p_idx) const;
+ void set_handle(EditorNode3DGizmo *p_gizmo, int p_idx, Camera3D *p_camera, const Point2 &p_point);
+ void commit_handle(EditorNode3DGizmo *p_gizmo, int p_idx, const Variant &p_restore, bool p_cancel = false);
- CollisionShapeSpatialGizmoPlugin();
+ CollisionShapeNode3DGizmoPlugin();
};
-class CollisionPolygonSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
- GDCLASS(CollisionPolygonSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+class CollisionPolygonNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
+ GDCLASS(CollisionPolygonNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
- CollisionPolygonSpatialGizmoPlugin();
+ void redraw(EditorNode3DGizmo *p_gizmo);
+ CollisionPolygonNode3DGizmoPlugin();
};
-class NavigationMeshSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class NavigationMeshNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(NavigationMeshSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(NavigationMeshNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
struct _EdgeKey {
@@ -364,12 +364,12 @@ class NavigationMeshSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
};
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
- NavigationMeshSpatialGizmoPlugin();
+ NavigationMeshNode3DGizmoPlugin();
};
class JointGizmosDrawer {
@@ -387,15 +387,15 @@ public:
static void draw_cone(const Transform &p_offset, const Basis &p_base, real_t p_swing, real_t p_twist, Vector<Vector3> &r_points);
};
-class JointSpatialGizmoPlugin : public EditorSpatialGizmoPlugin {
+class JointNode3DGizmoPlugin : public EditorNode3DGizmoPlugin {
- GDCLASS(JointSpatialGizmoPlugin, EditorSpatialGizmoPlugin);
+ GDCLASS(JointNode3DGizmoPlugin, EditorNode3DGizmoPlugin);
public:
- bool has_gizmo(Spatial *p_spatial);
+ bool has_gizmo(Node3D *p_spatial);
String get_name() const;
int get_priority() const;
- void redraw(EditorSpatialGizmo *p_gizmo);
+ void redraw(EditorNode3DGizmo *p_gizmo);
static void CreatePinJointGizmo(const Transform &p_offset, Vector<Vector3> &r_cursor_points);
static void CreateHingeJointGizmo(const Transform &p_offset, const Transform &p_trs_joint, const Transform &p_trs_body_a, const Transform &p_trs_body_b, real_t p_limit_lower, real_t p_limit_upper, bool p_use_limit, Vector<Vector3> &r_common_points, Vector<Vector3> *r_body_a_points, Vector<Vector3> *r_body_b_points);
@@ -428,7 +428,7 @@ public:
Vector<Vector3> *r_body_a_points,
Vector<Vector3> *r_body_b_points);
- JointSpatialGizmoPlugin();
+ JointNode3DGizmoPlugin();
};
#endif // SPATIAL_EDITOR_GIZMOS_H