Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
VisibleOnScreenNotifier3D¶
继承: VisualInstance3D < Node3D < Node < Object
3D 空间的盒形区块,用于检测其在屏幕上是否可见。
描述¶
VisibleOnScreenEnabler3D 表示 3D 空间的盒形区块。当该区块的任何部分在屏幕或 Camera3D 视图中可见时,它将发出 screen_entered 信号;同样,当其任何部分都不可见时,它将发出 screen_exited 信号。
如果你希望当该区块在屏幕上可见时自动启用节点,请使用 VisibleOnScreenEnabler3D。
注意:VisibleOnScreenNotifier3D 使用近似启发式,不考虑墙壁和其他遮挡,除非使用遮挡剔除。除非将 Node3D.visible 设置为 true
,否则它也不会起作用。
属性¶
|
方法¶
is_on_screen ( ) const |
信号¶
screen_entered ( )
当该 VisibleOnScreenNotifier3D 进入屏幕时发出。
screen_exited ( )
当该 VisibleOnScreenNotifier3D 退出屏幕时发出。
属性说明¶
AABB aabb = AABB(-1, -1, -1, 2, 2, 2)
该 VisibleOnScreenNotifier3D 的边界框。
方法说明¶
bool is_on_screen ( ) const
如果为 true
,则边界框在屏幕上。
注意:VisibleOnScreenNotifier3D 被添加到场景树后需要一帧来评估其可见性,因此该方法在实例化后将始终返回 false
。