@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 +1 -1
- package/dist/{ConvexResult-w4mY_6fr.d.cts → ConvexResult-D9juRiQz.d.cts} +7 -1
- package/dist/{ConvexResult-w4mY_6fr.d.ts → ConvexResult-D9juRiQz.d.ts} +7 -1
- package/dist/{chunk-SNMC46IS.js → chunk-3UEZODYZ.js} +2 -2
- package/dist/{chunk-KHH45HMB.cjs → chunk-H46ULHAS.cjs} +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/serialization/index.cjs +1 -1
- package/dist/serialization/index.d.cts +1 -1
- package/dist/serialization/index.d.ts +1 -1
- package/dist/serialization/index.js +1 -1
- package/package.json +5 -1
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 —
|
|
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.
|