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...
VisionOSXRInterface
Hérite de : XRInterface < RefCounted < Object
visionOS XR implementation for rendering in immersive mode, hand tracking, and controller tracking.
Description
This is a visionOS XR implementation. It has three modules:
the CompositorServices module, to render with Godot in immersive mode
the hand tracking module, using Apple's ARKit
the spatial controller module, using Apple's ARKit and GCController.
Those modules can be enabled/disabled independently. The rendering module uses the CompositorServices framework to render an Immersive scene. It supports the full and mixed immersion modes. To use this module, you must set the EditorExportPlatformVisionOS.application/app_role export setting to Immersive. You can choose the immersion style using the EditorExportPlatformVisionOS.application/immersion_style export setting. You must use the Metal rendering driver, and only the Mobile renderer is supported for now. You can initialize this interface in the Node._ready() method of any of your nodes as follows:
func _ready() -> void:
var interface = XRServer.find_interface("visionOS")
if interface and interface.initialize():
var viewport : Viewport = get_viewport()
viewport.use_xr = true
viewport.vrs_mode = Viewport.VRS_XR
viewport.use_hdr_2d = true
Do not initialize the XR interface in the Node._process() method, as this will initialize it at some unspecified point in the middle of the frame rendering, possibly causing incorrect visionOS API usage.
Enable the hand tracking module with the ProjectSettings.xr/visionos/enable_hand_tracking project setting. It will populate the "/user/hand_tracker/left" and "/user/hand_tracker/right" XRHandTrackers.
Enable the spatial controller module using the ProjectSettings.xr/visionos/enable_controller_tracking project setting. It will populate the "left_hand" and "right_hand" reserved XRController trackers.
Propriétés
|
||
|
||
|
||
xr_play_area_mode |
|
Énumérations
enum ImmersionStyle: 🔗
ImmersionStyle IMMERSION_STYLE_FULL = 0
The rendered content replaces the passthrough view of the real environment.
ImmersionStyle IMMERSION_STYLE_MIXED = 1
The rendered content is displayed along with the passthrough view of the real environment.
ImmersionStyle IMMERSION_STYLE_PROGRESSIVE = 2
The rendered content is displayed in a portal whose immersion level the user controls with the Digital Crown.
enum Visibility: 🔗
Visibility VISIBILITY_AUTOMATIC = 0
The system decides whether the element is visible.
Visibility VISIBILITY_VISIBLE = 1
The element is visible.
The element is hidden.
Descriptions des propriétés
ImmersionStyle immersion_style = 0 🔗
void set_immersion_style(value: ImmersionStyle)
ImmersionStyle get_immersion_style()
Immersion style of the immersive scene. Its initial value comes from the EditorExportPlatformVisionOS.application/immersion_style export setting.
Visibility persistent_system_overlays = 0 🔗
void set_persistent_system_overlays(value: Visibility)
Visibility get_persistent_system_overlays()
Visibility of the system overlays, such as the Home indicator. Its initial value comes from the ProjectSettings.xr/visionos/persistent_system_overlays project setting. See persistentSystemOverlays(_:).
Visibility upper_limb_visibility = 0 🔗
void set_upper_limb_visibility(value: Visibility)
Visibility get_upper_limb_visibility()
Visibility of the user's upper limbs. Its initial value comes from the ProjectSettings.xr/visionos/upper_limb_visibility project setting. See upperLimbVisibility(_:).