@newkrok/nape-js 3.21.0 → 3.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -182,7 +182,7 @@ present, with automatic `postMessage` fallback otherwise.
182
182
  ```bash
183
183
  npm install
184
184
  npm run build # tsup → dist/ (ESM + CJS + DTS)
185
- npm test # vitest — 4591 tests across 201 files
185
+ npm test # vitest — 4773 tests across 208 files
186
186
  npm run benchmark # Performance benchmarks
187
187
  ```
188
188
 
@@ -1295,11 +1295,17 @@ declare class Polygon extends Shape {
1295
1295
  /**
1296
1296
  * Create a Polygon from a list of Vec2 vertices. Vertices must form a convex polygon
1297
1297
  * in counter-clockwise order.
1298
+ *
1299
+ * The second parameter can be either a `Vec2` local-COM offset or a `Material`.
1300
+ * This allows both the legacy 2-arg form `(verts, material)` and the new 3-arg
1301
+ * form `(verts, localCOM, material, filter)` — consistent with Circle and Capsule.
1302
+ *
1298
1303
  * @param localVerts - Vertices as `Array<Vec2>`, `Vec2List`, or `GeomPoly`.
1304
+ * @param localCOMOrMaterial - Local centre offset (`Vec2`) **or** `Material` for backward compat.
1299
1305
  * @param material - Material to assign (uses default if omitted).
1300
1306
  * @param filter - InteractionFilter to assign (uses default if omitted).
1301
1307
  */
1302
- constructor(localVerts?: Vec2[] | any, material?: Material, filter?: InteractionFilter);
1308
+ constructor(localVerts?: Vec2[] | any, localCOMOrMaterial?: Vec2 | Material, material?: Material | InteractionFilter, filter?: InteractionFilter);
1303
1309
  /**
1304
1310
  * Create an axis-aligned rectangle at the given position.
1305
1311
  * @param x - Left edge x coordinate.
@@ -1295,11 +1295,17 @@ declare class Polygon extends Shape {
1295
1295
  /**
1296
1296
  * Create a Polygon from a list of Vec2 vertices. Vertices must form a convex polygon
1297
1297
  * in counter-clockwise order.
1298
+ *
1299
+ * The second parameter can be either a `Vec2` local-COM offset or a `Material`.
1300
+ * This allows both the legacy 2-arg form `(verts, material)` and the new 3-arg
1301
+ * form `(verts, localCOM, material, filter)` — consistent with Circle and Capsule.
1302
+ *
1298
1303
  * @param localVerts - Vertices as `Array<Vec2>`, `Vec2List`, or `GeomPoly`.
1304
+ * @param localCOMOrMaterial - Local centre offset (`Vec2`) **or** `Material` for backward compat.
1299
1305
  * @param material - Material to assign (uses default if omitted).
1300
1306
  * @param filter - InteractionFilter to assign (uses default if omitted).
1301
1307
  */
1302
- constructor(localVerts?: Vec2[] | any, material?: Material, filter?: InteractionFilter);
1308
+ constructor(localVerts?: Vec2[] | any, localCOMOrMaterial?: Vec2 | Material, material?: Material | InteractionFilter, filter?: InteractionFilter);
1303
1309
  /**
1304
1310
  * Create an axis-aligned rectangle at the given position.
1305
1311
  * @param x - Left edge x coordinate.