Package org.lwjgl.openvr
Class VRControllerState
java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VRControllerState>
org.lwjgl.openvr.VRControllerState
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class VRControllerState
extends org.lwjgl.system.Struct<VRControllerState>
implements org.lwjgl.system.NativeResource
Holds all the state of a controller at one moment in time.
Layout
struct VRControllerState_t {
uint32_t unPacketNum();
uint64_t ulButtonPressed();
uint64_t ulButtonTouched;
VRControllerAxis_t rAxis()[5];
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionVRControllerState(ByteBuffer container) Creates aVRControllerStateinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 VRControllerStateDeprecated.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 @Nullable VRControllerStatecreateSafe(long address) static @Nullable 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 VRControllerStateDeprecated.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.rAxis()axis data for the controller's analog inputsrAxis(int index) axis data for the controller's analog inputsrAxis(int index, Consumer<VRControllerAxis> consumer) rAxis(int index, VRControllerAxis value) Copies the specifiedVRControllerAxisat the specified index of therAxis()field.rAxis(Consumer<VRControllerAxis.Buffer> consumer) rAxis(VRControllerAxis.Buffer value) Copies the specifiedVRControllerAxis.Bufferto therAxis()field.set(int unPacketNum, long ulButtonPressed, long ulButtonTouched, VRControllerAxis.Buffer rAxis) Initializes this struct with the specified values.set(VRControllerState src) Copies the specified struct data to this struct.intsizeof()longbit flags for each of the buttons.ulButtonPressed(long value) Sets the specified value to theulButtonPressed()field.longulButtonTouched(long value) Sets the specified value to theulButtonTouchedfield.intIf 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.unPacketNum(int value) Sets the specified value to theunPacketNum()field.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
UNPACKETNUM
public static final int UNPACKETNUMThe struct member offsets. -
ULBUTTONPRESSED
public static final int ULBUTTONPRESSEDThe struct member offsets. -
ULBUTTONTOUCHED
public static final int ULBUTTONTOUCHEDThe struct member offsets. -
RAXIS
public static final int RAXISThe struct member offsets.
-
-
Constructor Details
-
VRControllerState
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 Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct<VRControllerState>
-
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
axis data for the controller's analog inputs -
rAxis
axis data for the controller's analog inputs -
unPacketNum
Sets the specified value to theunPacketNum()field. -
ulButtonPressed
Sets the specified value to theulButtonPressed()field. -
ulButtonTouched
Sets the specified value to theulButtonTouchedfield. -
rAxis
Copies the specifiedVRControllerAxis.Bufferto therAxis()field. -
rAxis
Copies the specifiedVRControllerAxisat the specified index of therAxis()field. -
rAxis
-
rAxis
-
set
public VRControllerState set(int unPacketNum, long ulButtonPressed, long ulButtonTouched, VRControllerAxis.Buffer rAxis) Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newVRControllerStateinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newVRControllerStateinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newVRControllerStateinstance allocated withBufferUtils. -
create
Returns a newVRControllerStateinstance for the specified memory address. -
createSafe
-
malloc
Returns a newVRControllerState.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newVRControllerState.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newVRControllerState.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aVRControllerState.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
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
Returns a newVRControllerStateinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newVRControllerStateinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newVRControllerState.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newVRControllerState.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
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
Unsafe version ofrAxis(). -
nrAxis
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
Unsafe version ofrAxis. -
nrAxis
Unsafe version ofrAxis.
-