Package org.lwjgl.ovr

Class OVRLayerEyeFovDepth

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

    public class OVRLayerEyeFovDepth
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Describes a layer that specifies a monoscopic or stereoscopic view, with depth textures in addition to color textures. This is typically used to support positional time warp. This struct is the same as OVRLayerEyeFov, but with the addition of DepthTexture and ProjectionDesc.

    ProjectionDesc can be created using TimewarpProjectionDesc_FromProjection.

    Three options exist with respect to mono/stereo texture usage:

    • ColorTexture[0] and ColorTexture[1] contain the left and right stereo renderings, respectively. Viewport[0] and Viewport[1] refer to ColorTexture[0] and ColorTexture[1], respectively.
    • ColorTexture[0] contains both the left and right renderings, ColorTexture[1] is NULL, and Viewport[0] and Viewport[1] refer to sub-rects with ColorTexture[0].
    • ColorTexture[0] contains a single monoscopic rendering, and Viewport[0] and Viewport[1] both refer to that rendering.

    Member documentation

    • HeaderHeader.Type must be LayerType_EyeFovDepth
    • ColorTexture[ovrEye_Count]ovrTextureSwapChains for the left and right eye respectively. The second one of which can be NULL for cases described above.
    • 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 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.
    • DepthTexture[ovrEye_Count] – depth texture for depth composition with overlays. Must map 1:1 to the ColorTexture.
    • ProjectionDesc – specifies how to convert DepthTexture information into meters

    Layout

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

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

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

        The struct member offsets.
    • Constructor Detail

      • OVRLayerEyeFovDepth

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

        public org.lwjgl.PointerBuffer ColorTexture()
        Returns a PointerBuffer view of the ColorTexture field.
      • 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.
      • DepthTexture

        public org.lwjgl.PointerBuffer DepthTexture()
        Returns a PointerBuffer view of the DepthTexture field.
      • DepthTexture

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

        public OVRLayerEyeFovDepth ColorTexture​(org.lwjgl.PointerBuffer value)
        Copies the specified PointerBuffer to the ColorTexture field.
      • ColorTexture

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

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

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

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

        public OVRLayerEyeFovDepth SensorSampleTime​(double value)
        Sets the specified value to the SensorSampleTime field.
      • DepthTexture

        public OVRLayerEyeFovDepth DepthTexture​(org.lwjgl.PointerBuffer value)
        Copies the specified PointerBuffer to the DepthTexture field.
      • DepthTexture

        public OVRLayerEyeFovDepth DepthTexture​(int index,
                                                long value)
        Sets the specified value at the specified index of the DepthTexture field.
      • malloc

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

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

        public static OVRLayerEyeFovDepth create()
        Returns a new OVRLayerEyeFovDepth instance allocated with BufferUtils.
      • create

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

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

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

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

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

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

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

        public static OVRLayerEyeFovDepth.Buffer callocStack​(int capacity,
                                                             org.lwjgl.system.MemoryStack stack)
        Returns a new OVRLayerEyeFovDepth.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
      • nColorTexture

        public static org.lwjgl.PointerBuffer nColorTexture​(long struct)
        Unsafe version of ColorTexture().
      • 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().
      • nDepthTexture

        public static org.lwjgl.PointerBuffer nDepthTexture​(long struct)
        Unsafe version of DepthTexture().
      • nDepthTexture

        public static long nDepthTexture​(long struct,
                                         int index)
        Unsafe version of DepthTexture.
      • nHeader

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

        public static void nColorTexture​(long struct,
                                         org.lwjgl.PointerBuffer value)
        Unsafe version of ColorTexture.
      • 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.
      • nDepthTexture

        public static void nDepthTexture​(long struct,
                                         org.lwjgl.PointerBuffer value)
        Unsafe version of DepthTexture.
      • nDepthTexture

        public static void nDepthTexture​(long struct,
                                         int index,
                                         long value)
        Unsafe version of DepthTexture.
      • 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