@heliguy-xyz/splat-viewer 1.0.0-rc.5 → 1.0.0-rc.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CameraModeManager.d.ts","sourceRoot":"","sources":["../../src/web-component/CameraModeManager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAEhB,KAAK,MAAM,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;AAEvD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,GAAG,CAAuB;IAClC,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,GAAG,CAAY;IACvB,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,IAAI,CAAQ;gBAGlB,GAAG,EAAE,qBAAqB,EAC1B,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,iBAAiB,GAAG,IAAI,EAC/B,GAAG,EAAE,GAAG,GAAG,IAAI,EACf,IAAI,EAAE,MAAM,EACZ,WAAW,GAAE,UAAkC;IAmB1C,OAAO,IAAI,UAAU;IAIrB,OAAO,CAAC,QAAQ,EAAE,UAAU,GAAG,IAAI;IA0BnC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;IAMpD,YAAY,IAAI,eAAe,GAAG,IAAI;IAmBtC,WAAW,IAAI,cAAc,GAAG,IAAI;IAe3C,OAAO,CAAC,iBAAiB;IA+BzB,OAAO,CAAC,mBAAmB;IA4B3B,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,iBAAiB;CAI1B"}
1
+ {"version":3,"file":"CameraModeManager.d.ts","sourceRoot":"","sources":["../../src/web-component/CameraModeManager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAEhB,KAAK,MAAM,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;AAEvD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,GAAG,CAAuB;IAClC,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,GAAG,CAAY;IACvB,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,IAAI,CAAQ;gBAGlB,GAAG,EAAE,qBAAqB,EAC1B,MAAM,EAAE,gBAAgB,EACxB,KAAK,EAAE,iBAAiB,GAAG,IAAI,EAC/B,GAAG,EAAE,GAAG,GAAG,IAAI,EACf,IAAI,EAAE,MAAM,EACZ,WAAW,GAAE,UAAkC;IAmB1C,OAAO,IAAI,UAAU;IAIrB,OAAO,CAAC,QAAQ,EAAE,UAAU,GAAG,IAAI;IAgCnC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI;IAMpD,YAAY,IAAI,eAAe,GAAG,IAAI;IAmBtC,WAAW,IAAI,cAAc,GAAG,IAAI;IAe3C,OAAO,CAAC,iBAAiB;IA+BzB,OAAO,CAAC,mBAAmB;IA4B3B,OAAO,CAAC,eAAe;IAoBvB,OAAO,CAAC,iBAAiB;CAI1B"}
@@ -104336,10 +104336,13 @@ class CameraModeManager {
104336
104336
  if (nextMode === this.mode)
104337
104337
  return;
104338
104338
  const prev = this.mode;
104339
- // Preserve camera transform
104339
+ // Preserve camera transform (position + rotation)
104340
104340
  const pos = this.camera.getPosition
104341
104341
  ? this.camera.getPosition().clone()
104342
104342
  : { x: 0, y: 0, z: 10 };
104343
+ const rot = this.camera.getRotation
104344
+ ? this.camera.getRotation().clone()
104345
+ : null;
104343
104346
  // Switch
104344
104347
  if (nextMode === 'fly') {
104345
104348
  this.deactivateOrbitMode();
@@ -104350,6 +104353,9 @@ class CameraModeManager {
104350
104353
  this.activateOrbitMode();
104351
104354
  }
104352
104355
  this.camera.setPosition(pos);
104356
+ if (rot && this.camera.setRotation) {
104357
+ this.camera.setRotation(rot);
104358
+ }
104353
104359
  this.mode = nextMode;
104354
104360
  // Emit camera-mode-changed
104355
104361
  this.emit('camera-mode-changed', { mode: nextMode, previousMode: prev });
@@ -104454,6 +104460,22 @@ class CameraModeManager {
104454
104460
  return;
104455
104461
  if (typeof this.fly.activate === 'function')
104456
104462
  this.fly.activate();
104463
+ // Align fly camera internal orientation with the current camera rotation so that
104464
+ // switching from orbit -> fly does not snap the view back to the initial direction.
104465
+ try {
104466
+ const euler = this.camera.getEulerAngles
104467
+ ? this.camera.getEulerAngles()
104468
+ : null;
104469
+ if (euler) {
104470
+ // These properties are part of the FlyCamera runtime state
104471
+ ;
104472
+ this.fly._pitch = euler.x || 0;
104473
+ this.fly._yaw = euler.y || 0;
104474
+ }
104475
+ }
104476
+ catch {
104477
+ // Best-effort sync; ignore if camera or script API differs
104478
+ }
104457
104479
  }
104458
104480
  deactivateFlyMode() {
104459
104481
  if (!this.fly)