Package org.lwjgl.ovr
Class OVRInputState
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.ovr.OVRInputState
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class OVRInputState extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
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.Member documentation
TimeInSeconds
– system type when the controller state was last updatedButtons
– values for buttons described byovrButton
Touches
– touch values for buttons and sensors as described byovrTouch
.IndexTrigger[ovrHand_Count]
– left and right finger trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f.HandTrigger[ovrHand_Count]
– left and right hand trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f.Thumbstick[ovrHand_Count]
– horizontal and vertical thumbstick axis values (Hand_Left
andHand_Right
), in the range -1.0f to 1.0f.ControllerType
– The type of the controller this state is for. One of:IndexTriggerNoDeadzone[ovrHand_Count]
– 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[ovrHand_Count]
– 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[ovrHand_Count]
– 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[ovrHand_Count]
– Left and right finger trigger values (Hand_Left
andHand_Right
), in range 0.0 to 1.0f. No deadzone or filter.HandTriggerRaw[ovrHand_Count]
– Left and right hand trigger values (Hand_Left
andHand_Right
), in the range 0.0 to 1.0f. No deadzone or filter.ThumbstickRaw[ovrHand_Count]
– Horizontal and vertical thumbstick axis values (Hand_Left
andHand_Right
), in range -1.0f to 1.0f. No deadzone or filter.
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 Modifier and Type Class Description static class
OVRInputState.Buffer
An array ofOVRInputState
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
BUTTONS
CONTROLLERTYPE
HANDTRIGGER
HANDTRIGGERNODEADZONE
HANDTRIGGERRAW
INDEXTRIGGER
INDEXTRIGGERNODEADZONE
INDEXTRIGGERRAWThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
THUMBSTICK
THUMBSTICKNODEADZONE
THUMBSTICKRAW
TIMEINSECONDS
TOUCHESThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description OVRInputState(java.nio.ByteBuffer container)
Creates aOVRInputState
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
Buttons()
Returns the value of theButtons
field.static OVRInputState
calloc()
Returns a newOVRInputState
instance allocated withmemCalloc
.static OVRInputState.Buffer
calloc(int capacity)
Returns a newOVRInputState.Buffer
instance allocated withmemCalloc
.static OVRInputState
callocStack()
Returns a newOVRInputState
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRInputState.Buffer
callocStack(int capacity)
Returns a newOVRInputState.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static OVRInputState.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRInputState.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRInputState
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRInputState
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.int
ControllerType()
Returns the value of theControllerType
field.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)
java.nio.FloatBuffer
HandTrigger()
Returns aFloatBuffer
view of theHandTrigger
field.float
HandTrigger(int index)
Returns the value at the specified index of theHandTrigger
field.java.nio.FloatBuffer
HandTriggerNoDeadzone()
Returns aFloatBuffer
view of theHandTriggerNoDeadzone
field.float
HandTriggerNoDeadzone(int index)
Returns the value at the specified index of theHandTriggerNoDeadzone
field.java.nio.FloatBuffer
HandTriggerRaw()
Returns aFloatBuffer
view of theHandTriggerRaw
field.float
HandTriggerRaw(int index)
Returns the value at the specified index of theHandTriggerRaw
field.java.nio.FloatBuffer
IndexTrigger()
Returns aFloatBuffer
view of theIndexTrigger
field.float
IndexTrigger(int index)
Returns the value at the specified index of theIndexTrigger
field.java.nio.FloatBuffer
IndexTriggerNoDeadzone()
Returns aFloatBuffer
view of theIndexTriggerNoDeadzone
field.float
IndexTriggerNoDeadzone(int index)
Returns the value at the specified index of theIndexTriggerNoDeadzone
field.java.nio.FloatBuffer
IndexTriggerRaw()
Returns aFloatBuffer
view of theIndexTriggerRaw
field.float
IndexTriggerRaw(int index)
Returns the value at the specified index of theIndexTriggerRaw
field.static OVRInputState
malloc()
Returns a newOVRInputState
instance allocated withmemAlloc
.static OVRInputState.Buffer
malloc(int capacity)
Returns a newOVRInputState.Buffer
instance allocated withmemAlloc
.static OVRInputState
mallocStack()
Returns a newOVRInputState
instance allocated on the thread-localMemoryStack
.static OVRInputState.Buffer
mallocStack(int capacity)
Returns a newOVRInputState.Buffer
instance allocated on the thread-localMemoryStack
.static OVRInputState.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRInputState.Buffer
instance allocated on the specifiedMemoryStack
.static OVRInputState
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRInputState
instance allocated on the specifiedMemoryStack
.static int
nButtons(long struct)
Unsafe version ofButtons()
.static int
nControllerType(long struct)
Unsafe version ofControllerType()
.static java.nio.FloatBuffer
nHandTrigger(long struct)
Unsafe version ofHandTrigger()
.static float
nHandTrigger(long struct, int index)
Unsafe version ofHandTrigger
.static java.nio.FloatBuffer
nHandTriggerNoDeadzone(long struct)
Unsafe version ofHandTriggerNoDeadzone()
.static float
nHandTriggerNoDeadzone(long struct, int index)
Unsafe version ofHandTriggerNoDeadzone
.static java.nio.FloatBuffer
nHandTriggerRaw(long struct)
Unsafe version ofHandTriggerRaw()
.static float
nHandTriggerRaw(long struct, int index)
Unsafe version ofHandTriggerRaw
.static java.nio.FloatBuffer
nIndexTrigger(long struct)
Unsafe version ofIndexTrigger()
.static float
nIndexTrigger(long struct, int index)
Unsafe version ofIndexTrigger
.static java.nio.FloatBuffer
nIndexTriggerNoDeadzone(long struct)
Unsafe version ofIndexTriggerNoDeadzone()
.static float
nIndexTriggerNoDeadzone(long struct, int index)
Unsafe version ofIndexTriggerNoDeadzone
.static java.nio.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()
OVRVector2f.Buffer
Thumbstick()
Returns aOVRVector2f
.Buffer view of theThumbstick
field.OVRVector2f
Thumbstick(int index)
Returns aOVRVector2f
view of the struct at the specified index of theThumbstick
field.OVRVector2f.Buffer
ThumbstickNoDeadzone()
Returns aOVRVector2f
.Buffer view of theThumbstickNoDeadzone
field.OVRVector2f
ThumbstickNoDeadzone(int index)
Returns aOVRVector2f
view of the struct at the specified index of theThumbstickNoDeadzone
field.OVRVector2f.Buffer
ThumbstickRaw()
Returns aOVRVector2f
.Buffer view of theThumbstickRaw
field.OVRVector2f
ThumbstickRaw(int index)
Returns aOVRVector2f
view of the struct at the specified index of theThumbstickRaw
field.double
TimeInSeconds()
Returns the value of theTimeInSeconds
field.int
Touches()
Returns the value of theTouches
field.
-
-
-
Field Detail
-
SIZEOF
The struct size in bytes.
-
ALIGNOF
The struct alignment in bytes.
-
TIMEINSECONDS, BUTTONS, TOUCHES, INDEXTRIGGER, HANDTRIGGER, THUMBSTICK, CONTROLLERTYPE, INDEXTRIGGERNODEADZONE, HANDTRIGGERNODEADZONE, THUMBSTICKNODEADZONE, INDEXTRIGGERRAW, HANDTRIGGERRAW, THUMBSTICKRAW
The struct member offsets.
-
-
Constructor Detail
-
OVRInputState
public OVRInputState(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
TimeInSeconds
public double TimeInSeconds()
Returns the value of theTimeInSeconds
field.
-
Buttons
public int Buttons()
Returns the value of theButtons
field.
-
Touches
public int Touches()
Returns the value of theTouches
field.
-
IndexTrigger
public java.nio.FloatBuffer IndexTrigger()
Returns aFloatBuffer
view of theIndexTrigger
field.
-
IndexTrigger
public float IndexTrigger(int index)
Returns the value at the specified index of theIndexTrigger
field.
-
HandTrigger
public java.nio.FloatBuffer HandTrigger()
Returns aFloatBuffer
view of theHandTrigger
field.
-
HandTrigger
public float HandTrigger(int index)
Returns the value at the specified index of theHandTrigger
field.
-
Thumbstick
public OVRVector2f.Buffer Thumbstick()
Returns aOVRVector2f
.Buffer view of theThumbstick
field.
-
Thumbstick
public OVRVector2f Thumbstick(int index)
Returns aOVRVector2f
view of the struct at the specified index of theThumbstick
field.
-
ControllerType
public int ControllerType()
Returns the value of theControllerType
field.
-
IndexTriggerNoDeadzone
public java.nio.FloatBuffer IndexTriggerNoDeadzone()
Returns aFloatBuffer
view of theIndexTriggerNoDeadzone
field.
-
IndexTriggerNoDeadzone
public float IndexTriggerNoDeadzone(int index)
Returns the value at the specified index of theIndexTriggerNoDeadzone
field.
-
HandTriggerNoDeadzone
public java.nio.FloatBuffer HandTriggerNoDeadzone()
Returns aFloatBuffer
view of theHandTriggerNoDeadzone
field.
-
HandTriggerNoDeadzone
public float HandTriggerNoDeadzone(int index)
Returns the value at the specified index of theHandTriggerNoDeadzone
field.
-
ThumbstickNoDeadzone
public OVRVector2f.Buffer ThumbstickNoDeadzone()
Returns aOVRVector2f
.Buffer view of theThumbstickNoDeadzone
field.
-
ThumbstickNoDeadzone
public OVRVector2f ThumbstickNoDeadzone(int index)
Returns aOVRVector2f
view of the struct at the specified index of theThumbstickNoDeadzone
field.
-
IndexTriggerRaw
public java.nio.FloatBuffer IndexTriggerRaw()
Returns aFloatBuffer
view of theIndexTriggerRaw
field.
-
IndexTriggerRaw
public float IndexTriggerRaw(int index)
Returns the value at the specified index of theIndexTriggerRaw
field.
-
HandTriggerRaw
public java.nio.FloatBuffer HandTriggerRaw()
Returns aFloatBuffer
view of theHandTriggerRaw
field.
-
HandTriggerRaw
public float HandTriggerRaw(int index)
Returns the value at the specified index of theHandTriggerRaw
field.
-
ThumbstickRaw
public OVRVector2f.Buffer ThumbstickRaw()
Returns aOVRVector2f
.Buffer view of theThumbstickRaw
field.
-
ThumbstickRaw
public OVRVector2f ThumbstickRaw(int index)
Returns aOVRVector2f
view of the struct at the specified index of theThumbstickRaw
field.
-
malloc
public static OVRInputState malloc()
Returns a newOVRInputState
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static OVRInputState calloc()
Returns a newOVRInputState
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static OVRInputState create()
Returns a newOVRInputState
instance allocated withBufferUtils
.
-
create
public static OVRInputState create(long address)
Returns a newOVRInputState
instance for the specified memory address.
-
createSafe
@Nullable public static OVRInputState createSafe(long address)
-
malloc
public static OVRInputState.Buffer malloc(int capacity)
Returns a newOVRInputState.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static OVRInputState.Buffer calloc(int capacity)
Returns a newOVRInputState.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRInputState.Buffer create(int capacity)
Returns a newOVRInputState.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static OVRInputState.Buffer create(long address, int capacity)
Create aOVRInputState.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static OVRInputState.Buffer createSafe(long address, int capacity)
-
mallocStack
public static OVRInputState mallocStack()
Returns a newOVRInputState
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static OVRInputState callocStack()
Returns a newOVRInputState
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static OVRInputState mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRInputState
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static OVRInputState callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRInputState
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static OVRInputState.Buffer mallocStack(int capacity)
Returns a newOVRInputState.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static OVRInputState.Buffer callocStack(int capacity)
Returns a newOVRInputState.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static OVRInputState.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRInputState.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static OVRInputState.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newOVRInputState.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
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
public static java.nio.FloatBuffer nIndexTrigger(long struct)
Unsafe version ofIndexTrigger()
.
-
nIndexTrigger
public static float nIndexTrigger(long struct, int index)
Unsafe version ofIndexTrigger
.
-
nHandTrigger
public static java.nio.FloatBuffer nHandTrigger(long struct)
Unsafe version ofHandTrigger()
.
-
nHandTrigger
public static float nHandTrigger(long struct, int index)
Unsafe version ofHandTrigger
.
-
nThumbstick
public static OVRVector2f.Buffer nThumbstick(long struct)
Unsafe version ofThumbstick()
.
-
nThumbstick
public static OVRVector2f nThumbstick(long struct, int index)
Unsafe version ofThumbstick
.
-
nControllerType
public static int nControllerType(long struct)
Unsafe version ofControllerType()
.
-
nIndexTriggerNoDeadzone
public static java.nio.FloatBuffer nIndexTriggerNoDeadzone(long struct)
Unsafe version ofIndexTriggerNoDeadzone()
.
-
nIndexTriggerNoDeadzone
public static float nIndexTriggerNoDeadzone(long struct, int index)
Unsafe version ofIndexTriggerNoDeadzone
.
-
nHandTriggerNoDeadzone
public static java.nio.FloatBuffer nHandTriggerNoDeadzone(long struct)
Unsafe version ofHandTriggerNoDeadzone()
.
-
nHandTriggerNoDeadzone
public static float nHandTriggerNoDeadzone(long struct, int index)
Unsafe version ofHandTriggerNoDeadzone
.
-
nThumbstickNoDeadzone
public static OVRVector2f.Buffer nThumbstickNoDeadzone(long struct)
Unsafe version ofThumbstickNoDeadzone()
.
-
nThumbstickNoDeadzone
public static OVRVector2f nThumbstickNoDeadzone(long struct, int index)
Unsafe version ofThumbstickNoDeadzone
.
-
nIndexTriggerRaw
public static java.nio.FloatBuffer nIndexTriggerRaw(long struct)
Unsafe version ofIndexTriggerRaw()
.
-
nIndexTriggerRaw
public static float nIndexTriggerRaw(long struct, int index)
Unsafe version ofIndexTriggerRaw
.
-
nHandTriggerRaw
public static java.nio.FloatBuffer nHandTriggerRaw(long struct)
Unsafe version ofHandTriggerRaw()
.
-
nHandTriggerRaw
public static float nHandTriggerRaw(long struct, int index)
Unsafe version ofHandTriggerRaw
.
-
nThumbstickRaw
public static OVRVector2f.Buffer nThumbstickRaw(long struct)
Unsafe version ofThumbstickRaw()
.
-
nThumbstickRaw
public static OVRVector2f nThumbstickRaw(long struct, int index)
Unsafe version ofThumbstickRaw
.
-
-