godot - 在 Godot 中获取 VR 游戏空间和跟踪区域边界
问题描述
使用 ARVROrigin,您可以获得虚拟世界中游戏空间的中心,但我想知道玩家必须使用的中心周围有多少空间。为此,我想知道游戏空间的尺寸和它的方向(假设它是一个矩形......对于 Quest 不确定),以及跟踪区域外部边界的某种表示。这样我就可以根据玩家在物理环境中的位置来调整游戏体验。
我正在考虑利用跟踪区域在空间中动态放置墙壁,以创建一个无限可探索的建筑,有点像看不见的外交。
解决方案
使用该GodotVR
插件,您可以使用以下代码获取表示监护人边界的数组:
onready var ovrTrackingTransform = preload("res://addons/godot_ovrmobile/OvrTrackingTransform.gdns").new()
onready var ovrGuardianSystem = preload("res://addons/godot_ovrmobile/OvrGuardianSystem.gdns").new()
func _process(delta):
print("GetTrackingSpace: " , ovrTrackingTransform.get_tracking_space())
print("GetBoundaryVisible: ", ovrGuardianSystem.get_boundary_visible())
print("GetBoundaryOrientedBoundingBox: ", ovrGuardianSystem.get_boundary_oriented_bounding_box())
推荐阅读
- machine-learning - GridSearch 和 Keras 的不同指标:实际返回的是哪一个
- ios - Flutter:(iOS)电子邮件地址的文本表单字段自动大写名称
- powershell-3.0 - 如何在远程计算机上打开 exe
- linux - nginx 工作进程更好地为单个 cpu 提供 1 个或多个进程?
- python - 当我运行此代码时,我得到了无效的语法,并突出显示了 p_desc
- vb.net - 计算文件中某个名称之后的名称数量?
- php - 如何访问对象中的动态属性?
- python - 需要将列表中的十六进制值视为 int 以使用 bin() 进行计算。我错过了什么?
- ios - 有没有办法以编程方式从 ios 应用商店下载应用程序
- python - 稀疏输入的 KNeighborsClassifier 中使用的算法?