@adatechnology/game-weapons-three 0.14.1 → 0.15.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/assets/weapon-svg/generated/m79.svg +1 -1
- package/dist/{chunk-PRC75VKC.js → chunk-GBO6L7CQ.js} +1639 -1406
- package/dist/chunk-GBO6L7CQ.js.map +1 -0
- package/dist/index.d.ts +31 -6
- package/dist/index.global.js +2146 -1043
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/dist/{testing-DnPjEPC5.d.ts → testing-Cf1M1sWN.d.ts} +27 -25
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +9 -9
- package/dist/chunk-PRC75VKC.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as ItemModels, W as WeaponProps, a as WeaponItemModel, M as
|
|
2
|
-
export {
|
|
1
|
+
import { I as ItemModels, W as WeaponProps, a as WeaponItemModel, M as ModelOptions, b as WeaponModel, c as ModelKit, d as ModelParts, e as ModelFamily, A as AttachmentModelRegistry, L as LaserRaycast } from './testing-Cf1M1sWN.js';
|
|
2
|
+
export { f as AttachmentBuildContext, g as AttachmentModel, h as AttachmentModelBuilder, C as CLASS_REFERENCE_ENERGY, i as COUNTER_ITEM_ID, j as CUES_IN_SAMPLE, k as CasingSound, l as CuePlayed, D as DEFAULT_ENERGY_CURVE, m as DEFAULT_EXPLOSIVES_SCENE, n as DistanceCurve, E as EXPLOSIVES_AREA_ID, o as EXPLOSIVES_TEXT, p as EnergyCurve, q as ExplosivesRoom, r as ExplosivesScene, s as ExplosivesTestModuleOptions, t as ExplosivesText, F as FlybySound, u as FxLayers, G as GAME_DISTANCE_CURVE, v as GAME_SOUND_CLASSES, w as GUNSHOT_PROFILES, x as GUNSHOT_SAMPLE, y as GUNSHOT_SAMPLE_IDS, z as Gunshot, B as GunshotInput, H as GunshotPlayed, J as ItemModelRequest, K as MECHANICAL_SOUNDS, N as MOUNTED_M134_ITEM_ID, O as MechanicalSoundId, P as ModelMaterials, Q as MountFrame, R as RELOAD_SAMPLE, S as RELOAD_SAMPLE_HITS, T as ShotExtras, U as ShotSound, V as ShotSoundClass, X as ShotSoundInput, Y as ShotSoundOptions, Z as SoundClassDef, _ as SoundStep, $ as WEAPON_ITEM_PREFIX, a0 as WEIGHT_INTENSITY, a1 as WeaponAudio, a2 as WeaponAudioOptions, a3 as WeaponFx, a4 as WeaponFxOptions, a5 as WeaponModelDef, a6 as WeaponSampleOptions, a7 as WeaponsTestModuleOptions, a8 as buildItemWeaponModel, a9 as buildThrowableModel, aa as buildWeaponModel, ab as computeCasingSound, ac as computeFlyby, ad as computeGunshot, ae as computeShotSound, af as createExplosivesTestModule, ag as createWeaponAudio, ah as createWeaponFx, ai as createWeaponsTestModule, aj as defaultWeaponProps, ak as deriveFrames, al as explosivesTextOf, am as hasThrowableModel, an as itemModelOfWeapon, ao as mechanicalSoundOf, ap as modelKit, aq as mountFrame, ar as registerWeaponItemModel, as as weaponSampleBank, at as weaponSampleDefaults, au as weaponsLayout } from './testing-Cf1M1sWN.js';
|
|
3
3
|
import * as THREE_NS from 'three';
|
|
4
4
|
import { TestableItem, Vec3, HostEvent, EffectSink, DestructibleSpec, DeepPartial, ToolClipSet } from '@adatechnology/game-contracts';
|
|
5
5
|
import { ExplosiveDef, Arsenal, WeaponDef, CartridgeDims, CaliberDef, CaseType, ReloadFamily, FittedAttachment, AttachmentDef } from '@adatechnology/game-weapons';
|
|
@@ -61,8 +61,8 @@ interface ProjectileModel {
|
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* The model of what a weapon throws or fires, drawn by the same code as the weapon itself: the round of a rocket launcher (the RPG-7's PG-7V, the Carl Gustaf's 84 mm round, the rocket of
|
|
64
|
-
* the disposable tubes), long axis +x
|
|
65
|
-
*
|
|
64
|
+
* the disposable tubes), long axis +x, and the explosives of the gallery (the M67, the molotov, the pipe bomb, the dynamite, the C4, the Claymore, the flashbang), centred, axis +y.
|
|
65
|
+
* Answers `null` where the gallery has no model (the 40 mm grenade of a launcher), and a host keeps its primitive for it.
|
|
66
66
|
*/
|
|
67
67
|
declare function projectileModel(THREE: typeof THREE_NS, query: ProjectileQuery): ProjectileModel | null;
|
|
68
68
|
|
|
@@ -99,12 +99,18 @@ declare function weaponProp(def: Pick<WeaponDef, 'id' | 'category' | 'mass'>, na
|
|
|
99
99
|
/** One mesh per box part, named after the part (what destruction renderers bind to), in a group with its origin on the floor. */
|
|
100
100
|
declare function buildProp(THREE: typeof THREE_NS, prop: WeaponProp): THREE_NS.Group;
|
|
101
101
|
|
|
102
|
+
/** The explosive ids of game-weapons the gallery drew (`m67`, `molotov`, `pipe_bomb`, `dynamite`, `c4`, `claymore`, `flashbang`). */
|
|
103
|
+
declare const EXPLOSIVE_MODEL_IDS: readonly string[];
|
|
104
|
+
declare const hasExplosiveModel: (explosiveId: string) => boolean;
|
|
105
|
+
/** The gallery model of an explosive standing on its base (y up, origin at the bottom centre, a `handle` mark where the hand closes); undefined for one the gallery did not draw. */
|
|
106
|
+
declare function buildExplosiveModel(THREE: typeof THREE_NS, explosiveId: string): THREE_NS.Group | undefined;
|
|
107
|
+
|
|
102
108
|
/**
|
|
103
109
|
* The prop of a weapon the gallery drew (or that an item model draws, `buildItemWeaponModel`), for a counter or the floor: its model lying on the side, centred on the footprint with its underside on the floor, joined into one mesh per
|
|
104
110
|
* material (the hands keep the model with its pivots, `buildWeaponModelById`), every mesh naming the one rigid part (`body`) that moves it. The size of that part is left in
|
|
105
111
|
* `userData.footprint` for `modeledPropSpec`.
|
|
106
112
|
*/
|
|
107
|
-
declare function buildModeledProp(THREE: typeof THREE_NS, def: Pick<WeaponDef, 'id'
|
|
113
|
+
declare function buildModeledProp(THREE: typeof THREE_NS, def: Pick<WeaponDef, 'id'> & Partial<Pick<WeaponDef, 'action'>>, name: string, decorate?: (root: THREE_NS.Object3D) => void, items?: ItemModels, props?: WeaponProps): THREE_NS.Group | undefined;
|
|
108
114
|
/** A modeled weapon on a tripod of three steel legs under its middle (the same legs the `tripod` accessory draws in the hands). */
|
|
109
115
|
declare function buildTripodMountedProp(THREE: typeof THREE_NS, def: Pick<WeaponDef, 'id'>, name: string, items?: ItemModels, props?: WeaponProps): THREE_NS.Group | undefined;
|
|
110
116
|
/** The destruction spec of a modeled prop: one steel box of its measures, with the real mass of the weapon. */
|
|
@@ -121,6 +127,25 @@ interface WeaponPropsOptions {
|
|
|
121
127
|
/** A set of weapon prop overrides of its own: the shipped ones plus `packs`, `patch` and `remove`. Nothing is shared with any other set on the page. */
|
|
122
128
|
declare function createWeaponProps(options?: WeaponPropsOptions): WeaponProps;
|
|
123
129
|
|
|
130
|
+
/** One weapon of the gallery as `data/models.json` keeps it: the builder, the measures in mm and the builder's options. */
|
|
131
|
+
interface ModelEntry {
|
|
132
|
+
readonly builder: 'pistol' | 'revolver' | 'rifle' | 'bullpup' | 'p90' | 'break' | 'breakLauncher' | 'm2' | 'm134' | 'launcher';
|
|
133
|
+
readonly caliber: string;
|
|
134
|
+
readonly length: number;
|
|
135
|
+
readonly barrel: number;
|
|
136
|
+
readonly options: ModelOptions;
|
|
137
|
+
readonly variantOf?: string;
|
|
138
|
+
}
|
|
139
|
+
declare const MODEL_ENTRIES: Readonly<Record<string, ModelEntry>>;
|
|
140
|
+
/**
|
|
141
|
+
* The model each generic archetype wears: the one of the first brand weapon (lowest id) that points to it with `archetype` and fires the same way (a rocket launcher that points to
|
|
142
|
+
* `shotgun_pump_12` does not lend its tube to the shotgun). An archetype nothing points to, the melee weapons and the bow keep their simple prop.
|
|
143
|
+
*/
|
|
144
|
+
declare const ARCHETYPE_MODELS: Readonly<Record<string, string>>;
|
|
145
|
+
declare const hasWeaponModel: (id: string) => boolean;
|
|
146
|
+
/** The gallery model of a weapon (or of the brand weapon an archetype wears, see `ARCHETYPE_MODELS`), long axis along +x, rear at the origin; undefined for melee, throwables and what nothing drew. */
|
|
147
|
+
declare function buildWeaponModelById(THREE: typeof THREE_NS, id: string): WeaponModel | undefined;
|
|
148
|
+
|
|
124
149
|
/** The shapes the gallery draws: rimfire, straight rimless (`p`), straight rimmed (`rimp`), bottleneck rimless (`r`), bottleneck rimmed (`rr`) and shotgun shell. */
|
|
125
150
|
type CartridgeShape = 'shell' | 'rim' | 'p' | 'rimp' | 'r' | 'rr';
|
|
126
151
|
/** The gallery's cartridge type of a calibre, from its case type, rim and dimensions. */
|
|
@@ -204,4 +229,4 @@ declare function rigUnderbarrel(THREE: typeof THREE_NS, model: WeaponModel, def:
|
|
|
204
229
|
*/
|
|
205
230
|
declare function rigStock(THREE: typeof THREE_NS, model: WeaponModel, def: Pick<WeaponDef, 'stock' | 'dimensions'>): void;
|
|
206
231
|
|
|
207
|
-
export { ATTACHMENT_MODELS, AttachmentModelRegistry, type AttachmentRig, BODY_ACTIONS, type CartridgeShape, type ClipContext, DEFAULT_THUMBNAIL_BASE, type FitAttachmentOptions, ItemModels, LaserRaycast, ModelFamily, ModelKit, ModelParts, P13_VALVE_MESH, type ProjectileModel, type ProjectileQuery, WEAPON_THUMBNAILS, WORLD_EFFECTS, WORLD_EXPLOSIVE_IDS, WORLD_EXPLOSIVE_PREFIX, WeaponItemModel, WeaponModel, type WeaponProp, WeaponProps, type WeaponPropsOptions, type WeaponThumbnailEntry, type WorldEffectIds, type WorldEffectsOptions, type WorldExplosiveOptions, applyCondition, buildCartridge, buildCasing, buildModeledProp, buildProp, buildRound, buildToolClips, buildTripodMountedProp, cartridgeShape, createWeaponProps, createWorldEffects, fitAttachmentModels, modeledPropSpec, partRegistry, projectileModel, rigStock, rigUnderbarrel, weaponProp, weaponThumbnailCredit, weaponThumbnailUrl, worldExplosiveItem, worldExplosiveShell, worldExplosiveValve };
|
|
232
|
+
export { ARCHETYPE_MODELS, ATTACHMENT_MODELS, AttachmentModelRegistry, type AttachmentRig, BODY_ACTIONS, type CartridgeShape, type ClipContext, DEFAULT_THUMBNAIL_BASE, EXPLOSIVE_MODEL_IDS, type FitAttachmentOptions, ItemModels, LaserRaycast, MODEL_ENTRIES, type ModelEntry, ModelFamily, ModelKit, ModelOptions, ModelParts, P13_VALVE_MESH, type ProjectileModel, type ProjectileQuery, WEAPON_THUMBNAILS, WORLD_EFFECTS, WORLD_EXPLOSIVE_IDS, WORLD_EXPLOSIVE_PREFIX, WeaponItemModel, WeaponModel, type WeaponProp, WeaponProps, type WeaponPropsOptions, type WeaponThumbnailEntry, type WorldEffectIds, type WorldEffectsOptions, type WorldExplosiveOptions, applyCondition, buildCartridge, buildCasing, buildExplosiveModel, buildModeledProp, buildProp, buildRound, buildToolClips, buildTripodMountedProp, buildWeaponModelById, cartridgeShape, createWeaponProps, createWorldEffects, fitAttachmentModels, hasExplosiveModel, hasWeaponModel, modeledPropSpec, partRegistry, projectileModel, rigStock, rigUnderbarrel, weaponProp, weaponThumbnailCredit, weaponThumbnailUrl, worldExplosiveItem, worldExplosiveShell, worldExplosiveValve };
|