@adatechnology/game-vehicles-three 0.9.9 → 0.9.10
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-CCKLH536.js → chunk-GEB4YOV7.js} +432 -28
- package/dist/chunk-GEB4YOV7.js.map +1 -0
- package/dist/index.d.ts +38 -9
- package/dist/index.global.js +2050 -288
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +9 -3
- package/dist/{testing-D6oFFVUd.d.ts → testing-CY8IYz1H.d.ts} +6 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +14 -13
- package/dist/chunk-CCKLH536.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { E as EngineProfile, V as VehicleSoundKeys, B as BuiltVehicle } from './testing-
|
|
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 engineProfileOfGroup, Q as hornOfGroup, R as loadProvingModule, S as loadVehiclesTestModule } from './testing-
|
|
3
|
-
import { EffectSink, Vec3, AudioSink, AnimationClipSpec } from '@adatechnology/game-contracts';
|
|
4
|
-
import { CabinSource, VehicleContext } from '@adatechnology/game-vehicles';
|
|
1
|
+
import { E as EngineProfile, V as VehicleSoundKeys, B as BuiltVehicle } from './testing-CY8IYz1H.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 engineProfileOfGroup, Q as hornOfGroup, R as loadProvingModule, S as loadVehiclesTestModule } from './testing-CY8IYz1H.js';
|
|
3
|
+
import { EffectSink, Vec3, AudioSink, AnimationClipSpec, DrawnCollider } from '@adatechnology/game-contracts';
|
|
4
|
+
import { CabinSource, VehicleContext, VehicleDestructible } from '@adatechnology/game-vehicles';
|
|
5
5
|
import { LoopRecipe, Falloff, SampleAlias, SoundRecipe, SoundBank } from '@adatechnology/game-audio';
|
|
6
6
|
import * as THREE_NS from 'three';
|
|
7
7
|
import { Texture, Material, Color, Object3D, Matrix4, MeshStandardMaterial, MeshBasicMaterial, Mesh, Vector3, Box3, CanvasTexture, CircleGeometry, BufferGeometry, Side } from 'three';
|
|
8
|
+
import { StaticBatchQueue } from '@adatechnology/game-render-three';
|
|
8
9
|
import '@adatechnology/game-vehicles-driving';
|
|
9
10
|
import '@adatechnology/game-vehicles-proving';
|
|
10
11
|
|
|
@@ -193,7 +194,7 @@ declare function createVehicleSound(audio: AudioSink | undefined, options?: Vehi
|
|
|
193
194
|
* 0.25 and 0.45 emissive) and the colours are the team's.
|
|
194
195
|
*/
|
|
195
196
|
|
|
196
|
-
type Three = typeof THREE_NS;
|
|
197
|
+
type Three$1 = typeof THREE_NS;
|
|
197
198
|
/** The six classes of a fused vehicle, in the order they are added to the group. */
|
|
198
199
|
declare const LITE_CLASSES: readonly ["paint", "trim", "metal", "glass", "light", "plate"];
|
|
199
200
|
type LiteClass = (typeof LITE_CLASSES)[number];
|
|
@@ -236,18 +237,22 @@ declare function classify(mat: LiteSourceMaterial, mesh: Object3D, c: LiteSource
|
|
|
236
237
|
/** The vertex colour of a piece of a class. `paintColor` replaces the primary paint. */
|
|
237
238
|
declare function classColor(mat: LiteSourceMaterial, cls: LiteClass, primary: Material | null | undefined, paintColor: Color | null | undefined, out: Color): Color;
|
|
238
239
|
/** The material of each class (vertex colours; glass blends; light is unlit; the plate keeps its canvas texture). */
|
|
239
|
-
declare function liteMaterials(THREE: Three, environment: Texture | null): Record<LiteClass, LiteMaterial>;
|
|
240
|
+
declare function liteMaterials(THREE: Three$1, environment: Texture | null): Record<LiteClass, LiteMaterial>;
|
|
240
241
|
/**
|
|
241
242
|
* Walks the built vehicle and collects every visible mesh, in the frame of `pivot`, into one set of arrays per class.
|
|
242
243
|
* `hidden` is the set of materials nobody sees from outside (`kit.lodHiddenMaterials()`).
|
|
243
244
|
*/
|
|
244
|
-
declare function fuse(THREE: Three, c: LiteSource, pivot: Matrix4, paintColor: Color | null, primary: Material | null | undefined, hidden: ReadonlySet<Material>): LiteFusion;
|
|
245
|
+
declare function fuse(THREE: Three$1, c: LiteSource, pivot: Matrix4, paintColor: Color | null, primary: Material | null | undefined, hidden: ReadonlySet<Material>): LiteFusion;
|
|
245
246
|
/** One mesh per class that has triangles. */
|
|
246
|
-
declare function liteMeshes(THREE: Three, fusion: LiteFusion, materials: Record<LiteClass, LiteMaterial>): Mesh[];
|
|
247
|
+
declare function liteMeshes(THREE: Three$1, fusion: LiteFusion, materials: Record<LiteClass, LiteMaterial>): Mesh[];
|
|
247
248
|
|
|
248
249
|
/** Past this distance (m) an untouched vehicle draws fused: nobody sees a door seam from here, and the full model costs hundreds of draw calls. */
|
|
249
250
|
declare const VEHICLE_LOD_DISTANCE = 14;
|
|
251
|
+
/** The one queue of an owner's vehicles (`vehicles.lod-batch`): pass it as `queue` to every `createVehicleLod` and register `queue.deferredQueue()` with the frame budget. */
|
|
252
|
+
declare const createVehicleLodQueue: () => StaticBatchQueue;
|
|
250
253
|
type VehicleLodOptions = {
|
|
254
|
+
/** The queue the batches are merged by, within a frame budget (`createVehicleLodQueue`). Not registered with a budget (or not given), each update merges for up to 2 ms, as ever. */
|
|
255
|
+
readonly queue?: StaticBatchQueue;
|
|
251
256
|
/** The clock (ms) the quiet time is read from (default `performance.now`). */
|
|
252
257
|
readonly now?: () => number;
|
|
253
258
|
};
|
|
@@ -594,4 +599,28 @@ interface WindshieldMist {
|
|
|
594
599
|
}
|
|
595
600
|
declare function createWindshieldMist(THREE: MistThree, built: BuiltVehicle): WindshieldMist;
|
|
596
601
|
|
|
597
|
-
|
|
602
|
+
type Three = typeof THREE_NS;
|
|
603
|
+
interface VehicleCollidersOptions {
|
|
604
|
+
/** Triangles of work per `pieces()` call: a vehicle that spawns fills in over several calls. Default all at once. */
|
|
605
|
+
readonly budget?: number;
|
|
606
|
+
}
|
|
607
|
+
interface VehicleColliders {
|
|
608
|
+
/** The pieces now: only what changed since the last call is made again. */
|
|
609
|
+
pieces(): DrawnCollider[];
|
|
610
|
+
/** Pieces are still to be made (the budget ran out): call `pieces()` again. */
|
|
611
|
+
isPending(): boolean;
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* What a vehicle collides with in an engine, as it is drawn: one piece per part that has a mesh of its own (a door, the hood, the lid, a bumper, a wheel, a tyre, a lamp, a
|
|
615
|
+
* mirror), and the rest of what is drawn (the body's merged meshes, the glass, the interior) split by the part of the shell that holds each triangle. A part's triangles are
|
|
616
|
+
* held in pieces by the 40 cm cell of the vehicle they are in; each piece is the box along the drawn vertices where that fits within 1 cm, else its triangles (coarsened, every
|
|
617
|
+
* vertex a drawn one) with the box around them. In the frame `describe()` answers in. A part that broke or came off has none; a mirror is its own piece and never widens the cab.
|
|
618
|
+
*
|
|
619
|
+
* Kept between calls: where each triangle went is worked out once per mesh, and a call finds what moved (a mesh that was posed, vertices a dent pushed) and makes again only
|
|
620
|
+
* the pieces it touched.
|
|
621
|
+
*/
|
|
622
|
+
declare const createVehicleColliders: (THREE: Three, vehicle: VehicleDestructible, frame: THREE_NS.Object3D, options?: VehicleCollidersOptions) => VehicleColliders;
|
|
623
|
+
/** The pieces of a vehicle once, all at once (`createVehicleColliders` keeps them between calls). */
|
|
624
|
+
declare const vehicleColliders: (THREE: Three, vehicle: VehicleDestructible, frame: THREE_NS.Object3D) => DrawnCollider[];
|
|
625
|
+
|
|
626
|
+
export { type BodyEvent, type BodyThree, BuiltVehicle, CAR_RECORDED_RPM, CAR_START_RUN_STOP, type CabinSmoke, DASHBOARD_LOOK, type DashboardOptions, type DashboardReading, type EngineBudget, type EngineBudgetOptions, type EngineLayerSetting, type EngineMixInput, EngineProfile, LAMP_RULES, LITE_CLASSES, type LampSwitch, type LiteClass, type LiteFusion, MIST_RULES, type MistThree, PRUNE_BELOW, VEHICLE_LOD_DISTANCE, VEHICLE_LOOPS, VEHICLE_LOOP_FALLOFF, VEHICLE_PRELOAD_SOUNDS, VEHICLE_SAMPLE_ALIASES, VEHICLE_SOUNDS, VEHICLE_SOUND_BANK, type VehicleBody, type VehicleBodyOptions, type VehicleColliders, type VehicleCollidersOptions, type VehicleDashboard, type VehicleLamps, type VehicleLod, type VehicleLodKit, type VehicleSound, type VehicleSoundFrame, VehicleSoundKeys, type VehicleSoundOptions, type VehicleSoundReading, type WheelRoll, type WheelRollThree, type WindowId, type WindshieldMist, classColor, classify, createCabinSmoke, createEngineBudget, createGearGuess, createVehicleBody, createVehicleColliders, createVehicleDashboard, createVehicleLamps, createVehicleLod, createVehicleLodQueue, createVehicleSound, createWheelRoll, createWindshieldMist, engineMix, firingHz, fuse, layerWeight, liteMaterials, liteMeshes, rpmShare, slideOfGrip, vehicleColliders };
|