Skip to content

1681-engine / index / polygonShape

Function: polygonShape() ​

ts
function polygonShape(points): PolygonShape;

Defined in: src/physics/polygon.ts:39

A convex polygon shape from any points: their convex hull, in the order the solver keeps, moved so its centroid is the body's position. Give points round the origin, or anywhere and place the body at polygonCentroid(points).

Parameters ​

ParameterType
pointsreadonly Vec2[]

Returns ​

PolygonShape

Released under the MIT License.