Package org.lwjgl.ovr

Class OVRLayerQuad

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

    public class OVRLayerQuad
    extends Struct
    implements 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.

    Member documentation

    • HeaderHeader.Type must be LayerType_Quad
    • ColorTexture – contains a single image, never with any stereo view
    • Viewport – specifies the ColorTexture sub-rect UV coordinates
    • 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 – width and height (respectively) of the quad in meters

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

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

        public long ColorTexture()
        Returns the value of the ColorTexture field.
      • Viewport

        public OVRRecti Viewport()
        Returns a OVRRecti view of the Viewport field.
      • Viewport

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

        public OVRPosef QuadPoseCenter()
        Returns a OVRPosef view of the QuadPoseCenter field.
      • QuadPoseCenter

        public OVRLayerQuad QuadPoseCenter​(java.util.function.Consumer<OVRPosef> consumer)
        Passes the QuadPoseCenter field to the specified Consumer.
      • QuadSize

        public OVRLayerQuad QuadSize​(java.util.function.Consumer<OVRVector2f> consumer)
        Passes the QuadSize field to the specified Consumer.
      • ColorTexture

        public OVRLayerQuad ColorTexture​(long value)
        Sets the specified value to the ColorTexture field.
      • set

        public OVRLayerQuad set​(OVRLayerQuad src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • 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.
      • 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.
      • callocStack

        public static OVRLayerQuad callocStack​(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
      • callocStack

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

        public static OVRLayerQuad.Buffer callocStack​(int capacity,
                                                      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
      • 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