@adatechnology/game-weapons-three 0.15.0 → 0.16.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
@@ -79,7 +79,7 @@ import {
79
79
  worldExplosiveItem,
80
80
  worldExplosiveShell,
81
81
  worldExplosiveValve
82
- } from "./chunk-GBO6L7CQ.js";
82
+ } from "./chunk-KWJQO6JS.js";
83
83
 
84
84
  // src/projectile-model.ts
85
85
  import { markKitOrigin } from "@adatechnology/game-contracts";
@@ -59,6 +59,15 @@ interface CasingSound {
59
59
  readonly voices: readonly CasingVoice[];
60
60
  }
61
61
  declare function computeCasingSound(input: CasingInput): CasingSound;
62
+ /** A dropped magazine hitting the floor. */
63
+ interface MagazineDropInput {
64
+ /** Floor material id (`concrete`, `wood_hard`, `soil`...). */
65
+ readonly surface?: string;
66
+ /** Vertical speed at the hit, m/s. Default 1.5. */
67
+ readonly speed?: number;
68
+ /** 0 for the first hit, then 1, 2... */
69
+ readonly bounce?: number;
70
+ }
62
71
 
63
72
  var profiles$1 = {
64
73
  pistol_22lr: {
@@ -794,11 +803,14 @@ declare function weaponSampleDefaults(sound: {
794
803
  /** The bank of the recorded weapon sounds, every url through `url` (or `baseUrl`). Gunshots choke at three voices. */
795
804
  declare function weaponSampleBank(options: WeaponSampleOptions): SoundBank;
796
805
 
797
- /** What a reload cue played: its recording, nothing (another cue's recording carries it), or the synthesized steps. */
798
- type CuePlayed = 'sample' | 'carried' | 'synth';
806
+ /** What a reload cue played: its recording, the recording's fitted copy (game-audio/fitted, while the files load or where they are missing), nothing (another cue's recording carries it), or the synthesized steps. */
807
+ type CuePlayed = 'sample' | 'fitted' | 'carried' | 'synth';
799
808
  /** What sounded for a shot: the recorded takes (`sample`, with the take of each layer) or the synthesized layers (`synth`). */
800
809
  type GunshotPlayed = {
801
810
  readonly kind: 'synth';
811
+ } | {
812
+ readonly kind: 'fitted';
813
+ readonly id: string;
802
814
  } | {
803
815
  readonly kind: 'sample';
804
816
  readonly id: string;
@@ -829,7 +841,7 @@ interface WeaponAudioOptions extends ShotSoundOptions {
829
841
  /** Told each gunshot played (profile, take, pitch, space, distance), so a host can log what sounded. */
830
842
  readonly onGunshot?: (shot: Gunshot, input: GunshotInput, played: GunshotPlayed) => void;
831
843
  /** Told each case that lands (floor, case type, sample id). */
832
- readonly onCasing?: (sound: CasingSound, played: 'sample' | 'synth') => void;
844
+ readonly onCasing?: (sound: CasingSound, played: 'sample' | 'fitted' | 'synth') => void;
833
845
  /** Seed of the noise buffer, of the start point in it and of the casing pitch: same seed, same sound. Default 1. */
834
846
  readonly seed?: number;
835
847
  /** Replaces or adds mechanical sounds by id. */
@@ -888,8 +900,8 @@ interface WeaponAudio {
888
900
  flyby(input: FlybyInput & {
889
901
  readonly position?: readonly [number, number, number];
890
902
  }): void;
891
- /** A magazine landing on the floor. */
892
- thud(): void;
903
+ /** A magazine landing on the floor: the floor material, the speed and which bounce (all optional). */
904
+ thud(input?: MagazineDropInput): void;
893
905
  /** Master volume, 0 to 1. */
894
906
  setVolume(volume: number): void;
895
907
  dispose(): void;
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, 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';
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-CEcZ-zzz.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-GBO6L7CQ.js";
12
+ } from "./chunk-KWJQO6JS.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.15.0",
3
+ "version": "0.16.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.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",
47
+ "@adatechnology/game-audio": "^0.9.0",
48
+ "@adatechnology/game-contracts": "^0.26.0",
49
+ "@adatechnology/game-floorplan-three": "^0.10.1",
50
+ "@adatechnology/game-items-three": "^0.7.4",
51
51
  "@adatechnology/game-render-three": "^0.2.0",
52
52
  "@adatechnology/game-shapes-three": "^0.3.1",
53
- "@adatechnology/game-vfx-three": "^0.7.0",
54
53
  "@adatechnology/game-vfx": "^0.8.0",
55
- "@adatechnology/game-weapons": "^0.7.0"
54
+ "@adatechnology/game-vfx-three": "^0.7.1",
55
+ "@adatechnology/game-weapons": "^0.7.1"
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.26.0",
68
+ "@adatechnology/game-test-room": "^0.27.0",
69
69
  "@adatechnology/golden-tool": "^0.0.0"
70
70
  },
71
71
  "scripts": {