@playcanvas/supersplat-viewer 1.23.0 → 1.23.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.23.0",
3
+ "version": "1.23.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.html CHANGED
@@ -354,7 +354,7 @@
354
354
  <span class="control-action">Toggle Gaming Controls</span>
355
355
  <span class="control-key">G</span>
356
356
  </div>
357
- <div class="control-item">
357
+ <div id="desktopShowCollisionHelp" class="control-item hidden">
358
358
  <span class="control-action">Show Collision</span>
359
359
  <span class="control-key">V</span>
360
360
  </div>
package/public/index.js CHANGED
@@ -77723,7 +77723,7 @@ const importSettings = (settings) => {
77723
77723
  return result;
77724
77724
  };
77725
77725
 
77726
- var version = "1.23.0";
77726
+ var version = "1.23.1";
77727
77727
 
77728
77728
  class Tooltip {
77729
77729
  register;
@@ -78013,7 +78013,7 @@ const initUI = (global) => {
78013
78013
  'reset', 'frame',
78014
78014
  'loadingText', 'loadingBar',
78015
78015
  'joystickBase', 'joystick',
78016
- 'showCollision',
78016
+ 'showCollision', 'desktopShowCollisionHelp',
78017
78017
  'tooltip',
78018
78018
  'annotationNav', 'annotationPrev', 'annotationNext', 'annotationInfo', 'annotationNavTitle',
78019
78019
  'viewerBranding', 'viewerTitle', 'appVersionLabel'
@@ -78367,9 +78367,10 @@ const initUI = (global) => {
78367
78367
  dom.flyCamera.classList.toggle('middle', value);
78368
78368
  dom.flyCamera.classList.toggle('right', !value);
78369
78369
  });
78370
- // Collision overlay toggle (only visible when overlay is available)
78370
+ // Collision overlay toggle + matching help-panel row (only visible when overlay is available)
78371
78371
  events.on('hasCollisionOverlay:changed', (value) => {
78372
78372
  dom.showCollision.classList.toggle('hidden', !value);
78373
+ dom.desktopShowCollisionHelp.classList.toggle('hidden', !value);
78373
78374
  });
78374
78375
  dom.showCollision.addEventListener('click', () => {
78375
78376
  state.collisionOverlayEnabled = !state.collisionOverlayEnabled;
@@ -81590,7 +81591,6 @@ class KeyboardMouseDevice {
81590
81591
  const tmpV$2 = new Vec3();
81591
81592
  const orbitMove = new Vec3();
81592
81593
  const flyMoveTmp = new Vec3();
81593
- const flyTouchPan = new Vec3();
81594
81594
  const pinchMoveTmp = new Vec3();
81595
81595
  const orbitRotate = new Vec3();
81596
81596
  const flyRotate = new Vec3();
@@ -81599,19 +81599,12 @@ class TouchDevice {
81599
81599
  moveSpeed = 4;
81600
81600
  pinchSpeed = 0.4;
81601
81601
  touchRotateSensitivity = 1.5;
81602
- touchPinchMoveSensitivity = 1.5;
81603
- pinchVelocitySensitivity = 0.006;
81604
- panVelocitySensitivity = 0.005;
81605
81602
  _source = new MultiTouchSource();
81606
81603
  _global = null;
81607
81604
  /** Touches currently active (running count from .read() deltas). */
81608
81605
  _touchCount = 0;
81609
81606
  /** UI joystick value [x, y], -1..1. */
81610
81607
  _joystick = [0, 0];
81611
- /** Smoothed forward/back velocity from pinch gesture (-1..1). */
81612
- _pinchVelocity = 0;
81613
- /** Smoothed strafe/vertical velocity from two-finger pan, -1..1 each. */
81614
- _panVelocity = [0, 0];
81615
81608
  /** Tap-detection state — touch count, max touches, and accumulated movement. */
81616
81609
  _tapTouches = 0;
81617
81610
  _tapMaxTouches = 0;
@@ -81692,49 +81685,38 @@ class TouchDevice {
81692
81685
  this._tapTouches = 0;
81693
81686
  this._tapMaxTouches = 0;
81694
81687
  }
81695
- // smoothed velocities for fly/walk first-person motion (non-gaming)
81696
- if (isFirstPerson && !gamingControls && this._touchCount > 1) {
81697
- // pinch[0] = oldDist - newDist: negative when spreading,
81698
- // positive when closing. Spreading = forward → subtract.
81699
- this._pinchVelocity -= pinch[0] * this.pinchVelocitySensitivity;
81700
- this._pinchVelocity = math.clamp(this._pinchVelocity, -1, 1.0);
81701
- this._panVelocity[0] += touch[0] * this.panVelocitySensitivity;
81702
- this._panVelocity[0] = math.clamp(this._panVelocity[0], -1, 1.0);
81703
- this._panVelocity[1] += touch[1] * this.panVelocitySensitivity;
81704
- this._panVelocity[1] = math.clamp(this._panVelocity[1], -1, 1.0);
81705
- }
81706
- else if (isFirstPerson && this._touchCount <= 1) {
81707
- this._pinchVelocity = 0;
81708
- this._panVelocity[0] = 0;
81709
- this._panVelocity[1] = 0;
81710
- }
81711
81688
  const orbit = isOrbit ? 1 : 0;
81712
81689
  const fly = isFirstPerson ? 1 : 0;
81713
81690
  const double = this._touchCount > 1 ? 1 : 0;
81714
81691
  const orbitFactor = isFirstPerson ? cameraComponent.fov / 120 : 1;
81715
81692
  const dragInvert = (isFirstPerson && !gamingControls) ? -1 : 1;
81693
+ // First-person modes (fly and walk) opt into the direct two-finger
81694
+ // model only outside gaming controls (gaming uses the joystick).
81695
+ const directFirstPerson = fly * (gamingControls ? 0 : 1);
81716
81696
  const { deltas } = frame;
81717
81697
  // move
81718
81698
  const v = tmpV$2.set(0, 0, 0);
81719
- // two-finger orbit-pan when in orbit mode (single touch is rotate, double is pan)
81699
+ // Two-finger pan: orbit pans the target; fly strafes/rises in the
81700
+ // camera basis; walk strafes along the ground plane. Identical 1:1
81701
+ // screen-space mapping in every mode so dragging feels the same —
81702
+ // what your fingers move, the camera moves. Walk zeros y because
81703
+ // WalkController treats any nonzero move[1] as a jump trigger.
81720
81704
  screenToWorld(cameraComponent, touch[0], touch[1], distance, orbitMove);
81721
- v.add(orbitMove.mulScalar(orbit * double));
81705
+ if (isWalk) {
81706
+ orbitMove.y = 0;
81707
+ }
81708
+ v.add(orbitMove.mulScalar((orbit + directFirstPerson) * double));
81722
81709
  if (gamingControls) {
81723
81710
  // joystick UI drives strafe + forward/back in fly/walk
81724
81711
  flyMoveTmp.set(this._joystick[0], 0, -this._joystick[1]);
81725
81712
  v.add(flyMoveTmp.mulScalar(fly * this.moveSpeed * dt));
81726
81713
  }
81727
- else {
81728
- // smoothed pan velocity → strafe (X) and vertical (Y, fly only)
81729
- flyTouchPan.set(this._panVelocity[0], isWalk ? 0 : -this._panVelocity[1], 0);
81730
- v.add(flyTouchPan.mulScalar(fly * this.touchPinchMoveSensitivity * this.moveSpeed * dt));
81731
- // smoothed pinch velocity → forward/back
81732
- flyMoveTmp.set(0, 0, this._pinchVelocity);
81733
- v.add(flyMoveTmp.mulScalar(fly * this.touchPinchMoveSensitivity * this.moveSpeed * dt));
81734
- }
81735
- // raw pinch for orbit-mode zoom
81736
- pinchMoveTmp.set(0, 0, pinch[0]);
81737
- v.add(pinchMoveTmp.mulScalar(orbit * double * this.pinchSpeed * DISPLACEMENT_SCALE));
81714
+ // Two-finger pinch z: orbit interprets +z as "farther from target"
81715
+ // (close-pinch = +pinch[0] = zoom out). First-person modes interpret
81716
+ // +z as "forward", so spreading (pinch[0] < 0) should move forward —
81717
+ // flip the sign there.
81718
+ pinchMoveTmp.set(0, 0, (orbit - directFirstPerson) * pinch[0]);
81719
+ v.add(pinchMoveTmp.mulScalar(double * this.pinchSpeed * DISPLACEMENT_SCALE));
81738
81720
  // tap-to-jump in walk + gaming controls
81739
81721
  if (isWalk && this._tapJump) {
81740
81722
  v.y = 1;