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.Layout
struct VRControllerState_t { uint32_tunPacketNum(); uint64_tulButtonPressed(); 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 Deprecated 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 VRControllerState.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVRControllerState.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VRControllerStatecalloc(org.lwjgl.system.MemoryStack stack)Returns a newVRControllerStateinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VRControllerStatecallocStack()Deprecated.static VRControllerState.BuffercallocStack(int capacity)Deprecated.static VRControllerState.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static VRControllerStatecallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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 VRControllerState.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newVRControllerState.Bufferinstance allocated on the specifiedMemoryStack.static VRControllerStatemalloc(org.lwjgl.system.MemoryStack stack)Returns a newVRControllerStateinstance allocated on the specifiedMemoryStack.static VRControllerStatemallocStack()Deprecated.static VRControllerState.BuffermallocStack(int capacity)Deprecated.static VRControllerState.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static VRControllerStatemallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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()axis data for the controller's analog inputsVRControllerAxisrAxis(int index)axis data for the controller's analog inputsVRControllerStaterAxis(int index, java.util.function.Consumer<VRControllerAxis> consumer)VRControllerStaterAxis(int index, VRControllerAxis value)Copies the specifiedVRControllerAxisat the specified index of therAxis()field.VRControllerStaterAxis(java.util.function.Consumer<VRControllerAxis.Buffer> consumer)Passes therAxis()field to the specifiedConsumer.VRControllerStaterAxis(VRControllerAxis.Buffer value)Copies the specifiedVRControllerAxis.Bufferto therAxis()field.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()bit flags for each of the buttons.VRControllerStateulButtonPressed(long value)Sets the specified value to theulButtonPressed()field.longulButtonTouched()VRControllerStateulButtonTouched(long value)Sets the specified value to theulButtonTouchedfield.intunPacketNum()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.VRControllerStateunPacketNum(int value)Sets the specified value to theunPacketNum()field.
-
-
-
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()
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
public long ulButtonPressed()
bit flags for each of the buttons. UseButtonMaskFromIdto turn an ID into a mask
-
ulButtonTouched
public long ulButtonTouched()
- Returns:
- the value of the
ulButtonTouchedfield.
-
rAxis
public VRControllerAxis.Buffer rAxis() public VRControllerAxis rAxis(int index)
axis data for the controller's analog inputs
-
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 theulButtonTouchedfield.
-
rAxis
public VRControllerState rAxis(VRControllerAxis.Buffer value)
Copies the specifiedVRControllerAxis.Bufferto therAxis()field.
-
rAxis
public VRControllerState rAxis(int index, VRControllerAxis value)
Copies the specifiedVRControllerAxisat 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)
-
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
@Deprecated public static VRControllerState mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VRControllerState callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static VRControllerState mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VRControllerState callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static VRControllerState.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static VRControllerState.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static VRControllerState.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 VRControllerState.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static VRControllerState malloc(org.lwjgl.system.MemoryStack stack)
Returns a newVRControllerStateinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static VRControllerState calloc(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
-
malloc
public static VRControllerState.Buffer malloc(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
-
calloc
public static VRControllerState.Buffer calloc(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.
-
-