Scene
The AcousticScene holds static and dynamic geometry used for occlusion, transmission, and reflection simulation. Access it through world.scene.
Methods
Section titled “Methods”addStaticMesh(input)
Section titled “addStaticMesh(input)”scene.addStaticMesh(input: StaticMeshInput): AcousticMeshHandleAdds static geometry to the scene.
addDynamicMesh(input)
Section titled “addDynamicMesh(input)”scene.addDynamicMesh(input: DynamicMeshInput): DynamicAcousticMeshHandleAdds rigid dynamic geometry to the scene. Scale is baked at creation time; only translation and rotation can be updated at runtime.
commit()
Section titled “commit()”scene.commit(): voidApplies pending scene changes to the simulator. Must be called after adding, removing, or updating geometry.
StaticMeshInput
Section titled “StaticMeshInput”geometry
: BufferGeometry — the Three.js geometry to upload. Triangle winding order must be counter-clockwise for front-facing triangles.
material
: AcousticMaterial | readonly AcousticMaterial[] — acoustic material or materials.
matrixWorld
: Matrix4 — optional world transform.
DynamicMeshInput
Section titled “DynamicMeshInput”Extends StaticMeshInput and requires:
matrixWorld
: Matrix4 — the initial world transform. Used to bake scale.
AcousticMeshHandle
Section titled “AcousticMeshHandle”interface AcousticMeshHandle { dispose: () => void}DynamicAcousticMeshHandle
Section titled “DynamicAcousticMeshHandle”interface DynamicAcousticMeshHandle extends AcousticMeshHandle { setTransform: (matrixWorld: Matrix4) => void}AcousticMaterial
Section titled “AcousticMaterial”interface AcousticMaterial { absorption: ThreeBand scattering: number transmission?: ThreeBand}absorption
: [low, mid, high] values in [0, 1]. Lower values mean more reflection.
scattering
: number in [0, 1] — how much sound is diffusely reflected.
transmission
: Optional [low, mid, high] values in [0, 1] — how much sound passes through the surface.
ThreeBand
Section titled “ThreeBand”type ThreeBand = readonly [number, number, number]Three values representing low, mid, and high frequency bands.