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...
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¶
|
||
|
Methods¶
void |
add_interface ( XRInterface interface ) |
void |
add_tracker ( XRPositionalTracker tracker ) |
void |
center_on_hmd ( RotationMode rotation_mode, bool keep_height ) |
find_interface ( String name ) const |
|
get_interface ( int idx ) const |
|
get_interface_count ( ) const |
|
get_interfaces ( ) const |
|
get_reference_frame ( ) const |
|
get_tracker ( StringName tracker_name ) const |
|
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, int type )
Emitted when an existing tracker has been updated. This can happen if the user switches controllers.
Enumerations¶
enum TrackerType:
TrackerType TRACKER_HEAD = 1
The tracker tracks the location of the players head. This is usually a location centered between the players eyes. Note that for handheld AR devices this can be the current location of the device.
TrackerType TRACKER_CONTROLLER = 2
The tracker tracks the location of a controller.
TrackerType TRACKER_BASESTATION = 4
The tracker tracks the location of a base station.
TrackerType TRACKER_ANCHOR = 8
The tracker tracks the location and size of an AR anchor.
TrackerType TRACKER_ANY_KNOWN = 127
Used internally to filter trackers of any known type.
TrackerType TRACKER_UNKNOWN = 128
Used internally if we haven't set the tracker type yet.