Package org.lwjgl.ovr

Class 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

    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;
    }
    • Field Detail

      • SIZEOF

        public static final int SIZEOF
        The struct size in bytes.
    • Constructor Detail

      • OVRInputState

        public OVRInputState(java.nio.ByteBuffer container)
        Creates a OVRInputState instance at the current position of the specified ByteBuffer 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 the sizeof(struct).
        Specified by:
        sizeof in class Struct
      • TimeInSeconds

        public double TimeInSeconds()
        Returns the value of the TimeInSeconds field.
      • ConnectedControllerTypes

        public int ConnectedControllerTypes()
        Returns the value of the ConnectedControllerTypes field.
      • Buttons

        public int Buttons()
        Returns the value of the Buttons field.
      • Touches

        public int Touches()
        Returns the value of the Touches field.
      • IndexTrigger

        public java.nio.FloatBuffer IndexTrigger()
        Returns a FloatBuffer view of the IndexTrigger field.
      • IndexTrigger

        public float IndexTrigger(int index)
        Returns the value at the specified index of the IndexTrigger field.
      • HandTrigger

        public java.nio.FloatBuffer HandTrigger()
        Returns a FloatBuffer view of the HandTrigger field.
      • HandTrigger

        public float HandTrigger(int index)
        Returns the value at the specified index of the HandTrigger field.
      • Thumbstick

        public OVRVector2f Thumbstick(int index)
        Returns a OVRVector2f view of the struct at the specified index of the Thumbstick field.
      • ControllerType

        public int ControllerType()
        Returns the value of the ControllerType field.
      • TimeInSeconds

        public OVRInputState TimeInSeconds(double value)
        Sets the specified value to the TimeInSeconds field.
      • ConnectedControllerTypes

        public OVRInputState ConnectedControllerTypes(int value)
        Sets the specified value to the ConnectedControllerTypes field.
      • Buttons

        public OVRInputState Buttons(int value)
        Sets the specified value to the Buttons field.
      • Touches

        public OVRInputState Touches(int value)
        Sets the specified value to the Touches field.
      • IndexTrigger

        public OVRInputState IndexTrigger(java.nio.FloatBuffer value)
        Copies the specified FloatBuffer to the IndexTrigger field.
      • IndexTrigger

        public OVRInputState IndexTrigger(int index,
                                          float value)
        Sets the specified value at the specified index of the IndexTrigger field.
      • HandTrigger

        public OVRInputState HandTrigger(java.nio.FloatBuffer value)
        Copies the specified FloatBuffer to the HandTrigger field.
      • HandTrigger

        public OVRInputState HandTrigger(int index,
                                         float value)
        Sets the specified value at the specified index of the HandTrigger field.
      • ControllerType

        public OVRInputState ControllerType(int value)
        Sets the specified value to the ControllerType 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.
      • set

        public OVRInputState set(OVRInputState src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • create

        public static OVRInputState create(long address)
        Returns a new OVRInputState instance for the specified memory address or null if the address is NULL.
      • create

        public static OVRInputState.Buffer create(long address,
                                                  int capacity)
        Create a OVRInputState.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • callocStack

        public static OVRInputState callocStack(MemoryStack stack)
        Returns a new OVRInputState instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate