Class XrHandMeshVertexBufferMSFT

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

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

    An application should preallocate the vertices array using the maxHandMeshVertexCount in XrSystemHandTrackingMeshPropertiesMSFT returned from GetSystemProperties. In this way, the application can avoid possible insufficient buffer sizes for each query, and therefore avoid reallocating memory each frame.

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

    If the input vertexCapacityInput is not sufficient to contain all output vertices, the runtime must return ERROR_SIZE_INSUFFICIENT on calls to the UpdateHandMeshMSFT, do not change content in vertexUpdateTime and vertices, and return 0 for vertexCountOutput.

    If the input vertexCapacityInput is equal to or larger than the maxHandMeshVertexCount in XrSystemHandTrackingMeshPropertiesMSFT returned from GetSystemProperties, the runtime must not return ERROR_SIZE_INSUFFICIENT on calls to the UpdateHandMeshMSFT because of insufficient vertex buffer size.

    If the input vertexUpdateTime is 0, and the capacity of the vertices array is sufficient, and hand mesh tracking is active, the runtime must return the latest non-zero vertexUpdateTime, and fill in the vertexCountOutput and vertices fields.

    If the input vertexUpdateTime is not 0, the runtime can either return without changing vertexCountOutput or the content in vertices, and return FALSE for vertexBufferChanged indicating the vertices are not changed; or return a new non-zero vertexUpdateTime and fill in latest data in vertexCountOutput and vertices and return TRUE for vertexBufferChanged indicating the vertices are updated to a newer version.

    An application can keep the XrHandMeshVertexBufferMSFT structure for each frame in frame loop and use the returned vertexUpdateTime to detect the changes of the content in vertices. The application can therefore avoid unnecessary processing of vertices, such as coping them to GPU memory.

    Valid Usage (Implicit)
    See Also

    XrHandMeshMSFT, XrHandMeshVertexMSFT, XrSystemHandTrackingMeshPropertiesMSFT, UpdateHandMeshMSFT

    Layout

    
     struct XrHandMeshVertexBufferMSFT {
         XrTime vertexUpdateTime();
         uint32_t vertexCapacityInput();
         uint32_t vertexCountOutput();
         XrHandMeshVertexMSFT * vertices();
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • VERTEXUPDATETIME, VERTEXCAPACITYINPUT, VERTEXCOUNTOUTPUT, VERTICES

        The struct member offsets.
    • Constructor Detail

      • XrHandMeshVertexBufferMSFT

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

        public long vertexUpdateTime()
        an XrTime representing the time when the runtime receives the vertex buffer content or 0 to indicate a request to retrieve latest vertices regardless of existing content in vertices.
      • vertexCapacityInput

        public int vertexCapacityInput()
        a positive uint32_t describes the capacity of the vertices array.
      • vertexCountOutput

        public int vertexCountOutput()
        a uint32_t filled in by the runtime with the count of vertices written in vertices.
      • malloc

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

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

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

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

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

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

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

        public static long nvertexUpdateTime​(long struct)
        Unsafe version of vertexUpdateTime().
      • nvertexCapacityInput

        public static int nvertexCapacityInput​(long struct)
        Unsafe version of vertexCapacityInput().
      • nvertexCountOutput

        public static int nvertexCountOutput​(long struct)
        Unsafe version of vertexCountOutput().
      • nvertexUpdateTime

        public static void nvertexUpdateTime​(long struct,
                                             long value)
        Unsafe version of vertexUpdateTime.
      • nvertexCapacityInput

        public static void nvertexCapacityInput​(long struct,
                                                int value)
        Sets the specified value to the vertexCapacityInput field of the specified struct.
      • nvertexCountOutput

        public static void nvertexCountOutput​(long struct,
                                              int value)
        Unsafe version of vertexCountOutput.
      • validate

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