One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

MeshDescriptor

struct · iOS 15.0+ · SDK 27.1

struct MeshDescriptor

Defines a 3D mesh's structure and data. Create or modify 3D shapes in a RealityKit scene using `MeshDescriptor`, which provides properties and methods to define the vertices, normals, texture coordinates, and other attributes of the mesh. Apply the mesh to an ``Entity`` by creating a ``MeshResource`` with ``MeshResource/generate(from:)-6l1q2``, and create a ``ModelComponent`` with ``ModelComponent/init(mesh:materials:)``. Start by creating a basic triangle with a `MeshDescriptor` instance. ```swift var descriptor = MeshDescriptor(name: "triangle") descriptor.positions = MeshBuffers.Positions([ [-1, -1, 0], [1, -1, 0], [0, 1, 0] ]) descriptor.primitives = .triangles([0, 1, 2]) ```

Members (8)

get · iOS 15.0+

primitives

TypeScript
get primitives(): (MeshDescriptor_Primitives) | null
Swift declaration
var primitives: MeshDescriptor.Primitives?

The primitives that make up the mesh.

set · iOS 15.0+

primitives

TypeScript
set primitives(value: (MeshDescriptor_Primitives) | null)
Swift declaration
var primitives: MeshDescriptor.Primitives?

The primitives that make up the mesh.

init · iOS 15.0+

init

TypeScript
static init(name?: string): MeshDescriptor
Swift declaration
init(name: String = "")

Creates an empty mesh descriptor.

get · iOS 15.0+

name

TypeScript
get name(): string
Swift declaration
var name: String

The name of the mesh.

set · iOS 15.0+

name

TypeScript
set name(value: string)
Swift declaration
var name: String

The name of the mesh.

get · iOS 15.0+

buffers

TypeScript
get buffers(): NativeMap<MeshBuffers_Identifier, AnyMeshBuffer>
Swift declaration
var buffers: [MeshBuffers.Identifier : AnyMeshBuffer] { get }

Descriptors for the buffers.

get · iOS 15.0+

materials

TypeScript
get materials(): MeshDescriptor_Materials
Swift declaration
var materials: MeshDescriptor.Materials

Material assignments.

set · iOS 15.0+

materials

TypeScript
set materials(value: MeshDescriptor_Materials)
Swift declaration
var materials: MeshDescriptor.Materials

Material assignments.

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

MeshDescriptor.subscript(_:)

This declaration needs Swift generic type arguments. (no canonical witness for S)

All RealityFoundation types →