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 byovrButton
Touches
– touch values for buttons and sensors as described byovrTouch
.IndexTrigger
– left and right finger trigger values (OVR.ovrHand_Left
andOVR.ovrHand_Right
), in the range 0.0 to 1.0f.HandTrigger
– left and right hand trigger values (OVR.ovrHand_Left
andOVR.ovrHand_Right
), in the range 0.0 to 1.0f.Thumbstick
– horizontal and vertical thumbstick axis values (OVR.ovrHand_Left
andOVR.ovrHand_Right
), in the range -1.0f to 1.0f.ControllerType
– The type of the controller this state is for. One of:ControllerType_Active
ControllerType_LTouch
ControllerType_None
ControllerType_RTouch
ControllerType_Remote
ControllerType_Touch
ControllerType_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 class
OVRInputState.Buffer
An array ofOVRInputState
structs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field and Description static int
SIZEOF
The 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 aOVRInputState
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description int
Buttons()
Returns the value of theButtons
field.OVRInputState
Buttons(int value)
Sets the specified value to 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, MemoryStack stack)
Returns a newOVRInputState.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static OVRInputState
callocStack(MemoryStack stack)
Returns a newOVRInputState
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.int
ConnectedControllerTypes()
Returns the value of theConnectedControllerTypes
field.OVRInputState
ConnectedControllerTypes(int value)
Sets the specified value to theConnectedControllerTypes
field.int
ControllerType()
Returns the value of theControllerType
field.OVRInputState
ControllerType(int value)
Sets the specified value to 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 ornull
if the address isNULL
.static OVRInputState.Buffer
create(long address, int capacity)
Create aOVRInputState.Buffer
instance at the specified memory.java.nio.FloatBuffer
HandTrigger()
Returns aFloatBuffer
view of theHandTrigger
field.OVRInputState
HandTrigger(java.nio.FloatBuffer value)
Copies the specifiedFloatBuffer
to theHandTrigger
field.float
HandTrigger(int index)
Returns the value at the specified index of theHandTrigger
field.OVRInputState
HandTrigger(int index, float value)
Sets the specified value at the specified index of theHandTrigger
field.java.nio.FloatBuffer
IndexTrigger()
Returns aFloatBuffer
view of theIndexTrigger
field.OVRInputState
IndexTrigger(java.nio.FloatBuffer value)
Copies the specifiedFloatBuffer
to theIndexTrigger
field.float
IndexTrigger(int index)
Returns the value at the specified index of theIndexTrigger
field.OVRInputState
IndexTrigger(int index, float value)
Sets the specified value at the specified index of theIndexTrigger
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, MemoryStack stack)
Returns a newOVRInputState.Buffer
instance allocated on the specifiedMemoryStack
.static OVRInputState
mallocStack(MemoryStack stack)
Returns a newOVRInputState
instance allocated on the specifiedMemoryStack
.OVRInputState
nset(long struct)
Unsafe version ofset
.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.OVRInputState
set(OVRInputState src)
Copies the specified struct data to this struct.int
sizeof()
Returns thesizeof(struct)
.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.OVRInputState
Thumbstick(int index, OVRVector2f value)
Copies the specifiedOVRVector2f
at the specified index of theThumbstick
field.OVRInputState
Thumbstick(OVRVector2f.Buffer value)
Copies the specifiedOVRVector2f.Buffer
to theThumbstick
field.double
TimeInSeconds()
Returns the value of theTimeInSeconds
field.OVRInputState
TimeInSeconds(double value)
Sets the specified value to theTimeInSeconds
field.int
Touches()
Returns the value of theTouches
field.OVRInputState
Touches(int value)
Sets the specified value to theTouches
field.-
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 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()
Description copied from class:Struct
Returns thesizeof(struct)
.
-
TimeInSeconds
public double TimeInSeconds()
Returns the value of theTimeInSeconds
field.
-
ConnectedControllerTypes
public int ConnectedControllerTypes()
Returns the value of theConnectedControllerTypes
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.
-
TimeInSeconds
public OVRInputState TimeInSeconds(double value)
Sets the specified value to theTimeInSeconds
field.
-
ConnectedControllerTypes
public OVRInputState ConnectedControllerTypes(int value)
Sets the specified value to theConnectedControllerTypes
field.
-
Buttons
public OVRInputState Buttons(int value)
Sets the specified value to theButtons
field.
-
Touches
public OVRInputState Touches(int value)
Sets the specified value to theTouches
field.
-
IndexTrigger
public OVRInputState IndexTrigger(java.nio.FloatBuffer value)
Copies the specifiedFloatBuffer
to theIndexTrigger
field.
-
IndexTrigger
public OVRInputState IndexTrigger(int index, float value)
Sets the specified value at the specified index of theIndexTrigger
field.
-
HandTrigger
public OVRInputState HandTrigger(java.nio.FloatBuffer value)
Copies the specifiedFloatBuffer
to theHandTrigger
field.
-
HandTrigger
public OVRInputState HandTrigger(int index, float value)
Sets the specified value at the specified index of theHandTrigger
field.
-
Thumbstick
public OVRInputState Thumbstick(OVRVector2f.Buffer value)
Copies the specifiedOVRVector2f.Buffer
to theThumbstick
field.
-
Thumbstick
public OVRInputState Thumbstick(int index, OVRVector2f value)
Copies the specifiedOVRVector2f
at the specified index of theThumbstick
field.
-
ControllerType
public OVRInputState ControllerType(int value)
Sets the specified value to theControllerType
field.
-
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 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 ornull
if the address isNULL
.
-
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
-
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(MemoryStack stack)
Returns a newOVRInputState
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static OVRInputState callocStack(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, 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, 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
-
-