@adatechnology/game-vehicles-three 0.1.0 → 0.3.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 +2 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.global.js +2184 -349
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +46 -21
- package/dist/index.js.map +1 -1
- package/package.json +11 -12
package/README.md
CHANGED
|
@@ -17,10 +17,10 @@ car.triangles // 19286 · car.drawCalls // 6 · car.damageables // metal, glass,
|
|
|
17
17
|
|
|
18
18
|
- `quality: 'high'` is the kit's vehicle (the context stays in `car.context` for damage), `'lite'` fuses it into `paint`, `trim`, `metal`, `glass`, `light` and `plate`, dropping interiors and pieces under 3 cm.
|
|
19
19
|
- The colour comes from `color` or from `seed` through the palette of the vehicle's group (`colorFromSeed`).
|
|
20
|
-
- Tested against the team's page on three r160 (triangles, draw calls, size, per-class vertices, damageable boxes) and against `DIMS` for the 69 vehicles
|
|
20
|
+
- Tested against the team's page on three r160 (triangles, draw calls, size, per-class vertices, damageable boxes) and against `DIMS` for the 69 vehicles.
|
|
21
21
|
|
|
22
22
|
## Test area
|
|
23
23
|
|
|
24
24
|
`createVehiclesTestModule({ locale, document?, three?, vehicles?, effects? })` is a `TestableModule` for the shared test room (`room.loadModule`, or `loadVehiclesTestModule(room)`, which learns the room's three.js to compute the door, hood and trunk clips). It lays the eight vehicles of the Frota test, each with its own `DestructibleImpl`, and brings 13 scenarios: the eleven of the team's test page, literal (`vehicles_9mm_windshield`, `vehicles_shotgun_door`, `vehicles_ram_front`, `vehicles_engine_fire`, `vehicles_fuel_tank`, `vehicles_unbolt_wheel`, `vehicles_tear_bumper`, `vehicles_break_mirror`, `vehicles_kill_battery`, `vehicles_rollover`, `vehicles_melt`; the page ids are in `PAGE_SCENARIO_ALIASES`), plus `vehicles_drive_arcade` and `vehicles_drive_semi` for `@adatechnology/game-vehicles-driving`.
|
|
25
25
|
|
|
26
|
-
The bench sets the quality (full or light mode), the paint by seed and palette, the driving mode and the surface, and drives a car down a lane; its layers show the damageable boxes by material, the zones by type and the axes of the output frame; its metrics read triangles, draw calls, the size against `DIMS` and the boxes by material. The module draws no particles: fire, explosion, glass, sparks, leaks and exhaust are requested by id through `host.effects` when the host has one (`defaultEffectIds`, replaceable by option). `examples/vehicles-test-area` loads it.
|
|
26
|
+
The bench sets the quality (full or light mode), the paint by seed and palette, the driving mode and the surface, and drives a car down a lane; its layers show the damageable boxes by material, the zones by type and the axes of the output frame; its metrics read triangles, draw calls, the size against `DIMS` and the boxes by material. The module draws no particles: fire, explosion, glass, sparks, leaks and exhaust are requested by id through `host.effects` when the host has one (`defaultEffectIds`, replaceable by option). A pierced tank asks for `leak` (`vehicle_leak`: the pool and the drips only); when the leak catches fire (a spark, an incendiary round, a fire near, a blast) the `ignite` event of the tank asks for `leakIgnited` (`vehicle_leak_ignited`: the Garagem's whole sequence, the fire along the pool and then the blast). `examples/vehicles-test-area` loads it.
|
package/dist/index.d.ts
CHANGED
|
@@ -105,6 +105,8 @@ type VehicleEffectIds = {
|
|
|
105
105
|
readonly glass: string;
|
|
106
106
|
readonly sparks: string;
|
|
107
107
|
readonly leak: string;
|
|
108
|
+
/** The leak of a pierced tank caught fire: the whole sequence (fire along the pool, then the blast). `leak` is only the pool and the drips. */
|
|
109
|
+
readonly leakIgnited: string;
|
|
108
110
|
readonly exhaust: string;
|
|
109
111
|
};
|
|
110
112
|
declare const defaultEffectIds: VehicleEffectIds;
|
|
@@ -115,6 +117,13 @@ type VehicleSoundIds = {
|
|
|
115
117
|
readonly crash: string;
|
|
116
118
|
};
|
|
117
119
|
declare const defaultSoundIds: VehicleSoundIds;
|
|
120
|
+
/** A damaged vehicle of the area: the item id, the fleet vehicle it is built from and the scenario of the kit applied while building. */
|
|
121
|
+
type VehicleWreck = {
|
|
122
|
+
readonly key: string;
|
|
123
|
+
readonly vehicle: string;
|
|
124
|
+
readonly scenario: string;
|
|
125
|
+
};
|
|
126
|
+
declare const DEFAULT_TEST_WRECKS: readonly VehicleWreck[];
|
|
118
127
|
type VehiclesTestOptions = {
|
|
119
128
|
/** `en` or `pt-BR` (default). */
|
|
120
129
|
readonly locale?: string;
|
|
@@ -125,7 +134,9 @@ type VehiclesTestOptions = {
|
|
|
125
134
|
readonly three?: unknown;
|
|
126
135
|
/** The vehicles to lay out, as fleet ids (default the 8 of the Frota test: hatch, sedan, pickup, sport bike, box truck, city bus, battle tank, attack helicopter). */
|
|
127
136
|
readonly vehicles?: readonly string[];
|
|
128
|
-
/**
|
|
137
|
+
/** Wrecks laid out after the vehicles: item `key` is the fleet vehicle `vehicle` built with the registered damage `scenario` (default `sedan_burnt` and `hatch_burnt`, the fleet's `burnt`; an empty list lays none). */
|
|
138
|
+
readonly wrecks?: readonly VehicleWreck[];
|
|
139
|
+
/** Effect ids requested through `host.effects` (the defaults are ids of `game-vfx`: the Garagem's `car_fuel_tank` blast, the `vehicle_fire`, `vehicle_leak` (pool and drips only), `vehicle_leak_ignited` (the whole sequence) and `vehicle_exhaust` recipes written around a car from `engine_smoke` and `fuel_leak`, and the point-based `glass_burst` and `impact_metal`). */
|
|
129
140
|
readonly effects?: Partial<VehicleEffectIds>;
|
|
130
141
|
/** Sound ids requested through `host.audio` (the defaults are the `game-audio` ones: `engine_saw`, `horn`, `sfx_impact`). */
|
|
131
142
|
readonly sounds?: Partial<VehicleSoundIds>;
|
|
@@ -212,4 +223,4 @@ declare const VEHICLE_SCENARIO_IDS: readonly string[];
|
|
|
212
223
|
declare const PAGE_SCENARIO_ALIASES: Readonly<Record<string, string>>;
|
|
213
224
|
declare const PAGE_ITEM_ALIASES: Readonly<Record<string, string>>;
|
|
214
225
|
|
|
215
|
-
export { type BuildVehicleOptions, type BuiltVehicle, DEFAULT_TEST_VEHICLES, type DocumentLike, type EffectsLike, LITE_CLASSES, type LiteClass, type LiteFusion, type ModuleRoomLike, PAGE_ITEM_ALIASES, PAGE_SCENARIO_ALIASES, PRUNE_BELOW, VEHICLES_AREA_ID, VEHICLE_SCENARIO_IDS, type VehicleEffectIds, type VehicleQuality, type VehicleSoundIds, type VehiclesContext, type VehiclesRoom, type VehiclesTestOptions, type VehiclesThree, type VehiclesThreeOptions, classColor, classify, createVehiclesTestModule, createVehiclesThree, defaultEffectIds, defaultSoundIds, fuse, liteMaterials, liteMeshes, loadVehiclesTestModule };
|
|
226
|
+
export { type BuildVehicleOptions, type BuiltVehicle, DEFAULT_TEST_VEHICLES, DEFAULT_TEST_WRECKS, type DocumentLike, type EffectsLike, LITE_CLASSES, type LiteClass, type LiteFusion, type ModuleRoomLike, PAGE_ITEM_ALIASES, PAGE_SCENARIO_ALIASES, PRUNE_BELOW, VEHICLES_AREA_ID, VEHICLE_SCENARIO_IDS, type VehicleEffectIds, type VehicleQuality, type VehicleSoundIds, type VehicleWreck, type VehiclesContext, type VehiclesRoom, type VehiclesTestOptions, type VehiclesThree, type VehiclesThreeOptions, classColor, classify, createVehiclesTestModule, createVehiclesThree, defaultEffectIds, defaultSoundIds, fuse, liteMaterials, liteMeshes, loadVehiclesTestModule };
|