Class XrHandMeshIndexBufferMSFT
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
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)
- The
XR_MSFT_hand_tracking_meshextension must be enabled prior to usingXrHandMeshIndexBufferMSFT - If
indexCapacityInputis not 0,indicesmust be a pointer to an array ofindexCapacityInputuint32_tvalues
See Also
XrHandMeshMSFT, XrSystemHandTrackingMeshPropertiesMSFT, UpdateHandMeshMSFT
Layout
struct XrHandMeshIndexBufferMSFT {
uint32_t indexBufferKey();
uint32_t indexCapacityInput();
uint32_t indexCountOutput();
uint32_t * indices();
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionXrHandMeshIndexBufferMSFT(ByteBuffer container) Creates aXrHandMeshIndexBufferMSFTinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic XrHandMeshIndexBufferMSFTcalloc()Returns a newXrHandMeshIndexBufferMSFTinstance allocated withmemCalloc.calloc(int capacity) Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated withmemCalloc.calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XrHandMeshIndexBufferMSFTcalloc(org.lwjgl.system.MemoryStack stack) Returns a newXrHandMeshIndexBufferMSFTinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XrHandMeshIndexBufferMSFTcreate()Returns a newXrHandMeshIndexBufferMSFTinstance allocated withBufferUtils.create(int capacity) Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated withBufferUtils.static XrHandMeshIndexBufferMSFTcreate(long address) Returns a newXrHandMeshIndexBufferMSFTinstance for the specified memory address.create(long address, int capacity) Create aXrHandMeshIndexBufferMSFT.Bufferinstance at the specified memory.static @Nullable XrHandMeshIndexBufferMSFTcreateSafe(long address) static @Nullable XrHandMeshIndexBufferMSFT.BuffercreateSafe(long address, int capacity) intauint32_tserving as the key of the returned index buffer content or 0 to indicate a request to retrieve the latest indices regardless of existing content inindices.indexBufferKey(int value) Sets the specified value to theindexBufferKey()field.inta positiveuint32_tdescribes the capacity of theindicesarray.indexCapacityInput(int value) Sets the specified value to theindexCapacityInput()field.intauint32_treturned by the runtime with the count of indices written inindices.indexCountOutput(int value) Sets the specified value to theindexCountOutput()field.@Nullable IntBufferindices()an array of indices filled in by the runtime, specifying the indices of the triangles list in the vertex buffer.static XrHandMeshIndexBufferMSFTmalloc()Returns a newXrHandMeshIndexBufferMSFTinstance allocated withmemAlloc.malloc(int capacity) Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated withmemAlloc.malloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated on the specifiedMemoryStack.static XrHandMeshIndexBufferMSFTmalloc(org.lwjgl.system.MemoryStack stack) Returns a newXrHandMeshIndexBufferMSFTinstance allocated on the specifiedMemoryStack.static intnindexBufferKey(long struct) Unsafe version ofindexBufferKey().static voidnindexBufferKey(long struct, int value) Unsafe version ofindexBufferKey.static intnindexCapacityInput(long struct) Unsafe version ofindexCapacityInput().static voidnindexCapacityInput(long struct, int value) Sets the specified value to theindexCapacityInputfield of the specifiedstruct.static intnindexCountOutput(long struct) Unsafe version ofindexCountOutput().static voidnindexCountOutput(long struct, int value) Unsafe version ofindexCountOutput.static @Nullable IntBuffernindices(long struct) Unsafe version ofindices.static voidUnsafe version ofindices.Initializes this struct with the specified values.Copies the specified struct data to this struct.intsizeof()Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
INDEXBUFFERKEY
public static final int INDEXBUFFERKEYThe struct member offsets. -
INDEXCAPACITYINPUT
public static final int INDEXCAPACITYINPUTThe struct member offsets. -
INDEXCOUNTOUTPUT
public static final int INDEXCOUNTOUTPUTThe struct member offsets. -
INDICES
public static final int INDICESThe struct member offsets.
-
-
Constructor Details
-
XrHandMeshIndexBufferMSFT
Creates aXrHandMeshIndexBufferMSFTinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct<XrHandMeshIndexBufferMSFT>
-
indexBufferKey
public int indexBufferKey()auint32_tserving as the key of the returned index buffer content or 0 to indicate a request to retrieve the latest indices regardless of existing content inindices. -
indexCapacityInput
public int indexCapacityInput()a positiveuint32_tdescribes the capacity of theindicesarray. -
indexCountOutput
public int indexCountOutput()auint32_treturned by the runtime with the count of indices written inindices. -
indices
an array of indices filled in by the runtime, specifying the indices of the triangles list in the vertex buffer. -
indexBufferKey
Sets the specified value to theindexBufferKey()field. -
indexCapacityInput
Sets the specified value to theindexCapacityInput()field. -
indexCountOutput
Sets the specified value to theindexCountOutput()field. -
indices
-
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
Returns a newXrHandMeshIndexBufferMSFTinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newXrHandMeshIndexBufferMSFTinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newXrHandMeshIndexBufferMSFTinstance allocated withBufferUtils. -
create
Returns a newXrHandMeshIndexBufferMSFTinstance for the specified memory address. -
createSafe
-
malloc
Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aXrHandMeshIndexBufferMSFT.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newXrHandMeshIndexBufferMSFTinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newXrHandMeshIndexBufferMSFTinstance allocated on the specifiedMemoryStackand 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 newXrHandMeshIndexBufferMSFT.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
public static XrHandMeshIndexBufferMSFT.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nindexBufferKey
public static int nindexBufferKey(long struct) Unsafe version ofindexBufferKey(). -
nindexCapacityInput
public static int nindexCapacityInput(long struct) Unsafe version ofindexCapacityInput(). -
nindexCountOutput
public static int nindexCountOutput(long struct) Unsafe version ofindexCountOutput(). -
nindices
Unsafe version ofindices. -
nindexBufferKey
public static void nindexBufferKey(long struct, int value) Unsafe version ofindexBufferKey. -
nindexCapacityInput
public static void nindexCapacityInput(long struct, int value) Sets the specified value to theindexCapacityInputfield of the specifiedstruct. -
nindexCountOutput
public static void nindexCountOutput(long struct, int value) Unsafe version ofindexCountOutput. -
nindices
Unsafe version ofindices.
-