@ExperimentalCustomMeshApi
public final class CustomMesh implements AutoCloseable


An immutable resource that defines the structure of a renderable mesh.

A CustomMesh is composed of a MeshBuffer and a list of MeshSubsets. Each MeshSubset defines a part of the mesh that can be rendered with a single Material.

Summary

Nested types

Builder for CustomMesh using an existing MeshBuffer.

Builder for CustomMesh providing raw data directly.

Public methods

void

Closes the given CustomMesh.

final @NonNull BoundingBox

The bounding box of the mesh, used for culling.

final @NonNull MeshBuffer

The MeshBuffer containing the vertex and index data for this mesh.

final @NonNull List<@NonNull MeshSubset>

The list of MeshSubsets defining the parts of the mesh.

Public methods

close

Added in 1.0.0-alpha15
@MainThread
public void close()

Closes the given CustomMesh.

The CustomMesh can be explicitly closed at anytime or garbage collected. An exception will be thrown if the CustomMesh is used after being closed.

Throws
IllegalStateException

if the resource has already been closed.

getBounds

Added in 1.0.0-alpha15
public final @NonNull BoundingBox getBounds()

The bounding box of the mesh, used for culling.

getMeshBuffer

Added in 1.0.0-alpha15
public final @NonNull MeshBuffer getMeshBuffer()

The MeshBuffer containing the vertex and index data for this mesh.

getSubsets

Added in 1.0.0-alpha15
public final @NonNull List<@NonNull MeshSubsetgetSubsets()

The list of MeshSubsets defining the parts of the mesh.