@realsee/five 6.8.0 → 6.8.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/ai_guides/features/flowing-light-2d-pass.md +64 -10
- package/ai_guides/features/flowing-light-3d-pass.md +64 -10
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/five.AdaptiveLuminancePass.html +1 -1
- package/docs/classes/five.BoundingMesh.html +1 -1
- package/docs/classes/five.Camera.html +1 -1
- package/docs/classes/five.EyeDomeLightingPass.html +1 -1
- package/docs/classes/five.Five.html +1 -1
- package/docs/classes/five.FivePass.html +1 -1
- package/docs/classes/five.InternalWebGLRenderer.html +1 -1
- package/docs/classes/five.Model.html +1 -1
- package/docs/classes/five.ModelScene.html +1 -1
- package/docs/classes/five.NetworkSubscribe.html +1 -1
- package/docs/classes/five.PBMContainer.html +1 -1
- package/docs/classes/five.PBMCustomShader.html +1 -1
- package/docs/classes/five.PBMGSObject.html +1 -1
- package/docs/classes/five.PBMGroup.html +1 -1
- package/docs/classes/five.PBMMesh.html +1 -1
- package/docs/classes/five.PBMMeshMaterial.html +1 -1
- package/docs/classes/five.PBMPanoFilter.html +1 -1
- package/docs/classes/five.PBMPointCloud.html +1 -1
- package/docs/classes/five.PBMPointCloudMaterial.html +1 -1
- package/docs/classes/five.PBMSkinnedMesh.html +1 -1
- package/docs/classes/five.PBMUpdateable.html +1 -1
- package/docs/classes/five.PanoCircleMesh.html +1 -1
- package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
- package/docs/classes/five.PanoCircleMeshSolid.html +1 -1
- package/docs/classes/five.Parameter.html +1 -1
- package/docs/classes/five.Scene.html +1 -1
- package/docs/classes/five.Subscribe.html +1 -1
- package/docs/classes/five.Tile3D.html +1 -1
- package/docs/classes/five.TileNode.html +1 -1
- package/docs/classes/five.TrajectoryNode.html +1 -1
- package/docs/classes/five.WorkResolvedObserver.html +1 -1
- package/docs/classes/gltf-loader.DDSLoader.html +1 -1
- package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFObject.html +1 -1
- package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
- package/docs/classes/line.Line.html +1 -1
- package/docs/classes/line.LineGeometry.html +1 -1
- package/docs/classes/line.LineMaterial.html +1 -1
- package/docs/classes/line.LineSegmentsGeometry.html +1 -1
- package/docs/classes/line.THREE_Line2.html +1 -1
- package/docs/classes/line.THREE_LineSegments2.html +1 -1
- package/docs/classes/plugins.BasePlugin.Controller.html +1 -1
- package/docs/classes/plugins.CSS2DObject.html +10 -0
- package/docs/classes/plugins.CSS2DRenderer.html +7 -0
- package/docs/classes/plugins.CSS3DObject.html +1 -1
- package/docs/classes/plugins.CSS3DSprite.html +1 -1
- package/docs/classes/plugins.Object3DHelperController.html +1 -1
- package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
- package/docs/classes/sticker.Sticker.html +1 -1
- package/docs/classes/vfx.Airflow.html +1 -1
- package/docs/classes/vfx.Flame.html +1 -1
- package/docs/classes/vfx.Particle.html +1 -1
- package/docs/classes/vfx.ParticleGPU.html +1 -1
- package/docs/classes/vfx.SpotLight.html +1 -1
- package/docs/documents/features_flowing-light-2d-pass.html +28 -15
- package/docs/documents/features_flowing-light-3d-pass.html +27 -14
- package/docs/functions/plugins.CSS2DPlugin.html +1 -0
- package/docs/functions/react.getPlugin.html +2 -0
- package/docs/functions/react.setPlugin.html +2 -0
- package/docs/functions/react.useFivePlugin.html +8 -0
- package/docs/functions/react.withFive.html +1 -1
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/five.AddableObject.html +1 -1
- package/docs/interfaces/five.AjaxOptions.html +1 -1
- package/docs/interfaces/five.BaseEvent.html +1 -1
- package/docs/interfaces/five.BaseExtendableEvent.html +1 -1
- package/docs/interfaces/five.EventCallback.html +1 -1
- package/docs/interfaces/five.GestureEvent.html +1 -1
- package/docs/interfaces/five.ImageOptions.html +1 -1
- package/docs/interfaces/five.IntersectEvent.html +1 -1
- package/docs/interfaces/five.IntersectMesh.html +1 -1
- package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/five.Intersection.html +1 -1
- package/docs/interfaces/five.LooseWorkWithExtrinsics.html +1 -1
- package/docs/interfaces/five.ModeChangeEvent.html +1 -1
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ModelEvent.html +1 -1
- package/docs/interfaces/five.ModelSceneEvent.html +1 -1
- package/docs/interfaces/five.ModelTileEvent.html +1 -1
- package/docs/interfaces/five.MovePanoOptions.html +1 -1
- package/docs/interfaces/five.NetworkAbortError.html +1 -1
- package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
- package/docs/interfaces/five.NetworkOptions.html +1 -1
- package/docs/interfaces/five.NetworkProxyError.html +1 -1
- package/docs/interfaces/five.NetworkResourceEvent.html +1 -1
- package/docs/interfaces/five.NetworkResponseError.html +1 -1
- package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
- package/docs/interfaces/five.ObjectEvent.html +1 -1
- package/docs/interfaces/five.PBMMaterial.html +1 -1
- package/docs/interfaces/five.PBMMeshMaterialParameters.html +1 -1
- package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
- package/docs/interfaces/five.PanoEvent.html +1 -1
- package/docs/interfaces/five.PanoPrepareEvent.html +1 -1
- package/docs/interfaces/five.PanoTextureEvent.html +1 -1
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ParameterMaterialValue.html +1 -1
- package/docs/interfaces/five.ParameterTilesetValue.html +1 -1
- package/docs/interfaces/five.ParameterValue.html +1 -1
- package/docs/interfaces/five.Pose.html +1 -1
- package/docs/interfaces/five.RenderEvent.html +1 -1
- package/docs/interfaces/five.ResolvedParameterValue.html +1 -1
- package/docs/interfaces/five.State.html +1 -1
- package/docs/interfaces/five.StateEvent.html +1 -1
- package/docs/interfaces/five.TextureOptions.html +1 -1
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.ViewLayer.html +1 -1
- package/docs/interfaces/five.WorkCubeImage.html +1 -1
- package/docs/interfaces/five.WorkImage.html +1 -1
- package/docs/interfaces/five.WorkObserver.html +1 -1
- package/docs/interfaces/five.WorkObserverProto.html +1 -1
- package/docs/interfaces/five.WorkTile.html +1 -1
- package/docs/interfaces/five.WorksEvent.html +1 -1
- package/docs/interfaces/five.XRControllerEvent.html +1 -1
- package/docs/interfaces/five.XRGestureEvent.html +1 -1
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.XRSessionEvent.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.BasePlugin.State.html +1 -1
- package/docs/interfaces/plugins.CSS2DPluginController.html +49 -0
- package/docs/interfaces/plugins.CSS2DPluginType.Config.html +2 -0
- package/docs/interfaces/plugins.CSS2DPluginType.CreateCSS2DObjectType.html +8 -0
- package/docs/interfaces/plugins.CSS2DPluginType.EventMap.html +10 -0
- package/docs/interfaces/plugins.CSS2DPluginType.Params.html +4 -0
- package/docs/interfaces/plugins.CSS2DPluginType.State.html +8 -0
- package/docs/interfaces/plugins.CSS2DRendererParameters.html +2 -0
- package/docs/interfaces/plugins.CSS3DPluginController.html +12 -12
- package/docs/interfaces/plugins.CSS3DPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.CSS3DPluginType.State.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginController.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +1 -1
- package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationController.html +1 -1
- package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.GaussianSplattingEntranceAnimationPluginType.State.html +1 -1
- package/docs/interfaces/plugins.ItemMaskController.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.BaseController.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.BaseHelper.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.BoundingBoxController.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.MoveController.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.MoveHelperAbstract.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.RotateController.html +1 -1
- package/docs/interfaces/plugins.Object3DHelperPluginType.RotateHelperAbstract.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
- package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
- package/docs/interfaces/plugins.TrajectoryController.html +1 -1
- package/docs/interfaces/react.FiveAppProps.html +11 -0
- package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
- package/docs/modules/plugins.CSS2DPluginType.html +1 -0
- package/docs/modules/plugins.html +1 -1
- package/docs/modules/react.html +1 -1
- package/docs/types/five.ParseOptions.html +1 -1
- package/docs/types/plugins.BasePlugin.EventMap.html +1 -1
- package/docs/types/plugins.CSS2DPluginType.PluginData.html +1 -0
- package/docs/types/plugins.CSS2DPluginType.ServerData.html +1 -0
- package/docs/variables/react.FiveApp.html +3 -0
- package/docs/variables/react.FiveAutoCanvas.html +3 -0
- package/five/index.js +5 -5
- package/five/index.mjs +65 -65
- package/five/renderer/postprocessing/passes/flowing-light-2d-pass.d.ts +6 -1
- package/five/renderer/postprocessing/passes/flowing-light-3d-pass.d.ts +3 -1
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/package.json +1 -1
- package/plugins/CSS2DPlugin/Controller.d.ts +59 -0
- package/plugins/CSS2DPlugin/index.d.ts +5 -0
- package/plugins/CSS2DPlugin/typing.d.ts +30 -0
- package/plugins/index.d.ts +2 -0
- package/plugins/index.js +24 -4
- package/plugins/index.mjs +557 -393
- package/plugins/thirdParty/CSS2DRenderer.d.ts +37 -0
- package/react/autoCanvas.d.ts +9 -0
- package/react/fiveApp.d.ts +22 -0
- package/react/hooks/useFivePlugin.d.ts +26 -0
- package/react/index.d.ts +4 -0
- package/react/index.js +3 -3
- package/react/index.mjs +291 -175
- package/react/withFive.d.ts +1 -1
- package/shader-lib/index.js +2 -2
- package/shader-lib/index.mjs +2 -2
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +24 -4
- package/umd/five-react.js +3 -3
- package/umd/five-shader-lib.js +2 -2
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +5 -5
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
- package/work-downloader/index.js +2 -2
- package/work-downloader/index.mjs +2 -2
package/react/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 4/
|
|
5
|
-
* Version: 6.8.
|
|
4
|
+
* Generated: 2026/4/28
|
|
5
|
+
* Version: 6.8.1
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -253,85 +253,86 @@
|
|
|
253
253
|
* writing and signed by Realsee. You and Realsee hereto confirm that this
|
|
254
254
|
* Agreement and all related documents shall be drafted in English.
|
|
255
255
|
*/import * as e from "react";
|
|
256
|
-
import
|
|
257
|
-
import
|
|
256
|
+
import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
|
|
257
|
+
import * as a from "three";
|
|
258
|
+
import { Five as o, getViewportScale as s } from "@realsee/five";
|
|
258
259
|
//#region build/react/rendererPool.js
|
|
259
|
-
var
|
|
260
|
-
function
|
|
260
|
+
var c = [], l = [];
|
|
261
|
+
function u({ preserveDrawingBuffer: e = !0, webgl2: t = !1 } = {}) {
|
|
261
262
|
if (typeof window > "u") return;
|
|
262
|
-
let
|
|
263
|
-
if (
|
|
264
|
-
if (
|
|
265
|
-
let
|
|
266
|
-
|
|
263
|
+
let n = null;
|
|
264
|
+
if (n = t ? c.shift() : l.shift(), !n) {
|
|
265
|
+
if (t) {
|
|
266
|
+
let t = document.createElement("canvas"), r = t.getContext("webgl2");
|
|
267
|
+
r ? n = new a.WebGLRenderer({
|
|
267
268
|
preserveDrawingBuffer: e,
|
|
268
269
|
antialias: !0,
|
|
269
270
|
alpha: !0,
|
|
270
271
|
stencil: !0,
|
|
271
|
-
canvas:
|
|
272
|
-
context:
|
|
273
|
-
}) : (console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),
|
|
272
|
+
canvas: t,
|
|
273
|
+
context: r
|
|
274
|
+
}) : (console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."), n = new a.WebGLRenderer({
|
|
274
275
|
preserveDrawingBuffer: e,
|
|
275
276
|
antialias: !1,
|
|
276
277
|
alpha: !0,
|
|
277
278
|
stencil: !0
|
|
278
279
|
}));
|
|
279
|
-
} else
|
|
280
|
+
} else n = new a.WebGLRenderer({
|
|
280
281
|
preserveDrawingBuffer: e,
|
|
281
282
|
antialias: !1,
|
|
282
283
|
alpha: !0,
|
|
283
284
|
stencil: !0
|
|
284
285
|
});
|
|
285
|
-
|
|
286
|
+
n.outputEncoding = a.sRGBEncoding;
|
|
286
287
|
}
|
|
287
|
-
return
|
|
288
|
+
return n.autoClear = !0, n;
|
|
288
289
|
}
|
|
289
|
-
function
|
|
290
|
-
e && (e.capabilities.isWebGL2 ?
|
|
290
|
+
function d(e) {
|
|
291
|
+
e && (e.capabilities.isWebGL2 ? l.indexOf(e) === -1 && l.push(e) : c.indexOf(e) === -1 && c.push(e));
|
|
291
292
|
}
|
|
292
293
|
//#endregion
|
|
293
294
|
//#region build/react/context.js
|
|
294
|
-
var
|
|
295
|
-
function
|
|
296
|
-
let t = e.useContext(
|
|
295
|
+
var f = e.createContext(null);
|
|
296
|
+
function p() {
|
|
297
|
+
let t = e.useContext(f);
|
|
297
298
|
if (!t) throw Error("FiveProvider never found.");
|
|
298
299
|
return t.five;
|
|
299
300
|
}
|
|
300
|
-
function
|
|
301
|
-
let t = e.useContext(
|
|
301
|
+
function m() {
|
|
302
|
+
let t = e.useContext(f);
|
|
302
303
|
if (!t) throw Error("FiveProvider never found.");
|
|
303
304
|
return t.loadWork;
|
|
304
305
|
}
|
|
305
306
|
//#endregion
|
|
306
307
|
//#region build/react/createProvider.js
|
|
307
|
-
function
|
|
308
|
+
function h(e, t) {
|
|
308
309
|
let n = Array.isArray(e) ? e : [e], r = Array.isArray(t) ? t : [t];
|
|
309
310
|
if (n.length !== r.length) return !1;
|
|
310
311
|
for (let e = 0; e < n.length; e++) if (n[e].workCode !== r[e].workCode) return !1;
|
|
311
312
|
return !0;
|
|
312
313
|
}
|
|
313
|
-
function
|
|
314
|
+
function g(t = {}) {
|
|
314
315
|
return class extends e.Component {
|
|
315
316
|
constructor(e) {
|
|
316
|
-
super(e), this.__fiveEventDisposers = [], this.__fiveDisposeTimer = null, this.five = new
|
|
317
|
+
super(e), this.__fiveEventDisposers = [], this.__fiveDisposeTimer = null, this.five = new o(Object.assign(Object.assign({}, t), { renderer: void 0 })), this.loadWork = this.loadWork.bind(this), this.state = {};
|
|
317
318
|
}
|
|
318
319
|
loadWork(e, t, n, r = !0) {
|
|
319
320
|
if (this.props.work) throw Error("props 'works' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");
|
|
320
321
|
return this.five.load(e, t, n, r);
|
|
321
322
|
}
|
|
322
323
|
shouldComponentUpdate(e) {
|
|
323
|
-
return this.five.renderer && this.five && e.work && !
|
|
324
|
+
return this.five.renderer && this.five && e.work && !h(e.work, this.five.works) && this.five.load(e.work, e.initialState, e.initialOptions), !0;
|
|
324
325
|
}
|
|
325
326
|
componentDidMount() {
|
|
326
327
|
var e;
|
|
327
328
|
clearTimeout(this.__fiveDisposeTimer), this.__fiveDisposeTimer = null;
|
|
328
329
|
let n;
|
|
329
330
|
if (typeof window < "u") {
|
|
330
|
-
n =
|
|
331
|
+
n = u({
|
|
331
332
|
webgl2: t == null ? void 0 : t.webgl2,
|
|
332
333
|
preserveDrawingBuffer: t == null ? void 0 : t.preserveDrawingBuffer
|
|
333
334
|
});
|
|
334
|
-
let e =
|
|
335
|
+
let e = s() === 1 ? window.devicePixelRatio : 1;
|
|
335
336
|
n == null || n.setPixelRatio(e);
|
|
336
337
|
}
|
|
337
338
|
this.five.renderer = n, this.setState({ renderer: n }), this.__fiveEventDisposers.push(this.five.on("load", () => {
|
|
@@ -343,20 +344,20 @@ function f(t = {}) {
|
|
|
343
344
|
})), this.__fiveEventDisposers.push(this.five.on("error", (e) => {
|
|
344
345
|
this.props.onError ? this.props.onError(e) : console.warn(e.message);
|
|
345
346
|
}));
|
|
346
|
-
let
|
|
347
|
-
|
|
347
|
+
let r = this.props.work || this.props.initialWork;
|
|
348
|
+
r && this.five.load(r, this.props.initialState, this.props.initialOptions, (e = this.props.initialUserAction) == null ? !0 : e);
|
|
348
349
|
}
|
|
349
350
|
componentWillUnmount() {
|
|
350
351
|
var e;
|
|
351
352
|
(e = this.five.controller) == null || e.destroy();
|
|
352
353
|
let t = this.five.renderer;
|
|
353
|
-
this.five.renderer = void 0,
|
|
354
|
+
this.five.renderer = void 0, d(t), this.setState({ renderer: void 0 }), this.__fiveDisposeTimer = setTimeout(() => {
|
|
354
355
|
this.__fiveDisposeTimer = null, this.five.dispose();
|
|
355
356
|
}, 1e3);
|
|
356
357
|
}
|
|
357
358
|
render() {
|
|
358
359
|
let t = this.five, n = this.loadWork, r = this.state.renderer;
|
|
359
|
-
return e.createElement(
|
|
360
|
+
return e.createElement(f.Provider, { value: {
|
|
360
361
|
renderer: r,
|
|
361
362
|
five: t,
|
|
362
363
|
loadWork: n
|
|
@@ -366,15 +367,15 @@ function f(t = {}) {
|
|
|
366
367
|
}
|
|
367
368
|
//#endregion
|
|
368
369
|
//#region build/react/canvas.js
|
|
369
|
-
var
|
|
370
|
+
var _ = typeof window < "u" ? e.useLayoutEffect : e.useEffect, v = {
|
|
370
371
|
display: "inline-block",
|
|
371
372
|
overflow: "hidden"
|
|
372
|
-
},
|
|
373
|
-
let r =
|
|
373
|
+
}, y = ({ width: t, height: n }) => {
|
|
374
|
+
let r = p(), i = e.createRef(), a = Object.assign({
|
|
374
375
|
width: t,
|
|
375
376
|
height: n
|
|
376
|
-
},
|
|
377
|
-
return
|
|
377
|
+
}, v);
|
|
378
|
+
return _(() => {
|
|
378
379
|
let e = i.current;
|
|
379
380
|
if (!e || !r.renderer) return;
|
|
380
381
|
let a = r.renderer.domElement;
|
|
@@ -395,41 +396,102 @@ var p = typeof window < "u" ? e.useLayoutEffect : e.useEffect, m = {
|
|
|
395
396
|
ref: i,
|
|
396
397
|
style: a
|
|
397
398
|
});
|
|
399
|
+
}, b = ({ children: t }) => {
|
|
400
|
+
let n = p(), r = e.useRef(null);
|
|
401
|
+
return e.useEffect(() => {
|
|
402
|
+
let e = r.current;
|
|
403
|
+
if (!e || !n.renderer) return;
|
|
404
|
+
let t = n.renderer.domElement;
|
|
405
|
+
e.appendChild(t);
|
|
406
|
+
let i = () => {
|
|
407
|
+
var t;
|
|
408
|
+
let { width: r, height: i } = e.getBoundingClientRect();
|
|
409
|
+
r === 0 || i === 0 || (n.camera.aspect = r / i, n.camera.updateProjectionMatrix(), (t = n.renderer) == null || t.setSize(r, i), n.refresh({
|
|
410
|
+
width: r,
|
|
411
|
+
height: i
|
|
412
|
+
}), n.needsRender = !0);
|
|
413
|
+
}, a = new ResizeObserver(i);
|
|
414
|
+
return a.observe(e), i(), () => {
|
|
415
|
+
t.parentNode === e && e.removeChild(t), a.unobserve(e), a.disconnect();
|
|
416
|
+
};
|
|
417
|
+
}, []), e.createElement("div", {
|
|
418
|
+
ref: r,
|
|
419
|
+
style: {
|
|
420
|
+
position: "absolute",
|
|
421
|
+
top: 0,
|
|
422
|
+
left: 0,
|
|
423
|
+
right: 0,
|
|
424
|
+
bottom: 0
|
|
425
|
+
}
|
|
426
|
+
}, t);
|
|
427
|
+
}, x = ({ renderChildren: t, load: n, children: r, fallback: i }) => {
|
|
428
|
+
let a = p(), [o, s] = e.useState(!!t), [c, l] = e.useState(!1);
|
|
429
|
+
return e.useEffect(() => {
|
|
430
|
+
a.getElement() && (s(!0), n && n(a).then((e) => {
|
|
431
|
+
a.load(...e);
|
|
432
|
+
}));
|
|
433
|
+
}, [a]), e.useEffect(() => {
|
|
434
|
+
let e = () => l(!0);
|
|
435
|
+
return a.on("works.load", e), a.works && a.works.length > 0 && l(!0), () => {
|
|
436
|
+
a.off("works.load", e);
|
|
437
|
+
};
|
|
438
|
+
}, [a]), !c && !t || !o ? i == null ? null : e.createElement(e.Fragment, null, i) : e.createElement(e.Fragment, null, r);
|
|
439
|
+
}, S = {
|
|
440
|
+
position: "relative",
|
|
441
|
+
width: "100vw",
|
|
442
|
+
height: "100vh",
|
|
443
|
+
overflow: "hidden"
|
|
444
|
+
}, C = {
|
|
445
|
+
backgroundAlpha: 1,
|
|
446
|
+
backgroundColor: 0,
|
|
447
|
+
imageOptions: { size: 512 },
|
|
448
|
+
textureOptions: { autoResize: !1 },
|
|
449
|
+
preserveDrawingBuffer: !0,
|
|
450
|
+
webgl2: !0
|
|
451
|
+
}, w = ({ fiveInitArgs: t = C, renderChildren: n, plugins: r, load: i, children: a, fullscreen: o, autoCanvas: s = !0, fallback: c }) => {
|
|
452
|
+
let [l] = e.useState(() => g(Object.assign(Object.assign({}, t), { plugins: r }))), u = [];
|
|
453
|
+
s && u.push(e.createElement(b, { key: "auto-canvas" })), a && u.push(a);
|
|
454
|
+
let d = e.createElement(l, null, e.createElement(x, {
|
|
455
|
+
load: i,
|
|
456
|
+
renderChildren: n,
|
|
457
|
+
fallback: c
|
|
458
|
+
}, ...u));
|
|
459
|
+
return o ? e.createElement("div", { style: S }, d) : d;
|
|
398
460
|
};
|
|
399
461
|
//#endregion
|
|
400
462
|
//#region build/react/hooks/unsafe__useFiveInstance.js
|
|
401
|
-
function
|
|
402
|
-
return
|
|
463
|
+
function T() {
|
|
464
|
+
return p();
|
|
403
465
|
}
|
|
404
466
|
//#endregion
|
|
405
467
|
//#region build/react/hooks/useFiveSceneEffect.js
|
|
406
|
-
function
|
|
407
|
-
let r =
|
|
468
|
+
function E(t, n) {
|
|
469
|
+
let r = p(), i = [r];
|
|
408
470
|
n !== void 0 && (i = i.concat(n)), e.useLayoutEffect(() => t(r.scene), i);
|
|
409
471
|
}
|
|
410
|
-
var
|
|
472
|
+
var D = E;
|
|
411
473
|
//#endregion
|
|
412
474
|
//#region build/react/hooks/useFiveWork.js
|
|
413
|
-
function
|
|
414
|
-
let t =
|
|
475
|
+
function O() {
|
|
476
|
+
let t = p(), n = m(), [r, i] = e.useState(() => t.works);
|
|
415
477
|
return e.useLayoutEffect(() => t.on("load", () => i(t.works)), [t]), [r, n];
|
|
416
478
|
}
|
|
417
479
|
//#endregion
|
|
418
480
|
//#region build/react/hooks/useFiveState.js
|
|
419
|
-
function
|
|
481
|
+
function k(e) {
|
|
420
482
|
return Object.assign({}, e.state);
|
|
421
483
|
}
|
|
422
|
-
function
|
|
423
|
-
let t =
|
|
484
|
+
function A() {
|
|
485
|
+
let t = p(), [n, r] = e.useState(() => k(t)), i = e.useCallback((e, n = !1, r = !0) => {
|
|
424
486
|
let i = typeof e == "function" ? e(t.getCurrentState()) : e;
|
|
425
487
|
t.setState(i, n, r);
|
|
426
488
|
}, [t]);
|
|
427
|
-
return e.useLayoutEffect(() => t.on("stateChange", () => r(
|
|
489
|
+
return e.useLayoutEffect(() => t.on("stateChange", () => r(k(t))), [t]), [n, i];
|
|
428
490
|
}
|
|
429
491
|
//#endregion
|
|
430
492
|
//#region build/react/hooks/useFiveCurrentState.js
|
|
431
|
-
function
|
|
432
|
-
let t =
|
|
493
|
+
function j() {
|
|
494
|
+
let t = p(), [n, r] = e.useState(() => t.getCurrentState()), i = e.useCallback((e, n = !1, r = !0) => {
|
|
433
495
|
let i = typeof e == "function" ? e(t.getCurrentState()) : e;
|
|
434
496
|
t.setState(i, n, r);
|
|
435
497
|
}, [t]);
|
|
@@ -437,20 +499,20 @@ function S() {
|
|
|
437
499
|
}
|
|
438
500
|
//#endregion
|
|
439
501
|
//#region build/react/hooks/useFiveCurrentObserver.js
|
|
440
|
-
function
|
|
441
|
-
let t =
|
|
502
|
+
function M() {
|
|
503
|
+
let t = p(), [n, r] = e.useState(() => t.getCurrentState());
|
|
442
504
|
return e.useLayoutEffect(() => t.on("currentStateChange", () => r(t.getCurrentState())), [t]), t.works.getObserver(n);
|
|
443
505
|
}
|
|
444
506
|
//#endregion
|
|
445
507
|
//#region build/react/hooks/useFiveEventCallback.js
|
|
446
|
-
function
|
|
447
|
-
let i =
|
|
508
|
+
function ee(t, n, r) {
|
|
509
|
+
let i = p(), a = [i, t];
|
|
448
510
|
r !== void 0 && (a = a.concat(r)), e.useLayoutEffect(() => i.on(t, n), a);
|
|
449
511
|
}
|
|
450
512
|
//#endregion
|
|
451
513
|
//#region build/react/hooks/useFiveAction.js
|
|
452
|
-
function
|
|
453
|
-
let t =
|
|
514
|
+
function te() {
|
|
515
|
+
let t = p();
|
|
454
516
|
return {
|
|
455
517
|
updateCamera: e.useCallback((e, n) => t.updateCamera(e, n), [t]),
|
|
456
518
|
getPixels: e.useCallback(t.getPixels.bind(t), [t]),
|
|
@@ -461,48 +523,102 @@ function T() {
|
|
|
461
523
|
}
|
|
462
524
|
//#endregion
|
|
463
525
|
//#region build/react/hooks/useFiveProject2d.js
|
|
464
|
-
function
|
|
465
|
-
let t =
|
|
526
|
+
function ne() {
|
|
527
|
+
let t = p(), [n, r] = e.useState(() => Symbol());
|
|
466
528
|
return e.useLayoutEffect(() => t.on("cameraUpdate", () => r(Symbol())), [t]), e.useCallback((e, n) => t.project2d(e, n), [t]);
|
|
467
529
|
}
|
|
468
530
|
//#endregion
|
|
469
531
|
//#region build/react/hooks/useFiveCameraRaycaster.js
|
|
470
|
-
function
|
|
471
|
-
let
|
|
472
|
-
return new
|
|
532
|
+
function N(e) {
|
|
533
|
+
let t = e.camera.getWorldDirection(new a.Vector3());
|
|
534
|
+
return new a.Raycaster(e.camera.position, t);
|
|
473
535
|
}
|
|
474
|
-
function
|
|
475
|
-
let t =
|
|
476
|
-
return e.useLayoutEffect(() => t.on("cameraUpdate", () => r(
|
|
536
|
+
function re() {
|
|
537
|
+
let t = p(), [n, r] = e.useState(() => N(t));
|
|
538
|
+
return e.useLayoutEffect(() => t.on("cameraUpdate", () => r(N(t))), [t]), n;
|
|
477
539
|
}
|
|
478
540
|
//#endregion
|
|
479
541
|
//#region build/react/hooks/useFiveCameraDirection.js
|
|
480
|
-
function
|
|
481
|
-
return e.camera.getWorldDirection(new
|
|
542
|
+
function P(e) {
|
|
543
|
+
return e.camera.getWorldDirection(new a.Vector3());
|
|
482
544
|
}
|
|
483
|
-
function
|
|
484
|
-
let t =
|
|
485
|
-
return e.useLayoutEffect(() => t.on("cameraUpdate", () => r(
|
|
545
|
+
function F() {
|
|
546
|
+
let t = p(), [n, r] = e.useState(() => P(t));
|
|
547
|
+
return e.useLayoutEffect(() => t.on("cameraUpdate", () => r(P(t))), [t]), n;
|
|
486
548
|
}
|
|
487
549
|
//#endregion
|
|
488
550
|
//#region build/react/hooks/useFiveModelIntersectRaycaster.js
|
|
489
|
-
function
|
|
490
|
-
let t =
|
|
551
|
+
function I() {
|
|
552
|
+
let t = p();
|
|
491
553
|
return e.useCallback((e) => t.model.intersectRaycaster(e), [t]);
|
|
492
554
|
}
|
|
493
555
|
//#endregion
|
|
494
556
|
//#region build/react/hooks/useFiveModelReadyState.js
|
|
495
|
-
function
|
|
557
|
+
function L(e) {
|
|
496
558
|
return e.model.empty ? "Empty" : "Loaded";
|
|
497
559
|
}
|
|
498
|
-
function
|
|
499
|
-
let t =
|
|
500
|
-
return e.useLayoutEffect(() => t.on("modelLoaded", () => r(
|
|
560
|
+
function ie() {
|
|
561
|
+
let t = p(), [n, r] = e.useState(() => L(t));
|
|
562
|
+
return e.useLayoutEffect(() => t.on("modelLoaded", () => r(L(t))), [t]), n;
|
|
563
|
+
}
|
|
564
|
+
//#endregion
|
|
565
|
+
//#region build/react/hooks/useFivePlugin.js
|
|
566
|
+
var R = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map();
|
|
567
|
+
function B(e) {
|
|
568
|
+
let t = z.get(e);
|
|
569
|
+
t && t.forEach((e) => e());
|
|
570
|
+
}
|
|
571
|
+
function V(e, t) {
|
|
572
|
+
return z.has(e) || z.set(e, /* @__PURE__ */ new Set()), z.get(e).add(t), () => {
|
|
573
|
+
let n = z.get(e);
|
|
574
|
+
n && (n.delete(t), n.size === 0 && z.delete(e));
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
function H(e, t) {
|
|
578
|
+
return `${e}:${t}`;
|
|
579
|
+
}
|
|
580
|
+
function U(e, t) {
|
|
581
|
+
var n;
|
|
582
|
+
return (n = R.get(H(e, t))) == null ? void 0 : n.plugin;
|
|
583
|
+
}
|
|
584
|
+
function W(e, t, n) {
|
|
585
|
+
R.set(H(e, t), { plugin: n }), B(e);
|
|
586
|
+
}
|
|
587
|
+
function G(e, a) {
|
|
588
|
+
var o, s;
|
|
589
|
+
let c = p(), l = (s = (o = c.work) == null ? void 0 : o.workCode) == null ? "" : s, u = H(l, e), d = r(c), [, f] = i(0);
|
|
590
|
+
return n(() => {
|
|
591
|
+
if (l) return V(l, () => f((e) => e + 1));
|
|
592
|
+
}, [l]), n(() => {
|
|
593
|
+
if (d.current === c) return;
|
|
594
|
+
d.current = c;
|
|
595
|
+
let t = R.get(u);
|
|
596
|
+
if (!t) return;
|
|
597
|
+
let n = t.plugin;
|
|
598
|
+
if (a != null && a.reCreateOnFiveChange && a.createPlugin) {
|
|
599
|
+
typeof n.dispose == "function" && n.dispose();
|
|
600
|
+
let t = a.createPlugin(c);
|
|
601
|
+
R.set(u, { plugin: t }), c.plugins[e] = t, B(l);
|
|
602
|
+
} else n && (typeof n.updateFive == "function" ? n.updateFive(c) : "five" in n && (n.five = c));
|
|
603
|
+
}, [c]), t(() => {
|
|
604
|
+
let t = R.get(u);
|
|
605
|
+
if (t) return c.plugins[e] = t.plugin, t.plugin;
|
|
606
|
+
let n = c.plugins[e];
|
|
607
|
+
if (n) return R.set(u, { plugin: n }), n;
|
|
608
|
+
if (a != null && a.createPlugin) {
|
|
609
|
+
let t = a.createPlugin(c);
|
|
610
|
+
return R.set(u, { plugin: t }), c.plugins[e] = t, B(l), t;
|
|
611
|
+
}
|
|
612
|
+
}, [
|
|
613
|
+
u,
|
|
614
|
+
c,
|
|
615
|
+
a == null ? void 0 : a.createPlugin
|
|
616
|
+
])();
|
|
501
617
|
}
|
|
502
618
|
//#endregion
|
|
503
619
|
//#region build/react/hooks/useFiveFloor.js
|
|
504
|
-
function
|
|
505
|
-
let t =
|
|
620
|
+
function K() {
|
|
621
|
+
let t = p(), [n, r] = e.useState(t.model.shownFloor), [i, a] = e.useState(t.model.floorLength), o = e.useCallback((e) => {
|
|
506
622
|
typeof e == "number" ? t.model.show(e) : t.model.show();
|
|
507
623
|
}, [t]);
|
|
508
624
|
return e.useLayoutEffect(() => {
|
|
@@ -519,39 +635,39 @@ function N() {
|
|
|
519
635
|
}
|
|
520
636
|
//#endregion
|
|
521
637
|
//#region build/react/hooks/useFiveHelper.js
|
|
522
|
-
function
|
|
523
|
-
let t =
|
|
638
|
+
function q() {
|
|
639
|
+
let t = p(), [n, r] = e.useState(t.helperVisible), i = e.useCallback((e) => {
|
|
524
640
|
t.helperVisible = e;
|
|
525
641
|
}, [t]);
|
|
526
642
|
return e.useLayoutEffect(() => t.on("helpersVisibleChange", (e) => r(e)), [t]), [n, i];
|
|
527
643
|
}
|
|
528
644
|
//#endregion
|
|
529
645
|
//#region build/react/withFive.js
|
|
530
|
-
var
|
|
531
|
-
function
|
|
646
|
+
var J = "$five";
|
|
647
|
+
function Y(e, t) {
|
|
532
648
|
return t.indexOf(e) >= 0;
|
|
533
649
|
}
|
|
534
|
-
function
|
|
650
|
+
function X(e, t) {
|
|
535
651
|
for (let n of Object.keys(t)) t[n] !== void 0 && (e[n] = t[n]);
|
|
536
652
|
}
|
|
537
|
-
function
|
|
538
|
-
let r =
|
|
653
|
+
function ae(t, n) {
|
|
654
|
+
let r = Y("state", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
539
655
|
if (r) return Object.assign({}, t.state);
|
|
540
656
|
}, [t, i]);
|
|
541
657
|
return e.useLayoutEffect(() => {
|
|
542
658
|
if (r) return t.on("stateChange", () => a(Symbol()));
|
|
543
659
|
}, [t]), [o, i];
|
|
544
660
|
}
|
|
545
|
-
function
|
|
546
|
-
let r =
|
|
661
|
+
function oe(t, n) {
|
|
662
|
+
let r = Y("currentState", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
547
663
|
if (r) return t.getCurrentState();
|
|
548
664
|
}, [t, i]);
|
|
549
665
|
return e.useLayoutEffect(() => {
|
|
550
666
|
if (r) return t.on("currentStateChange", () => a(Symbol()));
|
|
551
667
|
}, [t]), [o, i];
|
|
552
668
|
}
|
|
553
|
-
function
|
|
554
|
-
let r =
|
|
669
|
+
function se(t, n) {
|
|
670
|
+
let r = Y("currentObserver", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
555
671
|
if (r) return t.getCurrentState();
|
|
556
672
|
}, [t, i]);
|
|
557
673
|
e.useLayoutEffect(() => {
|
|
@@ -560,147 +676,147 @@ function R(t, n) {
|
|
|
560
676
|
let s;
|
|
561
677
|
return o && (s = t.works.getObserver(o)), [s, i];
|
|
562
678
|
}
|
|
563
|
-
function
|
|
564
|
-
return [
|
|
679
|
+
function ce(e, t) {
|
|
680
|
+
return [Y("unsafe__fiveInstance", t) ? e : void 0];
|
|
565
681
|
}
|
|
566
|
-
function
|
|
567
|
-
let r =
|
|
682
|
+
function le(t, n) {
|
|
683
|
+
let r = Y("works", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
568
684
|
if (r) return t.works;
|
|
569
685
|
}, [t, i]);
|
|
570
686
|
return e.useLayoutEffect(() => {
|
|
571
687
|
if (r) return t.on("load", () => a(Symbol()));
|
|
572
688
|
}, [t]), [o, i];
|
|
573
689
|
}
|
|
574
|
-
function
|
|
575
|
-
let r =
|
|
690
|
+
function ue(t, n) {
|
|
691
|
+
let r = Y("model", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
576
692
|
if (r) return t.model;
|
|
577
693
|
}, [t, i]);
|
|
578
694
|
return e.useLayoutEffect(() => {
|
|
579
695
|
if (r) return t.on("modelLoaded", () => a(Symbol()));
|
|
580
696
|
}, [t]), [o, i];
|
|
581
697
|
}
|
|
582
|
-
function
|
|
583
|
-
return [
|
|
698
|
+
function de(e, t) {
|
|
699
|
+
return [Y("scene", t) ? e.scene : void 0];
|
|
584
700
|
}
|
|
585
|
-
function
|
|
586
|
-
let
|
|
587
|
-
if (
|
|
588
|
-
}, [
|
|
701
|
+
function fe(t, n) {
|
|
702
|
+
let r = Y("cameraDirection", n), [i, o] = e.useState(Symbol()), s = e.useMemo(() => {
|
|
703
|
+
if (r) return t.camera.getWorldDirection(new a.Vector3());
|
|
704
|
+
}, [t, i]);
|
|
589
705
|
return e.useLayoutEffect(() => {
|
|
590
|
-
if (
|
|
591
|
-
}, [
|
|
592
|
-
}
|
|
593
|
-
function
|
|
594
|
-
let
|
|
595
|
-
if (
|
|
596
|
-
let e =
|
|
597
|
-
return new
|
|
706
|
+
if (r) return t.on("cameraUpdate", () => o(Symbol()));
|
|
707
|
+
}, [t]), [s, i];
|
|
708
|
+
}
|
|
709
|
+
function pe(t, n) {
|
|
710
|
+
let r = Y("cameraRaycaster", n), [i, o] = e.useState(Symbol()), s = e.useMemo(() => {
|
|
711
|
+
if (r) {
|
|
712
|
+
let e = t.camera.getWorldDirection(new a.Vector3());
|
|
713
|
+
return new a.Raycaster(t.camera.position, e);
|
|
598
714
|
}
|
|
599
|
-
}, [
|
|
715
|
+
}, [t, i]);
|
|
600
716
|
return e.useLayoutEffect(() => {
|
|
601
|
-
if (
|
|
602
|
-
}, [
|
|
717
|
+
if (r) return t.on("cameraUpdate", () => o(Symbol()));
|
|
718
|
+
}, [t]), [s, i];
|
|
603
719
|
}
|
|
604
|
-
function
|
|
605
|
-
let r =
|
|
720
|
+
function me(t, n) {
|
|
721
|
+
let r = Y("modelReadyState", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
606
722
|
if (r) return t.model.empty ? "Empty" : "Loaded";
|
|
607
723
|
}, [t, i]);
|
|
608
724
|
return e.useLayoutEffect(() => {
|
|
609
725
|
if (r) return t.on("modelLoaded", () => a(Symbol()));
|
|
610
726
|
}, [t]), [o, i];
|
|
611
727
|
}
|
|
612
|
-
function
|
|
613
|
-
let r =
|
|
728
|
+
function he(t, n) {
|
|
729
|
+
let r = Y("shownFloor", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
614
730
|
if (r) return t.model.shownFloor;
|
|
615
731
|
}, [t, i]);
|
|
616
732
|
return e.useLayoutEffect(() => {
|
|
617
733
|
if (r) return t.on("modelShownFloorChange", () => a(Symbol()));
|
|
618
734
|
}, [t]), [o, i];
|
|
619
735
|
}
|
|
620
|
-
function
|
|
621
|
-
let r =
|
|
736
|
+
function ge(t, n) {
|
|
737
|
+
let r = Y("helperVisible", n), [i, a] = e.useState(Symbol()), o = e.useMemo(() => {
|
|
622
738
|
if (r) return t.helperVisible;
|
|
623
739
|
}, [t, i]);
|
|
624
740
|
return e.useLayoutEffect(() => {
|
|
625
741
|
if (r) return t.on("helpersVisibleChange", () => a(Symbol()));
|
|
626
742
|
}, [t]), [o, i];
|
|
627
743
|
}
|
|
628
|
-
function
|
|
629
|
-
if (
|
|
744
|
+
function _e(e, t) {
|
|
745
|
+
if (Y("loadWork", t)) return e;
|
|
630
746
|
}
|
|
631
|
-
function
|
|
632
|
-
if (
|
|
747
|
+
function ve(e, t) {
|
|
748
|
+
if (Y("setState", t)) return (...t) => e.setState(...t);
|
|
633
749
|
}
|
|
634
|
-
function
|
|
635
|
-
if (
|
|
750
|
+
function ye(e, t) {
|
|
751
|
+
if (Y("on", t)) return (...t) => e.on(...t);
|
|
636
752
|
}
|
|
637
|
-
function
|
|
638
|
-
if (
|
|
753
|
+
function be(e, t) {
|
|
754
|
+
if (Y("on", t)) return (...t) => e.once(...t);
|
|
639
755
|
}
|
|
640
|
-
function
|
|
641
|
-
if (
|
|
756
|
+
function xe(e, t) {
|
|
757
|
+
if (Y("off", t)) return (...t) => e.off(...t);
|
|
642
758
|
}
|
|
643
|
-
function
|
|
644
|
-
if (
|
|
759
|
+
function Se(e, t) {
|
|
760
|
+
if (Y("intersectRaycaster", t)) return (...t) => e.model.intersectRaycaster(...t);
|
|
645
761
|
}
|
|
646
|
-
function
|
|
647
|
-
if (
|
|
762
|
+
function Ce(e, t) {
|
|
763
|
+
if (Y("project2d", t)) return (...t) => e.project2d(...t);
|
|
648
764
|
}
|
|
649
|
-
function
|
|
650
|
-
if (
|
|
765
|
+
function we(e, t) {
|
|
766
|
+
if (Y("updateCamera", t)) return (...t) => e.updateCamera(...t);
|
|
651
767
|
}
|
|
652
|
-
function
|
|
653
|
-
if (
|
|
768
|
+
function Te(e, t) {
|
|
769
|
+
if (Y("getPixels", t)) return e.getPixels.bind(e);
|
|
654
770
|
}
|
|
655
|
-
function
|
|
656
|
-
if (
|
|
771
|
+
function Ee(e, t) {
|
|
772
|
+
if (Y("render", t)) return (...t) => e.render(...t);
|
|
657
773
|
}
|
|
658
|
-
function
|
|
659
|
-
if (
|
|
774
|
+
function De(e, t) {
|
|
775
|
+
if (Y("needsRender", t)) return () => {
|
|
660
776
|
e.needsRender = !0;
|
|
661
777
|
};
|
|
662
778
|
}
|
|
663
|
-
function
|
|
664
|
-
if (
|
|
779
|
+
function Oe(e, t) {
|
|
780
|
+
if (Y("preloadPano", t)) return (...t) => e.preloadPano(...t);
|
|
665
781
|
}
|
|
666
|
-
function
|
|
667
|
-
if (
|
|
782
|
+
function ke(e, t) {
|
|
783
|
+
if (Y("showFloor", t)) return (t) => {
|
|
668
784
|
typeof t == "number" ? e.model.show(t) : e.model.show();
|
|
669
785
|
};
|
|
670
786
|
}
|
|
671
|
-
function
|
|
672
|
-
if (
|
|
787
|
+
function Z(e, t) {
|
|
788
|
+
if (Y("toggleHelperVisible", t)) return (t) => {
|
|
673
789
|
e.helperVisible = t;
|
|
674
790
|
};
|
|
675
791
|
}
|
|
676
|
-
function
|
|
792
|
+
function Ae(t) {
|
|
677
793
|
return function(n) {
|
|
678
794
|
return e.forwardRef((r, i) => {
|
|
679
|
-
let a =
|
|
795
|
+
let a = p(), o = m(), [s] = ce(a, t), [c, l] = ae(a, t), [u, d] = oe(a, t), [f, h] = se(a, t), [g, _] = le(a, t), [v, y] = ue(a, t), [b] = de(a, t), [x, S] = fe(a, t), [C, w] = pe(a, t), [T, E] = me(a, t), [D, O] = he(a, t), [k, A] = ge(a, t), j = e.useMemo(() => {
|
|
680
796
|
let e = {};
|
|
681
|
-
return
|
|
682
|
-
setState:
|
|
683
|
-
loadWork:
|
|
684
|
-
on:
|
|
685
|
-
once:
|
|
686
|
-
off:
|
|
687
|
-
intersectRaycaster:
|
|
688
|
-
project2d:
|
|
689
|
-
updateCamera:
|
|
690
|
-
getPixels:
|
|
691
|
-
render:
|
|
692
|
-
needsRender:
|
|
693
|
-
preloadPano:
|
|
694
|
-
showFloor:
|
|
695
|
-
toggleHelperVisible:
|
|
797
|
+
return X(e, {
|
|
798
|
+
setState: ve(a, t),
|
|
799
|
+
loadWork: _e(o, t),
|
|
800
|
+
on: ye(a, t),
|
|
801
|
+
once: be(a, t),
|
|
802
|
+
off: xe(a, t),
|
|
803
|
+
intersectRaycaster: Se(a, t),
|
|
804
|
+
project2d: Ce(a, t),
|
|
805
|
+
updateCamera: we(a, t),
|
|
806
|
+
getPixels: Te(a, t),
|
|
807
|
+
render: Ee(a, t),
|
|
808
|
+
needsRender: De(a, t),
|
|
809
|
+
preloadPano: Oe(a, t),
|
|
810
|
+
showFloor: ke(a, t),
|
|
811
|
+
toggleHelperVisible: Z(a, t)
|
|
696
812
|
}), e;
|
|
697
813
|
}, [a, o]), M = e.useMemo(() => {
|
|
698
814
|
let e = Object.assign({}, j);
|
|
699
|
-
return
|
|
815
|
+
return X(e, {
|
|
700
816
|
unsafe__fiveInstance: s,
|
|
701
817
|
state: c,
|
|
702
|
-
currentState:
|
|
703
|
-
currentObserver:
|
|
818
|
+
currentState: u,
|
|
819
|
+
currentObserver: f,
|
|
704
820
|
work: g,
|
|
705
821
|
model: v,
|
|
706
822
|
scene: b,
|
|
@@ -713,8 +829,8 @@ function pe(t) {
|
|
|
713
829
|
}, [
|
|
714
830
|
a,
|
|
715
831
|
j,
|
|
832
|
+
l,
|
|
716
833
|
d,
|
|
717
|
-
p,
|
|
718
834
|
h,
|
|
719
835
|
_,
|
|
720
836
|
y,
|
|
@@ -731,7 +847,7 @@ function pe(t) {
|
|
|
731
847
|
});
|
|
732
848
|
};
|
|
733
849
|
}
|
|
734
|
-
function
|
|
850
|
+
function je(...e) {
|
|
735
851
|
return e;
|
|
736
852
|
}
|
|
737
853
|
//#endregion
|
|
@@ -744,10 +860,10 @@ function Q(e, t) {
|
|
|
744
860
|
}
|
|
745
861
|
return n;
|
|
746
862
|
}
|
|
747
|
-
function
|
|
863
|
+
function Me(e, t) {
|
|
748
864
|
return typeof e == "number" && typeof t == "number" && isNaN(e) && isNaN(t) ? !0 : e === t;
|
|
749
865
|
}
|
|
750
|
-
function
|
|
866
|
+
function Ne(e, t) {
|
|
751
867
|
for (let n = 0; n < e.length; n++) for (let r = 0; r < t.length; r++) if (e[n] === t[r]) return !0;
|
|
752
868
|
return !1;
|
|
753
869
|
}
|
|
@@ -767,19 +883,19 @@ var $ = class {
|
|
|
767
883
|
}
|
|
768
884
|
setValues(e, t) {
|
|
769
885
|
let n = [];
|
|
770
|
-
for (let r in t) e.indexOf(r) >= 0 && !
|
|
886
|
+
for (let r in t) e.indexOf(r) >= 0 && !Me(t[r], this.values[r]) && n.push(r);
|
|
771
887
|
if (n.length === 0) return;
|
|
772
888
|
let r = Object.assign({}, this.values);
|
|
773
889
|
for (let e of n) this.values[e] = t[e];
|
|
774
890
|
this.onValuesChange && this.onValuesChange(this.values, r);
|
|
775
891
|
for (let [e, t] of this.listeners) {
|
|
776
|
-
if (!
|
|
892
|
+
if (!Ne(e, n)) continue;
|
|
777
893
|
let i = Q(r, e);
|
|
778
894
|
t(Q(this.values, e), i);
|
|
779
895
|
}
|
|
780
896
|
}
|
|
781
897
|
};
|
|
782
|
-
function
|
|
898
|
+
function Pe(t) {
|
|
783
899
|
let n = e.createContext(null);
|
|
784
900
|
return {
|
|
785
901
|
useStore(t) {
|
|
@@ -823,4 +939,4 @@ function _e(t) {
|
|
|
823
939
|
};
|
|
824
940
|
}
|
|
825
941
|
//#endregion
|
|
826
|
-
export {
|
|
942
|
+
export { w as FiveApp, b as FiveAutoCanvas, y as FiveCanvas, J as INJECTION_PROPNAME, $ as Store, je as createFiveFeature, g as createFiveProvider, Pe as createStore, U as getPlugin, W as setPlugin, T as unsafe__useFiveInstance, te as useFiveAction, F as useFiveCameraDirection, re as useFiveCameraRaycaster, M as useFiveCurrentObserver, j as useFiveCurrentState, ee as useFiveEventCallback, K as useFiveFloor, q as useFiveHelper, I as useFiveModelIntersectRaycaster, ie as useFiveModelReadyState, G as useFivePlugin, ne as useFiveProject2d, D as useFiveScene, E as useFiveSceneEffect, A as useFiveState, O as useFiveWork, Ae as withFive };
|