Package org.lwjgl.ovr

Class OVRInputState

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class OVRInputState
    extends Struct
    implements NativeResource
    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 Buttons;
         unsigned int Touches;
         float IndexTrigger[ovrHand_Count];
         float HandTrigger[ovrHand_Count];
         ovrVector2f Thumbstick[ovrHand_Count];
         ovrControllerType ControllerType;
         float IndexTriggerNoDeadzone[ovrHand_Count];
         float HandTriggerNoDeadzone[ovrHand_Count];
         ovrVector2f ThumbstickNoDeadzone[ovrHand_Count];
         float IndexTriggerRaw[ovrHand_Count];
         float HandTriggerRaw[ovrHand_Count];
         ovrVector2f ThumbstickRaw[ovrHand_Count];
     }
    • 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 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 sizeof(struct).
        Specified by:
        sizeof in class Struct
      • TimeInSeconds

        public double TimeInSeconds()
        Returns the value of the TimeInSeconds 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.
      • IndexTriggerNoDeadzone

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

        public float IndexTriggerNoDeadzone​(int index)
        Returns the value at the specified index of the IndexTriggerNoDeadzone field.
      • HandTriggerNoDeadzone

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

        public float HandTriggerNoDeadzone​(int index)
        Returns the value at the specified index of the HandTriggerNoDeadzone field.
      • ThumbstickNoDeadzone

        public OVRVector2f ThumbstickNoDeadzone​(int index)
        Returns a OVRVector2f view of the struct at the specified index of the ThumbstickNoDeadzone field.
      • IndexTriggerRaw

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

        public float IndexTriggerRaw​(int index)
        Returns the value at the specified index of the IndexTriggerRaw field.
      • HandTriggerRaw

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

        public float HandTriggerRaw​(int index)
        Returns the value at the specified index of the HandTriggerRaw field.
      • ThumbstickRaw

        public OVRVector2f ThumbstickRaw​(int index)
        Returns a OVRVector2f view of the struct at the specified index of the ThumbstickRaw field.
      • create

        public static OVRInputState create​(long address)
        Returns a new OVRInputState instance for the specified memory address.
      • createSafe

        @Nullable
        public static OVRInputState createSafe​(long address)
        Like create, but returns null if 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
      • createSafe

        @Nullable
        public static OVRInputState.Buffer createSafe​(long address,
                                                      int capacity)
        Like create, but returns null if address is NULL.
      • 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
      • nTimeInSeconds

        public static double nTimeInSeconds​(long struct)
        Unsafe version of TimeInSeconds().
      • nButtons

        public static int nButtons​(long struct)
        Unsafe version of Buttons().
      • nTouches

        public static int nTouches​(long struct)
        Unsafe version of Touches().
      • nIndexTrigger

        public static java.nio.FloatBuffer nIndexTrigger​(long struct)
        Unsafe version of IndexTrigger().
      • nIndexTrigger

        public static float nIndexTrigger​(long struct,
                                          int index)
        Unsafe version of IndexTrigger.
      • nHandTrigger

        public static java.nio.FloatBuffer nHandTrigger​(long struct)
        Unsafe version of HandTrigger().
      • nHandTrigger

        public static float nHandTrigger​(long struct,
                                         int index)
        Unsafe version of HandTrigger.
      • nThumbstick

        public static OVRVector2f nThumbstick​(long struct,
                                              int index)
        Unsafe version of Thumbstick.
      • nControllerType

        public static int nControllerType​(long struct)
        Unsafe version of ControllerType().
      • nIndexTriggerNoDeadzone

        public static java.nio.FloatBuffer nIndexTriggerNoDeadzone​(long struct)
        Unsafe version of IndexTriggerNoDeadzone().
      • nIndexTriggerNoDeadzone

        public static float nIndexTriggerNoDeadzone​(long struct,
                                                    int index)
        Unsafe version of IndexTriggerNoDeadzone.
      • nHandTriggerNoDeadzone

        public static java.nio.FloatBuffer nHandTriggerNoDeadzone​(long struct)
        Unsafe version of HandTriggerNoDeadzone().
      • nHandTriggerNoDeadzone

        public static float nHandTriggerNoDeadzone​(long struct,
                                                   int index)
        Unsafe version of HandTriggerNoDeadzone.
      • nIndexTriggerRaw

        public static java.nio.FloatBuffer nIndexTriggerRaw​(long struct)
        Unsafe version of IndexTriggerRaw().
      • nIndexTriggerRaw

        public static float nIndexTriggerRaw​(long struct,
                                             int index)
        Unsafe version of IndexTriggerRaw.
      • nHandTriggerRaw

        public static java.nio.FloatBuffer nHandTriggerRaw​(long struct)
        Unsafe version of HandTriggerRaw().
      • nHandTriggerRaw

        public static float nHandTriggerRaw​(long struct,
                                            int index)
        Unsafe version of HandTriggerRaw.
      • nThumbstickRaw

        public static OVRVector2f nThumbstickRaw​(long struct,
                                                 int index)
        Unsafe version of ThumbstickRaw.