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.

XRServer

Inherits: Object

Server for AR and VR features.

Description

The AR/VR server is the heart of our Advanced and Virtual Reality solution and handles all the processing.

Tutorials

Properties

XRInterface

primary_interface

Transform3D

world_origin

Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)

float

world_scale

1.0

Methods

void

add_interface ( XRInterface interface )

void

add_tracker ( XRPositionalTracker tracker )

void

center_on_hmd ( RotationMode rotation_mode, bool keep_height )

XRInterface

find_interface ( String name ) const

Transform3D

get_hmd_transform ( )

XRInterface

get_interface ( int idx ) const

int

get_interface_count ( ) const

Dictionary[]

get_interfaces ( ) const

Transform3D

get_reference_frame ( ) const

XRPositionalTracker

get_tracker ( StringName tracker_name ) const

Dictionary

get_trackers ( int tracker_types )

void

remove_interface ( XRInterface interface )

void

remove_tracker ( XRPositionalTracker tracker )


Signals

interface_added ( StringName interface_name )

Emitted when a new interface has been added.


interface_removed ( StringName interface_name )

Emitted when an interface is removed.


tracker_added ( StringName tracker_name, int type )

Emitted when a new tracker has been added. If you don't use a fixed number of controllers or if you're using XRAnchor3Ds for an AR solution, it is important to react to this signal to add the appropriate XRController3D or XRAnchor3D nodes related to this new tracker.


tracker_removed ( StringName tracker_name, int type )

Emitted when a tracker is removed. You should remove any XRController3D or XRAnchor3D points if applicable. This is not mandatory, the nodes simply become inactive and will be made active again when a new tracker becomes available (i.e. a new controller is switched on that takes the place of the previous one).


tracker_updated ( StringName tracker_name,