@adatechnology/game-vehicles 0.6.16 → 0.6.18
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/index.d.ts +45 -7
- package/dist/index.global.js +451 -101
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +338 -101
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ declare function installGeometry(kit: Kit): {
|
|
|
67
67
|
crease: (geo: BufferGeometry, deg: number) => BufferGeometry<three.NormalBufferAttributes>;
|
|
68
68
|
creaseTask: (geo: BufferGeometry, deg: number) => {
|
|
69
69
|
geo: BufferGeometry<three.NormalBufferAttributes>;
|
|
70
|
-
step: (deadline: number) => boolean;
|
|
70
|
+
step: (deadline: number, clock?: () => number) => boolean;
|
|
71
71
|
};
|
|
72
72
|
refreshBounds: (geo: BufferGeometry) => void;
|
|
73
73
|
pathShape: (items: readonly PathItem[]) => three.Shape;
|
|
@@ -79,7 +79,7 @@ declare function installGeometry(kit: Kit): {
|
|
|
79
79
|
cut: Record<string, BufferGeometry>;
|
|
80
80
|
tasks: Record<string, ReturnType<(geo: BufferGeometry, deg: number) => {
|
|
81
81
|
geo: BufferGeometry<three.NormalBufferAttributes>;
|
|
82
|
-
step: (deadline: number) => boolean;
|
|
82
|
+
step: (deadline: number, clock?: () => number) => boolean;
|
|
83
83
|
}>>;
|
|
84
84
|
};
|
|
85
85
|
mergeGeometries: (list: readonly BufferGeometry[]) => BufferGeometry<three.NormalBufferAttributes>;
|
|
@@ -1056,7 +1056,7 @@ type CutPanelOptions = {
|
|
|
1056
1056
|
anyN?: boolean;
|
|
1057
1057
|
pieceTasks?: Map<Mesh, {
|
|
1058
1058
|
geo: BufferGeometry;
|
|
1059
|
-
step: (deadline: number) => boolean;
|
|
1059
|
+
step: (deadline: number, clock?: () => number) => boolean;
|
|
1060
1060
|
}>;
|
|
1061
1061
|
};
|
|
1062
1062
|
declare function installZoneDent(kit: Kit): {
|
|
@@ -1444,9 +1444,10 @@ interface ParticleEffectRequest {
|
|
|
1444
1444
|
readonly point: [number, number, number];
|
|
1445
1445
|
readonly values: Readonly<Record<string, number>>;
|
|
1446
1446
|
}
|
|
1447
|
-
/** The host's effects world as far as the puffs need it (`EffectSink` of `game-contracts` fits). */
|
|
1447
|
+
/** The host's effects world as far as the puffs and 3D vehicle fire/explosions need it (`EffectSink` of `game-contracts` fits). */
|
|
1448
1448
|
interface ParticleEffects {
|
|
1449
1449
|
play(request: ParticleEffectRequest): unknown;
|
|
1450
|
+
stop?(handle: unknown): void;
|
|
1450
1451
|
}
|
|
1451
1452
|
|
|
1452
1453
|
type DamageableMaterial = 'metal' | 'glass' | 'rubber' | 'fuel';
|
|
@@ -1860,6 +1861,8 @@ interface ExplodeOptions {
|
|
|
1860
1861
|
now?: boolean;
|
|
1861
1862
|
/** Seconds of fire before the blast (default 3..8 at random). */
|
|
1862
1863
|
delay?: number;
|
|
1864
|
+
/** Skip playing the 3D blast effect in `detonate` (used when the destructible layer already emitted `explode` to the host). */
|
|
1865
|
+
skipBlastEffect?: boolean;
|
|
1863
1866
|
}
|
|
1864
1867
|
interface OverallHealth {
|
|
1865
1868
|
health: number;
|
|
@@ -2134,8 +2137,8 @@ declare function buildVehicleModel(kit: VehicleKit, c: VehicleContext, options?:
|
|
|
2134
2137
|
interface CreaseWork {
|
|
2135
2138
|
/** Units waiting; 0 in the frame a panel was torn (that frame already paid for the cut). `frame` is the budget's frame counter. */
|
|
2136
2139
|
pendingUnits(frame?: number): number;
|
|
2137
|
-
/** Runs one slice of the work (a smoothing step or a piece of the index warm-up) until `deadline`
|
|
2138
|
-
runStep(deadline: number): boolean;
|
|
2140
|
+
/** Runs one slice of the work (a smoothing step or a piece of the index warm-up) until `clock()` reaches `deadline` (`clock` is the budget's; default `performance.now`); false when there was nothing to run. */
|
|
2141
|
+
runStep(deadline: number, clock?: () => number): boolean;
|
|
2139
2142
|
/** Finishes everything now. */
|
|
2140
2143
|
finishAll(): void;
|
|
2141
2144
|
/** While true the vehicle's own update leaves the work to the queue. */
|
|
@@ -2153,6 +2156,14 @@ interface CreaseQueue {
|
|
|
2153
2156
|
*/
|
|
2154
2157
|
declare function createCreaseQueue(): CreaseQueue;
|
|
2155
2158
|
|
|
2159
|
+
/**
|
|
2160
|
+
* `createVehicleDestructible`: a vehicle that follows the destruction contract of `@adatechnology/game-contracts` and brings its own rules.
|
|
2161
|
+
* Every damage zone and mechanical part is a part with a material, hits become events (dent, hole, crack, fracture, detach, leak, ignite,
|
|
2162
|
+
* melt, explode), joints come apart by wear, by a wrench or by breaking, and the hidden mechanics change how the vehicle drives.
|
|
2163
|
+
*
|
|
2164
|
+
* It depends on the contracts only (types) and on the kit it is given: not on the default destruction world.
|
|
2165
|
+
*/
|
|
2166
|
+
|
|
2156
2167
|
interface VehicleDestructibleOptions {
|
|
2157
2168
|
/** Object id the host gives (`DestructibleImpl.id`). Default: the vehicle key. */
|
|
2158
2169
|
id?: string;
|
|
@@ -2214,6 +2225,8 @@ interface VehicleDestructible extends DestructibleImpl {
|
|
|
2214
2225
|
readonly model: VehicleModel;
|
|
2215
2226
|
/** Display name of a part (from the kit locale). */
|
|
2216
2227
|
partName(partId: string): string;
|
|
2228
|
+
/** The meshes and groups that draw the part now (none when it has no mesh of its own, came off or is not drawn: the body shell is the vehicle's merged meshes). */
|
|
2229
|
+
objectsOf(partId: string): Object3D[];
|
|
2217
2230
|
status(): VehicleStatus;
|
|
2218
2231
|
/** Open and close clips for the doors, the hood and the trunk lid the vehicle has. */
|
|
2219
2232
|
animations(): AnimationClipSpec[];
|
|
@@ -2359,4 +2372,29 @@ declare function swingOf(vehicle: VehicleContext, partId: string): number;
|
|
|
2359
2372
|
*/
|
|
2360
2373
|
declare function cabinEnclosure(source: CabinSource, options?: CabinEnclosureOptions): Enclosure | null;
|
|
2361
2374
|
|
|
2362
|
-
|
|
2375
|
+
/** Vehicle cabin categories covered by the R6 interior clearance table. */
|
|
2376
|
+
declare const CABIN_CATEGORIES: readonly ["passenger_car", "suv_pickup", "van", "truck", "bus", "agricultural", "military_light", "military_armored", "open_vehicle", "boat_cabin", "aircraft_enclosed"];
|
|
2377
|
+
type CabinCategory = (typeof CABIN_CATEGORIES)[number];
|
|
2378
|
+
/** Minimum door opening dimensions for a cabin category, in metres. */
|
|
2379
|
+
type CabinDoorMinimum = {
|
|
2380
|
+
readonly widthMetres: number;
|
|
2381
|
+
readonly heightMetres: number;
|
|
2382
|
+
};
|
|
2383
|
+
/** Minimum interior clearances for one vehicle cabin category, in metres (`Infinity` means unobstructed/open). */
|
|
2384
|
+
type CabinMinimum = {
|
|
2385
|
+
readonly frontHeadroomMetres: number;
|
|
2386
|
+
readonly rearHeadroomMetres: number | undefined;
|
|
2387
|
+
readonly frontLegroomMetres: number;
|
|
2388
|
+
readonly widthMetres: number;
|
|
2389
|
+
readonly door: CabinDoorMinimum | undefined;
|
|
2390
|
+
};
|
|
2391
|
+
/** Documented source of the cabin clearance table and entry duck factor. */
|
|
2392
|
+
declare const CABIN_SOURCE: string;
|
|
2393
|
+
/** Fraction of standing height required vertically when ducking through a side vehicle door. */
|
|
2394
|
+
declare const ENTRY_DUCK_FACTOR: number;
|
|
2395
|
+
/** Minimum interior clearances by cabin category (Spec 012 R6). */
|
|
2396
|
+
declare const CABIN_MINIMUMS: Readonly<Record<CabinCategory, CabinMinimum>>;
|
|
2397
|
+
/** Returns the minimum interior clearances for a cabin category. */
|
|
2398
|
+
declare const cabinMinimumOf: (category: CabinCategory) => CabinMinimum;
|
|
2399
|
+
|
|
2400
|
+
export { ARMOUR_LEVELS, type ArmourLevel, type ArmourLevelId, type Band, type BandId, type BandIndex, type BandOverride, type BuildFunction, type BuildOptions, type BuildState, type BuildZoneState, type BusRowsOptions, CABIN_CATEGORIES, CABIN_LEAK, CABIN_MINIMUMS, CABIN_SOURCE, CRASH_RULES, type CabinBox, type CabinCategory, type CabinDoorMinimum, type CabinEnclosureOptions, type CabinMinimum, type CabinSource, type CarSpec, type CarWheel, type CrashOptions, type CrashResult, type CrashRules, type CreaseQueue, type CreaseWork, type CutTest, type DamageMapOptions, type DamageZone, type Damageable, type DamageableKind, type DamageableMaterial, type DamageableSide, type DashboardOptions, type DriveReport, ENTRY_DUCK_FACTOR, type EngineBaySpec, type ExplodeOptions, type FlagEffect, type FluidDefinition, type GlassOptions, type GlassQuad, type Greenhouse, type GrilleOptions, type HeadlightLens, type HeadlightOptions, type ImpactOptions, type InteriorOptions, JOINT_RULES, type JointDef, type KitConfiguration, type KitInternals, type KitTexts, LEGACY_STATES, LEGACY_ZONE_IDS, type LabelArgument, type LocalBox, type LocaleStrings, type LodSettings, type LoftRow, type LoftStation, type OverallHealth, type PaneLook, type PartDef, type PartLabel, type PartRole, type PartialLocaleStrings, type ParticleEffectRequest, type ParticleEffects, type ParticleMaterials, type PathItem, type Plugin, type Puddle, type PuddleLobe, type ResolvedConfiguration, type RollState, SEED_SALTS, type ScenarioContext, type ScenarioDefinition, type ScenarioResult, type SceneNode, type SeatOptions, type ShellSpec, type SmoothLoftOptions, type Splat, type SplatOptions, type StrayLamp, type TaillightOptions, type ThreeObject, type ThreeVector, type Translate, type TumbleSpec, type UiHelpers, type UnderbodySpec, type VehicleContext, type VehicleDestructible, type VehicleDestructibleOptions, type VehicleItem, type VehicleItemOptions, type VehicleKit, type VehicleKitOptions, type VehicleLamp, type VehicleMeta, type VehicleModel, type VehiclePart, type VehicleSpec, type VehicleStatus, type WarpFn, type WarpOptions, type ZoneDamageEntry, type ZoneDef, type ZoneEffect, type ZoneState, armourLevelOf, buildVehicleItem, buildVehicleModel, cabinBoxOf, cabinEnclosure, cabinMinimumOf, clamp, crackedGlassMaterial, crashDeltaV, crashVehicle, createCreaseQueue, createLod, createTranslate, createVehicleDestructible, createVehicleKit, defaultDamageableKinds, defaultLodSettings, format, hash, legacyGlassId, legacyLightId, legacyZoneId, listLocales, registerLegacySeeds, registerLocale, resolveStrings, rng, smooth, strHash, strayLampsOf, swingOf, wrapThreeForLod };
|