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.Layout
struct ovrInputState { doubleTimeInSeconds(); unsigned intButtons(); unsigned intTouches(); floatIndexTrigger()[ovrHand_Count]; floatHandTrigger()[ovrHand_Count];ovrVector2fThumbstick()[ovrHand_Count]; ovrControllerTypeControllerType(); floatIndexTriggerNoDeadzone()[ovrHand_Count]; floatHandTriggerNoDeadzone()[ovrHand_Count];ovrVector2fThumbstickNoDeadzone()[ovrHand_Count]; floatIndexTriggerRaw()[ovrHand_Count]; floatHandTriggerRaw()[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 Deprecated Methods Modifier and Type Method Description intButtons()values for buttons described byovrButtonstatic OVRInputStatecalloc()Returns a newOVRInputStateinstance allocated withmemCalloc.static OVRInputState.Buffercalloc(int capacity)Returns a newOVRInputState.Bufferinstance allocated withmemCalloc.static OVRInputState.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRInputState.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRInputStatecalloc(org.lwjgl.system.MemoryStack stack)Returns a newOVRInputStateinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRInputStatecallocStack()Deprecated.static OVRInputState.BuffercallocStack(int capacity)Deprecated.static OVRInputState.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static OVRInputStatecallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.intControllerType()The type of the controller this state is for.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()left and right hand trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f.floatHandTrigger(int index)left and right hand trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f.java.nio.FloatBufferHandTriggerNoDeadzone()Left and right hand trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f.floatHandTriggerNoDeadzone(int index)Left and right hand trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f.java.nio.FloatBufferHandTriggerRaw()Left and right hand trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f.floatHandTriggerRaw(int index)Left and right hand trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f.java.nio.FloatBufferIndexTrigger()left and right finger trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f.floatIndexTrigger(int index)left and right finger trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f.java.nio.FloatBufferIndexTriggerNoDeadzone()Left and right finger trigger values (Hand_LeftandHand_Right), in range 0.0 to 1.0f.floatIndexTriggerNoDeadzone(int index)Left and right finger trigger values (Hand_LeftandHand_Right), in range 0.0 to 1.0f.java.nio.FloatBufferIndexTriggerRaw()Left and right finger trigger values (Hand_LeftandHand_Right), in range 0.0 to 1.0f.floatIndexTriggerRaw(int index)Left and right finger trigger values (Hand_LeftandHand_Right), in range 0.0 to 1.0f.static OVRInputStatemalloc()Returns a newOVRInputStateinstance allocated withmemAlloc.static OVRInputState.Buffermalloc(int capacity)Returns a newOVRInputState.Bufferinstance allocated withmemAlloc.static OVRInputState.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newOVRInputState.Bufferinstance allocated on the specifiedMemoryStack.static OVRInputStatemalloc(org.lwjgl.system.MemoryStack stack)Returns a newOVRInputStateinstance allocated on the specifiedMemoryStack.static OVRInputStatemallocStack()Deprecated.static OVRInputState.BuffermallocStack(int capacity)Deprecated.static OVRInputState.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static OVRInputStatemallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.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()horizontal and vertical thumbstick axis values (Hand_LeftandHand_Right), in the range -1.0f to 1.0f.OVRVector2fThumbstick(int index)horizontal and vertical thumbstick axis values (Hand_LeftandHand_Right), in the range -1.0f to 1.0f.OVRVector2f.BufferThumbstickNoDeadzone()Horizontal and vertical thumbstick axis values (Hand_LeftandHand_Right), in the range -1.0f to 1.0f.OVRVector2fThumbstickNoDeadzone(int index)Horizontal and vertical thumbstick axis values (Hand_LeftandHand_Right), in the range -1.0f to 1.0f.OVRVector2f.BufferThumbstickRaw()Horizontal and vertical thumbstick axis values (Hand_LeftandHand_Right), in range -1.0f to 1.0f.OVRVector2fThumbstickRaw(int index)Horizontal and vertical thumbstick axis values (Hand_LeftandHand_Right), in range -1.0f to 1.0f.doubleTimeInSeconds()system type when the controller state was last updatedintTouches()touch values for buttons and sensors as described byovrTouch.
-
-
-
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()
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
public java.nio.FloatBuffer IndexTrigger() public float IndexTrigger(int index)
left and right finger trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f.
-
HandTrigger
public java.nio.FloatBuffer HandTrigger() public float HandTrigger(int index)
left and right hand trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f.
-
Thumbstick
public OVRVector2f.Buffer Thumbstick() public OVRVector2f Thumbstick(int index)
horizontal and vertical thumbstick axis values (Hand_LeftandHand_Right), in the range -1.0f to 1.0f.
-
ControllerType
public int ControllerType()
-
IndexTriggerNoDeadzone
public java.nio.FloatBuffer IndexTriggerNoDeadzone() public float IndexTriggerNoDeadzone(int index)
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
public java.nio.FloatBuffer HandTriggerNoDeadzone() public float HandTriggerNoDeadzone(int index)
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
public OVRVector2f.Buffer ThumbstickNoDeadzone() public OVRVector2f ThumbstickNoDeadzone(int index)
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
public java.nio.FloatBuffer IndexTriggerRaw() public float IndexTriggerRaw(int index)
Left and right finger trigger values (Hand_LeftandHand_Right), in range 0.0 to 1.0f. No deadzone or filter.
-
HandTriggerRaw
public java.nio.FloatBuffer HandTriggerRaw() public float HandTriggerRaw(int index)
Left and right hand trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f. No deadzone or filter.
-
ThumbstickRaw
public OVRVector2f.Buffer ThumbstickRaw() public OVRVector2f ThumbstickRaw(int index)
Horizontal and vertical thumbstick axis values (Hand_LeftandHand_Right), in range -1.0f to 1.0f. No deadzone or filter.
-
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
@Deprecated public static OVRInputState mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static OVRInputState callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static OVRInputState mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static OVRInputState callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static OVRInputState.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static OVRInputState.Buffer callocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
mallocStack
@Deprecated public static OVRInputState.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 OVRInputState.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead.
-
malloc
public static OVRInputState malloc(org.lwjgl.system.MemoryStack stack)
Returns a newOVRInputStateinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static OVRInputState calloc(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
-
malloc
public static OVRInputState.Buffer malloc(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
-
calloc
public static OVRInputState.Buffer calloc(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.
-
-