Class XrHandMeshIndexBufferMSFT
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.openxr.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.NativeResourceThe index buffer of a hand mesh.Description
An application should preallocate the indices array using the
maxHandMeshIndexCountinXrSystemHandTrackingMeshPropertiesMSFTreturned fromGetSystemProperties. In this way, the application can avoid possible insufficient buffer sizees for each query, and therefore avoid reallocating memory each frame.The input
indexCapacityInputmust not be 0, andindicesmust not beNULL, or else the runtime must returnERROR_VALIDATION_FAILUREon calls to theUpdateHandMeshMSFTfunction.If the input
indexCapacityInputis not sufficient to contain all output indices, the runtime must returnERROR_SIZE_INSUFFICIENTon calls toUpdateHandMeshMSFT, not change the content inindexBufferKeyandindices, and return 0 forindexCountOutput.If the input
indexCapacityInputis equal to or larger than themaxHandMeshIndexCountinXrSystemHandTrackingMeshPropertiesMSFTreturned fromGetSystemProperties, the runtime must not returnERROR_SIZE_INSUFFICIENTerror onUpdateHandMeshMSFTbecause of insufficient index buffer size.If the input
indexBufferKeyis 0, the capacity of indices array is sufficient, and hand mesh tracking is active, the runtime must return the latest non-zeroindexBufferKey, and fill inindexCountOutputandindices.If the input
indexBufferKeyis not 0, the runtime can either return without changingindexCountOutputor content inindices, and returnFALSEforindexBufferChangedindicating the indices are not changed; or return a new non-zeroindexBufferKeyand fill in latest data inindexCountOutputandindices, and returnTRUEforindexBufferChangedindicating the indices are updated to a newer version.An application can keep the
XrHandMeshIndexBufferMSFTstructure for each frame in a frame loop and use the returnedindexBufferKeyto identify different triangle list topology described inindices. The application can therefore avoid unnecessary processing of indices, such as coping them to GPU memory.The runtime must return the same
indexBufferKeyfor the sameXrHandTrackerEXTat a given time, regardless of the inputXrHandPoseTypeMSFTinXrHandMeshUpdateInfoMSFT. 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 usingHAND_POSE_TYPE_REFERENCE_OPEN_PALM_MSFT, and apply the resultant UV data on vertices to the mesh returned from the same hand tracker usingHAND_POSE_TYPE_TRACKED_MSFT.Valid Usage (Implicit)
- The
XR_MSFT_hand_tracking_meshextension must be enabled prior to usingXrHandMeshIndexBufferMSFT indicesmust be a pointer to an array ofindexCapacityInputuint32_tvalues- The
indexCapacityInputparameter must be greater than 0
See Also
XrHandMeshMSFT,XrSystemHandTrackingMeshPropertiesMSFT,UpdateHandMeshMSFTLayout
struct XrHandMeshIndexBufferMSFT { uint32_tindexBufferKey(); uint32_tindexCapacityInput(); uint32_tindexCountOutput(); uint32_t *indices(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXrHandMeshIndexBufferMSFT.BufferAn array ofXrHandMeshIndexBufferMSFTstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intINDEXBUFFERKEY
INDEXCAPACITYINPUT
INDEXCOUNTOUTPUT
INDICESThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description XrHandMeshIndexBufferMSFT(java.nio.ByteBuffer container)Creates aXrHandMeshIndexBufferMSFTinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XrHandMeshIndexBufferMSFTcalloc()Returns a newXrHandMeshIndexBufferMSFTinstance allocated withmemCalloc.static XrHandMeshIndexBufferMSFT.Buffercalloc(int capacity)Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated withmemCalloc.static XrHandMeshIndexBufferMSFT.Buffercalloc(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.static XrHandMeshIndexBufferMSFT.Buffercreate(int capacity)Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated withBufferUtils.static XrHandMeshIndexBufferMSFTcreate(long address)Returns a newXrHandMeshIndexBufferMSFTinstance for the specified memory address.static XrHandMeshIndexBufferMSFT.Buffercreate(long address, int capacity)Create aXrHandMeshIndexBufferMSFT.Bufferinstance at the specified memory.static XrHandMeshIndexBufferMSFTcreateSafe(long address)static XrHandMeshIndexBufferMSFT.BuffercreateSafe(long address, int capacity)intindexBufferKey()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.XrHandMeshIndexBufferMSFTindexBufferKey(int value)Sets the specified value to theindexBufferKey()field.intindexCapacityInput()a positiveuint32_tdescribes the capacity of theindicesarray.intindexCountOutput()auint32_treturned by the runtime with the count of indices written inindices.XrHandMeshIndexBufferMSFTindexCountOutput(int value)Sets the specified value to theindexCountOutput()field.java.nio.IntBufferindices()an array of indices filled in by the runtime, specifying the indices of the triangles list in the vertex buffer.XrHandMeshIndexBufferMSFTindices(java.nio.IntBuffer value)Sets the address of the specifiedIntBufferto theindices()field.static XrHandMeshIndexBufferMSFTmalloc()Returns a newXrHandMeshIndexBufferMSFTinstance allocated withmemAlloc.static XrHandMeshIndexBufferMSFT.Buffermalloc(int capacity)Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated withmemAlloc.static XrHandMeshIndexBufferMSFT.Buffermalloc(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 java.nio.IntBuffernindices(long struct)Unsafe version ofindices.static voidnindices(long struct, java.nio.IntBuffer value)Unsafe version ofindices.XrHandMeshIndexBufferMSFTset(int indexBufferKey, int indexCountOutput, java.nio.IntBuffer indices)Initializes this struct with the specified values.XrHandMeshIndexBufferMSFTset(XrHandMeshIndexBufferMSFT src)Copies the specified struct data to this struct.intsizeof()static voidvalidate(long struct)Validates pointer members that should not beNULL.
-
-
-
Constructor Detail
-
XrHandMeshIndexBufferMSFT
public XrHandMeshIndexBufferMSFT(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
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
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.
-
indexBufferKey
public XrHandMeshIndexBufferMSFT indexBufferKey(int value)
Sets the specified value to theindexBufferKey()field.
-
indexCountOutput
public XrHandMeshIndexBufferMSFT indexCountOutput(int value)
Sets the specified value to theindexCountOutput()field.
-
indices
public XrHandMeshIndexBufferMSFT indices(java.nio.IntBuffer value)
Sets the address of the specifiedIntBufferto theindices()field.
-
set
public XrHandMeshIndexBufferMSFT set(int indexBufferKey, int indexCountOutput, java.nio.IntBuffer indices)
Initializes this struct with the specified values.
-
set
public XrHandMeshIndexBufferMSFT set(XrHandMeshIndexBufferMSFT src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static XrHandMeshIndexBufferMSFT malloc()
Returns a newXrHandMeshIndexBufferMSFTinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static XrHandMeshIndexBufferMSFT calloc()
Returns a newXrHandMeshIndexBufferMSFTinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static XrHandMeshIndexBufferMSFT create()
Returns a newXrHandMeshIndexBufferMSFTinstance allocated withBufferUtils.
-
create
public static XrHandMeshIndexBufferMSFT create(long address)
Returns a newXrHandMeshIndexBufferMSFTinstance for the specified memory address.
-
createSafe
@Nullable public static XrHandMeshIndexBufferMSFT createSafe(long address)
-
malloc
public static XrHandMeshIndexBufferMSFT.Buffer malloc(int capacity)
Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static XrHandMeshIndexBufferMSFT.Buffer calloc(int capacity)
Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static XrHandMeshIndexBufferMSFT.Buffer create(int capacity)
Returns a newXrHandMeshIndexBufferMSFT.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static XrHandMeshIndexBufferMSFT.Buffer create(long address, int capacity)
Create aXrHandMeshIndexBufferMSFT.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static XrHandMeshIndexBufferMSFT.Buffer createSafe(long address, int capacity)
-
malloc
public static XrHandMeshIndexBufferMSFT malloc(org.lwjgl.system.MemoryStack stack)
Returns a newXrHandMeshIndexBufferMSFTinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static XrHandMeshIndexBufferMSFT calloc(org.lwjgl.system.MemoryStack stack)
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:
stack- the stack from which to allocatecapacity- the buffer capacity
-
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:
stack- the stack from which to allocatecapacity- the buffer capacity
-
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
public static java.nio.IntBuffer nindices(long struct)
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
public static void nindices(long struct, java.nio.IntBuffer value)Unsafe version ofindices.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
-