diff options
author | reduz <reduzio@gmail.com> | 2021-06-16 15:43:02 -0300 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2021-06-16 18:50:39 -0300 |
commit | 6e98c4cd502949fc3659c882ac671a69457251b4 (patch) | |
tree | 5191d90e436da24e7eb69ca14694740cba1b70e2 /servers/rendering/renderer_rd/renderer_storage_rd.h | |
parent | 341cb8da311698d685b390524d0f20795f1774d7 (diff) |
Refactor VisibilityNotifier3D
* This is the 3D counterpart to #49632
* Implemented a bit different as 3D works using instancing
After merged, both 2D and 3D classes will most likely be renamed in a separate PR to DisplayNotifier2D/3D.
Diffstat (limited to 'servers/rendering/renderer_rd/renderer_storage_rd.h')
-rw-r--r-- | servers/rendering/renderer_rd/renderer_storage_rd.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.h b/servers/rendering/renderer_rd/renderer_storage_rd.h index 28a1044705..ab470cb3a6 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.h +++ b/servers/rendering/renderer_rd/renderer_storage_rd.h @@ -947,6 +947,17 @@ private: mutable RID_Owner<ParticlesCollisionInstance> particles_collision_instance_owner; + /* visibility_notifier */ + + struct VisibilityNotifier { + AABB aabb; + Callable enter_callback; + Callable exit_callback; + Dependency dependency; + }; + + mutable RID_Owner<VisibilityNotifier> visibility_notifier_owner; + /* Skeleton */ struct Skeleton { @@ -2253,6 +2264,14 @@ public: virtual bool particles_collision_is_heightfield(RID p_particles_collision) const; RID particles_collision_get_heightfield_framebuffer(RID p_particles_collision) const; + virtual RID visibility_notifier_allocate(); + virtual void visibility_notifier_initialize(RID p_notifier); + virtual void visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb); + virtual void visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable); + + virtual AABB visibility_notifier_get_aabb(RID p_notifier) const; + virtual void visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred); + //used from 2D and 3D virtual RID particles_collision_instance_create(RID p_collision); virtual void particles_collision_instance_set_transform(RID p_collision_instance, const Transform3D &p_transform); |