Package org.lwjgl.ovr
Class OVRLayerEyeMatrix
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.ovr.OVRLayerEyeMatrix
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, NativeResource, Pointer
public class OVRLayerEyeMatrix extends Struct
Describes a layer that specifies a monoscopic or stereoscopic view. This uses a direct 3x4 matrix to map from view space to the UV coordinates. It is essentially the same thing asOVRLayerEyeFov
but using a much lower level. This is mainly to provide compatibility with specific apps. Unless the application really requires this flexibility, it is usually better to useOVRLayerEyeFov
.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
Header
–Header.Type
must beOVR.ovrLayerType_EyeMatrix
ColorTexture
–ovrTextureSwapChains
for the left and right eye respectively. The second one of which can beNULL
Viewport
– specifies theColorTexture
sub-rect UV coordinates. BothViewport[0]
andViewport[1]
must be valid.RenderPose
– specifies the position and orientation of each eye view, with the position specified in meters. RenderPose will typically be the value returned fromOVRUtil.ovr_CalcEyePoses(org.lwjgl.ovr.OVRPosef, org.lwjgl.ovr.OVRVector3f.Buffer, org.lwjgl.ovr.OVRPosef.Buffer)
, but can be different in special cases if a different head pose is used for rendering.Matrix
– specifies the mapping from a view-space vector to a UV coordinate on the textures given above.P = (x,y,z,1)*Matrix TexU = P.x/P.z TexV = P.y/P.z
SensorSampleTime
– specifies the timestamp when the sourceOVRPosef
(used in calculating RenderPose) was sampled from the SDK. Typically retrieved by callingOVR.ovr_GetTimeInSeconds()
around the instant the application callsOVR.ovr_GetTrackingState(long, double, boolean, org.lwjgl.ovr.OVRTrackingState)
. The main purpose for this is to accurately track app tracking latency.
Layout
struct ovrLayerEyeMatrix {
ovrLayerHeader
Header; ovrTextureSwapChain[2] ColorTexture;ovrRecti
[2] Viewport;ovrPosef
[2] RenderPose;ovrMatrix4f
[2] Matrix; double SensorSampleTime; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
OVRLayerEyeMatrix.Buffer
An array ofOVRLayerEyeMatrix
structs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field and Description static int
SIZEOF
The struct size in bytes.-
Fields inherited from interface org.lwjgl.system.Pointer
POINTER_SHIFT, POINTER_SIZE
-
-
Constructor Summary
Constructors Constructor and Description OVRLayerEyeMatrix(java.nio.ByteBuffer container)
Creates aOVRLayerEyeMatrix
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static OVRLayerEyeMatrix
calloc()
Returns a newOVRLayerEyeMatrix
instance allocated withmemCalloc
.static OVRLayerEyeMatrix.Buffer
calloc(int capacity)
Returns a newOVRLayerEyeMatrix.Buffer
instance allocated withmemCalloc
.static OVRLayerEyeMatrix
callocStack()
Returns a newOVRLayerEyeMatrix
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRLayerEyeMatrix.Buffer
callocStack(int capacity)
Returns a newOVRLayerEyeMatrix.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRLayerEyeMatrix.Buffer
callocStack(int capacity, MemoryStack stack)
Returns a newOVRLayerEyeMatrix.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRLayerEyeMatrix
callocStack(MemoryStack stack)
Returns a newOVRLayerEyeMatrix
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.PointerBuffer
ColorTexture()
Returns aPointerBuffer
view of theColorTexture
field.long
ColorTexture(int index)
Returns the value at the specified index of theColorTexture
field.OVRLayerEyeMatrix
ColorTexture(int index, long value)
Sets the specified value at the specified index of theColorTexture
field.OVRLayerEyeMatrix
ColorTexture(PointerBuffer value)
Copies the specifiedPointerBuffer
to theColorTexture
field.static OVRLayerEyeMatrix
create()
Returns a newOVRLayerEyeMatrix
instance allocated withBufferUtils
.static OVRLayerEyeMatrix.Buffer
create(int capacity)
Returns a newOVRLayerEyeMatrix.Buffer
instance allocated withBufferUtils
.static OVRLayerEyeMatrix
create(long address)
Returns a newOVRLayerEyeMatrix
instance for the specified memory address ornull
if the address isNULL
.static OVRLayerEyeMatrix.Buffer
create(long address, int capacity)
Create aOVRLayerEyeMatrix.Buffer
instance at the specified memory.OVRLayerHeader
Header()
Returns aOVRLayerHeader
view of theHeader
field.OVRLayerEyeMatrix
Header(OVRLayerHeader value)
Copies the specifiedOVRLayerHeader
to theHeader
field.static OVRLayerEyeMatrix
malloc()
Returns a newOVRLayerEyeMatrix
instance allocated withmemAlloc
.static OVRLayerEyeMatrix.Buffer
malloc(int capacity)
Returns a newOVRLayerEyeMatrix.Buffer
instance allocated withmemAlloc
.static OVRLayerEyeMatrix
mallocStack()
Returns a newOVRLayerEyeMatrix
instance allocated on the thread-localMemoryStack
.static OVRLayerEyeMatrix.Buffer
mallocStack(int capacity)
Returns a newOVRLayerEyeMatrix.Buffer
instance allocated on the thread-localMemoryStack
.static OVRLayerEyeMatrix.Buffer
mallocStack(int capacity, MemoryStack stack)
Returns a newOVRLayerEyeMatrix.Buffer
instance allocated on the specifiedMemoryStack
.static OVRLayerEyeMatrix
mallocStack(MemoryStack stack)
Returns a newOVRLayerEyeMatrix
instance allocated on the specifiedMemoryStack
.OVRMatrix4f.Buffer
Matrix()
Returns aOVRMatrix4f
.Buffer view of theMatrix
field.OVRMatrix4f
Matrix(int index)
Returns aOVRMatrix4f
view of the struct at the specified index of theMatrix
field.OVRLayerEyeMatrix
Matrix(int index, OVRMatrix4f value)
Copies the specifiedOVRMatrix4f
at the specified index of theMatrix
field.OVRLayerEyeMatrix
Matrix(OVRMatrix4f.Buffer value)
Copies the specifiedOVRMatrix4f.Buffer
to theMatrix
field.OVRLayerEyeMatrix
nset(long struct)
Unsafe version ofset
.OVRPosef.Buffer
RenderPose()
Returns aOVRPosef
.Buffer view of theRenderPose
field.OVRPosef
RenderPose(int index)
Returns aOVRPosef
view of the struct at the specified index of theRenderPose
field.OVRLayerEyeMatrix
RenderPose(int index, OVRPosef value)
Copies the specifiedOVRPosef
at the specified index of theRenderPose
field.OVRLayerEyeMatrix
RenderPose(OVRPosef.Buffer value)
Copies the specifiedOVRPosef.Buffer
to theRenderPose
field.double
SensorSampleTime()
Returns the value of theSensorSampleTime
field.OVRLayerEyeMatrix
SensorSampleTime(double value)
Sets the specified value to theSensorSampleTime
field.OVRLayerEyeMatrix
set(OVRLayerEyeMatrix src)
Copies the specified struct data to this struct.OVRLayerEyeMatrix
set(OVRLayerHeader Header, PointerBuffer ColorTexture, OVRRecti.Buffer Viewport, OVRPosef.Buffer RenderPose, OVRMatrix4f.Buffer Matrix, double SensorSampleTime)
Initializes this struct with the specified values.int
sizeof()
Returns thesizeof(struct)
.static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
CallsOVRLayerEyeMatrix.validate(long)
for each struct contained in the specified struct array.OVRRecti.Buffer
Viewport()
Returns aOVRRecti
.Buffer view of theViewport
field.OVRRecti
Viewport(int index)
Returns aOVRRecti
view of the struct at the specified index of theViewport
field.OVRLayerEyeMatrix
Viewport(int index, OVRRecti value)
Copies the specifiedOVRRecti
at the specified index of theViewport
field.OVRLayerEyeMatrix
Viewport(OVRRecti.Buffer value)
Copies the specifiedOVRRecti.Buffer
to theViewport
field.-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
-
-
-
Constructor Detail
-
OVRLayerEyeMatrix
public OVRLayerEyeMatrix(java.nio.ByteBuffer container)
Creates aOVRLayerEyeMatrix
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()
Description copied from class:Struct
Returns thesizeof(struct)
.
-
Header
public OVRLayerHeader Header()
Returns aOVRLayerHeader
view of theHeader
field.
-
ColorTexture
public PointerBuffer ColorTexture()
Returns aPointerBuffer
view of theColorTexture
field.
-
ColorTexture
public long ColorTexture(int index)
Returns the value at the specified index of theColorTexture
field.
-
Viewport
public OVRRecti.Buffer Viewport()
Returns aOVRRecti
.Buffer view of theViewport
field.
-
Viewport
public OVRRecti Viewport(int index)
Returns aOVRRecti
view of the struct at the specified index of theViewport
field.
-
RenderPose
public OVRPosef.Buffer RenderPose()
Returns aOVRPosef
.Buffer view of theRenderPose
field.
-
RenderPose
public OVRPosef RenderPose(int index)
Returns aOVRPosef
view of the struct at the specified index of theRenderPose
field.
-
Matrix
public OVRMatrix4f.Buffer Matrix()
Returns aOVRMatrix4f
.Buffer view of theMatrix
field.
-
Matrix
public OVRMatrix4f Matrix(int index)
Returns aOVRMatrix4f
view of the struct at the specified index of theMatrix
field.
-
SensorSampleTime
public double SensorSampleTime()
Returns the value of theSensorSampleTime
field.
-
Header
public OVRLayerEyeMatrix Header(OVRLayerHeader value)
Copies the specifiedOVRLayerHeader
to theHeader
field.
-
ColorTexture
public OVRLayerEyeMatrix ColorTexture(PointerBuffer value)
Copies the specifiedPointerBuffer
to theColorTexture
field.
-
ColorTexture
public OVRLayerEyeMatrix ColorTexture(int index, long value)
Sets the specified value at the specified index of theColorTexture
field.
-
Viewport
public OVRLayerEyeMatrix Viewport(OVRRecti.Buffer value)
Copies the specifiedOVRRecti.Buffer
to theViewport
field.
-
Viewport
public OVRLayerEyeMatrix Viewport(int index, OVRRecti value)
Copies the specifiedOVRRecti
at the specified index of theViewport
field.
-
RenderPose
public OVRLayerEyeMatrix RenderPose(OVRPosef.Buffer value)
Copies the specifiedOVRPosef.Buffer
to theRenderPose
field.
-
RenderPose
public OVRLayerEyeMatrix RenderPose(int index, OVRPosef value)
Copies the specifiedOVRPosef
at the specified index of theRenderPose
field.
-
Matrix
public OVRLayerEyeMatrix Matrix(OVRMatrix4f.Buffer value)
Copies the specifiedOVRMatrix4f.Buffer
to theMatrix
field.
-
Matrix
public OVRLayerEyeMatrix Matrix(int index, OVRMatrix4f value)
Copies the specifiedOVRMatrix4f
at the specified index of theMatrix
field.
-
SensorSampleTime
public OVRLayerEyeMatrix SensorSampleTime(double value)
Sets the specified value to theSensorSampleTime
field.
-
set
public OVRLayerEyeMatrix set(OVRLayerHeader Header, PointerBuffer ColorTexture, OVRRecti.Buffer Viewport, OVRPosef.Buffer RenderPose, OVRMatrix4f.Buffer Matrix, double SensorSampleTime)
Initializes this struct with the specified values.
-
nset
public OVRLayerEyeMatrix nset(long struct)
Unsafe version ofset
.
-
set
public OVRLayerEyeMatrix set(OVRLayerEyeMatrix src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static OVRLayerEyeMatrix malloc()
Returns a newOVRLayerEyeMatrix
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static OVRLayerEyeMatrix calloc()
Returns a newOVRLayerEyeMatrix
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static OVRLayerEyeMatrix create()
Returns a newOVRLayerEyeMatrix
instance allocated withBufferUtils
.
-
create
public static OVRLayerEyeMatrix create(long address)
Returns a newOVRLayerEyeMatrix
instance for the specified memory address ornull
if the address isNULL
.
-
malloc
public static OVRLayerEyeMatrix.Buffer malloc(int capacity)
Returns a newOVRLayerEyeMatrix.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static OVRLayerEyeMatrix.Buffer calloc(int capacity)
Returns a newOVRLayerEyeMatrix.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRLayerEyeMatrix.Buffer create(int capacity)
Returns a newOVRLayerEyeMatrix.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRLayerEyeMatrix.Buffer create(long address, int capacity)
Create aOVRLayerEyeMatrix.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
mallocStack
public static OVRLayerEyeMatrix mallocStack()
Returns a newOVRLayerEyeMatrix
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static OVRLayerEyeMatrix callocStack()
Returns a newOVRLayerEyeMatrix
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static OVRLayerEyeMatrix mallocStack(MemoryStack stack)
Returns a newOVRLayerEyeMatrix
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static OVRLayerEyeMatrix callocStack(MemoryStack stack)
Returns a newOVRLayerEyeMatrix
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static OVRLayerEyeMatrix.Buffer mallocStack(int capacity)
Returns a newOVRLayerEyeMatrix.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static OVRLayerEyeMatrix.Buffer callocStack(int capacity)
Returns a newOVRLayerEyeMatrix.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static OVRLayerEyeMatrix.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newOVRLayerEyeMatrix.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static OVRLayerEyeMatrix.Buffer callocStack(int capacity, MemoryStack stack)
Returns a newOVRLayerEyeMatrix.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
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)
CallsOVRLayerEyeMatrix.validate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-