ArMesh

Represents a polygon mesh describing geometry.

Obtained by ArStreetscapeGeometry_acquireMesh.

Summary

Typedefs

ArMesh typedef
struct ArMesh_
A triangulated mesh representing a surface reconstruction of the scene.

Functions

ArMesh_getIndexList(const ArSession *session, const ArMesh *mesh, const uint32_t **out_indices)
void
Retrieves the triangle data for this mesh in an array of length ArMesh_getIndexListSize.
ArMesh_getIndexListSize(const ArSession *session, const ArMesh *mesh, int32_t *out_num_indices)
void
Retrieves the number of triangle indices (represented by ArMesh_getIndexList) in this mesh.
ArMesh_getVertexList(const ArSession *session, const ArMesh *mesh, const float **out_vertex_positions_xyz)
void
Retrieves the vertex coordinate data for this mesh.
ArMesh_getVertexListSize(const ArSession *session, const ArMesh *mesh, int32_t *out_num_vertices)
void
Retrieves the number of vertices in this mesh.
ArMesh_release(ArMesh *mesh)
void
Releases a reference to the Mesh.

Typedefs

ArMesh

struct ArMesh_ ArMesh

A triangulated mesh representing a surface reconstruction of the scene.

(reference type, large data).

Functions

ArMesh_getIndexList

void ArMesh_getIndexList(
  const ArSession *session,
  const ArMesh *mesh,
  const uint32_t **out_indices
)

Retrieves the triangle data for this mesh in an array of length ArMesh_getIndexListSize.

Each face is a triplet of indices into the vertices array. The indices should always be used as a triangle list, with three indices per triangle. The result can be passed as the "indices" parameter to glDrawElements or copied into a buffer bound via vkCmdBindIndexBuffer.

Details
Parameters
session
The ARCore session.
mesh
The mesh object to query.
out_indices
Where to store the concatenated indices of mesh vertices that correspond to each face. This length is out_num_indices from ArMesh_getIndexListSize().

ArMesh_getIndexListSize

void ArMesh_getIndexListSize(
  const ArSession *session,
  const ArMesh *mesh,
  int32_t *out_num_indices
)

Retrieves the number of triangle indices (represented by ArMesh_getIndexList) in this mesh.

The indices should always be used as a triangle list, with three indices per triangle. The result can be passed as the indices parameter to glDrawElements or copied into a buffer bound via vkCmdDrawIndexed .

Details
Parameters
session
The ARCore session.
mesh
The mesh object to query.
out_num_indices
The number of indices in this mesh. This will always be a multiple of 3.

ArMesh_getVertexList

void ArMesh_getVertexList(
  const ArSession *session,
  const ArMesh *mesh,
  const float **out_vertex_positions_xyz
)

Retrieves the vertex coordinate data for this mesh.

Each vertex is three float values, stored in XYZ order. The total number of float values in out_vertex_positions_xyz is 3 * ArMesh_getVertexListSize.

The array returned in out_vertex_positions_xyz will only remain valid as long as mesh is valid.

Details
Parameters
session
The ARCore session.
mesh
The mesh object to query.
out_vertex_positions_xyz
Where to store the vertex positions positions.

ArMesh_getVertexListSize

void ArMesh_getVertexListSize(
  const ArSession *session,
  const ArMesh *mesh,
  int32_t *out_num_vertices
)

Retrieves the number of vertices in this mesh.

Details
Parameters
session
The ARCore session.
mesh
The mesh object to query.
out_num_vertices
The number of vertices in this mesh.

ArMesh_release

void ArMesh_release(
  ArMesh *mesh
)

Releases a reference to the Mesh.

This must match a call to ArStreetscapeGeometry_acquireMesh.

This function may safely be called with NULL - it will do nothing.