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.

    Member documentation

    • 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 – bit flags for each of the buttons. Use ButtonMaskFromId to turn an ID into a mask
    • rAxis[5] – axis data for the controller's analog inputs

    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()
        Returns the value of the unPacketNum field.
      • ulButtonPressed

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

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

        public VRControllerState unPacketNum​(int value)
        Sets the specified value to the unPacketNum field.
      • ulButtonPressed

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

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

        public VRControllerState rAxis​(int index,
                                       java.util.function.Consumer<VRControllerAxis> consumer)
        Passes the element at index of the rAxis field to the specified Consumer.
      • 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

        public static VRControllerState mallocStack()
        Returns a new VRControllerState instance allocated on the thread-local MemoryStack.
      • callocStack

        public static VRControllerState callocStack()
        Returns a new VRControllerState instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

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

        public static VRControllerState callocStack​(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
      • callocStack

        public static VRControllerState.Buffer callocStack​(int capacity)
        Returns a new VRControllerState.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

        public static VRControllerState.Buffer mallocStack​(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
      • callocStack

        public static VRControllerState.Buffer callocStack​(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.