MobileVRInterface

    Generic mobile VR implementation.

    MobileVRInterface.swift:16
    class MobileVRInterface

    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:

    Superclasses

    Citizens in SwiftGodot

    Conformances

    • protocol CustomStringConvertible

      A type with a customized textual representation.

    • protocol Equatable

      A type that can be compared for value equality.

    • protocol Hashable

      A type that can be hashed into a Hasher to produce an integer hash value.

    • protocol Identifiable<ID>

      A class of types whose instances hold the value of an entity with stable identity.

    • protocol VariantRepresentable

      Types that conform to VariantRepresentable can be stored directly in Variant with no conversion. These include all of the Variant types from Godot (for example GString, Rect, Plane), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.

    • protocol VariantStorable

      Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.

    Type members

    Instance members

    • var displayToLens: Double

      The distance between the display and the lenses inside of the device in centimeters.

    • var displayWidth: Double

      The width of the display in centimeters.

    • var eyeHeight: Double

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

    • var iod: Double

      The interocular distance, also known as the interpupillary distance. The distance between the pupils of the left and right eye.

    • var k1: Double

      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.

    • var k2: Double

      The k2 lens factor, see k1.

    • var oversample: Double

      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.