Package org.lwjgl.ovr

Class OVRLayerQuad

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

    public class OVRLayerQuad
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Describes a layer of Quad type, which is a single quad in world or viewer space. It is used for both LayerType_Quad. This type of layer represents a single object placed in the world and not a stereo view of the world itself.

    A typical use of LayerType_Quad is to draw a television screen in a room that for some reason is more convenient to draw as a layer than as part of the main view in layer 0. For example, it could implement a 3D popup GUI that is drawn at a higher resolution than layer 0 to improve fidelity of the GUI.

    Quad layers are visible from both sides; they are not back-face culled.

    Layout

    
     struct ovrLayerQuad {
         ovrLayerHeader Header();
         ovrTextureSwapChain ColorTexture();
         ovrRecti Viewport();
         ovrPosef QuadPoseCenter();
         ovrVector2f QuadSize();
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • HEADER, COLORTEXTURE, VIEWPORT, QUADPOSECENTER, QUADSIZE

        The struct member offsets.
    • Constructor Detail

      • OVRLayerQuad

        public OVRLayerQuad​(java.nio.ByteBuffer container)
        Creates a OVRLayerQuad 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 long ColorTexture()
        contains a single image, never with any stereo view
      • Viewport

        public OVRRecti Viewport()
        specifies the ColorTexture sub-rect UV coordinates
      • QuadPoseCenter

        public OVRPosef QuadPoseCenter()
        specifies the orientation and position of the center point of a Quad layer type.

        The supplied direction is the vector perpendicular to the quad. The position is in real-world meters (not the application's virtual world, the physical world the user is in) and is relative to the "zero" position set by RecenterTrackingOrigin unless the LayerFlag_HeadLocked flag is used.

      • QuadSize

        public OVRVector2f QuadSize()
        width and height (respectively) of the quad in meters
      • set

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

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

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

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

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

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

        public static OVRLayerQuad.Buffer malloc​(int capacity)
        Returns a new OVRLayerQuad.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static OVRLayerQuad.Buffer calloc​(int capacity)
        Returns a new OVRLayerQuad.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

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

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

        @Deprecated
        public static OVRLayerQuad mallocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

        @Deprecated
        public static OVRLayerQuad callocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
      • malloc

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

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

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

        public static OVRLayerQuad.Buffer calloc​(int capacity,
                                                 org.lwjgl.system.MemoryStack stack)
        Returns a new OVRLayerQuad.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 long nColorTexture​(long struct)
        Unsafe version of ColorTexture().
      • nViewport

        public static OVRRecti nViewport​(long struct)
        Unsafe version of Viewport().
      • nHeader

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

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

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

        public static void nQuadPoseCenter​(long struct,
                                           OVRPosef value)
        Unsafe version of QuadPoseCenter.
      • nQuadSize

        public static void nQuadSize​(long struct,
                                     OVRVector2f value)
        Unsafe version of QuadSize.
      • validate

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