Contents

init(positions:triangleIndices:materials:)

Creates a reverb mesh resource from a list of positions, triangle indices, and material indices.

Declaration

convenience init(positions: [SIMD3<Float>], triangleIndices: [UInt32], materials: [UInt32]) throws

Parameters

  • positions:

    The vertex positions of the mesh.

  • triangleIndices:

    The triangle indices that reference positions in the positions array.

  • materials:

    An array of material indices, one per triangle, that map each face to a material in the Material array provided to Simulated(mesh:materials:).

Discussion

Use this initializer when you have precise control over the geometry:

let mesh = try ReverbMeshResource(
    positions: myPositions,
    triangleIndices: myIndices,
    materials: perFaceMaterialIndices
)