lovr.audio.setGeometry

Sets 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.


success = lovr.audio.setGeometry(vertices, indices, material)

Arguments

NameTypeDefaultDescription
verticestable 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.
indicestable 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).
materialAudioMaterial'generic' The acoustic material to use.

Returns

NameTypeDescription
successboolean Whether audio geometry is supported by the current spatializer and the geometry was loaded successfully.

success = lovr.audio.setGeometry(model, material)

Arguments

NameTypeDefaultDescription
modelModel A model to use for the audio geometry.
materialAudioMaterial'generic' The acoustic material to use.

Returns

NameTypeDescription
successboolean 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 Effects that use geometry are:

If an existing geometry has been set, this function will replace it.

The triangles must use counterclockwise winding.

See also