Package org.lwjgl.ovr

Class OVRVector2i

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

    public class OVRVector2i
    extends Struct
    implements NativeResource
    A 2D vector with integer components.

    Member documentation

    • x – the vector x component
    • y – the vector y component

    Layout

    
     struct ovrVector2i {
         int x;
         int y;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • X, Y

        The struct member offsets.
    • Constructor Detail

      • OVRVector2i

        public OVRVector2i​(java.nio.ByteBuffer container)
        Creates a OVRVector2i 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
      • x

        public int x()
        Returns the value of the x field.
      • y

        public int y()
        Returns the value of the y field.
      • x

        public OVRVector2i x​(int value)
        Sets the specified value to the x field.
      • y

        public OVRVector2i y​(int value)
        Sets the specified value to the y field.
      • set

        public OVRVector2i set​(int x,
                               int y)
        Initializes this struct with the specified values.
      • set

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

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

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

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

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

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

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

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

        public static OVRVector2i.Buffer callocStack​(int capacity,
                                                     MemoryStack stack)
        Returns a new OVRVector2i.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
      • nx

        public static int nx​(long struct)
        Unsafe version of x().
      • ny

        public static int ny​(long struct)
        Unsafe version of y().
      • nx

        public static void nx​(long struct,
                              int value)
        Unsafe version of x.
      • ny

        public static void ny​(long struct,
                              int value)
        Unsafe version of y.