@adatechnology/game-vehicles-three 0.6.4 → 0.8.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/dist/{chunk-MRUPKE7J.js → chunk-NPS4X64L.js} +864 -60
- package/dist/chunk-NPS4X64L.js.map +1 -0
- package/dist/index.d.ts +267 -14
- package/dist/index.global.js +2057 -401
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +19 -1
- package/dist/{testing-C-BgV7gj.d.ts → testing-Cb10i9fm.d.ts} +23 -9
- package/dist/testing.d.ts +3 -1
- package/dist/testing.js +1 -1
- package/package.json +8 -8
- package/dist/chunk-MRUPKE7J.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BIKE_ENGINE,
|
|
3
3
|
CAR_ENGINE,
|
|
4
|
+
CAR_RECORDED_RPM,
|
|
5
|
+
CAR_START_RUN_STOP,
|
|
4
6
|
CRASH_SPEEDS,
|
|
5
7
|
DASHBOARD_LOOK,
|
|
6
8
|
DEFAULT_TEST_VEHICLES,
|
|
@@ -9,6 +11,7 @@ import {
|
|
|
9
11
|
ENGINE_PROFILES,
|
|
10
12
|
LAMP_RULES,
|
|
11
13
|
LITE_CLASSES,
|
|
14
|
+
MIST_RULES,
|
|
12
15
|
PAGE_ITEM_ALIASES,
|
|
13
16
|
PAGE_SCENARIO_ALIASES,
|
|
14
17
|
PROVING_AREA_ID,
|
|
@@ -19,20 +22,26 @@ import {
|
|
|
19
22
|
VEHICLE_LOD_DISTANCE,
|
|
20
23
|
VEHICLE_LOOPS,
|
|
21
24
|
VEHICLE_LOOP_FALLOFF,
|
|
25
|
+
VEHICLE_PRELOAD_SOUNDS,
|
|
26
|
+
VEHICLE_SAMPLE_ALIASES,
|
|
22
27
|
VEHICLE_SCENARIO_IDS,
|
|
23
28
|
VEHICLE_SOUNDS,
|
|
24
29
|
VEHICLE_SOUND_BANK,
|
|
25
30
|
classColor,
|
|
26
31
|
classify,
|
|
27
32
|
createCabinSmoke,
|
|
33
|
+
createEngineBudget,
|
|
28
34
|
createGearGuess,
|
|
29
35
|
createProvingModule,
|
|
36
|
+
createVehicleBody,
|
|
30
37
|
createVehicleDashboard,
|
|
31
38
|
createVehicleLamps,
|
|
32
39
|
createVehicleLod,
|
|
33
40
|
createVehicleSound,
|
|
34
41
|
createVehiclesTestModule,
|
|
35
42
|
createVehiclesThree,
|
|
43
|
+
createWheelRoll,
|
|
44
|
+
createWindshieldMist,
|
|
36
45
|
defaultEffectIds,
|
|
37
46
|
defaultSoundIds,
|
|
38
47
|
engineMix,
|
|
@@ -44,10 +53,12 @@ import {
|
|
|
44
53
|
loadProvingModule,
|
|
45
54
|
loadVehiclesTestModule,
|
|
46
55
|
rpmShare
|
|
47
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-NPS4X64L.js";
|
|
48
57
|
export {
|
|
49
58
|
BIKE_ENGINE,
|
|
50
59
|
CAR_ENGINE,
|
|
60
|
+
CAR_RECORDED_RPM,
|
|
61
|
+
CAR_START_RUN_STOP,
|
|
51
62
|
CRASH_SPEEDS,
|
|
52
63
|
DASHBOARD_LOOK,
|
|
53
64
|
DEFAULT_TEST_VEHICLES,
|
|
@@ -56,6 +67,7 @@ export {
|
|
|
56
67
|
ENGINE_PROFILES,
|
|
57
68
|
LAMP_RULES,
|
|
58
69
|
LITE_CLASSES,
|
|
70
|
+
MIST_RULES,
|
|
59
71
|
PAGE_ITEM_ALIASES,
|
|
60
72
|
PAGE_SCENARIO_ALIASES,
|
|
61
73
|
PROVING_AREA_ID,
|
|
@@ -66,20 +78,26 @@ export {
|
|
|
66
78
|
VEHICLE_LOD_DISTANCE,
|
|
67
79
|
VEHICLE_LOOPS,
|
|
68
80
|
VEHICLE_LOOP_FALLOFF,
|
|
81
|
+
VEHICLE_PRELOAD_SOUNDS,
|
|
82
|
+
VEHICLE_SAMPLE_ALIASES,
|
|
69
83
|
VEHICLE_SCENARIO_IDS,
|
|
70
84
|
VEHICLE_SOUNDS,
|
|
71
85
|
VEHICLE_SOUND_BANK,
|
|
72
86
|
classColor,
|
|
73
87
|
classify,
|
|
74
88
|
createCabinSmoke,
|
|
89
|
+
createEngineBudget,
|
|
75
90
|
createGearGuess,
|
|
76
91
|
createProvingModule,
|
|
92
|
+
createVehicleBody,
|
|
77
93
|
createVehicleDashboard,
|
|
78
94
|
createVehicleLamps,
|
|
79
95
|
createVehicleLod,
|
|
80
96
|
createVehicleSound,
|
|
81
97
|
createVehiclesTestModule,
|
|
82
98
|
createVehiclesThree,
|
|
99
|
+
createWheelRoll,
|
|
100
|
+
createWindshieldMist,
|
|
83
101
|
defaultEffectIds,
|
|
84
102
|
defaultSoundIds,
|
|
85
103
|
engineMix,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { EffectSink, Vec3, TestableModule } from '@adatechnology/game-contracts';
|
|
2
2
|
import { Damageable, VehicleContext, VehicleKit } from '@adatechnology/game-vehicles';
|
|
3
|
+
import * as THREE_NS from 'three';
|
|
4
|
+
import { Group } from 'three';
|
|
5
|
+
import { StorageStack } from '@adatechnology/game-vehicles-driving';
|
|
3
6
|
import { ProvingSubject, ProvingTestRegistry, ProvingCertificate } from '@adatechnology/game-vehicles-proving';
|
|
4
7
|
|
|
5
8
|
type VehicleQuality = 'high' | 'lite';
|
|
@@ -39,7 +42,7 @@ interface BuiltVehicle {
|
|
|
39
42
|
color: string | null;
|
|
40
43
|
seed: number | string | null;
|
|
41
44
|
/** Group in the game frame: front on +z, right on -x, centred on x and z, wheels on y = 0. */
|
|
42
|
-
group:
|
|
45
|
+
group: Group;
|
|
43
46
|
/** Damageable boxes in the game frame. */
|
|
44
47
|
damageables: Damageable[];
|
|
45
48
|
triangles: number;
|
|
@@ -62,7 +65,7 @@ interface BuiltVehicle {
|
|
|
62
65
|
dispose(): void;
|
|
63
66
|
}
|
|
64
67
|
interface VehiclesThree {
|
|
65
|
-
readonly THREE:
|
|
68
|
+
readonly THREE: typeof THREE_NS;
|
|
66
69
|
readonly kit: VehicleKit;
|
|
67
70
|
build(key: string, options?: BuildVehicleOptions): BuiltVehicle;
|
|
68
71
|
}
|
|
@@ -76,7 +79,7 @@ interface VehiclesThreeOptions {
|
|
|
76
79
|
/** Vehicle id to the group id whose palette paints it. Defaults to the fleet group of the vehicle (`military` for the military ones). */
|
|
77
80
|
groupOf?: (key: string) => string;
|
|
78
81
|
}
|
|
79
|
-
declare function createVehiclesThree(THREE:
|
|
82
|
+
declare function createVehiclesThree(THREE: typeof THREE_NS, options: VehiclesThreeOptions): VehiclesThree;
|
|
80
83
|
|
|
81
84
|
/**
|
|
82
85
|
* How a vehicle sounds, as data. An engine is a few loops crossfaded by RPM (idle, low/mid, high) plus a load layer (intake and exhaust roar) that
|
|
@@ -126,6 +129,14 @@ type VehicleSoundKeys = {
|
|
|
126
129
|
readonly skidAsphalt: string;
|
|
127
130
|
readonly skidDirt: string;
|
|
128
131
|
readonly roll: string;
|
|
132
|
+
/** Pads squealing on the discs as a car brakes to a stop (not a skid: the tyres still grip). */
|
|
133
|
+
readonly brakeSqueal: string;
|
|
134
|
+
/** A body hit by the vehicle; a game points it at its own (a zombie, an animal) through `sounds` or the `hit` call. */
|
|
135
|
+
readonly hitBody: string;
|
|
136
|
+
/** An emergency siren, its pitch swept by the vehicle (`frame.siren`). */
|
|
137
|
+
readonly siren: string;
|
|
138
|
+
/** A helicopter's blades (`frame.rotor`). */
|
|
139
|
+
readonly rotor: string;
|
|
129
140
|
};
|
|
130
141
|
declare const DEFAULT_VEHICLE_SOUND_KEYS: VehicleSoundKeys;
|
|
131
142
|
/** The speed of the hit, m/s, where a crash stops being light (≈ 22 km/h: dents and plastic) and where it turns heavy (≈ 50 km/h: metal folds, glass goes). */
|
|
@@ -283,12 +294,16 @@ declare const PAGE_SCENARIO_ALIASES: Readonly<Record<string, string>>;
|
|
|
283
294
|
declare const PAGE_ITEM_ALIASES: Readonly<Record<string, string>>;
|
|
284
295
|
|
|
285
296
|
declare const PROVING_AREA_ID = "vehicles_proving";
|
|
286
|
-
type Three =
|
|
297
|
+
type Three = typeof THREE_NS;
|
|
287
298
|
/** Content comes in by option (the adapter does not import a content pack): the example wires the kit's fleet, a game its own catalogue. */
|
|
288
299
|
interface ProvingModuleOptions {
|
|
289
300
|
locale?: string;
|
|
290
301
|
/** Vehicles offered on the bench, by catalogue id. */
|
|
291
302
|
vehicles: readonly string[];
|
|
303
|
+
/** Catalogue id of the person thrown out of a crash without a belt (a person item of the characters module); without it the crash only logs. */
|
|
304
|
+
occupant?: string;
|
|
305
|
+
/** Catalogue id of the car parked behind for the parking sensors (a vehicle item of the vehicles module). Default `sedan` (the vehicles module's midsize sedan). */
|
|
306
|
+
parkedCar?: string;
|
|
292
307
|
/** The proving subject of a vehicle (`fleetProvingSubject` of game-vehicles-fleet); `mass` is the kit's own when it has one. Null hides the vehicle. */
|
|
293
308
|
subject(id: string, mass: number | undefined): ProvingSubject | null;
|
|
294
309
|
/** The vehicle's name on the bench and the board (default: the id). */
|
|
@@ -300,12 +315,11 @@ interface ProvingModuleOptions {
|
|
|
300
315
|
sounds?: Partial<VehicleSoundIds>;
|
|
301
316
|
/** Called whenever a certificate changes (a result in, a sign-off), so a page can keep or show them. */
|
|
302
317
|
onCertificate?(certificate: ProvingCertificate): void;
|
|
318
|
+
/** What the glovebox and the trunk of `vehicle` hold when someone gets in (items of the host's catalogue, as `game-items` finds them for a car). Default empty. */
|
|
319
|
+
stock?(compartment: string, vehicle: string): readonly StorageStack[];
|
|
320
|
+
/** The name of an item of the host's catalogue, for the log (default: its id). */
|
|
321
|
+
itemName?(id: string): string | undefined;
|
|
303
322
|
}
|
|
304
|
-
/**
|
|
305
|
-
* The proving ground as a `TestableModule`: a track where a fleet vehicle runs the measured tests of `game-vehicles-proving` live (0-100, top speed, braking, turning circle, wet braking, mud)
|
|
306
|
-
* on the same semi-simulation driver the headless runner uses, with the vehicle cameras of `game-camera` (chase, cockpit, hood) taking over the room's view, the rear-view and side mirrors
|
|
307
|
-
* and the reversing camera with its guide lines as extra views of the host, a board by the track with the vehicle's certificate, and the sign-off of the visual checks.
|
|
308
|
-
*/
|
|
309
323
|
declare function createProvingModule(options: ProvingModuleOptions): TestableModule & {
|
|
310
324
|
certificates(): ProvingCertificate[];
|
|
311
325
|
certificate(id: string): ProvingCertificate | undefined;
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export { D as DEFAULT_TEST_VEHICLES, d as DEFAULT_TEST_WRECKS, f as DocumentLike, h as EffectsLike, M as ModuleRoomLike, P as PAGE_ITEM_ALIASES, k as PAGE_SCENARIO_ALIASES, l as PROVING_AREA_ID, m as PROVING_TEXT, n as ProvingModuleOptions, o as ProvingRoomLike, p as ProvingText, q as VEHICLES_AREA_ID, r as VEHICLE_SCENARIO_IDS, s as VehicleEffectIds, v as VehicleSoundIds, w as VehicleWreck, x as VehiclesContext, y as VehiclesRoom, z as VehiclesTestFleet, A as VehiclesTestOptions, I as createProvingModule, J as createVehiclesTestModule, L as defaultEffectIds, N as defaultSoundIds, O as loadProvingModule, Q as loadVehiclesTestModule } from './testing-
|
|
1
|
+
export { D as DEFAULT_TEST_VEHICLES, d as DEFAULT_TEST_WRECKS, f as DocumentLike, h as EffectsLike, M as ModuleRoomLike, P as PAGE_ITEM_ALIASES, k as PAGE_SCENARIO_ALIASES, l as PROVING_AREA_ID, m as PROVING_TEXT, n as ProvingModuleOptions, o as ProvingRoomLike, p as ProvingText, q as VEHICLES_AREA_ID, r as VEHICLE_SCENARIO_IDS, s as VehicleEffectIds, v as VehicleSoundIds, w as VehicleWreck, x as VehiclesContext, y as VehiclesRoom, z as VehiclesTestFleet, A as VehiclesTestOptions, I as createProvingModule, J as createVehiclesTestModule, L as defaultEffectIds, N as defaultSoundIds, O as loadProvingModule, Q as loadVehiclesTestModule } from './testing-Cb10i9fm.js';
|
|
2
2
|
import '@adatechnology/game-contracts';
|
|
3
3
|
import '@adatechnology/game-vehicles';
|
|
4
|
+
import 'three';
|
|
5
|
+
import '@adatechnology/game-vehicles-driving';
|
|
4
6
|
import '@adatechnology/game-vehicles-proving';
|
package/dist/testing.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adatechnology/game-vehicles-three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.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": [
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
"dist"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@adatechnology/game-audio": "^0.
|
|
45
|
-
"@adatechnology/game-
|
|
46
|
-
"@adatechnology/game-contracts": "^0.24.0",
|
|
44
|
+
"@adatechnology/game-audio": "^0.9.0",
|
|
45
|
+
"@adatechnology/game-contracts": "^0.26.0",
|
|
47
46
|
"@adatechnology/game-render-three": "^0.2.0",
|
|
48
47
|
"@adatechnology/game-shapes-three": "^0.3.1",
|
|
49
|
-
"@adatechnology/game-vehicles": "^0.6.
|
|
50
|
-
"@adatechnology/game-vehicles-driving": "^0.2.
|
|
48
|
+
"@adatechnology/game-vehicles": "^0.6.4",
|
|
49
|
+
"@adatechnology/game-vehicles-driving": "^0.2.13",
|
|
51
50
|
"@adatechnology/game-vehicles-fleet": "^6.0.0",
|
|
52
|
-
"@adatechnology/game-vehicles-proving": "^0.1.
|
|
51
|
+
"@adatechnology/game-vehicles-proving": "^0.1.4",
|
|
52
|
+
"@adatechnology/game-camera": "^0.2.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@types/node": "^22.10.7",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"typescript": "^5.7.3",
|
|
61
61
|
"vitest": "^3.2.4",
|
|
62
62
|
"@adatechnology/game-kit-defaults": "^0.2.0",
|
|
63
|
-
"@adatechnology/game-test-room": "^0.
|
|
63
|
+
"@adatechnology/game-test-room": "^0.27.0",
|
|
64
64
|
"@adatechnology/golden-tool": "^0.0.0"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|