@realsee/dnalogel 2.0.0-alpha.35-beta2 → 2.0.0-alpha.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PanoSpatialTagPlugin/Plugin.d.ts +2 -0
- package/dist/PanoSpatialTagPlugin/index.js +40 -45
- package/dist/index.es.js +40 -45
- package/dist/index.js +40 -45
- package/dist/index.umd.js +40 -45
- package/docs/assets/search.js +1 -1
- package/docs/classes/Magnifier.html +4 -4
- package/docs/classes/ModelRoomLabelController.html +4 -4
- package/docs/classes/PanoFloorplanRadarPluginController.html +2 -2
- package/docs/enums/CameraMovementEffect.html +2 -2
- package/docs/enums/DIRECTION.html +1 -1
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/ModelFloorplanErrorType.html +1 -1
- package/docs/enums/Rotation.html +2 -2
- package/docs/index.html +1 -1
- package/docs/interfaces/CSS3DRenderPluginExportType.html +2 -2
- package/docs/interfaces/CameraMovementPluginExportType.html +2 -2
- package/docs/interfaces/FloorplanBounding.html +4 -4
- package/docs/interfaces/FloorplanData.html +2 -2
- package/docs/interfaces/FloorplanEntrance.html +7 -7
- package/docs/interfaces/FloorplanExtraObject.html +3 -3
- package/docs/interfaces/FloorplanExtraObject3D.html +2 -2
- package/docs/interfaces/FloorplanFloorData.html +2 -2
- package/docs/interfaces/FloorplanImagePosition.html +2 -2
- package/docs/interfaces/FloorplanObserver.html +2 -2
- package/docs/interfaces/FloorplanOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanPosition.html +2 -2
- package/docs/interfaces/FloorplanRoomItem.html +6 -6
- package/docs/interfaces/FloorplanRoomLabelItem.html +3 -3
- package/docs/interfaces/FloorplanServerBounding.html +4 -4
- package/docs/interfaces/FloorplanServerComputedData.html +1 -1
- package/docs/interfaces/FloorplanServerData.html +2 -2
- package/docs/interfaces/FloorplanServerEntrance.html +7 -7
- package/docs/interfaces/FloorplanServerFloorData.html +2 -2
- package/docs/interfaces/FloorplanServerImagePosition.html +2 -2
- package/docs/interfaces/FloorplanServerObserver.html +2 -2
- package/docs/interfaces/FloorplanServerOutlineItem.html +2 -2
- package/docs/interfaces/FloorplanServerPosition.html +2 -2
- package/docs/interfaces/FloorplanServerRoomItem.html +7 -7
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +3 -3
- package/docs/interfaces/ItemLabelPluginData.html +1 -1
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/ModelViewPluginExportType.html +1 -1
- package/docs/interfaces/OpenParameter.html +2 -2
- package/docs/interfaces/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
- package/docs/interfaces/PanoFloorplanRadarPluginControllerParameter.html +1 -1
- package/docs/interfaces/PanoMeasureParameterType.html +1 -1
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
- package/docs/interfaces/Point.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/Room.html +1 -1
- package/docs/interfaces/RoomInfo.html +1 -1
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/RoomRules.html +1 -1
- package/docs/interfaces/Rooms.html +1 -1
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +9 -9
- package/docs/modules.html +20 -20
- package/libs/PanoSpatialTagPlugin/Components/tag.js +2 -2
- package/libs/PanoSpatialTagPlugin/Plugin.d.ts +2 -0
- package/libs/PanoSpatialTagPlugin/Plugin.js +38 -43
- package/package.json +1 -1
|
@@ -57,7 +57,7 @@ function create_fragment(ctx) {
|
|
|
57
57
|
div3 = element("div");
|
|
58
58
|
div2 = element("div");
|
|
59
59
|
attr(div0, "class", "PanoSpatialTagPlugin__tag-shadow svelte-8ki8yx");
|
|
60
|
-
set_style(div0, "transform", "translate(" + /*contentWidth*/ ctx[7] / 2 * /*contentZoom*/ ctx[3] * 3 + "px, " + /*contentHeight*/ ctx[8] / 2 * (/*upsideDown*/ ctx[1] ? -1 : 1) * /*contentZoom*/ ctx[3] * 3 + "px)");
|
|
60
|
+
set_style(div0, "transform", "translate(" + /*contentWidth*/ ctx[7] / 2 * /*contentZoom*/ ctx[3] * 3 + "px, " + /*contentHeight*/ ctx[8] / 2 * (/*upsideDown*/ ctx[1] ? -1 : 1) * /*contentZoom*/ ctx[3] * 3 + "px) scale(" + 1 / /*contentZoom*/ ctx[3] + ")");
|
|
61
61
|
attr(i0, "class", "PanoSpatialTagPlugin__tag-flagpole svelte-8ki8yx");
|
|
62
62
|
set_style(i0, "width", /*lineWidthZoom*/ ctx[4] + "rem");
|
|
63
63
|
attr(i1, "class", "PanoSpatialTagPlugin__tag-line1 svelte-8ki8yx");
|
|
@@ -97,7 +97,7 @@ function create_fragment(ctx) {
|
|
|
97
97
|
},
|
|
98
98
|
p(ctx, [dirty]) {
|
|
99
99
|
if (dirty & /*contentWidth, contentZoom, contentHeight, upsideDown*/ 394) {
|
|
100
|
-
set_style(div0, "transform", "translate(" + /*contentWidth*/ ctx[7] / 2 * /*contentZoom*/ ctx[3] * 3 + "px, " + /*contentHeight*/ ctx[8] / 2 * (/*upsideDown*/ ctx[1] ? -1 : 1) * /*contentZoom*/ ctx[3] * 3 + "px)");
|
|
100
|
+
set_style(div0, "transform", "translate(" + /*contentWidth*/ ctx[7] / 2 * /*contentZoom*/ ctx[3] * 3 + "px, " + /*contentHeight*/ ctx[8] / 2 * (/*upsideDown*/ ctx[1] ? -1 : 1) * /*contentZoom*/ ctx[3] * 3 + "px) scale(" + 1 / /*contentZoom*/ ctx[3] + ")");
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
if (dirty & /*lineWidthZoom*/ 16) {
|
|
@@ -15,6 +15,8 @@ export interface PanoSpatialTagPluginParameterType {
|
|
|
15
15
|
minRad?: number;
|
|
16
16
|
nearTolerance?: number;
|
|
17
17
|
upsideHeight?: number;
|
|
18
|
+
minDistance?: number;
|
|
19
|
+
maxDistance?: number;
|
|
18
20
|
}
|
|
19
21
|
export interface PanoSpatialTagPluginExportType {
|
|
20
22
|
load: (data: PanoSpatialTagPluginData) => void;
|
|
@@ -8,13 +8,11 @@ import render from '../shared-utils/tinyEJSrender';
|
|
|
8
8
|
const MESH_SIZE = 0.001;
|
|
9
9
|
const RAY_TOLERANT_DISTANCE = 0.01;
|
|
10
10
|
const BLUR_IMAGE_URL = 'https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png';
|
|
11
|
-
const MIN_DISTANCE = 1.2;
|
|
12
|
-
const MAX_DISTANCE = 3.5;
|
|
13
11
|
/**
|
|
14
12
|
* 空间游走标签插件
|
|
15
13
|
*/
|
|
16
14
|
export const PanoSpatialTagPlugin = (five, params) => {
|
|
17
|
-
var _a, _b, _c, _d, _e, _f;
|
|
15
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
18
16
|
let wrapper = params === null || params === void 0 ? void 0 : params.container;
|
|
19
17
|
let centerY = 1.4;
|
|
20
18
|
const wait = (_a = params === null || params === void 0 ? void 0 : params.wait) !== null && _a !== void 0 ? _a : 200;
|
|
@@ -22,6 +20,8 @@ export const PanoSpatialTagPlugin = (five, params) => {
|
|
|
22
20
|
const minRad = (_c = params === null || params === void 0 ? void 0 : params.minRad) !== null && _c !== void 0 ? _c : Math.PI / 4;
|
|
23
21
|
const nearTolerance = (_d = params === null || params === void 0 ? void 0 : params.nearTolerance) !== null && _d !== void 0 ? _d : 100;
|
|
24
22
|
const upsideHeight = (_e = params === null || params === void 0 ? void 0 : params.upsideHeight) !== null && _e !== void 0 ? _e : 1.6;
|
|
23
|
+
const minDistance = (_f = params === null || params === void 0 ? void 0 : params.minDistance) !== null && _f !== void 0 ? _f : 1.2;
|
|
24
|
+
const maxDistance = (_g = params === null || params === void 0 ? void 0 : params.maxDistance) !== null && _g !== void 0 ? _g : 3.5;
|
|
25
25
|
// const foldPercent = params?.foldPercent ?? 20
|
|
26
26
|
const css3DRender = CSS3DRenderPlugin(five);
|
|
27
27
|
const container = document.createElement('div');
|
|
@@ -76,7 +76,7 @@ export const PanoSpatialTagPlugin = (five, params) => {
|
|
|
76
76
|
frustum.setFromProjectionMatrix(projScreenMatrix);
|
|
77
77
|
state.tags.forEach(tag => {
|
|
78
78
|
const distance = camera.position.clone().setY(centerY).distanceTo(tag.position);
|
|
79
|
-
if (distance <
|
|
79
|
+
if (distance < minDistance || distance > maxDistance)
|
|
80
80
|
return tag.destroying = true;
|
|
81
81
|
if (!frustum.containsPoint(tag.position))
|
|
82
82
|
return tag.destroying = true;
|
|
@@ -88,16 +88,16 @@ export const PanoSpatialTagPlugin = (five, params) => {
|
|
|
88
88
|
state.tags.forEach(tag => {
|
|
89
89
|
if (tag.destroying) {
|
|
90
90
|
tag.app.$set({
|
|
91
|
-
contentZoom: 0.1 + camera.position.distanceTo(tag.position) /
|
|
92
|
-
lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(tag.position) /
|
|
91
|
+
contentZoom: 0.1 + camera.position.distanceTo(tag.position) / maxDistance,
|
|
92
|
+
lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(tag.position) / maxDistance),
|
|
93
93
|
destroying: tag.destroying,
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
else {
|
|
97
97
|
tag.app.$set({
|
|
98
|
-
lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(tag.position) /
|
|
99
|
-
lineHeightZoom: 0.4 + (camera.position.distanceTo(tag.position) -
|
|
100
|
-
contentZoom: 0.1 + camera.position.distanceTo(tag.position) /
|
|
98
|
+
lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(tag.position) / maxDistance),
|
|
99
|
+
lineHeightZoom: 0.4 + (camera.position.distanceTo(tag.position) - minDistance) / maxDistance * 0.6,
|
|
100
|
+
contentZoom: 0.1 + camera.position.distanceTo(tag.position) / maxDistance,
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
});
|
|
@@ -171,7 +171,7 @@ export const PanoSpatialTagPlugin = (five, params) => {
|
|
|
171
171
|
if (state.tags.find(tag => point.id === tag.id && !tag.destroying))
|
|
172
172
|
return result;
|
|
173
173
|
const distance = camera.position.clone().setY(centerY).distanceTo(point.position);
|
|
174
|
-
if (distance <
|
|
174
|
+
if (distance < minDistance || distance > maxDistance)
|
|
175
175
|
return result;
|
|
176
176
|
if (!frustum.containsPoint(point.position))
|
|
177
177
|
return result;
|
|
@@ -256,9 +256,9 @@ export const PanoSpatialTagPlugin = (five, params) => {
|
|
|
256
256
|
props: {
|
|
257
257
|
id,
|
|
258
258
|
content: state.render(state.template, replacement),
|
|
259
|
-
lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(position) /
|
|
260
|
-
lineHeightZoom: 0.4 + (camera.position.distanceTo(position) -
|
|
261
|
-
contentZoom: 0.1 + camera.position.distanceTo(position) /
|
|
259
|
+
lineWidthZoom: 0.38 * (0.01 + camera.position.distanceTo(position) / maxDistance),
|
|
260
|
+
lineHeightZoom: 0.4 + (camera.position.distanceTo(position) - minDistance) / maxDistance * 0.6,
|
|
261
|
+
contentZoom: 0.1 + camera.position.distanceTo(position) / maxDistance,
|
|
262
262
|
upsideDown: position.y > upsideHeight,
|
|
263
263
|
folded: state.folded,
|
|
264
264
|
events: state.events,
|
|
@@ -369,6 +369,22 @@ export const PanoSpatialTagPlugin = (five, params) => {
|
|
|
369
369
|
tag.app.$set({ folded: true });
|
|
370
370
|
});
|
|
371
371
|
};
|
|
372
|
+
const onResize = () => {
|
|
373
|
+
five.once('renderFrame', updateOrigins);
|
|
374
|
+
};
|
|
375
|
+
const onModelLoaded = () => {
|
|
376
|
+
if (!wrapper)
|
|
377
|
+
wrapper = five.getElement().parentElement;
|
|
378
|
+
if (wrapper)
|
|
379
|
+
wrapper.appendChild(container);
|
|
380
|
+
state.forbidden = false;
|
|
381
|
+
centerY = five.model.bounding.getCenter(new THREE.Vector3()).y;
|
|
382
|
+
updateTags();
|
|
383
|
+
five.on('panoWillArrive', onPanoWillArrive);
|
|
384
|
+
five.on('panoArrived', onPanoArrived);
|
|
385
|
+
five.on('modeChange', onModeChange);
|
|
386
|
+
five.on('cameraUpdate', onCameraUpdate);
|
|
387
|
+
};
|
|
372
388
|
const dispose = () => {
|
|
373
389
|
blurImage = null;
|
|
374
390
|
css3DRender.disposeAll();
|
|
@@ -379,41 +395,20 @@ export const PanoSpatialTagPlugin = (five, params) => {
|
|
|
379
395
|
});
|
|
380
396
|
state.origins = [];
|
|
381
397
|
state.tags = [];
|
|
398
|
+
five.off('modelLoaded', onModelLoaded);
|
|
399
|
+
five.off('renderFrame', updateOrigins);
|
|
382
400
|
five.off('panoWillArrive', onPanoWillArrive);
|
|
383
401
|
five.off('panoArrived', onPanoArrived);
|
|
384
402
|
five.off('modeChange', onModeChange);
|
|
385
403
|
five.off('cameraUpdate', onCameraUpdate);
|
|
386
|
-
|
|
404
|
+
five.off('dispose', dispose);
|
|
405
|
+
window.removeEventListener('resize', onResize, false);
|
|
387
406
|
};
|
|
388
|
-
window.addEventListener('resize',
|
|
389
|
-
if ((
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
wrapper.appendChild(container);
|
|
394
|
-
state.forbidden = false;
|
|
395
|
-
centerY = five.model.bounding.getCenter(new THREE.Vector3()).y;
|
|
396
|
-
updateTags();
|
|
397
|
-
five.on('panoWillArrive', onPanoWillArrive);
|
|
398
|
-
five.on('panoArrived', onPanoArrived);
|
|
399
|
-
five.on('modeChange', onModeChange);
|
|
400
|
-
five.on('cameraUpdate', onCameraUpdate);
|
|
401
|
-
}
|
|
402
|
-
else {
|
|
403
|
-
five.once('modelLoaded', () => {
|
|
404
|
-
if (!wrapper)
|
|
405
|
-
wrapper = five.getElement().parentElement;
|
|
406
|
-
if (wrapper)
|
|
407
|
-
wrapper.appendChild(container);
|
|
408
|
-
centerY = five.model.bounding.getCenter(new THREE.Vector3()).y;
|
|
409
|
-
state.forbidden = false;
|
|
410
|
-
updateTags();
|
|
411
|
-
five.on('panoWillArrive', onPanoWillArrive);
|
|
412
|
-
five.on('panoArrived', onPanoArrived);
|
|
413
|
-
five.on('modeChange', onModeChange);
|
|
414
|
-
five.on('cameraUpdate', onCameraUpdate);
|
|
415
|
-
});
|
|
416
|
-
}
|
|
407
|
+
window.addEventListener('resize', onResize, false);
|
|
408
|
+
if ((_h = five === null || five === void 0 ? void 0 : five.model) === null || _h === void 0 ? void 0 : _h.loaded)
|
|
409
|
+
onModelLoaded();
|
|
410
|
+
else
|
|
411
|
+
five.once('modelLoaded', onModelLoaded);
|
|
417
412
|
five.on('dispose', dispose);
|
|
418
413
|
return {
|
|
419
414
|
load,
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"repository": "https://github.com/realsee-developer/dnalogel.git",
|
|
9
9
|
"description": "如视 VR 看房插件合集",
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "2.0.0-alpha.35
|
|
11
|
+
"version": "2.0.0-alpha.35",
|
|
12
12
|
"license": "SEE LICENSE IN TERMS.txt",
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "yarn run tsb && yarn run build:rollup && yarn run build:components && yarn build:docs",
|