@playcanvas/supersplat-viewer 1.18.1 → 1.18.2-beta.0
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 +2 -1
- package/public/index.html +1 -0
- package/public/index.js +16 -10
- package/public/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playcanvas/supersplat-viewer",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.2-beta.0",
|
|
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",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"typescript": "5.9.3"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
|
+
"prepare": "rollup -c",
|
|
66
67
|
"build": "rollup -c",
|
|
67
68
|
"develop": "concurrently --kill-others \"npm run watch\" \"npm run serve\"",
|
|
68
69
|
"lint": "eslint src rollup.config.mjs eslint.config.mjs",
|
package/public/index.html
CHANGED
package/public/index.js
CHANGED
|
@@ -76063,20 +76063,20 @@ class Viewer {
|
|
|
76063
76063
|
cameraEntity.camera.farClip = far;
|
|
76064
76064
|
cameraEntity.camera.nearClip = near;
|
|
76065
76065
|
};
|
|
76066
|
+
const stepCamera = (dt) => {
|
|
76067
|
+
if (this.inputController && this.cameraManager) {
|
|
76068
|
+
this.inputController.update(dt, this.cameraManager.camera.distance);
|
|
76069
|
+
this.cameraManager.update(dt, this.inputController.frame);
|
|
76070
|
+
applyCamera(this.cameraManager.camera);
|
|
76071
|
+
}
|
|
76072
|
+
};
|
|
76066
76073
|
// handle application update
|
|
76067
76074
|
app.on('update', (deltaTime) => {
|
|
76068
|
-
// in xr mode we leave the camera alone
|
|
76069
76075
|
if (app.xr.active) {
|
|
76070
76076
|
return;
|
|
76071
76077
|
}
|
|
76072
|
-
|
|
76073
|
-
|
|
76074
|
-
this.inputController.update(deltaTime, this.cameraManager.camera.distance);
|
|
76075
|
-
// update cameras
|
|
76076
|
-
this.cameraManager.update(deltaTime, this.inputController.frame);
|
|
76077
|
-
// apply to the camera entity
|
|
76078
|
-
applyCamera(this.cameraManager.camera);
|
|
76079
|
-
}
|
|
76078
|
+
// in step mode the scene is frozen; only window.stepFrame advances it
|
|
76079
|
+
stepCamera(config.stepMode ? 0 : deltaTime);
|
|
76080
76080
|
});
|
|
76081
76081
|
// Render voxel debug overlay
|
|
76082
76082
|
app.on('prerender', () => {
|
|
@@ -76086,6 +76086,12 @@ class Viewer {
|
|
|
76086
76086
|
events.on('firstFrame', () => {
|
|
76087
76087
|
state.loaded = true;
|
|
76088
76088
|
state.animationPaused = !!config.noanim;
|
|
76089
|
+
if (config.stepMode) {
|
|
76090
|
+
window.stepFrame = (dtMs) => {
|
|
76091
|
+
stepCamera(dtMs / 1000);
|
|
76092
|
+
app.renderNextFrame = true;
|
|
76093
|
+
};
|
|
76094
|
+
}
|
|
76089
76095
|
});
|
|
76090
76096
|
// wait for the model to load
|
|
76091
76097
|
Promise.all([gsplatLoad, skyboxLoad, voxelLoad]).then((results) => {
|
|
@@ -78133,7 +78139,7 @@ const initXr = (global) => {
|
|
|
78133
78139
|
});
|
|
78134
78140
|
};
|
|
78135
78141
|
|
|
78136
|
-
var version = "1.18.
|
|
78142
|
+
var version = "1.18.2-beta.0";
|
|
78137
78143
|
|
|
78138
78144
|
const loadGsplat = async (app, config, progressCallback) => {
|
|
78139
78145
|
const { contents, contentUrl, unified, aa } = config;
|