summaryrefslogtreecommitdiff
path: root/editor/plugins/node_3d_editor_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/node_3d_editor_plugin.cpp')
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 01868ba77e..afd8d2d075 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -501,7 +501,7 @@ ObjectID Node3DEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, b
Node *edited_scene = get_tree()->get_edited_scene_root();
ObjectID closest;
- Node *item = NULL;
+ Node *item = nullptr;
float closest_dist = 1e20;
int selected_handle = -1;
@@ -588,7 +588,7 @@ void Node3DEditorViewport::_find_items_at_pos(const Point2 &p_pos, bool &r_inclu
Vector3 normal;
int handle = -1;
- bool inters = seg->intersect_ray(camera, p_pos, point, normal, NULL, p_alt_select);
+ bool inters = seg->intersect_ray(camera, p_pos, point, normal, nullptr, p_alt_select);
if (!inters)
continue;
@@ -2273,7 +2273,7 @@ static bool is_shortcut_pressed(const String &p_path) {
return false;
}
InputEventKey *k = Object::cast_to<InputEventKey>(shortcut->get_shortcut().ptr());
- if (k == NULL) {
+ if (k == nullptr) {
return false;
}
const InputFilter &input = *InputFilter::get_singleton();
@@ -2386,11 +2386,11 @@ void Node3DEditorViewport::_notification(int p_what) {
_update_freelook(delta);
Node *scene_root = editor->get_scene_tree_dock()->get_editor_data()->get_edited_scene_root();
- if (previewing_cinema && scene_root != NULL) {
+ if (previewing_cinema && scene_root != nullptr) {
Camera3D *cam = scene_root->get_viewport()->get_camera();
- if (cam != NULL && cam != previewing) {
+ if (cam != nullptr && cam != previewing) {
//then switch the viewport's camera to the scene's viewport camera
- if (previewing != NULL) {
+ if (previewing != nullptr) {
previewing->disconnect("tree_exited", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
}
previewing = cam;
@@ -2950,7 +2950,7 @@ void Node3DEditorViewport::_menu_option(int p_option) {
if (current) {
preview_camera->hide();
} else {
- if (previewing != NULL)
+ if (previewing != nullptr)
preview_camera->show();
}
} break;
@@ -3137,7 +3137,7 @@ void Node3DEditorViewport::_toggle_camera_preview(bool p_activate) {
if (!p_activate) {
previewing->disconnect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
- previewing = NULL;
+ previewing = nullptr;
RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore
if (!preview)
preview_camera->hide();
@@ -3157,10 +3157,10 @@ void Node3DEditorViewport::_toggle_camera_preview(bool p_activate) {
void Node3DEditorViewport::_toggle_cinema_preview(bool p_activate) {
previewing_cinema = p_activate;
if (!previewing_cinema) {
- if (previewing != NULL)
+ if (previewing != nullptr)
previewing->disconnect("tree_exited", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
- previewing = NULL;
+ previewing = nullptr;
RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore
preview_camera->set_pressed(false);
if (!preview) {
@@ -3503,7 +3503,7 @@ Vector3 Node3DEditorViewport::_get_instance_position(const Point2 &p_pos) const
Vector3 hit_point;
Vector3 hit_normal;
- bool inters = seg->intersect_ray(camera, p_pos, hit_point, hit_normal, NULL, false);
+ bool inters = seg->intersect_ray(camera, p_pos, hit_point, hit_normal, nullptr, false);
if (!inters)
continue;
@@ -3568,8 +3568,8 @@ void Node3DEditorViewport::_create_preview(const Vector<String> &files) const {
ERR_CONTINUE(res.is_null());
Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res));
Ref<Mesh> mesh = Ref<Mesh>(Object::cast_to<Mesh>(*res));
- if (mesh != NULL || scene != NULL) {
- if (mesh != NULL) {
+ if (mesh != nullptr || scene != nullptr) {
+ if (mesh != nullptr) {
MeshInstance3D *mesh_instance = memnew(MeshInstance3D);
mesh_instance->set_mesh(mesh);
preview_node->add_child(mesh_instance);
@@ -3620,10 +3620,10 @@ bool Node3DEditorViewport::_create_instance(Node *parent, String &path, const Po
Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res));
Ref<Mesh> mesh = Ref<Mesh>(Object::cast_to<Mesh>(*res));
- Node *instanced_scene = NULL;
+ Node *instanced_scene = nullptr;
- if (mesh != NULL || scene != NULL) {
- if (mesh != NULL) {
+ if (mesh != nullptr || scene != nullptr) {
+ if (mesh != nullptr) {
MeshInstance3D *mesh_instance = memnew(MeshInstance3D);
mesh_instance->set_mesh(mesh);
mesh_instance->set_name(path.get_file().get_basename());
@@ -3637,7 +3637,7 @@ bool Node3DEditorViewport::_create_instance(Node *parent, String &path, const Po
}
}
- if (instanced_scene == NULL) {
+ if (instanced_scene == nullptr) {
return false;
}
@@ -3648,7 +3648,7 @@ bool Node3DEditorViewport::_create_instance(Node *parent, String &path, const Po
}
}
- if (scene != NULL) {
+ if (scene != nullptr) {
instanced_scene->set_filename(ProjectSettings::get_singleton()->localize_path(path));
}
@@ -3689,7 +3689,7 @@ void Node3DEditorViewport::_perform_drop_data() {
}
Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res));
Ref<Mesh> mesh = Ref<Mesh>(Object::cast_to<Mesh>(*res));
- if (mesh != NULL || scene != NULL) {
+ if (mesh != nullptr || scene != nullptr) {
bool success = _create_instance(target_node, path, drop_pos);
if (!success) {
error_files.push_back(path);
@@ -3964,10 +3964,10 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, Edito
preview_camera->set_h_size_flags(0);
preview_camera->hide();
preview_camera->connect("toggled", callable_mp(this, &Node3DEditorViewport::_toggle_camera_preview));
- previewing = NULL;
+ previewing = nullptr;
gizmo_scale = 1.0;
- preview_node = NULL;
+ preview_node = nullptr;
info_label = memnew(Label);
info_label->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -90 * EDSCALE);
@@ -4030,7 +4030,7 @@ Node3DEditorViewport::Node3DEditorViewport(Node3DEditor *p_spatial_editor, Edito
surface->add_child(top_right_vbox);
- accept = NULL;
+ accept = nullptr;
freelook_active = false;
freelook_speed = EditorSettings::get_singleton()->get("editors/3d/freelook/freelook_base_speed");
@@ -4393,7 +4393,7 @@ Node3DEditorViewportContainer::Node3DEditorViewportContainer() {
///////////////////////////////////////////////////////////////////
-Node3DEditor *Node3DEditor::singleton = NULL;
+Node3DEditor *Node3DEditor::singleton = nullptr;
Node3DEditorSelectedItem::~Node3DEditorSelectedItem() {
@@ -4479,7 +4479,7 @@ Object *Node3DEditor::_get_editor_data(Object *p_what) {
Node3D *sp = Object::cast_to<Node3D>(p_what);
if (!sp)
- return NULL;
+ return nullptr;
Node3DEditorSelectedItem *si = memnew(Node3DEditorSelectedItem);
@@ -5903,7 +5903,7 @@ void Node3DEditor::_toggle_maximize_view(Object *p_viewport) {
void Node3DEditor::_node_removed(Node *p_node) {
if (p_node == selected)
- selected = NULL;
+ selected = nullptr;
}
void Node3DEditor::_register_all_gizmos() {
@@ -5979,7 +5979,7 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) {
undo_redo = p_editor->get_undo_redo();
VBoxContainer *vbc = this;
- custom_camera = NULL;
+ custom_camera = nullptr;
singleton = this;
editor = p_editor;
editor_selection = editor->get_editor_selection();
@@ -6315,7 +6315,7 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) {
scenario_debug = RenderingServer::SCENARIO_DEBUG_DISABLED;
- selected = NULL;
+ selected = nullptr;
set_process_unhandled_key_input(true);
add_to_group("_spatial_editor_group");
@@ -6761,8 +6761,8 @@ EditorNode3DGizmoPlugin::EditorNode3DGizmoPlugin() {
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);
+ current_gizmos[i]->set_plugin(nullptr);
+ current_gizmos[i]->get_spatial_node()->set_gizmo(nullptr);
}
if (Node3DEditor::get_singleton()) {
Node3DEditor::get_singleton()->update_all_gizmos();