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.NativeResourceDescribes 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 byovrButtonTouches– touch values for buttons and sensors as described byovrTouch.IndexTrigger[ovrHand_Count]– left and right finger trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f.HandTrigger[ovrHand_Count]– left and right hand trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f.Thumbstick[ovrHand_Count]– horizontal and vertical thumbstick axis values (Hand_LeftandHand_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_LeftandHand_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_LeftandHand_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_LeftandHand_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_LeftandHand_Right), in range 0.0 to 1.0f. No deadzone or filter.HandTriggerRaw[ovrHand_Count]– Left and right hand trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f. No deadzone or filter.ThumbstickRaw[ovrHand_Count]– Horizontal and vertical thumbstick axis values (Hand_LeftandHand_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];ovrVector2fThumbstick[ovrHand_Count]; ovrControllerType ControllerType; float IndexTriggerNoDeadzone[ovrHand_Count]; float HandTriggerNoDeadzone[ovrHand_Count];ovrVector2fThumbstickNoDeadzone[ovrHand_Count]; float IndexTriggerRaw[ovrHand_Count]; float HandTriggerRaw[ovrHand_Count];ovrVector2fThumbstickRaw[ovrHand_Count]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOVRInputState.BufferAn array ofOVRInputStatestructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intBUTTONS
CONTROLLERTYPE
HANDTRIGGER
HANDTRIGGERNODEADZONE
HANDTRIGGERRAW
INDEXTRIGGER
INDEXTRIGGERNODEADZONE
INDEXTRIGGERRAWThe struct member offsets.static intSIZEOFThe struct size in bytes.static intTHUMBSTICK
THUMBSTICKNODEADZONE
THUMBSTICKRAW
TIMEINSECONDS
TOUCHESThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description OVRInputState(java.nio.ByteBuffer container)Creates aOVRInputStateinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intButtons()Returns the value of theButtonsfield.static OVRInputStatecalloc()Returns a newOVRInputStateinstance allocated withmemCalloc.static OVRInputState.Buffercalloc(int capacity)Returns a newOVRInputState.Bufferinstance allocated withmemCalloc.static OVRInputStatecallocStack()Returns a newOVRInputStateinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static OVRInputState.BuffercallocStack(int capacity)Returns a newOVRInputState.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static OVRInputState.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRInputState.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRInputStatecallocStack(org.lwjgl.system.MemoryStack stack)Returns a newOVRInputStateinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.intControllerType()Returns the value of theControllerTypefield.static OVRInputStatecreate()Returns a newOVRInputStateinstance allocated withBufferUtils.static OVRInputState.Buffercreate(int capacity)Returns a newOVRInputState.Bufferinstance allocated withBufferUtils.static OVRInputStatecreate(long address)Returns a newOVRInputStateinstance for the specified memory address.static OVRInputState.Buffercreate(long address, int capacity)Create aOVRInputState.Bufferinstance at the specified memory.static OVRInputStatecreateSafe(long address)static OVRInputState.BuffercreateSafe(long address, int capacity)java.nio.FloatBufferHandTrigger()Returns aFloatBufferview of theHandTriggerfield.floatHandTrigger(int index)Returns the value at the specified index of theHandTriggerfield.java.nio.FloatBufferHandTriggerNoDeadzone()Returns aFloatBufferview of theHandTriggerNoDeadzonefield.floatHandTriggerNoDeadzone(int index)Returns the value at the specified index of theHandTriggerNoDeadzonefield.java.nio.FloatBufferHandTriggerRaw()Returns aFloatBufferview of theHandTriggerRawfield.floatHandTriggerRaw(int index)Returns the value at the specified index of theHandTriggerRawfield.java.nio.FloatBufferIndexTrigger()Returns aFloatBufferview of theIndexTriggerfield.floatIndexTrigger(int index)Returns the value at the specified index of theIndexTriggerfield.java.nio.FloatBufferIndexTriggerNoDeadzone()Returns aFloatBufferview of theIndexTriggerNoDeadzonefield.floatIndexTriggerNoDeadzone(int index)Returns the value at the specified index of theIndexTriggerNoDeadzonefield.java.nio.FloatBufferIndexTriggerRaw()Returns aFloatBufferview of theIndexTriggerRawfield.floatIndexTriggerRaw(int index)Returns the value at the specified index of theIndexTriggerRawfield.static OVRInputStatemalloc()Returns a newOVRInputStateinstance allocated withmemAlloc.static OVRInputState.Buffermalloc(int capacity)Returns a newOVRInputState.Bufferinstance allocated withmemAlloc.static OVRInputStatemallocStack()Returns a newOVRInputStateinstance allocated on the thread-localMemoryStack.static OVRInputState.BuffermallocStack(int capacity)Returns a newOVRInputState.Bufferinstance allocated on the thread-localMemoryStack.static OVRInputState.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRInputState.Bufferinstance allocated on the specifiedMemoryStack.static OVRInputStatemallocStack(org.lwjgl.system.MemoryStack stack)Returns a newOVRInputStateinstance allocated on the specifiedMemoryStack.static intnButtons(long struct)Unsafe version ofButtons().static intnControllerType(long struct)Unsafe version ofControllerType().static java.nio.FloatBuffernHandTrigger(long struct)Unsafe version ofHandTrigger().static floatnHandTrigger(long struct, int index)Unsafe version ofHandTrigger.static java.nio.FloatBuffernHandTriggerNoDeadzone(long struct)Unsafe version ofHandTriggerNoDeadzone().static floatnHandTriggerNoDeadzone(long struct, int index)Unsafe version ofHandTriggerNoDeadzone.static java.nio.FloatBuffernHandTriggerRaw(long struct)Unsafe version ofHandTriggerRaw().static floatnHandTriggerRaw(long struct, int index)Unsafe version ofHandTriggerRaw.static java.nio.FloatBuffernIndexTrigger(long struct)Unsafe version ofIndexTrigger().static floatnIndexTrigger(long struct, int index)Unsafe version ofIndexTrigger.static java.nio.FloatBuffernIndexTriggerNoDeadzone(long struct)Unsafe version ofIndexTriggerNoDeadzone().static floatnIndexTriggerNoDeadzone(long struct, int index)Unsafe version ofIndexTriggerNoDeadzone.static java.nio.FloatBuffernIndexTriggerRaw(long struct)Unsafe version ofIndexTriggerRaw().static floatnIndexTriggerRaw(long struct, int index)Unsafe version ofIndexTriggerRaw.static OVRVector2f.BuffernThumbstick(long struct)Unsafe version ofThumbstick().static OVRVector2fnThumbstick(long struct, int index)Unsafe version ofThumbstick.static OVRVector2f.BuffernThumbstickNoDeadzone(long struct)Unsafe version ofThumbstickNoDeadzone().static OVRVector2fnThumbstickNoDeadzone(long struct, int index)Unsafe version ofThumbstickNoDeadzone.static OVRVector2f.BuffernThumbstickRaw(long struct)Unsafe version ofThumbstickRaw().static OVRVector2fnThumbstickRaw(long struct, int index)Unsafe version ofThumbstickRaw.static doublenTimeInSeconds(long struct)Unsafe version ofTimeInSeconds().static intnTouches(long struct)Unsafe version ofTouches().intsizeof()OVRVector2f.BufferThumbstick()Returns aOVRVector2f.Buffer view of theThumbstickfield.OVRVector2fThumbstick(int index)Returns aOVRVector2fview of the struct at the specified index of theThumbstickfield.OVRVector2f.BufferThumbstickNoDeadzone()Returns aOVRVector2f.Buffer view of theThumbstickNoDeadzonefield.OVRVector2fThumbstickNoDeadzone(int index)Returns aOVRVector2fview of the struct at the specified index of theThumbstickNoDeadzonefield.OVRVector2f.BufferThumbstickRaw()Returns aOVRVector2f.Buffer view of theThumbstickRawfield.OVRVector2fThumbstickRaw(int index)Returns aOVRVector2fview of the struct at the specified index of theThumbstickRawfield.doubleTimeInSeconds()Returns the value of theTimeInSecondsfield.intTouches()Returns the value of theTouchesfield.
-
-
-
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 aOVRInputStateinstance 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
-
TimeInSeconds
public double TimeInSeconds()
Returns the value of theTimeInSecondsfield.
-
Buttons
public int Buttons()
Returns the value of theButtonsfield.
-
Touches
public int Touches()
Returns the value of theTouchesfield.
-
IndexTrigger
public java.nio.FloatBuffer IndexTrigger()
Returns aFloatBufferview of theIndexTriggerfield.
-
IndexTrigger
public float IndexTrigger(int index)
Returns the value at the specified index of theIndexTriggerfield.
-
HandTrigger
public java.nio.FloatBuffer HandTrigger()
Returns aFloatBufferview of theHandTriggerfield.
-
HandTrigger
public float HandTrigger(int index)
Returns the value at the specified index of theHandTriggerfield.
-
Thumbstick
public OVRVector2f.Buffer Thumbstick()
Returns aOVRVector2f.Buffer view of theThumbstickfield.
-
Thumbstick
public OVRVector2f Thumbstick(int index)
Returns aOVRVector2fview of the struct at the specified index of theThumbstickfield.
-
ControllerType
public int ControllerType()
Returns the value of theControllerTypefield.
-
IndexTriggerNoDeadzone
public java.nio.FloatBuffer IndexTriggerNoDeadzone()
Returns aFloatBufferview of theIndexTriggerNoDeadzonefield.
-
IndexTriggerNoDeadzone
public float IndexTriggerNoDeadzone(int index)
Returns the value at the specified index of theIndexTriggerNoDeadzonefield.
-
HandTriggerNoDeadzone
public java.nio.FloatBuffer HandTriggerNoDeadzone()
Returns aFloatBufferview of theHandTriggerNoDeadzonefield.
-
HandTriggerNoDeadzone
public float HandTriggerNoDeadzone(int index)
Returns the value at the specified index of theHandTriggerNoDeadzonefield.
-
ThumbstickNoDeadzone
public OVRVector2f.Buffer ThumbstickNoDeadzone()
Returns aOVRVector2f.Buffer view of theThumbstickNoDeadzonefield.
-
ThumbstickNoDeadzone
public OVRVector2f ThumbstickNoDeadzone(int index)
Returns aOVRVector2fview of the struct at the specified index of theThumbstickNoDeadzonefield.
-
IndexTriggerRaw
public java.nio.FloatBuffer IndexTriggerRaw()
Returns aFloatBufferview of theIndexTriggerRawfield.
-
IndexTriggerRaw
public float IndexTriggerRaw(int index)
Returns the value at the specified index of theIndexTriggerRawfield.
-
HandTriggerRaw
public java.nio.FloatBuffer HandTriggerRaw()
Returns aFloatBufferview of theHandTriggerRawfield.
-
HandTriggerRaw
public float HandTriggerRaw(int index)
Returns the value at the specified index of theHandTriggerRawfield.
-
ThumbstickRaw
public OVRVector2f.Buffer ThumbstickRaw()
Returns aOVRVector2f.Buffer view of theThumbstickRawfield.
-
ThumbstickRaw
public OVRVector2f ThumbstickRaw(int index)
Returns aOVRVector2fview of the struct at the specified index of theThumbstickRawfield.
-
malloc
public static OVRInputState malloc()
Returns a newOVRInputStateinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static OVRInputState calloc()
Returns a newOVRInputStateinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static OVRInputState create()
Returns a newOVRInputStateinstance allocated withBufferUtils.
-
create
public static OVRInputState create(long address)
Returns a newOVRInputStateinstance for the specified memory address.
-
createSafe
@Nullable public static OVRInputState createSafe(long address)
-
malloc
public static OVRInputState.Buffer malloc(int capacity)
Returns a newOVRInputState.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static OVRInputState.Buffer calloc(int capacity)
Returns a newOVRInputState.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static OVRInputState.Buffer create(int capacity)
Returns a newOVRInputState.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static OVRInputState.Buffer create(long address, int capacity)
Create aOVRInputState.Bufferinstance 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 newOVRInputStateinstance allocated on the thread-localMemoryStack.
-
callocStack
public static OVRInputState callocStack()
Returns a newOVRInputStateinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static OVRInputState mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRInputStateinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static OVRInputState callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newOVRInputStateinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static OVRInputState.Buffer callocStack(int capacity)
Returns a newOVRInputState.Bufferinstance allocated on the thread-localMemoryStackand 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.Bufferinstance 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.Bufferinstance allocated on the specifiedMemoryStackand 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.
-
-