@playcanvas/supersplat-viewer 1.19.0 → 1.19.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.19.0",
3
+ "version": "1.19.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
@@ -74777,15 +74777,21 @@ class Annotations {
74777
74777
  parentDom.id = 'annotations';
74778
74778
  Annotation.parentDom = parentDom;
74779
74779
  document.querySelector('#ui').appendChild(parentDom);
74780
- global.events.on('controlsHidden:changed', (value) => {
74781
- parentDom.style.display = value ? 'none' : 'block';
74782
- Annotation.opacity = value ? 0.0 : 1.0;
74780
+ this.annotations = global.settings.annotations;
74781
+ this.parentDom = parentDom;
74782
+ const { state } = global;
74783
+ const updateVisibility = () => {
74784
+ const hidden = state.controlsHidden || (state.cameraMode === 'walk' && state.gamingControls);
74785
+ parentDom.style.display = hidden ? 'none' : 'block';
74786
+ Annotation.opacity = hidden ? 0.0 : 1.0;
74783
74787
  if (this.annotations.length > 0) {
74784
74788
  global.app.renderNextFrame = true;
74785
74789
  }
74786
- });
74787
- this.annotations = global.settings.annotations;
74788
- this.parentDom = parentDom;
74790
+ };
74791
+ global.events.on('controlsHidden:changed', updateVisibility);
74792
+ global.events.on('cameraMode:changed', updateVisibility);
74793
+ global.events.on('gamingControls:changed', updateVisibility);
74794
+ updateVisibility();
74789
74795
  if (hasCameraFrame) {
74790
74796
  Annotation.hotspotColor.gamma();
74791
74797
  Annotation.hoverColor.gamma();
@@ -75433,6 +75439,8 @@ class WalkController {
75433
75439
  onEnter(camera) {
75434
75440
  this.goto(camera);
75435
75441
  if (this.collision) {
75442
+ this._resolveSpawnCollision();
75443
+ this._prevPosition.copy(this._position);
75436
75444
  const groundY = this._probeGround(this._position);
75437
75445
  if (groundY !== null) {
75438
75446
  this._grounded = true;
@@ -75550,6 +75558,23 @@ class WalkController {
75550
75558
  this._pendingMove[2] = 0;
75551
75559
  this._accumulator = 0;
75552
75560
  }
75561
+ /**
75562
+ * Push the capsule upward until it clears solid geometry, up to a maximum of
75563
+ * 100 iterations. Only used at spawn time to handle the case where walk mode
75564
+ * activates inside a solid region. Per-frame collision resolution is unaffected,
75565
+ * avoiding the ceiling launch bug.
75566
+ */
75567
+ _resolveSpawnCollision() {
75568
+ const half = this.capsuleHeight * 0.5 - this.capsuleRadius;
75569
+ const minStep = this.capsuleRadius;
75570
+ for (let i = 0; i < 100; i++) {
75571
+ const center = this._position.y - this.eyeHeight + this.capsuleHeight * 0.5;
75572
+ if (!this.collision.queryCapsule(this._position.x, center, this._position.z, half, this.capsuleRadius, out)) {
75573
+ break;
75574
+ }
75575
+ this._position.y += Math.max(out.y, minStep);
75576
+ }
75577
+ }
75553
75578
  /**
75554
75579
  * Cast multiple rays downward to find the average ground surface height.
75555
75580
  * Uses 5 rays (center + 4 cardinal at capsule radius) to spatially filter
@@ -78786,7 +78811,7 @@ const initXr = (global) => {
78786
78811
  });
78787
78812
  };
78788
78813
 
78789
- var version = "1.19.0";
78814
+ var version = "1.19.1";
78790
78815
 
78791
78816
  const loadGsplat = async (app, config, progressCallback) => {
78792
78817
  const { contents, contentUrl, unified, aa } = config;