Package org.lwjgl.ovr
Class OVRViewScaleDesc
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.ovr.OVRViewScaleDesc
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class OVRViewScaleDesc extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceContains the data necessary to properly calculate position info for various layer types.HmdToEyePoseis the same value-pair provided inOVREyeRenderDesc. Modifying this value is suggested only if the app is forcing monoscopic rendering and requires that all layers including quad layers show up in a monoscopic fashion.HmdSpaceToWorldScaleInMetersis used to scale player motion into in-application units.
In other words, it is how big an in-application unit is in the player's physical meters. For example, if the application uses inches as its units then
HmdSpaceToWorldScaleInMeterswould be 0.0254. Note that if you are scaling the player in size, this must also scale. So if your application units are inches, but you're shrinking the player to half their normal size, thenHmdSpaceToWorldScaleInMeterswould be0.0254*2.0.Member documentation
HmdToEyePose[ovrEye_Count]– transform of each eye from the HMD center, in metersHmdSpaceToWorldScaleInMeters– ratio of viewer units to meter units
Layout
struct ovrViewScaleDesc {ovrPosefHmdToEyePose[ovrEye_Count]; float HmdSpaceToWorldScaleInMeters; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOVRViewScaleDesc.BufferAn array ofOVRViewScaleDescstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intHMDSPACETOWORLDSCALEINMETERS
HMDTOEYEPOSEThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description OVRViewScaleDesc(java.nio.ByteBuffer container)Creates aOVRViewScaleDescinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OVRViewScaleDesccalloc()Returns a newOVRViewScaleDescinstance allocated withmemCalloc.static OVRViewScaleDesc.Buffercalloc(int capacity)Returns a newOVRViewScaleDesc.Bufferinstance allocated withmemCalloc.static OVRViewScaleDesccallocStack()Returns a newOVRViewScaleDescinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static OVRViewScaleDesc.BuffercallocStack(int capacity)Returns a newOVRViewScaleDesc.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static OVRViewScaleDesc.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRViewScaleDesc.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRViewScaleDesccallocStack(org.lwjgl.system.MemoryStack stack)Returns a newOVRViewScaleDescinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRViewScaleDesccreate()Returns a newOVRViewScaleDescinstance allocated withBufferUtils.static OVRViewScaleDesc.Buffercreate(int capacity)Returns a newOVRViewScaleDesc.Bufferinstance allocated withBufferUtils.static OVRViewScaleDesccreate(long address)Returns a newOVRViewScaleDescinstance for the specified memory address.static OVRViewScaleDesc.Buffercreate(long address, int capacity)Create aOVRViewScaleDesc.Bufferinstance at the specified memory.static OVRViewScaleDesccreateSafe(long address)static OVRViewScaleDesc.BuffercreateSafe(long address, int capacity)floatHmdSpaceToWorldScaleInMeters()Returns the value of theHmdSpaceToWorldScaleInMetersfield.OVRViewScaleDescHmdSpaceToWorldScaleInMeters(float value)Sets the specified value to theHmdSpaceToWorldScaleInMetersfield.OVRPosef.BufferHmdToEyePose()Returns aOVRPosef.Buffer view of theHmdToEyePosefield.OVRPosefHmdToEyePose(int index)Returns aOVRPosefview of the struct at the specified index of theHmdToEyePosefield.OVRViewScaleDescHmdToEyePose(int index, java.util.function.Consumer<OVRPosef> consumer)Passes the element atindexof theHmdToEyePosefield to the specifiedConsumer.OVRViewScaleDescHmdToEyePose(int index, OVRPosef value)Copies the specifiedOVRPosefat the specified index of theHmdToEyePosefield.OVRViewScaleDescHmdToEyePose(java.util.function.Consumer<OVRPosef.Buffer> consumer)Passes theHmdToEyePosefield to the specifiedConsumer.OVRViewScaleDescHmdToEyePose(OVRPosef.Buffer value)Copies the specifiedOVRPosef.Bufferto theHmdToEyePosefield.static OVRViewScaleDescmalloc()Returns a newOVRViewScaleDescinstance allocated withmemAlloc.static OVRViewScaleDesc.Buffermalloc(int capacity)Returns a newOVRViewScaleDesc.Bufferinstance allocated withmemAlloc.static OVRViewScaleDescmallocStack()Returns a newOVRViewScaleDescinstance allocated on the thread-localMemoryStack.static OVRViewScaleDesc.BuffermallocStack(int capacity)Returns a newOVRViewScaleDesc.Bufferinstance allocated on the thread-localMemoryStack.static OVRViewScaleDesc.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRViewScaleDesc.Bufferinstance allocated on the specifiedMemoryStack.static OVRViewScaleDescmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newOVRViewScaleDescinstance allocated on the specifiedMemoryStack.static floatnHmdSpaceToWorldScaleInMeters(long struct)Unsafe version ofHmdSpaceToWorldScaleInMeters().static voidnHmdSpaceToWorldScaleInMeters(long struct, float value)Unsafe version ofHmdSpaceToWorldScaleInMeters.static OVRPosef.BuffernHmdToEyePose(long struct)Unsafe version ofHmdToEyePose().static OVRPosefnHmdToEyePose(long struct, int index)Unsafe version ofHmdToEyePose.static voidnHmdToEyePose(long struct, int index, OVRPosef value)Unsafe version ofHmdToEyePose.static voidnHmdToEyePose(long struct, OVRPosef.Buffer value)Unsafe version ofHmdToEyePose.OVRViewScaleDescset(OVRPosef.Buffer HmdToEyePose, float HmdSpaceToWorldScaleInMeters)Initializes this struct with the specified values.OVRViewScaleDescset(OVRViewScaleDesc src)Copies the specified struct data to this struct.intsizeof()
-
-
-
Constructor Detail
-
OVRViewScaleDesc
public OVRViewScaleDesc(java.nio.ByteBuffer container)
Creates aOVRViewScaleDescinstance 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
-
HmdToEyePose
public OVRPosef.Buffer HmdToEyePose()
Returns aOVRPosef.Buffer view of theHmdToEyePosefield.
-
HmdToEyePose
public OVRPosef HmdToEyePose(int index)
Returns aOVRPosefview of the struct at the specified index of theHmdToEyePosefield.
-
HmdSpaceToWorldScaleInMeters
public float HmdSpaceToWorldScaleInMeters()
Returns the value of theHmdSpaceToWorldScaleInMetersfield.
-
HmdToEyePose
public OVRViewScaleDesc HmdToEyePose(OVRPosef.Buffer value)
Copies the specifiedOVRPosef.Bufferto theHmdToEyePosefield.
-
HmdToEyePose
public OVRViewScaleDesc HmdToEyePose(int index, OVRPosef value)
Copies the specifiedOVRPosefat the specified index of theHmdToEyePosefield.
-
HmdToEyePose
public OVRViewScaleDesc HmdToEyePose(java.util.function.Consumer<OVRPosef.Buffer> consumer)
Passes theHmdToEyePosefield to the specifiedConsumer.
-
HmdToEyePose
public OVRViewScaleDesc HmdToEyePose(int index, java.util.function.Consumer<OVRPosef> consumer)
Passes the element atindexof theHmdToEyePosefield to the specifiedConsumer.
-
HmdSpaceToWorldScaleInMeters
public OVRViewScaleDesc HmdSpaceToWorldScaleInMeters(float value)
Sets the specified value to theHmdSpaceToWorldScaleInMetersfield.
-
set
public OVRViewScaleDesc set(OVRPosef.Buffer HmdToEyePose, float HmdSpaceToWorldScaleInMeters)
Initializes this struct with the specified values.
-
set
public OVRViewScaleDesc set(OVRViewScaleDesc src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static OVRViewScaleDesc malloc()
Returns a newOVRViewScaleDescinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static OVRViewScaleDesc calloc()
Returns a newOVRViewScaleDescinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static OVRViewScaleDesc create()
Returns a newOVRViewScaleDescinstance allocated withBufferUtils.
-
create
public static OVRViewScaleDesc create(long address)
Returns a newOVRViewScaleDescinstance for the specified memory address.
-
createSafe
@Nullable public static OVRViewScaleDesc createSafe(long address)
-
malloc
public static OVRViewScaleDesc.Buffer malloc(int capacity)
Returns a newOVRViewScaleDesc.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static OVRViewScaleDesc.Buffer calloc(int capacity)
Returns a newOVRViewScaleDesc.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static OVRViewScaleDesc.Buffer create(int capacity)
Returns a newOVRViewScaleDesc.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static OVRViewScaleDesc.Buffer create(long address, int capacity)
Create aOVRViewScaleDesc.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static OVRViewScaleDesc.Buffer createSafe(long address, int capacity)
-
mallocStack
public static OVRViewScaleDesc mallocStack()
Returns a newOVRViewScaleDescinstance allocated on the thread-localMemoryStack.
-
callocStack
public static OVRViewScaleDesc callocStack()
Returns a newOVRViewScaleDescinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static OVRViewScaleDesc mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRViewScaleDescinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static OVRViewScaleDesc callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRViewScaleDescinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static OVRViewScaleDesc.Buffer mallocStack(int capacity)
Returns a newOVRViewScaleDesc.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static OVRViewScaleDesc.Buffer callocStack(int capacity)
Returns a newOVRViewScaleDesc.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static OVRViewScaleDesc.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRViewScaleDesc.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static OVRViewScaleDesc.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRViewScaleDesc.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nHmdToEyePose
public static OVRPosef.Buffer nHmdToEyePose(long struct)
Unsafe version ofHmdToEyePose().
-
nHmdToEyePose
public static OVRPosef nHmdToEyePose(long struct, int index)
Unsafe version ofHmdToEyePose.
-
nHmdSpaceToWorldScaleInMeters
public static float nHmdSpaceToWorldScaleInMeters(long struct)
Unsafe version ofHmdSpaceToWorldScaleInMeters().
-
nHmdToEyePose
public static void nHmdToEyePose(long struct, OVRPosef.Buffer value)Unsafe version ofHmdToEyePose.
-
nHmdToEyePose
public static void nHmdToEyePose(long struct, int index, OVRPosef value)Unsafe version ofHmdToEyePose.
-
nHmdSpaceToWorldScaleInMeters
public static void nHmdSpaceToWorldScaleInMeters(long struct, float value)Unsafe version ofHmdSpaceToWorldScaleInMeters.
-
-