Class FBTriangleMesh
Meshes may be useful in XR applications when representing parts of the environment. In particular, application may provide the surfaces of real-world objects tagged manually to the runtime, or obtain automatically detected environment contents.
This extension allows:
- An application to create a triangle mesh and specify the mesh data.
- An application to update mesh contents if a mesh is mutable.
In order to enable the functionality of this extension, the application must pass the name of the extension into CreateInstance via the XrInstanceCreateInfo::enabledExtensionNames parameter as indicated in the extension section.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extension name.static final intThe extension specification version.static final intExtendsXrObjectType.static final intXrTriangleMeshFlagBitsFB - XrTriangleMeshFlagBitsFBstatic final intExtendsXrStructureType.static final intXrWindingOrderFB - Triangle winding orderstatic final intXrWindingOrderFB - Triangle winding orderstatic final intXrWindingOrderFB - Triangle winding order -
Method Summary
Modifier and TypeMethodDescriptionstatic intnxrCreateTriangleMeshFB(XrSession session, long createInfo, long outTriangleMesh) Unsafe version of:CreateTriangleMeshFBstatic intnxrTriangleMeshBeginVertexBufferUpdateFB(XrTriangleMeshFB mesh, long outVertexCount) Unsafe version of:TriangleMeshBeginVertexBufferUpdateFBstatic intnxrTriangleMeshGetIndexBufferFB(XrTriangleMeshFB mesh, long outIndexBuffer) Unsafe version of:TriangleMeshGetIndexBufferFBstatic intnxrTriangleMeshGetVertexBufferFB(XrTriangleMeshFB mesh, long outVertexBuffer) Unsafe version of:TriangleMeshGetVertexBufferFBstatic intxrCreateTriangleMeshFB(XrSession session, XrTriangleMeshCreateInfoFB createInfo, org.lwjgl.PointerBuffer outTriangleMesh) Create a triangle mesh.static intDestroy a triangle mesh.static intBegin an update of the mesh data.static intxrTriangleMeshBeginVertexBufferUpdateFB(XrTriangleMeshFB mesh, IntBuffer outVertexCount) Begin an update of the vertex data.static intxrTriangleMeshEndUpdateFB(XrTriangleMeshFB mesh, int vertexCount, int triangleCount) End an update of the mesh data.static intEnd an update of the vertex data.static intxrTriangleMeshGetIndexBufferFB(XrTriangleMeshFB mesh, org.lwjgl.PointerBuffer outIndexBuffer) Obtain the index buffer of a triangle mesh.static intxrTriangleMeshGetVertexBufferFB(XrTriangleMeshFB mesh, org.lwjgl.PointerBuffer outVertexBuffer) Obtain the vertex buffer of a triangle mesh.
-
Field Details
-
XR_FB_triangle_mesh_SPEC_VERSION
public static final int XR_FB_triangle_mesh_SPEC_VERSIONThe extension specification version.- See Also:
-
XR_FB_TRIANGLE_MESH_EXTENSION_NAME
The extension name.- See Also:
-
XR_TYPE_TRIANGLE_MESH_CREATE_INFO_FB
public static final int XR_TYPE_TRIANGLE_MESH_CREATE_INFO_FBExtendsXrStructureType.- See Also:
-
XR_OBJECT_TYPE_TRIANGLE_MESH_FB
public static final int XR_OBJECT_TYPE_TRIANGLE_MESH_FBExtendsXrObjectType.- See Also:
-
XR_TRIANGLE_MESH_MUTABLE_BIT_FB
public static final int XR_TRIANGLE_MESH_MUTABLE_BIT_FBXrTriangleMeshFlagBitsFB - XrTriangleMeshFlagBitsFBFlag Descriptions
TRIANGLE_MESH_MUTABLE_BIT_FB— The triangle mesh is mutable (can be modified after it is created).
- See Also:
-
XR_WINDING_ORDER_UNKNOWN_FB
public static final int XR_WINDING_ORDER_UNKNOWN_FBXrWindingOrderFB - Triangle winding orderEnumerant Descriptions
WINDING_ORDER_UNKNOWN_FB— Winding order is unknown and the runtime cannot make any assumptions on the triangle orientationWINDING_ORDER_CW_FB— Clockwise winding orderWINDING_ORDER_CCW_FB— Counter-clockwise winding order
See Also
- See Also:
-
XR_WINDING_ORDER_CW_FB
public static final int XR_WINDING_ORDER_CW_FBXrWindingOrderFB - Triangle winding orderEnumerant Descriptions
WINDING_ORDER_UNKNOWN_FB— Winding order is unknown and the runtime cannot make any assumptions on the triangle orientationWINDING_ORDER_CW_FB— Clockwise winding orderWINDING_ORDER_CCW_FB— Counter-clockwise winding order
See Also
- See Also:
-
XR_WINDING_ORDER_CCW_FB
public static final int XR_WINDING_ORDER_CCW_FBXrWindingOrderFB - Triangle winding orderEnumerant Descriptions
WINDING_ORDER_UNKNOWN_FB— Winding order is unknown and the runtime cannot make any assumptions on the triangle orientationWINDING_ORDER_CW_FB— Clockwise winding orderWINDING_ORDER_CCW_FB— Counter-clockwise winding order
See Also
- See Also:
-
-
Method Details
-
nxrCreateTriangleMeshFB
Unsafe version of:CreateTriangleMeshFB -
xrCreateTriangleMeshFB
public static int xrCreateTriangleMeshFB(XrSession session, XrTriangleMeshCreateInfoFB createInfo, org.lwjgl.PointerBuffer outTriangleMesh) Create a triangle mesh.C Specification
The
CreateTriangleMeshFBfunction is defined as:XrResult xrCreateTriangleMeshFB( XrSession session, const XrTriangleMeshCreateInfoFB* createInfo, XrTriangleMeshFB* outTriangleMesh);Description
This creates an
XrTriangleMeshFBhandle. The returned triangle mesh handle may be subsequently used in API calls.When the mesh is mutable (the
TRIANGLE_MESH_MUTABLE_BIT_FBbit is set inXrTriangleMeshCreateInfoFB::flags), the created triangle mesh starts in the Undefined Topology state.Immutable meshes have no state machine; they may be considered to be in state Ready with no valid edges leaving that state.
Valid Usage (Implicit)
- The
XR_FB_triangle_meshextension must be enabled prior to callingCreateTriangleMeshFB sessionmust be a validXrSessionhandlecreateInfomust be a pointer to a validXrTriangleMeshCreateInfoFBstructureoutTriangleMeshmust be a pointer to anXrTriangleMeshFBhandle
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
session- theXrSessionto which the mesh will belong.createInfo- a pointer to anXrTriangleMeshCreateInfoFBstructure containing parameters to be used to create the mesh.outTriangleMesh- a pointer to a handle in which the createdXrTriangleMeshFBis returned.
- The
-
xrDestroyTriangleMeshFB
Destroy a triangle mesh.C Specification
The
DestroyTriangleMeshFBfunction is defined as:XrResult xrDestroyTriangleMeshFB( XrTriangleMeshFB mesh);Description
XrTriangleMeshFBhandles and their associated data are destroyed byDestroyTriangleMeshFB. The mesh buffers retrieved byTriangleMeshGetVertexBufferFBandTriangleMeshGetIndexBufferFBmust not be accessed anymore after their parent mesh object has been destroyed.Valid Usage (Implicit)
- The
XR_FB_triangle_meshextension must be enabled prior to callingDestroyTriangleMeshFB meshmust be a validXrTriangleMeshFBhandle
Thread Safety
- Access to
mesh, and any child handles, must be externally synchronized - Access to the buffers returned from calls to
TriangleMeshGetVertexBufferFBandTriangleMeshGetIndexBufferFBonmeshmust be externally synchronized
Return Codes
- On success, this command returns
- On failure, this command returns
- Parameters:
mesh- theXrTriangleMeshFBto destroy.
- The
-
nxrTriangleMeshGetVertexBufferFB
Unsafe version of:TriangleMeshGetVertexBufferFB -
xrTriangleMeshGetVertexBufferFB
public static int xrTriangleMeshGetVertexBufferFB(XrTriangleMeshFB mesh, org.lwjgl.PointerBuffer outVertexBuffer) Obtain the vertex buffer of a triangle mesh.C Specification
The
TriangleMeshGetVertexBufferFBfunction is defined as:XrResult xrTriangleMeshGetVertexBufferFB( XrTriangleMeshFB mesh, XrVector3f** outVertexBuffer);Description
Retrieves a pointer to the vertex buffer. The vertex buffer is structured as an array of
XrVector3f. The size of the buffer isXrTriangleMeshCreateInfoFB::vertexCountelements. The buffer location is guaranteed to remain constant over the lifecycle of the mesh object.A mesh must be mutable and in a specific state for the application to modify it through the retrieved vertex buffer.
- A mutable triangle mesh must be in state Defining Topology, Updating Mesh, or Updating Vertices to modify the contents of the vertex buffer retrieved by this function.
- A mutable triangle mesh must be in state Defining Topology or Updating Mesh to modify the count of elements in the vertex buffer retrieved by this function. The new count is passed as a parameter to
TriangleMeshEndUpdateFB.
Valid Usage (Implicit)
- The
XR_FB_triangle_meshextension must be enabled prior to callingTriangleMeshGetVertexBufferFB meshmust be a validXrTriangleMeshFBhandleoutVertexBuffermust be a pointer to a pointer to anXrVector3fstructure
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
mesh- theXrTriangleMeshFBto get the vertex buffer for.outVertexBuffer- a pointer to return the vertex buffer into.
-
nxrTriangleMeshGetIndexBufferFB
Unsafe version of:TriangleMeshGetIndexBufferFB -
xrTriangleMeshGetIndexBufferFB
public static int xrTriangleMeshGetIndexBufferFB(XrTriangleMeshFB mesh, org.lwjgl.PointerBuffer outIndexBuffer) Obtain the index buffer of a triangle mesh.C Specification
The
TriangleMeshGetIndexBufferFBfunction is defined as:XrResult xrTriangleMeshGetIndexBufferFB( XrTriangleMeshFB mesh, uint32_t** outIndexBuffer);Description
Retrieves a pointer to the index buffer that defines the topology of the triangle mesh. Each triplet of consecutive elements points to three vertices in the vertex buffer and thus form a triangle. The size of the index buffer is
3 *elements. The buffer location is guaranteed to remain constant over the lifecycle of the mesh object.XrTriangleMeshCreateInfoFB::triangleCountA triangle mesh must be mutable and in state Defining Topology or Updating Mesh for the application to modify the contents and/or triangle count in the index buffer retrieved by this function.
Valid Usage (Implicit)
- The
XR_FB_triangle_meshextension must be enabled prior to callingTriangleMeshGetIndexBufferFB meshmust be a validXrTriangleMeshFBhandleoutIndexBuffermust be a pointer to a pointer to auint32_tvalue
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
mesh- theXrTriangleMeshFBto get the index buffer for.outIndexBuffer- a pointer to return the index buffer into.
- The
-
xrTriangleMeshBeginUpdateFB
Begin an update of the mesh data.C Specification
The
TriangleMeshBeginUpdateFBfunction is defined as:XrResult xrTriangleMeshBeginUpdateFB( XrTriangleMeshFB mesh);Description
Begins updating the mesh buffer data. The application must call this function before it makes any modifications to the buffers retrieved by
TriangleMeshGetVertexBufferFBandTriangleMeshGetIndexBufferFB. If only the vertex buffer contents need to be updated, and the mesh is in state Ready,TriangleMeshBeginVertexBufferUpdateFBmay be used instead. To commit the modifications, the application must callTriangleMeshEndUpdateFB.The triangle mesh
meshmust be mutable. The runtime must returnERROR_VALIDATION_FAILUREif the mesh is immutable.The triangle mesh
meshmust be in state Undefined Topology or Ready.- If the triangle mesh is in state Undefined Topology before this call, a successful call moves it to state Defining Topology.
- If the triangle mesh is in state Ready before this call, a successful call moves it to state Updating Mesh.
Valid Usage (Implicit)
- The
XR_FB_triangle_meshextension must be enabled prior to callingTriangleMeshBeginUpdateFB meshmust be a validXrTriangleMeshFBhandle
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
mesh- theXrTriangleMeshFBto update.
-
xrTriangleMeshEndUpdateFB
public static int xrTriangleMeshEndUpdateFB(XrTriangleMeshFB mesh, int vertexCount, int triangleCount) End an update of the mesh data.C Specification
The
TriangleMeshEndUpdateFBfunction is defined as:XrResult xrTriangleMeshEndUpdateFB( XrTriangleMeshFB mesh, uint32_t vertexCount, uint32_t triangleCount);Description
Signals to the runtime that the application has finished initially populating or updating the mesh buffers.
vertexCountandtriangleCountspecify the actual number of primitives that make up the mesh after the update. They must be larger than zero but smaller or equal to the maximum counts defined at create time. The runtime must returnERROR_VALIDATION_FAILUREif an invalid count is passed.The triangle mesh
meshmust be mutable. The runtime must returnERROR_VALIDATION_FAILUREif the mesh is immutable.The triangle mesh
meshmust be in state Defining Topology or Updating Mesh.A successful call moves
meshto state Ready.Valid Usage (Implicit)
- The
XR_FB_triangle_meshextension must be enabled prior to callingTriangleMeshEndUpdateFB meshmust be a validXrTriangleMeshFBhandle
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
mesh- theXrTriangleMeshFBto update.vertexCount- the vertex count after the update.triangleCount- the triangle count after the update.
- The
-
nxrTriangleMeshBeginVertexBufferUpdateFB
public static int nxrTriangleMeshBeginVertexBufferUpdateFB(XrTriangleMeshFB mesh, long outVertexCount) Unsafe version of:TriangleMeshBeginVertexBufferUpdateFB -
xrTriangleMeshBeginVertexBufferUpdateFB
public static int xrTriangleMeshBeginVertexBufferUpdateFB(XrTriangleMeshFB mesh, IntBuffer outVertexCount) Begin an update of the vertex data.C Specification
The
TriangleMeshBeginVertexBufferUpdateFBfunction is defined as:XrResult xrTriangleMeshBeginVertexBufferUpdateFB( XrTriangleMeshFB mesh, uint32_t* outVertexCount);Description
Begins an update of the vertex positions of a mutable triangle mesh. The vertex count returned through
outVertexCountis defined by the last call toTriangleMeshEndUpdateFB. Once the modification is done, callTriangleMeshEndVertexBufferUpdateFBto commit the changes and move to state Ready.The triangle mesh
meshmust be mutable. The runtime must returnERROR_VALIDATION_FAILUREif the mesh is immutable.The triangle mesh
meshmust be in state Ready.A successful call moves
meshto state Updating Vertices.Valid Usage (Implicit)
- The
XR_FB_triangle_meshextension must be enabled prior to callingTriangleMeshBeginVertexBufferUpdateFB meshmust be a validXrTriangleMeshFBhandleoutVertexCountmust be a pointer to auint32_tvalue
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
TriangleMeshBeginUpdateFB,TriangleMeshEndVertexBufferUpdateFB- Parameters:
mesh- theXrTriangleMeshFBto update.outVertexCount- a pointer to a value to populate with the current vertex count. The updated data must have the exact same number of vertices.
- The
-
xrTriangleMeshEndVertexBufferUpdateFB
End an update of the vertex data.C Specification
The
TriangleMeshEndVertexBufferUpdateFBfunction is defined as:XrResult xrTriangleMeshEndVertexBufferUpdateFB( XrTriangleMeshFB mesh);Description
Signals to the runtime that the application has finished updating the vertex buffer data following a call to
TriangleMeshBeginVertexBufferUpdateFB.The triangle mesh
meshmust be mutable. The runtime must returnERROR_VALIDATION_FAILUREif the mesh is immutable.The triangle mesh
meshmust be in state Updating Vertices.A successful call moves
meshto state Ready.Valid Usage (Implicit)
- The
XR_FB_triangle_meshextension must be enabled prior to callingTriangleMeshEndVertexBufferUpdateFB meshmust be a validXrTriangleMeshFBhandle
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
mesh- theXrTriangleMeshFBto update.
- The
-