@adatechnology/game-weapons-three 0.26.4 → 0.27.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.
@@ -2,6 +2,7 @@
2
2
  import { markKitOrigin as markKitOrigin6 } from "@adatechnology/game-contracts";
3
3
  import { createArsenal, genericWeapons, roundsToWarningOf } from "@adatechnology/game-weapons";
4
4
  import { furnitureSpec as furnitureSpec2 } from "@adatechnology/game-floorplan-three";
5
+ import { isPhysicsServices } from "@adatechnology/game-physics";
5
6
  import { isLightBudget, isRenderPools } from "@adatechnology/game-render-three";
6
7
 
7
8
  // src/test-area/accessory-bench.ts
@@ -10178,6 +10179,9 @@ function createBoxFx(options) {
10178
10179
  get magazines() {
10179
10180
  return bodies.filter((b) => b.kind === "magazine").length;
10180
10181
  },
10182
+ clearLoose() {
10183
+ for (const body of [...bodies]) removeBody(body);
10184
+ },
10181
10185
  dispose() {
10182
10186
  for (const body of [...bodies]) removeBody(body);
10183
10187
  hand.removeFromParent();
@@ -11727,8 +11731,11 @@ function createParticles(THREE, scene, groundAt, limit, surface, physics) {
11727
11731
  }
11728
11732
  },
11729
11733
  count: (kind) => list.filter((particle) => particle.kind === kind).length,
11730
- dispose() {
11734
+ clear() {
11731
11735
  for (const particle of [...list]) remove(particle);
11736
+ },
11737
+ dispose() {
11738
+ api.clear();
11732
11739
  }
11733
11740
  };
11734
11741
  return api;
@@ -12928,6 +12935,9 @@ function createViewmodel(options) {
12928
12935
  get magazines() {
12929
12936
  return particles.count("magazine");
12930
12937
  },
12938
+ clearLoose() {
12939
+ particles.clear();
12940
+ },
12931
12941
  dispose() {
12932
12942
  release();
12933
12943
  particles.dispose();
@@ -13073,6 +13083,12 @@ function createWeaponFx(options) {
13073
13083
  get magazines() {
13074
13084
  return box2.magazines + model.magazines + (left ? left.box.magazines + left.model.magazines : 0);
13075
13085
  },
13086
+ clearLoose() {
13087
+ box2.clearLoose();
13088
+ model.clearLoose();
13089
+ left?.box.clearLoose();
13090
+ left?.model.clearLoose();
13091
+ },
13076
13092
  dispose() {
13077
13093
  box2.dispose();
13078
13094
  model.dispose();
@@ -14795,6 +14811,7 @@ function createWeaponsTestModule(options = {}) {
14795
14811
  motion: () => ({ speed: lent.player().speed, running: lent.player().running }),
14796
14812
  ...lent.effects ? { effects: lent.effects } : {},
14797
14813
  ...lent.particleLimit ? { particleLimit: lent.particleLimit } : {},
14814
+ ...isPhysicsServices(lent.physics) ? { physics: lent.physics.world } : {},
14798
14815
  ...isLightBudget(lent.lights) ? { lights: lent.lights } : {},
14799
14816
  ...isRenderPools(lent.pools) ? { pools: lent.pools } : {},
14800
14817
  ...options.attachmentModels ? { attachmentModels: options.attachmentModels } : {},
@@ -14856,6 +14873,7 @@ function createWeaponsTestModule(options = {}) {
14856
14873
  });
14857
14874
  const offHands = lent.setHandTargets?.(() => holstered?.handTargets() ?? created.handTargets());
14858
14875
  const offMuzzle = lent.setMuzzleSource?.((hand) => created.muzzle(hand));
14876
+ const offClear = lent.onClear?.(() => created.clearLoose());
14859
14877
  created.handle({ type: "tool", weapon: lent.tool().weapon }, lent.tool());
14860
14878
  return () => {
14861
14879
  accessories.dispose();
@@ -14866,6 +14884,7 @@ function createWeaponsTestModule(options = {}) {
14866
14884
  offClock();
14867
14885
  offHands?.();
14868
14886
  offMuzzle?.();
14887
+ offClear?.();
14869
14888
  created.dispose();
14870
14889
  holstered?.dispose();
14871
14890
  audio?.dispose();
@@ -16040,4 +16059,4 @@ export {
16040
16059
  DEFAULT_EXPLOSIVES_SCENE,
16041
16060
  createExplosivesTestModule
16042
16061
  };
16043
- //# sourceMappingURL=chunk-CGGF5CDD.js.map
16062
+ //# sourceMappingURL=chunk-6L7CAZIF.js.map