【问题标题】:Getting VR playspace in Godot and tracked area bounds在 Godot 中获取 VR 游戏空间和跟踪区域边界
【发布时间】:2019-10-18 18:14:57
【问题描述】:

使用 ARVROrigin,您可以获得虚拟世界中游戏空间的中心,但我想知道玩家必须使用的中心周围有多少空间。为此,我想知道游戏空间的尺寸和它的方向(假设它是一个矩形......对于 Quest 不确定),以及跟踪区域外部边界的某种表示。这样我就可以根据玩家在物理环境中所处的位置来调整游戏体验。

我正在考虑利用跟踪区域在空间中动态放置墙壁,以创建一个无限可探索的建筑,有点像看不见的外交。

【问题讨论】:

    标签: godot


    【解决方案1】:

    使用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())
    

    取自https://github.com/GodotVR/godot_oculus_mobile

    【讨论】:

    • 这很有帮助,但仅适用于 oculus mobile。 Vive 和 Rift 有类似的方法吗?
    • @RobKohr 还没有在 godot 插件中,但是有一个未解决的问题要将该功能添加到插件 here OpenVR 中已经存在的方法。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-07
    • 2021-07-22
    • 2015-02-05
    • 1970-01-01
    相关资源
    最近更新 更多