Top Description Fields Constructors Methods
org.lwjgl.openxr

public Class FBTriangleMesh

extends Object
Class Inheritance
Imports
java.nio.*, org.lwjgl.*, org.lwjgl.system.*

The XR_FB_triangle_mesh extension.

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:

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 extensions section.

Field Summary

Modifier and TypeField and Description
public static final String
public static final int
XR_FB_triangle_mesh_SPEC_VERSION

The extension specification version.

public static final int
XR_OBJECT_TYPE_TRIANGLE_MESH_FB

Extends XrObjectType.

public static final int
XR_TRIANGLE_MESH_MUTABLE_BIT_FB

XrTriangleMeshFlagBitsFB - XrTriangleMeshFlagBitsFB Flag Descriptions

public static final int
XR_TYPE_TRIANGLE_MESH_CREATE_INFO_FB

Extends XrStructureType.

public static final int
XR_WINDING_ORDER_CCW_FB

XrWindingOrderFB - Triangle winding order Enumerant Descriptions

public static final int
XR_WINDING_ORDER_CW_FB

XrWindingOrderFB - Triangle winding order Enumerant Descriptions

public static final int
XR_WINDING_ORDER_UNKNOWN_FB

XrWindingOrderFB - Triangle winding order Enumerant Descriptions

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
nxrCreateTriangleMeshFB(XrSession session, long createInfo, long outTriangleMesh)

Unsafe version of: CreateTriangleMeshFB

public static int
public static int
public static int
public static int
xrCreateTriangleMeshFB(XrSession
the XrSession to which the mesh will belong.
session
,
XrTriangleMeshCreateInfoFB
a pointer to an XrTriangleMeshCreateInfoFB structure containing parameters to be used to create the mesh.
createInfo
,
PointerBuffer
a pointer to a handle in which the created XrTriangleMeshFB is returned.
outTriangleMesh
)

Create a triangle mesh.

public static int
xrDestroyTriangleMeshFB(XrTriangleMeshFB
the XrTriangleMeshFB to destroy.
mesh
)

Destroy a triangle mesh.

public static int
xrTriangleMeshBeginUpdateFB(XrTriangleMeshFB
the XrTriangleMeshFB to update.
mesh
)

Begin an update of the mesh data.

public static int
xrTriangleMeshBeginVertexBufferUpdateFB(XrTriangleMeshFB
the XrTriangleMeshFB to update.
mesh
,
IntBuffer
a pointer to a value to populate with the current vertex count. The updated data must have the exact same number of vertices.
outVertexCount
)

Begin an update of the vertex data.

public static int
xrTriangleMeshEndUpdateFB(XrTriangleMeshFB
the XrTriangleMeshFB to update.
mesh
,
int
the vertex count after the update.
vertexCount
,
int
the triangle count after the update.
triangleCount
)

End an update of the mesh data.

public static int
xrTriangleMeshEndVertexBufferUpdateFB(XrTriangleMeshFB
the XrTriangleMeshFB to update.
mesh
)

End an update of the vertex data.

public static int
xrTriangleMeshGetIndexBufferFB(XrTriangleMeshFB
the XrTriangleMeshFB to get the index buffer for.
mesh
,
PointerBuffer
a pointer to return the index buffer into.
outIndexBuffer
)

Obtain the index buffer of a triangle mesh.

public static int
xrTriangleMeshGetVertexBufferFB(XrTriangleMeshFB
the XrTriangleMeshFB to get the vertex buffer for.
mesh
,
PointerBuffer
a pointer to return the vertex buffer into.
outVertexBuffer
)

Obtain the vertex buffer of a triangle mesh.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

XR_FB_TRIANGLE_MESH_EXTENSION_NAMEback to summary
public static final String XR_FB_TRIANGLE_MESH_EXTENSION_NAME

The extension name.

XR_FB_triangle_mesh_SPEC_VERSIONback to summary
public static final int XR_FB_triangle_mesh_SPEC_VERSION

The extension specification version.

XR_OBJECT_TYPE_TRIANGLE_MESH_FBback to summary
public static final int XR_OBJECT_TYPE_TRIANGLE_MESH_FB

Extends XrObjectType.

XR_TRIANGLE_MESH_MUTABLE_BIT_FBback to summary
public static final int XR_TRIANGLE_MESH_MUTABLE_BIT_FB

XrTriangleMeshFlagBitsFB - XrTriangleMeshFlagBitsFB

Flag Descriptions
XR_TYPE_TRIANGLE_MESH_CREATE_INFO_FBback to summary
public static final int XR_TYPE_TRIANGLE_MESH_CREATE_INFO_FB

Extends XrStructureType.

XR_WINDING_ORDER_CCW_FBback to summary
public static final int XR_WINDING_ORDER_CCW_FB

XrWindingOrderFB - Triangle winding order

