Package org.lwjgl.ovr

Class OVRLayerEyeFov

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

    public class OVRLayerEyeFov
    extends Struct
    implements NativeResource
    Describes a layer that specifies a monoscopic or stereoscopic view. This is the kind of layer that's typically used as layer 0 to SubmitFrame, as it is the kind of layer used to render a 3D stereoscopic view.

    Member documentation

    • HeaderHeader.Type must be LayerType_EyeFov
    • ColorTexture[ovrEye_Count]ovrTextureSwapChains for the left and right eye respectively. The second one of which can be NULL.
    • Viewport[ovrEye_Count] – specifies the ColorTexture sub-rect UV coordinates. Both Viewport[0] and Viewport[1] must be valid.
    • Fov[ovrEye_Count] – the viewport field of view
    • RenderPose[ovrEye_Count] – specifies the position and orientation of each eye view, with the position specified in meters. RenderPose will typically be the value returned from _CalcEyePoses, but can be different in special cases if a different head pose is used for rendering.
    • SensorSampleTime – specifies the timestamp when the source OVRPosef (used in calculating RenderPose) was sampled from the SDK. Typically retrieved by calling GetTimeInSeconds around the instant the application calls GetTrackingState. The main purpose for this is to accurately track app tracking latency.

    Layout

    
     struct ovrLayerEyeFov {
         ovrLayerHeader Header;
         ovrTextureSwapChain ColorTexture[ovrEye_Count];
         ovrRecti Viewport[ovrEye_Count];
         ovrFovPort Fov[ovrEye_Count];
         ovrPosef RenderPose[ovrEye_Count];
         double SensorSampleTime;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • HEADER, COLORTEXTURE, VIEWPORT, FOV, RENDERPOSE, SENSORSAMPLETIME

        The struct member offsets.
    • Constructor Detail

      • OVRLayerEyeFov

        public OVRLayerEyeFov​(java.nio.ByteBuffer container)
        Creates a OVRLayerEyeFov 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
      • ColorTexture

        public long ColorTexture​(int index)
        Returns the value at the specified index of the ColorTexture field.
      • Viewport

        public OVRRecti Viewport​(int index)
        Returns a OVRRecti view of the struct at the specified index of the Viewport field.
      • Fov

        public OVRFovPort Fov​(int index)
        Returns a OVRFovPort view of the struct at the specified index of the Fov field.
      • RenderPose

        public OVRPosef RenderPose​(int index)
        Returns a OVRPosef view of the struct at the specified index of the RenderPose field.
      • SensorSampleTime

        public double SensorSampleTime()
        Returns the value of the SensorSampleTime field.
      • Header

        public OVRLayerEyeFov Header​(java.util.function.Consumer<OVRLayerHeader> consumer)
        Passes the Header field to the specified Consumer.
      • ColorTexture

        public OVRLayerEyeFov ColorTexture​(int index,
                                           long value)
        Sets the specified value at the specified index of the ColorTexture field.
      • Viewport

        public OVRLayerEyeFov Viewport​(int index,
                                       OVRRecti value)
        Copies the specified OVRRecti at the specified index of the Viewport field.
      • Viewport

        public OVRLayerEyeFov Viewport​(java.util.function.Consumer<OVRRecti.Buffer> consumer)
        Passes the Viewport field to the specified Consumer.
      • Viewport

        public OVRLayerEyeFov Viewport​(int index,
                                       java.util.function.Consumer<OVRRecti> consumer)
        Passes the element at index of the Viewport field to the specified Consumer.
      • Fov

        public OVRLayerEyeFov Fov​(int index,
                                  java.util.function.Consumer<OVRFovPort> consumer)
        Passes the element at index of the Fov field to the specified Consumer.
      • RenderPose

        public OVRLayerEyeFov RenderPose​(int index,
                                         OVRPosef value)
        Copies the specified OVRPosef at the specified index of the RenderPose field.
      • RenderPose

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

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

        public OVRLayerEyeFov SensorSampleTime​(double value)
        Sets the specified value to the SensorSampleTime field.
      • set

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

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

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

        public static OVRLayerEyeFov create​(long address)
        Returns a new OVRLayerEyeFov instance for the specified memory address.
      • createSafe

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

        public static OVRLayerEyeFov.Buffer create​(long address,
                                                   int capacity)
        Create a OVRLayerEyeFov.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

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

        public static OVRLayerEyeFov mallocStack()
        Returns a new OVRLayerEyeFov instance allocated on the thread-local MemoryStack.
      • callocStack

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

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

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

        public static long nColorTexture​(long struct,
                                         int index)
        Unsafe version of ColorTexture.
      • nViewport

        public static OVRRecti nViewport​(long struct,
                                         int index)
        Unsafe version of Viewport.
      • nFov

        public static OVRFovPort nFov​(long struct,
                                      int index)
        Unsafe version of Fov.
      • nRenderPose

        public static OVRPosef nRenderPose​(long struct,
                                           int index)
        Unsafe version of RenderPose.
      • nSensorSampleTime

        public static double nSensorSampleTime​(long struct)
        Unsafe version of SensorSampleTime().
      • nHeader

        public static void nHeader​(long struct,
                                   OVRLayerHeader value)
        Unsafe version of Header.
      • nColorTexture

        public static void nColorTexture​(long struct,
                                         int index,
                                         long value)
        Unsafe version of ColorTexture.
      • nViewport

        public static void nViewport​(long struct,
                                     int index,
                                     OVRRecti value)
        Unsafe version of Viewport.
      • nFov

        public static void nFov​(long struct,
                                int index,
                                OVRFovPort value)
        Unsafe version of Fov.
      • nRenderPose

        public static void nRenderPose​(long struct,
                                       int index,
                                       OVRPosef value)
        Unsafe version of RenderPose.
      • nSensorSampleTime

        public static void nSensorSampleTime​(long struct,
                                             double value)
        Unsafe version of SensorSampleTime.
      • validate

        public static void validate​(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate
      • validate

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array