@adatechnology/game-characters-three 0.10.0 → 0.11.1

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.
@@ -8577,7 +8577,7 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
8577
8577
  };
8578
8578
  };
8579
8579
 
8580
- // ../game-audio/dist/chunk-UUWKSG4J.js
8580
+ // ../game-audio/dist/chunk-BUYBYP4L.js
8581
8581
  var DISTANCE_CURVES = {
8582
8582
  /** The game's `sfx`: `vol / (1 + d² × 0.004)`, cutoff `/ (1 + d × 0.01)`, silent below 0.01 (jogo L62091–62092, L62101). */
8583
8583
  game_sfx: { model: "inverse_square", k: 4e-3, cutoffK: 0.01, minGain: 0.01 },
@@ -8755,6 +8755,8 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
8755
8755
  ["revolver_38_357", 2, "sfx_pistol"],
8756
8756
  ["revolver_44_50ae", 3, "sfx_pistol"],
8757
8757
  ["smg_9mm_auto", 1, "sfx_pistol"],
8758
+ ["launcher_40mm", 2],
8759
+ ["rocket_launch", 2],
8758
8760
  ["shotgun_12", 1, "sfx_shotgun"],
8759
8761
  ["rifle_5_56", 1, "sfx_rifle"],
8760
8762
  ["rifle_7_62x39", 1, "sfx_rifle"],
@@ -11631,6 +11633,7 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
11631
11633
  parent.add(mesh2);
11632
11634
  return mesh2;
11633
11635
  };
11636
+ const TRIGGER_CURL = 1.22;
11634
11637
  const hands = [];
11635
11638
  rig.arms.forEach((arm, index) => {
11636
11639
  const el = arm.el;
@@ -12031,6 +12034,13 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
12031
12034
  if (run || fall > 0) return;
12032
12035
  root.updateMatrixWorld(true);
12033
12036
  armReach.apply(targets, view);
12037
+ for (const hand of hands) {
12038
+ const curl = hand.side < 0 ? targets?.fingers?.index : targets?.fingersL?.index;
12039
+ if (curl === void 0 || !hand.fingers[1]) continue;
12040
+ const k = TRIGGER_CURL * Math.min(1, Math.max(0, curl));
12041
+ hand.fingers[0].rotation.z = -hand.side * k * 0.9;
12042
+ hand.fingers[1].rotation.z = -hand.side * k * 1.1;
12043
+ }
12034
12044
  },
12035
12045
  on(_type, listener) {
12036
12046
  listeners.add(listener);
@@ -12881,7 +12891,7 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
12881
12891
  const channelPose = newPose(THREE);
12882
12892
  const mixed = newPose(THREE);
12883
12893
  const dropped = newPose(THREE);
12884
- let indexCurl;
12894
+ const indexCurl = { R: void 0, L: void 0 };
12885
12895
  const bone = createTwoBone(THREE);
12886
12896
  const shoulder = new THREE.Vector3();
12887
12897
  const wristAt = new THREE.Vector3();
@@ -12945,7 +12955,7 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
12945
12955
  arm.anchor.quaternion.copy(pose.q);
12946
12956
  arm.anchor.scale.setScalar(scale);
12947
12957
  arm.hand.setGrip(pose.grip);
12948
- arm.hand.setIndex(arm.side === "R" ? indexCurl : void 0);
12958
+ arm.hand.setIndex(indexCurl[arm.side]);
12949
12959
  arm.joints.shoulder.copy(shoulder);
12950
12960
  arm.joints.elbow.copy(bone.joint);
12951
12961
  arm.joints.wrist.copy(bone.end);
@@ -13031,7 +13041,7 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
13031
13041
  desired.p.add(bobOffset);
13032
13042
  }
13033
13043
  modeOf(mode, arm);
13034
- if (side === "R") indexCurl = mode === "target" ? targets?.fingers?.index : void 0;
13044
+ indexCurl[side] = mode === "target" ? side === "R" ? targets?.fingers?.index : targets?.fingersL?.index : void 0;
13035
13045
  arm.blend = blendSeconds <= 0 ? 1 : Math.min(1, arm.blend + dt / blendSeconds);
13036
13046
  if (arm.blend >= 1) copyPose(arm.shown, desired);
13037
13047
  else mixPose(THREE, arm.shown, arm.from, desired, ease2(arm.blend));