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.

MobileVRInterface

Hereda: XRInterface < RefCounted < Object

Implementación de la RealidadVirtual(VR) móvil genérica.

Descripción

Esta es una implementación genérica de realidad virtual móvil en la que necesitas proporcionar detalles sobre el teléfono y el HMD (dispositivo de visualización montado en la cabeza) utilizado. No se basa en ningún marco existente. Esta es la interfaz más básica que tenemos. Para obtener el mejor efecto, necesitas un teléfono móvil con giroscopio y acelerómetro.

Ten en cuenta que, aunque no hay seguimiento posicional, la cámara asumirá que el casco está a una altura de 1,85 metros. Puedes cambiar esto ajustando eye_height.

Se puede inicializar esta interfaz de la siguiente manera:

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

Nota: Para Android, deben estar habilitados ProjectSettings.input_devices/sensors/enable_accelerometer, ProjectSettings.input_devices/sensors/enable_gravity, ProjectSettings.input_devices/sensors/enable_gyroscope y ProjectSettings.input_devices/sensors/enable_magnetometer.

Propiedades

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

Rect2

offset_rect

Rect2(0, 0, 1, 1)

float

oversample

1.5

float

vrs_min_radius

20.0

float

vrs_strength

1.0

PlayAreaMode

xr_play_area_mode

1 (overrides XRInterface)


Descripciones de Propiedades

float display_to_lens = 4.0 🔗

  • void set_display_to_lens(value: float)

  • float get_display_to_lens()

La distancia entre la pantalla y las lentes dentro del dispositivo en centímetros.


float display_width = 14.5 🔗

  • void set_display_width(value: float)

  • float get_display_width()

El ancho de la pantalla en centímetros.


float eye_height = 1.85 🔗

  • void set_eye_height(value: float)

  • float get_eye_height()

The height at which the camera is placed in relation to the ground (i.e. XROrigin3D node).


float iod = 6.0 🔗

La distancia interocular, también conocida como distancia interpupilar. La distancia entre las pupilas del ojo izquierdo y del derecho.


float k1 = 0.215 🔗

El factor k1 de la lente es una de las dos constantes que definen la fuerza de la lente utilizada e influye directamente en el efecto de distorsión de la lente.


float k2 = 0.215 🔗

El factor de lente k2, ver k1.


Rect2 offset_rect = Rect2(0, 0, 1, 1) 🔗

  • void set_offset_rect(value: Rect2)

  • Rect2 get_offset_rect()

Set the offset rect relative to the area being rendered. A length of 1 represents the whole rendering area on that axis.


float oversample = 1.5 🔗

  • void set_oversample(value: float)

  • float get_oversample()

El ajuste de sobremuestreo. Debido a la distorsión de la lente, tenemos que renderizar nuestros búferes a una resolución más alta de la que la pantalla puede manejar nativamente. Un valor entre 1,5 y 2,0 a menudo proporciona buenos resultados pero a costa del rendimiento.


float vrs_min_radius = 20.0 🔗

  • void set_vrs_min_radius(value: float)

  • float get_vrs_min_radius()

The minimum radius around the focal point where full quality is guaranteed if VRS is used as a percentage of screen size.

Note: Mobile and Forward+ renderers only. Requires Viewport.vrs_mode to be set to Viewport.VRS_XR.


float vrs_strength = 1.0 🔗

  • void set_vrs_strength(value: float)

  • float get_vrs_strength()

The strength used to calculate the VRS density map. The greater this value, the more noticeable VRS is. This improves performance at the cost of quality.

Note: Mobile and Forward+ renderers only. Requires Viewport.vrs_mode to be set to Viewport.VRS_XR.