@adatechnology/game-weapons-three 0.14.2 → 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/dist/index.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  DEFAULT_THUMBNAIL_BASE,
11
11
  EXPLOSIVES_AREA_ID,
12
12
  EXPLOSIVES_TEXT,
13
+ EXPLOSIVE_MODEL_IDS,
13
14
  GAME_DISTANCE_CURVE,
14
15
  GAME_SOUND_CLASSES,
15
16
  GUNSHOT_PROFILES,
@@ -31,11 +32,13 @@ import {
31
32
  applyCondition,
32
33
  buildCartridge,
33
34
  buildCasing,
35
+ buildExplosiveModel,
34
36
  buildFlyingRocket,
35
37
  buildItemWeaponModel,
36
38
  buildModeledProp,
37
39
  buildProp,
38
40
  buildRound,
41
+ buildThrowableModel,
39
42
  buildToolClips,
40
43
  buildTripodMountedProp,
41
44
  buildWeaponModel,
@@ -54,6 +57,8 @@ import {
54
57
  deriveFrames,
55
58
  explosivesTextOf,
56
59
  fitAttachmentModels,
60
+ hasExplosiveModel,
61
+ hasThrowableModel,
57
62
  hasWeaponModel,
58
63
  itemModelOfWeapon,
59
64
  mechanicalSoundOf,
@@ -74,16 +79,27 @@ import {
74
79
  worldExplosiveItem,
75
80
  worldExplosiveShell,
76
81
  worldExplosiveValve
77
- } from "./chunk-XMVSA7UT.js";
82
+ } from "./chunk-GBO6L7CQ.js";
78
83
 
79
84
  // src/projectile-model.ts
85
+ import { markKitOrigin } from "@adatechnology/game-contracts";
80
86
  function projectileModel(THREE, query) {
81
- if (query.kind !== "rocket") return null;
87
+ if (query.kind !== "rocket") return explosiveProjectile(THREE, query);
82
88
  const launcher = buildWeaponModelById(THREE, query.weapon);
83
89
  if (!launcher || launcher.parts.family !== "rocket") return null;
84
90
  const round = launcher.parts.makeRound ? launcher.parts.makeRound() : buildFlyingRocket(modelKit(THREE), launcher.parts.launcherType);
85
91
  return { model: round, axis: [1, 0, 0] };
86
92
  }
93
+ function explosiveProjectile(THREE, query) {
94
+ const model = query.explosive === void 0 ? void 0 : buildExplosiveModel(THREE, query.explosive);
95
+ if (!model) return null;
96
+ const centre = new THREE.Box3().setFromObject(model).getCenter(new THREE.Vector3());
97
+ const holder = markKitOrigin(new THREE.Group(), { owner: "game-weapons-three", kind: "explosive", id: model.name });
98
+ holder.name = model.name;
99
+ model.position.sub(centre);
100
+ holder.add(model);
101
+ return { model: holder, axis: [0, 1, 0] };
102
+ }
87
103
 
88
104
  // src/weapon-props.ts
89
105
  import { applyPatches, mergeById, removeIds } from "@adatechnology/game-contracts";
@@ -108,6 +124,7 @@ export {
108
124
  DEFAULT_THUMBNAIL_BASE,
109
125
  EXPLOSIVES_AREA_ID,
110
126
  EXPLOSIVES_TEXT,
127
+ EXPLOSIVE_MODEL_IDS,
111
128
  GAME_DISTANCE_CURVE,
112
129
  GAME_SOUND_CLASSES,
113
130
  GUNSHOT_PROFILES,
@@ -128,10 +145,12 @@ export {
128
145
  applyCondition,
129
146
  buildCartridge,
130
147
  buildCasing,
148
+ buildExplosiveModel,
131
149
  buildItemWeaponModel,
132
150
  buildModeledProp,
133
151
  buildProp,
134
152
  buildRound,
153
+ buildThrowableModel,
135
154
  buildToolClips,
136
155
  buildTripodMountedProp,
137
156
  buildWeaponModel,
@@ -151,6 +170,8 @@ export {
151
170
  deriveFrames,
152
171
  explosivesTextOf,
153
172
  fitAttachmentModels,
173
+ hasExplosiveModel,
174
+ hasThrowableModel,
154
175
  hasWeaponModel,
155
176
  itemModelOfWeapon,
156
177
  mechanicalSoundOf,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/projectile-model.ts","../src/weapon-props.ts"],"sourcesContent":["import type * as THREE_NS from 'three'\n\nimport { buildWeaponModelById } from './models'\nimport { modelKit } from './models/kit'\nimport { buildFlyingRocket } from './models/launcher-rounds'\n\n/** What a host asks for a thrown or set down explosive: the weapon in the hand, the explosive it carries and how it is used (`rocket`, `grenade`, `molotov`, `charge`). */\nexport interface ProjectileQuery {\n readonly weapon: string\n readonly explosive?: string | undefined\n readonly kind: string\n}\n\n/** The model of a projectile and the axis along its length. */\nexport interface ProjectileModel {\n readonly model: THREE_NS.Object3D\n readonly axis: [number, number, number]\n}\n\n/**\n * 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\n * the disposable tubes), long axis +x. Answers `null` where the gallery has no model: the throwables (grenades, molotovs, dynamite, C4, the Claymore) and the grenade launchers are\n * still the plain props of `weaponProp`, and a host keeps its primitive for them.\n */\nexport function projectileModel(THREE: typeof THREE_NS, query: ProjectileQuery): ProjectileModel | null {\n if (query.kind !== 'rocket') return null\n const launcher = buildWeaponModelById(THREE, query.weapon)\n if (!launcher || launcher.parts.family !== 'rocket') return null\n const round = launcher.parts.makeRound ? launcher.parts.makeRound() : buildFlyingRocket(modelKit(THREE), launcher.parts.launcherType)\n return { model: round, axis: [1, 0, 0] }\n}\n","import { applyPatches, mergeById, removeIds } from '@adatechnology/game-contracts'\nimport type { DeepPartial } from '@adatechnology/game-contracts'\n\nimport { SHIPPED_WEAPON_ITEM_MODELS, weaponPropsOver } from './weapon-item-model'\nimport type { WeaponItemModel, WeaponProps } from './weapon-item-model'\n\nexport interface WeaponPropsOptions {\n /** Item model overrides by weapon id, added to the shipped ones (`null` keeps the low-poly prop); later packs replace earlier ones. */\n readonly packs?: readonly Readonly<Record<string, WeaponItemModel | null>>[]\n /** Changes to an override by weapon id, merged field by field. */\n readonly patch?: Readonly<Record<string, DeepPartial<WeaponItemModel>>>\n /** Weapon ids whose override is taken out (the weapon id itself is then the item model id). */\n readonly remove?: readonly string[]\n}\n\ntype Entry = { readonly id: string; readonly model: WeaponItemModel }\n\n/** 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. */\nexport function createWeaponProps(options: WeaponPropsOptions = {}): WeaponProps {\n const entryOf = ([id, model]: readonly [string, WeaponItemModel | null]): Entry => ({ id, model: model ?? { item: '' } })\n const entries = mergeById<Entry>(SHIPPED_WEAPON_ITEM_MODELS.map(entryOf), (options.packs ?? []).flatMap((pack) => Object.entries(pack).map(entryOf)))\n const patches: Record<string, { model: DeepPartial<WeaponItemModel> }> = {}\n for (const [id, model] of Object.entries(options.patch ?? {})) patches[id] = { model }\n applyPatches(entries, patches)\n removeIds(entries, options.remove)\n return weaponPropsOver(new Map([...entries].map(([id, entry]) => [id, entry.model])))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBO,SAAS,gBAAgB,OAAwB,OAAgD;AACtG,MAAI,MAAM,SAAS,SAAU,QAAO;AACpC,QAAM,WAAW,qBAAqB,OAAO,MAAM,MAAM;AACzD,MAAI,CAAC,YAAY,SAAS,MAAM,WAAW,SAAU,QAAO;AAC5D,QAAM,QAAQ,SAAS,MAAM,YAAY,SAAS,MAAM,UAAU,IAAI,kBAAkB,SAAS,KAAK,GAAG,SAAS,MAAM,YAAY;AACpI,SAAO,EAAE,OAAO,OAAO,MAAM,CAAC,GAAG,GAAG,CAAC,EAAE;AACzC;;;AC9BA,SAAS,cAAc,WAAW,iBAAiB;AAkB5C,SAAS,kBAAkB,UAA8B,CAAC,GAAgB;AAC/E,QAAM,UAAU,CAAC,CAAC,IAAI,KAAK,OAAyD,EAAE,IAAI,OAAO,SAAS,EAAE,MAAM,GAAG,EAAE;AACvH,QAAM,UAAU,UAAiB,2BAA2B,IAAI,OAAO,IAAI,QAAQ,SAAS,CAAC,GAAG,QAAQ,CAAC,SAAS,OAAO,QAAQ,IAAI,EAAE,IAAI,OAAO,CAAC,CAAC;AACpJ,QAAM,UAAmE,CAAC;AAC1E,aAAW,CAAC,IAAI,KAAK,KAAK,OAAO,QAAQ,QAAQ,SAAS,CAAC,CAAC,EAAG,SAAQ,EAAE,IAAI,EAAE,MAAM;AACrF,eAAa,SAAS,OAAO;AAC7B,YAAU,SAAS,QAAQ,MAAM;AACjC,SAAO,gBAAgB,IAAI,IAAI,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,MAAM,KAAK,CAAC,CAAC,CAAC;AACtF;","names":[]}
1
+ {"version":3,"sources":["../src/projectile-model.ts","../src/weapon-props.ts"],"sourcesContent":["import { markKitOrigin } from '@adatechnology/game-contracts'\nimport type * as THREE_NS from 'three'\n\nimport { buildWeaponModelById } from './models'\nimport { buildExplosiveModel } from './models/explosives'\nimport { modelKit } from './models/kit'\nimport { buildFlyingRocket } from './models/launcher-rounds'\n\n/** What a host asks for a thrown or set down explosive: the weapon in the hand, the explosive it carries and how it is used (`rocket`, `grenade`, `molotov`, `charge`). */\nexport interface ProjectileQuery {\n readonly weapon: string\n readonly explosive?: string | undefined\n readonly kind: string\n}\n\n/** The model of a projectile and the axis along its length. */\nexport interface ProjectileModel {\n readonly model: THREE_NS.Object3D\n readonly axis: [number, number, number]\n}\n\n/**\n * 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\n * 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.\n * Answers `null` where the gallery has no model (the 40 mm grenade of a launcher), and a host keeps its primitive for it.\n */\nexport function projectileModel(THREE: typeof THREE_NS, query: ProjectileQuery): ProjectileModel | null {\n if (query.kind !== 'rocket') return explosiveProjectile(THREE, query)\n const launcher = buildWeaponModelById(THREE, query.weapon)\n if (!launcher || launcher.parts.family !== 'rocket') return null\n const round = launcher.parts.makeRound ? launcher.parts.makeRound() : buildFlyingRocket(modelKit(THREE), launcher.parts.launcherType)\n return { model: round, axis: [1, 0, 0] }\n}\n\n// a thrown or set down explosive the gallery drew: its model centred on its middle (it tumbles about it in flight), standing axis +y\nfunction explosiveProjectile(THREE: typeof THREE_NS, query: ProjectileQuery): ProjectileModel | null {\n const model = query.explosive === undefined ? undefined : buildExplosiveModel(THREE, query.explosive)\n if (!model) return null\n const centre = new THREE.Box3().setFromObject(model).getCenter(new THREE.Vector3())\n const holder = markKitOrigin(new THREE.Group(), { owner: 'game-weapons-three', kind: 'explosive', id: model.name })\n holder.name = model.name\n model.position.sub(centre)\n holder.add(model)\n return { model: holder, axis: [0, 1, 0] }\n}\n","import { applyPatches, mergeById, removeIds } from '@adatechnology/game-contracts'\nimport type { DeepPartial } from '@adatechnology/game-contracts'\n\nimport { SHIPPED_WEAPON_ITEM_MODELS, weaponPropsOver } from './weapon-item-model'\nimport type { WeaponItemModel, WeaponProps } from './weapon-item-model'\n\nexport interface WeaponPropsOptions {\n /** Item model overrides by weapon id, added to the shipped ones (`null` keeps the low-poly prop); later packs replace earlier ones. */\n readonly packs?: readonly Readonly<Record<string, WeaponItemModel | null>>[]\n /** Changes to an override by weapon id, merged field by field. */\n readonly patch?: Readonly<Record<string, DeepPartial<WeaponItemModel>>>\n /** Weapon ids whose override is taken out (the weapon id itself is then the item model id). */\n readonly remove?: readonly string[]\n}\n\ntype Entry = { readonly id: string; readonly model: WeaponItemModel }\n\n/** 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. */\nexport function createWeaponProps(options: WeaponPropsOptions = {}): WeaponProps {\n const entryOf = ([id, model]: readonly [string, WeaponItemModel | null]): Entry => ({ id, model: model ?? { item: '' } })\n const entries = mergeById<Entry>(SHIPPED_WEAPON_ITEM_MODELS.map(entryOf), (options.packs ?? []).flatMap((pack) => Object.entries(pack).map(entryOf)))\n const patches: Record<string, { model: DeepPartial<WeaponItemModel> }> = {}\n for (const [id, model] of Object.entries(options.patch ?? {})) patches[id] = { model }\n applyPatches(entries, patches)\n removeIds(entries, options.remove)\n return weaponPropsOver(new Map([...entries].map(([id, entry]) => [id, entry.model])))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,qBAAqB;AA0BvB,SAAS,gBAAgB,OAAwB,OAAgD;AACtG,MAAI,MAAM,SAAS,SAAU,QAAO,oBAAoB,OAAO,KAAK;AACpE,QAAM,WAAW,qBAAqB,OAAO,MAAM,MAAM;AACzD,MAAI,CAAC,YAAY,SAAS,MAAM,WAAW,SAAU,QAAO;AAC5D,QAAM,QAAQ,SAAS,MAAM,YAAY,SAAS,MAAM,UAAU,IAAI,kBAAkB,SAAS,KAAK,GAAG,SAAS,MAAM,YAAY;AACpI,SAAO,EAAE,OAAO,OAAO,MAAM,CAAC,GAAG,GAAG,CAAC,EAAE;AACzC;AAGA,SAAS,oBAAoB,OAAwB,OAAgD;AACnG,QAAM,QAAQ,MAAM,cAAc,SAAY,SAAY,oBAAoB,OAAO,MAAM,SAAS;AACpG,MAAI,CAAC,MAAO,QAAO;AACnB,QAAM,SAAS,IAAI,MAAM,KAAK,EAAE,cAAc,KAAK,EAAE,UAAU,IAAI,MAAM,QAAQ,CAAC;AAClF,QAAM,SAAS,cAAc,IAAI,MAAM,MAAM,GAAG,EAAE,OAAO,sBAAsB,MAAM,aAAa,IAAI,MAAM,KAAK,CAAC;AAClH,SAAO,OAAO,MAAM;AACpB,QAAM,SAAS,IAAI,MAAM;AACzB,SAAO,IAAI,KAAK;AAChB,SAAO,EAAE,OAAO,QAAQ,MAAM,CAAC,GAAG,GAAG,CAAC,EAAE;AAC1C;;;AC5CA,SAAS,cAAc,WAAW,iBAAiB;AAkB5C,SAAS,kBAAkB,UAA8B,CAAC,GAAgB;AAC/E,QAAM,UAAU,CAAC,CAAC,IAAI,KAAK,OAAyD,EAAE,IAAI,OAAO,SAAS,EAAE,MAAM,GAAG,EAAE;AACvH,QAAM,UAAU,UAAiB,2BAA2B,IAAI,OAAO,IAAI,QAAQ,SAAS,CAAC,GAAG,QAAQ,CAAC,SAAS,OAAO,QAAQ,IAAI,EAAE,IAAI,OAAO,CAAC,CAAC;AACpJ,QAAM,UAAmE,CAAC;AAC1E,aAAW,CAAC,IAAI,KAAK,KAAK,OAAO,QAAQ,QAAQ,SAAS,CAAC,CAAC,EAAG,SAAQ,EAAE,IAAI,EAAE,MAAM;AACrF,eAAa,SAAS,OAAO;AAC7B,YAAU,SAAS,QAAQ,MAAM;AACjC,SAAO,gBAAgB,IAAI,IAAI,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,MAAM,KAAK,CAAC,CAAC,CAAC;AACtF;","names":[]}
@@ -1,4 +1,4 @@
1
- import { HostTool, HandPose, EffectSink, HostEvent, HandTargets, TestableModule, AreaPlacement, DestructionEvent, Hit, Vec3 as Vec3$1, ModuleControl, ModuleLayer, ModuleMetric, ModuleHost } from '@adatechnology/game-contracts';
1
+ import { HostTool, HandPose, EffectSink, HostEvent, HandTargets, MuzzlePose, TestableModule, AreaPlacement, DestructionEvent, Hit, Vec3 as Vec3$1, ModuleControl, ModuleLayer, ModuleMetric, ModuleHost } from '@adatechnology/game-contracts';
2
2
  import { CaseType, CaliberDef, ReloadStageId, WeaponEvent, MountKind, AttachmentDef, FittedAttachment, Arsenal, WeaponDef, ExplosiveDef } from '@adatechnology/game-weapons';
3
3
  import { SampleDefaults, SfxManifest, SoundBank, AudioEngine } from '@adatechnology/game-audio';
4
4
  import * as THREE_NS from 'three';
@@ -1057,22 +1057,6 @@ interface StockMove {
1057
1057
  axis: 'x' | 'y' | 'z';
1058
1058
  travel: number;
1059
1059
  }
1060
-
1061
- /** One weapon of the gallery as `data/models.json` keeps it: the builder, the measures in mm and the builder's options. */
1062
- interface ModelEntry {
1063
- readonly builder: 'pistol' | 'revolver' | 'rifle' | 'bullpup' | 'p90' | 'break' | 'm2' | 'm134' | 'launcher';
1064
- readonly caliber: string;
1065
- readonly length: number;
1066
- readonly barrel: number;
1067
- readonly options: ModelOptions;
1068
- readonly variantOf?: string;
1069
- }
1070
- declare const MODEL_ENTRIES: Readonly<Record<string, ModelEntry>>;
1071
- /**
1072
- * 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
1073
- * `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.
1074
- */
1075
- declare const ARCHETYPE_MODELS: Readonly<Record<string, string>>;
1076
1060
  /** A weapon model: `root` (the page's `wr`) holds `inner` (what the builder made, fitted to the real length); `parts` are pivots and marks inside `inner`. */
1077
1061
  interface WeaponModel {
1078
1062
  readonly id: string;
@@ -1080,9 +1064,6 @@ interface WeaponModel {
1080
1064
  readonly inner: THREE_NS.Group;
1081
1065
  readonly parts: ModelParts;
1082
1066
  }
1083
- declare const hasWeaponModel: (id: string) => boolean;
1084
- /** 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. */
1085
- declare function buildWeaponModelById(THREE: typeof THREE_NS, id: string): WeaponModel | undefined;
1086
1067
 
1087
1068
  type Three = typeof THREE_NS;
1088
1069
  type Material = THREE_NS.Material;
@@ -1122,6 +1103,11 @@ declare const createMaterials: (THREE: Three) => {
1122
1103
  tape: THREE_NS.MeshStandardMaterial;
1123
1104
  pipe: THREE_NS.MeshStandardMaterial;
1124
1105
  green: THREE_NS.MeshStandardMaterial;
1106
+ /** Explosive finishes: the molotov's bottle, the dynamite's paper, the C4's putty and the detonator's wire. */
1107
+ bottle: THREE_NS.MeshStandardMaterial;
1108
+ dynamite: THREE_NS.MeshStandardMaterial;
1109
+ c4: THREE_NS.MeshStandardMaterial;
1110
+ wire: THREE_NS.MeshStandardMaterial;
1125
1111
  /** Magazine finishes named by the options. */
1126
1112
  bakelite: THREE_NS.MeshStandardMaterial;
1127
1113
  polyMag: THREE_NS.MeshStandardMaterial;
@@ -1283,6 +1269,8 @@ interface WeaponFxOptions {
1283
1269
  contact?: LaserRaycast;
1284
1270
  /** Where the body holds the tool (`ModuleHost.holdFrame`): third person draws it there at its real size. */
1285
1271
  bodyHold?: () => HandPose | null;
1272
+ /** Whether the view is the player's own eye: the gallery's guns are then framed in the view (`VIEW_HOLD`) instead of held on the body. */
1273
+ firstPerson?: () => boolean;
1286
1274
  /** The host's effects: the muzzle flash, smoke, backblast and flame jet of the gallery models are recipes it plays; without it the viewmodel makes a world of its own for them. */
1287
1275
  effects?: EffectSink;
1288
1276
  /** The most casings and magazines alive at once (`host.particleLimit`), read at each spawn; without it the viewmodel keeps a cap of its own. */
@@ -1302,6 +1290,8 @@ interface WeaponFx {
1302
1290
  setCondition(condition: string): void;
1303
1291
  /** Where the hands take the weapon (world space, read every frame after `update`): the grip and the forend of the model, or the handle of the generic prop; null with nothing in the hands. */
1304
1292
  handTargets(): HandTargets | null;
1293
+ /** The muzzle of the weapon in the hands as drawn now (world space): the gallery model's mark, or the front of the generic prop; null for a tool that fires no shot. */
1294
+ muzzle(): MuzzlePose | null;
1305
1295
  /** What is drawn (casings, magazines, muzzle flash): change a field and the next event follows it. */
1306
1296
  readonly layers: FxLayers;
1307
1297
  /** Weapon shown in the hands, or null. */
@@ -1342,8 +1332,14 @@ interface WeaponProps {
1342
1332
  /** `buildItemWeaponModel` with this set's overrides. */
1343
1333
  buildItemModel(THREE: typeof THREE_NS, def: Pick<WeaponDef, 'id'>, items?: ItemModels): THREE_NS.Group | undefined;
1344
1334
  /** `buildWeaponModel` with this set's overrides. */
1345
- buildModel(THREE: typeof THREE_NS, def: Pick<WeaponDef, 'id' | 'category' | 'mass'>, items?: ItemModels): THREE_NS.Group;
1335
+ buildModel(THREE: typeof THREE_NS, def: WeaponModelDef, items?: ItemModels): THREE_NS.Group;
1346
1336
  }
1337
+ /** What a weapon model is drawn from: the id, the category and mass of the low-poly prop, and the action that names a throwable's explosive. */
1338
+ type WeaponModelDef = Pick<WeaponDef, 'id' | 'category' | 'mass'> & Partial<Pick<WeaponDef, 'action'>>;
1339
+ /** The gallery model of the explosive a throwable carries (the frag grenade's M67, the molotov, the dynamite...), or undefined for any other weapon. */
1340
+ /** Whether the gallery drew the explosive a throwable carries. */
1341
+ declare const hasThrowableModel: (def: Partial<Pick<WeaponDef, "action">>) => boolean;
1342
+ declare const buildThrowableModel: (THREE: typeof THREE_NS, def: Partial<Pick<WeaponDef, "action">>) => THREE_NS.Group | undefined;
1347
1343
  /** The set behind `registerWeaponItemModel`, `itemModelOfWeapon`, `buildItemWeaponModel` and `buildWeaponModel`, created on first use. */
1348
1344
  declare const defaultWeaponProps: () => WeaponProps;
1349
1345
  /** @deprecated use `createWeaponProps(...).register`. */
@@ -1357,8 +1353,8 @@ declare const itemModelOfWeapon: (weaponId: string, items?: ItemModels) => strin
1357
1353
  * @deprecated use `createWeaponProps(...).buildItemModel`.
1358
1354
  */
1359
1355
  declare const buildItemWeaponModel: (THREE: typeof THREE_NS, def: Pick<WeaponDef, "id">, items?: ItemModels) => THREE_NS.Group | undefined;
1360
- /** The model of a weapon for the hands or a shelf: the team's item model when the kit has one (`buildItemWeaponModel`), the low-poly prop the counters show otherwise. @deprecated use `createWeaponProps(...).buildModel`. */
1361
- declare const buildWeaponModel: (THREE: typeof THREE_NS, def: Pick<WeaponDef, "id" | "category" | "mass">, items?: ItemModels) => THREE_NS.Group;
1356
+ /** The model of a weapon for the hands or a shelf: the team's item model when the kit has one (`buildItemWeaponModel`), the gallery model of a throwable's explosive, the low-poly prop the counters show otherwise. @deprecated use `createWeaponProps(...).buildModel`. */
1357
+ declare const buildWeaponModel: (THREE: typeof THREE_NS, def: WeaponModelDef, items?: ItemModels) => THREE_NS.Group;
1362
1358
 
1363
1359
  interface WeaponsTestModuleOptions {
1364
1360
  /** `en` or `pt-BR` (default). */
@@ -1384,7 +1380,7 @@ interface WeaponsTestModuleOptions {
1384
1380
  /** The weapon item model overrides to draw with (`createWeaponProps(...)`); default the shared set behind `registerWeaponItemModel`. */
1385
1381
  props?: WeaponProps;
1386
1382
  }
1387
- /** Prefix of the item ids of the weapon props (`weapon_pistol_9mm`). */
1383
+ /** Prefix of the item ids of the weapon props (`weapon_beretta_92fs`). */
1388
1384
  declare const WEAPON_ITEM_PREFIX = "weapon_";
1389
1385
  declare const COUNTER_ITEM_ID = "counter_weapons";
1390
1386
  declare const MOUNTED_M134_ITEM_ID = "m134_tripod";
@@ -1544,6 +1540,12 @@ interface ExplosivesRoom {
1544
1540
  };
1545
1541
  readonly renderer: {
1546
1542
  impulse(objectId: string, impulse: Vec3$1, point?: Vec3$1): void;
1543
+ /** World boxes of what is drawn around (x, z) (game-destruction-three `solidsNear`). */
1544
+ solidsNear?(x: number, z: number, radius: number): ReadonlyArray<{
1545
+ readonly objectId: string;
1546
+ readonly min: Vec3$1;
1547
+ readonly max: Vec3$1;
1548
+ }>;
1547
1549
  };
1548
1550
  readonly vfx: {
1549
1551
  spawn(kind: string, point: Vec3$1, velocity: Vec3$1, options?: {
@@ -1699,4 +1701,4 @@ declare function createExplosivesTestModule(options?: ExplosivesTestModuleOption
1699
1701
  readonly bench: ReturnType<typeof createExplosivesBench>;
1700
1702
  };
1701
1703
 
1702
- export { type ShotSoundOptions as $, type AttachmentModelRegistry as A, type GunshotInput as B, CLASS_REFERENCE_ENERGY as C, DEFAULT_ENERGY_CURVE as D, EXPLOSIVES_AREA_ID as E, type FlybySound as F, GAME_DISTANCE_CURVE as G, type GunshotPlayed as H, type ItemModels as I, type ItemModelRequest as J, MECHANICAL_SOUNDS as K, type LaserRaycast as L, type ModelKit as M, MODEL_ENTRIES as N, MOUNTED_M134_ITEM_ID as O, type MechanicalSoundId as P, type ModelEntry as Q, type ModelMaterials as R, type ModelOptions as S, type MountFrame as T, RELOAD_SAMPLE as U, RELOAD_SAMPLE_HITS as V, type WeaponProps as W, type ShotExtras as X, type ShotSound as Y, type ShotSoundClass as Z, type ShotSoundInput as _, type WeaponItemModel as a, type SoundClassDef as a0, type SoundStep as a1, WEAPON_ITEM_PREFIX as a2, WEIGHT_INTENSITY as a3, type WeaponAudio as a4, type WeaponAudioOptions as a5, type WeaponFx as a6, type WeaponFxOptions as a7, type WeaponSampleOptions as a8, type WeaponsTestModuleOptions as a9, buildItemWeaponModel as aa, buildWeaponModel as ab, buildWeaponModelById as ac, computeCasingSound as ad, computeFlyby as ae, computeGunshot as af, computeShotSound as ag, createExplosivesTestModule as ah, createWeaponAudio as ai, createWeaponFx as aj, createWeaponsTestModule as ak, defaultWeaponProps as al, deriveFrames as am, explosivesTextOf as an, hasWeaponModel as ao, itemModelOfWeapon as ap, mechanicalSoundOf as aq, modelKit as ar, mountFrame as as, registerWeaponItemModel as at, weaponSampleBank as au, weaponSampleDefaults as av, weaponsLayout as aw, type WeaponModel as b, type ModelParts as c, type ModelFamily as d, ARCHETYPE_MODELS as e, type AttachmentBuildContext as f, type AttachmentModel as g, type AttachmentModelBuilder as h, COUNTER_ITEM_ID as i, CUES_IN_SAMPLE as j, type CasingSound as k, type CuePlayed as l, DEFAULT_EXPLOSIVES_SCENE as m, type DistanceCurve as n, EXPLOSIVES_TEXT as o, type EnergyCurve as p, type ExplosivesRoom as q, type ExplosivesScene as r, type ExplosivesTestModuleOptions as s, type ExplosivesText as t, type FxLayers as u, GAME_SOUND_CLASSES as v, GUNSHOT_PROFILES as w, GUNSHOT_SAMPLE as x, GUNSHOT_SAMPLE_IDS as y, type Gunshot as z };
1704
+ export { WEAPON_ITEM_PREFIX as $, type AttachmentModelRegistry as A, type GunshotInput as B, CLASS_REFERENCE_ENERGY as C, DEFAULT_ENERGY_CURVE as D, EXPLOSIVES_AREA_ID as E, type FlybySound as F, GAME_DISTANCE_CURVE as G, type GunshotPlayed as H, type ItemModels as I, type ItemModelRequest as J, MECHANICAL_SOUNDS as K, type LaserRaycast as L, type ModelOptions as M, MOUNTED_M134_ITEM_ID as N, type MechanicalSoundId as O, type ModelMaterials as P, type MountFrame as Q, RELOAD_SAMPLE as R, RELOAD_SAMPLE_HITS as S, type ShotExtras as T, type ShotSound as U, type ShotSoundClass as V, type WeaponProps as W, type ShotSoundInput as X, type ShotSoundOptions as Y, type SoundClassDef as Z, type SoundStep as _, type WeaponItemModel as a, WEIGHT_INTENSITY as a0, type WeaponAudio as a1, type WeaponAudioOptions as a2, type WeaponFx as a3, type WeaponFxOptions as a4, type WeaponModelDef as a5, type WeaponSampleOptions as a6, type WeaponsTestModuleOptions as a7, buildItemWeaponModel as a8, buildThrowableModel as a9, buildWeaponModel as aa, computeCasingSound as ab, computeFlyby as ac, computeGunshot as ad, computeShotSound as ae, createExplosivesTestModule as af, createWeaponAudio as ag, createWeaponFx as ah, createWeaponsTestModule as ai, defaultWeaponProps as aj, deriveFrames as ak, explosivesTextOf as al, hasThrowableModel as am, itemModelOfWeapon as an, mechanicalSoundOf as ao, modelKit as ap, mountFrame as aq, registerWeaponItemModel as ar, weaponSampleBank as as, weaponSampleDefaults as at, weaponsLayout as au, type WeaponModel as b, type ModelKit as c, type ModelParts as d, type ModelFamily as e, type AttachmentBuildContext as f, type AttachmentModel as g, type AttachmentModelBuilder as h, COUNTER_ITEM_ID as i, CUES_IN_SAMPLE as j, type CasingSound as k, type CuePlayed as l, DEFAULT_EXPLOSIVES_SCENE as m, type DistanceCurve as n, EXPLOSIVES_TEXT as o, type EnergyCurve as p, type ExplosivesRoom as q, type ExplosivesScene as r, type ExplosivesTestModuleOptions as s, type ExplosivesText as t, type FxLayers as u, GAME_SOUND_CLASSES as v, GUNSHOT_PROFILES as w, GUNSHOT_SAMPLE as x, GUNSHOT_SAMPLE_IDS as y, type Gunshot as z };
package/dist/testing.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { i as COUNTER_ITEM_ID, m as DEFAULT_EXPLOSIVES_SCENE, E as EXPLOSIVES_AREA_ID, o as EXPLOSIVES_TEXT, q as ExplosivesRoom, r as ExplosivesScene, s as ExplosivesTestModuleOptions, t as ExplosivesText, O as MOUNTED_M134_ITEM_ID, a2 as WEAPON_ITEM_PREFIX, a9 as WeaponsTestModuleOptions, ah as createExplosivesTestModule, ak as createWeaponsTestModule, an as explosivesTextOf, aw as weaponsLayout } from './testing-DnPjEPC5.js';
1
+ export { i as COUNTER_ITEM_ID, m as DEFAULT_EXPLOSIVES_SCENE, E as EXPLOSIVES_AREA_ID, o as EXPLOSIVES_TEXT, q as ExplosivesRoom, r as ExplosivesScene, s as ExplosivesTestModuleOptions, t as ExplosivesText, N as MOUNTED_M134_ITEM_ID, $ as WEAPON_ITEM_PREFIX, a7 as WeaponsTestModuleOptions, af as createExplosivesTestModule, ai as createWeaponsTestModule, al as explosivesTextOf, au as weaponsLayout } from './testing-Cf1M1sWN.js';
2
2
  import '@adatechnology/game-contracts';
3
3
  import '@adatechnology/game-weapons';
4
4
  import '@adatechnology/game-audio';
package/dist/testing.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  createWeaponsTestModule,
10
10
  explosivesTextOf,
11
11
  weaponsLayout
12
- } from "./chunk-XMVSA7UT.js";
12
+ } from "./chunk-GBO6L7CQ.js";
13
13
  export {
14
14
  COUNTER_ITEM_ID,
15
15
  DEFAULT_EXPLOSIVES_SCENE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adatechnology/game-weapons-three",
3
- "version": "0.14.2",
3
+ "version": "0.15.0",
4
4
  "license": "MIT AND CC-BY-SA-4.0 AND CC-BY-SA-3.0 AND CC-BY-3.0 AND CC0-1.0 AND LicenseRef-Public-Domain",
5
5
  "description": "three.js presentation for @adatechnology/game-weapons: the real models of the Galeria 3D do Arsenal (78 weapons, a cartridge and a case per calibre), the weapon in the hands playing the tool-animation clips (fire, burst, cycle, jam, clear, safety and the seven reloads), ejected casings and dropped magazines, worn-metal conditions, synthesized sounds, and the weapons test area (counters with every weapon) as a TestableModule.",
6
6
  "keywords": [
@@ -44,15 +44,15 @@
44
44
  "assets"
45
45
  ],
46
46
  "dependencies": {
47
- "@adatechnology/game-audio": "^0.7.0",
48
- "@adatechnology/game-contracts": "^0.24.0",
49
- "@adatechnology/game-items-three": "^0.7.2",
50
- "@adatechnology/game-floorplan-three": "^0.9.3",
47
+ "@adatechnology/game-audio": "^0.8.0",
48
+ "@adatechnology/game-floorplan-three": "^0.10.0",
49
+ "@adatechnology/game-contracts": "^0.25.0",
50
+ "@adatechnology/game-items-three": "^0.7.3",
51
51
  "@adatechnology/game-render-three": "^0.2.0",
52
52
  "@adatechnology/game-shapes-three": "^0.3.1",
53
- "@adatechnology/game-vfx": "^0.7.0",
54
- "@adatechnology/game-vfx-three": "^0.6.0",
55
- "@adatechnology/game-weapons": "^0.6.0"
53
+ "@adatechnology/game-vfx-three": "^0.7.0",
54
+ "@adatechnology/game-vfx": "^0.8.0",
55
+ "@adatechnology/game-weapons": "^0.7.0"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "three": "^0.160.0"
@@ -65,7 +65,7 @@
65
65
  "tsup": "^8.5.1",
66
66
  "typescript": "^5.7.3",
67
67
  "vitest": "^3.2.4",
68
- "@adatechnology/game-test-room": "^0.25.2",
68
+ "@adatechnology/game-test-room": "^0.26.0",
69
69
  "@adatechnology/golden-tool": "^0.0.0"
70
70
  },
71
71
  "scripts": {