@playcanvas/supersplat-viewer 1.16.0 → 1.16.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcanvas/supersplat-viewer",
3
- "version": "1.16.0",
3
+ "version": "1.16.1",
4
4
  "author": "PlayCanvas <support@playcanvas.com>",
5
5
  "homepage": "https://github.com/playcanvas/supersplat-viewer#readme",
6
6
  "description": "Viewer for https://superspl.at",
package/public/index.js CHANGED
@@ -71563,6 +71563,8 @@ const orbitRotate = new Vec3();
71563
71563
  const flyRotate = new Vec3();
71564
71564
  const stickMove = new Vec3();
71565
71565
  const stickRotate = new Vec3();
71566
+ /** Maximum accumulated touch movement (px) to still count as a tap */
71567
+ const TAP_EPSILON = 15;
71566
71568
  /**
71567
71569
  * Converts screen space mouse deltas to world space pan vector.
71568
71570
  *
@@ -71646,6 +71648,10 @@ class InputController {
71646
71648
  pinchVelocitySensitivity = 0.006;
71647
71649
  // Sensitivity for two-finger pan delta → velocity conversion
71648
71650
  panVelocitySensitivity = 0.005;
71651
+ // Tap-to-jump state (uses existing MultiTouchSource count/touch deltas)
71652
+ _tapTouches = 0;
71653
+ _tapDelta = 0;
71654
+ _tapJump = false;
71649
71655
  // this gets overridden by the viewer based on scene size
71650
71656
  moveSpeed = 4;
71651
71657
  orbitSpeed = 18;
@@ -71694,6 +71700,8 @@ class InputController {
71694
71700
  events.on('inputEvent', async (eventName, event) => {
71695
71701
  switch (eventName) {
71696
71702
  case 'dblclick': {
71703
+ if (state.cameraMode === 'fps')
71704
+ break;
71697
71705
  if (!picker) {
71698
71706
  picker = new Picker(app, camera);
71699
71707
  }
@@ -71827,6 +71835,28 @@ class InputController {
71827
71835
  this._state.shift += key[keyCode.SHIFT];
71828
71836
  this._state.ctrl += key[keyCode.CTRL];
71829
71837
  const isFps = state.cameraMode === 'fps';
71838
+ // Tap-to-jump detection using existing MultiTouchSource deltas
71839
+ if (isFps) {
71840
+ const prevTaps = this._tapTouches;
71841
+ this._tapTouches = Math.max(0, this._tapTouches + count[0]);
71842
+ // Touch just started (0 → 1+)
71843
+ if (prevTaps === 0 && this._tapTouches > 0) {
71844
+ this._tapDelta = 0;
71845
+ }
71846
+ // Accumulate movement while touch is active
71847
+ if (this._tapTouches > 0) {
71848
+ this._tapDelta += Math.abs(touch[0]) + Math.abs(touch[1]);
71849
+ }
71850
+ // Touch just ended (1+ → 0): check if it was a tap
71851
+ if (prevTaps > 0 && this._tapTouches === 0) {
71852
+ if (this._tapDelta < TAP_EPSILON) {
71853
+ this._tapJump = true;
71854
+ }
71855
+ }
71856
+ }
71857
+ else {
71858
+ this._tapTouches = 0;
71859
+ }
71830
71860
  const isFirstPerson = state.cameraMode === 'fly' || isFps;
71831
71861
  // Accumulate pinch and pan deltas into velocity when using pinch control scheme
71832
71862
  // pinch[0] = oldDist - newDist: negative when spreading, positive when closing
@@ -71899,6 +71929,11 @@ class InputController {
71899
71929
  }
71900
71930
  pinchMove.set(0, 0, pinch[0]);
71901
71931
  v.add(pinchMove.mulScalar(orbit * double * this.pinchSpeed * dt));
71932
+ // Tap-to-jump for mobile FPS mode
71933
+ if (isFps && this._tapJump) {
71934
+ v.y = 1;
71935
+ this._tapJump = false;
71936
+ }
71902
71937
  deltas.move.append([v.x, v.y, v.z]);
71903
71938
  // mobile rotate
71904
71939
  v.set(0, 0, 0);
@@ -74468,7 +74503,7 @@ const initXr = (global) => {
74468
74503
  });
74469
74504
  };
74470
74505
 
74471
- var version = "1.16.0";
74506
+ var version = "1.16.1";
74472
74507
 
74473
74508
  const loadGsplat = async (app, config, progressCallback) => {
74474
74509
  const { contents, contentUrl, unified, aa } = config;