lovr.physics.newMeshShape

Edit

Creates a new MeshShape.






Arguments

NameTypeDefaultDescription
verticestable The table of vertices in the mesh. Each vertex is a table with 3 numbers.
indicestable A table of triangle indices representing how the vertices are connected in the Mesh.
scalenumber1.0 A scale to apply to the mesh vertices.

Returns

NameTypeDescription
meshMeshShape The new MeshShape.

Arguments

NameTypeDefaultDescription
modelDataModelData The ModelData to use the vertices from.
scalenumber1.0 A scale to apply to the mesh vertices.

Returns

NameTypeDescription
meshMeshShape The new MeshShape.

Arguments

NameTypeDefaultDescription
modelModel A Model to use for the mesh data. Similar to calling Model:getTriangles and passing it to this function, but has better performance.
scalenumber1.0 A scale to apply to the mesh vertices.

Returns

NameTypeDescription
meshMeshShape The new MeshShape.

Arguments

NameTypeDefaultDescription
meshMesh The Mesh to use the vertices from. It must use the cpu storage mode.
scalenumber1.0 A scale to apply to the mesh vertices.

Returns

NameTypeDescription
meshMeshShape The new MeshShape.

Clones an existing MeshShape, which is faster than passing the same mesh multiple times. Clones can have their own scale. The clone's scale doesn't get multiplied with the scale of the template.

Arguments

NameTypeDefaultDescription
templateMeshShape An existing MeshShape to clone.
scalenumber1.0 A scale to apply to the mesh vertices.

Returns

NameTypeDescription
meshMeshShape The new MeshShape.

See also