lovr.audio.newAudioMesh

Edit

Creates a new AudioMesh.




Arguments

NameTypeDefaultDescription
verticestable A table of vertices in the mesh. Can be a table of tables (each with 3 numbers) or a table of numbers (every 3 numbers form a 3D vertex).
indicestable A table of triangle indices representing how the vertices are connected together into triangles.
materialAudioMaterial | {AudioMaterial}'generic' The material the audio mesh is made out of. Can be a single AudioMaterial to apply to the whole mesh, or a table of AudioMaterial values, one for each triangle.

Returns

NameTypeDescription
audioMeshAudioMesh The new AudioMesh.

Arguments

NameTypeDefaultDescription
modelDataModelData A ModelData to use for the mesh data.
materialAudioMaterial | {AudioMaterial}'generic' The material the audio mesh is made out of. Can be a single AudioMaterial to apply to the whole mesh, or a table of AudioMaterial values, one for each triangle.

Returns

NameTypeDescription
audioMeshAudioMesh The new AudioMesh.

Arguments

NameTypeDefaultDescription
meshMesh A Mesh to use for the mesh data. It must use the cpu storage mode.
materialAudioMaterial | {AudioMaterial}'generic' The material the audio mesh is made out of. Can be a single AudioMaterial to apply to the whole mesh, or a table of AudioMaterial values, one for each triangle.

Returns

NameTypeDescription
audioMeshAudioMesh The new AudioMesh.

Notes

The triangles in an AudioMesh should use counterclockwise winding.

The AudioMesh will start out enabled, and it will be located at the origin.

See also