Class XrSpheref

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer
Direct Known Subclasses:
XrSpherefKHR

public class XrSpheref extends Struct<XrSpheref> implements NativeResource

 struct XrSpheref {
     {@link XrPosef XrPosef} center;
     float radius;
 }
  • Field Details

    • SIZEOF

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

      public static final int ALIGNOF
      The struct alignment in bytes.
    • CENTER

      public static final int CENTER
      The struct member offsets.
    • RADIUS

      public static final int RADIUS
      The struct member offsets.
  • Constructor Details

    • XrSpheref

      public XrSpheref(ByteBuffer container)
      Creates a XrSpheref 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 Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<XrSpheref>
    • center

      public XrPosef center()
      Returns:
      a XrPosef view of the center field.
    • radius

      public float radius()
      Returns:
      the value of the radius field.
    • center

      public XrSpheref center(XrPosef value)
      Copies the specified XrPosef to the center field.
    • center

      public XrSpheref center(Consumer<XrPosef> consumer)
      Passes the center field to the specified Consumer.
    • radius

      public XrSpheref radius(float value)
      Sets the specified value to the radius field.
    • set

      public XrSpheref set(XrPosef center, float radius)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

      public static XrSpheref.Buffer malloc(int capacity)
      Returns a new XrSpheref.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static XrSpheref.Buffer calloc(int capacity)
      Returns a new XrSpheref.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static XrSpheref.Buffer create(int capacity)
      Returns a new XrSpheref.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

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

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

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

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

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

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

      public static XrPosef ncenter(long struct)
      Unsafe version of center().
    • nradius

      public static float nradius(long struct)
      Unsafe version of radius().
    • ncenter

      public static void ncenter(long struct, XrPosef value)
      Unsafe version of center.
    • nradius

      public static void nradius(long struct, float value)
      Unsafe version of radius.