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, NativeResource, Pointer
public class OVRViewScaleDesc extends Struct
Contains the data necessary to properly calculate position info for various layer types.HmdToEyeOffset
is the same value pair provided inOVREyeRenderDesc
.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
HmdToEyeOffset
– translation of each eyeHmdSpaceToWorldScaleInMeters
– ratio of viewer units to meter units
Layout
struct ovrViewScaleDesc {
ovrVector3f
[2] HmdToEyeOffset; float HmdSpaceToWorldScaleInMeters; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
OVRViewScaleDesc.Buffer
An array ofOVRViewScaleDesc
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 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 and 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, MemoryStack stack)
Returns a newOVRViewScaleDesc.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRViewScaleDesc
callocStack(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 ornull
if the address isNULL
.static OVRViewScaleDesc.Buffer
create(long address, int capacity)
Create aOVRViewScaleDesc.Buffer
instance at the specified memory.float
HmdSpaceToWorldScaleInMeters()
Returns the value of theHmdSpaceToWorldScaleInMeters
field.OVRViewScaleDesc
HmdSpaceToWorldScaleInMeters(float value)
Sets the specified value to theHmdSpaceToWorldScaleInMeters
field.OVRVector3f.Buffer
HmdToEyeOffset()
Returns aOVRVector3f
.Buffer view of theHmdToEyeOffset
field.OVRVector3f
HmdToEyeOffset(int index)
Returns aOVRVector3f
view of the struct at the specified index of theHmdToEyeOffset
field.OVRViewScaleDesc
HmdToEyeOffset(int index, OVRVector3f value)
Copies the specifiedOVRVector3f
at the specified index of theHmdToEyeOffset
field.OVRViewScaleDesc
HmdToEyeOffset(OVRVector3f.Buffer value)
Copies the specifiedOVRVector3f.Buffer
to theHmdToEyeOffset
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, MemoryStack stack)
Returns a newOVRViewScaleDesc.Buffer
instance allocated on the specifiedMemoryStack
.static OVRViewScaleDesc
mallocStack(MemoryStack stack)
Returns a newOVRViewScaleDesc
instance allocated on the specifiedMemoryStack
.OVRViewScaleDesc
nset(long struct)
Unsafe version ofset
.OVRViewScaleDesc
set(OVRVector3f.Buffer HmdToEyeOffset, float HmdSpaceToWorldScaleInMeters)
Initializes this struct with the specified values.OVRViewScaleDesc
set(OVRViewScaleDesc src)
Copies the specified struct data to this struct.int
sizeof()
Returns thesizeof(struct)
.-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
-
-
-
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()
Description copied from class:Struct
Returns thesizeof(struct)
.
-
HmdToEyeOffset
public OVRVector3f.Buffer HmdToEyeOffset()
Returns aOVRVector3f
.Buffer view of theHmdToEyeOffset
field.
-
HmdToEyeOffset
public OVRVector3f HmdToEyeOffset(int index)
Returns aOVRVector3f
view of the struct at the specified index of theHmdToEyeOffset
field.
-
HmdSpaceToWorldScaleInMeters
public float HmdSpaceToWorldScaleInMeters()
Returns the value of theHmdSpaceToWorldScaleInMeters
field.
-
HmdToEyeOffset
public OVRViewScaleDesc HmdToEyeOffset(OVRVector3f.Buffer value)
Copies the specifiedOVRVector3f.Buffer
to theHmdToEyeOffset
field.
-
HmdToEyeOffset
public OVRViewScaleDesc HmdToEyeOffset(int index, OVRVector3f value)
Copies the specifiedOVRVector3f
at the specified index of theHmdToEyeOffset
field.
-
HmdSpaceToWorldScaleInMeters
public OVRViewScaleDesc HmdSpaceToWorldScaleInMeters(float value)
Sets the specified value to theHmdSpaceToWorldScaleInMeters
field.
-
set
public OVRViewScaleDesc set(OVRVector3f.Buffer HmdToEyeOffset, float HmdSpaceToWorldScaleInMeters)
Initializes this struct with the specified values.
-
nset
public OVRViewScaleDesc nset(long struct)
Unsafe version ofset
.
-
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 ornull
if the address isNULL
.
-
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
-
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(MemoryStack stack)
Returns a newOVRViewScaleDesc
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static OVRViewScaleDesc callocStack(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, 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, 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
-
-