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– left and right finger trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f.HandTrigger– left and right hand trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f.Thumbstick– 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– 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– 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– 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– Left and right finger trigger values (Hand_LeftandHand_Right), in range 0.0 to 1.0f. No deadzone or filter.HandTriggerRaw– Left and right hand trigger values (Hand_LeftandHand_Right), in the range 0.0 to 1.0f. No deadzone or filter.ThumbstickRaw– 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 and Description static classOVRInputState.BufferAn array ofOVRInputStatestructs.
-
Field Summary
Fields Modifier and Type Field and Description static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor and 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 and 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.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.
-
-
-
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
-
-