Enumerant Descriptions
See Also

XrTriangleMeshCreateInfoFB

XR_WINDING_ORDER_CW_FBback to summary
public static final int XR_WINDING_ORDER_CW_FB

XrWindingOrderFB - Triangle winding order

Enumerant Descriptions
See Also

XrTriangleMeshCreateInfoFB

XR_WINDING_ORDER_UNKNOWN_FBback to summary
public static final int XR_WINDING_ORDER_UNKNOWN_FB

XrWindingOrderFB - Triangle winding order

Enumerant Descriptions
See Also

XrTriangleMeshCreateInfoFB

Constructor Detail

FBTriangleMeshback to summary
protected FBTriangleMesh()

Method Detail

nxrCreateTriangleMeshFBback to summary
public static int nxrCreateTriangleMeshFB(XrSession session, long createInfo, long outTriangleMesh)

Unsafe version of: CreateTriangleMeshFB

nxrTriangleMeshBeginVertexBufferUpdateFBback to summary
public static int nxrTriangleMeshBeginVertexBufferUpdateFB(XrTriangleMeshFB mesh, long outVertexCount)

Unsafe version of: TriangleMeshBeginVertexBufferUpdateFB

nxrTriangleMeshGetIndexBufferFBback to summary
public static int nxrTriangleMeshGetIndexBufferFB(XrTriangleMeshFB mesh, long outIndexBuffer)

Unsafe version of: TriangleMeshGetIndexBufferFB

nxrTriangleMeshGetVertexBufferFBback to summary
public static int nxrTriangleMeshGetVertexBufferFB(XrTriangleMeshFB mesh, long outVertexBuffer)

Unsafe version of: TriangleMeshGetVertexBufferFB

xrCreateTriangleMeshFBback to summary
public static int xrCreateTriangleMeshFB(XrSession session, XrTriangleMeshCreateInfoFB createInfo, PointerBuffer outTriangleMesh)

Create a triangle mesh.

C Specification

The CreateTriangleMeshFB function is defined as:


XrResult xrCreateTriangleMeshFB(
    XrSession                                   session,
    const XrTriangleMeshCreateInfoFB*           createInfo,
    XrTriangleMeshFB*                           outTriangleMesh);
Description

This creates an XrTriangleMeshFB handle. The returned triangle mesh handle may be subsequently used in API calls.

When the mesh is mutable (the TRIANGLE_MESH_MUTABLE_BIT_FB bit is set in createInfo→pname:flags), the created triangle mesh starts in the fb_triangle_mesh_state_undefined_topology state.

Immutable meshes have no state machine; they may be considered to be in state fb_triangle_mesh_state_ready with no valid edges leaving that state.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrTriangleMeshCreateInfoFB

Parameters
session:XrSession

the XrSession to which the mesh will belong.

createInfo:XrTriangleMeshCreateInfoFB

a pointer to an XrTriangleMeshCreateInfoFB structure containing parameters to be used to create the mesh.

outTriangleMesh:PointerBuffer

a pointer to a handle in which the created XrTriangleMeshFB is returned.

Annotations
@NativeType:XrResult
xrDestroyTriangleMeshFBback to summary
public static int xrDestroyTriangleMeshFB(XrTriangleMeshFB mesh)

Destroy a triangle mesh.

C Specification

The DestroyTriangleMeshFB function is defined as:


XrResult xrDestroyTriangleMeshFB(
    XrTriangleMeshFB                            mesh);
Description

XrTriangleMeshFB handles and their associated data are destroyed by DestroyTriangleMeshFB. The mesh buffers retrieved by TriangleMeshGetVertexBufferFB and TriangleMeshGetIndexBufferFB must not be accessed anymore after their parent mesh object has been destroyed.

Valid Usage (Implicit)
Thread Safety
Return Codes
On success, this command returns
On failure, this command returns
Parameters
mesh:XrTriangleMeshFB

the XrTriangleMeshFB to destroy.

Annotations
@NativeType:XrResult
xrTriangleMeshBeginUpdateFBback to summary
public static int xrTriangleMeshBeginUpdateFB(XrTriangleMeshFB mesh)

Begin an update of the mesh data.

C Specification

The TriangleMeshBeginUpdateFB function 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 TriangleMeshGetVertexBufferFB and TriangleMeshGetIndexBufferFB. If only the vertex buffer contents need to be updated, and the mesh is in state fb_triangle_mesh_state_ready, TriangleMeshBeginVertexBufferUpdateFB may be used instead. To commit the modifications, the application must call TriangleMeshEndUpdateFB.

The triangle mesh mesh must be mutable. The runtime must return ERROR_VALIDATION_FAILURE if the mesh is immutable.

The triangle mesh mesh must be in state fb_triangle_mesh_state_undefined_topology or fb_triangle_mesh_state_ready.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

