Package org.lwjgl.ovr

Class OVRViewScaleDesc

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer


    public class OVRViewScaleDesc
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Contains the data necessary to properly calculate position info for various layer types.
    • HmdToEyePose is the same value-pair provided in OVREyeRenderDesc. Modifying this value is suggested only if the app is forcing monoscopic rendering and requires that all layers including quad layers show up in a monoscopic fashion.
    • HmdSpaceToWorldScaleInMeters is used to scale player motion into in-application units.

    In other words, it is how big an in-application unit is in the player's physical meters. For example, if the application uses inches as its units then HmdSpaceToWorldScaleInMeters would be 0.0254. Note that if you are scaling the player in size, this must also scale. So if your application units are inches, but you're shrinking the player to half their normal size, then HmdSpaceToWorldScaleInMeters would be 0.0254*2.0.

    Member documentation

    • HmdToEyePose – transform of each eye from the HMD center, in meters
    • HmdSpaceToWorldScaleInMeters – ratio of viewer units to meter units

    Layout

     struct ovrViewScaleDesc {
         ovrPosef HmdToEyePose[ovrEye_Count];
         float HmdSpaceToWorldScaleInMeters;
     }
    • Field Detail

      • SIZEOF

        public static final int SIZEOF
        The struct size in bytes.
    • Constructor Detail

      • OVRViewScaleDesc

        public OVRViewScaleDesc(java.nio.ByteBuffer container)
        Creates a OVRViewScaleDesc instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • HmdToEyePose

        public OVRPosef HmdToEyePose(int index)
        Returns a OVRPosef view of the struct at the specified index of the HmdToEyePose field.
      • HmdSpaceToWorldScaleInMeters

        public float HmdSpaceToWorldScaleInMeters()
        Returns the value of the HmdSpaceToWorldScaleInMeters field.
      • HmdToEyePose

        public OVRViewScaleDesc HmdToEyePose(int index,
                                             OVRPosef value)
        Copies the specified OVRPosef at the specified index of the HmdToEyePose field.
      • HmdSpaceToWorldScaleInMeters

        public OVRViewScaleDesc HmdSpaceToWorldScaleInMeters(float value)
        Sets the specified value to the HmdSpaceToWorldScaleInMeters field.
      • set

        public OVRViewScaleDesc set(OVRViewScaleDesc src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • createSafe

        @Nullable
        public static OVRViewScaleDesc createSafe(long address)
        Like create, but returns null if address is NULL.
      • createSafe

        @Nullable
        public static OVRViewScaleDesc.Buffer createSafe(long address,
                                                         int capacity)
        Like create, but returns null if address is NULL.
      • callocStack

        public static OVRViewScaleDesc callocStack()
        Returns a new OVRViewScaleDesc instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static OVRViewScaleDesc mallocStack(org.lwjgl.system.MemoryStack stack)
        Returns a new OVRViewScaleDesc instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static OVRViewScaleDesc callocStack(org.lwjgl.system.MemoryStack stack)
        Returns a new OVRViewScaleDesc instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static OVRViewScaleDesc.Buffer callocStack(int capacity)
        Returns a new OVRViewScaleDesc.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

        public static OVRViewScaleDesc.Buffer mallocStack(int capacity,
                                                          org.lwjgl.system.MemoryStack stack)
        Returns a new OVRViewScaleDesc.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static OVRViewScaleDesc.Buffer callocStack(int capacity,
                                                          org.lwjgl.system.MemoryStack stack)
        Returns a new OVRViewScaleDesc.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity