class_mobilevrinterface.rst 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/modules/mobile_vr/doc_classes/MobileVRInterface.xml.
  6. .. _class_MobileVRInterface:
  7. MobileVRInterface
  8. =================
  9. **Inherits:** :ref:`XRInterface<class_XRInterface>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Generic mobile VR implementation.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. 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.
  15. 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 :ref:`eye_height<class_MobileVRInterface_property_eye_height>`.
  16. You can initialize this interface as follows:
  17. ::
  18. var interface = XRServer.find_interface("Native mobile")
  19. if interface and interface.initialize():
  20. get_viewport().use_xr = true
  21. \ **Note:** For Android, :ref:`ProjectSettings.input_devices/sensors/enable_accelerometer<class_ProjectSettings_property_input_devices/sensors/enable_accelerometer>`, :ref:`ProjectSettings.input_devices/sensors/enable_gravity<class_ProjectSettings_property_input_devices/sensors/enable_gravity>`, :ref:`ProjectSettings.input_devices/sensors/enable_gyroscope<class_ProjectSettings_property_input_devices/sensors/enable_gyroscope>` and :ref:`ProjectSettings.input_devices/sensors/enable_magnetometer<class_ProjectSettings_property_input_devices/sensors/enable_magnetometer>` must be enabled.
  22. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +----------------------------------------------------+--------------------------------------------------------------------------+------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`display_to_lens<class_MobileVRInterface_property_display_to_lens>` | ``4.0`` |
  29. +----------------------------------------------------+--------------------------------------------------------------------------+------------------------------------------------------------------------------------+
  30. | :ref:`float<class_float>` | :ref:`display_width<class_MobileVRInterface_property_display_width>` | ``14.5`` |
  31. +----------------------------------------------------+--------------------------------------------------------------------------+------------------------------------------------------------------------------------+
  32. | :ref:`float<class_float>` | :ref:`eye_height<class_MobileVRInterface_property_eye_height>` | ``1.85`` |
  33. +----------------------------------------------------+--------------------------------------------------------------------------+------------------------------------------------------------------------------------+
  34. | :ref:`float<class_float>` | :ref:`iod<class_MobileVRInterface_property_iod>` | ``6.0`` |
  35. +----------------------------------------------------+--------------------------------------------------------------------------+------------------------------------------------------------------------------------+
  36. | :ref:`float<class_float>` | :ref:`k1<class_MobileVRInterface_property_k1>` | ``0.215`` |
  37. +----------------------------------------------------+--------------------------------------------------------------------------+------------------------------------------------------------------------------------+
  38. | :ref:`float<class_float>` | :ref:`k2<class_MobileVRInterface_property_k2>` | ``0.215`` |
  39. +----------------------------------------------------+--------------------------------------------------------------------------+------------------------------------------------------------------------------------+
  40. | :ref:`Rect2<class_Rect2>` | :ref:`offset_rect<class_MobileVRInterface_property_offset_rect>` | ``Rect2(0, 0, 1, 1)`` |
  41. +----------------------------------------------------+--------------------------------------------------------------------------+------------------------------------------------------------------------------------+
  42. | :ref:`float<class_float>` | :ref:`oversample<class_MobileVRInterface_property_oversample>` | ``1.5`` |
  43. +----------------------------------------------------+--------------------------------------------------------------------------+------------------------------------------------------------------------------------+
  44. | :ref:`float<class_float>` | :ref:`vrs_min_radius<class_MobileVRInterface_property_vrs_min_radius>` | ``20.0`` |
  45. +----------------------------------------------------+--------------------------------------------------------------------------+------------------------------------------------------------------------------------+
  46. | :ref:`float<class_float>` | :ref:`vrs_strength<class_MobileVRInterface_property_vrs_strength>` | ``1.0`` |
  47. +----------------------------------------------------+--------------------------------------------------------------------------+------------------------------------------------------------------------------------+
  48. | :ref:`PlayAreaMode<enum_XRInterface_PlayAreaMode>` | xr_play_area_mode | ``1`` (overrides :ref:`XRInterface<class_XRInterface_property_xr_play_area_mode>`) |
  49. +----------------------------------------------------+--------------------------------------------------------------------------+------------------------------------------------------------------------------------+
  50. .. rst-class:: classref-section-separator
  51. ----
  52. .. rst-class:: classref-descriptions-group
  53. Property Descriptions
  54. ---------------------
  55. .. _class_MobileVRInterface_property_display_to_lens:
  56. .. rst-class:: classref-property
  57. :ref:`float<class_float>` **display_to_lens** = ``4.0`` :ref:`🔗<class_MobileVRInterface_property_display_to_lens>`
  58. .. rst-class:: classref-property-setget
  59. - |void| **set_display_to_lens**\ (\ value\: :ref:`float<class_float>`\ )
  60. - :ref:`float<class_float>` **get_display_to_lens**\ (\ )
  61. The distance between the display and the lenses inside of the device in centimeters.
  62. .. rst-class:: classref-item-separator
  63. ----
  64. .. _class_MobileVRInterface_property_display_width:
  65. .. rst-class:: classref-property
  66. :ref:`float<class_float>` **display_width** = ``14.5`` :ref:`🔗<class_MobileVRInterface_property_display_width>`
  67. .. rst-class:: classref-property-setget
  68. - |void| **set_display_width**\ (\ value\: :ref:`float<class_float>`\ )
  69. - :ref:`float<class_float>` **get_display_width**\ (\ )
  70. The width of the display in centimeters.
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_MobileVRInterface_property_eye_height:
  74. .. rst-class:: classref-property
  75. :ref:`float<class_float>` **eye_height** = ``1.85`` :ref:`🔗<class_MobileVRInterface_property_eye_height>`
  76. .. rst-class:: classref-property-setget
  77. - |void| **set_eye_height**\ (\ value\: :ref:`float<class_float>`\ )
  78. - :ref:`float<class_float>` **get_eye_height**\ (\ )
  79. The height at which the camera is placed in relation to the ground (i.e. :ref:`XROrigin3D<class_XROrigin3D>` node).
  80. .. rst-class:: classref-item-separator
  81. ----
  82. .. _class_MobileVRInterface_property_iod:
  83. .. rst-class:: classref-property
  84. :ref:`float<class_float>` **iod** = ``6.0`` :ref:`🔗<class_MobileVRInterface_property_iod>`
  85. .. rst-class:: classref-property-setget
  86. - |void| **set_iod**\ (\ value\: :ref:`float<class_float>`\ )
  87. - :ref:`float<class_float>` **get_iod**\ (\ )
  88. The interocular distance, also known as the interpupillary distance. The distance between the pupils of the left and right eye.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_MobileVRInterface_property_k1:
  92. .. rst-class:: classref-property
  93. :ref:`float<class_float>` **k1** = ``0.215`` :ref:`🔗<class_MobileVRInterface_property_k1>`
  94. .. rst-class:: classref-property-setget
  95. - |void| **set_k1**\ (\ value\: :ref:`float<class_float>`\ )
  96. - :ref:`float<class_float>` **get_k1**\ (\ )
  97. The k1 lens factor is one of the two constants that define the strength of the lens used and directly influences the lens distortion effect.
  98. .. rst-class:: classref-item-separator
  99. ----
  100. .. _class_MobileVRInterface_property_k2:
  101. .. rst-class:: classref-property
  102. :ref:`float<class_float>` **k2** = ``0.215`` :ref:`🔗<class_MobileVRInterface_property_k2>`
  103. .. rst-class:: classref-property-setget
  104. - |void| **set_k2**\ (\ value\: :ref:`float<class_float>`\ )
  105. - :ref:`float<class_float>` **get_k2**\ (\ )
  106. The k2 lens factor, see k1.
  107. .. rst-class:: classref-item-separator
  108. ----
  109. .. _class_MobileVRInterface_property_offset_rect:
  110. .. rst-class:: classref-property
  111. :ref:`Rect2<class_Rect2>` **offset_rect** = ``Rect2(0, 0, 1, 1)`` :ref:`🔗<class_MobileVRInterface_property_offset_rect>`
  112. .. rst-class:: classref-property-setget
  113. - |void| **set_offset_rect**\ (\ value\: :ref:`Rect2<class_Rect2>`\ )
  114. - :ref:`Rect2<class_Rect2>` **get_offset_rect**\ (\ )
  115. Set the offset rect relative to the area being rendered. A length of 1 represents the whole rendering area on that axis.
  116. .. rst-class:: classref-item-separator
  117. ----
  118. .. _class_MobileVRInterface_property_oversample:
  119. .. rst-class:: classref-property
  120. :ref:`float<class_float>` **oversample** = ``1.5`` :ref:`🔗<class_MobileVRInterface_property_oversample>`
  121. .. rst-class:: classref-property-setget
  122. - |void| **set_oversample**\ (\ value\: :ref:`float<class_float>`\ )
  123. - :ref:`float<class_float>` **get_oversample**\ (\ )
  124. The oversample setting. Because of the lens distortion we have to render our buffers at a higher resolution then the screen can natively handle. A value between 1.5 and 2.0 often provides good results but at the cost of performance.
  125. .. rst-class:: classref-item-separator
  126. ----
  127. .. _class_MobileVRInterface_property_vrs_min_radius:
  128. .. rst-class:: classref-property
  129. :ref:`float<class_float>` **vrs_min_radius** = ``20.0`` :ref:`🔗<class_MobileVRInterface_property_vrs_min_radius>`
  130. .. rst-class:: classref-property-setget
  131. - |void| **set_vrs_min_radius**\ (\ value\: :ref:`float<class_float>`\ )
  132. - :ref:`float<class_float>` **get_vrs_min_radius**\ (\ )
  133. The minimum radius around the focal point where full quality is guaranteed if VRS is used as a percentage of screen size.
  134. \ **Note:** Mobile and Forward+ renderers only. Requires :ref:`Viewport.vrs_mode<class_Viewport_property_vrs_mode>` to be set to :ref:`Viewport.VRS_XR<class_Viewport_constant_VRS_XR>`.
  135. .. rst-class:: classref-item-separator
  136. ----
  137. .. _class_MobileVRInterface_property_vrs_strength:
  138. .. rst-class:: classref-property
  139. :ref:`float<class_float>` **vrs_strength** = ``1.0`` :ref:`🔗<class_MobileVRInterface_property_vrs_strength>`
  140. .. rst-class:: classref-property-setget
  141. - |void| **set_vrs_strength**\ (\ value\: :ref:`float<class_float>`\ )
  142. - :ref:`float<class_float>` **get_vrs_strength**\ (\ )
  143. 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.
  144. \ **Note:** Mobile and Forward+ renderers only. Requires :ref:`Viewport.vrs_mode<class_Viewport_property_vrs_mode>` to be set to :ref:`Viewport.VRS_XR<class_Viewport_constant_VRS_XR>`.
  145. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  146. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  147. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  148. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  149. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  150. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  151. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  152. .. |void| replace:: :abbr:`void (No return value.)`