primitives
TypeScriptget primitives(): (MeshDescriptor_Primitives) | nullSwift declarationvar primitives: MeshDescriptor.Primitives?The primitives that make up the mesh.
struct · iOS 15.0+ · SDK 27.1
struct MeshDescriptorDefines 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]) ```
get primitives(): (MeshDescriptor_Primitives) | nullSwift declarationvar primitives: MeshDescriptor.Primitives?The primitives that make up the mesh.
set primitives(value: (MeshDescriptor_Primitives) | null)Swift declarationvar primitives: MeshDescriptor.Primitives?The primitives that make up the mesh.
static init(name?: string): MeshDescriptorSwift declarationinit(name: String = "")Creates an empty mesh descriptor.
get name(): stringSwift declarationvar name: StringThe name of the mesh.
set name(value: string)Swift declarationvar name: StringThe name of the mesh.
get buffers(): NativeMap<MeshBuffers_Identifier, AnyMeshBuffer>Swift declarationvar buffers: [MeshBuffers.Identifier : AnyMeshBuffer] { get }Descriptors for the buffers.
get materials(): MeshDescriptor_MaterialsSwift declarationvar materials: MeshDescriptor.MaterialsMaterial assignments.
set materials(value: MeshDescriptor_Materials)Swift declarationvar materials: MeshDescriptor.MaterialsMaterial assignments.
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)