Contents

ReverbMeshResource

A high-level representation of a collection of vertices and edges that define a shape used for simulating reverb.

Declaration

final class ReverbMeshResource

Overview

Use a ReverbMeshResource to describe the acoustic geometry of your scene. Create one from geometric primitives, custom vertex data, or an existing MeshResource:

// From a geometric primitive:
let room = ReverbMeshResource.shoebox(size: [4, 3, 5])

// From custom vertex data:
let mesh = try ReverbMeshResource(
    positions: myPositions,
    triangleIndices: myIndices,
    materials: perFaceMaterialIndices
)

// From an existing mesh resource:
let mesh = try ReverbMeshResource(from: myVisualMesh)

Pair a reverb mesh with Audio.Material values and set a ReverbComponent on an entity to activate simulated reverb:

let reverb: Reverb = .simulated(mesh: room, materials: [.concrete, .carpet])
entity.components.set(ReverbComponent(reverb: reverb))

Topics

Creating standard room shapes

Creating a custom mesh

Initializers

See Also

Acoustics and group playback