Package org.lwjgl.ovr

Class OVRLayerQuad

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<OVRLayerQuad>
org.lwjgl.ovr.OVRLayerQuad
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class OVRLayerQuad extends org.lwjgl.system.Struct<OVRLayerQuad> 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 Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • COLORTEXTURE

      public static final int COLORTEXTURE
      The struct member offsets.
    • VIEWPORT

      public static final int VIEWPORT
      The struct member offsets.
    • QUADPOSECENTER

      public static final int QUADPOSECENTER
      The struct member offsets.
    • QUADSIZE

      public static final int QUADSIZE
      The struct member offsets.
  • Constructor Details

    • OVRLayerQuad

      public OVRLayerQuad(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 Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<OVRLayerQuad>
    • Header

      public OVRLayerHeader Header()
      Header.Type must be LayerType_Quad
    • 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
    • Header

      public OVRLayerQuad Header(OVRLayerHeader value)
      Copies the specified OVRLayerHeader to the Header() field.
    • Header

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

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

      public OVRLayerQuad Viewport(OVRRecti value)
      Copies the specified OVRRecti to the Viewport() field.
    • Viewport

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

      public OVRLayerQuad QuadPoseCenter(OVRPosef value)
      Copies the specified OVRPosef to the QuadPoseCenter() field.
    • QuadPoseCenter

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

      public OVRLayerQuad QuadSize(OVRVector2f value)
      Copies the specified OVRVector2f to the QuadSize() field.
    • QuadSize

      public OVRLayerQuad QuadSize(Consumer<OVRVector2f> consumer)
      Passes the QuadSize() field to the specified Consumer.
    • set

      public OVRLayerQuad set(OVRLayerHeader Header, long ColorTexture, OVRRecti Viewport, OVRPosef QuadPoseCenter, OVRVector2f QuadSize)
      Initializes this struct with the specified values.
    • 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

      public static @Nullable 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(int capacity)
      Returns a new OVRLayerQuad.Buffer instance allocated with BufferUtils.
      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

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

      @Deprecated public static OVRLayerQuad mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static OVRLayerQuad callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • 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.
    • mallocStack

      @Deprecated public static OVRLayerQuad.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static OVRLayerQuad.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

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

      @Deprecated public static OVRLayerQuad.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, 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:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • 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:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nHeader

      public static OVRLayerHeader nHeader(long struct)
      Unsafe version of Header().
    • nColorTexture

      public static long nColorTexture(long struct)
      Unsafe version of ColorTexture().
    • nViewport

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

      public static OVRPosef nQuadPoseCenter(long struct)
      Unsafe version of QuadPoseCenter().
    • nQuadSize

      public static OVRVector2f nQuadSize(long struct)
      Unsafe version of QuadSize().
    • 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