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 | number | 1.0 | A scale to apply to the points. |
Returns
Name | Type | Description |
shape | ConvexShape | The new ConvexShape. |
Arguments
Name | Type | Default | Description |
modelData | ModelData | The ModelData to compute a convex hull from. | |
scale | number | 1.0 | A scale to apply to the points. |
Returns
Name | Type | Description |
shape | ConvexShape | The new ConvexShape. |
Arguments
Name | Type | Default | Description |
model | Model | The Model to compute a convex hull from. | |
scale | number | 1.0 | A scale to apply to the points. |
Returns
Name | Type | Description |
shape | ConvexShape | The new ConvexShape. |
Arguments
Name | Type | Default | Description |
mesh | Mesh |
The Mesh to compute a convex hull from. It must use the cpu storage mode.
| |
scale | number | 1.0 | A scale to apply to the points. |
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 | number | 1.0 | A scale to apply to the points. |
Returns
Name | Type | Description |
shape | ConvexShape | The new ConvexShape. |