Class VRControllerState

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

    public class VRControllerState
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Holds all the state of a controller at one moment in time.

    Layout

    
     struct VRControllerState_t {
         uint32_t unPacketNum();
         uint64_t ulButtonPressed();
         uint64_t ulButtonTouched;
         VRControllerAxis_t rAxis()[5];
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • UNPACKETNUM, ULBUTTONPRESSED, ULBUTTONTOUCHED, RAXIS

        The struct member offsets.
    • Constructor Detail

      • VRControllerState

        public VRControllerState​(java.nio.ByteBuffer container)
        Creates a VRControllerState 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()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • unPacketNum

        public int unPacketNum()
        If packet num matches that on your prior call, then the controller state hasn't been changed since your last call and there is no need to process it.
      • ulButtonPressed

        public long ulButtonPressed()
        bit flags for each of the buttons. Use ButtonMaskFromId to turn an ID into a mask
      • ulButtonTouched

        public long ulButtonTouched()
        Returns:
        the value of the ulButtonTouched field.
      • ulButtonTouched

        public VRControllerState ulButtonTouched​(long value)
        Sets the specified value to the ulButtonTouched field.
      • malloc

        public static VRControllerState malloc()
        Returns a new VRControllerState instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static VRControllerState calloc()
        Returns a new VRControllerState instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static VRControllerState create()
        Returns a new VRControllerState instance allocated with BufferUtils.
      • create

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

        @Nullable
        public static VRControllerState createSafe​(long address)
        Like create, but returns null if address is NULL.
      • createSafe

        @Nullable
        public static VRControllerState.Buffer createSafe​(long address,
                                                          int capacity)
        Like create, but returns null if address is NULL.
      • mallocStack

        @Deprecated
        public static VRControllerState mallocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

        @Deprecated
        public static VRControllerState callocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
      • malloc

        public static VRControllerState malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new VRControllerState instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static VRControllerState calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new VRControllerState instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • malloc

        public static VRControllerState.Buffer malloc​(int capacity,
                                                      org.lwjgl.system.MemoryStack stack)
        Returns a new VRControllerState.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • calloc

        public static VRControllerState.Buffer calloc​(int capacity,
                                                      org.lwjgl.system.MemoryStack stack)
        Returns a new VRControllerState.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nunPacketNum

        public static int nunPacketNum​(long struct)
        Unsafe version of unPacketNum().
      • nulButtonPressed

        public static long nulButtonPressed​(long struct)
        Unsafe version of ulButtonPressed().
      • nulButtonTouched

        public static long nulButtonTouched​(long struct)
        Unsafe version of ulButtonTouched().
      • nunPacketNum

        public static void nunPacketNum​(long struct,
                                        int value)
        Unsafe version of unPacketNum.
      • nulButtonPressed

        public static void nulButtonPressed​(long struct,
                                            long value)
        Unsafe version of ulButtonPressed.
      • nulButtonTouched

        public static void nulButtonTouched​(long struct,
                                            long value)
        Unsafe version of ulButtonTouched.
      • nrAxis

        public static void nrAxis​(long struct,
                                  int index,
                                  VRControllerAxis value)
        Unsafe version of rAxis.