TriangleMeshEndUpdateFB

Parameters
mesh:XrTriangleMeshFB

the XrTriangleMeshFB to update.

Annotations
@NativeType:XrResult
xrTriangleMeshBeginVertexBufferUpdateFBback to summary
public static int xrTriangleMeshBeginVertexBufferUpdateFB(XrTriangleMeshFB mesh, IntBuffer outVertexCount)

Begin an update of the vertex data.

C Specification

The TriangleMeshBeginVertexBufferUpdateFB function 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 outVertexCount is defined by the last call to TriangleMeshEndUpdateFB. Once the modification is done, call TriangleMeshEndVertexBufferUpdateFB to commit the changes and move to state fb_triangle_mesh_state_ready.

The triangle mesh mesh must be mutable. The runtime must return ERROR_VALIDATION_FAILURE if the mesh is immutable.

The triangle mesh mesh must be in state fb_triangle_mesh_state_ready.

A successful call moves mesh to state fb_triangle_mesh_state_updating_vertices.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

TriangleMeshBeginUpdateFB, TriangleMeshEndVertexBufferUpdateFB

Parameters
mesh:XrTriangleMeshFB

the XrTriangleMeshFB to update.

outVertexCount:IntBuffer

a pointer to a value to populate with the current vertex count. The updated data must have the exact same number of vertices.

Annotations
@NativeType:XrResult
xrTriangleMeshEndUpdateFBback to summary
public static int xrTriangleMeshEndUpdateFB(XrTriangleMeshFB mesh, int vertexCount, int triangleCount)

End an update of the mesh data.

C Specification

The TriangleMeshEndUpdateFB function 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. vertexCount and triangleCount specify 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 return ERROR_VALIDATION_FAILURE if an invalid count is passed.

The triangle mesh mesh must be mutable. The runtime must return ERROR_VALIDATION_FAILURE if the mesh is immutable.

The triangle mesh mesh must be in state fb_triangle_mesh_state_defining_topology or fb_triangle_mesh_state_updating_mesh.

A successful call moves mesh to state fb_triangle_mesh_state_ready.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

TriangleMeshBeginUpdateFB

Parameters
mesh:XrTriangleMeshFB

the XrTriangleMeshFB to update.

vertexCount:int

the vertex count after the update.

triangleCount:int

the triangle count after the update.

Annotations
@NativeType:XrResult
xrTriangleMeshEndVertexBufferUpdateFBback to summary
public static int xrTriangleMeshEndVertexBufferUpdateFB(XrTriangleMeshFB mesh)

End an update of the vertex data.

C Specification

The TriangleMeshEndVertexBufferUpdateFB function 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 mesh must be mutable. The runtime must return ERROR_VALIDATION_FAILURE if the mesh is immutable.

The triangle mesh mesh must be in state fb_triangle_mesh_state_updating_vertices.

A successful call moves mesh to state fb_triangle_mesh_state_ready.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

TriangleMeshBeginVertexBufferUpdateFB

Parameters
mesh:XrTriangleMeshFB

the XrTriangleMeshFB to update.

Annotations
@NativeType:XrResult
xrTriangleMeshGetIndexBufferFBback to summary
public static int xrTriangleMeshGetIndexBufferFB(XrTriangleMeshFB mesh, PointerBuffer outIndexBuffer)

Obtain the index buffer of a triangle mesh.

C Specification

The TriangleMeshGetIndexBufferFB function 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 buffer is XrTriangleMeshCreateInfoFB::indexCount elements. The buffer location is guaranteed to remain constant over the lifecycle of the mesh object.

A triangle mesh must be mutable and in state fb_triangle_mesh_state_defining_topology or fb_triangle_mesh_state_updating_mesh for the application to modify the contents and/or triangle count in the index buffer retrieved by this function.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

TriangleMeshGetVertexBufferFB

Parameters
mesh:XrTriangleMeshFB

the XrTriangleMeshFB to get the index buffer for.

outIndexBuffer:PointerBuffer

a pointer to return the index buffer into.

Annotations
@NativeType:XrResult
xrTriangleMeshGetVertexBufferFBback to summary
public static int xrTriangleMeshGetVertexBufferFB(XrTriangleMeshFB mesh, PointerBuffer outVertexBuffer)

Obtain the vertex buffer of a triangle mesh.

C Specification

The TriangleMeshGetVertexBufferFB function 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 is XrTriangleMeshCreateInfoFB::vertexCount elements. 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.

Valid Usage (Implicit)
Return Codes
On success, this command returns
On failure, this command returns
See Also

XrVector3f, TriangleMeshGetIndexBufferFB

Parameters
mesh:XrTriangleMeshFB

the XrTriangleMeshFB to get the vertex buffer for.

outVertexBuffer:PointerBuffer

a pointer to return the vertex buffer into.

Annotations
@NativeType:XrResult