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, NativeResource, Pointer
public class OVRInputState extends Struct
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 updatedConnectedControllerTypes– described byovrControllerType. Indicates which ControllerTypes are present.Buttons– values for buttons described byovrButtonTouches– touch values for buttons and sensors as described byovrTouch.IndexTrigger– left and right finger trigger values (OVR.ovrHand_LeftandOVR.ovrHand_Right), in the range 0.0 to 1.0f.HandTrigger– left and right hand trigger values (OVR.ovrHand_LeftandOVR.ovrHand_Right), in the range 0.0 to 1.0f.Thumbstick– horizontal and vertical thumbstick axis values (OVR.ovrHand_LeftandOVR.ovrHand_Right), in the range -1.0f to 1.0f.ControllerType– The type of the controller this state is for. One of:ControllerType_ActiveControllerType_LTouchControllerType_NoneControllerType_RTouchControllerType_RemoteControllerType_TouchControllerType_XBox
Layout
struct ovrInputState { double TimeInSeconds; unsigned int ConnectedControllerTypes; unsigned int Buttons; unsigned int Touches; float[2] IndexTrigger; float[2] HandTrigger;ovrVector2f[2] Thumbstick; ovrControllerType ControllerType; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classOVRInputState.BufferAn array ofOVRInputStatestructs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field and Description static intSIZEOFThe struct size in bytes.-
Fields inherited from interface org.lwjgl.system.Pointer
POINTER_SHIFT, POINTER_SIZE
-
-
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.OVRInputStateButtons(int value)Sets the specified value to 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, MemoryStack stack)Returns a newOVRInputState.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static OVRInputStatecallocStack(MemoryStack stack)Returns a newOVRInputStateinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.intConnectedControllerTypes()Returns the value of theConnectedControllerTypesfield.OVRInputStateConnectedControllerTypes(int value)Sets the specified value to theConnectedControllerTypesfield.intControllerType()Returns the value of theControllerTypefield.OVRInputStateControllerType(int value)Sets the specified value to 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 ornullif the address isNULL.static OVRInputState.Buffercreate(long address, int capacity)Create aOVRInputState.Bufferinstance at the specified memory.java.nio.FloatBufferHandTrigger()Returns aFloatBufferview of theHandTriggerfield.OVRInputStateHandTrigger(java.nio.FloatBuffer value)Copies the specifiedFloatBufferto theHandTriggerfield.floatHandTrigger(int index)Returns the value at the specified index of theHandTriggerfield.OVRInputStateHandTrigger(int index, float value)Sets the specified value at the specified index of theHandTriggerfield.java.nio.FloatBufferIndexTrigger()Returns aFloatBufferview of theIndexTriggerfield.OVRInputStateIndexTrigger(java.nio.FloatBuffer value)Copies the specifiedFloatBufferto theIndexTriggerfield.floatIndexTrigger(int index)Returns the value at the specified index of theIndexTriggerfield.OVRInputStateIndexTrigger(int index, float value)Sets the specified value at the specified index of theIndexTriggerfield.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, MemoryStack stack)Returns a newOVRInputState.Bufferinstance allocated on the specifiedMemoryStack.static OVRInputStatemallocStack(MemoryStack stack)Returns a newOVRInputStateinstance allocated on the specifiedMemoryStack.OVRInputStatenset(long struct)Unsafe version ofset.OVRInputStateset(double TimeInSeconds, int ConnectedControllerTypes, int Buttons, int Touches, java.nio.FloatBuffer IndexTrigger, java.nio.FloatBuffer HandTrigger, OVRVector2f.Buffer Thumbstick, int ControllerType)Initializes this struct with the specified values.OVRInputStateset(OVRInputState src)Copies the specified struct data to this struct.intsizeof()Returns thesizeof(struct).OVRVector2f.BufferThumbstick()Returns aOVRVector2f.Buffer view of theThumbstickfield.OVRVector2fThumbstick(int index)Returns aOVRVector2fview of the struct at the specified index of theThumbstickfield.OVRInputStateThumbstick(int index, OVRVector2f value)Copies the specifiedOVRVector2fat the specified index of theThumbstickfield.OVRInputStateThumbstick(OVRVector2f.Buffer value)Copies the specifiedOVRVector2f.Bufferto theThumbstickfield.doubleTimeInSeconds()Returns the value of theTimeInSecondsfield.OVRInputStateTimeInSeconds(double value)Sets the specified value to theTimeInSecondsfield.intTouches()Returns the value of theTouchesfield.OVRInputStateTouches(int value)Sets the specified value to theTouchesfield.-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
-
-
-
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()
Description copied from class:StructReturns thesizeof(struct).
-
TimeInSeconds
public double TimeInSeconds()
Returns the value of theTimeInSecondsfield.
-
ConnectedControllerTypes
public int ConnectedControllerTypes()
Returns the value of theConnectedControllerTypesfield.
-
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.
-
TimeInSeconds
public OVRInputState TimeInSeconds(double value)
Sets the specified value to theTimeInSecondsfield.
-
ConnectedControllerTypes
public OVRInputState ConnectedControllerTypes(int value)
Sets the specified value to theConnectedControllerTypesfield.
-
Buttons
public OVRInputState Buttons(int value)
Sets the specified value to theButtonsfield.
-
Touches
public OVRInputState Touches(int value)
Sets the specified value to theTouchesfield.
-
IndexTrigger
public OVRInputState IndexTrigger(java.nio.FloatBuffer value)
Copies the specifiedFloatBufferto theIndexTriggerfield.
-
IndexTrigger
public OVRInputState IndexTrigger(int index, float value)
Sets the specified value at the specified index of theIndexTriggerfield.
-
HandTrigger
public OVRInputState HandTrigger(java.nio.FloatBuffer value)
Copies the specifiedFloatBufferto theHandTriggerfield.
-
HandTrigger
public OVRInputState HandTrigger(int index, float value)
Sets the specified value at the specified index of theHandTriggerfield.
-
Thumbstick
public OVRInputState Thumbstick(OVRVector2f.Buffer value)
Copies the specifiedOVRVector2f.Bufferto theThumbstickfield.
-
Thumbstick
public OVRInputState Thumbstick(int index, OVRVector2f value)
Copies the specifiedOVRVector2fat the specified index of theThumbstickfield.
-
ControllerType
public OVRInputState ControllerType(int value)
Sets the specified value to theControllerTypefield.
-
set
public OVRInputState set(double TimeInSeconds, int ConnectedControllerTypes, int Buttons, int Touches, java.nio.FloatBuffer IndexTrigger, java.nio.FloatBuffer HandTrigger, OVRVector2f.Buffer Thumbstick, int ControllerType)
Initializes this struct with the specified values.
-
nset
public OVRInputState nset(long struct)
Unsafe version ofset.
-
set
public OVRInputState set(OVRInputState src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
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 ornullif the address isNULL.
-
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
-
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(MemoryStack stack)
Returns a newOVRInputStateinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static OVRInputState callocStack(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, 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, 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
-
-