lovr.physics.newConvexShape
EditCreates a new ConvexShape.
Arguments
| Name | Type | Default | Description |
| points | table | A list of vertices to compute a convex hull from. Can be a table of tables (each with 3 numbers) or a table of numbers (every 3 numbers form a 3D point). | |
| scale | vector | nil | An optional scale to apply to the points. Can also be provided as 3 numbers. |
Returns
| Name | Type | Description |
| shape | ConvexShape | The new ConvexShape. |
Arguments
| Name | Type | Default | Description |
| object | ModelData | Mesh | An object to use for the points of the convex hull. | |
| scale | vector | nil | An optional scale to apply to the points. Can also be provided as 3 numbers. |
Returns
| Name | Type | Description |
| shape | ConvexShape | The new ConvexShape. |
Clones an existing ConvexShape, which is faster than passing the same points 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 | ConvexShape | An existing ConvexShape to clone. | |
| scale | vector | nil | An optional scale to apply to the points. Can also be provided as 3 numbers. |
Returns
| Name | Type | Description |
| shape | ConvexShape | The new ConvexShape. |