Class XrHandMeshIndexBufferMSFT

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

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

    An application should preallocate the indices array using the maxHandMeshIndexCount in XrSystemHandTrackingMeshPropertiesMSFT 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 maxHandMeshIndexCount in XrSystemHandTrackingMeshPropertiesMSFT 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 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 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 Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • INDEXBUFFERKEY, INDEXCAPACITYINPUT, INDEXCOUNTOUTPUT, INDICES

        The struct member offsets.
    • Constructor Detail

      • XrHandMeshIndexBufferMSFT

        public XrHandMeshIndexBufferMSFT​(java.nio.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 Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • 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 java.nio.IntBuffer indices()
        an array of indices filled in by the runtime, specifying the indices of the triangles list in the vertex buffer.
      • set

        public XrHandMeshIndexBufferMSFT set​(int indexBufferKey,
                                             int indexCountOutput,
                                             java.nio.IntBuffer indices)
        Initializes this struct with the specified values.
      • 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.
      • 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
      • 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:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • 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 java.nio.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,
                                    java.nio.IntBuffer value)
        Unsafe version of indices.
      • validate

        public static void validate​(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate