lovr.audio.setGeometry
EditSets a mesh of triangles to use for modeling audio effects, using a table of vertices or a Model. When the appropriate effects are enabled, audio from Source
objects will correctly be occluded by walls and bounce around to create realistic reverb.
An optional AudioMaterial
may be provided to specify the acoustic properties of the geometry.
Arguments
Name | Type | Default | Description |
vertices | table | A flat table of vertices. Each vertex is 3 numbers representing its x, y, and z position. The units used for audio coordinates are up to you, but meters are recommended. | |
indices | table | A list of indices, indicating how the vertices are connected into triangles. Indices are 1-indexed and are 32 bits (they can be bigger than 65535). | |
material | AudioMaterial | 'generic' | The acoustic material to use. |
Returns
Name | Type | Description |
success | boolean | Whether audio geometry is supported by the current spatializer and the geometry was loaded successfully. |
Arguments
Name | Type | Default | Description |
model | Model | A model to use for the audio geometry. | |
material | AudioMaterial | 'generic' | The acoustic material to use. |
Returns
Name | Type | Description |
success | boolean | Whether audio geometry is supported by the current spatializer and the geometry was loaded successfully. |
Notes
This is currently only supported/used by the phonon
spatializer.
The Effect
s that use geometry are:
occlusion
reverb
transmission
If an existing geometry has been set, this function will replace it.
The triangles must use counterclockwise winding.