Up to date

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

MobileVRInterface

Inherits: XRInterface < RefCounted < Object

Generic mobile VR implementation.

Description

This is a generic mobile VR implementation where you need to provide details about the phone and HMD used. It does not rely on any existing framework. This is the most basic interface we have. For the best effect, you need a mobile phone with a gyroscope and accelerometer.

Note that even though there is no positional tracking, the camera will assume the headset is at a height of 1.85 meters. You can change this by setting eye_height.

You can initialize this interface as follows:

var interface = XRServer.find_interface("Native mobile")
if interface and interface.initialize():
    get_viewport().xr = true

Properties

float

display_to_lens

4.0

float

display_width

14.5

float

eye_height

1.85

float

iod

6.0

float

k1

0.215

float

k2

0.215

float

oversample

1.5

PlayAreaMode

xr_play_area_mode

1 (overrides XRInterface)


Property Descriptions

float display_to_lens = 4.0

  • void set_display_to_lens ( float value )

  • float get_display_to_lens ( )

The distance bet