@playcanvas/supersplat-viewer 1.13.0 → 1.13.2

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.13.0",
3
+ "version": "1.13.2",
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
@@ -103746,7 +103746,7 @@ class OrbitController {
103746
103746
  p.position.copy(camera.position);
103747
103747
  p.angles.copy(camera.angles);
103748
103748
  p.distance = camera.distance;
103749
- this.controller.attach(p, true);
103749
+ this.controller.attach(p, false);
103750
103750
  }
103751
103751
  }
103752
103752
 
@@ -103808,9 +103808,14 @@ class CameraManager {
103808
103808
  let fromMode = isObjectExperience ? 'orbit' : 'fly';
103809
103809
  // enter the initial controller
103810
103810
  getController(state.cameraMode).onEnter(this.camera);
103811
- // transition time between cameras
103812
- const transitionSpeed = 2.0;
103811
+ // transition state
103812
+ const transitionSpeed = 1.0;
103813
103813
  let transitionTimer = 1;
103814
+ // start a new camera transition from the current pose
103815
+ const startTransition = () => {
103816
+ from.copy(this.camera);
103817
+ transitionTimer = 0;
103818
+ };
103814
103819
  // application update
103815
103820
  this.update = (deltaTime, frame) => {
103816
103821
  // use dt of 0 if animation is paused
@@ -103837,10 +103842,12 @@ class CameraManager {
103837
103842
  case 'frame':
103838
103843
  state.cameraMode = 'orbit';
103839
103844
  controllers.orbit.goto(frameCamera);
103845
+ startTransition();
103840
103846
  break;
103841
103847
  case 'reset':
103842
103848
  state.cameraMode = 'orbit';
103843
103849
  controllers.orbit.goto(resetCamera);
103850
+ startTransition();
103844
103851
  break;
103845
103852
  case 'playPause':
103846
103853
  if (state.hasAnimation) {
@@ -103863,9 +103870,9 @@ class CameraManager {
103863
103870
  });
103864
103871
  // handle camera mode switching
103865
103872
  events.on('cameraMode:changed', (value, prev) => {
103866
- // store previous camera mode and pose
103873
+ // snapshot the current pose before any controller mutation
103874
+ startTransition();
103867
103875
  target.copy(this.camera);
103868
- from.copy(this.camera);
103869
103876
  fromMode = prev;
103870
103877
  // exit the old controller
103871
103878
  const prevController = getController(prev);
@@ -103873,8 +103880,6 @@ class CameraManager {
103873
103880
  // enter new controller
103874
103881
  const newController = getController(value);
103875
103882
  newController.onEnter(this.camera);
103876
- // reset camera transition timer
103877
- transitionTimer = 0;
103878
103883
  });
103879
103884
  // handle user scrubbing the animation timeline
103880
103885
  events.on('scrubAnim', (time) => {
@@ -103891,6 +103896,7 @@ class CameraManager {
103891
103896
  tmpCamera.copy(this.camera);
103892
103897
  tmpCamera.look(this.camera.position, position);
103893
103898
  controllers.orbit.goto(tmpCamera);
103899
+ startTransition();
103894
103900
  });
103895
103901
  events.on('annotation.activate', (annotation) => {
103896
103902
  // switch to orbit camera on pick
@@ -103900,6 +103906,8 @@ class CameraManager {
103900
103906
  tmpCamera.fov = initial.fov;
103901
103907
  tmpCamera.look(new Vec3(initial.position), new Vec3(initial.target));
103902
103908
  controllers.orbit.goto(tmpCamera);
103909
+ target.fov = tmpCamera.fov;
103910
+ startTransition();
103903
103911
  });
103904
103912
  }
103905
103913
  }
@@ -105539,7 +105547,7 @@ const initXr = (global) => {
105539
105547
  });
105540
105548
  };
105541
105549
 
105542
- var version = "1.13.0";
105550
+ var version = "1.13.2";
105543
105551
 
105544
105552
  const loadGsplat = async (app, config, progressCallback) => {
105545
105553
  const { contents, contentUrl, unified, aa } = config;