Package org.lwjgl.openvr
Class VRControllerState
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.openvr.VRControllerState
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VRControllerState extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Holds all the state of a controller at one moment in time.Member documentation
unPacketNum
– If packet num matches that on your prior call, then the controller state hasn't been changed since your last call and there is no need to process it.ulButtonPressed
– bit flags for each of the buttons. UseButtonMaskFromId
to turn an ID into a maskrAxis[5]
– axis data for the controller's analog inputs
Layout
struct VRControllerState_t { uint32_t unPacketNum; uint64_t ulButtonPressed; uint64_t ulButtonTouched;
VRControllerAxis_t
rAxis[5]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VRControllerState.Buffer
An array ofVRControllerState
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
RAXIS
The struct member offsets.static int
SIZEOF
The struct size in bytes.static int
ULBUTTONPRESSED
ULBUTTONTOUCHED
UNPACKETNUMThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VRControllerState(java.nio.ByteBuffer container)
Creates aVRControllerState
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 VRControllerState
calloc()
Returns a newVRControllerState
instance allocated withmemCalloc
.static VRControllerState.Buffer
calloc(int capacity)
Returns a newVRControllerState.Buffer
instance allocated withmemCalloc
.static VRControllerState
callocStack()
Returns a newVRControllerState
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VRControllerState.Buffer
callocStack(int capacity)
Returns a newVRControllerState.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VRControllerState.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVRControllerState.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VRControllerState
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVRControllerState
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VRControllerState
create()
Returns a newVRControllerState
instance allocated withBufferUtils
.static VRControllerState.Buffer
create(int capacity)
Returns a newVRControllerState.Buffer
instance allocated withBufferUtils
.static VRControllerState
create(long address)
Returns a newVRControllerState
instance for the specified memory address.static VRControllerState.Buffer
create(long address, int capacity)
Create aVRControllerState.Buffer
instance at the specified memory.static VRControllerState
createSafe(long address)
static VRControllerState.Buffer
createSafe(long address, int capacity)
static VRControllerState
malloc()
Returns a newVRControllerState
instance allocated withmemAlloc
.static VRControllerState.Buffer
malloc(int capacity)
Returns a newVRControllerState.Buffer
instance allocated withmemAlloc
.static VRControllerState
mallocStack()
Returns a newVRControllerState
instance allocated on the thread-localMemoryStack
.static VRControllerState.Buffer
mallocStack(int capacity)
Returns a newVRControllerState.Buffer
instance allocated on the thread-localMemoryStack
.static VRControllerState.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVRControllerState.Buffer
instance allocated on the specifiedMemoryStack
.static VRControllerState
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVRControllerState
instance allocated on the specifiedMemoryStack
.static VRControllerAxis.Buffer
nrAxis(long struct)
Unsafe version ofrAxis()
.static VRControllerAxis
nrAxis(long struct, int index)
Unsafe version ofrAxis
.static void
nrAxis(long struct, int index, VRControllerAxis value)
Unsafe version ofrAxis
.static void
nrAxis(long struct, VRControllerAxis.Buffer value)
Unsafe version ofrAxis
.static long
nulButtonPressed(long struct)
Unsafe version ofulButtonPressed()
.static void
nulButtonPressed(long struct, long value)
Unsafe version ofulButtonPressed
.static long
nulButtonTouched(long struct)
Unsafe version ofulButtonTouched()
.static void
nulButtonTouched(long struct, long value)
Unsafe version ofulButtonTouched
.static int
nunPacketNum(long struct)
Unsafe version ofunPacketNum()
.static void
nunPacketNum(long struct, int value)
Unsafe version ofunPacketNum
.VRControllerAxis.Buffer
rAxis()
Returns aVRControllerAxis
.Buffer view of therAxis
field.VRControllerAxis
rAxis(int index)
Returns aVRControllerAxis
view of the struct at the specified index of therAxis
field.VRControllerState
rAxis(int index, java.util.function.Consumer<VRControllerAxis> consumer)
Passes the element atindex
of therAxis
field to the specifiedConsumer
.VRControllerState
rAxis(int index, VRControllerAxis value)
Copies the specifiedVRControllerAxis
at the specified index of therAxis
field.VRControllerState
rAxis(java.util.function.Consumer<VRControllerAxis.Buffer> consumer)
Passes therAxis
field to the specifiedConsumer
.VRControllerState
rAxis(VRControllerAxis.Buffer value)
Copies the specifiedVRControllerAxis.Buffer
to therAxis
field.VRControllerState
set(int unPacketNum, long ulButtonPressed, long ulButtonTouched, VRControllerAxis.Buffer rAxis)
Initializes this struct with the specified values.VRControllerState
set(VRControllerState src)
Copies the specified struct data to this struct.int
sizeof()
long
ulButtonPressed()
Returns the value of theulButtonPressed
field.VRControllerState
ulButtonPressed(long value)
Sets the specified value to theulButtonPressed
field.long
ulButtonTouched()
Returns the value of theulButtonTouched
field.VRControllerState
ulButtonTouched(long value)
Sets the specified value to theulButtonTouched
field.int
unPacketNum()
Returns the value of theunPacketNum
field.VRControllerState
unPacketNum(int value)
Sets the specified value to theunPacketNum
field.
-
-
-
Constructor Detail
-
VRControllerState
public VRControllerState(java.nio.ByteBuffer container)
Creates aVRControllerState
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
-
unPacketNum
public int unPacketNum()
Returns the value of theunPacketNum
field.
-
ulButtonPressed
public long ulButtonPressed()
Returns the value of theulButtonPressed
field.
-
ulButtonTouched
public long ulButtonTouched()
Returns the value of theulButtonTouched
field.
-
rAxis
public VRControllerAxis.Buffer rAxis()
Returns aVRControllerAxis
.Buffer view of therAxis
field.
-
rAxis
public VRControllerAxis rAxis(int index)
Returns aVRControllerAxis
view of the struct at the specified index of therAxis
field.
-
unPacketNum
public VRControllerState unPacketNum(int value)
Sets the specified value to theunPacketNum
field.
-
ulButtonPressed
public VRControllerState ulButtonPressed(long value)
Sets the specified value to theulButtonPressed
field.
-
ulButtonTouched
public VRControllerState ulButtonTouched(long value)
Sets the specified value to theulButtonTouched
field.
-
rAxis
public VRControllerState rAxis(VRControllerAxis.Buffer value)
Copies the specifiedVRControllerAxis.Buffer
to therAxis
field.
-
rAxis
public VRControllerState rAxis(int index, VRControllerAxis value)
Copies the specifiedVRControllerAxis
at the specified index of therAxis
field.
-
rAxis
public VRControllerState rAxis(java.util.function.Consumer<VRControllerAxis.Buffer> consumer)
Passes therAxis
field to the specifiedConsumer
.
-
rAxis
public VRControllerState rAxis(int index, java.util.function.Consumer<VRControllerAxis> consumer)
Passes the element atindex
of therAxis
field to the specifiedConsumer
.
-
set
public VRControllerState set(int unPacketNum, long ulButtonPressed, long ulButtonTouched, VRControllerAxis.Buffer rAxis)
Initializes this struct with the specified values.
-
set
public VRControllerState set(VRControllerState src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VRControllerState malloc()
Returns a newVRControllerState
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VRControllerState calloc()
Returns a newVRControllerState
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VRControllerState create()
Returns a newVRControllerState
instance allocated withBufferUtils
.
-
create
public static VRControllerState create(long address)
Returns a newVRControllerState
instance for the specified memory address.
-
createSafe
@Nullable public static VRControllerState createSafe(long address)
-
malloc
public static VRControllerState.Buffer malloc(int capacity)
Returns a newVRControllerState.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VRControllerState.Buffer calloc(int capacity)
Returns a newVRControllerState.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VRControllerState.Buffer create(int capacity)
Returns a newVRControllerState.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VRControllerState.Buffer create(long address, int capacity)
Create aVRControllerState.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VRControllerState.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VRControllerState mallocStack()
Returns a newVRControllerState
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VRControllerState callocStack()
Returns a newVRControllerState
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VRControllerState mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVRControllerState
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VRControllerState callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVRControllerState
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VRControllerState.Buffer mallocStack(int capacity)
Returns a newVRControllerState.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VRControllerState.Buffer callocStack(int capacity)
Returns a newVRControllerState.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VRControllerState.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVRControllerState.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VRControllerState.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVRControllerState.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nunPacketNum
public static int nunPacketNum(long struct)
Unsafe version ofunPacketNum()
.
-
nulButtonPressed
public static long nulButtonPressed(long struct)
Unsafe version ofulButtonPressed()
.
-
nulButtonTouched
public static long nulButtonTouched(long struct)
Unsafe version ofulButtonTouched()
.
-
nrAxis
public static VRControllerAxis.Buffer nrAxis(long struct)
Unsafe version ofrAxis()
.
-
nrAxis
public static VRControllerAxis nrAxis(long struct, int index)
Unsafe version ofrAxis
.
-
nunPacketNum
public static void nunPacketNum(long struct, int value)
Unsafe version ofunPacketNum
.
-
nulButtonPressed
public static void nulButtonPressed(long struct, long value)
Unsafe version ofulButtonPressed
.
-
nulButtonTouched
public static void nulButtonTouched(long struct, long value)
Unsafe version ofulButtonTouched
.
-
nrAxis
public static void nrAxis(long struct, VRControllerAxis.Buffer value)
Unsafe version ofrAxis
.
-
nrAxis
public static void nrAxis(long struct, int index, VRControllerAxis value)
Unsafe version ofrAxis
.
-
-