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

Returns

NameTypeDescription
shapeConvexShape The new ConvexShape.

Arguments

NameTypeDefaultDescription
objectModelData | Mesh An object to use for the points of the convex hull.
scalevectornil An optional scale to apply to the points. Can also be provided as 3 numbers.

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

Returns

NameTypeDescription
shapeConvexShape The new ConvexShape.

See also