@adatechnology/game-weapons-three 0.27.6 → 0.28.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.
@@ -9559,6 +9559,7 @@ var oneHandHold = (hold, hand) => {
9559
9559
  };
9560
9560
 
9561
9561
  // src/fx/tool-motion.ts
9562
+ import { MELEE_FAMILIES } from "@adatechnology/game-weapons";
9562
9563
  var HOLD = { offset: [0, 0, 0], turn: [0, 0, 0] };
9563
9564
  var SHOVEL_DIG = {
9564
9565
  keys: [
@@ -9589,8 +9590,45 @@ var SHOVEL_SWING = {
9589
9590
  { at: 1, ...HOLD }
9590
9591
  ]
9591
9592
  };
9592
- var TOOL_MOTIONS = /* @__PURE__ */ new Map([
9593
- ["shovel", /* @__PURE__ */ new Map([["dig", SHOVEL_DIG], ["fill", SHOVEL_FILL], ["swing", SHOVEL_SWING]])]
9593
+ var KNIFE_SLASH = {
9594
+ keys: [
9595
+ { at: 0, ...HOLD },
9596
+ { at: 0.3, offset: [0.06, 0.3, 0.04], turn: [0.35, 0, -0.5] },
9597
+ { at: 0.43, offset: [-0.1, 0.2, -0.2], turn: [-0.6, 0, 0.5] },
9598
+ { at: 0.62, offset: [-0.24, 0.04, -0.12], turn: [-1, 0, 0.9] },
9599
+ { at: 1, ...HOLD }
9600
+ ]
9601
+ };
9602
+ var KNIFE_STAB = {
9603
+ keys: [
9604
+ { at: 0, ...HOLD },
9605
+ { at: 0.28, offset: [0.02, 0.06, 0.08], turn: [0.15, 0, 0] },
9606
+ { at: 0.43, offset: [-0.04, 0.12, -0.22], turn: [-0.5, 0, 0] },
9607
+ { at: 0.6, offset: [-0.04, 0.11, -0.2], turn: [-0.45, 0, 0] },
9608
+ { at: 1, ...HOLD }
9609
+ ]
9610
+ };
9611
+ var ONE_HAND_CHOP = {
9612
+ keys: [
9613
+ { at: 0, ...HOLD },
9614
+ { at: 0.3, offset: [0.04, 0.4, 0.04], turn: [0.5, 0, -0.2] },
9615
+ { at: 0.43, offset: [-0.03, 0.18, -0.22], turn: [-0.6, 0, 0.1] },
9616
+ { at: 0.62, offset: [-0.05, -0.03, -0.18], turn: [-1.1, 0, 0.2] },
9617
+ { at: 1, ...HOLD }
9618
+ ]
9619
+ };
9620
+ var FAMILY_MOTIONS = /* @__PURE__ */ new Map([
9621
+ ["short_blade", /* @__PURE__ */ new Map([["slash", KNIFE_SLASH], ["stab", KNIFE_STAB]])],
9622
+ ["one_hand_swing", /* @__PURE__ */ new Map([["chop", ONE_HAND_CHOP]])],
9623
+ // a bat, a pipe or an axe swung with both hands goes as the shovel's swing
9624
+ ["two_hand_swing", /* @__PURE__ */ new Map([["swing", SHOVEL_SWING]])]
9625
+ ]);
9626
+ var TOOL_MOTIONS = new Map([
9627
+ ["shovel", /* @__PURE__ */ new Map([["dig", SHOVEL_DIG], ["fill", SHOVEL_FILL], ["swing", SHOVEL_SWING]])],
9628
+ ...MELEE_FAMILIES.flatMap((family) => {
9629
+ const motions = FAMILY_MOTIONS.get(family.id);
9630
+ return motions ? family.weapons.map((weapon) => [weapon, motions]) : [];
9631
+ })
9594
9632
  ]);
9595
9633
  var ease2 = (s) => s * s * (3 - 2 * s);
9596
9634
  function sampleToolMotion(motion, at2) {
@@ -15991,6 +16029,7 @@ export {
15991
16029
  createWeaponAudio,
15992
16030
  VIEW_HOLD,
15993
16031
  toWorldLens,
16032
+ FAMILY_MOTIONS,
15994
16033
  TOOL_MOTIONS,
15995
16034
  sampleToolMotion,
15996
16035
  BODY_ACTIONS,
@@ -16060,4 +16099,4 @@ export {
16060
16099
  DEFAULT_EXPLOSIVES_SCENE,
16061
16100
  createExplosivesTestModule
16062
16101
  };
16063
- //# sourceMappingURL=chunk-GXZM4CE6.js.map
16102
+ //# sourceMappingURL=chunk-IU5JELUL.js.map