Package org.lwjgl.ovr
Class OVRInputState
- All Implemented Interfaces:
AutoCloseable
,NativeResource
,Pointer
Describes the complete controller input state, including Oculus Touch, and XBox gamepad. If multiple inputs are connected and used at the same time,
their inputs are combined.
Layout
struct ovrInputState {
double TimeInSeconds()
;
unsigned int Buttons()
;
unsigned int Touches()
;
float IndexTrigger()
[ovrHand_Count];
float HandTrigger()
[ovrHand_Count];
ovrVector2f
Thumbstick()
[ovrHand_Count];
ovrControllerType ControllerType()
;
float IndexTriggerNoDeadzone()
[ovrHand_Count];
float HandTriggerNoDeadzone()
[ovrHand_Count];
ovrVector2f
ThumbstickNoDeadzone()
[ovrHand_Count];
float IndexTriggerRaw()
[ovrHand_Count];
float HandTriggerRaw()
[ovrHand_Count];
ovrVector2f
ThumbstickRaw()
[ovrHand_Count];
}
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The struct alignment in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct size in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
Constructor Summary
ConstructorDescriptionOVRInputState
(ByteBuffer container) Creates aOVRInputState
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionint
Buttons()
values for buttons described byovrButton
static OVRInputState
calloc()
Returns a newOVRInputState
instance allocated withmemCalloc
.static OVRInputState.Buffer
calloc
(int capacity) Returns a newOVRInputState.Buffer
instance allocated withmemCalloc
.static OVRInputState.Buffer
calloc
(int capacity, MemoryStack stack) Returns a newOVRInputState.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRInputState
calloc
(MemoryStack stack) Returns a newOVRInputState
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRInputState
Deprecated.static OVRInputState.Buffer
callocStack
(int capacity) Deprecated.static OVRInputState.Buffer
callocStack
(int capacity, MemoryStack stack) Deprecated.static OVRInputState
callocStack
(MemoryStack stack) Deprecated.int
The type of the controller this state is for.static OVRInputState
create()
Returns a newOVRInputState
instance allocated withBufferUtils
.static OVRInputState.Buffer
create
(int capacity) Returns a newOVRInputState.Buffer
instance allocated withBufferUtils
.static OVRInputState
create
(long address) Returns a newOVRInputState
instance for the specified memory address.static OVRInputState.Buffer
create
(long address, int capacity) Create aOVRInputState.Buffer
instance at the specified memory.static OVRInputState
createSafe
(long address) static OVRInputState.Buffer
createSafe
(long address, int capacity) left and right hand trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f.float
HandTrigger
(int index) left and right hand trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f.Left and right hand trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f.float
HandTriggerNoDeadzone
(int index) Left and right hand trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f.Left and right hand trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f.float
HandTriggerRaw
(int index) Left and right hand trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f.left and right finger trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f.float
IndexTrigger
(int index) left and right finger trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f.Left and right finger trigger values (Hand_Left
andHand_Right
), in range 0.0 to 1.0f.float
IndexTriggerNoDeadzone
(int index) Left and right finger trigger values (Hand_Left
andHand_Right
), in range 0.0 to 1.0f.Left and right finger trigger values (Hand_Left
andHand_Right
), in range 0.0 to 1.0f.float
IndexTriggerRaw
(int index) Left and right finger trigger values (Hand_Left
andHand_Right
), in range 0.0 to 1.0f.static OVRInputState
malloc()
Returns a newOVRInputState
instance allocated withmemAlloc
.static OVRInputState.Buffer
malloc
(int capacity) Returns a newOVRInputState.Buffer
instance allocated withmemAlloc
.static OVRInputState.Buffer
malloc
(int capacity, MemoryStack stack) Returns a newOVRInputState.Buffer
instance allocated on the specifiedMemoryStack
.static OVRInputState
malloc
(MemoryStack stack) Returns a newOVRInputState
instance allocated on the specifiedMemoryStack
.static OVRInputState
Deprecated.static OVRInputState.Buffer
mallocStack
(int capacity) Deprecated.static OVRInputState.Buffer
mallocStack
(int capacity, MemoryStack stack) Deprecated.static OVRInputState
mallocStack
(MemoryStack stack) Deprecated.static int
nButtons
(long struct) Unsafe version ofButtons()
.static int
nControllerType
(long struct) Unsafe version ofControllerType()
.static FloatBuffer
nHandTrigger
(long struct) Unsafe version ofHandTrigger()
.static float
nHandTrigger
(long struct, int index) Unsafe version ofHandTrigger
.static FloatBuffer
nHandTriggerNoDeadzone
(long struct) Unsafe version ofHandTriggerNoDeadzone()
.static float
nHandTriggerNoDeadzone
(long struct, int index) Unsafe version ofHandTriggerNoDeadzone
.static FloatBuffer
nHandTriggerRaw
(long struct) Unsafe version ofHandTriggerRaw()
.static float
nHandTriggerRaw
(long struct, int index) Unsafe version ofHandTriggerRaw
.static FloatBuffer
nIndexTrigger
(long struct) Unsafe version ofIndexTrigger()
.static float
nIndexTrigger
(long struct, int index) Unsafe version ofIndexTrigger
.static FloatBuffer
nIndexTriggerNoDeadzone
(long struct) Unsafe version ofIndexTriggerNoDeadzone()
.static float
nIndexTriggerNoDeadzone
(long struct, int index) Unsafe version ofIndexTriggerNoDeadzone
.static FloatBuffer
nIndexTriggerRaw
(long struct) Unsafe version ofIndexTriggerRaw()
.static float
nIndexTriggerRaw
(long struct, int index) Unsafe version ofIndexTriggerRaw
.static OVRVector2f.Buffer
nThumbstick
(long struct) Unsafe version ofThumbstick()
.static OVRVector2f
nThumbstick
(long struct, int index) Unsafe version ofThumbstick
.static OVRVector2f.Buffer
nThumbstickNoDeadzone
(long struct) Unsafe version ofThumbstickNoDeadzone()
.static OVRVector2f
nThumbstickNoDeadzone
(long struct, int index) Unsafe version ofThumbstickNoDeadzone
.static OVRVector2f.Buffer
nThumbstickRaw
(long struct) Unsafe version ofThumbstickRaw()
.static OVRVector2f
nThumbstickRaw
(long struct, int index) Unsafe version ofThumbstickRaw
.static double
nTimeInSeconds
(long struct) Unsafe version ofTimeInSeconds()
.static int
nTouches
(long struct) Unsafe version ofTouches()
.int
sizeof()
Returnssizeof(struct)
.horizontal and vertical thumbstick axis values (Hand_Left
andHand_Right
), in the range -1.0f to 1.0f.Thumbstick
(int index) horizontal and vertical thumbstick axis values (Hand_Left
andHand_Right
), in the range -1.0f to 1.0f.Horizontal and vertical thumbstick axis values (Hand_Left
andHand_Right
), in the range -1.0f to 1.0f.ThumbstickNoDeadzone
(int index) Horizontal and vertical thumbstick axis values (Hand_Left
andHand_Right
), in the range -1.0f to 1.0f.Horizontal and vertical thumbstick axis values (Hand_Left
andHand_Right
), in range -1.0f to 1.0f.ThumbstickRaw
(int index) Horizontal and vertical thumbstick axis values (Hand_Left
andHand_Right
), in range -1.0f to 1.0f.double
system type when the controller state was last updatedint
Touches()
touch values for buttons and sensors as described byovrTouch
.Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
Methods 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. -
TIMEINSECONDS
public static final int TIMEINSECONDSThe struct member offsets. -
BUTTONS
public static final int BUTTONSThe struct member offsets. -
TOUCHES
public static final int TOUCHESThe struct member offsets. -
INDEXTRIGGER
public static final int INDEXTRIGGERThe struct member offsets. -
HANDTRIGGER
public static final int HANDTRIGGERThe struct member offsets. -
THUMBSTICK
public static final int THUMBSTICKThe struct member offsets. -
CONTROLLERTYPE
public static final int CONTROLLERTYPEThe struct member offsets. -
INDEXTRIGGERNODEADZONE
public static final int INDEXTRIGGERNODEADZONEThe struct member offsets. -
HANDTRIGGERNODEADZONE
public static final int HANDTRIGGERNODEADZONEThe struct member offsets. -
THUMBSTICKNODEADZONE
public static final int THUMBSTICKNODEADZONEThe struct member offsets. -
INDEXTRIGGERRAW
public static final int INDEXTRIGGERRAWThe struct member offsets. -
HANDTRIGGERRAW
public static final int HANDTRIGGERRAWThe struct member offsets. -
THUMBSTICKRAW
public static final int THUMBSTICKRAWThe struct member offsets.
-
-
Constructor Details
-
OVRInputState
Creates aOVRInputState
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 Details
-
sizeof
public int sizeof()Description copied from class:Struct
Returnssizeof(struct)
.- Specified by:
sizeof
in classStruct<OVRInputState>
-
TimeInSeconds
public double TimeInSeconds()system type when the controller state was last updated -
Buttons
public int Buttons()values for buttons described byovrButton
-
Touches
public int Touches()touch values for buttons and sensors as described byovrTouch
. -
IndexTrigger
left and right finger trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f. -
IndexTrigger
public float IndexTrigger(int index) left and right finger trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f. -
HandTrigger
left and right hand trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f. -
HandTrigger
public float HandTrigger(int index) left and right hand trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f. -
Thumbstick
horizontal and vertical thumbstick axis values (Hand_Left
andHand_Right
), in the range -1.0f to 1.0f. -
Thumbstick
horizontal and vertical thumbstick axis values (Hand_Left
andHand_Right
), in the range -1.0f to 1.0f. -
ControllerType
public int ControllerType() -
IndexTriggerNoDeadzone
Left and right finger trigger values (Hand_Left
andHand_Right
), in range 0.0 to 1.0f. Does not apply a deadzone. Only touch applies a filter. -
IndexTriggerNoDeadzone
public float IndexTriggerNoDeadzone(int index) Left and right finger trigger values (Hand_Left
andHand_Right
), in range 0.0 to 1.0f. Does not apply a deadzone. Only touch applies a filter. -
HandTriggerNoDeadzone
Left and right hand trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f. Does not apply a deadzone. Only touch applies a filter. -
HandTriggerNoDeadzone
public float HandTriggerNoDeadzone(int index) Left and right hand trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f. Does not apply a deadzone. Only touch applies a filter. -
ThumbstickNoDeadzone
Horizontal and vertical thumbstick axis values (Hand_Left
andHand_Right
), in the range -1.0f to 1.0f. Does not apply a deadzone or filter. -
ThumbstickNoDeadzone
Horizontal and vertical thumbstick axis values (Hand_Left
andHand_Right
), in the range -1.0f to 1.0f. Does not apply a deadzone or filter. -
IndexTriggerRaw
Left and right finger trigger values (Hand_Left
andHand_Right
), in range 0.0 to 1.0f. No deadzone or filter. -
IndexTriggerRaw
public float IndexTriggerRaw(int index) Left and right finger trigger values (Hand_Left
andHand_Right
), in range 0.0 to 1.0f. No deadzone or filter. -
HandTriggerRaw
Left and right hand trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f. No deadzone or filter. -
HandTriggerRaw
public float HandTriggerRaw(int index) Left and right hand trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f. No deadzone or filter. -
ThumbstickRaw
Horizontal and vertical thumbstick axis values (Hand_Left
andHand_Right
), in range -1.0f to 1.0f. No deadzone or filter. -
ThumbstickRaw
Horizontal and vertical thumbstick axis values (Hand_Left
andHand_Right
), in range -1.0f to 1.0f. No deadzone or filter. -
malloc
Returns a newOVRInputState
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newOVRInputState
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newOVRInputState
instance allocated withBufferUtils
. -
create
Returns a newOVRInputState
instance for the specified memory address. -
createSafe
-
malloc
Returns a newOVRInputState.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
Returns a newOVRInputState.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
Returns a newOVRInputState.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
Create aOVRInputState.Buffer
instance 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.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)
instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)
instead. -
malloc
Returns a newOVRInputState
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newOVRInputState
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
malloc
Returns a newOVRInputState.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
calloc
Returns a newOVRInputState.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
nTimeInSeconds
public static double nTimeInSeconds(long struct) Unsafe version ofTimeInSeconds()
. -
nButtons
public static int nButtons(long struct) Unsafe version ofButtons()
. -
nTouches
public static int nTouches(long struct) Unsafe version ofTouches()
. -
nIndexTrigger
Unsafe version ofIndexTrigger()
. -
nIndexTrigger
public static float nIndexTrigger(long struct, int index) Unsafe version ofIndexTrigger
. -
nHandTrigger
Unsafe version ofHandTrigger()
. -
nHandTrigger
public static float nHandTrigger(long struct, int index) Unsafe version ofHandTrigger
. -
nThumbstick
Unsafe version ofThumbstick()
. -
nThumbstick
Unsafe version ofThumbstick
. -
nControllerType
public static int nControllerType(long struct) Unsafe version ofControllerType()
. -
nIndexTriggerNoDeadzone
Unsafe version ofIndexTriggerNoDeadzone()
. -
nIndexTriggerNoDeadzone
public static float nIndexTriggerNoDeadzone(long struct, int index) Unsafe version ofIndexTriggerNoDeadzone
. -
nHandTriggerNoDeadzone
Unsafe version ofHandTriggerNoDeadzone()
. -
nHandTriggerNoDeadzone
public static float nHandTriggerNoDeadzone(long struct, int index) Unsafe version ofHandTriggerNoDeadzone
. -
nThumbstickNoDeadzone
Unsafe version ofThumbstickNoDeadzone()
. -
nThumbstickNoDeadzone
Unsafe version ofThumbstickNoDeadzone
. -
nIndexTriggerRaw
Unsafe version ofIndexTriggerRaw()
. -
nIndexTriggerRaw
public static float nIndexTriggerRaw(long struct, int index) Unsafe version ofIndexTriggerRaw
. -
nHandTriggerRaw
Unsafe version ofHandTriggerRaw()
. -
nHandTriggerRaw
public static float nHandTriggerRaw(long struct, int index) Unsafe version ofHandTriggerRaw
. -
nThumbstickRaw
Unsafe version ofThumbstickRaw()
. -
nThumbstickRaw
Unsafe version ofThumbstickRaw
.
-