Class MobileVRInterface
- Namespace
- Godot
- Assembly
- GodotSharp.dll
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 EyeHeight.
You can initialize this interface as follows:
var interface = XRServer.find_interface("Native mobile")
if interface and interface.initialize():
get_viewport().xr = true
public class MobileVRInterface : XRInterface, IDisposable
- Inheritance
-
MobileVRInterface
- Implements
- Inherited Members
Constructors
MobileVRInterface()
public MobileVRInterface()
Properties
DisplayToLens
The distance between the display and the lenses inside of the device in centimeters.
public double DisplayToLens { get; set; }
Property Value
DisplayWidth
The width of the display in centimeters.
public double DisplayWidth { get; set; }
Property Value
EyeHeight
The height at which the camera is placed in relation to the ground (i.e. XROrigin3D node).
public double EyeHeight { get; set; }
Property Value
Iod
The interocular distance, also known as the interpupillary distance. The distance between the pupils of the left and right eye.
public double Iod { get; set; }
Property Value
K1
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.
public double K1 { get; set; }
Property Value
K2
The k2 lens factor, see k1.
public double K2 { get; set; }
Property Value
Oversample
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.
public double Oversample { get; set; }
Property Value
Methods
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.