MobileVRInterface
Phone stereo VR: lens parameters, assumed height and VRS.
MobileVRInterface is a simple built-in stereo path for a phone in a holder. Its registered name is Native mobile. It uses sensor-based rotation and fixed EyeHeight, without positional room tracking. This is neither OpenXR/ARCore nor automatic integration with any headset.
Initialize registers head and selects primary, but current code returns true without a phone too. Two views and a head pose do not establish physical sensors either. One component should own startup; avoid replacing another provider’s primary/head and restore UseXR. Full executed helper and diagnosis: phone VR. Do not Dispose the borrowed FindInterface result; new MobileVRInterface creates a separate object without automatic registration.
EyeHeight uses meters before WorldScale; Iod, DisplayWidth and DisplayToLens use centimeters. Oversample changes target size and frustum; K1/K2 control distortion. Parameters do not automatically discover holder geometry or load QR profiles.
Set WorldScale before startup. After the first GetCameraOffsets, the current cache does not refresh for a live WorldScale change; old ±0.03 offsets were reproduced after switching 1→2. A controlled stop/start rebuilt ±0.06. The engine limitation was not fixed. Do not edit returned cached arrays as configuration.
Windows headless/SDK 1.0.0 checks covered parameters, helper lifecycle, primary/head ownership, UseXR restoration and numerical eye calculations. Phone hardware, GetTrackingStatus initialization, lenses/stereo pixels, VRS output, on-device C# export, comfort and performance were not tested. For OpenXR devices use XR startup.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
MobileVRInterfaceConstructor
public MobileVRInterface();Creates a separate uninitialized object with default parameters. Does not add it to XRServer, connect a phone or enable Viewport.UseXR. Use FindInterface("Native mobile") for the built-in registered interface; do not start competing head owners.
Properties10
DisplayToLensProperty
public double DisplayToLens { get; set; }Display-to-lens distance in centimeters, initially 4.0. A divisor in frustum calculation: use a meaningful positive value. The setter stores it and clears projections on change; not automatic calibration.
DisplayWidthProperty
public double DisplayWidth { get; set; }Physical display width in centimeters, initially 14.5. Used in frustum and lens-distortion layout; not a pixel count or window width. A change clears projection cache. The setter does not measure the device.
EyeHeightProperty
public double EyeHeight { get; set; }Assumed head height in meters before WorldScale, initially 1.85. Not measured by positional sensors. Process writes this fixed Y into the head pose; gameplay movement/origin are separate.
IodProperty
public double Iod { get; set; }Interocular distance in centimeters, initially 6.0. Produces −0.03/+0.03 eye offsets at WorldScale=1. A changed value clears offsets and projections; repeating the same value does not reset caches. Do not supply meters.
K1Property
public double K1 { get; set; }First dimensionless lens-distortion coefficient, initially 0.215. Used with K2 during screen blit, not a gameplay-coordinate change. Match actual lenses; the interface loads no QR profile automatically.
K2Property
public double K2 { get; set; }Second dimensionless lens-distortion coefficient, initially 0.215. Works with K1; not AA strength or a quality preset. The setter stores the number without establishing suitable lens calibration.
OffsetRectProperty
public Rect2 OffsetRect { get; set; }Output region relative to the screen rect, initially Rect2(0,0,1,1) for its full area. Position and Size are scaled by screen-rect dimensions; not pixels or a tracking-origin offset. Does not make a SubViewport visible on screen by itself.
OversampleProperty
public double Oversample { get; set; }Rendering multiplier, initially 1.5. Per-eye target is half window width × multiplier and window height × multiplier; also affects frustum and distortion upscale. Not MSAA or guaranteed improvement. A change clears projection cache; choose a positive device-appropriate value.
VrsMinRadiusProperty
public float VrsMinRadius { get; set; }Minimum central full-density VRS region as a size percentage, initially 20. The setter clamps to 1–100 with an out-of-range warning. Requires an active XR VRS path; a stored value establishes neither map use nor image quality.
VrsStrengthProperty
public float VrsStrength { get; set; }VRS-map strength, initially 1. The setter clamps to 0.1–10 with an out-of-range warning. Larger values change the density/quality trade-off, not a promised FPS. Actual map output and performance were not tested here.
Methods20
GetDisplayToLensdouble
public double GetDisplayToLens();Returns stored DisplayToLens, not a physical-device measurement. Display-to-lens distance in centimeters, initially 4.0. A divisor in frustum calculation: use a meaningful positive value. The setter stores it and clears projections on change; not automatic calibration.
doubleStored DisplayToLens, not evidence of hardware or output quality.
GetDisplayWidthdouble
public double GetDisplayWidth();Returns stored DisplayWidth, not a physical-device measurement. Physical display width in centimeters, initially 14.5. Used in frustum and lens-distortion layout; not a pixel count or window width. A change clears projection cache. The setter does not measure the device.
doubleStored DisplayWidth, not evidence of hardware or output quality.
GetEyeHeightdouble
public double GetEyeHeight();Returns stored EyeHeight, not a physical-device measurement. Assumed head height in meters before WorldScale, initially 1.85. Not measured by positional sensors. Process writes this fixed Y into the head pose; gameplay movement/origin are separate.
doubleStored EyeHeight, not evidence of hardware or output quality.
GetIoddouble
public double GetIod();Returns stored Iod, not a physical-device measurement. Interocular distance in centimeters, initially 6.0. Produces −0.03/+0.03 eye offsets at WorldScale=1. A changed value clears offsets and projections; repeating the same value does not reset caches. Do not supply meters.
doubleStored Iod, not evidence of hardware or output quality.
GetK1double
public double GetK1();Returns stored K1, not a physical-device measurement. First dimensionless lens-distortion coefficient, initially 0.215. Used with K2 during screen blit, not a gameplay-coordinate change. Match actual lenses; the interface loads no QR profile automatically.
doubleStored K1, not evidence of hardware or output quality.
GetK2double
public double GetK2();Returns stored K2, not a physical-device measurement. Second dimensionless lens-distortion coefficient, initially 0.215. Works with K1; not AA strength or a quality preset. The setter stores the number without establishing suitable lens calibration.
doubleStored K2, not evidence of hardware or output quality.
GetOffsetRectRect2
public Rect2 GetOffsetRect();Returns stored OffsetRect, not a physical-device measurement. Output region relative to the screen rect, initially Rect2(0,0,1,1) for its full area. Position and Size are scaled by screen-rect dimensions; not pixels or a tracking-origin offset. Does not make a SubViewport visible on screen by itself.
Rect2Stored OffsetRect, not evidence of hardware or output quality.
GetOversampledouble
public double GetOversample();Returns stored Oversample, not a physical-device measurement. Rendering multiplier, initially 1.5. Per-eye target is half window width × multiplier and window height × multiplier; also affects frustum and distortion upscale. Not MSAA or guaranteed improvement. A change clears projection cache; choose a positive device-appropriate value.
doubleStored Oversample, not evidence of hardware or output quality.
GetVrsMinRadiusfloat
public float GetVrsMinRadius();Returns stored VrsMinRadius, not a physical-device measurement. Minimum central full-density VRS region as a size percentage, initially 20. The setter clamps to 1–100 with an out-of-range warning. Requires an active XR VRS path; a stored value establishes neither map use nor image quality.
floatStored VrsMinRadius, not evidence of hardware or output quality.
GetVrsStrengthfloat
public float GetVrsStrength();Returns stored VrsStrength, not a physical-device measurement. VRS-map strength, initially 1. The setter clamps to 0.1–10 with an out-of-range warning. Larger values change the density/quality trade-off, not a promised FPS. Actual map output and performance were not tested here.
floatStored VrsStrength, not evidence of hardware or output quality.
SetDisplayToLensvoid
public void SetDisplayToLens(double displayToLens);Configures this interface’s DisplayToLens; does not initialize it. Display-to-lens distance in centimeters, initially 4.0. A divisor in frustum calculation: use a meaningful positive value. The setter stores it and clears projections on change; not automatic calibration.
| Name | Type | Default |
|---|---|---|
displayToLens | double | — |
displayToLensDisplay-to-lens distance in centimeters, initially 4.0. A divisor in frustum calculation: use a meaningful positive value. The setter stores it and clears projections on change; not automatic calibration.
SetDisplayWidthvoid
public void SetDisplayWidth(double displayWidth);Configures this interface’s DisplayWidth; does not initialize it. Physical display width in centimeters, initially 14.5. Used in frustum and lens-distortion layout; not a pixel count or window width. A change clears projection cache. The setter does not measure the device.
| Name | Type | Default |
|---|---|---|
displayWidth | double | — |
displayWidthPhysical display width in centimeters, initially 14.5. Used in frustum and lens-distortion layout; not a pixel count or window width. A change clears projection cache. The setter does not measure the device.
SetEyeHeightvoid
public void SetEyeHeight(double eyeHeight);Configures this interface’s EyeHeight; does not initialize it. Assumed head height in meters before WorldScale, initially 1.85. Not measured by positional sensors. Process writes this fixed Y into the head pose; gameplay movement/origin are separate.
| Name | Type | Default |
|---|---|---|
eyeHeight | double | — |
eyeHeightAssumed head height in meters before WorldScale, initially 1.85. Not measured by positional sensors. Process writes this fixed Y into the head pose; gameplay movement/origin are separate.
SetIodvoid
public void SetIod(double iod);Configures this interface’s Iod; does not initialize it. Interocular distance in centimeters, initially 6.0. Produces −0.03/+0.03 eye offsets at WorldScale=1. A changed value clears offsets and projections; repeating the same value does not reset caches. Do not supply meters.
| Name | Type | Default |
|---|---|---|
iod | double | — |
iodInterocular distance in centimeters, initially 6.0. Produces −0.03/+0.03 eye offsets at WorldScale=1. A changed value clears offsets and projections; repeating the same value does not reset caches. Do not supply meters.
SetK1void
public void SetK1(double k);Configures this interface’s K1; does not initialize it. First dimensionless lens-distortion coefficient, initially 0.215. Used with K2 during screen blit, not a gameplay-coordinate change. Match actual lenses; the interface loads no QR profile automatically.
| Name | Type | Default |
|---|---|---|
k | double | — |
kFirst dimensionless lens-distortion coefficient, initially 0.215. Used with K2 during screen blit, not a gameplay-coordinate change. Match actual lenses; the interface loads no QR profile automatically.
SetK2void
public void SetK2(double k);Configures this interface’s K2; does not initialize it. Second dimensionless lens-distortion coefficient, initially 0.215. Works with K1; not AA strength or a quality preset. The setter stores the number without establishing suitable lens calibration.
| Name | Type | Default |
|---|---|---|
k | double | — |
kSecond dimensionless lens-distortion coefficient, initially 0.215. Works with K1; not AA strength or a quality preset. The setter stores the number without establishing suitable lens calibration.
SetOffsetRectvoid
public void SetOffsetRect(Rect2 offsetRect);Configures this interface’s OffsetRect; does not initialize it. Output region relative to the screen rect, initially Rect2(0,0,1,1) for its full area. Position and Size are scaled by screen-rect dimensions; not pixels or a tracking-origin offset. Does not make a SubViewport visible on screen by itself.
| Name | Type | Default |
|---|---|---|
offsetRect | Rect2 | — |
offsetRectOutput region relative to the screen rect, initially Rect2(0,0,1,1) for its full area. Position and Size are scaled by screen-rect dimensions; not pixels or a tracking-origin offset. Does not make a SubViewport visible on screen by itself.
SetOversamplevoid
public void SetOversample(double oversample);Configures this interface’s Oversample; does not initialize it. Rendering multiplier, initially 1.5. Per-eye target is half window width × multiplier and window height × multiplier; also affects frustum and distortion upscale. Not MSAA or guaranteed improvement. A change clears projection cache; choose a positive device-appropriate value.
| Name | Type | Default |
|---|---|---|
oversample | double | — |
oversampleRendering multiplier, initially 1.5. Per-eye target is half window width × multiplier and window height × multiplier; also affects frustum and distortion upscale. Not MSAA or guaranteed improvement. A change clears projection cache; choose a positive device-appropriate value.
SetVrsMinRadiusvoid
public void SetVrsMinRadius(float radius);Configures this interface’s VrsMinRadius; does not initialize it. Minimum central full-density VRS region as a size percentage, initially 20. The setter clamps to 1–100 with an out-of-range warning. Requires an active XR VRS path; a stored value establishes neither map use nor image quality.
| Name | Type | Default |
|---|---|---|
radius | float | — |
radiusMinimum central full-density VRS region as a size percentage, initially 20. The setter clamps to 1–100 with an out-of-range warning. Requires an active XR VRS path; a stored value establishes neither map use nor image quality.
SetVrsStrengthvoid
public void SetVrsStrength(float strength);Configures this interface’s VrsStrength; does not initialize it. VRS-map strength, initially 1. The setter clamps to 0.1–10 with an out-of-range warning. Larger values change the density/quality trade-off, not a promised FPS. Actual map output and performance were not tested here.
| Name | Type | Default |
|---|---|---|
strength | float | — |
strengthVRS-map strength, initially 1. The setter clamps to 0.1–10 with an out-of-range warning. Larger values change the density/quality trade-off, not a promised FPS. Actual map output and performance were not tested here.