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.NativeResource
Contains the data necessary to properly calculate position info for various layer types.HmdToEyePose
is 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.HmdSpaceToWorldScaleInMeters
is 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
HmdSpaceToWorldScaleInMeters
would 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, thenHmdSpaceToWorldScaleInMeters
would 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 {
ovrPosef
HmdToEyePose[ovrEye_Count]; float HmdSpaceToWorldScaleInMeters; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OVRViewScaleDesc.Buffer
An array ofOVRViewScaleDesc
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
HMDSPACETOWORLDSCALEINMETERS
HMDTOEYEPOSEThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description OVRViewScaleDesc(java.nio.ByteBuffer container)
Creates aOVRViewScaleDesc
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 OVRViewScaleDesc
calloc()
Returns a newOVRViewScaleDesc
instance allocated withmemCalloc
.static OVRViewScaleDesc.Buffer
calloc(int capacity)
Returns a newOVRViewScaleDesc.Buffer
instance allocated withmemCalloc
.static OVRViewScaleDesc
callocStack()
Returns a newOVRViewScaleDesc
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRViewScaleDesc.Buffer
callocStack(int capacity)
Returns a newOVRViewScaleDesc.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRViewScaleDesc.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRViewScaleDesc.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRViewScaleDesc
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRViewScaleDesc
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRViewScaleDesc
create()
Returns a newOVRViewScaleDesc
instance allocated withBufferUtils
.static OVRViewScaleDesc.Buffer
create(int capacity)
Returns a newOVRViewScaleDesc.Buffer
instance allocated withBufferUtils
.static OVRViewScaleDesc
create(long address)
Returns a newOVRViewScaleDesc
instance for the specified memory address.static OVRViewScaleDesc.Buffer
create(long address, int capacity)
Create aOVRViewScaleDesc.Buffer
instance at the specified memory.static OVRViewScaleDesc
createSafe(long address)
static OVRViewScaleDesc.Buffer
createSafe(long address, int capacity)
float
HmdSpaceToWorldScaleInMeters()
Returns the value of theHmdSpaceToWorldScaleInMeters
field.OVRViewScaleDesc
HmdSpaceToWorldScaleInMeters(float value)
Sets the specified value to theHmdSpaceToWorldScaleInMeters
field.OVRPosef.Buffer
HmdToEyePose()
Returns aOVRPosef
.Buffer view of theHmdToEyePose
field.OVRPosef
HmdToEyePose(int index)
Returns aOVRPosef
view of the struct at the specified index of theHmdToEyePose
field.OVRViewScaleDesc
HmdToEyePose(int index, java.util.function.Consumer<OVRPosef> consumer)
Passes the element atindex
of theHmdToEyePose
field to the specifiedConsumer
.OVRViewScaleDesc
HmdToEyePose(int index, OVRPosef value)
Copies the specifiedOVRPosef
at the specified index of theHmdToEyePose
field.OVRViewScaleDesc
HmdToEyePose(java.util.function.Consumer<OVRPosef.Buffer> consumer)
Passes theHmdToEyePose
field to the specifiedConsumer
.OVRViewScaleDesc
HmdToEyePose(OVRPosef.Buffer value)
Copies the specifiedOVRPosef.Buffer
to theHmdToEyePose
field.static OVRViewScaleDesc
malloc()
Returns a newOVRViewScaleDesc
instance allocated withmemAlloc
.static OVRViewScaleDesc.Buffer
malloc(int capacity)
Returns a newOVRViewScaleDesc.Buffer
instance allocated withmemAlloc
.static OVRViewScaleDesc
mallocStack()
Returns a newOVRViewScaleDesc
instance allocated on the thread-localMemoryStack
.static OVRViewScaleDesc.Buffer
mallocStack(int capacity)
Returns a newOVRViewScaleDesc.Buffer
instance allocated on the thread-localMemoryStack
.static OVRViewScaleDesc.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRViewScaleDesc.Buffer
instance allocated on the specifiedMemoryStack
.static OVRViewScaleDesc
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRViewScaleDesc
instance allocated on the specifiedMemoryStack
.static float
nHmdSpaceToWorldScaleInMeters(long struct)
Unsafe version ofHmdSpaceToWorldScaleInMeters()
.static void
nHmdSpaceToWorldScaleInMeters(long struct, float value)
Unsafe version ofHmdSpaceToWorldScaleInMeters
.static OVRPosef.Buffer
nHmdToEyePose(long struct)
Unsafe version ofHmdToEyePose()
.static OVRPosef
nHmdToEyePose(long struct, int index)
Unsafe version ofHmdToEyePose
.static void
nHmdToEyePose(long struct, int index, OVRPosef value)
Unsafe version ofHmdToEyePose
.static void
nHmdToEyePose(long struct, OVRPosef.Buffer value)
Unsafe version ofHmdToEyePose
.OVRViewScaleDesc
set(OVRPosef.Buffer HmdToEyePose, float HmdSpaceToWorldScaleInMeters)
Initializes this struct with the specified values.OVRViewScaleDesc
set(OVRViewScaleDesc src)
Copies the specified struct data to this struct.int
sizeof()
-
-
-
Constructor Detail
-
OVRViewScaleDesc
public OVRViewScaleDesc(java.nio.ByteBuffer container)
Creates aOVRViewScaleDesc
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
-
HmdToEyePose
public OVRPosef.Buffer HmdToEyePose()
Returns aOVRPosef
.Buffer view of theHmdToEyePose
field.
-
HmdToEyePose
public OVRPosef HmdToEyePose(int index)
Returns aOVRPosef
view of the struct at the specified index of theHmdToEyePose
field.
-
HmdSpaceToWorldScaleInMeters
public float HmdSpaceToWorldScaleInMeters()
Returns the value of theHmdSpaceToWorldScaleInMeters
field.
-
HmdToEyePose
public OVRViewScaleDesc HmdToEyePose(OVRPosef.Buffer value)
Copies the specifiedOVRPosef.Buffer
to theHmdToEyePose
field.
-
HmdToEyePose
public OVRViewScaleDesc HmdToEyePose(int index, OVRPosef value)
Copies the specifiedOVRPosef
at 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)
Passes the element atindex
of theHmdToEyePose
field to the specifiedConsumer
.
-
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 newOVRViewScaleDesc
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static OVRViewScaleDesc calloc()
Returns a newOVRViewScaleDesc
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static OVRViewScaleDesc create()
Returns a newOVRViewScaleDesc
instance allocated withBufferUtils
.
-
create
public static OVRViewScaleDesc create(long address)
Returns a newOVRViewScaleDesc
instance for the specified memory address.
-
createSafe
@Nullable public static OVRViewScaleDesc createSafe(long address)
-
malloc
public static OVRViewScaleDesc.Buffer malloc(int capacity)
Returns a newOVRViewScaleDesc.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static OVRViewScaleDesc.Buffer calloc(int capacity)
Returns a newOVRViewScaleDesc.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRViewScaleDesc.Buffer create(int capacity)
Returns a newOVRViewScaleDesc.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRViewScaleDesc.Buffer create(long address, int capacity)
Create aOVRViewScaleDesc.Buffer
instance 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 newOVRViewScaleDesc
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static OVRViewScaleDesc callocStack()
Returns a newOVRViewScaleDesc
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static OVRViewScaleDesc mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRViewScaleDesc
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static OVRViewScaleDesc callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRViewScaleDesc
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static OVRViewScaleDesc.Buffer callocStack(int capacity)
Returns a newOVRViewScaleDesc.Buffer
instance allocated on the thread-localMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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
.
-
-