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.
scalevectornil An optional scale to apply to the mesh vertices. Can also be provided as 3 numbers.

Returns

NameTypeDescription
meshMeshShape The new MeshShape.

Arguments

NameTypeDefaultDescription
objectModelData | Mesh An object to use the triangles from. Meshes must use the cpu storage mode.
scalevectornil An optional scale to apply to the mesh vertices. Can also be provided as 3 numbers.

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.
scalevectornil An optional scale to apply to the mesh vertices. Can also be provided as 3 numbers.

Returns

NameTypeDescription
meshMeshShape The new MeshShape.

See also