Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

XRInterface

Inherits: RefCounted < Object

Inherited By: MobileVRInterface, OpenXRInterface, WebXRInterface, XRInterfaceExtension

Base class for an XR interface implementation.

Description

This class needs to be implemented to make an AR or VR platform available to Godot and these should be implemented as C++ modules or GDExtension modules. Part of the interface is exposed to GDScript so you can detect, enable and configure an AR or VR platform.

Interfaces should be written in such a way that simply enabling them will give us a working setup. You can query the available interfaces through XRServer.

Tutorials

Properties

bool

ar_is_anchor_detection_enabled

false

EnvironmentBlendMode

environment_blend_mode

0

bool

interface_is_primary

false

PlayAreaMode

xr_play_area_mode

0

Methods

int

get_camera_feed_id ( )

int

get_capabilities ( ) const

StringName

get_name ( ) const

PackedVector3Array

get_play_area ( ) const

Projection

get_projection_for_view ( int view, float aspect, float near, float far )

Vector2