summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2021-06-16 21:52:30 -0300
committerreduz <reduzio@gmail.com>2021-06-16 22:01:39 -0300
commitab2456b7406d34bb446033de6ce76096f4502c9e (patch)
treebe50809d959c59d4378a79e7792308bc47c0cc8c /scene
parentbb4c464fecae268a419a91db8eec8f525e904b45 (diff)
Rename VisibilityNotifierXD to VisibleOnScreenNotifierXD
* Renames for 2D and 3D * Class name was confusing, given both 2D and 3D have a "visible" property that is unrelated to actual on-screen visibility. * New name makes it clear that this is about visibility on screen.
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/visible_on_screen_notifier_2d.cpp (renamed from scene/2d/visibility_notifier_2d.cpp)62
-rw-r--r--scene/2d/visible_on_screen_notifier_2d.h (renamed from scene/2d/visibility_notifier_2d.h)20
-rw-r--r--scene/3d/visible_on_screen_notifier_3d.cpp (renamed from scene/3d/visibility_notifier_3d.cpp)61
-rw-r--r--scene/3d/visible_on_screen_notifier_3d.h (renamed from scene/3d/visibility_notifier_3d.h)21
-rw-r--r--scene/register_scene_types.cpp18
-rw-r--r--scene/resources/world_2d.cpp2
-rw-r--r--scene/resources/world_2d.h2
-rw-r--r--scene/resources/world_3d.cpp2
-rw-r--r--scene/resources/world_3d.h2
9 files changed, 99 insertions, 91 deletions
diff --git a/scene/2d/visibility_notifier_2d.cpp b/scene/2d/visible_on_screen_notifier_2d.cpp
index a73d60ada5..25237edacf 100644
--- a/scene/2d/visibility_notifier_2d.cpp
+++ b/scene/2d/visible_on_screen_notifier_2d.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visibility_notifier_2d.cpp */
+/* visible_on_screen_notifier_2d.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "visibility_notifier_2d.h"
+#include "visible_on_screen_notifier_2d.h"
#include "core/config/engine.h"
#include "gpu_particles_2d.h"
@@ -39,16 +39,16 @@
#include "scene/scene_string_names.h"
#ifdef TOOLS_ENABLED
-Rect2 VisibilityNotifier2D::_edit_get_rect() const {
+Rect2 VisibleOnScreenNotifier2D::_edit_get_rect() const {
return rect;
}
-bool VisibilityNotifier2D::_edit_use_rect() const {
+bool VisibleOnScreenNotifier2D::_edit_use_rect() const {
return true;
}
#endif
-void VisibilityNotifier2D::_visibility_enter() {
+void VisibleOnScreenNotifier2D::_visibility_enter() {
if (!is_inside_tree() || Engine::get_singleton()->is_editor_hint()) {
return;
}
@@ -57,7 +57,7 @@ void VisibilityNotifier2D::_visibility_enter() {
emit_signal(SceneStringNames::get_singleton()->screen_entered);
_screen_enter();
}
-void VisibilityNotifier2D::_visibility_exit() {
+void VisibleOnScreenNotifier2D::_visibility_exit() {
if (!is_inside_tree() || Engine::get_singleton()->is_editor_hint()) {
return;
}
@@ -67,23 +67,23 @@ void VisibilityNotifier2D::_visibility_exit() {
_screen_exit();
}
-void VisibilityNotifier2D::set_rect(const Rect2 &p_rect) {
+void VisibleOnScreenNotifier2D::set_rect(const Rect2 &p_rect) {
rect = p_rect;
if (is_inside_tree()) {
- RS::get_singleton()->canvas_item_set_visibility_notifier(get_canvas_item(), true, rect, callable_mp(this, &VisibilityNotifier2D::_visibility_enter), callable_mp(this, &VisibilityNotifier2D::_visibility_exit));
+ RS::get_singleton()->canvas_item_set_visibility_notifier(get_canvas_item(), true, rect, callable_mp(this, &VisibleOnScreenNotifier2D::_visibility_enter), callable_mp(this, &VisibleOnScreenNotifier2D::_visibility_exit));
}
}
-Rect2 VisibilityNotifier2D::get_rect() const {
+Rect2 VisibleOnScreenNotifier2D::get_rect() const {
return rect;
}
-void VisibilityNotifier2D::_notification(int p_what) {
+void VisibleOnScreenNotifier2D::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_ENTER_TREE: {
//get_world_2d()->
on_screen = false;
- RS::get_singleton()->canvas_item_set_visibility_notifier(get_canvas_item(), true, rect, callable_mp(this, &VisibilityNotifier2D::_visibility_enter), callable_mp(this, &VisibilityNotifier2D::_visibility_exit));
+ RS::get_singleton()->canvas_item_set_visibility_notifier(get_canvas_item(), true, rect, callable_mp(this, &VisibleOnScreenNotifier2D::_visibility_enter), callable_mp(this, &VisibleOnScreenNotifier2D::_visibility_exit));
} break;
case NOTIFICATION_DRAW: {
if (Engine::get_singleton()->is_editor_hint()) {
@@ -97,14 +97,14 @@ void VisibilityNotifier2D::_notification(int p_what) {
}
}
-bool VisibilityNotifier2D::is_on_screen() const {
+bool VisibleOnScreenNotifier2D::is_on_screen() const {
return on_screen;
}
-void VisibilityNotifier2D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_rect", "rect"), &VisibilityNotifier2D::set_rect);
- ClassDB::bind_method(D_METHOD("get_rect"), &VisibilityNotifier2D::get_rect);
- ClassDB::bind_method(D_METHOD("is_on_screen"), &VisibilityNotifier2D::is_on_screen);
+void VisibleOnScreenNotifier2D::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_rect", "rect"), &VisibleOnScreenNotifier2D::set_rect);
+ ClassDB::bind_method(D_METHOD("get_rect"), &VisibleOnScreenNotifier2D::get_rect);
+ ClassDB::bind_method(D_METHOD("is_on_screen"), &VisibleOnScreenNotifier2D::is_on_screen);
ADD_PROPERTY(PropertyInfo(Variant::RECT2, "rect"), "set_rect", "get_rect");
@@ -112,31 +112,31 @@ void VisibilityNotifier2D::_bind_methods() {
ADD_SIGNAL(MethodInfo("screen_exited"));
}
-VisibilityNotifier2D::VisibilityNotifier2D() {
+VisibleOnScreenNotifier2D::VisibleOnScreenNotifier2D() {
rect = Rect2(-10, -10, 20, 20);
}
//////////////////////////////////////
-void VisibilityEnabler2D::_screen_enter() {
+void VisibleOnScreenEnabler2D::_screen_enter() {
_update_enable_mode(true);
}
-void VisibilityEnabler2D::_screen_exit() {
+void VisibleOnScreenEnabler2D::_screen_exit() {
_update_enable_mode(false);
}
-void VisibilityEnabler2D::set_enable_mode(EnableMode p_mode) {
+void VisibleOnScreenEnabler2D::set_enable_mode(EnableMode p_mode) {
enable_mode = p_mode;
if (is_inside_tree()) {
_update_enable_mode(is_on_screen());
}
}
-VisibilityEnabler2D::EnableMode VisibilityEnabler2D::get_enable_mode() {
+VisibleOnScreenEnabler2D::EnableMode VisibleOnScreenEnabler2D::get_enable_mode() {
return enable_mode;
}
-void VisibilityEnabler2D::set_enable_node_path(NodePath p_path) {
+void VisibleOnScreenEnabler2D::set_enable_node_path(NodePath p_path) {
if (enable_node_path == p_path) {
return;
}
@@ -150,11 +150,11 @@ void VisibilityEnabler2D::set_enable_node_path(NodePath p_path) {
}
}
}
-NodePath VisibilityEnabler2D::get_enable_node_path() {
+NodePath VisibleOnScreenEnabler2D::get_enable_node_path() {
return enable_node_path;
}
-void VisibilityEnabler2D::_update_enable_mode(bool p_enable) {
+void VisibleOnScreenEnabler2D::_update_enable_mode(bool p_enable) {
Node *node = static_cast<Node *>(ObjectDB::get_instance(node_id));
if (node) {
if (p_enable) {
@@ -174,7 +174,7 @@ void VisibilityEnabler2D::_update_enable_mode(bool p_enable) {
}
}
}
-void VisibilityEnabler2D::_notification(int p_what) {
+void VisibleOnScreenEnabler2D::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
if (Engine::get_singleton()->is_editor_hint()) {
return;
@@ -193,12 +193,12 @@ void VisibilityEnabler2D::_notification(int p_what) {
}
}
-void VisibilityEnabler2D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_enable_mode", "mode"), &VisibilityEnabler2D::set_enable_mode);
- ClassDB::bind_method(D_METHOD("get_enable_mode"), &VisibilityEnabler2D::get_enable_mode);
+void VisibleOnScreenEnabler2D::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_enable_mode", "mode"), &VisibleOnScreenEnabler2D::set_enable_mode);
+ ClassDB::bind_method(D_METHOD("get_enable_mode"), &VisibleOnScreenEnabler2D::get_enable_mode);
- ClassDB::bind_method(D_METHOD("set_enable_node_path", "path"), &VisibilityEnabler2D::set_enable_node_path);
- ClassDB::bind_method(D_METHOD("get_enable_node_path"), &VisibilityEnabler2D::get_enable_node_path);
+ ClassDB::bind_method(D_METHOD("set_enable_node_path", "path"), &VisibleOnScreenEnabler2D::set_enable_node_path);
+ ClassDB::bind_method(D_METHOD("get_enable_node_path"), &VisibleOnScreenEnabler2D::get_enable_node_path);
ADD_GROUP("Enabling", "enable_");
ADD_PROPERTY(PropertyInfo(Variant::INT, "enable_mode", PROPERTY_HINT_ENUM, "Inherit,Always,WhenPaused"), "set_enable_mode", "get_enable_mode");
@@ -209,5 +209,5 @@ void VisibilityEnabler2D::_bind_methods() {
BIND_ENUM_CONSTANT(ENABLE_MODE_WHEN_PAUSED);
}
-VisibilityEnabler2D::VisibilityEnabler2D() {
+VisibleOnScreenEnabler2D::VisibleOnScreenEnabler2D() {
}
diff --git a/scene/2d/visibility_notifier_2d.h b/scene/2d/visible_on_screen_notifier_2d.h
index 8cb0989787..9c236a138f 100644
--- a/scene/2d/visibility_notifier_2d.h
+++ b/scene/2d/visible_on_screen_notifier_2d.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visibility_notifier_2d.h */
+/* visible_on_screen_notifier_2d.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,14 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef VISIBILITY_NOTIFIER_2D_H
-#define VISIBILITY_NOTIFIER_2D_H
+#ifndef VISIBLE_ON_SCREEN_NOTIFIER_2D_H
+#define VISIBLE_ON_SCREEN_NOTIFIER_2D_H
#include "scene/2d/node_2d.h"
class Viewport;
-class VisibilityNotifier2D : public Node2D {
- GDCLASS(VisibilityNotifier2D, Node2D);
+class VisibleOnScreenNotifier2D : public Node2D {
+ GDCLASS(VisibleOnScreenNotifier2D, Node2D);
Set<Viewport *> viewports;
@@ -64,11 +64,11 @@ public:
bool is_on_screen() const;
- VisibilityNotifier2D();
+ VisibleOnScreenNotifier2D();
};
-class VisibilityEnabler2D : public VisibilityNotifier2D {
- GDCLASS(VisibilityEnabler2D, VisibilityNotifier2D);
+class VisibleOnScreenEnabler2D : public VisibleOnScreenNotifier2D {
+ GDCLASS(VisibleOnScreenEnabler2D, VisibleOnScreenNotifier2D);
public:
enum EnableMode {
@@ -97,9 +97,9 @@ public:
void set_enable_node_path(NodePath p_path);
NodePath get_enable_node_path();
- VisibilityEnabler2D();
+ VisibleOnScreenEnabler2D();
};
-VARIANT_ENUM_CAST(VisibilityEnabler2D::EnableMode);
+VARIANT_ENUM_CAST(VisibleOnScreenEnabler2D::EnableMode);
#endif // VISIBILITY_NOTIFIER_2D_H
diff --git a/scene/3d/visibility_notifier_3d.cpp b/scene/3d/visible_on_screen_notifier_3d.cpp
index 39b17d195b..682bcec449 100644
--- a/scene/3d/visibility_notifier_3d.cpp
+++ b/scene/3d/visible_on_screen_notifier_3d.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visibility_notifier_3d.cpp */
+/* visible_on_screen_notifier_3d.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#include "visibility_notifier_3d.h"
+#include "visible_on_screen_notifier_3d.h"
#include "core/config/engine.h"
#include "scene/3d/camera_3d.h"
@@ -36,7 +36,7 @@
#include "scene/animation/animation_player.h"
#include "scene/scene_string_names.h"
-void VisibilityNotifier3D::_visibility_enter() {
+void VisibleOnScreenNotifier3D::_visibility_enter() {
if (!is_inside_tree() || Engine::get_singleton()->is_editor_hint()) {
return;
}
@@ -45,7 +45,7 @@ void VisibilityNotifier3D::_visibility_enter() {
emit_signal(SceneStringNames::get_singleton()->screen_entered);
_screen_enter();
}
-void VisibilityNotifier3D::_visibility_exit() {
+void VisibleOnScreenNotifier3D::_visibility_exit() {
if (!is_inside_tree() || Engine::get_singleton()->is_editor_hint()) {
return;
}
@@ -55,7 +55,7 @@ void VisibilityNotifier3D::_visibility_exit() {
_screen_exit();
}
-void VisibilityNotifier3D::set_aabb(const AABB &p_aabb) {
+void VisibleOnScreenNotifier3D::set_aabb(const AABB &p_aabb) {
if (aabb == p_aabb) {
return;
}
@@ -66,23 +66,23 @@ void VisibilityNotifier3D::set_aabb(const AABB &p_aabb) {
update_gizmo();
}
-AABB VisibilityNotifier3D::get_aabb() const {
+AABB VisibleOnScreenNotifier3D::get_aabb() const {
return aabb;
}
-bool VisibilityNotifier3D::is_on_screen() const {
+bool VisibleOnScreenNotifier3D::is_on_screen() const {
return on_screen;
}
-void VisibilityNotifier3D::_notification(int p_what) {
+void VisibleOnScreenNotifier3D::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_EXIT_TREE) {
on_screen = false;
}
}
-void VisibilityNotifier3D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_aabb", "rect"), &VisibilityNotifier3D::set_aabb);
- ClassDB::bind_method(D_METHOD("is_on_screen"), &VisibilityNotifier3D::is_on_screen);
+void VisibleOnScreenNotifier3D::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_aabb", "rect"), &VisibleOnScreenNotifier3D::set_aabb);
+ ClassDB::bind_method(D_METHOD("is_on_screen"), &VisibleOnScreenNotifier3D::is_on_screen);
ADD_PROPERTY(PropertyInfo(Variant::AABB, "aabb"), "set_aabb", "get_aabb");
@@ -90,38 +90,43 @@ void VisibilityNotifier3D::_bind_methods() {
ADD_SIGNAL(MethodInfo("screen_exited"));
}
-Vector<Face3> VisibilityNotifier3D::get_faces(uint32_t p_usage_flags) const {
+Vector<Face3> VisibleOnScreenNotifier3D::get_faces(uint32_t p_usage_flags) const {
return Vector<Face3>();
}
-VisibilityNotifier3D::VisibilityNotifier3D() {
+VisibleOnScreenNotifier3D::VisibleOnScreenNotifier3D() {
RID notifier = RS::get_singleton()->visibility_notifier_create();
RS::get_singleton()->visibility_notifier_set_aabb(notifier, aabb);
- RS::get_singleton()->visibility_notifier_set_callbacks(notifier, callable_mp(this, &VisibilityNotifier3D::_visibility_enter), callable_mp(this, &VisibilityNotifier3D::_visibility_exit));
+ RS::get_singleton()->visibility_notifier_set_callbacks(notifier, callable_mp(this, &VisibleOnScreenNotifier3D::_visibility_enter), callable_mp(this, &VisibleOnScreenNotifier3D::_visibility_exit));
set_base(notifier);
}
+VisibleOnScreenNotifier3D::~VisibleOnScreenNotifier3D() {
+ RID base = get_base();
+ set_base(RID());
+ RS::get_singleton()->free(base);
+}
//////////////////////////////////////
-void VisibilityEnabler3D::_screen_enter() {
+void VisibleOnScreenEnabler3D::_screen_enter() {
_update_enable_mode(true);
}
-void VisibilityEnabler3D::_screen_exit() {
+void VisibleOnScreenEnabler3D::_screen_exit() {
_update_enable_mode(false);
}
-void VisibilityEnabler3D::set_enable_mode(EnableMode p_mode) {
+void VisibleOnScreenEnabler3D::set_enable_mode(EnableMode p_mode) {
enable_mode = p_mode;
if (is_inside_tree()) {
_update_enable_mode(is_on_screen());
}
}
-VisibilityEnabler3D::EnableMode VisibilityEnabler3D::get_enable_mode() {
+VisibleOnScreenEnabler3D::EnableMode VisibleOnScreenEnabler3D::get_enable_mode() {
return enable_mode;
}
-void VisibilityEnabler3D::set_enable_node_path(NodePath p_path) {
+void VisibleOnScreenEnabler3D::set_enable_node_path(NodePath p_path) {
if (enable_node_path == p_path) {
return;
}
@@ -135,11 +140,11 @@ void VisibilityEnabler3D::set_enable_node_path(NodePath p_path) {
}
}
}
-NodePath VisibilityEnabler3D::get_enable_node_path() {
+NodePath VisibleOnScreenEnabler3D::get_enable_node_path() {
return enable_node_path;
}
-void VisibilityEnabler3D::_update_enable_mode(bool p_enable) {
+void VisibleOnScreenEnabler3D::_update_enable_mode(bool p_enable) {
Node *node = static_cast<Node *>(ObjectDB::get_instance(node_id));
if (node) {
if (p_enable) {
@@ -159,7 +164,7 @@ void VisibilityEnabler3D::_update_enable_mode(bool p_enable) {
}
}
}
-void VisibilityEnabler3D::_notification(int p_what) {
+void VisibleOnScreenEnabler3D::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
if (Engine::get_singleton()->is_editor_hint()) {
return;
@@ -178,12 +183,12 @@ void VisibilityEnabler3D::_notification(int p_what) {
}
}
-void VisibilityEnabler3D::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_enable_mode", "mode"), &VisibilityEnabler3D::set_enable_mode);
- ClassDB::bind_method(D_METHOD("get_enable_mode"), &VisibilityEnabler3D::get_enable_mode);
+void VisibleOnScreenEnabler3D::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("set_enable_mode", "mode"), &VisibleOnScreenEnabler3D::set_enable_mode);
+ ClassDB::bind_method(D_METHOD("get_enable_mode"), &VisibleOnScreenEnabler3D::get_enable_mode);
- ClassDB::bind_method(D_METHOD("set_enable_node_path", "path"), &VisibilityEnabler3D::set_enable_node_path);
- ClassDB::bind_method(D_METHOD("get_enable_node_path"), &VisibilityEnabler3D::get_enable_node_path);
+ ClassDB::bind_method(D_METHOD("set_enable_node_path", "path"), &VisibleOnScreenEnabler3D::set_enable_node_path);
+ ClassDB::bind_method(D_METHOD("get_enable_node_path"), &VisibleOnScreenEnabler3D::get_enable_node_path);
ADD_GROUP("Enabling", "enable_");
ADD_PROPERTY(PropertyInfo(Variant::INT, "enable_mode", PROPERTY_HINT_ENUM, "Inherit,Always,WhenPaused"), "set_enable_mode", "get_enable_mode");
@@ -194,5 +199,5 @@ void VisibilityEnabler3D::_bind_methods() {
BIND_ENUM_CONSTANT(ENABLE_MODE_WHEN_PAUSED);
}
-VisibilityEnabler3D::VisibilityEnabler3D() {
+VisibleOnScreenEnabler3D::VisibleOnScreenEnabler3D() {
}
diff --git a/scene/3d/visibility_notifier_3d.h b/scene/3d/visible_on_screen_notifier_3d.h
index 878c97e35e..fb7137c4f0 100644
--- a/scene/3d/visibility_notifier_3d.h
+++ b/scene/3d/visible_on_screen_notifier_3d.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* visibility_notifier_3d.h */
+/* visible_on_screen_notifier_3d.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -28,15 +28,15 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
-#ifndef VISIBILITY_NOTIFIER_H
-#define VISIBILITY_NOTIFIER_H
+#ifndef VISIBLE_ON_SCREEN_NOTIFIER_3D_H
+#define VISIBLE_ON_SCREEN_NOTIFIER_3D_H
#include "scene/3d/visual_instance_3d.h"
class World3D;
class Camera3D;
-class VisibilityNotifier3D : public VisualInstance3D {
- GDCLASS(VisibilityNotifier3D, VisualInstance3D);
+class VisibleOnScreenNotifier3D : public VisualInstance3D {
+ GDCLASS(VisibleOnScreenNotifier3D, VisualInstance3D);
AABB aabb = AABB(Vector3(-1, -1, -1), Vector3(2, 2, 2));
@@ -59,11 +59,12 @@ public:
virtual Vector<Face3> get_faces(uint32_t p_usage_flags) const override;
- VisibilityNotifier3D();
+ VisibleOnScreenNotifier3D();
+ ~VisibleOnScreenNotifier3D();
};
-class VisibilityEnabler3D : public VisibilityNotifier3D {
- GDCLASS(VisibilityEnabler3D, VisibilityNotifier3D);
+class VisibleOnScreenEnabler3D : public VisibleOnScreenNotifier3D {
+ GDCLASS(VisibleOnScreenEnabler3D, VisibleOnScreenNotifier3D);
public:
enum EnableMode {
@@ -92,9 +93,9 @@ public:
void set_enable_node_path(NodePath p_path);
NodePath get_enable_node_path();
- VisibilityEnabler3D();
+ VisibleOnScreenEnabler3D();
};
-VARIANT_ENUM_CAST(VisibilityEnabler3D::EnableMode);
+VARIANT_ENUM_CAST(VisibleOnScreenEnabler3D::EnableMode);
#endif // VISIBILITY_NOTIFIER_H
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 332976a18d..2a97ae3acf 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -65,7 +65,7 @@
#include "scene/2d/sprite_2d.h"
#include "scene/2d/tile_map.h"
#include "scene/2d/touch_screen_button.h"
-#include "scene/2d/visibility_notifier_2d.h"
+#include "scene/2d/visible_on_screen_notifier_2d.h"
#include "scene/animation/animation_blend_space_1d.h"
#include "scene/animation/animation_blend_space_2d.h"
#include "scene/animation/animation_blend_tree.h"
@@ -229,7 +229,7 @@
#include "scene/3d/spring_arm_3d.h"
#include "scene/3d/sprite_3d.h"
#include "scene/3d/vehicle_body_3d.h"
-#include "scene/3d/visibility_notifier_3d.h"
+#include "scene/3d/visible_on_screen_notifier_3d.h"
#include "scene/3d/voxel_gi.h"
#include "scene/3d/world_environment.h"
#include "scene/3d/xr_nodes.h"
@@ -513,8 +513,8 @@ void register_scene_types() {
ClassDB::register_class<Curve3D>();
ClassDB::register_class<Path3D>();
ClassDB::register_class<PathFollow3D>();
- ClassDB::register_class<VisibilityNotifier3D>();
- ClassDB::register_class<VisibilityEnabler3D>();
+ ClassDB::register_class<VisibleOnScreenNotifier3D>();
+ ClassDB::register_class<VisibleOnScreenEnabler3D>();
ClassDB::register_class<WorldEnvironment>();
ClassDB::register_class<RemoteTransform3D>();
@@ -655,8 +655,8 @@ void register_scene_types() {
ClassDB::register_class<CollisionShape2D>();
ClassDB::register_class<CollisionPolygon2D>();
ClassDB::register_class<RayCast2D>();
- ClassDB::register_class<VisibilityNotifier2D>();
- ClassDB::register_class<VisibilityEnabler2D>();
+ ClassDB::register_class<VisibleOnScreenNotifier2D>();
+ ClassDB::register_class<VisibleOnScreenEnabler2D>();
ClassDB::register_class<Polygon2D>();
ClassDB::register_class<Skeleton2D>();
ClassDB::register_class<Bone2D>();
@@ -966,8 +966,8 @@ void register_scene_types() {
ClassDB::add_compatibility_class("VehicleWheel", "VehicleWheel3D");
ClassDB::add_compatibility_class("ViewportContainer", "SubViewportContainer");
ClassDB::add_compatibility_class("Viewport", "SubViewport");
- ClassDB::add_compatibility_class("VisibilityEnabler", "VisibilityEnabler3D");
- ClassDB::add_compatibility_class("VisibilityNotifier", "VisibilityNotifier3D");
+ ClassDB::add_compatibility_class("VisibilityEnabler", "VisibleOnScreenEnabler3D");
+ ClassDB::add_compatibility_class("VisibilityNotifier", "VisibleOnScreenNotifier3D");
ClassDB::add_compatibility_class("VisualServer", "RenderingServer");
ClassDB::add_compatibility_class("VisualShaderNodeScalarConstant", "VisualShaderNodeFloatConstant");
ClassDB::add_compatibility_class("VisualShaderNodeScalarFunc", "VisualShaderNodeFloatFunc");
@@ -986,6 +986,8 @@ void register_scene_types() {
ClassDB::add_compatibility_class("World", "World3D");
ClassDB::add_compatibility_class("StreamTexture", "StreamTexture2D");
ClassDB::add_compatibility_class("Light2D", "PointLight2D");
+ ClassDB::add_compatibility_class("VisibilityNotifier2D", "VisibleOnScreenNotifier2D");
+ ClassDB::add_compatibility_class("VisibilityNotifier3D", "VisibleOnScreenNotifier3D");
#endif /* DISABLE_DEPRECATED */
diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp
index 9a7a47f884..8af4deda83 100644
--- a/scene/resources/world_2d.cpp
+++ b/scene/resources/world_2d.cpp
@@ -32,7 +32,7 @@
#include "core/config/project_settings.h"
#include "scene/2d/camera_2d.h"
-#include "scene/2d/visibility_notifier_2d.h"
+#include "scene/2d/visible_on_screen_notifier_2d.h"
#include "scene/main/window.h"
#include "servers/navigation_server_2d.h"
#include "servers/physics_server_2d.h"
diff --git a/scene/resources/world_2d.h b/scene/resources/world_2d.h
index e31ac22351..65f89c8f64 100644
--- a/scene/resources/world_2d.h
+++ b/scene/resources/world_2d.h
@@ -35,7 +35,7 @@
#include "core/io/resource.h"
#include "servers/physics_server_2d.h"
-class VisibilityNotifier2D;
+class VisibleOnScreenNotifier2D;
class Viewport;
struct SpatialIndexer2D;
diff --git a/scene/resources/world_3d.cpp b/scene/resources/world_3d.cpp
index a85bd8fdba..8d9b1fd6ec 100644
--- a/scene/resources/world_3d.cpp
+++ b/scene/resources/world_3d.cpp
@@ -33,7 +33,7 @@
#include "core/math/camera_matrix.h"
#include "core/math/octree.h"
#include "scene/3d/camera_3d.h"
-#include "scene/3d/visibility_notifier_3d.h"
+#include "scene/3d/visible_on_screen_notifier_3d.h"
#include "scene/scene_string_names.h"
#include "servers/navigation_server_3d.h"
diff --git a/scene/resources/world_3d.h b/scene/resources/world_3d.h
index da5ed486b0..2c5be35609 100644
--- a/scene/resources/world_3d.h
+++ b/scene/resources/world_3d.h
@@ -38,7 +38,7 @@
#include "servers/rendering_server.h"
class Camera3D;
-class VisibilityNotifier3D;
+class VisibleOnScreenNotifier3D;
struct SpatialIndexer;
class World3D : public Resource {