Class XrHandMeshIndexBufferMSFT

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<XrHandMeshIndexBufferMSFT>
org.lwjgl.openxr.XrHandMeshIndexBufferMSFT
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class XrHandMeshIndexBufferMSFT extends org.lwjgl.system.Struct<XrHandMeshIndexBufferMSFT> implements org.lwjgl.system.NativeResource
The index buffer of a hand mesh.
Description

An application should preallocate the indices array using the XrSystemHandTrackingMeshPropertiesMSFT::maxHandMeshIndexCount returned from GetSystemProperties. In this way, the application can avoid possible insufficient buffer sizees for each query, and therefore avoid reallocating memory each frame.

The input indexCapacityInput must not be 0, and indices must not be NULL, or else the runtime must return ERROR_VALIDATION_FAILURE on calls to the UpdateHandMeshMSFT function.

If the input indexCapacityInput is not sufficient to contain all output indices, the runtime must return ERROR_SIZE_INSUFFICIENT on calls to UpdateHandMeshMSFT, not change the content in indexBufferKey and indices, and return 0 for indexCountOutput.

If the input indexCapacityInput is equal to or larger than the XrSystemHandTrackingMeshPropertiesMSFT::maxHandMeshIndexCount returned from GetSystemProperties, the runtime must not return ERROR_SIZE_INSUFFICIENT error on UpdateHandMeshMSFT because of insufficient index buffer size.

If the input indexBufferKey is 0, the capacity of indices array is sufficient, and hand mesh tracking is active, the runtime must return the latest non-zero indexBufferKey, and fill in indexCountOutput and indices.

If the input indexBufferKey is not 0, the runtime can either return without changing indexCountOutput or content in indices, and return FALSE for XrHandMeshMSFT::indexBufferChanged indicating the indices are not changed; or return a new non-zero indexBufferKey and fill in latest data in indexCountOutput and indices, and return TRUE for XrHandMeshMSFT::indexBufferChanged indicating the indices are updated to a newer version.

An application can keep the XrHandMeshIndexBufferMSFT structure for each frame in a frame loop and use the returned indexBufferKey to identify different triangle list topology described in indices. The application can therefore avoid unnecessary processing of indices, such as coping them to GPU memory.

The runtime must return the same indexBufferKey for the same XrHandTrackerEXT at a given time, regardless of the input XrHandPoseTypeMSFT in XrHandMeshUpdateInfoMSFT. This ensures the index buffer has the same mesh topology and allows the application to reason about vertices across different hand pose types. For example, the application can build a procedure to perform UV mapping on vertices of a hand mesh using HAND_POSE_TYPE_REFERENCE_OPEN_PALM_MSFT, and apply the resultant UV data on vertices to the mesh returned from the same hand tracker using HAND_POSE_TYPE_TRACKED_MSFT.

Valid Usage (Implicit)
See Also

XrHandMeshMSFT, XrSystemHandTrackingMeshPropertiesMSFT, UpdateHandMeshMSFT

Layout


 struct XrHandMeshIndexBufferMSFT {
     uint32_t indexBufferKey();
     uint32_t indexCapacityInput();
     uint32_t indexCountOutput();
     uint32_t * indices();
 }
  • Field Details

    • SIZEOF

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

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

      public static final int INDEXBUFFERKEY
      The struct member offsets.
    • INDEXCAPACITYINPUT

      public static final int INDEXCAPACITYINPUT
      The struct member offsets.
    • INDEXCOUNTOUTPUT

      public static final int INDEXCOUNTOUTPUT
      The struct member offsets.
    • INDICES

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

    • XrHandMeshIndexBufferMSFT

      public XrHandMeshIndexBufferMSFT(ByteBuffer container)
      Creates a XrHandMeshIndexBufferMSFT 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()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<XrHandMeshIndexBufferMSFT>
    • indexBufferKey

      public int indexBufferKey()
      a uint32_t serving as the key of the returned index buffer content or 0 to indicate a request to retrieve the latest indices regardless of existing content in indices.
    • indexCapacityInput

      public int indexCapacityInput()
      a positive uint32_t describes the capacity of the indices array.
    • indexCountOutput

      public int indexCountOutput()
      a uint32_t returned by the runtime with the count of indices written in indices.
    • indices

      public @Nullable IntBuffer indices()
      an array of indices filled in by the runtime, specifying the indices of the triangles list in the vertex buffer.
    • indexBufferKey

      public XrHandMeshIndexBufferMSFT indexBufferKey(int value)
      Sets the specified value to the indexBufferKey() field.
    • indexCapacityInput

      public XrHandMeshIndexBufferMSFT indexCapacityInput(int value)
      Sets the specified value to the indexCapacityInput() field.
    • indexCountOutput

      public XrHandMeshIndexBufferMSFT indexCountOutput(int value)
      Sets the specified value to the indexCountOutput() field.
    • indices

      public XrHandMeshIndexBufferMSFT indices(@Nullable IntBuffer value)
      Sets the address of the specified IntBuffer to the indices() field.
    • set

      public XrHandMeshIndexBufferMSFT set(int indexBufferKey, int indexCapacityInput, int indexCountOutput, @Nullable IntBuffer indices)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static XrHandMeshIndexBufferMSFT.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new XrHandMeshIndexBufferMSFT.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
    • nindexBufferKey

      public static int nindexBufferKey(long struct)
      Unsafe version of indexBufferKey().
    • nindexCapacityInput

      public static int nindexCapacityInput(long struct)
      Unsafe version of indexCapacityInput().
    • nindexCountOutput

      public static int nindexCountOutput(long struct)
      Unsafe version of indexCountOutput().
    • nindices

      public static @Nullable IntBuffer nindices(long struct)
      Unsafe version of indices.
    • nindexBufferKey

      public static void nindexBufferKey(long struct, int value)
      Unsafe version of indexBufferKey.
    • nindexCapacityInput

      public static void nindexCapacityInput(long struct, int value)
      Sets the specified value to the indexCapacityInput field of the specified struct.
    • nindexCountOutput

      public static void nindexCountOutput(long struct, int value)
      Unsafe version of indexCountOutput.
    • nindices

      public static void nindices(long struct, @Nullable IntBuffer value)
      Unsafe version of indices.