@adatechnology/game-vehicles-three 0.10.1 → 0.11.0
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 +17 -0
- package/dist/{chunk-5T52WAQS.js → chunk-GAPMLLDL.js} +224 -5
- package/dist/chunk-GAPMLLDL.js.map +1 -0
- package/dist/chunk-UHLZ23KF.js +565 -0
- package/dist/chunk-UHLZ23KF.js.map +1 -0
- package/dist/index.d.ts +173 -10
- package/dist/index.global.js +1424 -62
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +482 -3
- package/dist/index.js.map +1 -1
- package/dist/testing.js +2 -1
- package/dist/worker-kinds-Dnbh9_c9.d.ts +51 -0
- package/dist/worker-kinds.d.ts +2 -0
- package/dist/worker-kinds.js +9 -0
- package/dist/worker-kinds.js.map +1 -0
- package/package.json +20 -12
- package/dist/chunk-5T52WAQS.js.map +0 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { TaskKind } from '@adatechnology/game-contracts';
|
|
2
|
+
|
|
3
|
+
/** A cut across one axis; the two halves it makes are cut again by `lo` and `hi`, or are leaves when those are null. */
|
|
4
|
+
interface CutNode {
|
|
5
|
+
readonly axis: 0 | 1 | 2;
|
|
6
|
+
readonly at: number;
|
|
7
|
+
lo: CutNode | null;
|
|
8
|
+
hi: CutNode | null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** One thin piece of the intact car, named by its key: its triangles in the frame of the colliders. */
|
|
12
|
+
interface HullPlanPiece {
|
|
13
|
+
readonly key: string;
|
|
14
|
+
readonly vertices: Float64Array;
|
|
15
|
+
readonly indices: Uint32Array;
|
|
16
|
+
}
|
|
17
|
+
/** What the division of a car's pieces needs: the thin pieces, the pieces of the solid parts (one entry per piece, `key` the part: each part gets one hull of all its pieces) and the hulls the model may have besides the solid parts. */
|
|
18
|
+
interface HullPlanJob {
|
|
19
|
+
readonly pieces: readonly HullPlanPiece[];
|
|
20
|
+
readonly solids: readonly HullPlanPiece[];
|
|
21
|
+
readonly maxHulls: number;
|
|
22
|
+
}
|
|
23
|
+
/** The one hull of a solid part (empty `points` when it has none), named by the part. */
|
|
24
|
+
interface HullPlanSolid {
|
|
25
|
+
readonly key: string;
|
|
26
|
+
readonly points: Float32Array;
|
|
27
|
+
}
|
|
28
|
+
/** A hull the division made: the piece it is from (`unit`, with `~n` for a protrusion), the cuts that lead to it, its points and the drawn vertices it was made from. */
|
|
29
|
+
interface HullPlanLeaf {
|
|
30
|
+
readonly unit: string;
|
|
31
|
+
readonly path: string;
|
|
32
|
+
readonly points: Float32Array;
|
|
33
|
+
readonly vertices: Float64Array;
|
|
34
|
+
}
|
|
35
|
+
/** The plan of a car, as plain data (no `Map`, so two results compare byte for byte): the cuts and the protrusions taken off each piece, and the hulls they make. */
|
|
36
|
+
interface HullPlanResult {
|
|
37
|
+
readonly cuts: ReadonlyArray<readonly [string, CutNode]>;
|
|
38
|
+
readonly taken: ReadonlyArray<readonly [string, readonly number[]]>;
|
|
39
|
+
readonly leaves: readonly HullPlanLeaf[];
|
|
40
|
+
readonly solids: readonly HullPlanSolid[];
|
|
41
|
+
}
|
|
42
|
+
/** The whole division of an intact car (design 10.3): a pure function of the job, the same on the main thread and in a worker. */
|
|
43
|
+
declare const planHulls: (job: HullPlanJob) => HullPlanResult;
|
|
44
|
+
/**
|
|
45
|
+
* The division of a car's hulls as a task kind of the worker coordinator (`vehicles.hull-plan`, lane `build`, CLAUDE.md §14): the pieces of the intact car in (their buffers handed over, not copied: a car whose worker fails makes the job again), the plan and the hulls
|
|
46
|
+
* out, the buffers transferred back. It is made once per model and kept by `createHullPlanCache`; until it arrives the car collides as the pieces' boxes. A game's worker file lists it in
|
|
47
|
+
* `installWorkerHost`.
|
|
48
|
+
*/
|
|
49
|
+
declare const hullPlanKind: TaskKind<HullPlanJob, HullPlanResult>;
|
|
50
|
+
|
|
51
|
+
export { type CutNode as C, type HullPlanResult as H, type HullPlanJob as a, type HullPlanLeaf as b, type HullPlanPiece as c, hullPlanKind as h, planHulls as p };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adatechnology/game-vehicles-three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "three.js output of the vehicles of @adatechnology/game-vehicles: a vehicle in a game frame (front on +z, centred, on the ground) at full detail or fused into six meshes (the team's Frota Leve light mode), coloured by seed, with its damageable boxes; and the vehicles test module.",
|
|
6
6
|
"keywords": [
|
|
@@ -35,22 +35,27 @@
|
|
|
35
35
|
"types": "./dist/testing.d.ts",
|
|
36
36
|
"import": "./dist/testing.js"
|
|
37
37
|
},
|
|
38
|
+
"./worker-kinds": {
|
|
39
|
+
"types": "./dist/worker-kinds.d.ts",
|
|
40
|
+
"import": "./dist/worker-kinds.js"
|
|
41
|
+
},
|
|
38
42
|
"./global": "./dist/index.global.js"
|
|
39
43
|
},
|
|
40
44
|
"files": [
|
|
41
45
|
"dist"
|
|
42
46
|
],
|
|
43
47
|
"dependencies": {
|
|
44
|
-
"@adatechnology/game-audio": "^0.15.
|
|
45
|
-
"@adatechnology/game-contracts": "^0.41.0",
|
|
46
|
-
"@adatechnology/game-render-three": "^0.4.5",
|
|
47
|
-
"@adatechnology/game-shapes": "^0.4.5",
|
|
48
|
+
"@adatechnology/game-audio": "^0.15.6",
|
|
48
49
|
"@adatechnology/game-camera": "^0.3.0",
|
|
50
|
+
"@adatechnology/game-contracts": "^0.42.0",
|
|
51
|
+
"@adatechnology/game-physics": "^0.4.0",
|
|
52
|
+
"@adatechnology/game-render-three": "^0.4.6",
|
|
53
|
+
"@adatechnology/game-shapes": "^0.4.6",
|
|
49
54
|
"@adatechnology/game-shapes-three": "^0.4.1",
|
|
50
|
-
"@adatechnology/game-vehicles": "^0.7.
|
|
51
|
-
"@adatechnology/game-vehicles-driving": "^0.2.
|
|
52
|
-
"@adatechnology/game-vehicles-fleet": "^
|
|
53
|
-
"@adatechnology/game-vehicles-proving": "^0.
|
|
55
|
+
"@adatechnology/game-vehicles": "^0.7.2",
|
|
56
|
+
"@adatechnology/game-vehicles-driving": "^0.2.29",
|
|
57
|
+
"@adatechnology/game-vehicles-fleet": "^9.0.0",
|
|
58
|
+
"@adatechnology/game-vehicles-proving": "^0.3.0"
|
|
54
59
|
},
|
|
55
60
|
"devDependencies": {
|
|
56
61
|
"@types/node": "^22.10.7",
|
|
@@ -60,8 +65,10 @@
|
|
|
60
65
|
"tsup": "^8.5.1",
|
|
61
66
|
"typescript": "^5.7.3",
|
|
62
67
|
"vitest": "^3.2.4",
|
|
63
|
-
"@adatechnology/game-kit-defaults": "^0.3.
|
|
64
|
-
"@adatechnology/game-
|
|
68
|
+
"@adatechnology/game-kit-defaults": "^0.3.9",
|
|
69
|
+
"@adatechnology/game-physics-jolt": "^0.3.1",
|
|
70
|
+
"@adatechnology/game-test-room": "^0.39.1",
|
|
71
|
+
"@adatechnology/game-workers": "^0.1.6",
|
|
65
72
|
"@adatechnology/golden-tool": "^0.0.0"
|
|
66
73
|
},
|
|
67
74
|
"peerDependencies": {
|
|
@@ -70,6 +77,7 @@
|
|
|
70
77
|
"scripts": {
|
|
71
78
|
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsup",
|
|
72
79
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
73
|
-
"test": "vitest run"
|
|
80
|
+
"test": "vitest run",
|
|
81
|
+
"test:cost": "mkdir -p ~/.cache/adatechnology-game-kit && HULLS_COST=1 flock ~/.cache/adatechnology-game-kit/perf-measure.lock vitest run tests/vehicle-hulls-fleet.test.ts"
|
|
74
82
|
}
|
|
75
83
|
}
|