Package org.lwjgl.ovr
Class OVRLayerQuad
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.ovr.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 bothLayerType_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
Header
–Header.Type
must beLayerType_Quad
ColorTexture
– contains a single image, never with any stereo viewViewport
– specifies the ColorTexture sub-rect UV coordinatesQuadPoseCenter
– 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 theLayerFlag_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; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OVRLayerQuad.Buffer
An array ofOVRLayerQuad
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
COLORTEXTURE
HEADER
QUADPOSECENTER
QUADSIZEThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
VIEWPORT
The struct member offsets.
-
Constructor Summary
Constructors Constructor Description OVRLayerQuad(java.nio.ByteBuffer container)
Creates aOVRLayerQuad
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OVRLayerQuad
calloc()
Returns a newOVRLayerQuad
instance allocated withmemCalloc
.static OVRLayerQuad.Buffer
calloc(int capacity)
Returns a newOVRLayerQuad.Buffer
instance allocated withmemCalloc
.static OVRLayerQuad
callocStack()
Returns a newOVRLayerQuad
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRLayerQuad.Buffer
callocStack(int capacity)
Returns a newOVRLayerQuad.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRLayerQuad.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerQuad.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRLayerQuad
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerQuad
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.long
ColorTexture()
Returns the value of theColorTexture
field.OVRLayerQuad
ColorTexture(long value)
Sets the specified value to theColorTexture
field.static OVRLayerQuad
create()
Returns a newOVRLayerQuad
instance allocated withBufferUtils
.static OVRLayerQuad.Buffer
create(int capacity)
Returns a newOVRLayerQuad.Buffer
instance allocated withBufferUtils
.static OVRLayerQuad
create(long address)
Returns a newOVRLayerQuad
instance for the specified memory address.static OVRLayerQuad.Buffer
create(long address, int capacity)
Create aOVRLayerQuad.Buffer
instance at the specified memory.static OVRLayerQuad
createSafe(long address)
static OVRLayerQuad.Buffer
createSafe(long address, int capacity)
OVRLayerHeader
Header()
Returns aOVRLayerHeader
view of theHeader
field.OVRLayerQuad
Header(java.util.function.Consumer<OVRLayerHeader> consumer)
Passes theHeader
field to the specifiedConsumer
.OVRLayerQuad
Header(OVRLayerHeader value)
Copies the specifiedOVRLayerHeader
to theHeader
field.static OVRLayerQuad
malloc()
Returns a newOVRLayerQuad
instance allocated withmemAlloc
.static OVRLayerQuad.Buffer
malloc(int capacity)
Returns a newOVRLayerQuad.Buffer
instance allocated withmemAlloc
.static OVRLayerQuad
mallocStack()
Returns a newOVRLayerQuad
instance allocated on the thread-localMemoryStack
.static OVRLayerQuad.Buffer
mallocStack(int capacity)
Returns a newOVRLayerQuad.Buffer
instance allocated on the thread-localMemoryStack
.static OVRLayerQuad.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerQuad.Buffer
instance allocated on the specifiedMemoryStack
.static OVRLayerQuad
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerQuad
instance allocated on the specifiedMemoryStack
.static long
nColorTexture(long struct)
Unsafe version ofColorTexture()
.static void
nColorTexture(long struct, long value)
Unsafe version ofColorTexture
.static OVRLayerHeader
nHeader(long struct)
Unsafe version ofHeader()
.static void
nHeader(long struct, OVRLayerHeader value)
Unsafe version ofHeader
.static OVRPosef
nQuadPoseCenter(long struct)
Unsafe version ofQuadPoseCenter()
.static void
nQuadPoseCenter(long struct, OVRPosef value)
Unsafe version ofQuadPoseCenter
.static OVRVector2f
nQuadSize(long struct)
Unsafe version ofQuadSize()
.static void
nQuadSize(long struct, OVRVector2f value)
Unsafe version ofQuadSize
.static OVRRecti
nViewport(long struct)
Unsafe version ofViewport()
.static void
nViewport(long struct, OVRRecti value)
Unsafe version ofViewport
.OVRPosef
QuadPoseCenter()
Returns aOVRPosef
view of theQuadPoseCenter
field.OVRLayerQuad
QuadPoseCenter(java.util.function.Consumer<OVRPosef> consumer)
Passes theQuadPoseCenter
field to the specifiedConsumer
.OVRLayerQuad
QuadPoseCenter(OVRPosef value)
Copies the specifiedOVRPosef
to theQuadPoseCenter
field.OVRVector2f
QuadSize()
Returns aOVRVector2f
view of theQuadSize
field.OVRLayerQuad
QuadSize(java.util.function.Consumer<OVRVector2f> consumer)
Passes theQuadSize
field to the specifiedConsumer
.OVRLayerQuad
QuadSize(OVRVector2f value)
Copies the specifiedOVRVector2f
to theQuadSize
field.OVRLayerQuad
set(OVRLayerHeader Header, long ColorTexture, OVRRecti Viewport, OVRPosef QuadPoseCenter, OVRVector2f QuadSize)
Initializes this struct with the specified values.OVRLayerQuad
set(OVRLayerQuad src)
Copies the specified struct data to this struct.int
sizeof()
static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.OVRRecti
Viewport()
Returns aOVRRecti
view of theViewport
field.OVRLayerQuad
Viewport(java.util.function.Consumer<OVRRecti> consumer)
Passes theViewport
field to the specifiedConsumer
.OVRLayerQuad
Viewport(OVRRecti value)
Copies the specifiedOVRRecti
to theViewport
field.
-
-
-
Constructor Detail
-
OVRLayerQuad
public OVRLayerQuad(java.nio.ByteBuffer container)
Creates aOVRLayerQuad
instance at the current position of the specifiedByteBuffer
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 classorg.lwjgl.system.Struct
-
Header
public OVRLayerHeader Header()
Returns aOVRLayerHeader
view of theHeader
field.
-
ColorTexture
public long ColorTexture()
Returns the value of theColorTexture
field.
-
QuadPoseCenter
public OVRPosef QuadPoseCenter()
Returns aOVRPosef
view of theQuadPoseCenter
field.
-
QuadSize
public OVRVector2f QuadSize()
Returns aOVRVector2f
view of theQuadSize
field.
-
Header
public OVRLayerQuad Header(OVRLayerHeader value)
Copies the specifiedOVRLayerHeader
to theHeader
field.
-
Header
public OVRLayerQuad Header(java.util.function.Consumer<OVRLayerHeader> consumer)
Passes theHeader
field to the specifiedConsumer
.
-
ColorTexture
public OVRLayerQuad ColorTexture(long value)
Sets the specified value to theColorTexture
field.
-
Viewport
public OVRLayerQuad Viewport(OVRRecti value)
Copies the specifiedOVRRecti
to theViewport
field.
-
Viewport
public OVRLayerQuad Viewport(java.util.function.Consumer<OVRRecti> consumer)
Passes theViewport
field to the specifiedConsumer
.
-
QuadPoseCenter
public OVRLayerQuad QuadPoseCenter(OVRPosef value)
Copies the specifiedOVRPosef
to theQuadPoseCenter
field.
-
QuadPoseCenter
public OVRLayerQuad QuadPoseCenter(java.util.function.Consumer<OVRPosef> consumer)
Passes theQuadPoseCenter
field to the specifiedConsumer
.
-
QuadSize
public OVRLayerQuad QuadSize(OVRVector2f value)
Copies the specifiedOVRVector2f
to theQuadSize
field.
-
QuadSize
public OVRLayerQuad QuadSize(java.util.function.Consumer<OVRVector2f> consumer)
Passes theQuadSize
field to the specifiedConsumer
.
-
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 newOVRLayerQuad
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static OVRLayerQuad calloc()
Returns a newOVRLayerQuad
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static OVRLayerQuad create()
Returns a newOVRLayerQuad
instance allocated withBufferUtils
.
-
create
public static OVRLayerQuad create(long address)
Returns a newOVRLayerQuad
instance for the specified memory address.
-
createSafe
@Nullable public static OVRLayerQuad createSafe(long address)
-
malloc
public static OVRLayerQuad.Buffer malloc(int capacity)
Returns a newOVRLayerQuad.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static OVRLayerQuad.Buffer calloc(int capacity)
Returns a newOVRLayerQuad.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRLayerQuad.Buffer create(int capacity)
Returns a newOVRLayerQuad.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRLayerQuad.Buffer create(long address, int capacity)
Create aOVRLayerQuad.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static OVRLayerQuad.Buffer createSafe(long address, int capacity)
-
mallocStack
public static OVRLayerQuad mallocStack()
Returns a newOVRLayerQuad
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static OVRLayerQuad callocStack()
Returns a newOVRLayerQuad
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static OVRLayerQuad mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerQuad
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static OVRLayerQuad callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerQuad
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static OVRLayerQuad.Buffer mallocStack(int capacity)
Returns a newOVRLayerQuad.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static OVRLayerQuad.Buffer callocStack(int capacity)
Returns a newOVRLayerQuad.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static OVRLayerQuad.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerQuad.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static OVRLayerQuad.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerQuad.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nHeader
public static OVRLayerHeader nHeader(long struct)
Unsafe version ofHeader()
.
-
nColorTexture
public static long nColorTexture(long struct)
Unsafe version ofColorTexture()
.
-
nViewport
public static OVRRecti nViewport(long struct)
Unsafe version ofViewport()
.
-
nQuadPoseCenter
public static OVRPosef nQuadPoseCenter(long struct)
Unsafe version ofQuadPoseCenter()
.
-
nQuadSize
public static OVRVector2f nQuadSize(long struct)
Unsafe version ofQuadSize()
.
-
nHeader
public static void nHeader(long struct, OVRLayerHeader value)
Unsafe version ofHeader
.
-
nColorTexture
public static void nColorTexture(long struct, long value)
Unsafe version ofColorTexture
.
-
nQuadPoseCenter
public static void nQuadPoseCenter(long struct, OVRPosef value)
Unsafe version ofQuadPoseCenter
.
-
nQuadSize
public static void nQuadSize(long struct, OVRVector2f value)
Unsafe version ofQuadSize
.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-
validate
public static void validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-