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.Layout
struct ovrViewScaleDesc {ovrPosefHmdToEyePose()[ovrEye_Count]; floatHmdSpaceToWorldScaleInMeters(); }
-
-
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 Deprecated 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 OVRViewScaleDesc.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRViewScaleDesc.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRViewScaleDesccalloc(org.lwjgl.system.MemoryStack stack)Returns a newOVRViewScaleDescinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRViewScaleDesccallocStack()Deprecated.static OVRViewScaleDesc.BuffercallocStack(int capacity)Deprecated.static OVRViewScaleDesc.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static OVRViewScaleDesccallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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()ratio of viewer units to meter unitsOVRViewScaleDescHmdSpaceToWorldScaleInMeters(float value)Sets the specified value to theHmdSpaceToWorldScaleInMeters()field.OVRPosef.BufferHmdToEyePose()transform of each eye from the HMD center, in metersOVRPosefHmdToEyePose(int index)transform of each eye from the HMD center, in metersOVRViewScaleDescHmdToEyePose(int index, java.util.function.Consumer<OVRPosef> consumer)OVRViewScaleDescHmdToEyePose(int index, OVRPosef value)Copies the specifiedOVRPosefat the specified index of theHmdToEyePose()field.OVRViewScaleDescHmdToEyePose(java.util.function.Consumer<OVRPosef.Buffer> consumer)Passes theHmdToEyePose()field to the specifiedConsumer.OVRViewScaleDescHmdToEyePose(OVRPosef.Buffer value)Copies the specifiedOVRPosef.Bufferto theHmdToEyePose()field.static OVRViewScaleDescmalloc()Returns a newOVRViewScaleDescinstance allocated withmemAlloc.static OVRViewScaleDesc.Buffermalloc(int capacity)Returns a newOVRViewScaleDesc.Bufferinstance allocated withmemAlloc.static OVRViewScaleDesc.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRViewScaleDesc.Bufferinstance allocated on the specifiedMemoryStack.static OVRViewScaleDescmalloc(org.lwjgl.system.MemoryStack stack)Returns a newOVRViewScaleDescinstance allocated on the specifiedMemoryStack.static OVRViewScaleDescmallocStack()Deprecated.static OVRViewScaleDesc.BuffermallocStack(int capacity)Deprecated.static OVRViewScaleDesc.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static OVRViewScaleDescmallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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() public OVRPosef HmdToEyePose(int index)
transform of each eye from the HMD center, in meters
-
HmdSpaceToWorldScaleInMeters
public float HmdSpaceToWorldScaleInMeters()
ratio of viewer units to meter units
-
HmdToEyePose
public OVRViewScaleDesc HmdToEyePose(OVRPosef.Buffer value)
Copies the specifiedOVRPosef.Bufferto theHmdToEyePose()field.
-
HmdToEyePose
public OVRViewScaleDesc HmdToEyePose(int index, OVRPosef value)
Copies the specifiedOVRPosefat the specified index of theHmdToEyePose()field.
-
HmdToEyePose
public OVRViewScaleDesc HmdToEyePose(java.util.function.Consumer<OVRPosef.Buffer> consumer)
Passes theHmdToEyePose()field to the specifiedConsumer.
-
HmdToEyePose
public OVRViewScaleDesc HmdToEyePose(int index, java.util.function.Consumer<OVRPosef> consumer)
-
HmdSpaceToWorldScaleInMeters
public OVRViewScaleDesc HmdSpaceToWorldScaleInMeters(float value)
Sets the specified value to theHmdSpaceToWorldScaleInMeters()field.
-
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
@Deprecated public static OVRViewScaleDesc mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static OVRViewScaleDesc callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static OVRViewScaleDesc mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static OVRViewScaleDesc callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static OVRViewScaleDesc.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static OVRViewScaleDesc.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static OVRViewScaleDesc.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static OVRViewScaleDesc.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static OVRViewScaleDesc malloc(org.lwjgl.system.MemoryStack stack)
Returns a newOVRViewScaleDescinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static OVRViewScaleDesc calloc(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
-
malloc
public static OVRViewScaleDesc.Buffer malloc(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
-
calloc
public static OVRViewScaleDesc.Buffer calloc(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.
-
-