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.NativeResourceHolds 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. UseButtonMaskFromIdto 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_trAxis[5]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVRControllerState.BufferAn array ofVRControllerStatestructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intRAXISThe struct member offsets.static intSIZEOFThe struct size in bytes.static intULBUTTONPRESSED
ULBUTTONTOUCHED
UNPACKETNUMThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description VRControllerState(java.nio.ByteBuffer container)Creates aVRControllerStateinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VRControllerStatecalloc()Returns a newVRControllerStateinstance allocated withmemCalloc.static VRControllerState.Buffercalloc(int capacity)Returns a newVRControllerState.Bufferinstance allocated withmemCalloc.static VRControllerStatecallocStack()Returns a newVRControllerStateinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VRControllerState.BuffercallocStack(int capacity)Returns a newVRControllerState.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VRControllerState.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVRControllerState.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VRControllerStatecallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVRControllerStateinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VRControllerStatecreate()Returns a newVRControllerStateinstance allocated withBufferUtils.static VRControllerState.Buffercreate(int capacity)Returns a newVRControllerState.Bufferinstance allocated withBufferUtils.static VRControllerStatecreate(long address)Returns a newVRControllerStateinstance for the specified memory address.static VRControllerState.Buffercreate(long address, int capacity)Create aVRControllerState.Bufferinstance at the specified memory.static VRControllerStatecreateSafe(long address)static VRControllerState.BuffercreateSafe(long address, int capacity)static VRControllerStatemalloc()Returns a newVRControllerStateinstance allocated withmemAlloc.static VRControllerState.Buffermalloc(int capacity)Returns a newVRControllerState.Bufferinstance allocated withmemAlloc.static VRControllerStatemallocStack()Returns a newVRControllerStateinstance allocated on the thread-localMemoryStack.static VRControllerState.BuffermallocStack(int capacity)Returns a newVRControllerState.Bufferinstance allocated on the thread-localMemoryStack.static VRControllerState.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVRControllerState.Bufferinstance allocated on the specifiedMemoryStack.static VRControllerStatemallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVRControllerStateinstance allocated on the specifiedMemoryStack.static VRControllerAxis.BuffernrAxis(long struct)Unsafe version ofrAxis().static VRControllerAxisnrAxis(long struct, int index)Unsafe version ofrAxis.static voidnrAxis(long struct, int index, VRControllerAxis value)Unsafe version ofrAxis.static voidnrAxis(long struct, VRControllerAxis.Buffer value)Unsafe version ofrAxis.static longnulButtonPressed(long struct)Unsafe version ofulButtonPressed().static voidnulButtonPressed(long struct, long value)Unsafe version ofulButtonPressed.static longnulButtonTouched(long struct)Unsafe version ofulButtonTouched().static voidnulButtonTouched(long struct, long value)Unsafe version ofulButtonTouched.static intnunPacketNum(long struct)Unsafe version ofunPacketNum().static voidnunPacketNum(long struct, int value)Unsafe version ofunPacketNum.VRControllerAxis.BufferrAxis()Returns aVRControllerAxis.Buffer view of therAxisfield.VRControllerAxisrAxis(int index)Returns aVRControllerAxisview of the struct at the specified index of therAxisfield.VRControllerStaterAxis(int index, java.util.function.Consumer<VRControllerAxis> consumer)Passes the element atindexof therAxisfield to the specifiedConsumer.VRControllerStaterAxis(int index, VRControllerAxis value)Copies the specifiedVRControllerAxisat the specified index of therAxisfield.VRControllerStaterAxis(java.util.function.Consumer<VRControllerAxis.Buffer> consumer)Passes therAxisfield to the specifiedConsumer.VRControllerStaterAxis(VRControllerAxis.Buffer value)Copies the specifiedVRControllerAxis.Bufferto therAxisfield.VRControllerStateset(int unPacketNum, long ulButtonPressed, long ulButtonTouched, VRControllerAxis.Buffer rAxis)Initializes this struct with the specified values.VRControllerStateset(VRControllerState src)Copies the specified struct data to this struct.intsizeof()longulButtonPressed()Returns the value of theulButtonPressedfield.VRControllerStateulButtonPressed(long value)Sets the specified value to theulButtonPressedfield.longulButtonTouched()Returns the value of theulButtonTouchedfield.VRControllerStateulButtonTouched(long value)Sets the specified value to theulButtonTouchedfield.intunPacketNum()Returns the value of theunPacketNumfield.VRControllerStateunPacketNum(int value)Sets the specified value to theunPacketNumfield.
-
-
-
Constructor Detail
-
VRControllerState
public VRControllerState(java.nio.ByteBuffer container)
Creates aVRControllerStateinstance 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
-
unPacketNum
public int unPacketNum()
Returns the value of theunPacketNumfield.
-
ulButtonPressed
public long ulButtonPressed()
Returns the value of theulButtonPressedfield.
-
ulButtonTouched
public long ulButtonTouched()
Returns the value of theulButtonTouchedfield.
-
rAxis
public VRControllerAxis.Buffer rAxis()
Returns aVRControllerAxis.Buffer view of therAxisfield.
-
rAxis
public VRControllerAxis rAxis(int index)
Returns aVRControllerAxisview of the struct at the specified index of therAxisfield.
-
unPacketNum
public VRControllerState unPacketNum(int value)
Sets the specified value to theunPacketNumfield.
-
ulButtonPressed
public VRControllerState ulButtonPressed(long value)
Sets the specified value to theulButtonPressedfield.
-
ulButtonTouched
public VRControllerState ulButtonTouched(long value)
Sets the specified value to theulButtonTouchedfield.
-
rAxis
public VRControllerState rAxis(VRControllerAxis.Buffer value)
Copies the specifiedVRControllerAxis.Bufferto therAxisfield.
-
rAxis
public VRControllerState rAxis(int index, VRControllerAxis value)
Copies the specifiedVRControllerAxisat the specified index of therAxisfield.
-
rAxis
public VRControllerState rAxis(java.util.function.Consumer<VRControllerAxis.Buffer> consumer)
Passes therAxisfield to the specifiedConsumer.
-
rAxis
public VRControllerState rAxis(int index, java.util.function.Consumer<VRControllerAxis> consumer)
Passes the element atindexof therAxisfield 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 newVRControllerStateinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VRControllerState calloc()
Returns a newVRControllerStateinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VRControllerState create()
Returns a newVRControllerStateinstance allocated withBufferUtils.
-
create
public static VRControllerState create(long address)
Returns a newVRControllerStateinstance for the specified memory address.
-
createSafe
@Nullable public static VRControllerState createSafe(long address)
-
malloc
public static VRControllerState.Buffer malloc(int capacity)
Returns a newVRControllerState.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VRControllerState.Buffer calloc(int capacity)
Returns a newVRControllerState.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VRControllerState.Buffer create(int capacity)
Returns a newVRControllerState.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VRControllerState.Buffer create(long address, int capacity)
Create aVRControllerState.Bufferinstance 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 newVRControllerStateinstance allocated on the thread-localMemoryStack.
-
callocStack
public static VRControllerState callocStack()
Returns a newVRControllerStateinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VRControllerState mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVRControllerStateinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VRControllerState callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVRControllerStateinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VRControllerState.Buffer callocStack(int capacity)
Returns a newVRControllerState.Bufferinstance allocated on the thread-localMemoryStackand 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.Bufferinstance 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.Bufferinstance allocated on the specifiedMemoryStackand 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.
-
-