@playcanvas/supersplat-viewer 1.7.0 → 1.7.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 +6 -6
- package/public/index.js +60 -9
- 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.7.
|
|
3
|
+
"version": "1.7.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",
|
|
@@ -38,16 +38,16 @@
|
|
|
38
38
|
],
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@playcanvas/eslint-config": "2.1.0",
|
|
41
|
-
"@playcanvas/web-components": "0.2.
|
|
42
|
-
"@rollup/plugin-node-resolve": "16.0.
|
|
41
|
+
"@playcanvas/web-components": "0.2.11",
|
|
42
|
+
"@rollup/plugin-node-resolve": "16.0.3",
|
|
43
43
|
"@rollup/plugin-typescript": "12.1.4",
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "8.46.
|
|
45
|
-
"@typescript-eslint/parser": "8.46.
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "8.46.1",
|
|
45
|
+
"@typescript-eslint/parser": "8.46.1",
|
|
46
46
|
"autoprefixer": "10.4.21",
|
|
47
47
|
"concurrently": "9.2.1",
|
|
48
48
|
"eslint": "9.37.0",
|
|
49
49
|
"globals": "16.4.0",
|
|
50
|
-
"playcanvas": "2.12.
|
|
50
|
+
"playcanvas": "2.12.3",
|
|
51
51
|
"postcss": "8.5.6",
|
|
52
52
|
"publint": "0.3.14",
|
|
53
53
|
"rollup": "4.52.4",
|
package/public/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const TRACEID_GPU_TIMINGS = 'GpuTimings';
|
|
2
2
|
|
|
3
|
-
const version = '2.12.
|
|
4
|
-
const revision = '
|
|
3
|
+
const version = '2.12.3';
|
|
4
|
+
const revision = '49d2399';
|
|
5
5
|
function extend(target, ex) {
|
|
6
6
|
for(const prop in ex){
|
|
7
7
|
const copy = ex[prop];
|
|
@@ -35424,6 +35424,16 @@ class GSplatSogsData {
|
|
|
35424
35424
|
this.packShMemory();
|
|
35425
35425
|
}
|
|
35426
35426
|
});
|
|
35427
|
+
[
|
|
35428
|
+
'scales',
|
|
35429
|
+
'sh0',
|
|
35430
|
+
'shN'
|
|
35431
|
+
].forEach((name)=>{
|
|
35432
|
+
const codebook = this.meta[name]?.codebook;
|
|
35433
|
+
if (codebook?.[0] === null) {
|
|
35434
|
+
codebook[0] = codebook[1] + (codebook[1] - codebook[255]) / 255;
|
|
35435
|
+
}
|
|
35436
|
+
});
|
|
35427
35437
|
if (this.destroyed || device._destroyed) return;
|
|
35428
35438
|
await this.generateCenters();
|
|
35429
35439
|
if (this.destroyed || device._destroyed) return;
|
|
@@ -90082,6 +90092,38 @@ class InputController extends InputConsumer {
|
|
|
90082
90092
|
const DOUBLE_TAP_THRESHOLD = 250;
|
|
90083
90093
|
const DOUBLE_TAP_VARIANCE = 100;
|
|
90084
90094
|
|
|
90095
|
+
const movementState = ()=>{
|
|
90096
|
+
const state = new Map();
|
|
90097
|
+
return {
|
|
90098
|
+
down: (event)=>{
|
|
90099
|
+
state.set(event.pointerId, [
|
|
90100
|
+
event.screenX,
|
|
90101
|
+
event.screenY
|
|
90102
|
+
]);
|
|
90103
|
+
},
|
|
90104
|
+
move: (event)=>{
|
|
90105
|
+
if (!state.has(event.pointerId)) {
|
|
90106
|
+
return [
|
|
90107
|
+
0,
|
|
90108
|
+
0
|
|
90109
|
+
];
|
|
90110
|
+
}
|
|
90111
|
+
const prev = state.get(event.pointerId);
|
|
90112
|
+
const mvX = event.screenX - prev[0];
|
|
90113
|
+
const mvY = event.screenY - prev[1];
|
|
90114
|
+
prev[0] = event.screenX;
|
|
90115
|
+
prev[1] = event.screenY;
|
|
90116
|
+
return [
|
|
90117
|
+
mvX,
|
|
90118
|
+
mvY
|
|
90119
|
+
];
|
|
90120
|
+
},
|
|
90121
|
+
up: (event)=>{
|
|
90122
|
+
state.delete(event.pointerId);
|
|
90123
|
+
}
|
|
90124
|
+
};
|
|
90125
|
+
};
|
|
90126
|
+
|
|
90085
90127
|
const v$1 = new Vec2();
|
|
90086
90128
|
class VirtualJoystick {
|
|
90087
90129
|
constructor({ range } = {}){
|
|
@@ -90145,7 +90187,7 @@ class DualGestureSource extends InputSource {
|
|
|
90145
90187
|
doubleTap: [
|
|
90146
90188
|
0
|
|
90147
90189
|
]
|
|
90148
|
-
}), this._layout = 'joystick-touch', this._pointerData = new Map(), this._lastPointer = {
|
|
90190
|
+
}), this._movementState = movementState(), this._layout = 'joystick-touch', this._pointerData = new Map(), this._lastPointer = {
|
|
90149
90191
|
x: 0,
|
|
90150
90192
|
y: 0,
|
|
90151
90193
|
time: 0
|
|
@@ -90178,6 +90220,7 @@ class DualGestureSource extends InputSource {
|
|
|
90178
90220
|
}
|
|
90179
90221
|
_onPointerDown(event) {
|
|
90180
90222
|
const { pointerType, pointerId, clientX, clientY } = event;
|
|
90223
|
+
this._movementState.down(event);
|
|
90181
90224
|
if (pointerType !== 'touch') {
|
|
90182
90225
|
return;
|
|
90183
90226
|
}
|
|
@@ -90206,7 +90249,8 @@ class DualGestureSource extends InputSource {
|
|
|
90206
90249
|
}
|
|
90207
90250
|
}
|
|
90208
90251
|
_onPointerMove(event) {
|
|
90209
|
-
const { pointerType, pointerId, target, clientX, clientY
|
|
90252
|
+
const { pointerType, pointerId, target, clientX, clientY } = event;
|
|
90253
|
+
const [movementX, movementY] = this._movementState.move(event);
|
|
90210
90254
|
if (pointerType !== 'touch') {
|
|
90211
90255
|
return;
|
|
90212
90256
|
}
|
|
@@ -90242,6 +90286,7 @@ class DualGestureSource extends InputSource {
|
|
|
90242
90286
|
}
|
|
90243
90287
|
_onPointerUp(event) {
|
|
90244
90288
|
const { pointerType, pointerId } = event;
|
|
90289
|
+
this._movementState.up(event);
|
|
90245
90290
|
if (pointerType !== 'touch') {
|
|
90246
90291
|
return;
|
|
90247
90292
|
}
|
|
@@ -90310,7 +90355,7 @@ class MultiTouchSource extends InputSource {
|
|
|
90310
90355
|
pinch: [
|
|
90311
90356
|
0
|
|
90312
90357
|
]
|
|
90313
|
-
}), this._pointerEvents = new Map(), this._pointerPos = new Vec2(), this._pinchDist = -1;
|
|
90358
|
+
}), this._movementState = movementState(), this._pointerEvents = new Map(), this._pointerPos = new Vec2(), this._pinchDist = -1;
|
|
90314
90359
|
this._onPointerDown = this._onPointerDown.bind(this);
|
|
90315
90360
|
this._onPointerMove = this._onPointerMove.bind(this);
|
|
90316
90361
|
this._onPointerUp = this._onPointerUp.bind(this);
|
|
@@ -90318,6 +90363,7 @@ class MultiTouchSource extends InputSource {
|
|
|
90318
90363
|
}
|
|
90319
90364
|
_onPointerDown(event) {
|
|
90320
90365
|
const { pointerId, pointerType } = event;
|
|
90366
|
+
this._movementState.down(event);
|
|
90321
90367
|
if (pointerType !== 'touch') {
|
|
90322
90368
|
return;
|
|
90323
90369
|
}
|
|
@@ -90332,7 +90378,8 @@ class MultiTouchSource extends InputSource {
|
|
|
90332
90378
|
}
|
|
90333
90379
|
}
|
|
90334
90380
|
_onPointerMove(event) {
|
|
90335
|
-
const { pointerType, target, pointerId
|
|
90381
|
+
const { pointerType, target, pointerId } = event;
|
|
90382
|
+
const [movementX, movementY] = this._movementState.move(event);
|
|
90336
90383
|
if (pointerType !== 'touch') {
|
|
90337
90384
|
return;
|
|
90338
90385
|
}
|
|
@@ -90366,6 +90413,7 @@ class MultiTouchSource extends InputSource {
|
|
|
90366
90413
|
}
|
|
90367
90414
|
_onPointerUp(event) {
|
|
90368
90415
|
const { pointerType, pointerId } = event;
|
|
90416
|
+
this._movementState.up(event);
|
|
90369
90417
|
if (pointerType !== 'touch') {
|
|
90370
90418
|
return;
|
|
90371
90419
|
}
|
|
@@ -90492,7 +90540,7 @@ class KeyboardMouseSource extends InputSource {
|
|
|
90492
90540
|
wheel: [
|
|
90493
90541
|
0
|
|
90494
90542
|
]
|
|
90495
|
-
}), this._pointerId = -1, this._keyMap = new Map(), this._keyPrev = Array(KEY_COUNT).fill(0), this._keyNow = Array(KEY_COUNT).fill(0), this._button = Array(3).fill(0);
|
|
90543
|
+
}), this._movementState = movementState(), this._pointerId = -1, this._keyMap = new Map(), this._keyPrev = Array(KEY_COUNT).fill(0), this._keyNow = Array(KEY_COUNT).fill(0), this._button = Array(3).fill(0);
|
|
90496
90544
|
this._pointerLock = pointerLock ?? false;
|
|
90497
90545
|
const { keyCode } = KeyboardMouseSource;
|
|
90498
90546
|
for(let i = 0; i < 26; i++){
|
|
@@ -90527,6 +90575,7 @@ class KeyboardMouseSource extends InputSource {
|
|
|
90527
90575
|
]);
|
|
90528
90576
|
}
|
|
90529
90577
|
_onPointerDown(event) {
|
|
90578
|
+
this._movementState.down(event);
|
|
90530
90579
|
if (event.pointerType !== 'mouse') {
|
|
90531
90580
|
return;
|
|
90532
90581
|
}
|
|
@@ -90546,6 +90595,7 @@ class KeyboardMouseSource extends InputSource {
|
|
|
90546
90595
|
this._pointerId = event.pointerId;
|
|
90547
90596
|
}
|
|
90548
90597
|
_onPointerMove(event) {
|
|
90598
|
+
const [movementX, movementY] = this._movementState.move(event);
|
|
90549
90599
|
if (event.pointerType !== 'mouse') {
|
|
90550
90600
|
return;
|
|
90551
90601
|
}
|
|
@@ -90562,11 +90612,12 @@ class KeyboardMouseSource extends InputSource {
|
|
|
90562
90612
|
}
|
|
90563
90613
|
}
|
|
90564
90614
|
this.deltas.mouse.append([
|
|
90565
|
-
|
|
90566
|
-
|
|
90615
|
+
movementX,
|
|
90616
|
+
movementY
|
|
90567
90617
|
]);
|
|
90568
90618
|
}
|
|
90569
90619
|
_onPointerUp(event) {
|
|
90620
|
+
this._movementState.up(event);
|
|
90570
90621
|
if (event.pointerType !== 'mouse') {
|
|
90571
90622
|
return;
|
|
90572
90623
|
}
|