@playcanvas/supersplat-viewer 1.18.4 → 1.18.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.
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/public/index.html +1 -0
- package/public/index.js +27 -49
- package/public/index.js.map +1 -1
package/package.json
CHANGED
package/public/index.html
CHANGED
package/public/index.js
CHANGED
|
@@ -73841,7 +73841,7 @@ class WalkController {
|
|
|
73841
73841
|
/**
|
|
73842
73842
|
* Field of view in degrees for walk mode.
|
|
73843
73843
|
*/
|
|
73844
|
-
fov =
|
|
73844
|
+
fov = 90;
|
|
73845
73845
|
/**
|
|
73846
73846
|
* Total capsule height in meters (default: human proportion)
|
|
73847
73847
|
*/
|
|
@@ -76221,8 +76221,8 @@ class Viewer {
|
|
|
76221
76221
|
}
|
|
76222
76222
|
else {
|
|
76223
76223
|
const { gsplat } = app.scene;
|
|
76224
|
-
// quality
|
|
76225
|
-
const
|
|
76224
|
+
// quality budget
|
|
76225
|
+
const budgets = {
|
|
76226
76226
|
mobile: {
|
|
76227
76227
|
low: 1,
|
|
76228
76228
|
high: 2
|
|
@@ -76232,11 +76232,22 @@ class Viewer {
|
|
|
76232
76232
|
high: 4
|
|
76233
76233
|
}
|
|
76234
76234
|
};
|
|
76235
|
-
const
|
|
76236
|
-
|
|
76237
|
-
|
|
76238
|
-
|
|
76239
|
-
|
|
76235
|
+
const getBudget = () => {
|
|
76236
|
+
const quality = platform.mobile ? budgets.mobile : budgets.desktop;
|
|
76237
|
+
return state.retinaDisplay ? quality.high : quality.low;
|
|
76238
|
+
};
|
|
76239
|
+
if (config.fullload) {
|
|
76240
|
+
// reveal once full quality has finished loading (used for screenshots)
|
|
76241
|
+
gsplat.splatBudget = getBudget() * 1000000;
|
|
76242
|
+
gsplat.lodRangeMin = 0;
|
|
76243
|
+
gsplat.lodRangeMax = 1000;
|
|
76244
|
+
}
|
|
76245
|
+
else {
|
|
76246
|
+
// reveal once low lod has loaded for fastest possible reveal
|
|
76247
|
+
const lodLevels = results[0].gsplat.resource?.octree?.lodLevels;
|
|
76248
|
+
if (lodLevels) {
|
|
76249
|
+
gsplat.lodRangeMax = gsplat.lodRangeMin = lodLevels - 1;
|
|
76250
|
+
}
|
|
76240
76251
|
}
|
|
76241
76252
|
// these two allow LOD behind camera to drop, saves lots of splats
|
|
76242
76253
|
gsplat.lodUpdateAngle = 90;
|
|
@@ -76270,8 +76281,7 @@ class Viewer {
|
|
|
76270
76281
|
state.readyToRender = true;
|
|
76271
76282
|
// handle quality mode changes
|
|
76272
76283
|
const updateLod = () => {
|
|
76273
|
-
|
|
76274
|
-
gsplat.splatBudget = settings * 1000000;
|
|
76284
|
+
gsplat.splatBudget = getBudget() * 1000000;
|
|
76275
76285
|
gsplat.lodRangeMin = 0;
|
|
76276
76286
|
gsplat.lodRangeMax = 1000;
|
|
76277
76287
|
};
|
|
@@ -76600,20 +76610,6 @@ class VoxelCollider {
|
|
|
76600
76610
|
const leafData = view.slice(metadata.nodeCount, metadata.nodeCount + metadata.leafDataCount);
|
|
76601
76611
|
return new VoxelCollider(metadata, nodes, leafData);
|
|
76602
76612
|
}
|
|
76603
|
-
/**
|
|
76604
|
-
* Query whether a world-space point lies inside a solid voxel.
|
|
76605
|
-
*
|
|
76606
|
-
* @param x - World X coordinate.
|
|
76607
|
-
* @param y - World Y coordinate.
|
|
76608
|
-
* @param z - World Z coordinate.
|
|
76609
|
-
* @returns True if the point is inside a solid voxel.
|
|
76610
|
-
*/
|
|
76611
|
-
queryPoint(x, y, z) {
|
|
76612
|
-
const ix = Math.floor((x - this.gridMinX) / this.voxelResolution);
|
|
76613
|
-
const iy = Math.floor((y - this.gridMinY) / this.voxelResolution);
|
|
76614
|
-
const iz = Math.floor((z - this.gridMinZ) / this.voxelResolution);
|
|
76615
|
-
return this.isVoxelSolid(ix, iy, iz);
|
|
76616
|
-
}
|
|
76617
76613
|
/**
|
|
76618
76614
|
* Compute a stable surface normal at a world-space position using flatness-probability
|
|
76619
76615
|
* sampling. Tests 9 candidate directions: 3 axis-aligned and 6 diagonal (45-degree in
|
|
@@ -77171,7 +77167,7 @@ class VoxelCollider {
|
|
|
77171
77167
|
const distNegZ = cz - vMinZ;
|
|
77172
77168
|
const distPosZ = vMaxZ - cz;
|
|
77173
77169
|
const escapeX = distNegX < distPosX ? -(distNegX + radius) : (distPosX + radius);
|
|
77174
|
-
const escapeY = distNegY
|
|
77170
|
+
const escapeY = distNegY < distPosY ? -(distNegY + radius) : (distPosY + radius);
|
|
77175
77171
|
const escapeZ = distNegZ < distPosZ ? -(distNegZ + radius) : (distPosZ + radius);
|
|
77176
77172
|
const absX = Math.abs(escapeX);
|
|
77177
77173
|
const absY = Math.abs(escapeY);
|
|
@@ -77179,14 +77175,14 @@ class VoxelCollider {
|
|
|
77179
77175
|
px = 0;
|
|
77180
77176
|
py = 0;
|
|
77181
77177
|
pz = 0;
|
|
77182
|
-
if (
|
|
77183
|
-
py = escapeY;
|
|
77184
|
-
penetration = absY;
|
|
77185
|
-
}
|
|
77186
|
-
else if (absX <= absZ) {
|
|
77178
|
+
if (absX <= absY && absX <= absZ) {
|
|
77187
77179
|
px = escapeX;
|
|
77188
77180
|
penetration = absX;
|
|
77189
77181
|
}
|
|
77182
|
+
else if (absY <= absZ) {
|
|
77183
|
+
py = escapeY;
|
|
77184
|
+
penetration = absY;
|
|
77185
|
+
}
|
|
77190
77186
|
else {
|
|
77191
77187
|
pz = escapeZ;
|
|
77192
77188
|
penetration = absZ;
|
|
@@ -77202,24 +77198,6 @@ class VoxelCollider {
|
|
|
77202
77198
|
}
|
|
77203
77199
|
}
|
|
77204
77200
|
}
|
|
77205
|
-
// Column-based Y fallback: the per-voxel sphere test loses Y information
|
|
77206
|
-
// when the capsule segment passes through a voxel (segY lands inside the
|
|
77207
|
-
// AABB, zeroing dy). Recover it by finding the topmost solid voxel in the
|
|
77208
|
-
// capsule-center column and computing a direct capsule-bottom push.
|
|
77209
|
-
if (found && Math.abs(bestPushY) <= PENETRATION_EPSILON) {
|
|
77210
|
-
const icx = Math.floor((cx - gridMinX) / voxelResolution);
|
|
77211
|
-
const icz = Math.floor((cz - gridMinZ) / voxelResolution);
|
|
77212
|
-
const capsuleBottom = segTopY + radius;
|
|
77213
|
-
for (let iy = iyMin; iy <= iyMax; iy++) {
|
|
77214
|
-
if (this.isVoxelSolid(icx, iy, icz)) {
|
|
77215
|
-
const surfaceY = gridMinY + iy * voxelResolution;
|
|
77216
|
-
if (capsuleBottom > surfaceY + PENETRATION_EPSILON) {
|
|
77217
|
-
bestPushY = surfaceY - capsuleBottom;
|
|
77218
|
-
}
|
|
77219
|
-
break;
|
|
77220
|
-
}
|
|
77221
|
-
}
|
|
77222
|
-
}
|
|
77223
77201
|
if (found) {
|
|
77224
77202
|
this._push.x = bestPushX;
|
|
77225
77203
|
this._push.y = bestPushY;
|
|
@@ -78215,7 +78193,7 @@ const initXr = (global) => {
|
|
|
78215
78193
|
});
|
|
78216
78194
|
};
|
|
78217
78195
|
|
|
78218
|
-
var version = "1.18.
|
|
78196
|
+
var version = "1.18.6";
|
|
78219
78197
|
|
|
78220
78198
|
const loadGsplat = async (app, config, progressCallback) => {
|
|
78221
78199
|
const { contents, contentUrl, unified, aa } = config;
|