@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/dist/index.js +1 -1
- package/package.json +1 -1
- package/public/index.js +32 -7
- package/public/index.js.map +1 -1
package/package.json
CHANGED
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.
|
|
74781
|
-
|
|
74782
|
-
|
|
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
|
-
|
|
74788
|
-
|
|
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.
|
|
78814
|
+
var version = "1.19.1";
|
|
78790
78815
|
|
|
78791
78816
|
const loadGsplat = async (app, config, progressCallback) => {
|
|
78792
78817
|
const { contents, contentUrl, unified, aa } = config;
|