@adatechnology/game-test-room 0.17.1 → 0.18.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.d.ts CHANGED
@@ -383,6 +383,11 @@ interface RoomAvatar {
383
383
  leg?: 'left' | 'right';
384
384
  hand?: 'left' | 'right';
385
385
  }): number | null;
386
+ /**
387
+ * Brings the body's hands to the tool in them (`HandTargets`, world space: the module's, as the first-person arms get them). The room calls it in third person every frame, after the
388
+ * modules have placed the tool and before the render; an avatar without it keeps the hands where its own pose puts them.
389
+ */
390
+ reach?(targets: HandTargets | null): void;
386
391
  }
387
392
  /** Which leg a kick uses: `alternate` swaps at each kick (right first). */
388
393
  type KickLeg = 'alternate' | 'left' | 'right';
@@ -45646,6 +45646,10 @@ ${SURFACE_GLSL}`).replace("#include <color_fragment>", "#include <color_fragment
45646
45646
  lastHand = { stance: state.stance, triggerFinger: state.triggerFinger, targets };
45647
45647
  arms.update(dt, state);
45648
45648
  };
45649
+ const reachAvatar = () => {
45650
+ if (!avatar?.reach || !thirdActive()) return;
45651
+ avatar.reach(push.active || heldPiece ? null : handSource?.() ?? null);
45652
+ };
45649
45653
  const applyThirdView = () => {
45650
45654
  if (!thirdActive()) return () => void 0;
45651
45655
  const home = camera2.position.clone();
@@ -46813,6 +46817,7 @@ ${SURFACE_GLSL}`).replace("#include <color_fragment>", "#include <color_fragment
46813
46817
  if (!paused) followHeld(dt);
46814
46818
  stepSim(dt * timeScale);
46815
46819
  stepFirstPerson(paused ? 0 : dt);
46820
+ reachAvatar();
46816
46821
  if (progress && simTime - progress.at > 0.25) progress = null;
46817
46822
  hudAcc += dt;
46818
46823
  if (hudAcc >= 0.1 && ui) {