lovr.physics.newMeshShape
EditCreates a new MeshShape.
Arguments
Name | Type | Default | Description |
vertices | table | The table of vertices in the mesh. Each vertex is a table with 3 numbers. | |
indices | table | A table of triangle indices representing how the vertices are connected in the Mesh. | |
scale | number | 1.0 | A scale to apply to the mesh vertices. |
Returns
Name | Type | Description |
mesh | MeshShape | The new MeshShape. |
Arguments
Name | Type | Default | Description |
modelData | ModelData | The ModelData to use the vertices from. | |
scale | number | 1.0 | A scale to apply to the mesh vertices. |
Returns
Name | Type | Description |
mesh | MeshShape | The new MeshShape. |
Arguments
Name | Type | Default | Description |
model | Model |
A Model to use for the mesh data. Similar to calling Model:getTriangles and passing it to this function, but has better performance.
| |
scale | number | 1.0 | A scale to apply to the mesh vertices. |
Returns
Name | Type | Description |
mesh | MeshShape | The new MeshShape. |
Arguments
Name | Type | Default | Description |
mesh | Mesh |
The Mesh to use the vertices from. It must use the cpu storage mode.
| |
scale | number | 1.0 | A scale to apply to the mesh vertices. |
Returns
Name | Type | Description |
mesh | MeshShape | 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
Name | Type | Default | Description |
template | MeshShape | An existing MeshShape to clone. | |
scale | number | 1.0 | A scale to apply to the mesh vertices. |
Returns
Name | Type | Description |
mesh | MeshShape | The new MeshShape. |