Package org.lwjgl.ovr

Class OVRViewScaleDesc

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

    public class OVRViewScaleDesc
    extends Struct
    implements 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[ovrEye_Count] – 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

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • HMDTOEYEPOSE, HMDSPACETOWORLDSCALEINMETERS

        The struct member offsets.
    • 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()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class 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.
      • HmdToEyePose

        public OVRViewScaleDesc HmdToEyePose​(java.util.function.Consumer<OVRPosef.Buffer> consumer)
        Passes the HmdToEyePose field to the specified Consumer.
      • HmdToEyePose

        public OVRViewScaleDesc HmdToEyePose​(int index,
                                             java.util.function.Consumer<OVRPosef> consumer)
        Passes the element at index of the HmdToEyePose field to the specified Consumer.
      • HmdSpaceToWorldScaleInMeters

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

        public OVRViewScaleDesc set​(OVRPosef.Buffer HmdToEyePose,
                                    float HmdSpaceToWorldScaleInMeters)
        Initializes this struct with the specified values.
      • set

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

        public static OVRViewScaleDesc malloc()
        Returns a new OVRViewScaleDesc instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static OVRViewScaleDesc calloc()
        Returns a new OVRViewScaleDesc instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static OVRViewScaleDesc create​(long address)
        Returns a new OVRViewScaleDesc instance for the specified memory address.
      • 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.
      • mallocStack

        public static OVRViewScaleDesc mallocStack()
        Returns a new OVRViewScaleDesc instance allocated on the thread-local MemoryStack.
      • 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​(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​(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
      • nHmdToEyePose

        public static OVRPosef nHmdToEyePose​(long struct,
                                             int index)
        Unsafe version of HmdToEyePose.
      • nHmdSpaceToWorldScaleInMeters

        public static float nHmdSpaceToWorldScaleInMeters​(long struct)
      • nHmdToEyePose

        public static void nHmdToEyePose​(long struct,
                                         int index,
                                         OVRPosef value)
        Unsafe version of HmdToEyePose.
      • nHmdSpaceToWorldScaleInMeters

        public static void nHmdSpaceToWorldScaleInMeters​(long struct,
                                                         float value)
        Unsafe version of HmdSpaceToWorldScaleInMeters.