lovr.physics.newConvexShape

Edit

Creates a new ConvexShape.






Arguments

NameTypeDefaultDescription
pointstable 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).
scalenumber1.0 A scale to apply to the points.

Returns

NameTypeDescription
shapeConvexShape The new ConvexShape.

Arguments

NameTypeDefaultDescription
modelDataModelData The ModelData to compute a convex hull from.
scalenumber1.0 A scale to apply to the points.

Returns

NameTypeDescription
shapeConvexShape The new ConvexShape.

Arguments

NameTypeDefaultDescription
modelModel The Model to compute a convex hull from.
scalenumber1.0 A scale to apply to the points.

Returns

NameTypeDescription
shapeConvexShape The new ConvexShape.

Arguments

NameTypeDefaultDescription
meshMesh The Mesh to compute a convex hull from. It must use the cpu storage mode.
scalenumber1.0 A scale to apply to the points.

Returns

NameTypeDescription
shapeConvexShape 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

NameTypeDefaultDescription
templateConvexShape An existing ConvexShape to clone.
scalenumber1.0 A scale to apply to the points.

Returns

NameTypeDescription
shapeConvexShape The new ConvexShape.

See also