Class

MTKMesh

A container for the vertex data of a Model I/O mesh, suitable for use in a Metal app.

Declaration

@interface MTKMesh : NSObject

Topics

Initialization

- initWithMesh:device:error:

Initializes a MetalKit mesh and its submeshes from a Model I/O mesh.

Loading Meshes from an Asset

+ newMeshesFromAsset:device:sourceMeshes:error:

Creates and initializes MetalKit meshes from all Model I/O meshes in a Model I/O asset.

Submeshes

submeshes

An array of submeshes containing index buffers referencing the mesh vertices.

Vertex Properties

vertexBuffers

An array of buffers in which mesh vertex data resides.

vertexCount

The number of vertices in the vertex buffers.

vertexDescriptor

A Model I/O vertex descriptor specifying the data layout in the vertex buffers.

Identifying Properties

name

The name of the mesh.

Constants

Mesh Error Handling

Strings used when handling NSError messages returned from a mesh initialization method.

Relationships

Inherits From

See Also

Model Handling

MTKMeshBuffer

A buffer that backs the vertex data of a Model I/O mesh, suitable for use in a Metal app.

MTKMeshBufferAllocator

An interface for allocating a MetalKit buffer that backs the vertex data of a Model I/O mesh, suitable for use in a Metal app.

MTKSubmesh

A container for the index data of a Model I/O submesh, suitable for use in a Metal app.

Conversion Functions

Convert between Metal and Model I/O vertex representations.

Model Errors

Learn about errors thrown by model handling methods.