Class XrHandMeshVertexBufferMSFT
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.openxr.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.NativeResourceThe vertex buffer of a hand mesh.Description
An application should preallocate the vertices array using the
maxHandMeshVertexCountinXrSystemHandTrackingMeshPropertiesMSFTreturned fromGetSystemProperties. In this way, the application can avoid possible insufficient buffer sizes for each query, and therefore avoid reallocating memory each frame.The input
vertexCapacityInputmust not be 0, andverticesmust not beNULL, or else the runtime must returnERROR_VALIDATION_FAILUREon calls to theUpdateHandMeshMSFTfunction.If the input
vertexCapacityInputis not sufficient to contain all output vertices, the runtime must returnERROR_SIZE_INSUFFICIENTon calls to theUpdateHandMeshMSFT, do not change content invertexUpdateTimeandvertices, and return 0 forvertexCountOutput.If the input
vertexCapacityInputis equal to or larger than themaxHandMeshVertexCountinXrSystemHandTrackingMeshPropertiesMSFTreturned fromGetSystemProperties, the runtime must not returnERROR_SIZE_INSUFFICIENTon calls to theUpdateHandMeshMSFTbecause of insufficient vertex buffer size.If the input
vertexUpdateTimeis 0, and the capacity of the vertices array is sufficient, and hand mesh tracking is active, the runtime must return the latest non-zerovertexUpdateTime, and fill in thevertexCountOutputandverticesfields.If the input
vertexUpdateTimeis not 0, the runtime can either return without changingvertexCountOutputor the content invertices, and returnFALSEforvertexBufferChangedindicating the vertices are not changed; or return a new non-zerovertexUpdateTimeand fill in latest data invertexCountOutputandverticesand returnTRUEforvertexBufferChangedindicating the vertices are updated to a newer version.An application can keep the
XrHandMeshVertexBufferMSFTstructure for each frame in frame loop and use the returnedvertexUpdateTimeto detect the changes of the content invertices. The application can therefore avoid unnecessary processing of vertices, such as coping them to GPU memory.Valid Usage (Implicit)
- The
XR_MSFT_hand_tracking_meshextension must be enabled prior to usingXrHandMeshVertexBufferMSFT verticesmust be a pointer to an array ofvertexCapacityInputXrHandMeshVertexMSFTstructures- The
vertexCapacityInputparameter must be greater than 0
See Also
XrHandMeshMSFT,XrHandMeshVertexMSFT,XrSystemHandTrackingMeshPropertiesMSFT,UpdateHandMeshMSFTLayout
struct XrHandMeshVertexBufferMSFT { XrTimevertexUpdateTime(); uint32_tvertexCapacityInput(); uint32_tvertexCountOutput();XrHandMeshVertexMSFT*vertices(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXrHandMeshVertexBufferMSFT.BufferAn array ofXrHandMeshVertexBufferMSFTstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intSIZEOFThe struct size in bytes.static intVERTEXCAPACITYINPUT
VERTEXCOUNTOUTPUT
VERTEXUPDATETIME
VERTICESThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description XrHandMeshVertexBufferMSFT(java.nio.ByteBuffer container)Creates aXrHandMeshVertexBufferMSFTinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XrHandMeshVertexBufferMSFTcalloc()Returns a newXrHandMeshVertexBufferMSFTinstance allocated withmemCalloc.static XrHandMeshVertexBufferMSFT.Buffercalloc(int capacity)Returns a newXrHandMeshVertexBufferMSFT.Bufferinstance allocated withmemCalloc.static XrHandMeshVertexBufferMSFT.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newXrHandMeshVertexBufferMSFT.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XrHandMeshVertexBufferMSFTcalloc(org.lwjgl.system.MemoryStack stack)Returns a newXrHandMeshVertexBufferMSFTinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XrHandMeshVertexBufferMSFTcreate()Returns a newXrHandMeshVertexBufferMSFTinstance allocated withBufferUtils.static XrHandMeshVertexBufferMSFT.Buffercreate(int capacity)Returns a newXrHandMeshVertexBufferMSFT.Bufferinstance allocated withBufferUtils.static XrHandMeshVertexBufferMSFTcreate(long address)Returns a newXrHandMeshVertexBufferMSFTinstance for the specified memory address.static XrHandMeshVertexBufferMSFT.Buffercreate(long address, int capacity)Create aXrHandMeshVertexBufferMSFT.Bufferinstance at the specified memory.static XrHandMeshVertexBufferMSFTcreateSafe(long address)static XrHandMeshVertexBufferMSFT.BuffercreateSafe(long address, int capacity)static XrHandMeshVertexBufferMSFTmalloc()Returns a newXrHandMeshVertexBufferMSFTinstance allocated withmemAlloc.static XrHandMeshVertexBufferMSFT.Buffermalloc(int capacity)Returns a newXrHandMeshVertexBufferMSFT.Bufferinstance allocated withmemAlloc.static XrHandMeshVertexBufferMSFT.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newXrHandMeshVertexBufferMSFT.Bufferinstance allocated on the specifiedMemoryStack.static XrHandMeshVertexBufferMSFTmalloc(org.lwjgl.system.MemoryStack stack)Returns a newXrHandMeshVertexBufferMSFTinstance allocated on the specifiedMemoryStack.static intnvertexCapacityInput(long struct)Unsafe version ofvertexCapacityInput().static voidnvertexCapacityInput(long struct, int value)Sets the specified value to thevertexCapacityInputfield of the specifiedstruct.static intnvertexCountOutput(long struct)Unsafe version ofvertexCountOutput().static voidnvertexCountOutput(long struct, int value)Unsafe version ofvertexCountOutput.static longnvertexUpdateTime(long struct)Unsafe version ofvertexUpdateTime().static voidnvertexUpdateTime(long struct, long value)Unsafe version ofvertexUpdateTime.static XrHandMeshVertexMSFT.Buffernvertices(long struct)Unsafe version ofvertices().static voidnvertices(long struct, XrHandMeshVertexMSFT.Buffer value)Unsafe version ofvertices.XrHandMeshVertexBufferMSFTset(long vertexUpdateTime, int vertexCountOutput, XrHandMeshVertexMSFT.Buffer vertices)Initializes this struct with the specified values.XrHandMeshVertexBufferMSFTset(XrHandMeshVertexBufferMSFT src)Copies the specified struct data to this struct.intsizeof()static voidvalidate(long struct)Validates pointer members that should not beNULL.intvertexCapacityInput()a positiveuint32_tdescribes the capacity of theverticesarray.intvertexCountOutput()auint32_tfilled in by the runtime with the count of vertices written invertices.XrHandMeshVertexBufferMSFTvertexCountOutput(int value)Sets the specified value to thevertexCountOutput()field.longvertexUpdateTime()anXrTimerepresenting the time when the runtime receives the vertex buffer content or 0 to indicate a request to retrieve latest vertices regardless of existing content invertices.XrHandMeshVertexBufferMSFTvertexUpdateTime(long value)Sets the specified value to thevertexUpdateTime()field.XrHandMeshVertexMSFT.Buffervertices()an array ofXrHandMeshVertexMSFTfilled in by the runtime, specifying the vertices of the hand mesh including the position and normal vector in the hand mesh space.XrHandMeshVertexBufferMSFTvertices(XrHandMeshVertexMSFT.Buffer value)Sets the address of the specifiedXrHandMeshVertexMSFT.Bufferto thevertices()field.
-
-
-
Constructor Detail
-
XrHandMeshVertexBufferMSFT
public XrHandMeshVertexBufferMSFT(java.nio.ByteBuffer container)
Creates aXrHandMeshVertexBufferMSFTinstance 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
-
vertexUpdateTime
public long vertexUpdateTime()
anXrTimerepresenting the time when the runtime receives the vertex buffer content or 0 to indicate a request to retrieve latest vertices regardless of existing content invertices.
-
vertexCapacityInput
public int vertexCapacityInput()
a positiveuint32_tdescribes the capacity of theverticesarray.
-
vertexCountOutput
public int vertexCountOutput()
auint32_tfilled in by the runtime with the count of vertices written invertices.
-
vertices
public XrHandMeshVertexMSFT.Buffer vertices()
an array ofXrHandMeshVertexMSFTfilled in by the runtime, specifying the vertices of the hand mesh including the position and normal vector in the hand mesh space.
-
vertexUpdateTime
public XrHandMeshVertexBufferMSFT vertexUpdateTime(long value)
Sets the specified value to thevertexUpdateTime()field.
-
vertexCountOutput
public XrHandMeshVertexBufferMSFT vertexCountOutput(int value)
Sets the specified value to thevertexCountOutput()field.
-
vertices
public XrHandMeshVertexBufferMSFT vertices(XrHandMeshVertexMSFT.Buffer value)
Sets the address of the specifiedXrHandMeshVertexMSFT.Bufferto thevertices()field.
-
set
public XrHandMeshVertexBufferMSFT set(long vertexUpdateTime, int vertexCountOutput, XrHandMeshVertexMSFT.Buffer vertices)
Initializes this struct with the specified values.
-
set
public XrHandMeshVertexBufferMSFT set(XrHandMeshVertexBufferMSFT src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static XrHandMeshVertexBufferMSFT malloc()
Returns a newXrHandMeshVertexBufferMSFTinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static XrHandMeshVertexBufferMSFT calloc()
Returns a newXrHandMeshVertexBufferMSFTinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static XrHandMeshVertexBufferMSFT create()
Returns a newXrHandMeshVertexBufferMSFTinstance allocated withBufferUtils.
-
create
public static XrHandMeshVertexBufferMSFT create(long address)
Returns a newXrHandMeshVertexBufferMSFTinstance for the specified memory address.
-
createSafe
@Nullable public static XrHandMeshVertexBufferMSFT createSafe(long address)
-
malloc
public static XrHandMeshVertexBufferMSFT.Buffer malloc(int capacity)
Returns a newXrHandMeshVertexBufferMSFT.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static XrHandMeshVertexBufferMSFT.Buffer calloc(int capacity)
Returns a newXrHandMeshVertexBufferMSFT.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static XrHandMeshVertexBufferMSFT.Buffer create(int capacity)
Returns a newXrHandMeshVertexBufferMSFT.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static XrHandMeshVertexBufferMSFT.Buffer create(long address, int capacity)
Create aXrHandMeshVertexBufferMSFT.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static XrHandMeshVertexBufferMSFT.Buffer createSafe(long address, int capacity)
-
malloc
public static XrHandMeshVertexBufferMSFT malloc(org.lwjgl.system.MemoryStack stack)
Returns a newXrHandMeshVertexBufferMSFTinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static XrHandMeshVertexBufferMSFT calloc(org.lwjgl.system.MemoryStack stack)
Returns a newXrHandMeshVertexBufferMSFTinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static XrHandMeshVertexBufferMSFT.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newXrHandMeshVertexBufferMSFT.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static XrHandMeshVertexBufferMSFT.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newXrHandMeshVertexBufferMSFT.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nvertexUpdateTime
public static long nvertexUpdateTime(long struct)
Unsafe version ofvertexUpdateTime().
-
nvertexCapacityInput
public static int nvertexCapacityInput(long struct)
Unsafe version ofvertexCapacityInput().
-
nvertexCountOutput
public static int nvertexCountOutput(long struct)
Unsafe version ofvertexCountOutput().
-
nvertices
public static XrHandMeshVertexMSFT.Buffer nvertices(long struct)
Unsafe version ofvertices().
-
nvertexUpdateTime
public static void nvertexUpdateTime(long struct, long value)Unsafe version ofvertexUpdateTime.
-
nvertexCapacityInput
public static void nvertexCapacityInput(long struct, int value)Sets the specified value to thevertexCapacityInputfield of the specifiedstruct.
-
nvertexCountOutput
public static void nvertexCountOutput(long struct, int value)Unsafe version ofvertexCountOutput.
-
nvertices
public static void nvertices(long struct, XrHandMeshVertexMSFT.Buffer value)Unsafe version ofvertices.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
-