@adatechnology/game-vehicles-three 0.6.0 → 0.6.1
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-4SUQMRS3.js → chunk-MRUPKE7J.js} +732 -23
- package/dist/chunk-MRUPKE7J.js.map +1 -0
- package/dist/index.d.ts +168 -3
- package/dist/index.global.js +1049 -26
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +9 -1
- package/dist/{testing-gEnSqEF6.d.ts → testing-C-BgV7gj.d.ts} +40 -9
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-4SUQMRS3.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { E as EngineProfile, V as VehicleSoundKeys } from './testing-
|
|
2
|
-
export {
|
|
1
|
+
import { E as EngineProfile, V as VehicleSoundKeys, B as BuiltVehicle } from './testing-C-BgV7gj.js';
|
|
2
|
+
export { a as BIKE_ENGINE, b as BuildVehicleOptions, C as CAR_ENGINE, c as CRASH_SPEEDS, D as DEFAULT_TEST_VEHICLES, d as DEFAULT_TEST_WRECKS, e as DEFAULT_VEHICLE_SOUND_KEYS, f as DocumentLike, g as ENGINE_PROFILES, h as EffectsLike, i as EngineLayer, j as EngineLoadLayer, F as FleetDims, 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, T as TRUCK_ENGINE, q as VEHICLES_AREA_ID, r as VEHICLE_SCENARIO_IDS, s as VehicleEffectIds, t as VehicleFleetContent, u as VehicleQuality, v as VehicleSoundIds, w as VehicleWreck, x as VehiclesContext, y as VehiclesRoom, z as VehiclesTestFleet, A as VehiclesTestOptions, G as VehiclesThree, H as VehiclesThreeOptions, I as createProvingModule, J as createVehiclesTestModule, K as createVehiclesThree, L as defaultEffectIds, N as defaultSoundIds, O as loadProvingModule, Q as loadVehiclesTestModule } from './testing-C-BgV7gj.js';
|
|
3
3
|
import { EffectSink, Vec3, AudioSink } from '@adatechnology/game-contracts';
|
|
4
4
|
import { CabinSource } from '@adatechnology/game-vehicles';
|
|
5
5
|
import { LoopRecipe, Falloff, SoundRecipe, SoundBank } from '@adatechnology/game-audio';
|
|
6
|
+
import { Object3D, CanvasTexture, CircleGeometry, MeshBasicMaterial, Mesh, Vector3 } from 'three';
|
|
6
7
|
import '@adatechnology/game-vehicles-proving';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -166,4 +167,168 @@ type VehicleLod = {
|
|
|
166
167
|
/** Shows `full` near and the kit's fused light mode (one mesh per class of material) far, in `root`'s own space. Hit tests read the full model, visible or not. */
|
|
167
168
|
declare function createVehicleLod(kit: any, context: any, root: any, full: any, options?: VehicleLodOptions): VehicleLod;
|
|
168
169
|
|
|
169
|
-
|
|
170
|
+
type LampSwitch = {
|
|
171
|
+
mode: 'off' | 'position' | 'low' | 'high';
|
|
172
|
+
fog: boolean;
|
|
173
|
+
interior: boolean;
|
|
174
|
+
brake: boolean;
|
|
175
|
+
reverse: boolean;
|
|
176
|
+
/** Indicator lamps lit this instant (the controls blink them). */
|
|
177
|
+
left: boolean;
|
|
178
|
+
right: boolean;
|
|
179
|
+
};
|
|
180
|
+
/** Glow of the lamp glass by switch, as a share of what the kit drew (the kit draws them lit), and the beams. */
|
|
181
|
+
declare const LAMP_RULES: {
|
|
182
|
+
readonly glow: {
|
|
183
|
+
readonly head: {
|
|
184
|
+
readonly off: 0.04;
|
|
185
|
+
readonly position: 0.3;
|
|
186
|
+
readonly low: 1;
|
|
187
|
+
readonly high: 1.35;
|
|
188
|
+
};
|
|
189
|
+
readonly tail: {
|
|
190
|
+
readonly off: 0.15;
|
|
191
|
+
readonly on: 0.7;
|
|
192
|
+
readonly brake: 1.6;
|
|
193
|
+
};
|
|
194
|
+
readonly fog: {
|
|
195
|
+
readonly off: 0.04;
|
|
196
|
+
readonly on: 1.1;
|
|
197
|
+
};
|
|
198
|
+
readonly amber: {
|
|
199
|
+
readonly off: 0.1;
|
|
200
|
+
readonly on: 2.2;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
readonly low: {
|
|
204
|
+
readonly color: 16773584;
|
|
205
|
+
readonly intensity: 2.4;
|
|
206
|
+
readonly distance: 32;
|
|
207
|
+
readonly angle: 0.42;
|
|
208
|
+
readonly penumbra: 0.55;
|
|
209
|
+
readonly decay: 1.6;
|
|
210
|
+
readonly drop: 0.09;
|
|
211
|
+
};
|
|
212
|
+
readonly high: {
|
|
213
|
+
readonly color: 16774882;
|
|
214
|
+
readonly intensity: 3.6;
|
|
215
|
+
readonly distance: 70;
|
|
216
|
+
readonly angle: 0.3;
|
|
217
|
+
readonly penumbra: 0.45;
|
|
218
|
+
readonly decay: 1.4;
|
|
219
|
+
readonly drop: 0.015;
|
|
220
|
+
};
|
|
221
|
+
readonly fog: {
|
|
222
|
+
readonly color: 16773320;
|
|
223
|
+
readonly intensity: 1.6;
|
|
224
|
+
readonly distance: 16;
|
|
225
|
+
readonly angle: 0.75;
|
|
226
|
+
readonly penumbra: 0.7;
|
|
227
|
+
readonly decay: 1.8;
|
|
228
|
+
readonly drop: 0.12;
|
|
229
|
+
};
|
|
230
|
+
readonly reverse: {
|
|
231
|
+
readonly color: 16054015;
|
|
232
|
+
readonly intensity: 0.9;
|
|
233
|
+
readonly distance: 7;
|
|
234
|
+
readonly decay: 2;
|
|
235
|
+
};
|
|
236
|
+
readonly interior: {
|
|
237
|
+
readonly color: 16769712;
|
|
238
|
+
readonly intensity: 0.5;
|
|
239
|
+
readonly distance: 2.4;
|
|
240
|
+
readonly decay: 2;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
interface VehicleLamps {
|
|
244
|
+
/** What this vehicle has: fog lamps only when the kit drew them. */
|
|
245
|
+
readonly has: {
|
|
246
|
+
head: boolean;
|
|
247
|
+
tail: boolean;
|
|
248
|
+
fog: boolean;
|
|
249
|
+
indicators: boolean;
|
|
250
|
+
};
|
|
251
|
+
set(lamps: LampSwitch): void;
|
|
252
|
+
readonly state: LampSwitch;
|
|
253
|
+
dispose(): void;
|
|
254
|
+
}
|
|
255
|
+
declare function createVehicleLamps(THREE: {
|
|
256
|
+
Object3D: new () => Object3D;
|
|
257
|
+
}, built: BuiltVehicle, options?: {
|
|
258
|
+
lights?: unknown;
|
|
259
|
+
owner?: string;
|
|
260
|
+
}): VehicleLamps;
|
|
261
|
+
|
|
262
|
+
/** What the cluster shows this instant. */
|
|
263
|
+
type DashboardReading = {
|
|
264
|
+
kmh: number;
|
|
265
|
+
rpm: number;
|
|
266
|
+
/** -1 reverse, 0 neutral, 1.. forward. */
|
|
267
|
+
gear: number;
|
|
268
|
+
ignition: boolean;
|
|
269
|
+
engineOn: boolean;
|
|
270
|
+
left: boolean;
|
|
271
|
+
right: boolean;
|
|
272
|
+
highBeam: boolean;
|
|
273
|
+
lowBeam: boolean;
|
|
274
|
+
fog: boolean;
|
|
275
|
+
parkingBrake: boolean;
|
|
276
|
+
seatbelt: boolean;
|
|
277
|
+
fourWheel: boolean;
|
|
278
|
+
/** Engine temperature, 0 (cold) to 1 (overheating); leave out while the engine has no heat model. */
|
|
279
|
+
temperature?: number;
|
|
280
|
+
/** Fuel, 0 (empty) to 1 (full); leave out while the vehicle has no fuel model. */
|
|
281
|
+
fuel?: number;
|
|
282
|
+
};
|
|
283
|
+
/** The scale of the dials and how often the faces are redrawn. */
|
|
284
|
+
type DashboardOptions = {
|
|
285
|
+
/** The kit's dial material (`kit.materials.gauge`): the dials are found by it. */
|
|
286
|
+
gauge: unknown;
|
|
287
|
+
/** The kit's needle material (`kit.materials.amber`): the fixed needles drawn on the dials hide while the live face shows. */
|
|
288
|
+
needle?: unknown;
|
|
289
|
+
/** Top of the speedometer, km/h. Default 220. */
|
|
290
|
+
maxKmh?: number;
|
|
291
|
+
/** Red line of the rev counter. Default 6500. */
|
|
292
|
+
redlineRpm?: number;
|
|
293
|
+
/** Redraws per second at most. Default 15. */
|
|
294
|
+
fps?: number;
|
|
295
|
+
/** Where the canvases come from (tests pass a fake one). Default the page's. */
|
|
296
|
+
document?: {
|
|
297
|
+
createElement(tag: 'canvas'): HTMLCanvasElement;
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
interface VehicleDashboard {
|
|
301
|
+
/** How many dials were found (0: a vehicle without a cluster drawn, nothing to show). */
|
|
302
|
+
readonly dials: number;
|
|
303
|
+
update(reading: DashboardReading, dt: number): void;
|
|
304
|
+
dispose(): void;
|
|
305
|
+
}
|
|
306
|
+
type ThreeLib = {
|
|
307
|
+
CanvasTexture: new (canvas: HTMLCanvasElement) => CanvasTexture;
|
|
308
|
+
CircleGeometry: new (radius: number, segments: number) => CircleGeometry;
|
|
309
|
+
MeshBasicMaterial: new (p: {
|
|
310
|
+
map: CanvasTexture;
|
|
311
|
+
transparent: boolean;
|
|
312
|
+
toneMapped: boolean;
|
|
313
|
+
depthWrite: boolean;
|
|
314
|
+
}) => MeshBasicMaterial;
|
|
315
|
+
Mesh: new (g: CircleGeometry, m: MeshBasicMaterial) => Mesh;
|
|
316
|
+
Vector3: new (x?: number, y?: number, z?: number) => Vector3;
|
|
317
|
+
};
|
|
318
|
+
/** The colours of the cluster: the warning lights by the usual code (red stop, amber caution, green and blue information). */
|
|
319
|
+
declare const DASHBOARD_LOOK: {
|
|
320
|
+
readonly face: "#0b1110";
|
|
321
|
+
readonly ring: "#2f3a36";
|
|
322
|
+
readonly marks: "#cfe8dc";
|
|
323
|
+
readonly needle: "#ff6a2a";
|
|
324
|
+
readonly red: "#e2402f";
|
|
325
|
+
readonly amber: "#f2a630";
|
|
326
|
+
readonly green: "#46d16f";
|
|
327
|
+
readonly blue: "#3f8cff";
|
|
328
|
+
readonly dim: "rgba(207,232,220,0.12)";
|
|
329
|
+
/** How far in front of the kit's dial the face sits, metres (the kit's needle sticks out 6 mm). */
|
|
330
|
+
readonly lift: 0.011;
|
|
331
|
+
};
|
|
332
|
+
declare function createVehicleDashboard(THREE: ThreeLib, built: BuiltVehicle, options: DashboardOptions): VehicleDashboard;
|
|
333
|
+
|
|
334
|
+
export { BuiltVehicle, type CabinSmoke, DASHBOARD_LOOK, type DashboardOptions, type DashboardReading, type EngineLayerSetting, type EngineMixInput, EngineProfile, LAMP_RULES, LITE_CLASSES, type LampSwitch, type LiteClass, type LiteFusion, PRUNE_BELOW, VEHICLE_LOD_DISTANCE, VEHICLE_LOOPS, VEHICLE_LOOP_FALLOFF, VEHICLE_SOUNDS, VEHICLE_SOUND_BANK, type VehicleDashboard, type VehicleLamps, type VehicleLod, type VehicleSound, type VehicleSoundFrame, VehicleSoundKeys, type VehicleSoundOptions, type VehicleSoundReading, classColor, classify, createCabinSmoke, createGearGuess, createVehicleDashboard, createVehicleLamps, createVehicleLod, createVehicleSound, engineMix, firingHz, fuse, layerWeight, liteMaterials, liteMeshes, rpmShare };
|