Path: blob/master/modules/mobile_vr/doc_classes/MobileVRInterface.xml
10278 views
<?xml version="1.0" encoding="UTF-8" ?>1<class name="MobileVRInterface" inherits="XRInterface" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">2<brief_description>3Generic mobile VR implementation.4</brief_description>5<description>6This 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.7Note 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 [member eye_height].8You can initialize this interface as follows:9[codeblock]10var interface = XRServer.find_interface("Native mobile")11if interface and interface.initialize():12get_viewport().use_xr = true13[/codeblock]14[b]Note:[/b] For Android, [member ProjectSettings.input_devices/sensors/enable_accelerometer], [member ProjectSettings.input_devices/sensors/enable_gravity], [member ProjectSettings.input_devices/sensors/enable_gyroscope] and [member ProjectSettings.input_devices/sensors/enable_magnetometer] must be enabled.15</description>16<tutorials>17</tutorials>18<members>19<member name="display_to_lens" type="float" setter="set_display_to_lens" getter="get_display_to_lens" default="4.0">20The distance between the display and the lenses inside of the device in centimeters.21</member>22<member name="display_width" type="float" setter="set_display_width" getter="get_display_width" default="14.5">23The width of the display in centimeters.24</member>25<member name="eye_height" type="float" setter="set_eye_height" getter="get_eye_height" default="1.85">26The height at which the camera is placed in relation to the ground (i.e. [XROrigin3D] node).27</member>28<member name="iod" type="float" setter="set_iod" getter="get_iod" default="6.0">29The interocular distance, also known as the interpupillary distance. The distance between the pupils of the left and right eye.30</member>31<member name="k1" type="float" setter="set_k1" getter="get_k1" default="0.215">32The k1 lens factor is one of the two constants that define the strength of the lens used and directly influences the lens distortion effect.33</member>34<member name="k2" type="float" setter="set_k2" getter="get_k2" default="0.215">35The k2 lens factor, see k1.36</member>37<member name="offset_rect" type="Rect2" setter="set_offset_rect" getter="get_offset_rect" default="Rect2(0, 0, 1, 1)">38Set the offset rect relative to the area being rendered. A length of 1 represents the whole rendering area on that axis.39</member>40<member name="oversample" type="float" setter="set_oversample" getter="get_oversample" default="1.5">41The 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.42</member>43<member name="vrs_min_radius" type="float" setter="set_vrs_min_radius" getter="get_vrs_min_radius" default="20.0">44The minimum radius around the focal point where full quality is guaranteed if VRS is used as a percentage of screen size.45[b]Note:[/b] Mobile and Forward+ renderers only. Requires [member Viewport.vrs_mode] to be set to [constant Viewport.VRS_XR].46</member>47<member name="vrs_strength" type="float" setter="set_vrs_strength" getter="get_vrs_strength" default="1.0">48The 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.49[b]Note:[/b] Mobile and Forward+ renderers only. Requires [member Viewport.vrs_mode] to be set to [constant Viewport.VRS_XR].50</member>51<member name="xr_play_area_mode" type="int" setter="set_play_area_mode" getter="get_play_area_mode" overrides="XRInterface" enum="XRInterface.PlayAreaMode" default="1" />52</members>53</class>545556