Class XrHandMeshMSFT
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.openxr.XrHandMeshMSFT
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class XrHandMeshMSFT extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceThe data of a hand mesh.Description
When the returned
isActivevalue isFALSE, the runtime indicates the hand is not actively tracked, for example, the hand is outside of sensor’s range, or the input focus is taken away from the application. When the runtime returnsFALSEtoisActive, it must setindexBufferChangedandvertexBufferChangedtoFALSE, and must not change the content inindexBufferorvertexBuffer,When the returned
isActivevalue isTRUE, the hand tracking mesh represented inindexBufferandvertexBufferare updated to the latest data of thetimegiven to theUpdateHandMeshMSFTfunction. The runtime must setindexBufferChangedandvertexBufferChangedto reflect whether the index or vertex buffer’s content are changed during the update. In this way, the application can easily avoid unnecessary processing of buffers when there’s no new data.The hand mesh is represented in triangle lists and each triangle’s vertices are in clockwise order when looking from outside of the hand. When hand tracking is active, i.e. when
isActiveis returned asTRUE, the returnedindexBuffer.indexCountOutputvalue must be positive and multiple of 3, andvertexBuffer.vertexCountOutputvalue must be equal to or larger than 3.Valid Usage (Implicit)
- The
XR_MSFT_hand_tracking_meshextension must be enabled prior to usingXrHandMeshMSFT typemust beTYPE_HAND_MESH_MSFTnextmust beNULLor a valid pointer to the next structure in a structure chainindexBuffermust be a validXrHandMeshIndexBufferMSFTstructurevertexBuffermust be a validXrHandMeshVertexBufferMSFTstructure
See Also
XrHandMeshIndexBufferMSFT,XrHandMeshVertexBufferMSFT,UpdateHandMeshMSFTLayout
struct XrHandMeshMSFT { XrStructureTypetype(); void *next(); XrBool32isActive(); XrBool32indexBufferChanged(); XrBool32vertexBufferChanged();XrHandMeshIndexBufferMSFTindexBuffer();XrHandMeshVertexBufferMSFTvertexBuffer(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXrHandMeshMSFT.BufferAn array ofXrHandMeshMSFTstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intINDEXBUFFER
INDEXBUFFERCHANGED
ISACTIVE
NEXTThe struct member offsets.static intSIZEOFThe struct size in bytes.static intTYPE
VERTEXBUFFER
VERTEXBUFFERCHANGEDThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description XrHandMeshMSFT(java.nio.ByteBuffer container)Creates aXrHandMeshMSFTinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static XrHandMeshMSFTcalloc()Returns a newXrHandMeshMSFTinstance allocated withmemCalloc.static XrHandMeshMSFT.Buffercalloc(int capacity)Returns a newXrHandMeshMSFT.Bufferinstance allocated withmemCalloc.static XrHandMeshMSFT.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newXrHandMeshMSFT.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XrHandMeshMSFTcalloc(org.lwjgl.system.MemoryStack stack)Returns a newXrHandMeshMSFTinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XrHandMeshMSFTcreate()Returns a newXrHandMeshMSFTinstance allocated withBufferUtils.static XrHandMeshMSFT.Buffercreate(int capacity)Returns a newXrHandMeshMSFT.Bufferinstance allocated withBufferUtils.static XrHandMeshMSFTcreate(long address)Returns a newXrHandMeshMSFTinstance for the specified memory address.static XrHandMeshMSFT.Buffercreate(long address, int capacity)Create aXrHandMeshMSFT.Bufferinstance at the specified memory.static XrHandMeshMSFTcreateSafe(long address)static XrHandMeshMSFT.BuffercreateSafe(long address, int capacity)XrHandMeshIndexBufferMSFTindexBuffer()anXrHandMeshIndexBufferMSFTreturns the index buffer of the tracked hand mesh.XrHandMeshMSFTindexBuffer(java.util.function.Consumer<XrHandMeshIndexBufferMSFT> consumer)Passes theindexBuffer()field to the specifiedConsumer.XrHandMeshMSFTindexBuffer(XrHandMeshIndexBufferMSFT value)Copies the specifiedXrHandMeshIndexBufferMSFTto theindexBuffer()field.booleanindexBufferChanged()anXrBool32indicating if theindexBuffercontent was changed during the update.XrHandMeshMSFTindexBufferChanged(boolean value)Sets the specified value to theindexBufferChanged()field.booleanisActive()anXrBool32indicating if the current hand tracker is active.XrHandMeshMSFTisActive(boolean value)Sets the specified value to theisActive()field.static XrHandMeshMSFTmalloc()Returns a newXrHandMeshMSFTinstance allocated withmemAlloc.static XrHandMeshMSFT.Buffermalloc(int capacity)Returns a newXrHandMeshMSFT.Bufferinstance allocated withmemAlloc.static XrHandMeshMSFT.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newXrHandMeshMSFT.Bufferinstance allocated on the specifiedMemoryStack.static XrHandMeshMSFTmalloc(org.lwjgl.system.MemoryStack stack)Returns a newXrHandMeshMSFTinstance allocated on the specifiedMemoryStack.longnext()NULLor a pointer to the next structure in a structure chain.XrHandMeshMSFTnext(long value)Sets the specified value to thenext()field.static XrHandMeshIndexBufferMSFTnindexBuffer(long struct)Unsafe version ofindexBuffer().static voidnindexBuffer(long struct, XrHandMeshIndexBufferMSFT value)Unsafe version ofindexBuffer.static intnindexBufferChanged(long struct)Unsafe version ofindexBufferChanged().static voidnindexBufferChanged(long struct, int value)Unsafe version ofindexBufferChanged.static intnisActive(long struct)Unsafe version ofisActive().static voidnisActive(long struct, int value)Unsafe version ofisActive.static longnnext(long struct)Unsafe version ofnext().static voidnnext(long struct, long value)Unsafe version ofnext.static intntype(long struct)Unsafe version oftype().static voidntype(long struct, int value)Unsafe version oftype.static XrHandMeshVertexBufferMSFTnvertexBuffer(long struct)Unsafe version ofvertexBuffer().static voidnvertexBuffer(long struct, XrHandMeshVertexBufferMSFT value)Unsafe version ofvertexBuffer.static intnvertexBufferChanged(long struct)Unsafe version ofvertexBufferChanged().static voidnvertexBufferChanged(long struct, int value)Unsafe version ofvertexBufferChanged.XrHandMeshMSFTset(int type, long next, boolean isActive, boolean indexBufferChanged, boolean vertexBufferChanged, XrHandMeshIndexBufferMSFT indexBuffer, XrHandMeshVertexBufferMSFT vertexBuffer)Initializes this struct with the specified values.XrHandMeshMSFTset(XrHandMeshMSFT src)Copies the specified struct data to this struct.intsizeof()inttype()theXrStructureTypeof this structure.XrHandMeshMSFTtype(int value)Sets the specified value to thetype()field.XrHandMeshMSFTtype$Default()Sets theTYPE_HAND_MESH_MSFTvalue to thetype()field.static voidvalidate(long struct)Validates pointer members that should not beNULL.XrHandMeshVertexBufferMSFTvertexBuffer()anXrHandMeshVertexBufferMSFTreturns the vertex buffer of the tracked hand mesh.XrHandMeshMSFTvertexBuffer(java.util.function.Consumer<XrHandMeshVertexBufferMSFT> consumer)Passes thevertexBuffer()field to the specifiedConsumer.XrHandMeshMSFTvertexBuffer(XrHandMeshVertexBufferMSFT value)Copies the specifiedXrHandMeshVertexBufferMSFTto thevertexBuffer()field.booleanvertexBufferChanged()anXrBool32indicating if thevertexBuffercontent was changed during the update.XrHandMeshMSFTvertexBufferChanged(boolean value)Sets the specified value to thevertexBufferChanged()field.
-
-
-
Constructor Detail
-
XrHandMeshMSFT
public XrHandMeshMSFT(java.nio.ByteBuffer container)
Creates aXrHandMeshMSFTinstance 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
-
type
public int type()
theXrStructureTypeof this structure.
-
next
public long next()
NULLor a pointer to the next structure in a structure chain. No such structures are defined in core OpenXR or this extension.
-
isActive
public boolean isActive()
anXrBool32indicating if the current hand tracker is active.
-
indexBufferChanged
public boolean indexBufferChanged()
anXrBool32indicating if theindexBuffercontent was changed during the update.
-
vertexBufferChanged
public boolean vertexBufferChanged()
anXrBool32indicating if thevertexBuffercontent was changed during the update.
-
indexBuffer
public XrHandMeshIndexBufferMSFT indexBuffer()
anXrHandMeshIndexBufferMSFTreturns the index buffer of the tracked hand mesh.
-
vertexBuffer
public XrHandMeshVertexBufferMSFT vertexBuffer()
anXrHandMeshVertexBufferMSFTreturns the vertex buffer of the tracked hand mesh.
-
type
public XrHandMeshMSFT type(int value)
Sets the specified value to thetype()field.
-
type$Default
public XrHandMeshMSFT type$Default()
Sets theTYPE_HAND_MESH_MSFTvalue to thetype()field.
-
next
public XrHandMeshMSFT next(long value)
Sets the specified value to thenext()field.
-
isActive
public XrHandMeshMSFT isActive(boolean value)
Sets the specified value to theisActive()field.
-
indexBufferChanged
public XrHandMeshMSFT indexBufferChanged(boolean value)
Sets the specified value to theindexBufferChanged()field.
-
vertexBufferChanged
public XrHandMeshMSFT vertexBufferChanged(boolean value)
Sets the specified value to thevertexBufferChanged()field.
-
indexBuffer
public XrHandMeshMSFT indexBuffer(XrHandMeshIndexBufferMSFT value)
Copies the specifiedXrHandMeshIndexBufferMSFTto theindexBuffer()field.
-
indexBuffer
public XrHandMeshMSFT indexBuffer(java.util.function.Consumer<XrHandMeshIndexBufferMSFT> consumer)
Passes theindexBuffer()field to the specifiedConsumer.
-
vertexBuffer
public XrHandMeshMSFT vertexBuffer(XrHandMeshVertexBufferMSFT value)
Copies the specifiedXrHandMeshVertexBufferMSFTto thevertexBuffer()field.
-
vertexBuffer
public XrHandMeshMSFT vertexBuffer(java.util.function.Consumer<XrHandMeshVertexBufferMSFT> consumer)
Passes thevertexBuffer()field to the specifiedConsumer.
-
set
public XrHandMeshMSFT set(int type, long next, boolean isActive, boolean indexBufferChanged, boolean vertexBufferChanged, XrHandMeshIndexBufferMSFT indexBuffer, XrHandMeshVertexBufferMSFT vertexBuffer)
Initializes this struct with the specified values.
-
set
public XrHandMeshMSFT set(XrHandMeshMSFT src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static XrHandMeshMSFT malloc()
Returns a newXrHandMeshMSFTinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static XrHandMeshMSFT calloc()
Returns a newXrHandMeshMSFTinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static XrHandMeshMSFT create()
Returns a newXrHandMeshMSFTinstance allocated withBufferUtils.
-
create
public static XrHandMeshMSFT create(long address)
Returns a newXrHandMeshMSFTinstance for the specified memory address.
-
createSafe
@Nullable public static XrHandMeshMSFT createSafe(long address)
-
malloc
public static XrHandMeshMSFT.Buffer malloc(int capacity)
Returns a newXrHandMeshMSFT.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static XrHandMeshMSFT.Buffer calloc(int capacity)
Returns a newXrHandMeshMSFT.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static XrHandMeshMSFT.Buffer create(int capacity)
Returns a newXrHandMeshMSFT.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static XrHandMeshMSFT.Buffer create(long address, int capacity)
Create aXrHandMeshMSFT.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static XrHandMeshMSFT.Buffer createSafe(long address, int capacity)
-
malloc
public static XrHandMeshMSFT malloc(org.lwjgl.system.MemoryStack stack)
Returns a newXrHandMeshMSFTinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static XrHandMeshMSFT calloc(org.lwjgl.system.MemoryStack stack)
Returns a newXrHandMeshMSFTinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static XrHandMeshMSFT.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newXrHandMeshMSFT.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static XrHandMeshMSFT.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newXrHandMeshMSFT.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
ntype
public static int ntype(long struct)
Unsafe version oftype().
-
nnext
public static long nnext(long struct)
Unsafe version ofnext().
-
nisActive
public static int nisActive(long struct)
Unsafe version ofisActive().
-
nindexBufferChanged
public static int nindexBufferChanged(long struct)
Unsafe version ofindexBufferChanged().
-
nvertexBufferChanged
public static int nvertexBufferChanged(long struct)
Unsafe version ofvertexBufferChanged().
-
nindexBuffer
public static XrHandMeshIndexBufferMSFT nindexBuffer(long struct)
Unsafe version ofindexBuffer().
-
nvertexBuffer
public static XrHandMeshVertexBufferMSFT nvertexBuffer(long struct)
Unsafe version ofvertexBuffer().
-
ntype
public static void ntype(long struct, int value)Unsafe version oftype.
-
nnext
public static void nnext(long struct, long value)Unsafe version ofnext.
-
nisActive
public static void nisActive(long struct, int value)Unsafe version ofisActive.
-
nindexBufferChanged
public static void nindexBufferChanged(long struct, int value)Unsafe version ofindexBufferChanged.
-
nvertexBufferChanged
public static void nvertexBufferChanged(long struct, int value)Unsafe version ofvertexBufferChanged.
-
nindexBuffer
public static void nindexBuffer(long struct, XrHandMeshIndexBufferMSFT value)Unsafe version ofindexBuffer.
-
nvertexBuffer
public static void nvertexBuffer(long struct, XrHandMeshVertexBufferMSFT value)Unsafe version ofvertexBuffer.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
-