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,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class OVRLayerEyeMatrix extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceDescribes 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 as
OVRLayerEyeFovbut 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]andColorTexture[1]contain the left and right stereo renderings, respectively.Viewport[0]andViewport[1]refer toColorTexture[0]andColorTexture[1], respectively.ColorTexture[0]contains both the left and right renderings,ColorTexture[1]isNULL, andViewport[0]andViewport[1]refer to sub-rects withColorTexture[0].ColorTexture[0]contains a single monoscopic rendering, andViewport[0]andViewport[1]both refer to that rendering.
Member documentation
Header–Header.Typemust beLayerType_EyeMatrixColorTexture[ovrEye_Count]–ovrTextureSwapChainsfor the left and right eye respectively. The second one of which can beNULLfor cases described above.Viewport[ovrEye_Count]– specifies theColorTexturesub-rect UV coordinates. BothViewport[0]andViewport[1]must be valid.RenderPose[ovrEye_Count]– specifies the position and orientation of each eye view, with the position specified in meters.RenderPosewill typically be the value returned from_CalcEyePoses, but can be different in special cases if a different head pose is used for rendering.Matrix[ovrEye_Count]– 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.zSensorSampleTime– specifies the timestamp when the sourceovrPosef(used in calculatingRenderPose) was sampled from the SDK. Typically retrieved by callingGetTimeInSecondsaround the instant the application callsGetTrackingStateThe main purpose for this is to accurately track app tracking latency.
Layout
struct ovrLayerEyeMatrix {ovrLayerHeaderHeader; ovrTextureSwapChain ColorTexture[ovrEye_Count];ovrRectiViewport[ovrEye_Count];ovrPosefRenderPose[ovrEye_Count];ovrMatrix4fMatrix[ovrEye_Count]; double SensorSampleTime; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOVRLayerEyeMatrix.BufferAn array ofOVRLayerEyeMatrixstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intCOLORTEXTURE
HEADER
MATRIX
RENDERPOSE
SENSORSAMPLETIMEThe struct member offsets.static intSIZEOFThe struct size in bytes.static intVIEWPORTThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description OVRLayerEyeMatrix(java.nio.ByteBuffer container)Creates aOVRLayerEyeMatrixinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OVRLayerEyeMatrixcalloc()Returns a newOVRLayerEyeMatrixinstance allocated withmemCalloc.static OVRLayerEyeMatrix.Buffercalloc(int capacity)Returns a newOVRLayerEyeMatrix.Bufferinstance allocated withmemCalloc.static OVRLayerEyeMatrixcallocStack()Returns a newOVRLayerEyeMatrixinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static OVRLayerEyeMatrix.BuffercallocStack(int capacity)Returns a newOVRLayerEyeMatrix.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static OVRLayerEyeMatrix.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRLayerEyeMatrix.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRLayerEyeMatrixcallocStack(org.lwjgl.system.MemoryStack stack)Returns a newOVRLayerEyeMatrixinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.org.lwjgl.PointerBufferColorTexture()Returns aPointerBufferview of theColorTexturefield.longColorTexture(int index)Returns the value at the specified index of theColorTexturefield.OVRLayerEyeMatrixColorTexture(int index, long value)Sets the specified value at the specified index of theColorTexturefield.OVRLayerEyeMatrixColorTexture(org.lwjgl.PointerBuffer value)Copies the specifiedPointerBufferto theColorTexturefield.static OVRLayerEyeMatrixcreate()Returns a newOVRLayerEyeMatrixinstance allocated withBufferUtils.static OVRLayerEyeMatrix.Buffercreate(int capacity)Returns a newOVRLayerEyeMatrix.Bufferinstance allocated withBufferUtils.static OVRLayerEyeMatrixcreate(long address)Returns a newOVRLayerEyeMatrixinstance for the specified memory address.static OVRLayerEyeMatrix.Buffercreate(long address, int capacity)Create aOVRLayerEyeMatrix.Bufferinstance at the specified memory.static OVRLayerEyeMatrixcreateSafe(long address)static OVRLayerEyeMatrix.BuffercreateSafe(long address, int capacity)OVRLayerHeaderHeader()Returns aOVRLayerHeaderview of theHeaderfield.OVRLayerEyeMatrixHeader(java.util.function.Consumer<OVRLayerHeader> consumer)Passes theHeaderfield to the specifiedConsumer.OVRLayerEyeMatrixHeader(OVRLayerHeader value)Copies the specifiedOVRLayerHeaderto theHeaderfield.static OVRLayerEyeMatrixmalloc()Returns a newOVRLayerEyeMatrixinstance allocated withmemAlloc.static OVRLayerEyeMatrix.Buffermalloc(int capacity)Returns a newOVRLayerEyeMatrix.Bufferinstance allocated withmemAlloc.static OVRLayerEyeMatrixmallocStack()Returns a newOVRLayerEyeMatrixinstance allocated on the thread-localMemoryStack.static OVRLayerEyeMatrix.BuffermallocStack(int capacity)Returns a newOVRLayerEyeMatrix.Bufferinstance allocated on the thread-localMemoryStack.static OVRLayerEyeMatrix.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRLayerEyeMatrix.Bufferinstance allocated on the specifiedMemoryStack.static OVRLayerEyeMatrixmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newOVRLayerEyeMatrixinstance allocated on the specifiedMemoryStack.OVRMatrix4f.BufferMatrix()Returns aOVRMatrix4f.Buffer view of theMatrixfield.OVRMatrix4fMatrix(int index)Returns aOVRMatrix4fview of the struct at the specified index of theMatrixfield.OVRLayerEyeMatrixMatrix(int index, java.util.function.Consumer<OVRMatrix4f> consumer)Passes the element atindexof theMatrixfield to the specifiedConsumer.OVRLayerEyeMatrixMatrix(int index, OVRMatrix4f value)Copies the specifiedOVRMatrix4fat the specified index of theMatrixfield.OVRLayerEyeMatrixMatrix(java.util.function.Consumer<OVRMatrix4f.Buffer> consumer)Passes theMatrixfield to the specifiedConsumer.OVRLayerEyeMatrixMatrix(OVRMatrix4f.Buffer value)Copies the specifiedOVRMatrix4f.Bufferto theMatrixfield.static org.lwjgl.PointerBuffernColorTexture(long struct)Unsafe version ofColorTexture().static longnColorTexture(long struct, int index)Unsafe version ofColorTexture.static voidnColorTexture(long struct, int index, long value)Unsafe version ofColorTexture.static voidnColorTexture(long struct, org.lwjgl.PointerBuffer value)Unsafe version ofColorTexture.static OVRLayerHeadernHeader(long struct)Unsafe version ofHeader().static voidnHeader(long struct, OVRLayerHeader value)Unsafe version ofHeader.static OVRMatrix4f.BuffernMatrix(long struct)Unsafe version ofMatrix().static OVRMatrix4fnMatrix(long struct, int index)Unsafe version ofMatrix.static voidnMatrix(long struct, int index, OVRMatrix4f value)Unsafe version ofMatrix.static voidnMatrix(long struct, OVRMatrix4f.Buffer value)Unsafe version ofMatrix.static OVRPosef.BuffernRenderPose(long struct)Unsafe version ofRenderPose().static OVRPosefnRenderPose(long struct, int index)Unsafe version ofRenderPose.static voidnRenderPose(long struct, int index, OVRPosef value)Unsafe version ofRenderPose.static voidnRenderPose(long struct, OVRPosef.Buffer value)Unsafe version ofRenderPose.static doublenSensorSampleTime(long struct)Unsafe version ofSensorSampleTime().static voidnSensorSampleTime(long struct, double value)Unsafe version ofSensorSampleTime.static OVRRecti.BuffernViewport(long struct)Unsafe version ofViewport().static OVRRectinViewport(long struct, int index)Unsafe version ofViewport.static voidnViewport(long struct, int index, OVRRecti value)Unsafe version ofViewport.static voidnViewport(long struct, OVRRecti.Buffer value)Unsafe version ofViewport.OVRPosef.BufferRenderPose()Returns aOVRPosef.Buffer view of theRenderPosefield.OVRPosefRenderPose(int index)Returns aOVRPosefview of the struct at the specified index of theRenderPosefield.OVRLayerEyeMatrixRenderPose(int index, java.util.function.Consumer<OVRPosef> consumer)Passes the element atindexof theRenderPosefield to the specifiedConsumer.OVRLayerEyeMatrixRenderPose(int index, OVRPosef value)Copies the specifiedOVRPosefat the specified index of theRenderPosefield.OVRLayerEyeMatrixRenderPose(java.util.function.Consumer<OVRPosef.Buffer> consumer)Passes theRenderPosefield to the specifiedConsumer.OVRLayerEyeMatrixRenderPose(OVRPosef.Buffer value)Copies the specifiedOVRPosef.Bufferto theRenderPosefield.doubleSensorSampleTime()Returns the value of theSensorSampleTimefield.OVRLayerEyeMatrixSensorSampleTime(double value)Sets the specified value to theSensorSampleTimefield.OVRLayerEyeMatrixset(OVRLayerEyeMatrix src)Copies the specified struct data to this struct.OVRLayerEyeMatrixset(OVRLayerHeader Header, org.lwjgl.PointerBuffer ColorTexture, OVRRecti.Buffer Viewport, OVRPosef.Buffer RenderPose, OVRMatrix4f.Buffer Matrix, double SensorSampleTime)Initializes this struct with the specified values.intsizeof()static voidvalidate(long struct)Validates pointer members that should not beNULL.static voidvalidate(long array, int count)Callsvalidate(long)for each struct contained in the specified struct array.OVRRecti.BufferViewport()Returns aOVRRecti.Buffer view of theViewportfield.OVRRectiViewport(int index)Returns aOVRRectiview of the struct at the specified index of theViewportfield.OVRLayerEyeMatrixViewport(int index, java.util.function.Consumer<OVRRecti> consumer)Passes the element atindexof theViewportfield to the specifiedConsumer.OVRLayerEyeMatrixViewport(int index, OVRRecti value)Copies the specifiedOVRRectiat the specified index of theViewportfield.OVRLayerEyeMatrixViewport(java.util.function.Consumer<OVRRecti.Buffer> consumer)Passes theViewportfield to the specifiedConsumer.OVRLayerEyeMatrixViewport(OVRRecti.Buffer value)Copies the specifiedOVRRecti.Bufferto theViewportfield.
-
-
-
Constructor Detail
-
OVRLayerEyeMatrix
public OVRLayerEyeMatrix(java.nio.ByteBuffer container)
Creates aOVRLayerEyeMatrixinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
Header
public OVRLayerHeader Header()
Returns aOVRLayerHeaderview of theHeaderfield.
-
ColorTexture
public org.lwjgl.PointerBuffer ColorTexture()
Returns aPointerBufferview of theColorTexturefield.
-
ColorTexture
public long ColorTexture(int index)
Returns the value at the specified index of theColorTexturefield.
-
Viewport
public OVRRecti.Buffer Viewport()
Returns aOVRRecti.Buffer view of theViewportfield.
-
Viewport
public OVRRecti Viewport(int index)
Returns aOVRRectiview of the struct at the specified index of theViewportfield.
-
RenderPose
public OVRPosef.Buffer RenderPose()
Returns aOVRPosef.Buffer view of theRenderPosefield.
-
RenderPose
public OVRPosef RenderPose(int index)
Returns aOVRPosefview of the struct at the specified index of theRenderPosefield.
-
Matrix
public OVRMatrix4f.Buffer Matrix()
Returns aOVRMatrix4f.Buffer view of theMatrixfield.
-
Matrix
public OVRMatrix4f Matrix(int index)
Returns aOVRMatrix4fview of the struct at the specified index of theMatrixfield.
-
SensorSampleTime
public double SensorSampleTime()
Returns the value of theSensorSampleTimefield.
-
Header
public OVRLayerEyeMatrix Header(OVRLayerHeader value)
Copies the specifiedOVRLayerHeaderto theHeaderfield.
-
Header
public OVRLayerEyeMatrix Header(java.util.function.Consumer<OVRLayerHeader> consumer)
Passes theHeaderfield to the specifiedConsumer.
-
ColorTexture
public OVRLayerEyeMatrix ColorTexture(org.lwjgl.PointerBuffer value)
Copies the specifiedPointerBufferto theColorTexturefield.
-
ColorTexture
public OVRLayerEyeMatrix ColorTexture(int index, long value)
Sets the specified value at the specified index of theColorTexturefield.
-
Viewport
public OVRLayerEyeMatrix Viewport(OVRRecti.Buffer value)
Copies the specifiedOVRRecti.Bufferto theViewportfield.
-
Viewport
public OVRLayerEyeMatrix Viewport(int index, OVRRecti value)
Copies the specifiedOVRRectiat the specified index of theViewportfield.
-
Viewport
public OVRLayerEyeMatrix Viewport(java.util.function.Consumer<OVRRecti.Buffer> consumer)
Passes theViewportfield to the specifiedConsumer.
-
Viewport
public OVRLayerEyeMatrix Viewport(int index, java.util.function.Consumer<OVRRecti> consumer)
Passes the element atindexof theViewportfield to the specifiedConsumer.
-
RenderPose
public OVRLayerEyeMatrix RenderPose(OVRPosef.Buffer value)
Copies the specifiedOVRPosef.Bufferto theRenderPosefield.
-
RenderPose
public OVRLayerEyeMatrix RenderPose(int index, OVRPosef value)
Copies the specifiedOVRPosefat the specified index of theRenderPosefield.
-
RenderPose
public OVRLayerEyeMatrix RenderPose(java.util.function.Consumer<OVRPosef.Buffer> consumer)
Passes theRenderPosefield to the specifiedConsumer.
-
RenderPose
public OVRLayerEyeMatrix RenderPose(int index, java.util.function.Consumer<OVRPosef> consumer)
Passes the element atindexof theRenderPosefield to the specifiedConsumer.
-
Matrix
public OVRLayerEyeMatrix Matrix(OVRMatrix4f.Buffer value)
Copies the specifiedOVRMatrix4f.Bufferto theMatrixfield.
-
Matrix
public OVRLayerEyeMatrix Matrix(int index, OVRMatrix4f value)
Copies the specifiedOVRMatrix4fat the specified index of theMatrixfield.
-
Matrix
public OVRLayerEyeMatrix Matrix(java.util.function.Consumer<OVRMatrix4f.Buffer> consumer)
Passes theMatrixfield to the specifiedConsumer.
-
Matrix
public OVRLayerEyeMatrix Matrix(int index, java.util.function.Consumer<OVRMatrix4f> consumer)
Passes the element atindexof theMatrixfield to the specifiedConsumer.
-
SensorSampleTime
public OVRLayerEyeMatrix SensorSampleTime(double value)
Sets the specified value to theSensorSampleTimefield.
-
set
public OVRLayerEyeMatrix set(OVRLayerHeader Header, org.lwjgl.PointerBuffer ColorTexture, OVRRecti.Buffer Viewport, OVRPosef.Buffer RenderPose, OVRMatrix4f.Buffer Matrix, double SensorSampleTime)
Initializes this struct with the specified values.
-
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 newOVRLayerEyeMatrixinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static OVRLayerEyeMatrix calloc()
Returns a newOVRLayerEyeMatrixinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static OVRLayerEyeMatrix create()
Returns a newOVRLayerEyeMatrixinstance allocated withBufferUtils.
-
create
public static OVRLayerEyeMatrix create(long address)
Returns a newOVRLayerEyeMatrixinstance for the specified memory address.
-
createSafe
@Nullable public static OVRLayerEyeMatrix createSafe(long address)
-
malloc
public static OVRLayerEyeMatrix.Buffer malloc(int capacity)
Returns a newOVRLayerEyeMatrix.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static OVRLayerEyeMatrix.Buffer calloc(int capacity)
Returns a newOVRLayerEyeMatrix.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static OVRLayerEyeMatrix.Buffer create(int capacity)
Returns a newOVRLayerEyeMatrix.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static OVRLayerEyeMatrix.Buffer create(long address, int capacity)
Create aOVRLayerEyeMatrix.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static OVRLayerEyeMatrix.Buffer createSafe(long address, int capacity)
-
mallocStack
public static OVRLayerEyeMatrix mallocStack()
Returns a newOVRLayerEyeMatrixinstance allocated on the thread-localMemoryStack.
-
callocStack
public static OVRLayerEyeMatrix callocStack()
Returns a newOVRLayerEyeMatrixinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static OVRLayerEyeMatrix mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerEyeMatrixinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static OVRLayerEyeMatrix callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerEyeMatrixinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static OVRLayerEyeMatrix.Buffer callocStack(int capacity)
Returns a newOVRLayerEyeMatrix.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static OVRLayerEyeMatrix.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerEyeMatrix.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static OVRLayerEyeMatrix.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRLayerEyeMatrix.Bufferinstance allocated on the specifiedMemoryStackand 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 org.lwjgl.PointerBuffer nColorTexture(long struct)
Unsafe version ofColorTexture().
-
nColorTexture
public static long nColorTexture(long struct, int index)Unsafe version ofColorTexture.
-
nViewport
public static OVRRecti.Buffer nViewport(long struct)
Unsafe version ofViewport().
-
nRenderPose
public static OVRPosef.Buffer nRenderPose(long struct)
Unsafe version ofRenderPose().
-
nRenderPose
public static OVRPosef nRenderPose(long struct, int index)
Unsafe version ofRenderPose.
-
nMatrix
public static OVRMatrix4f.Buffer nMatrix(long struct)
Unsafe version ofMatrix().
-
nMatrix
public static OVRMatrix4f nMatrix(long struct, int index)
Unsafe version ofMatrix.
-
nSensorSampleTime
public static double nSensorSampleTime(long struct)
Unsafe version ofSensorSampleTime().
-
nHeader
public static void nHeader(long struct, OVRLayerHeader value)Unsafe version ofHeader.
-
nColorTexture
public static void nColorTexture(long struct, org.lwjgl.PointerBuffer value)Unsafe version ofColorTexture.
-
nColorTexture
public static void nColorTexture(long struct, int index, long value)Unsafe version ofColorTexture.
-
nViewport
public static void nViewport(long struct, OVRRecti.Buffer value)Unsafe version ofViewport.
-
nViewport
public static void nViewport(long struct, int index, OVRRecti value)Unsafe version ofViewport.
-
nRenderPose
public static void nRenderPose(long struct, OVRPosef.Buffer value)Unsafe version ofRenderPose.
-
nRenderPose
public static void nRenderPose(long struct, int index, OVRPosef value)Unsafe version ofRenderPose.
-
nMatrix
public static void nMatrix(long struct, OVRMatrix4f.Buffer value)Unsafe version ofMatrix.
-
nMatrix
public static void nMatrix(long struct, int index, OVRMatrix4f value)Unsafe version ofMatrix.
-
nSensorSampleTime
public static void nSensorSampleTime(long struct, double value)Unsafe version ofSensorSampleTime.
-
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
-
-