1681-engine / index / polygonCentroid
Function: polygonCentroid() ​
ts
function polygonCentroid(points): Vec2;Defined in: src/physics/polygon.ts:18
The centroid of the convex hull of points: where to put the body so a polygonShape(points) lands on them.
Parameters ​
| Parameter | Type |
|---|---|
points | readonly Vec2[] |
Returns ​
Vec2