@ericchen1990/pano-view 2.4.0 → 2.5.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/README.md +63 -61
- package/README.zh-CN.md +63 -61
- package/dist/index.cjs +356 -271
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.mjs +230 -146
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2296,6 +2296,7 @@ __export(index_exports, {
|
|
|
2296
2296
|
resolvePanoContextMenuEntries: () => resolvePanoContextMenuEntries,
|
|
2297
2297
|
unwrapPolygonVertices: () => unwrapPolygonVertices,
|
|
2298
2298
|
usePanoEvents: () => usePanoEvents,
|
|
2299
|
+
usePanoViewer: () => usePanoViewer,
|
|
2299
2300
|
validatePolygonVertices: () => validatePolygonVertices,
|
|
2300
2301
|
validatePolylineVertices: () => validatePolylineVertices,
|
|
2301
2302
|
vector3ToPanoPosition: () => vector3ToPanoPosition
|
|
@@ -9160,9 +9161,92 @@ var WebVR = (0, import_react32.forwardRef)(function WebVR2({
|
|
|
9160
9161
|
] });
|
|
9161
9162
|
});
|
|
9162
9163
|
|
|
9164
|
+
// src/use-pano-viewer.ts
|
|
9165
|
+
var import_react33 = require("react");
|
|
9166
|
+
function createPanoViewerHandle(ref) {
|
|
9167
|
+
return {
|
|
9168
|
+
getView: () => ref.current?.getView() ?? { yaw: 0, pitch: 0, fov: 75 },
|
|
9169
|
+
setView: (view, options) => {
|
|
9170
|
+
ref.current?.setView(view, options);
|
|
9171
|
+
},
|
|
9172
|
+
reset: () => {
|
|
9173
|
+
ref.current?.reset();
|
|
9174
|
+
},
|
|
9175
|
+
enterFullscreen: () => ref.current?.enterFullscreen() ?? Promise.resolve(),
|
|
9176
|
+
exitFullscreen: () => ref.current?.exitFullscreen() ?? Promise.resolve(),
|
|
9177
|
+
toggleFullscreen: () => ref.current?.toggleFullscreen() ?? Promise.resolve(),
|
|
9178
|
+
isFullscreen: () => ref.current?.isFullscreen() ?? false,
|
|
9179
|
+
setScene: (id) => ref.current?.setScene(id) ?? false,
|
|
9180
|
+
nextScene: () => ref.current?.nextScene() ?? false,
|
|
9181
|
+
previousScene: () => ref.current?.previousScene() ?? false,
|
|
9182
|
+
getActiveSceneId: () => ref.current?.getActiveSceneId() ?? null,
|
|
9183
|
+
getSceneIds: () => ref.current?.getSceneIds() ?? [],
|
|
9184
|
+
isSceneTransitioning: () => ref.current?.isSceneTransitioning() ?? false,
|
|
9185
|
+
enterVR: () => ref.current?.enterVR() ?? Promise.resolve(false),
|
|
9186
|
+
exitVR: () => ref.current?.exitVR() ?? Promise.resolve(),
|
|
9187
|
+
toggleVR: () => ref.current?.toggleVR() ?? Promise.resolve(false),
|
|
9188
|
+
isVRAvailable: () => ref.current?.isVRAvailable() ?? false,
|
|
9189
|
+
isVREnabled: () => ref.current?.isVREnabled() ?? false,
|
|
9190
|
+
getVRMode: () => ref.current?.getVRMode() ?? null,
|
|
9191
|
+
requestVRPermission: () => ref.current?.requestVRPermission() ?? Promise.resolve(false),
|
|
9192
|
+
getVideo: () => ref.current?.getVideo() ?? null,
|
|
9193
|
+
subscribeVideo: (onStoreChange) => ref.current?.subscribeVideo(onStoreChange) ?? (() => {
|
|
9194
|
+
}),
|
|
9195
|
+
playVideo: () => ref.current?.playVideo() ?? Promise.resolve(),
|
|
9196
|
+
pauseVideo: () => {
|
|
9197
|
+
ref.current?.pauseVideo();
|
|
9198
|
+
},
|
|
9199
|
+
toggleVideo: () => {
|
|
9200
|
+
ref.current?.toggleVideo();
|
|
9201
|
+
},
|
|
9202
|
+
seekVideo: (time) => {
|
|
9203
|
+
ref.current?.seekVideo(time);
|
|
9204
|
+
},
|
|
9205
|
+
setVideoVolume: (volume) => {
|
|
9206
|
+
ref.current?.setVideoVolume(volume);
|
|
9207
|
+
},
|
|
9208
|
+
setVideoMuted: (muted) => {
|
|
9209
|
+
ref.current?.setVideoMuted(muted);
|
|
9210
|
+
},
|
|
9211
|
+
toggleVideoMuted: () => {
|
|
9212
|
+
ref.current?.toggleVideoMuted();
|
|
9213
|
+
},
|
|
9214
|
+
getBackgroundAudio: () => ref.current?.getBackgroundAudio() ?? null,
|
|
9215
|
+
subscribeBackgroundAudio: (onStoreChange) => ref.current?.subscribeBackgroundAudio(onStoreChange) ?? (() => {
|
|
9216
|
+
}),
|
|
9217
|
+
playBackgroundAudio: () => ref.current?.playBackgroundAudio() ?? Promise.resolve(),
|
|
9218
|
+
pauseBackgroundAudio: () => {
|
|
9219
|
+
ref.current?.pauseBackgroundAudio();
|
|
9220
|
+
},
|
|
9221
|
+
toggleBackgroundAudio: () => {
|
|
9222
|
+
ref.current?.toggleBackgroundAudio();
|
|
9223
|
+
},
|
|
9224
|
+
setBackgroundAudioVolume: (volume) => {
|
|
9225
|
+
ref.current?.setBackgroundAudioVolume(volume);
|
|
9226
|
+
},
|
|
9227
|
+
setBackgroundAudioMuted: (muted) => {
|
|
9228
|
+
ref.current?.setBackgroundAudioMuted(muted);
|
|
9229
|
+
},
|
|
9230
|
+
toggleBackgroundAudioMuted: () => {
|
|
9231
|
+
ref.current?.toggleBackgroundAudioMuted();
|
|
9232
|
+
},
|
|
9233
|
+
startAutoRotate: () => {
|
|
9234
|
+
ref.current?.startAutoRotate();
|
|
9235
|
+
},
|
|
9236
|
+
stopAutoRotate: () => {
|
|
9237
|
+
ref.current?.stopAutoRotate();
|
|
9238
|
+
}
|
|
9239
|
+
};
|
|
9240
|
+
}
|
|
9241
|
+
function usePanoViewer() {
|
|
9242
|
+
const ref = (0, import_react33.useRef)(null);
|
|
9243
|
+
const handle = (0, import_react33.useMemo)(() => createPanoViewerHandle(ref), []);
|
|
9244
|
+
return (0, import_react33.useMemo)(() => ({ ref, ...handle }), [handle]);
|
|
9245
|
+
}
|
|
9246
|
+
|
|
9163
9247
|
// src/sphere.tsx
|
|
9164
9248
|
var import_fiber15 = require("@react-three/fiber");
|
|
9165
|
-
var
|
|
9249
|
+
var import_react35 = require("react");
|
|
9166
9250
|
var import_three10 = require("three");
|
|
9167
9251
|
|
|
9168
9252
|
// src/asset-url.ts
|
|
@@ -9187,7 +9271,7 @@ function resolveUrlAgainstFile(fileUrl, path) {
|
|
|
9187
9271
|
}
|
|
9188
9272
|
|
|
9189
9273
|
// src/pano-filter/pano-basic-material.tsx
|
|
9190
|
-
var
|
|
9274
|
+
var import_react34 = require("react");
|
|
9191
9275
|
|
|
9192
9276
|
// src/pano-filter/shaders.ts
|
|
9193
9277
|
var GLSL_FILTER_COMMON = `
|
|
@@ -9347,13 +9431,13 @@ function PanoBasicMaterial({
|
|
|
9347
9431
|
toneMapped = false
|
|
9348
9432
|
}) {
|
|
9349
9433
|
const snapshot = usePanoFilterSnapshot();
|
|
9350
|
-
const materialRef = (0,
|
|
9351
|
-
const intensityRef = (0,
|
|
9352
|
-
const intensityUniformRef = (0,
|
|
9434
|
+
const materialRef = (0, import_react34.useRef)(null);
|
|
9435
|
+
const intensityRef = (0, import_react34.useRef)(snapshot.intensity);
|
|
9436
|
+
const intensityUniformRef = (0, import_react34.useRef)(null);
|
|
9353
9437
|
intensityRef.current = snapshot.intensity;
|
|
9354
9438
|
const active = isPanoFilterActive(snapshot);
|
|
9355
9439
|
const preset = snapshot.preset;
|
|
9356
|
-
const onBeforeCompile = (0,
|
|
9440
|
+
const onBeforeCompile = (0, import_react34.useMemo)(() => {
|
|
9357
9441
|
if (!active || preset === "none") {
|
|
9358
9442
|
return void 0;
|
|
9359
9443
|
}
|
|
@@ -9370,7 +9454,7 @@ function PanoBasicMaterial({
|
|
|
9370
9454
|
compile.toString = () => `pano-filter:${preset}`;
|
|
9371
9455
|
return compile;
|
|
9372
9456
|
}, [active, preset]);
|
|
9373
|
-
(0,
|
|
9457
|
+
(0, import_react34.useLayoutEffect)(() => {
|
|
9374
9458
|
if (!active) {
|
|
9375
9459
|
intensityUniformRef.current = null;
|
|
9376
9460
|
}
|
|
@@ -9380,7 +9464,7 @@ function PanoBasicMaterial({
|
|
|
9380
9464
|
}
|
|
9381
9465
|
material.needsUpdate = true;
|
|
9382
9466
|
}, [active, preset]);
|
|
9383
|
-
(0,
|
|
9467
|
+
(0, import_react34.useLayoutEffect)(() => {
|
|
9384
9468
|
if (intensityUniformRef.current) {
|
|
9385
9469
|
intensityUniformRef.current.value = snapshot.intensity;
|
|
9386
9470
|
}
|
|
@@ -9403,12 +9487,12 @@ function PanoBasicMaterial({
|
|
|
9403
9487
|
// src/sphere.tsx
|
|
9404
9488
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
9405
9489
|
function useEquirectTexture(url, anisotropy, generateMipmaps, onLoad, onError) {
|
|
9406
|
-
const [texture, setTexture] = (0,
|
|
9407
|
-
const onLoadRef = (0,
|
|
9408
|
-
const onErrorRef = (0,
|
|
9490
|
+
const [texture, setTexture] = (0, import_react35.useState)(null);
|
|
9491
|
+
const onLoadRef = (0, import_react35.useRef)(onLoad);
|
|
9492
|
+
const onErrorRef = (0, import_react35.useRef)(onError);
|
|
9409
9493
|
onLoadRef.current = onLoad;
|
|
9410
9494
|
onErrorRef.current = onError;
|
|
9411
|
-
(0,
|
|
9495
|
+
(0, import_react35.useEffect)(() => {
|
|
9412
9496
|
if (!url) {
|
|
9413
9497
|
setTexture(null);
|
|
9414
9498
|
return;
|
|
@@ -9447,7 +9531,7 @@ function useEquirectTexture(url, anisotropy, generateMipmaps, onLoad, onError) {
|
|
|
9447
9531
|
active = false;
|
|
9448
9532
|
};
|
|
9449
9533
|
}, [anisotropy, generateMipmaps, url]);
|
|
9450
|
-
(0,
|
|
9534
|
+
(0, import_react35.useEffect)(
|
|
9451
9535
|
() => () => {
|
|
9452
9536
|
texture?.dispose();
|
|
9453
9537
|
},
|
|
@@ -9467,7 +9551,7 @@ function Sphere({
|
|
|
9467
9551
|
}) {
|
|
9468
9552
|
const gl = (0, import_fiber15.useThree)((state) => state.gl);
|
|
9469
9553
|
const anisotropy = gl.capabilities.getMaxAnisotropy();
|
|
9470
|
-
const resolvedPreviewUrl = (0,
|
|
9554
|
+
const resolvedPreviewUrl = (0, import_react35.useMemo)(
|
|
9471
9555
|
() => resolveUrlAgainstFile(src, previewUrl),
|
|
9472
9556
|
[previewUrl, src]
|
|
9473
9557
|
);
|
|
@@ -9486,11 +9570,11 @@ function Sphere({
|
|
|
9486
9570
|
onPreviewError
|
|
9487
9571
|
);
|
|
9488
9572
|
const displayTexture = texture ?? previewTexture;
|
|
9489
|
-
const readyRef = (0,
|
|
9490
|
-
(0,
|
|
9573
|
+
const readyRef = (0, import_react35.useRef)(false);
|
|
9574
|
+
(0, import_react35.useEffect)(() => {
|
|
9491
9575
|
readyRef.current = false;
|
|
9492
9576
|
}, [resolvedPreviewUrl, src]);
|
|
9493
|
-
(0,
|
|
9577
|
+
(0, import_react35.useEffect)(() => {
|
|
9494
9578
|
if (!displayTexture || readyRef.current) {
|
|
9495
9579
|
return;
|
|
9496
9580
|
}
|
|
@@ -9522,7 +9606,7 @@ function Sphere({
|
|
|
9522
9606
|
|
|
9523
9607
|
// src/video/pano-video.tsx
|
|
9524
9608
|
var import_fiber16 = require("@react-three/fiber");
|
|
9525
|
-
var
|
|
9609
|
+
var import_react36 = require("react");
|
|
9526
9610
|
var import_three11 = require("three");
|
|
9527
9611
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
9528
9612
|
var EMPTY_TRACKS = [];
|
|
@@ -9609,10 +9693,10 @@ function applyEquirectangularLayout(texture, anisotropy) {
|
|
|
9609
9693
|
}
|
|
9610
9694
|
function usePosterTexture(poster, onError) {
|
|
9611
9695
|
const gl = (0, import_fiber16.useThree)((state) => state.gl);
|
|
9612
|
-
const [texture, setTexture] = (0,
|
|
9613
|
-
const onErrorRef = (0,
|
|
9696
|
+
const [texture, setTexture] = (0, import_react36.useState)(null);
|
|
9697
|
+
const onErrorRef = (0, import_react36.useRef)(onError);
|
|
9614
9698
|
onErrorRef.current = onError;
|
|
9615
|
-
(0,
|
|
9699
|
+
(0, import_react36.useEffect)(() => {
|
|
9616
9700
|
let active = true;
|
|
9617
9701
|
setTexture(null);
|
|
9618
9702
|
if (!poster) {
|
|
@@ -9649,7 +9733,7 @@ function usePosterTexture(poster, onError) {
|
|
|
9649
9733
|
active = false;
|
|
9650
9734
|
};
|
|
9651
9735
|
}, [gl, poster]);
|
|
9652
|
-
(0,
|
|
9736
|
+
(0, import_react36.useEffect)(
|
|
9653
9737
|
() => () => {
|
|
9654
9738
|
texture?.dispose();
|
|
9655
9739
|
},
|
|
@@ -9707,38 +9791,38 @@ function PanoVideo({
|
|
|
9707
9791
|
onTrackChange
|
|
9708
9792
|
}) {
|
|
9709
9793
|
const gl = (0, import_fiber16.useThree)((state) => state.gl);
|
|
9710
|
-
const host = (0,
|
|
9711
|
-
const overlay = (0,
|
|
9712
|
-
const variants = (0,
|
|
9794
|
+
const host = (0, import_react36.useContext)(PanoVideoHostContext);
|
|
9795
|
+
const overlay = (0, import_react36.useContext)(PanoChromeOverlayContext);
|
|
9796
|
+
const variants = (0, import_react36.useMemo)(
|
|
9713
9797
|
() => resolvePanoVideoVariants({ poster, src, variants: variantsProp }),
|
|
9714
9798
|
[poster, src, variantsProp]
|
|
9715
9799
|
);
|
|
9716
9800
|
const tracks = tracksProp ?? EMPTY_TRACKS;
|
|
9717
9801
|
const captionsEnabled = captions !== false;
|
|
9718
|
-
const captionAppearance = (0,
|
|
9802
|
+
const captionAppearance = (0, import_react36.useMemo)(
|
|
9719
9803
|
() => resolvePanoVideoCaptionAppearance(
|
|
9720
9804
|
typeof captions === "object" ? captions : void 0
|
|
9721
9805
|
),
|
|
9722
9806
|
[captions]
|
|
9723
9807
|
);
|
|
9724
|
-
const [variantId, setVariantId] = (0,
|
|
9808
|
+
const [variantId, setVariantId] = (0, import_react36.useState)(
|
|
9725
9809
|
() => resolvePanoVideoVariantId(variants, defaultVariantId)
|
|
9726
9810
|
);
|
|
9727
|
-
const [trackId, setTrackId] = (0,
|
|
9811
|
+
const [trackId, setTrackId] = (0, import_react36.useState)(
|
|
9728
9812
|
() => captionsEnabled ? defaultPanoVideoTrackId(tracks) : null
|
|
9729
9813
|
);
|
|
9730
|
-
const [ready, setReady] = (0,
|
|
9731
|
-
const autoPlayRef = (0,
|
|
9814
|
+
const [ready, setReady] = (0, import_react36.useState)(false);
|
|
9815
|
+
const autoPlayRef = (0, import_react36.useRef)(autoPlay);
|
|
9732
9816
|
autoPlayRef.current = autoPlay;
|
|
9733
|
-
const blockedRef = (0,
|
|
9734
|
-
const captionAppearanceOverrideRef = (0,
|
|
9817
|
+
const blockedRef = (0, import_react36.useRef)(false);
|
|
9818
|
+
const captionAppearanceOverrideRef = (0, import_react36.useRef)(
|
|
9735
9819
|
{}
|
|
9736
9820
|
);
|
|
9737
|
-
const mediaCapabilitiesRef = (0,
|
|
9821
|
+
const mediaCapabilitiesRef = (0, import_react36.useRef)({
|
|
9738
9822
|
volumeAdjustable: true,
|
|
9739
9823
|
playbackRates: [...DEFAULT_PANO_VIDEO_PLAYBACK_RATES]
|
|
9740
9824
|
});
|
|
9741
|
-
const storeRef = (0,
|
|
9825
|
+
const storeRef = (0, import_react36.useRef)(null);
|
|
9742
9826
|
if (!storeRef.current) {
|
|
9743
9827
|
storeRef.current = {
|
|
9744
9828
|
snapshot: {
|
|
@@ -9748,7 +9832,7 @@ function PanoVideo({
|
|
|
9748
9832
|
listeners: /* @__PURE__ */ new Set()
|
|
9749
9833
|
};
|
|
9750
9834
|
}
|
|
9751
|
-
const actionsRef = (0,
|
|
9835
|
+
const actionsRef = (0, import_react36.useRef)({
|
|
9752
9836
|
play: async () => {
|
|
9753
9837
|
},
|
|
9754
9838
|
pause: () => {
|
|
@@ -9768,19 +9852,19 @@ function PanoVideo({
|
|
|
9768
9852
|
setCaptionAppearance: (_appearance) => {
|
|
9769
9853
|
}
|
|
9770
9854
|
});
|
|
9771
|
-
const onLoadRef = (0,
|
|
9772
|
-
const onErrorRef = (0,
|
|
9773
|
-
const onPlaybackStateChangeRef = (0,
|
|
9774
|
-
const onEndedRef = (0,
|
|
9775
|
-
const onVariantChangeRef = (0,
|
|
9776
|
-
const onTrackChangeRef = (0,
|
|
9855
|
+
const onLoadRef = (0, import_react36.useRef)(onLoad);
|
|
9856
|
+
const onErrorRef = (0, import_react36.useRef)(onError);
|
|
9857
|
+
const onPlaybackStateChangeRef = (0, import_react36.useRef)(onPlaybackStateChange);
|
|
9858
|
+
const onEndedRef = (0, import_react36.useRef)(onEnded);
|
|
9859
|
+
const onVariantChangeRef = (0, import_react36.useRef)(onVariantChange);
|
|
9860
|
+
const onTrackChangeRef = (0, import_react36.useRef)(onTrackChange);
|
|
9777
9861
|
onLoadRef.current = onLoad;
|
|
9778
9862
|
onErrorRef.current = onError;
|
|
9779
9863
|
onPlaybackStateChangeRef.current = onPlaybackStateChange;
|
|
9780
9864
|
onEndedRef.current = onEnded;
|
|
9781
9865
|
onVariantChangeRef.current = onVariantChange;
|
|
9782
9866
|
onTrackChangeRef.current = onTrackChange;
|
|
9783
|
-
const resource = (0,
|
|
9867
|
+
const resource = (0, import_react36.useMemo)(() => {
|
|
9784
9868
|
if (typeof document === "undefined") {
|
|
9785
9869
|
return null;
|
|
9786
9870
|
}
|
|
@@ -9797,7 +9881,7 @@ function PanoVideo({
|
|
|
9797
9881
|
texture.generateMipmaps = false;
|
|
9798
9882
|
return { video, texture };
|
|
9799
9883
|
}, []);
|
|
9800
|
-
(0,
|
|
9884
|
+
(0, import_react36.useEffect)(
|
|
9801
9885
|
() => () => {
|
|
9802
9886
|
if (!resource) {
|
|
9803
9887
|
return;
|
|
@@ -9812,13 +9896,13 @@ function PanoVideo({
|
|
|
9812
9896
|
},
|
|
9813
9897
|
[resource]
|
|
9814
9898
|
);
|
|
9815
|
-
(0,
|
|
9899
|
+
(0, import_react36.useEffect)(() => {
|
|
9816
9900
|
if (!resource) {
|
|
9817
9901
|
return;
|
|
9818
9902
|
}
|
|
9819
9903
|
resource.texture.anisotropy = gl.capabilities.getMaxAnisotropy();
|
|
9820
9904
|
}, [gl, resource]);
|
|
9821
|
-
(0,
|
|
9905
|
+
(0, import_react36.useEffect)(() => {
|
|
9822
9906
|
if (!resource || !overlay?.overlayElement) {
|
|
9823
9907
|
return;
|
|
9824
9908
|
}
|
|
@@ -9841,7 +9925,7 @@ function PanoVideo({
|
|
|
9841
9925
|
activeVariant?.poster ?? poster,
|
|
9842
9926
|
onError
|
|
9843
9927
|
);
|
|
9844
|
-
const emitSnapshot = (0,
|
|
9928
|
+
const emitSnapshot = (0, import_react36.useCallback)(
|
|
9845
9929
|
(patch) => {
|
|
9846
9930
|
const store = storeRef.current;
|
|
9847
9931
|
const video = resource?.video;
|
|
@@ -9893,7 +9977,7 @@ function PanoVideo({
|
|
|
9893
9977
|
captionAppearance
|
|
9894
9978
|
]
|
|
9895
9979
|
);
|
|
9896
|
-
const controller = (0,
|
|
9980
|
+
const controller = (0, import_react36.useMemo)(
|
|
9897
9981
|
() => ({
|
|
9898
9982
|
subscribe: (onStoreChange) => {
|
|
9899
9983
|
const store = storeRef.current;
|
|
@@ -9945,7 +10029,7 @@ function PanoVideo({
|
|
|
9945
10029
|
}),
|
|
9946
10030
|
[]
|
|
9947
10031
|
);
|
|
9948
|
-
(0,
|
|
10032
|
+
(0, import_react36.useLayoutEffect)(() => {
|
|
9949
10033
|
if (!host || variants.length === 0) {
|
|
9950
10034
|
return;
|
|
9951
10035
|
}
|
|
@@ -9958,7 +10042,7 @@ function PanoVideo({
|
|
|
9958
10042
|
notifyPanoVideoHost(host);
|
|
9959
10043
|
};
|
|
9960
10044
|
}, [captionsEnabled, controller, controls, host, variants.length]);
|
|
9961
|
-
(0,
|
|
10045
|
+
(0, import_react36.useLayoutEffect)(() => {
|
|
9962
10046
|
if (!resource) {
|
|
9963
10047
|
return;
|
|
9964
10048
|
}
|
|
@@ -9971,10 +10055,10 @@ function PanoVideo({
|
|
|
9971
10055
|
};
|
|
9972
10056
|
emitSnapshot();
|
|
9973
10057
|
}, [emitSnapshot, playbackRates, resource]);
|
|
9974
|
-
(0,
|
|
10058
|
+
(0, import_react36.useEffect)(() => {
|
|
9975
10059
|
emitSnapshot();
|
|
9976
10060
|
}, [emitSnapshot]);
|
|
9977
|
-
(0,
|
|
10061
|
+
(0, import_react36.useEffect)(() => {
|
|
9978
10062
|
if (!resource || !activeVariant || !mediaKey) {
|
|
9979
10063
|
return;
|
|
9980
10064
|
}
|
|
@@ -10031,7 +10115,7 @@ function PanoVideo({
|
|
|
10031
10115
|
video.removeEventListener("error", handleError);
|
|
10032
10116
|
};
|
|
10033
10117
|
}, [mediaKey, resource]);
|
|
10034
|
-
(0,
|
|
10118
|
+
(0, import_react36.useEffect)(() => {
|
|
10035
10119
|
if (!resource) {
|
|
10036
10120
|
return;
|
|
10037
10121
|
}
|
|
@@ -10121,7 +10205,7 @@ function PanoVideo({
|
|
|
10121
10205
|
}
|
|
10122
10206
|
};
|
|
10123
10207
|
}, [emitSnapshot, resource]);
|
|
10124
|
-
(0,
|
|
10208
|
+
(0, import_react36.useEffect)(() => {
|
|
10125
10209
|
if (!resource) {
|
|
10126
10210
|
return;
|
|
10127
10211
|
}
|
|
@@ -10134,7 +10218,7 @@ function PanoVideo({
|
|
|
10134
10218
|
video.playsInline = playsInline;
|
|
10135
10219
|
video.preload = preload;
|
|
10136
10220
|
}, [loop, muted, playsInline, preload, resource, volume]);
|
|
10137
|
-
(0,
|
|
10221
|
+
(0, import_react36.useEffect)(() => {
|
|
10138
10222
|
if (!resource) {
|
|
10139
10223
|
return;
|
|
10140
10224
|
}
|
|
@@ -10184,7 +10268,7 @@ function PanoVideo({
|
|
|
10184
10268
|
video.removeEventListener("ratechange", handleVolume);
|
|
10185
10269
|
};
|
|
10186
10270
|
}, [emitSnapshot, resource]);
|
|
10187
|
-
(0,
|
|
10271
|
+
(0, import_react36.useEffect)(() => {
|
|
10188
10272
|
if (!resource) {
|
|
10189
10273
|
return;
|
|
10190
10274
|
}
|
|
@@ -10219,7 +10303,7 @@ function PanoVideo({
|
|
|
10219
10303
|
video.textTracks.removeEventListener("change", applyModes);
|
|
10220
10304
|
};
|
|
10221
10305
|
}, [emitSnapshot, resource, trackId, tracks]);
|
|
10222
|
-
(0,
|
|
10306
|
+
(0, import_react36.useEffect)(() => {
|
|
10223
10307
|
if (!captionsEnabled) {
|
|
10224
10308
|
setTrackId(null);
|
|
10225
10309
|
return;
|
|
@@ -10255,7 +10339,7 @@ function PanoVideo({
|
|
|
10255
10339
|
|
|
10256
10340
|
// src/scenes.tsx
|
|
10257
10341
|
var import_fiber21 = require("@react-three/fiber");
|
|
10258
|
-
var
|
|
10342
|
+
var import_react41 = require("react");
|
|
10259
10343
|
var import_three19 = require("three");
|
|
10260
10344
|
|
|
10261
10345
|
// src/scene-transitions/presets.ts
|
|
@@ -10306,7 +10390,7 @@ function isSnapshotTransition(preset) {
|
|
|
10306
10390
|
|
|
10307
10391
|
// src/scene-transitions/particle-overlay.tsx
|
|
10308
10392
|
var import_fiber17 = require("@react-three/fiber");
|
|
10309
|
-
var
|
|
10393
|
+
var import_react37 = require("react");
|
|
10310
10394
|
var import_three13 = require("three");
|
|
10311
10395
|
|
|
10312
10396
|
// src/scene-transitions/glsl.ts
|
|
@@ -10438,12 +10522,12 @@ function ParticleOverlay({
|
|
|
10438
10522
|
onFinish
|
|
10439
10523
|
}) {
|
|
10440
10524
|
const { camera } = (0, import_fiber17.useThree)();
|
|
10441
|
-
const meshRef = (0,
|
|
10442
|
-
const startRef = (0,
|
|
10443
|
-
const finishedRef = (0,
|
|
10444
|
-
const directionRef = (0,
|
|
10445
|
-
const geometry = (0,
|
|
10446
|
-
const material = (0,
|
|
10525
|
+
const meshRef = (0, import_react37.useRef)(null);
|
|
10526
|
+
const startRef = (0, import_react37.useRef)(null);
|
|
10527
|
+
const finishedRef = (0, import_react37.useRef)(false);
|
|
10528
|
+
const directionRef = (0, import_react37.useRef)(new import_three13.Vector3());
|
|
10529
|
+
const geometry = (0, import_react37.useMemo)(() => createParticleGeometry(), []);
|
|
10530
|
+
const material = (0, import_react37.useMemo)(
|
|
10447
10531
|
() => new import_three13.ShaderMaterial({
|
|
10448
10532
|
transparent: true,
|
|
10449
10533
|
depthTest: false,
|
|
@@ -10459,9 +10543,9 @@ function ParticleOverlay({
|
|
|
10459
10543
|
}),
|
|
10460
10544
|
[snapshot.texture]
|
|
10461
10545
|
);
|
|
10462
|
-
(0,
|
|
10463
|
-
(0,
|
|
10464
|
-
(0,
|
|
10546
|
+
(0, import_react37.useEffect)(() => () => geometry.dispose(), [geometry]);
|
|
10547
|
+
(0, import_react37.useEffect)(() => () => material.dispose(), [material]);
|
|
10548
|
+
(0, import_react37.useEffect)(() => {
|
|
10465
10549
|
startRef.current = null;
|
|
10466
10550
|
finishedRef.current = false;
|
|
10467
10551
|
material.uniforms.progress.value = 0;
|
|
@@ -10497,7 +10581,7 @@ function ParticleOverlay({
|
|
|
10497
10581
|
|
|
10498
10582
|
// src/scene-transitions/snapshot-overlay.tsx
|
|
10499
10583
|
var import_fiber18 = require("@react-three/fiber");
|
|
10500
|
-
var
|
|
10584
|
+
var import_react38 = require("react");
|
|
10501
10585
|
var import_three15 = require("three");
|
|
10502
10586
|
|
|
10503
10587
|
// src/scene-transitions/snapshot-shaders.ts
|
|
@@ -10786,18 +10870,18 @@ function SnapshotOverlay({
|
|
|
10786
10870
|
onFinish
|
|
10787
10871
|
}) {
|
|
10788
10872
|
const { camera, gl } = (0, import_fiber18.useThree)();
|
|
10789
|
-
const meshRef = (0,
|
|
10790
|
-
const startRef = (0,
|
|
10791
|
-
const finishedRef = (0,
|
|
10792
|
-
const directionRef = (0,
|
|
10793
|
-
const material = (0,
|
|
10873
|
+
const meshRef = (0, import_react38.useRef)(null);
|
|
10874
|
+
const startRef = (0, import_react38.useRef)(null);
|
|
10875
|
+
const finishedRef = (0, import_react38.useRef)(false);
|
|
10876
|
+
const directionRef = (0, import_react38.useRef)(new import_three15.Vector3());
|
|
10877
|
+
const material = (0, import_react38.useMemo)(() => {
|
|
10794
10878
|
if (!isSnapshotTransition(transition.preset)) {
|
|
10795
10879
|
return null;
|
|
10796
10880
|
}
|
|
10797
10881
|
return createSnapshotMaterial(transition.preset, snapshot.texture);
|
|
10798
10882
|
}, [snapshot.texture, transition.preset]);
|
|
10799
|
-
(0,
|
|
10800
|
-
(0,
|
|
10883
|
+
(0, import_react38.useEffect)(() => () => material?.dispose(), [material]);
|
|
10884
|
+
(0, import_react38.useEffect)(() => {
|
|
10801
10885
|
startRef.current = null;
|
|
10802
10886
|
finishedRef.current = false;
|
|
10803
10887
|
if (material) {
|
|
@@ -10879,7 +10963,7 @@ function TransitionOverlay(props) {
|
|
|
10879
10963
|
|
|
10880
10964
|
// src/tile/texture-manager-context.tsx
|
|
10881
10965
|
var import_fiber19 = require("@react-three/fiber");
|
|
10882
|
-
var
|
|
10966
|
+
var import_react39 = require("react");
|
|
10883
10967
|
|
|
10884
10968
|
// src/tile/texture-manager.ts
|
|
10885
10969
|
var import_three16 = require("three");
|
|
@@ -11104,7 +11188,7 @@ var TileTextureManager = class {
|
|
|
11104
11188
|
|
|
11105
11189
|
// src/tile/texture-manager-context.tsx
|
|
11106
11190
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
11107
|
-
var TileTextureManagerContext = (0,
|
|
11191
|
+
var TileTextureManagerContext = (0, import_react39.createContext)(
|
|
11108
11192
|
null
|
|
11109
11193
|
);
|
|
11110
11194
|
function TileTextureManagerProvider({
|
|
@@ -11114,7 +11198,7 @@ function TileTextureManagerProvider({
|
|
|
11114
11198
|
}) {
|
|
11115
11199
|
const gl = (0, import_fiber19.useThree)((state) => state.gl);
|
|
11116
11200
|
const anisotropy = gl.capabilities.getMaxAnisotropy();
|
|
11117
|
-
const manager = (0,
|
|
11201
|
+
const manager = (0, import_react39.useMemo)(
|
|
11118
11202
|
() => new TileTextureManager({
|
|
11119
11203
|
anisotropy,
|
|
11120
11204
|
maxBytes: Math.max(1, maxTextureMemoryMb) * 1024 * 1024,
|
|
@@ -11123,19 +11207,19 @@ function TileTextureManagerProvider({
|
|
|
11123
11207
|
}),
|
|
11124
11208
|
[anisotropy, maxConcurrentLoads, maxTextureMemoryMb]
|
|
11125
11209
|
);
|
|
11126
|
-
(0,
|
|
11210
|
+
(0, import_react39.useEffect)(() => {
|
|
11127
11211
|
manager.resume();
|
|
11128
11212
|
return () => manager.dispose();
|
|
11129
11213
|
}, [manager]);
|
|
11130
11214
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(TileTextureManagerContext.Provider, { value: manager, children });
|
|
11131
11215
|
}
|
|
11132
11216
|
function useSharedTileTextureManager() {
|
|
11133
|
-
return (0,
|
|
11217
|
+
return (0, import_react39.useContext)(TileTextureManagerContext);
|
|
11134
11218
|
}
|
|
11135
11219
|
|
|
11136
11220
|
// src/tile/tile.tsx
|
|
11137
11221
|
var import_fiber20 = require("@react-three/fiber");
|
|
11138
|
-
var
|
|
11222
|
+
var import_react40 = require("react");
|
|
11139
11223
|
var import_three18 = require("three");
|
|
11140
11224
|
|
|
11141
11225
|
// src/tile/face-layout.ts
|
|
@@ -11324,10 +11408,10 @@ var VISIBILITY_FOV_PADDING_DEGREES = 8;
|
|
|
11324
11408
|
var PREVIEW_RADIUS = CUBE_RADIUS + 0.05;
|
|
11325
11409
|
var SHARED_TILE_GEOMETRY = new import_three18.PlaneGeometry(1, 1);
|
|
11326
11410
|
function usePreviewTexture(url, anisotropy, onError) {
|
|
11327
|
-
const [texture, setTexture] = (0,
|
|
11328
|
-
const onErrorRef = (0,
|
|
11411
|
+
const [texture, setTexture] = (0, import_react40.useState)(null);
|
|
11412
|
+
const onErrorRef = (0, import_react40.useRef)(onError);
|
|
11329
11413
|
onErrorRef.current = onError;
|
|
11330
|
-
(0,
|
|
11414
|
+
(0, import_react40.useEffect)(() => {
|
|
11331
11415
|
if (!url) {
|
|
11332
11416
|
setTexture(null);
|
|
11333
11417
|
return;
|
|
@@ -11364,7 +11448,7 @@ function usePreviewTexture(url, anisotropy, onError) {
|
|
|
11364
11448
|
active = false;
|
|
11365
11449
|
};
|
|
11366
11450
|
}, [anisotropy, url]);
|
|
11367
|
-
(0,
|
|
11451
|
+
(0, import_react40.useEffect)(
|
|
11368
11452
|
() => () => {
|
|
11369
11453
|
texture?.dispose();
|
|
11370
11454
|
},
|
|
@@ -11377,7 +11461,7 @@ function PreviewFace({
|
|
|
11377
11461
|
texture,
|
|
11378
11462
|
faceOrder
|
|
11379
11463
|
}) {
|
|
11380
|
-
const geometry = (0,
|
|
11464
|
+
const geometry = (0, import_react40.useMemo)(() => {
|
|
11381
11465
|
const nextGeometry = new import_three18.PlaneGeometry(
|
|
11382
11466
|
PREVIEW_RADIUS * 2,
|
|
11383
11467
|
PREVIEW_RADIUS * 2
|
|
@@ -11395,7 +11479,7 @@ function PreviewFace({
|
|
|
11395
11479
|
uv.needsUpdate = true;
|
|
11396
11480
|
return nextGeometry;
|
|
11397
11481
|
}, [face, faceOrder]);
|
|
11398
|
-
(0,
|
|
11482
|
+
(0, import_react40.useEffect)(
|
|
11399
11483
|
() => () => {
|
|
11400
11484
|
geometry.dispose();
|
|
11401
11485
|
},
|
|
@@ -11436,14 +11520,14 @@ function PreviewCube({
|
|
|
11436
11520
|
));
|
|
11437
11521
|
}
|
|
11438
11522
|
function useManagedTexture(manager, key, url, address) {
|
|
11439
|
-
const [managedState, setManagedState] = (0,
|
|
11523
|
+
const [managedState, setManagedState] = (0, import_react40.useState)(() => ({
|
|
11440
11524
|
manager,
|
|
11441
11525
|
key,
|
|
11442
11526
|
url,
|
|
11443
11527
|
snapshot: manager.getSnapshot(key)
|
|
11444
11528
|
}));
|
|
11445
11529
|
const snapshot = managedState.manager === manager && managedState.key === key && managedState.url === url ? managedState.snapshot : manager.getSnapshot(key);
|
|
11446
|
-
(0,
|
|
11530
|
+
(0, import_react40.useEffect)(
|
|
11447
11531
|
() => manager.acquire(key, url, address, (nextSnapshot) => {
|
|
11448
11532
|
setManagedState({
|
|
11449
11533
|
manager,
|
|
@@ -11456,7 +11540,7 @@ function useManagedTexture(manager, key, url, address) {
|
|
|
11456
11540
|
);
|
|
11457
11541
|
return snapshot;
|
|
11458
11542
|
}
|
|
11459
|
-
var TileMesh = (0,
|
|
11543
|
+
var TileMesh = (0, import_react40.memo)(function TileMesh2({
|
|
11460
11544
|
address,
|
|
11461
11545
|
manager,
|
|
11462
11546
|
renderOrder,
|
|
@@ -11489,7 +11573,7 @@ var TileMesh = (0, import_react39.memo)(function TileMesh2({
|
|
|
11489
11573
|
}
|
|
11490
11574
|
) });
|
|
11491
11575
|
});
|
|
11492
|
-
var TileLayerMeshes = (0,
|
|
11576
|
+
var TileLayerMeshes = (0, import_react40.memo)(function TileLayerMeshes2({
|
|
11493
11577
|
layer,
|
|
11494
11578
|
manager,
|
|
11495
11579
|
resolveUrl
|
|
@@ -11663,10 +11747,10 @@ function Tile({
|
|
|
11663
11747
|
onLevelChange
|
|
11664
11748
|
}) {
|
|
11665
11749
|
const { camera, gl, size } = (0, import_fiber20.useThree)();
|
|
11666
|
-
const multiresConfig = (0,
|
|
11750
|
+
const multiresConfig = (0, import_react40.useMemo)(() => parseMultires(multires), [multires]);
|
|
11667
11751
|
const { levels, tileSize } = multiresConfig;
|
|
11668
11752
|
const multiresToken = `${tileSize}:${levels.join(",")}`;
|
|
11669
|
-
const candidatesByLevel = (0,
|
|
11753
|
+
const candidatesByLevel = (0, import_react40.useMemo)(
|
|
11670
11754
|
() => buildTileCandidates(levels, tileSize),
|
|
11671
11755
|
[levels, tileSize]
|
|
11672
11756
|
);
|
|
@@ -11678,13 +11762,13 @@ function Tile({
|
|
|
11678
11762
|
onPreviewError
|
|
11679
11763
|
);
|
|
11680
11764
|
const sharedManager = useSharedTileTextureManager();
|
|
11681
|
-
const progressRef = (0,
|
|
11682
|
-
const errorRef = (0,
|
|
11683
|
-
const levelChangeRef = (0,
|
|
11765
|
+
const progressRef = (0, import_react40.useRef)(onLoadProgress);
|
|
11766
|
+
const errorRef = (0, import_react40.useRef)(onTileError);
|
|
11767
|
+
const levelChangeRef = (0, import_react40.useRef)(onLevelChange);
|
|
11684
11768
|
progressRef.current = onLoadProgress;
|
|
11685
11769
|
errorRef.current = onTileError;
|
|
11686
11770
|
levelChangeRef.current = onLevelChange;
|
|
11687
|
-
const ownedManager = (0,
|
|
11771
|
+
const ownedManager = (0, import_react40.useMemo)(
|
|
11688
11772
|
() => new TileTextureManager({
|
|
11689
11773
|
anisotropy,
|
|
11690
11774
|
maxBytes: Math.max(1, maxTextureMemoryMb) * 1024 * 1024,
|
|
@@ -11705,7 +11789,7 @@ function Tile({
|
|
|
11705
11789
|
]
|
|
11706
11790
|
);
|
|
11707
11791
|
const manager = sharedManager ?? ownedManager;
|
|
11708
|
-
(0,
|
|
11792
|
+
(0, import_react40.useEffect)(() => {
|
|
11709
11793
|
manager.resume();
|
|
11710
11794
|
return () => {
|
|
11711
11795
|
if (manager === ownedManager) {
|
|
@@ -11715,11 +11799,11 @@ function Tile({
|
|
|
11715
11799
|
queueMicrotask(() => manager.releaseUnused());
|
|
11716
11800
|
};
|
|
11717
11801
|
}, [manager, ownedManager]);
|
|
11718
|
-
const readyRef = (0,
|
|
11719
|
-
(0,
|
|
11802
|
+
const readyRef = (0, import_react40.useRef)(false);
|
|
11803
|
+
(0, import_react40.useEffect)(() => {
|
|
11720
11804
|
readyRef.current = false;
|
|
11721
11805
|
}, [effectivePreviewUrl]);
|
|
11722
|
-
(0,
|
|
11806
|
+
(0, import_react40.useEffect)(() => {
|
|
11723
11807
|
if (!previewTexture || readyRef.current) {
|
|
11724
11808
|
return;
|
|
11725
11809
|
}
|
|
@@ -11727,31 +11811,31 @@ function Tile({
|
|
|
11727
11811
|
onReady?.();
|
|
11728
11812
|
}, [onReady, previewTexture]);
|
|
11729
11813
|
const template = urlTemplate ?? buildDefaultTileUrlTemplate();
|
|
11730
|
-
const resolveUrl = (0,
|
|
11814
|
+
const resolveUrl = (0, import_react40.useMemo)(
|
|
11731
11815
|
() => (address) => {
|
|
11732
11816
|
const relativePath = resolveTileUrl ? resolveTileUrl(address) : resolveTemplateUrl(template, address);
|
|
11733
11817
|
return resolveRelativeTileUrl(baseUrl, relativePath);
|
|
11734
11818
|
},
|
|
11735
11819
|
[baseUrl, resolveTileUrl, template]
|
|
11736
11820
|
);
|
|
11737
|
-
const [layers, setLayers] = (0,
|
|
11738
|
-
const layerTokenRef = (0,
|
|
11739
|
-
const currentLevelRef = (0,
|
|
11740
|
-
const lastUpdateAtRef = (0,
|
|
11741
|
-
const visibilityDirtyRef = (0,
|
|
11742
|
-
const lastVisibilityQuaternionRef = (0,
|
|
11743
|
-
const lastVisibilityFovRef = (0,
|
|
11744
|
-
const lastViewportRef = (0,
|
|
11745
|
-
const frustumRef = (0,
|
|
11746
|
-
const projectionMatrixRef = (0,
|
|
11747
|
-
const visibilityCameraRef = (0,
|
|
11748
|
-
(0,
|
|
11821
|
+
const [layers, setLayers] = (0, import_react40.useState)([]);
|
|
11822
|
+
const layerTokenRef = (0, import_react40.useRef)("");
|
|
11823
|
+
const currentLevelRef = (0, import_react40.useRef)(1);
|
|
11824
|
+
const lastUpdateAtRef = (0, import_react40.useRef)(-Infinity);
|
|
11825
|
+
const visibilityDirtyRef = (0, import_react40.useRef)(true);
|
|
11826
|
+
const lastVisibilityQuaternionRef = (0, import_react40.useRef)(camera.quaternion.clone());
|
|
11827
|
+
const lastVisibilityFovRef = (0, import_react40.useRef)(Number.NaN);
|
|
11828
|
+
const lastViewportRef = (0, import_react40.useRef)({ width: 0, height: 0, dpr: 0 });
|
|
11829
|
+
const frustumRef = (0, import_react40.useRef)(new import_three18.Frustum());
|
|
11830
|
+
const projectionMatrixRef = (0, import_react40.useRef)(new import_three18.Matrix4());
|
|
11831
|
+
const visibilityCameraRef = (0, import_react40.useRef)(new import_three18.PerspectiveCamera());
|
|
11832
|
+
(0, import_react40.useEffect)(() => {
|
|
11749
11833
|
currentLevelRef.current = 1;
|
|
11750
11834
|
layerTokenRef.current = "";
|
|
11751
11835
|
visibilityDirtyRef.current = true;
|
|
11752
11836
|
setLayers([]);
|
|
11753
11837
|
}, [manager, multiresToken]);
|
|
11754
|
-
(0,
|
|
11838
|
+
(0, import_react40.useEffect)(() => {
|
|
11755
11839
|
if (loadMode !== "preview") {
|
|
11756
11840
|
return;
|
|
11757
11841
|
}
|
|
@@ -11902,9 +11986,9 @@ function SnapshotCapture({
|
|
|
11902
11986
|
onCaptured
|
|
11903
11987
|
}) {
|
|
11904
11988
|
const { camera, gl, scene, size } = (0, import_fiber21.useThree)();
|
|
11905
|
-
const capturedRequestRef = (0,
|
|
11906
|
-
const renderTargetRef = (0,
|
|
11907
|
-
(0,
|
|
11989
|
+
const capturedRequestRef = (0, import_react41.useRef)(0);
|
|
11990
|
+
const renderTargetRef = (0, import_react41.useRef)(null);
|
|
11991
|
+
(0, import_react41.useEffect)(
|
|
11908
11992
|
() => () => {
|
|
11909
11993
|
renderTargetRef.current?.dispose();
|
|
11910
11994
|
renderTargetRef.current = null;
|
|
@@ -11960,50 +12044,50 @@ function ScenesController({
|
|
|
11960
12044
|
snapshotMaxPixels = 3686400,
|
|
11961
12045
|
phaseRef: externalPhaseRef
|
|
11962
12046
|
}) {
|
|
11963
|
-
const controlsRef = (0,
|
|
12047
|
+
const controlsRef = (0, import_react41.useContext)(PanoramaViewContext);
|
|
11964
12048
|
const manager = useSharedTileTextureManager();
|
|
11965
|
-
const transition = (0,
|
|
12049
|
+
const transition = (0, import_react41.useMemo)(
|
|
11966
12050
|
() => resolveTransition(transitionInput),
|
|
11967
12051
|
[transitionInput]
|
|
11968
12052
|
);
|
|
11969
|
-
const sceneMap = (0,
|
|
12053
|
+
const sceneMap = (0, import_react41.useMemo)(
|
|
11970
12054
|
() => new Map(scenes.map((scene) => [scene.id, scene])),
|
|
11971
12055
|
[scenes]
|
|
11972
12056
|
);
|
|
11973
12057
|
const initialScene = sceneMap.get(activeSceneId) ?? null;
|
|
11974
|
-
const [slots, setSlots] = (0,
|
|
12058
|
+
const [slots, setSlots] = (0, import_react41.useState)([
|
|
11975
12059
|
initialScene,
|
|
11976
12060
|
null
|
|
11977
12061
|
]);
|
|
11978
|
-
const [activeSlot, setActiveSlot] = (0,
|
|
11979
|
-
const [liveSlot, setLiveSlot] = (0,
|
|
11980
|
-
const [pendingSlot, setPendingSlot] = (0,
|
|
11981
|
-
const [phase, setPhase] = (0,
|
|
11982
|
-
const [captureRequestId, setCaptureRequestId] = (0,
|
|
11983
|
-
const [transitionRunId, setTransitionRunId] = (0,
|
|
11984
|
-
const [snapshot, setSnapshot] = (0,
|
|
11985
|
-
const [recoveryKey, setRecoveryKey] = (0,
|
|
11986
|
-
const requestedSceneIdRef = (0,
|
|
11987
|
-
const captureReasonRef = (0,
|
|
11988
|
-
const interactionReleaseRef = (0,
|
|
11989
|
-
const slotsRef = (0,
|
|
11990
|
-
const phaseRef = (0,
|
|
11991
|
-
const liveSlotRef = (0,
|
|
11992
|
-
const transitionFromRef = (0,
|
|
12062
|
+
const [activeSlot, setActiveSlot] = (0, import_react41.useState)(0);
|
|
12063
|
+
const [liveSlot, setLiveSlot] = (0, import_react41.useState)(0);
|
|
12064
|
+
const [pendingSlot, setPendingSlot] = (0, import_react41.useState)(null);
|
|
12065
|
+
const [phase, setPhase] = (0, import_react41.useState)(initialScene ? "idle" : "preloading");
|
|
12066
|
+
const [captureRequestId, setCaptureRequestId] = (0, import_react41.useState)(0);
|
|
12067
|
+
const [transitionRunId, setTransitionRunId] = (0, import_react41.useState)(0);
|
|
12068
|
+
const [snapshot, setSnapshot] = (0, import_react41.useState)(null);
|
|
12069
|
+
const [recoveryKey, setRecoveryKey] = (0, import_react41.useState)(0);
|
|
12070
|
+
const requestedSceneIdRef = (0, import_react41.useRef)(activeSceneId);
|
|
12071
|
+
const captureReasonRef = (0, import_react41.useRef)("start");
|
|
12072
|
+
const interactionReleaseRef = (0, import_react41.useRef)(null);
|
|
12073
|
+
const slotsRef = (0, import_react41.useRef)(slots);
|
|
12074
|
+
const phaseRef = (0, import_react41.useRef)(phase);
|
|
12075
|
+
const liveSlotRef = (0, import_react41.useRef)(liveSlot);
|
|
12076
|
+
const transitionFromRef = (0, import_react41.useRef)(initialScene);
|
|
11993
12077
|
slotsRef.current = slots;
|
|
11994
12078
|
phaseRef.current = phase;
|
|
11995
12079
|
if (externalPhaseRef) {
|
|
11996
12080
|
externalPhaseRef.current = phase;
|
|
11997
12081
|
}
|
|
11998
12082
|
liveSlotRef.current = liveSlot;
|
|
11999
|
-
const releaseInteraction = (0,
|
|
12083
|
+
const releaseInteraction = (0, import_react41.useCallback)(() => {
|
|
12000
12084
|
interactionReleaseRef.current?.();
|
|
12001
12085
|
interactionReleaseRef.current = null;
|
|
12002
12086
|
}, []);
|
|
12003
|
-
const reportError = (0,
|
|
12087
|
+
const reportError = (0, import_react41.useCallback)((sceneId, error) => {
|
|
12004
12088
|
onTransitionError?.({ sceneId, error });
|
|
12005
12089
|
}, [onTransitionError]);
|
|
12006
|
-
const startPreload = (0,
|
|
12090
|
+
const startPreload = (0, import_react41.useCallback)((scene) => {
|
|
12007
12091
|
const nextSlot = 1 - liveSlotRef.current;
|
|
12008
12092
|
requestedSceneIdRef.current = scene.id;
|
|
12009
12093
|
setSlots((current) => {
|
|
@@ -12014,7 +12098,7 @@ function ScenesController({
|
|
|
12014
12098
|
setPendingSlot(nextSlot);
|
|
12015
12099
|
setPhase("preloading");
|
|
12016
12100
|
}, []);
|
|
12017
|
-
(0,
|
|
12101
|
+
(0, import_react41.useEffect)(() => {
|
|
12018
12102
|
const requested = sceneMap.get(activeSceneId);
|
|
12019
12103
|
if (!requested) {
|
|
12020
12104
|
reportError(activeSceneId, new Error(`Unknown panorama scene: ${activeSceneId}`));
|
|
@@ -12038,7 +12122,7 @@ function ScenesController({
|
|
|
12038
12122
|
}
|
|
12039
12123
|
startPreload(requested);
|
|
12040
12124
|
}, [activeSceneId, pendingSlot, reportError, sceneMap, startPreload]);
|
|
12041
|
-
const handleReady = (0,
|
|
12125
|
+
const handleReady = (0, import_react41.useCallback)((slot) => {
|
|
12042
12126
|
if (slot !== pendingSlot || phaseRef.current !== "preloading") {
|
|
12043
12127
|
return;
|
|
12044
12128
|
}
|
|
@@ -12069,7 +12153,7 @@ function ScenesController({
|
|
|
12069
12153
|
setPhase("capturing");
|
|
12070
12154
|
setCaptureRequestId((current) => current + 1);
|
|
12071
12155
|
}, [controlsRef, onTransitionEnd, pendingSlot, transition.preset]);
|
|
12072
|
-
const handleCaptured = (0,
|
|
12156
|
+
const handleCaptured = (0, import_react41.useCallback)((nextSnapshot) => {
|
|
12073
12157
|
setSnapshot((current) => {
|
|
12074
12158
|
current?.dispose();
|
|
12075
12159
|
return nextSnapshot;
|
|
@@ -12091,7 +12175,7 @@ function ScenesController({
|
|
|
12091
12175
|
setPhase("transitioning");
|
|
12092
12176
|
setTransitionRunId((current) => current + 1);
|
|
12093
12177
|
}, [manager, pendingSlot, sceneMap, startPreload]);
|
|
12094
|
-
const finishTransition = (0,
|
|
12178
|
+
const finishTransition = (0, import_react41.useCallback)(() => {
|
|
12095
12179
|
const nextSlot = pendingSlot;
|
|
12096
12180
|
const previousScene = transitionFromRef.current;
|
|
12097
12181
|
const nextScene = nextSlot === null ? null : slotsRef.current[nextSlot];
|
|
@@ -12116,12 +12200,12 @@ function ScenesController({
|
|
|
12116
12200
|
});
|
|
12117
12201
|
}
|
|
12118
12202
|
}, [onTransitionEnd, pendingSlot, releaseInteraction, snapshot, transition.preset]);
|
|
12119
|
-
(0,
|
|
12203
|
+
(0, import_react41.useEffect)(() => () => {
|
|
12120
12204
|
releaseInteraction();
|
|
12121
12205
|
snapshot?.dispose();
|
|
12122
12206
|
}, [releaseInteraction, snapshot]);
|
|
12123
12207
|
const { gl } = (0, import_fiber21.useThree)();
|
|
12124
|
-
(0,
|
|
12208
|
+
(0, import_react41.useEffect)(() => {
|
|
12125
12209
|
const canvas = gl.domElement;
|
|
12126
12210
|
const onContextLost = (event) => {
|
|
12127
12211
|
event.preventDefault();
|
|
@@ -12145,7 +12229,7 @@ function ScenesController({
|
|
|
12145
12229
|
}, [gl, manager, releaseInteraction, snapshot]);
|
|
12146
12230
|
const renderedScene = slots[liveSlot];
|
|
12147
12231
|
const snapshotVisible = snapshot !== null && (phase === "transitioning" || phase === "recapturing" || phase === "preloading");
|
|
12148
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
12232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react41.Fragment, { children: [
|
|
12149
12233
|
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
12150
12234
|
SnapshotCapture,
|
|
12151
12235
|
{
|
|
@@ -12197,11 +12281,11 @@ function Scenes({
|
|
|
12197
12281
|
...rest
|
|
12198
12282
|
}) {
|
|
12199
12283
|
const isControlled = controlledId !== void 0;
|
|
12200
|
-
const [internalId, setInternalId] = (0,
|
|
12284
|
+
const [internalId, setInternalId] = (0, import_react41.useState)(
|
|
12201
12285
|
() => controlledId ?? defaultActiveSceneId ?? scenes[0]?.id ?? ""
|
|
12202
12286
|
);
|
|
12203
12287
|
const resolvedId = isControlled ? controlledId : internalId;
|
|
12204
|
-
const requestSceneChange = (0,
|
|
12288
|
+
const requestSceneChange = (0, import_react41.useCallback)(
|
|
12205
12289
|
(id) => {
|
|
12206
12290
|
if (isControlled) {
|
|
12207
12291
|
onActiveSceneIdChange?.(id);
|
|
@@ -12211,13 +12295,13 @@ function Scenes({
|
|
|
12211
12295
|
},
|
|
12212
12296
|
[isControlled, onActiveSceneIdChange]
|
|
12213
12297
|
);
|
|
12214
|
-
const scenesRef = (0,
|
|
12298
|
+
const scenesRef = (0, import_react41.useRef)(scenes);
|
|
12215
12299
|
scenesRef.current = scenes;
|
|
12216
|
-
const resolvedIdRef = (0,
|
|
12300
|
+
const resolvedIdRef = (0, import_react41.useRef)(resolvedId);
|
|
12217
12301
|
resolvedIdRef.current = resolvedId;
|
|
12218
|
-
const host = (0,
|
|
12219
|
-
const phaseRef = (0,
|
|
12220
|
-
(0,
|
|
12302
|
+
const host = (0, import_react41.useContext)(ScenesHostContext);
|
|
12303
|
+
const phaseRef = (0, import_react41.useRef)("idle");
|
|
12304
|
+
(0, import_react41.useEffect)(() => {
|
|
12221
12305
|
if (!host) {
|
|
12222
12306
|
return;
|
|
12223
12307
|
}
|
|
@@ -12287,25 +12371,25 @@ function Scenes({
|
|
|
12287
12371
|
|
|
12288
12372
|
// src/hotspot/image-hotspot.tsx
|
|
12289
12373
|
var import_fiber23 = require("@react-three/fiber");
|
|
12290
|
-
var
|
|
12374
|
+
var import_react45 = require("react");
|
|
12291
12375
|
var import_three22 = require("three");
|
|
12292
12376
|
|
|
12293
12377
|
// src/hotspot/hotspot-anchor.tsx
|
|
12294
12378
|
var import_fiber22 = require("@react-three/fiber");
|
|
12295
|
-
var
|
|
12379
|
+
var import_react44 = require("react");
|
|
12296
12380
|
var import_three20 = require("three");
|
|
12297
12381
|
|
|
12298
12382
|
// src/hotspot/hotspot-tooltip.tsx
|
|
12299
|
-
var
|
|
12383
|
+
var import_react43 = require("react");
|
|
12300
12384
|
|
|
12301
12385
|
// src/webvr/stereo-html.tsx
|
|
12302
12386
|
var import_drei = require("@react-three/drei");
|
|
12303
|
-
var
|
|
12387
|
+
var import_react42 = require("react");
|
|
12304
12388
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
12305
12389
|
function useFallbackStereoView() {
|
|
12306
|
-
const runtime = (0,
|
|
12390
|
+
const runtime = (0, import_react42.useContext)(WebVRRuntimeContext);
|
|
12307
12391
|
const host = runtime?.host ?? null;
|
|
12308
|
-
const fallback = (0,
|
|
12392
|
+
const fallback = (0, import_react42.useSyncExternalStore)(
|
|
12309
12393
|
(onStoreChange) => host ? subscribeWebVRHost(host, onStoreChange) : () => void 0,
|
|
12310
12394
|
() => isFallbackStereoMode(host?.snapshot.mode ?? null),
|
|
12311
12395
|
() => false
|
|
@@ -12419,16 +12503,16 @@ function HotspotTooltip({
|
|
|
12419
12503
|
offset = DEFAULT_HOTSPOT_TOOLTIP_OFFSET,
|
|
12420
12504
|
appearance
|
|
12421
12505
|
}) {
|
|
12422
|
-
const [imageFailed, setImageFailed] = (0,
|
|
12423
|
-
(0,
|
|
12506
|
+
const [imageFailed, setImageFailed] = (0, import_react43.useState)(false);
|
|
12507
|
+
(0, import_react43.useEffect)(() => {
|
|
12424
12508
|
setImageFailed(false);
|
|
12425
12509
|
}, [content.image]);
|
|
12426
12510
|
const showImage = Boolean(content.image) && !imageFailed;
|
|
12427
|
-
const resolvedAppearance = (0,
|
|
12511
|
+
const resolvedAppearance = (0, import_react43.useMemo)(
|
|
12428
12512
|
() => resolveHotspotTooltipAppearance(appearance),
|
|
12429
12513
|
[appearance]
|
|
12430
12514
|
);
|
|
12431
|
-
const bubbleStyle = (0,
|
|
12515
|
+
const bubbleStyle = (0, import_react43.useMemo)(
|
|
12432
12516
|
() => ({
|
|
12433
12517
|
background: resolvedAppearance.background,
|
|
12434
12518
|
border: resolvedAppearance.border,
|
|
@@ -12807,18 +12891,18 @@ function HotspotAnchor({
|
|
|
12807
12891
|
onPositionChange,
|
|
12808
12892
|
onDragEnd
|
|
12809
12893
|
}) {
|
|
12810
|
-
const controlsRef = (0,
|
|
12811
|
-
const eventBus = (0,
|
|
12894
|
+
const controlsRef = (0, import_react44.useContext)(PanoramaViewContext);
|
|
12895
|
+
const eventBus = (0, import_react44.useContext)(PanoEventBusContext);
|
|
12812
12896
|
const cursorApi = usePanoCursor();
|
|
12813
12897
|
const { camera, size } = (0, import_fiber22.useThree)();
|
|
12814
|
-
const groupRef = (0,
|
|
12815
|
-
const tooltipAnchorRef = (0,
|
|
12816
|
-
const dragStateRef = (0,
|
|
12817
|
-
const suppressNextClickRef = (0,
|
|
12818
|
-
const [hovered, setHovered] = (0,
|
|
12819
|
-
const [dragging, setDragging] = (0,
|
|
12820
|
-
const [pinned, setPinned] = (0,
|
|
12821
|
-
const tooltipContent = (0,
|
|
12898
|
+
const groupRef = (0, import_react44.useRef)(null);
|
|
12899
|
+
const tooltipAnchorRef = (0, import_react44.useRef)(null);
|
|
12900
|
+
const dragStateRef = (0, import_react44.useRef)(null);
|
|
12901
|
+
const suppressNextClickRef = (0, import_react44.useRef)(false);
|
|
12902
|
+
const [hovered, setHovered] = (0, import_react44.useState)(false);
|
|
12903
|
+
const [dragging, setDragging] = (0, import_react44.useState)(false);
|
|
12904
|
+
const [pinned, setPinned] = (0, import_react44.useState)(false);
|
|
12905
|
+
const tooltipContent = (0, import_react44.useMemo)(
|
|
12822
12906
|
() => resolveHotspotTooltipContent(tooltip),
|
|
12823
12907
|
[tooltip]
|
|
12824
12908
|
);
|
|
@@ -12834,17 +12918,17 @@ function HotspotAnchor({
|
|
|
12834
12918
|
scaledWidth,
|
|
12835
12919
|
scaledHeight
|
|
12836
12920
|
);
|
|
12837
|
-
const worldPosition = (0,
|
|
12921
|
+
const worldPosition = (0, import_react44.useMemo)(
|
|
12838
12922
|
() => panoPositionToVector3(normalizedPosition, resolvedDistance),
|
|
12839
12923
|
[normalizedPosition.pitch, normalizedPosition.yaw, resolvedDistance]
|
|
12840
12924
|
);
|
|
12841
|
-
const surfaceQuaternion3 = (0,
|
|
12925
|
+
const surfaceQuaternion3 = (0, import_react44.useMemo)(
|
|
12842
12926
|
() => createSurfaceQuaternion(normalizedPosition),
|
|
12843
12927
|
[normalizedPosition.pitch, normalizedPosition.yaw]
|
|
12844
12928
|
);
|
|
12845
12929
|
const worldWidth = angularSizeToWorldSize(scaledWidth, resolvedDistance);
|
|
12846
12930
|
const worldHeight = angularSizeToWorldSize(scaledHeight, resolvedDistance);
|
|
12847
|
-
const focusGeometry = (0,
|
|
12931
|
+
const focusGeometry = (0, import_react44.useMemo)(() => {
|
|
12848
12932
|
const planeGeometry = new import_three20.PlaneGeometry(1, 1);
|
|
12849
12933
|
const geometry = new import_three20.EdgesGeometry(planeGeometry);
|
|
12850
12934
|
planeGeometry.dispose();
|
|
@@ -12871,14 +12955,14 @@ function HotspotAnchor({
|
|
|
12871
12955
|
});
|
|
12872
12956
|
const tooltipOpen = visible && tooltipContent !== null && isTooltipOpen(tooltipTrigger, hovered, focused, pinned);
|
|
12873
12957
|
const cursorClaimId = hotspotCursorClaimId(id);
|
|
12874
|
-
(0,
|
|
12958
|
+
(0, import_react44.useEffect)(
|
|
12875
12959
|
() => () => {
|
|
12876
12960
|
dragStateRef.current?.releaseInteractionLock();
|
|
12877
12961
|
dragStateRef.current = null;
|
|
12878
12962
|
},
|
|
12879
12963
|
[]
|
|
12880
12964
|
);
|
|
12881
|
-
(0,
|
|
12965
|
+
(0, import_react44.useEffect)(() => {
|
|
12882
12966
|
if (!cursorApi) {
|
|
12883
12967
|
return;
|
|
12884
12968
|
}
|
|
@@ -12900,14 +12984,14 @@ function HotspotAnchor({
|
|
|
12900
12984
|
hovered,
|
|
12901
12985
|
visible
|
|
12902
12986
|
]);
|
|
12903
|
-
(0,
|
|
12987
|
+
(0, import_react44.useEffect)(
|
|
12904
12988
|
() => () => {
|
|
12905
12989
|
cursorApi?.release(cursorClaimId);
|
|
12906
12990
|
},
|
|
12907
12991
|
[cursorApi, cursorClaimId]
|
|
12908
12992
|
);
|
|
12909
|
-
(0,
|
|
12910
|
-
(0,
|
|
12993
|
+
(0, import_react44.useEffect)(() => () => focusGeometry.dispose(), [focusGeometry]);
|
|
12994
|
+
(0, import_react44.useEffect)(() => {
|
|
12911
12995
|
if (tooltipTrigger !== "click") {
|
|
12912
12996
|
setPinned(false);
|
|
12913
12997
|
return;
|
|
@@ -12916,12 +13000,12 @@ function HotspotAnchor({
|
|
|
12916
13000
|
setPinned(false);
|
|
12917
13001
|
});
|
|
12918
13002
|
}, [eventBus, tooltipTrigger]);
|
|
12919
|
-
(0,
|
|
13003
|
+
(0, import_react44.useEffect)(() => {
|
|
12920
13004
|
if (tooltipTrigger !== "hover") {
|
|
12921
13005
|
setHovered(false);
|
|
12922
13006
|
}
|
|
12923
13007
|
}, [tooltipTrigger]);
|
|
12924
|
-
(0,
|
|
13008
|
+
(0, import_react44.useEffect)(() => {
|
|
12925
13009
|
if (acceptsPointer) {
|
|
12926
13010
|
return;
|
|
12927
13011
|
}
|
|
@@ -12934,7 +13018,7 @@ function HotspotAnchor({
|
|
|
12934
13018
|
dragStateRef.current = null;
|
|
12935
13019
|
setDragging(false);
|
|
12936
13020
|
}, [acceptsPointer]);
|
|
12937
|
-
(0,
|
|
13021
|
+
(0, import_react44.useLayoutEffect)(() => {
|
|
12938
13022
|
const group = groupRef.current;
|
|
12939
13023
|
if (!group) {
|
|
12940
13024
|
return;
|
|
@@ -13260,12 +13344,12 @@ function HotspotPlane({
|
|
|
13260
13344
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
13261
13345
|
function useHotspotImageTexture(src, onLoad, onError) {
|
|
13262
13346
|
const gl = (0, import_fiber23.useThree)((state) => state.gl);
|
|
13263
|
-
const [texture, setTexture] = (0,
|
|
13264
|
-
const onLoadRef = (0,
|
|
13265
|
-
const onErrorRef = (0,
|
|
13347
|
+
const [texture, setTexture] = (0, import_react45.useState)(null);
|
|
13348
|
+
const onLoadRef = (0, import_react45.useRef)(onLoad);
|
|
13349
|
+
const onErrorRef = (0, import_react45.useRef)(onError);
|
|
13266
13350
|
onLoadRef.current = onLoad;
|
|
13267
13351
|
onErrorRef.current = onError;
|
|
13268
|
-
(0,
|
|
13352
|
+
(0, import_react45.useEffect)(() => {
|
|
13269
13353
|
let active = true;
|
|
13270
13354
|
setTexture(null);
|
|
13271
13355
|
if (!src) {
|
|
@@ -13303,7 +13387,7 @@ function useHotspotImageTexture(src, onLoad, onError) {
|
|
|
13303
13387
|
active = false;
|
|
13304
13388
|
};
|
|
13305
13389
|
}, [gl, src]);
|
|
13306
|
-
(0,
|
|
13390
|
+
(0, import_react45.useEffect)(
|
|
13307
13391
|
() => () => {
|
|
13308
13392
|
texture?.dispose();
|
|
13309
13393
|
},
|
|
@@ -13325,13 +13409,13 @@ function ImageHotspot({
|
|
|
13325
13409
|
}
|
|
13326
13410
|
|
|
13327
13411
|
// src/hotspot/polygon-hotspot.tsx
|
|
13328
|
-
var
|
|
13412
|
+
var import_react47 = require("react");
|
|
13329
13413
|
var import_three24 = require("three");
|
|
13330
13414
|
|
|
13331
13415
|
// src/hotspot/hotspot-stroke-line.tsx
|
|
13332
13416
|
var import_drei2 = require("@react-three/drei");
|
|
13333
13417
|
var import_fiber24 = require("@react-three/fiber");
|
|
13334
|
-
var
|
|
13418
|
+
var import_react46 = require("react");
|
|
13335
13419
|
var import_three23 = require("three");
|
|
13336
13420
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
13337
13421
|
var LINE_WORLD_POSITION = new import_three23.Vector3();
|
|
@@ -13364,10 +13448,10 @@ function HotspotStrokeLine({
|
|
|
13364
13448
|
dashSize,
|
|
13365
13449
|
gapSize
|
|
13366
13450
|
}) {
|
|
13367
|
-
const lineRef = (0,
|
|
13451
|
+
const lineRef = (0, import_react46.useRef)(null);
|
|
13368
13452
|
const { camera, size } = (0, import_fiber24.useThree)();
|
|
13369
13453
|
const dash = resolveDash(dashSize, gapSize);
|
|
13370
|
-
(0,
|
|
13454
|
+
(0, import_react46.useLayoutEffect)(() => {
|
|
13371
13455
|
if (!dash.dashed) {
|
|
13372
13456
|
return;
|
|
13373
13457
|
}
|
|
@@ -13657,24 +13741,24 @@ function PolygonHotspot({
|
|
|
13657
13741
|
onInvalid,
|
|
13658
13742
|
...anchorProps
|
|
13659
13743
|
}) {
|
|
13660
|
-
const issues = (0,
|
|
13744
|
+
const issues = (0, import_react47.useMemo)(() => validatePolygonVertices(vertices), [vertices]);
|
|
13661
13745
|
const valid = issues.length === 0;
|
|
13662
|
-
const center = (0,
|
|
13663
|
-
const fillGeometry = (0,
|
|
13746
|
+
const center = (0, import_react47.useMemo)(() => valid ? polygonCenter(vertices) : null, [valid, vertices]);
|
|
13747
|
+
const fillGeometry = (0, import_react47.useMemo)(
|
|
13664
13748
|
() => valid && center ? makeFillGeometry(vertices, center) : null,
|
|
13665
13749
|
[center, valid, vertices]
|
|
13666
13750
|
);
|
|
13667
|
-
const strokePoints = (0,
|
|
13751
|
+
const strokePoints = (0, import_react47.useMemo)(
|
|
13668
13752
|
() => valid && center ? makeStrokePositions(vertices, center) : null,
|
|
13669
13753
|
[center, valid, vertices]
|
|
13670
13754
|
);
|
|
13671
13755
|
const resolvedStrokeOpacity = Math.max(0, Math.min(strokeOpacity, 1));
|
|
13672
|
-
const startVerticesRef = (0,
|
|
13756
|
+
const startVerticesRef = (0, import_react47.useRef)(null);
|
|
13673
13757
|
const issuesKey = issues.map((issue) => issue.code).join(",");
|
|
13674
|
-
(0,
|
|
13758
|
+
(0, import_react47.useEffect)(() => {
|
|
13675
13759
|
if (!valid) onInvalid?.(issues);
|
|
13676
13760
|
}, [issues, issuesKey, onInvalid, valid]);
|
|
13677
|
-
(0,
|
|
13761
|
+
(0, import_react47.useEffect)(() => () => fillGeometry?.dispose(), [fillGeometry]);
|
|
13678
13762
|
if (!valid || !center || !fillGeometry || !strokePoints || strokePoints.length < 2) {
|
|
13679
13763
|
return null;
|
|
13680
13764
|
}
|
|
@@ -13754,7 +13838,7 @@ function PolygonHotspot({
|
|
|
13754
13838
|
}
|
|
13755
13839
|
|
|
13756
13840
|
// src/hotspot/polyline-hotspot.tsx
|
|
13757
|
-
var
|
|
13841
|
+
var import_react48 = require("react");
|
|
13758
13842
|
var import_three25 = require("three");
|
|
13759
13843
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
13760
13844
|
var POLYLINE_RADIUS = 990;
|
|
@@ -13873,16 +13957,16 @@ function PolylineHotspot({
|
|
|
13873
13957
|
onInvalid,
|
|
13874
13958
|
...anchorProps
|
|
13875
13959
|
}) {
|
|
13876
|
-
const issues = (0,
|
|
13960
|
+
const issues = (0, import_react48.useMemo)(() => validatePolylineVertices(vertices), [vertices]);
|
|
13877
13961
|
const valid = issues.length === 0;
|
|
13878
|
-
const center = (0,
|
|
13879
|
-
const linePoints = (0,
|
|
13962
|
+
const center = (0, import_react48.useMemo)(() => valid ? polylineCenter(vertices) : null, [valid, vertices]);
|
|
13963
|
+
const linePoints = (0, import_react48.useMemo)(
|
|
13880
13964
|
() => valid && center ? makeLinePositions(vertices, center) : null,
|
|
13881
13965
|
[center, valid, vertices]
|
|
13882
13966
|
);
|
|
13883
13967
|
const opacity = Math.max(0, Math.min(strokeOpacity, 1));
|
|
13884
|
-
const startVerticesRef = (0,
|
|
13885
|
-
(0,
|
|
13968
|
+
const startVerticesRef = (0, import_react48.useRef)(null);
|
|
13969
|
+
(0, import_react48.useEffect)(() => {
|
|
13886
13970
|
if (!valid) onInvalid?.(issues);
|
|
13887
13971
|
}, [issues, onInvalid, valid]);
|
|
13888
13972
|
if (!valid || !center || !linePoints || linePoints.length < 2) return null;
|
|
@@ -13948,7 +14032,7 @@ function PolylineHotspot({
|
|
|
13948
14032
|
}
|
|
13949
14033
|
|
|
13950
14034
|
// src/hotspot/graphic-hotspot.tsx
|
|
13951
|
-
var
|
|
14035
|
+
var import_react49 = require("react");
|
|
13952
14036
|
var import_three26 = require("three");
|
|
13953
14037
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
13954
14038
|
var GRAPHIC_TEXTURE_SIZE = 512;
|
|
@@ -14139,12 +14223,12 @@ function createGraphicTexture(graphic, aspectWidth, aspectHeight) {
|
|
|
14139
14223
|
return texture;
|
|
14140
14224
|
}
|
|
14141
14225
|
function useGraphicTexture(graphic, aspectWidth, aspectHeight, onLoad, onError) {
|
|
14142
|
-
const [texture, setTexture] = (0,
|
|
14143
|
-
const onLoadRef = (0,
|
|
14144
|
-
const onErrorRef = (0,
|
|
14226
|
+
const [texture, setTexture] = (0, import_react49.useState)(null);
|
|
14227
|
+
const onLoadRef = (0, import_react49.useRef)(onLoad);
|
|
14228
|
+
const onErrorRef = (0, import_react49.useRef)(onError);
|
|
14145
14229
|
onLoadRef.current = onLoad;
|
|
14146
14230
|
onErrorRef.current = onError;
|
|
14147
|
-
(0,
|
|
14231
|
+
(0, import_react49.useEffect)(() => {
|
|
14148
14232
|
let nextTexture = null;
|
|
14149
14233
|
try {
|
|
14150
14234
|
nextTexture = createGraphicTexture(graphic, aspectWidth, aspectHeight);
|
|
@@ -14183,7 +14267,7 @@ function GraphicHotspot(props) {
|
|
|
14183
14267
|
|
|
14184
14268
|
// src/hotspot/sequence-hotspot.tsx
|
|
14185
14269
|
var import_fiber25 = require("@react-three/fiber");
|
|
14186
|
-
var
|
|
14270
|
+
var import_react50 = require("react");
|
|
14187
14271
|
var import_three27 = require("three");
|
|
14188
14272
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
14189
14273
|
var DEFAULT_SEQUENCE_FPS = 12;
|
|
@@ -14200,12 +14284,12 @@ function useSpriteTexture({
|
|
|
14200
14284
|
onLoadProgress
|
|
14201
14285
|
}) {
|
|
14202
14286
|
const gl = (0, import_fiber25.useThree)((state) => state.gl);
|
|
14203
|
-
const [texture, setTexture] = (0,
|
|
14204
|
-
const onErrorRef = (0,
|
|
14205
|
-
const onLoadProgressRef = (0,
|
|
14287
|
+
const [texture, setTexture] = (0, import_react50.useState)(null);
|
|
14288
|
+
const onErrorRef = (0, import_react50.useRef)(onError);
|
|
14289
|
+
const onLoadProgressRef = (0, import_react50.useRef)(onLoadProgress);
|
|
14206
14290
|
onErrorRef.current = onError;
|
|
14207
14291
|
onLoadProgressRef.current = onLoadProgress;
|
|
14208
|
-
(0,
|
|
14292
|
+
(0, import_react50.useEffect)(() => {
|
|
14209
14293
|
let active = true;
|
|
14210
14294
|
setTexture(null);
|
|
14211
14295
|
if (!src) {
|
|
@@ -14246,7 +14330,7 @@ function useSpriteTexture({
|
|
|
14246
14330
|
active = false;
|
|
14247
14331
|
};
|
|
14248
14332
|
}, [gl, id, src]);
|
|
14249
|
-
(0,
|
|
14333
|
+
(0, import_react50.useEffect)(
|
|
14250
14334
|
() => () => {
|
|
14251
14335
|
texture?.dispose();
|
|
14252
14336
|
},
|
|
@@ -14275,24 +14359,24 @@ function SequenceHotspot({
|
|
|
14275
14359
|
const texture = useSpriteTexture({ id, src, onError, onLoadProgress });
|
|
14276
14360
|
const frameCount = resolveFrameCount(requestedFrameCount);
|
|
14277
14361
|
const safeFps = resolveFps(fps);
|
|
14278
|
-
const [frameIndex, setFrameIndex] = (0,
|
|
14279
|
-
const elapsedRef = (0,
|
|
14280
|
-
const frameIndexRef = (0,
|
|
14281
|
-
const endedRef = (0,
|
|
14282
|
-
const lastPlaybackStateRef = (0,
|
|
14283
|
-
const onFrameChangeRef = (0,
|
|
14284
|
-
const onPlaybackStateChangeRef = (0,
|
|
14285
|
-
const onEndedRef = (0,
|
|
14362
|
+
const [frameIndex, setFrameIndex] = (0, import_react50.useState)(0);
|
|
14363
|
+
const elapsedRef = (0, import_react50.useRef)(0);
|
|
14364
|
+
const frameIndexRef = (0, import_react50.useRef)(0);
|
|
14365
|
+
const endedRef = (0, import_react50.useRef)(false);
|
|
14366
|
+
const lastPlaybackStateRef = (0, import_react50.useRef)(null);
|
|
14367
|
+
const onFrameChangeRef = (0, import_react50.useRef)(onFrameChange);
|
|
14368
|
+
const onPlaybackStateChangeRef = (0, import_react50.useRef)(onPlaybackStateChange);
|
|
14369
|
+
const onEndedRef = (0, import_react50.useRef)(onEnded);
|
|
14286
14370
|
onFrameChangeRef.current = onFrameChange;
|
|
14287
14371
|
onPlaybackStateChangeRef.current = onPlaybackStateChange;
|
|
14288
14372
|
onEndedRef.current = onEnded;
|
|
14289
|
-
(0,
|
|
14373
|
+
(0, import_react50.useEffect)(() => {
|
|
14290
14374
|
elapsedRef.current = 0;
|
|
14291
14375
|
frameIndexRef.current = 0;
|
|
14292
14376
|
endedRef.current = false;
|
|
14293
14377
|
setFrameIndex(0);
|
|
14294
14378
|
}, [frameCount, frameDirection, src]);
|
|
14295
|
-
(0,
|
|
14379
|
+
(0, import_react50.useEffect)(() => {
|
|
14296
14380
|
if (!texture) {
|
|
14297
14381
|
return;
|
|
14298
14382
|
}
|
|
@@ -14306,13 +14390,13 @@ function SequenceHotspot({
|
|
|
14306
14390
|
);
|
|
14307
14391
|
texture.needsUpdate = true;
|
|
14308
14392
|
}, [frameCount, frameDirection, frameIndex, texture]);
|
|
14309
|
-
(0,
|
|
14393
|
+
(0, import_react50.useEffect)(() => {
|
|
14310
14394
|
if (!texture) {
|
|
14311
14395
|
return;
|
|
14312
14396
|
}
|
|
14313
14397
|
onFrameChangeRef.current?.({ id, index: 0, src });
|
|
14314
14398
|
}, [id, src, texture]);
|
|
14315
|
-
(0,
|
|
14399
|
+
(0, import_react50.useEffect)(() => {
|
|
14316
14400
|
if (!texture) {
|
|
14317
14401
|
return;
|
|
14318
14402
|
}
|
|
@@ -14366,7 +14450,7 @@ function SequenceHotspot({
|
|
|
14366
14450
|
|
|
14367
14451
|
// src/hotspot/video-hotspot.tsx
|
|
14368
14452
|
var import_fiber26 = require("@react-three/fiber");
|
|
14369
|
-
var
|
|
14453
|
+
var import_react51 = require("react");
|
|
14370
14454
|
var import_three28 = require("three");
|
|
14371
14455
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
14372
14456
|
function clampVolume2(volume) {
|
|
@@ -14377,10 +14461,10 @@ function clampVolume2(volume) {
|
|
|
14377
14461
|
}
|
|
14378
14462
|
function usePosterTexture2(id, poster, onError) {
|
|
14379
14463
|
const gl = (0, import_fiber26.useThree)((state) => state.gl);
|
|
14380
|
-
const [texture, setTexture] = (0,
|
|
14381
|
-
const onErrorRef = (0,
|
|
14464
|
+
const [texture, setTexture] = (0, import_react51.useState)(null);
|
|
14465
|
+
const onErrorRef = (0, import_react51.useRef)(onError);
|
|
14382
14466
|
onErrorRef.current = onError;
|
|
14383
|
-
(0,
|
|
14467
|
+
(0, import_react51.useEffect)(() => {
|
|
14384
14468
|
let active = true;
|
|
14385
14469
|
setTexture(null);
|
|
14386
14470
|
if (!poster) {
|
|
@@ -14417,7 +14501,7 @@ function usePosterTexture2(id, poster, onError) {
|
|
|
14417
14501
|
active = false;
|
|
14418
14502
|
};
|
|
14419
14503
|
}, [gl, id, poster]);
|
|
14420
|
-
(0,
|
|
14504
|
+
(0, import_react51.useEffect)(
|
|
14421
14505
|
() => () => {
|
|
14422
14506
|
texture?.dispose();
|
|
14423
14507
|
},
|
|
@@ -14435,14 +14519,14 @@ function useVideoResource({
|
|
|
14435
14519
|
poster,
|
|
14436
14520
|
src
|
|
14437
14521
|
}) {
|
|
14438
|
-
const [resource, setResource] = (0,
|
|
14439
|
-
const onEndedRef = (0,
|
|
14440
|
-
const onErrorRef = (0,
|
|
14441
|
-
const onPlaybackStateChangeRef = (0,
|
|
14522
|
+
const [resource, setResource] = (0, import_react51.useState)(null);
|
|
14523
|
+
const onEndedRef = (0, import_react51.useRef)(onEnded);
|
|
14524
|
+
const onErrorRef = (0, import_react51.useRef)(onError);
|
|
14525
|
+
const onPlaybackStateChangeRef = (0, import_react51.useRef)(onPlaybackStateChange);
|
|
14442
14526
|
onEndedRef.current = onEnded;
|
|
14443
14527
|
onErrorRef.current = onError;
|
|
14444
14528
|
onPlaybackStateChangeRef.current = onPlaybackStateChange;
|
|
14445
|
-
(0,
|
|
14529
|
+
(0, import_react51.useEffect)(() => {
|
|
14446
14530
|
if (!src) {
|
|
14447
14531
|
setResource(null);
|
|
14448
14532
|
return;
|
|
@@ -14543,11 +14627,11 @@ function VideoHotspot({
|
|
|
14543
14627
|
src
|
|
14544
14628
|
});
|
|
14545
14629
|
const posterTexture = usePosterTexture2(id, poster, onError);
|
|
14546
|
-
const onPlaybackErrorRef = (0,
|
|
14547
|
-
const onPlaybackStateChangeRef = (0,
|
|
14630
|
+
const onPlaybackErrorRef = (0, import_react51.useRef)(onPlaybackError);
|
|
14631
|
+
const onPlaybackStateChangeRef = (0, import_react51.useRef)(onPlaybackStateChange);
|
|
14548
14632
|
onPlaybackErrorRef.current = onPlaybackError;
|
|
14549
14633
|
onPlaybackStateChangeRef.current = onPlaybackStateChange;
|
|
14550
|
-
(0,
|
|
14634
|
+
(0, import_react51.useEffect)(() => {
|
|
14551
14635
|
if (!resource) {
|
|
14552
14636
|
return;
|
|
14553
14637
|
}
|
|
@@ -14557,7 +14641,7 @@ function VideoHotspot({
|
|
|
14557
14641
|
resource.video.playsInline = playsInline;
|
|
14558
14642
|
resource.video.preload = preload;
|
|
14559
14643
|
}, [loop, muted, playsInline, preload, resource, volume]);
|
|
14560
|
-
(0,
|
|
14644
|
+
(0, import_react51.useEffect)(() => {
|
|
14561
14645
|
if (!resource) {
|
|
14562
14646
|
return;
|
|
14563
14647
|
}
|
|
@@ -14585,7 +14669,7 @@ function VideoHotspot({
|
|
|
14585
14669
|
|
|
14586
14670
|
// src/hotspot/audio-hotspot.tsx
|
|
14587
14671
|
var import_fiber27 = require("@react-three/fiber");
|
|
14588
|
-
var
|
|
14672
|
+
var import_react52 = require("react");
|
|
14589
14673
|
var import_three29 = require("three");
|
|
14590
14674
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
14591
14675
|
var SPEAKER_TEXTURE_SIZE = 512;
|
|
@@ -14651,8 +14735,8 @@ function createSpeakerTexture(state) {
|
|
|
14651
14735
|
return texture;
|
|
14652
14736
|
}
|
|
14653
14737
|
function useSpeakerTextures(enabled) {
|
|
14654
|
-
const [textures, setTextures] = (0,
|
|
14655
|
-
(0,
|
|
14738
|
+
const [textures, setTextures] = (0, import_react52.useState)({ playing: null, stopped: null });
|
|
14739
|
+
(0, import_react52.useEffect)(() => {
|
|
14656
14740
|
if (!enabled) {
|
|
14657
14741
|
setTextures({ playing: null, stopped: null });
|
|
14658
14742
|
return;
|
|
@@ -14669,10 +14753,10 @@ function useSpeakerTextures(enabled) {
|
|
|
14669
14753
|
}
|
|
14670
14754
|
function useIconTexture(icon, enabled, onError, id) {
|
|
14671
14755
|
const gl = (0, import_fiber27.useThree)((state) => state.gl);
|
|
14672
|
-
const [texture, setTexture] = (0,
|
|
14673
|
-
const onErrorRef = (0,
|
|
14756
|
+
const [texture, setTexture] = (0, import_react52.useState)(null);
|
|
14757
|
+
const onErrorRef = (0, import_react52.useRef)(onError);
|
|
14674
14758
|
onErrorRef.current = onError;
|
|
14675
|
-
(0,
|
|
14759
|
+
(0, import_react52.useEffect)(() => {
|
|
14676
14760
|
let active = true;
|
|
14677
14761
|
setTexture(null);
|
|
14678
14762
|
if (!enabled || !icon) {
|
|
@@ -14709,7 +14793,7 @@ function useIconTexture(icon, enabled, onError, id) {
|
|
|
14709
14793
|
active = false;
|
|
14710
14794
|
};
|
|
14711
14795
|
}, [enabled, gl, icon, id]);
|
|
14712
|
-
(0,
|
|
14796
|
+
(0, import_react52.useEffect)(
|
|
14713
14797
|
() => () => {
|
|
14714
14798
|
texture?.dispose();
|
|
14715
14799
|
},
|
|
@@ -14728,13 +14812,13 @@ function useAudioHowl({
|
|
|
14728
14812
|
playing,
|
|
14729
14813
|
src
|
|
14730
14814
|
}) {
|
|
14731
|
-
const [howl, setHowl] = (0,
|
|
14732
|
-
const playingRef = (0,
|
|
14733
|
-
const loopRef = (0,
|
|
14734
|
-
const onEndedRef = (0,
|
|
14735
|
-
const onErrorRef = (0,
|
|
14736
|
-
const onPlaybackErrorRef = (0,
|
|
14737
|
-
const onPlaybackStateChangeRef = (0,
|
|
14815
|
+
const [howl, setHowl] = (0, import_react52.useState)(null);
|
|
14816
|
+
const playingRef = (0, import_react52.useRef)(playing);
|
|
14817
|
+
const loopRef = (0, import_react52.useRef)(loop ?? false);
|
|
14818
|
+
const onEndedRef = (0, import_react52.useRef)(onEnded);
|
|
14819
|
+
const onErrorRef = (0, import_react52.useRef)(onError);
|
|
14820
|
+
const onPlaybackErrorRef = (0, import_react52.useRef)(onPlaybackError);
|
|
14821
|
+
const onPlaybackStateChangeRef = (0, import_react52.useRef)(onPlaybackStateChange);
|
|
14738
14822
|
playingRef.current = playing;
|
|
14739
14823
|
loopRef.current = loop ?? false;
|
|
14740
14824
|
onEndedRef.current = onEnded;
|
|
@@ -14742,7 +14826,7 @@ function useAudioHowl({
|
|
|
14742
14826
|
onPlaybackErrorRef.current = onPlaybackError;
|
|
14743
14827
|
onPlaybackStateChangeRef.current = onPlaybackStateChange;
|
|
14744
14828
|
const sourcesKey = sourceList(src).join("\0");
|
|
14745
|
-
(0,
|
|
14829
|
+
(0, import_react52.useEffect)(() => {
|
|
14746
14830
|
const sources = sourcesKey.length > 0 ? sourcesKey.split("\0") : [];
|
|
14747
14831
|
if (sources.length === 0) {
|
|
14748
14832
|
setHowl(null);
|
|
@@ -14779,7 +14863,7 @@ function useAudioHowl({
|
|
|
14779
14863
|
handle.dispose();
|
|
14780
14864
|
};
|
|
14781
14865
|
}, [crossOrigin, id, sourcesKey]);
|
|
14782
|
-
(0,
|
|
14866
|
+
(0, import_react52.useEffect)(() => {
|
|
14783
14867
|
howl?.loop(loop ?? false);
|
|
14784
14868
|
}, [howl, loop]);
|
|
14785
14869
|
return howl;
|
|
@@ -14822,15 +14906,15 @@ function AudioHotspot({
|
|
|
14822
14906
|
const stoppedIconTexture = useIconTexture(icon, marker, onError, id);
|
|
14823
14907
|
const playingIconTexture = useIconTexture(playingIcon, marker, onError, id);
|
|
14824
14908
|
const markerTexture = playing ? playingIconTexture ?? stoppedIconTexture ?? speakerTextures.playing : stoppedIconTexture ?? speakerTextures.stopped;
|
|
14825
|
-
const playingRef = (0,
|
|
14909
|
+
const playingRef = (0, import_react52.useRef)(playing);
|
|
14826
14910
|
playingRef.current = playing;
|
|
14827
|
-
const mutedRef = (0,
|
|
14828
|
-
const volumeRef = (0,
|
|
14829
|
-
const rangeRef = (0,
|
|
14911
|
+
const mutedRef = (0, import_react52.useRef)(muted);
|
|
14912
|
+
const volumeRef = (0, import_react52.useRef)(volume);
|
|
14913
|
+
const rangeRef = (0, import_react52.useRef)(range);
|
|
14830
14914
|
mutedRef.current = muted;
|
|
14831
14915
|
volumeRef.current = volume;
|
|
14832
14916
|
rangeRef.current = range;
|
|
14833
|
-
(0,
|
|
14917
|
+
(0, import_react52.useEffect)(() => {
|
|
14834
14918
|
if (!howl) {
|
|
14835
14919
|
return;
|
|
14836
14920
|
}
|
|
@@ -14840,7 +14924,7 @@ function AudioHotspot({
|
|
|
14840
14924
|
}
|
|
14841
14925
|
howl.play();
|
|
14842
14926
|
}, [howl, playing]);
|
|
14843
|
-
(0,
|
|
14927
|
+
(0, import_react52.useEffect)(() => {
|
|
14844
14928
|
if (!howl || !pauseWhenHidden) {
|
|
14845
14929
|
return;
|
|
14846
14930
|
}
|
|
@@ -14875,7 +14959,7 @@ function AudioHotspot({
|
|
|
14875
14959
|
}
|
|
14876
14960
|
|
|
14877
14961
|
// src/hotspot/text-hotspot.tsx
|
|
14878
|
-
var
|
|
14962
|
+
var import_react53 = require("react");
|
|
14879
14963
|
var import_three30 = require("three");
|
|
14880
14964
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
14881
14965
|
var TEXT_TEXTURE_LONG_SIDE = 1024;
|
|
@@ -15097,12 +15181,12 @@ function createTextTexture(text, width, height, style) {
|
|
|
15097
15181
|
return texture;
|
|
15098
15182
|
}
|
|
15099
15183
|
function useTextTexture(text, width, height, style, onLoad, onError) {
|
|
15100
|
-
const [texture, setTexture] = (0,
|
|
15101
|
-
const onLoadRef = (0,
|
|
15102
|
-
const onErrorRef = (0,
|
|
15184
|
+
const [texture, setTexture] = (0, import_react53.useState)(null);
|
|
15185
|
+
const onLoadRef = (0, import_react53.useRef)(onLoad);
|
|
15186
|
+
const onErrorRef = (0, import_react53.useRef)(onError);
|
|
15103
15187
|
onLoadRef.current = onLoad;
|
|
15104
15188
|
onErrorRef.current = onError;
|
|
15105
|
-
(0,
|
|
15189
|
+
(0, import_react53.useEffect)(() => {
|
|
15106
15190
|
let cancelled = false;
|
|
15107
15191
|
let nextTexture = null;
|
|
15108
15192
|
const run = async () => {
|
|
@@ -15366,6 +15450,7 @@ function IframeHotspot({
|
|
|
15366
15450
|
resolvePanoContextMenuEntries,
|
|
15367
15451
|
unwrapPolygonVertices,
|
|
15368
15452
|
usePanoEvents,
|
|
15453
|
+
usePanoViewer,
|
|
15369
15454
|
validatePolygonVertices,
|
|
15370
15455
|
validatePolylineVertices,
|
|
15371
15456
|
vector3ToPanoPosition
|