@realsee/dnalogel 0.1.2 → 0.1.7

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.
Files changed (215) hide show
  1. package/components/ARVideoFigure/ARVideoFigureMesh.js +56 -32
  2. package/components/ARVideoFigure/ARVideoFigureScene.js +30 -19
  3. package/components/ARVideoFigure/ImgBgTransparent.js +22 -6
  4. package/components/ARVideoFigure/ImgBgTransparentMesh.js +40 -30
  5. package/components/ARVideoFigure/fragmentShader.js +2 -0
  6. package/components/ARVideoFigure/index.js +22 -6
  7. package/components/ARVideoFigure/vertexShader.js +2 -0
  8. package/components/GLTFView/index.d.ts +72 -0
  9. package/components/GLTFView/index.js +149 -0
  10. package/components/GlassFilters/index.js +25 -1
  11. package/components/ModelView/ModelViewController.js +39 -29
  12. package/components/ModelView/index.js +4 -2
  13. package/components/PaintBrush/index.js +15 -1
  14. package/components/PanoTag/index.js +2 -0
  15. package/data/1aGKl9JmrlXMXx8d.js +2 -0
  16. package/data/54djM0oR6ky3Ey8e.d.ts +55 -0
  17. package/data/54djM0oR6ky3Ey8e.js +350 -0
  18. package/data/6gyq3v1verxD7JO1.js +2 -0
  19. package/data/8054djM0oR6ky3Ey8e.d.ts +55 -0
  20. package/data/8054djM0oR6ky3Ey8e.js +350 -0
  21. package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.js +2 -0
  22. package/data/PrXel3aqGbp34JQn.js +2 -0
  23. package/data/XJ6NMLWnkAY3Rdx8.d.ts +843 -0
  24. package/data/XJ6NMLWnkAY3Rdx8.js +7989 -0
  25. package/data/YdoNP9K4rwQDwjJr.js +2 -0
  26. package/data/ZLvK29zj4L29Jowd.d.ts +55 -0
  27. package/data/ZLvK29zj4L29Jowd.js +372 -0
  28. package/data/auto3d-njL5J99VwCmnjtQElOmXQr.js +2 -0
  29. package/data/extrude-walls/ZLvK29zj4L29Jowd.d.ts +5 -0
  30. package/data/extrude-walls/ZLvK29zj4L29Jowd.js +14 -0
  31. package/data/extrude-walls/lo024DEgzanMj5BE.d.ts +5 -0
  32. package/data/extrude-walls/lo024DEgzanMj5BE.js +14 -0
  33. package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.d.ts +85 -0
  34. package/data/jd6oMOzPxnQ3BvxY_B7yw51J9rXlhYhjhGTOgRVqu6WeEqjNX.js +511 -0
  35. package/data/lo024DEgzanMj5BE.d.ts +55 -0
  36. package/data/lo024DEgzanMj5BE.js +966 -0
  37. package/data/oPzy3ApbjjpD8YdR.js +2 -0
  38. package/data/qjAxMG4XbPn96wKG.js +2 -0
  39. package/data/rXel3aPQRRBD4JQn.js +2 -0
  40. package/data/vLykj3NWrllMrG06.d.ts +2 -0
  41. package/data/vLykj3NWrllMrG06.js +199 -2
  42. package/data/wz0QV9KA4ugyo9ME.js +2 -0
  43. package/data/zxMawr9raSg8LYjG.d.ts +53 -0
  44. package/data/zxMawr9raSg8LYjG.js +590 -0
  45. package/examples/FiveStateController/index.js +9 -15
  46. package/examples/VRHouse/Mobile.js +15 -1
  47. package/examples/VRHouse/PC.js +15 -1
  48. package/examples/VRHouse/index.js +15 -1
  49. package/index.js +4 -2
  50. package/libs/gltf-viewer/Subscribe.d.ts +76 -0
  51. package/libs/gltf-viewer/Subscribe.js +231 -0
  52. package/libs/gltf-viewer/coordsMoveByOffset.d.ts +13 -0
  53. package/libs/gltf-viewer/coordsMoveByOffset.js +22 -0
  54. package/libs/gltf-viewer/coordsToDirection.d.ts +5 -0
  55. package/{components/PBRView/index.js → libs/gltf-viewer/coordsToDirection.js} +29 -19
  56. package/libs/gltf-viewer/formatRad.d.ts +1 -0
  57. package/libs/gltf-viewer/formatRad.js +13 -0
  58. package/libs/gltf-viewer/getFrameTime.d.ts +1 -0
  59. package/libs/gltf-viewer/getFrameTime.js +28 -0
  60. package/libs/gltf-viewer/index.d.ts +55 -0
  61. package/libs/gltf-viewer/index.js +650 -0
  62. package/libs/gltf-viewer/mouseWheel.d.ts +2 -0
  63. package/libs/gltf-viewer/mouseWheel.js +59 -0
  64. package/libs/gltf-viewer/requestAnimationFrame.d.ts +1 -0
  65. package/libs/gltf-viewer/requestAnimationFrame.js +18 -0
  66. package/libs/gltf-viewer/requestAnimationFrameInterval.d.ts +1 -0
  67. package/libs/gltf-viewer/requestAnimationFrameInterval.js +31 -0
  68. package/libs/gltf-viewer/uuid.d.ts +4 -0
  69. package/libs/gltf-viewer/uuid.js +28 -0
  70. package/package.json +8 -4
  71. package/plugins/AutoPreloadPlugin/index.d.ts +23 -0
  72. package/plugins/AutoPreloadPlugin/index.js +111 -0
  73. package/plugins/CSS3DRenderPlugin/components/Marker/index.js +24 -16
  74. package/plugins/CSS3DRenderPlugin/index.d.ts +3 -2
  75. package/plugins/CSS3DRenderPlugin/index.js +79 -46
  76. package/plugins/CameraMovementPlugin/index.js +33 -9
  77. package/plugins/CameraMovementPlugin/typing.js +2 -0
  78. package/plugins/ModelChassisCompassPlugin/index.d.ts +7 -3
  79. package/plugins/ModelChassisCompassPlugin/index.js +34 -33
  80. package/plugins/ModelEntryDoorGuidePlugin/index.d.ts +13 -1
  81. package/plugins/ModelEntryDoorGuidePlugin/index.js +233 -2
  82. package/plugins/ModelExtrudeWallsPlugin/index.d.ts +16 -0
  83. package/plugins/ModelExtrudeWallsPlugin/index.js +252 -0
  84. package/plugins/ModelRoomLabelPlugin/Controller.d.ts +35 -0
  85. package/plugins/ModelRoomLabelPlugin/Controller.js +153 -0
  86. package/plugins/ModelRoomLabelPlugin/RoomLabelItem.d.ts +8 -0
  87. package/plugins/ModelRoomLabelPlugin/RoomLabelItem.js +66 -0
  88. package/plugins/ModelRoomLabelPlugin/RoomLabelItems.d.ts +7 -0
  89. package/plugins/ModelRoomLabelPlugin/RoomLabelItems.js +159 -0
  90. package/plugins/ModelRoomLabelPlugin/index.d.ts +8 -0
  91. package/plugins/ModelRoomLabelPlugin/index.js +18 -0
  92. package/plugins/ModelRoomLabelPlugin/typings.d.ts +35 -0
  93. package/plugins/ModelRoomLabelPlugin/typings.js +7 -0
  94. package/plugins/ModelRoomLabelPlugin/utils/parseData.d.ts +3 -0
  95. package/plugins/ModelRoomLabelPlugin/utils/parseData.js +35 -0
  96. package/plugins/ModelTVVideoPlugin/index.js +100 -16
  97. package/plugins/ModelViewPlugin/index.js +25 -1
  98. package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.js +29 -25
  99. package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.js +15 -1
  100. package/plugins/PanoCursorRaycasterPlugin/index.js +13 -6
  101. package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.js +4 -2
  102. package/plugins/PanoCursorRaycasterPlugin/utils/createLine.js +15 -1
  103. package/plugins/PanoDoorLabelPlugin/index.js +2 -0
  104. package/plugins/PanoIRobotPlugin/index.js +2 -0
  105. package/plugins/PanoMaskSelectorPlugin/compare.d.ts +1 -0
  106. package/plugins/PanoMaskSelectorPlugin/compare.js +17 -0
  107. package/plugins/PanoMaskSelectorPlugin/createBox.d.ts +7 -0
  108. package/plugins/PanoMaskSelectorPlugin/createBox.js +79 -0
  109. package/plugins/PanoMaskSelectorPlugin/createTextures.d.ts +3 -0
  110. package/plugins/PanoMaskSelectorPlugin/createTextures.js +45 -0
  111. package/plugins/PanoMaskSelectorPlugin/fragmentShader.d.ts +1 -0
  112. package/plugins/PanoMaskSelectorPlugin/fragmentShader.js +10 -0
  113. package/plugins/PanoMaskSelectorPlugin/index.d.ts +49 -0
  114. package/plugins/PanoMaskSelectorPlugin/index.js +348 -0
  115. package/plugins/PanoMaskSelectorPlugin/vertexShader.d.ts +1 -0
  116. package/plugins/PanoMaskSelectorPlugin/vertexShader.js +10 -0
  117. package/plugins/PanoRulerPlugin/data/roomInfo.js +2 -0
  118. package/plugins/PanoRulerPlugin/data/roomRules.js +2 -0
  119. package/plugins/PanoRulerPlugin/index.js +68 -20
  120. package/plugins/PanoRulerPlugin/typings.js +2 -0
  121. package/plugins/PanoTVVideoPlugin/index.d.ts +2 -0
  122. package/plugins/PanoTVVideoPlugin/index.js +108 -26
  123. package/plugins/TreasurePlugin/Controller.js +58 -52
  124. package/plugins/TreasurePlugin/TreasureFaceAnime.js +36 -21
  125. package/plugins/TreasurePlugin/TreasureObject.js +60 -56
  126. package/plugins/TreasurePlugin/TreasureOpenAnime.js +38 -19
  127. package/plugins/TreasurePlugin/constants.js +2 -0
  128. package/plugins/TreasurePlugin/index.js +2 -0
  129. package/plugins/TreasurePlugin/typings.js +2 -0
  130. package/plugins/floorplan/Assets/floorplanExtraObject.js +2 -0
  131. package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +71 -88
  132. package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +25 -5
  133. package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +19 -4
  134. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.js +28 -4
  135. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +28 -5
  136. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +20 -6
  137. package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +30 -8
  138. package/plugins/floorplan/ModelFloorplanPlugin/controller.style.js +2 -0
  139. package/plugins/floorplan/ModelFloorplanPlugin/index.js +4 -2
  140. package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.js +2 -0
  141. package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +2 -0
  142. package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +14 -22
  143. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +25 -3
  144. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +6 -2
  145. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +19 -3
  146. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.js +28 -4
  147. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.js +22 -6
  148. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.js +29 -19
  149. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.js +2 -0
  150. package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +44 -47
  151. package/plugins/floorplan/PanoFloorplanRadarPlugin/index.js +4 -2
  152. package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +50 -55
  153. package/plugins/floorplan/TopviewFloorplanPlugin/index.js +2 -0
  154. package/plugins/floorplan/TopviewFloorplanPlugin/style.js +2 -0
  155. package/plugins/floorplan/components/FloorplanImage.js +15 -1
  156. package/plugins/floorplan/typings/floorplanData.js +2 -0
  157. package/plugins/floorplan/typings/floorplanServerData.js +2 -0
  158. package/plugins/floorplan/utils/formatData.js +28 -10
  159. package/plugins/floorplan/utils/formatPosition.js +10 -8
  160. package/shared-utils/Preloader.js +6 -0
  161. package/shared-utils/Subscribe.js +36 -16
  162. package/shared-utils/animationFrame/BetterTween.js +28 -27
  163. package/shared-utils/animationFrame/calculateProgress.js +2 -0
  164. package/shared-utils/animationFrame/formatRad.js +2 -0
  165. package/shared-utils/animationFrame/index.js +12 -0
  166. package/shared-utils/animationFrame/tween.js +17 -1
  167. package/shared-utils/changeModelCanvansOpacity.js +14 -0
  168. package/shared-utils/createCanvasTextTexture.d.ts +8 -0
  169. package/shared-utils/createCanvasTextTexture.js +31 -0
  170. package/shared-utils/createFiveContainer.js +23 -17
  171. package/shared-utils/createLine/index.js +15 -1
  172. package/shared-utils/debounce.js +4 -0
  173. package/shared-utils/equal.js +15 -4
  174. package/shared-utils/filter.js +36 -2
  175. package/shared-utils/five/changeMode.js +13 -17
  176. package/shared-utils/five/useFivePlugin.js +2 -0
  177. package/shared-utils/formatRad.js +2 -0
  178. package/shared-utils/getPxmm.js +15 -1
  179. package/shared-utils/getRandomColor.js +10 -0
  180. package/shared-utils/isNil.js +2 -0
  181. package/shared-utils/isTruelyObject.js +4 -0
  182. package/shared-utils/math/evenNumber.js +2 -0
  183. package/shared-utils/math/planimetry.js +10 -0
  184. package/shared-utils/math/rad2Deg.js +2 -0
  185. package/shared-utils/nearlyEqual.js +2 -0
  186. package/shared-utils/nextFrame.js +2 -0
  187. package/shared-utils/noop.js +2 -0
  188. package/shared-utils/object3d2LocalMatrix.js +20 -14
  189. package/shared-utils/px2rem.js +10 -0
  190. package/shared-utils/tap.js +2 -0
  191. package/shared-utils/three/centerPoint.js +2 -0
  192. package/shared-utils/three/getExtraModelLoader.js +14 -0
  193. package/shared-utils/three/getNormal.js +4 -0
  194. package/shared-utils/three/getTextureLoader.js +16 -0
  195. package/shared-utils/three/loadFbxObj.js +13 -5
  196. package/shared-utils/three/loadTexture.js +13 -5
  197. package/shared-utils/three/transformPositionToVector3.js +2 -0
  198. package/shared-utils/three/transfromToMeshBasicMaterial.d.ts +2 -0
  199. package/shared-utils/three/transfromToMeshBasicMaterial.js +33 -0
  200. package/shared-utils/throttle.js +4 -0
  201. package/shared-utils/to.js +8 -4
  202. package/shared-utils/useDebounce.js +6 -0
  203. package/shared-utils/useThrottle.js +6 -0
  204. package/shared-utils/uuid.js +8 -0
  205. package/shared-utils/vectorTocoordinates.js +2 -0
  206. package/typedoc/components.js +2 -0
  207. package/typedoc/plugins.d.ts +2 -0
  208. package/typedoc/plugins.js +41 -1
  209. package/typedoc/shared-utils.js +2 -0
  210. package/typedoc/typings.js +2 -0
  211. package/typings/math.type.js +2 -0
  212. package/typings/utils.type.js +2 -0
  213. package/components/PBRView/index.d.ts +0 -14
  214. package/data/wYnRjQ4KZoV1yPoG.d.ts +0 -114
  215. package/data/wYnRjQ4KZoV1yPoG.js +0 -512
@@ -0,0 +1,49 @@
1
+ import * as THREE from 'three';
2
+ import { FivePlugin, WorkImage } from '@realsee/five';
3
+ export interface PanoMaskObject {
4
+ color: {
5
+ r: number;
6
+ g: number;
7
+ b: number;
8
+ };
9
+ name?: string;
10
+ id: string;
11
+ }
12
+ export interface PanoMaskSelectorPluginData {
13
+ panoramaImgs: Omit<WorkImage, 'depth' | 'tiles'>[];
14
+ colorMaps: PanoMaskObject[];
15
+ config?: {
16
+ maskColor?: THREE.Color;
17
+ thickness?: number;
18
+ };
19
+ }
20
+ export interface PanoMaskSelectorPluginParameterType {
21
+ data?: PanoMaskSelectorPluginData;
22
+ }
23
+ export interface PanoMaskSelectorPluginReturnType {
24
+ /**
25
+ * 加载数据
26
+ */
27
+ load: (data: PanoMaskSelectorPluginData) => Promise<boolean>;
28
+ /**
29
+ * @returns 返回值为 选中的 物体信息;如果选中失败 则 返回 false。
30
+ */
31
+ select: (x: number, y: number) => Promise<false | PanoMaskObject>;
32
+ /**
33
+ * 擦除选中物体的 Mask(不可还原)。
34
+ */
35
+ erase: () => void;
36
+ /**
37
+ * 隐藏 选中物体的 Mask。
38
+ */
39
+ hide: () => void;
40
+ /**
41
+ * 展示 选中物体的 Mask。
42
+ */
43
+ show: () => void;
44
+ /**
45
+ * 销毁函数。
46
+ */
47
+ dispose: () => void;
48
+ }
49
+ export declare const PanoMaskSelectorPlugin: FivePlugin<PanoMaskSelectorPluginParameterType, PanoMaskSelectorPluginReturnType>;
@@ -0,0 +1,348 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.string.iterator.js");
4
+
5
+ require("core-js/modules/es.weak-map.js");
6
+
7
+ require("core-js/modules/web.dom-collections.iterator.js");
8
+
9
+ require("core-js/modules/es.object.define-property.js");
10
+
11
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
12
+
13
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
14
+
15
+ var _typeof = require("@babel/runtime/helpers/typeof");
16
+
17
+ Object.defineProperty(exports, "__esModule", {
18
+ value: true
19
+ });
20
+ exports.PanoMaskSelectorPlugin = void 0;
21
+
22
+ require("core-js/modules/es.array.iterator.js");
23
+
24
+ require("core-js/modules/es.array-buffer.slice.js");
25
+
26
+ require("core-js/modules/es.object.to-string.js");
27
+
28
+ require("core-js/modules/es.typed-array.uint8-array.js");
29
+
30
+ require("core-js/modules/es.typed-array.copy-within.js");
31
+
32
+ require("core-js/modules/es.typed-array.every.js");
33
+
34
+ require("core-js/modules/es.typed-array.fill.js");
35
+
36
+ require("core-js/modules/es.typed-array.filter.js");
37
+
38
+ require("core-js/modules/es.typed-array.find.js");
39
+
40
+ require("core-js/modules/es.typed-array.find-index.js");
41
+
42
+ require("core-js/modules/es.typed-array.for-each.js");
43
+
44
+ require("core-js/modules/es.typed-array.includes.js");
45
+
46
+ require("core-js/modules/es.typed-array.index-of.js");
47
+
48
+ require("core-js/modules/es.typed-array.iterator.js");
49
+
50
+ require("core-js/modules/es.typed-array.join.js");
51
+
52
+ require("core-js/modules/es.typed-array.last-index-of.js");
53
+
54
+ require("core-js/modules/es.typed-array.map.js");
55
+
56
+ require("core-js/modules/es.typed-array.reduce.js");
57
+
58
+ require("core-js/modules/es.typed-array.reduce-right.js");
59
+
60
+ require("core-js/modules/es.typed-array.reverse.js");
61
+
62
+ require("core-js/modules/es.typed-array.set.js");
63
+
64
+ require("core-js/modules/es.typed-array.slice.js");
65
+
66
+ require("core-js/modules/es.typed-array.some.js");
67
+
68
+ require("core-js/modules/es.typed-array.sort.js");
69
+
70
+ require("core-js/modules/es.typed-array.subarray.js");
71
+
72
+ require("core-js/modules/es.typed-array.to-locale-string.js");
73
+
74
+ require("core-js/modules/es.typed-array.to-string.js");
75
+
76
+ require("core-js/modules/es.array.fill.js");
77
+
78
+ require("core-js/modules/es.array.slice.js");
79
+
80
+ require("core-js/modules/es.array.find.js");
81
+
82
+ require("core-js/modules/es.array.for-each.js");
83
+
84
+ require("core-js/modules/web.dom-collections.for-each.js");
85
+
86
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
87
+
88
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
89
+
90
+ var THREE = _interopRequireWildcard(require("three"));
91
+
92
+ var _five = require("@realsee/five");
93
+
94
+ var _createBox = require("./createBox");
95
+
96
+ var _createTextures = require("./createTextures");
97
+
98
+ var _compare = require("./compare");
99
+
100
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
101
+
102
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
103
+
104
+ var PanoMaskSelectorPlugin = function PanoMaskSelectorPlugin(five) {
105
+ var parameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
106
+ var state = {
107
+ data: parameters.data
108
+ };
109
+
110
+ var dispose = function dispose() {
111
+ if (state.box) {
112
+ five.scene.remove(state.box);
113
+ }
114
+
115
+ five.off('panoArrived', wrapper);
116
+ five.off('modeChange', modeChangeListener);
117
+ };
118
+
119
+ var wrapper = function wrapper() {
120
+ var _state$data$config, _state$data$config2;
121
+
122
+ if (five.panoIndex === undefined) {
123
+ return;
124
+ }
125
+
126
+ if (five.panoIndex === state.currentLoadedIndex) {
127
+ return;
128
+ }
129
+
130
+ if (!state.data) {
131
+ return;
132
+ }
133
+
134
+ if (state.box) {
135
+ five.scene.remove(state.box);
136
+ }
137
+
138
+ var panoramaImgs = state.data.panoramaImgs[five.panoIndex];
139
+
140
+ if (!panoramaImgs) {
141
+ state.textures = undefined;
142
+ return false;
143
+ }
144
+
145
+ state.textures = (0, _createTextures.createTextures)(panoramaImgs);
146
+ state.box = (0, _createBox.createBox)(state.textures, five.work.observers[five.panoIndex], {
147
+ opacity: true,
148
+ maskColor: ((_state$data$config = state.data.config) === null || _state$data$config === void 0 ? void 0 : _state$data$config.maskColor) || new THREE.Color(1, 0, 0),
149
+ thickness: ((_state$data$config2 = state.data.config) === null || _state$data$config2 === void 0 ? void 0 : _state$data$config2.thickness) || 0.005
150
+ });
151
+ five.scene.add(state.box);
152
+ state.currentLoadedIndex = five.panoIndex;
153
+ return true;
154
+ };
155
+
156
+ var load = /*#__PURE__*/function () {
157
+ var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
158
+ return _regenerator["default"].wrap(function _callee$(_context) {
159
+ while (1) {
160
+ switch (_context.prev = _context.next) {
161
+ case 0:
162
+ state.data = data;
163
+ wrapper();
164
+ return _context.abrupt("return", true);
165
+
166
+ case 3:
167
+ case "end":
168
+ return _context.stop();
169
+ }
170
+ }
171
+ }, _callee);
172
+ }));
173
+
174
+ return function load(_x2) {
175
+ return _ref.apply(this, arguments);
176
+ };
177
+ }();
178
+
179
+ var select = /*#__PURE__*/function () {
180
+ var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_x, _y) {
181
+ var _state$data;
182
+
183
+ var element, pixel, x, y, renderTarget, pickingBuffer, camera, renderer, newScence, observer, newBox, unit8ArrayGroup, i, selectedColor, colorMaps, object;
184
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
185
+ while (1) {
186
+ switch (_context2.prev = _context2.next) {
187
+ case 0:
188
+ if (state.textures) {
189
+ _context2.next = 2;
190
+ break;
191
+ }
192
+
193
+ return _context2.abrupt("return", false);
194
+
195
+ case 2:
196
+ if (state.box) {
197
+ _context2.next = 4;
198
+ break;
199
+ }
200
+
201
+ return _context2.abrupt("return", false);
202
+
203
+ case 4:
204
+ if (!(five.panoIndex === undefined)) {
205
+ _context2.next = 6;
206
+ break;
207
+ }
208
+
209
+ return _context2.abrupt("return", false);
210
+
211
+ case 6:
212
+ if (!(five.currentMode !== _five.Five.Mode.Panorama)) {
213
+ _context2.next = 8;
214
+ break;
215
+ }
216
+
217
+ return _context2.abrupt("return", false);
218
+
219
+ case 8:
220
+ if (five.renderer) {
221
+ _context2.next = 10;
222
+ break;
223
+ }
224
+
225
+ return _context2.abrupt("return", false);
226
+
227
+ case 10:
228
+ element = five.getElement();
229
+
230
+ if (element) {
231
+ _context2.next = 13;
232
+ break;
233
+ }
234
+
235
+ return _context2.abrupt("return", false);
236
+
237
+ case 13:
238
+ pixel = 1;
239
+ x = _x * five.renderer.getPixelRatio();
240
+ y = _y * five.renderer.getPixelRatio();
241
+ renderTarget = new THREE.WebGLRenderTarget(pixel, pixel);
242
+ pickingBuffer = new Uint8Array(4 * pixel * pixel);
243
+ camera = five.camera.clone();
244
+ renderer = five.renderer;
245
+ newScence = new THREE.Scene();
246
+ observer = five.work.observers[five.panoIndex];
247
+ newBox = (0, _createBox.createBox)(state.textures, observer, {
248
+ opacity: false
249
+ });
250
+ newScence.add(newBox);
251
+ camera.setViewOffset(element.width, element.height, x, y, pixel, pixel);
252
+ renderer.setRenderTarget(renderTarget);
253
+ renderer.render(newScence, camera);
254
+ pickingBuffer.fill(0);
255
+ renderer.readRenderTargetPixels(renderTarget, 0, 0, pixel, pixel, pickingBuffer);
256
+ camera.clearViewOffset();
257
+ renderer.setRenderTarget(null);
258
+ unit8ArrayGroup = [];
259
+
260
+ for (i = 0; i < pickingBuffer.length; i += 4 * pixel) {
261
+ unit8ArrayGroup.push(pickingBuffer.slice(i, i + 4 * pixel));
262
+ }
263
+
264
+ selectedColor = new THREE.Color(pickingBuffer[0] / 255, pickingBuffer[1] / 255, pickingBuffer[2] / 255);
265
+ colorMaps = ((_state$data = state.data) === null || _state$data === void 0 ? void 0 : _state$data.colorMaps) || [];
266
+ object = colorMaps.find(function (item) {
267
+ var objectColor = new THREE.Color(item.color.r, item.color.g, item.color.b);
268
+ return (0, _compare.compare)(objectColor, selectedColor);
269
+ });
270
+
271
+ if (object) {
272
+ _context2.next = 38;
273
+ break;
274
+ }
275
+
276
+ return _context2.abrupt("return", false);
277
+
278
+ case 38:
279
+ state.box.material.forEach(function (m) {
280
+ return m.uniforms.selectedColor.value = selectedColor;
281
+ });
282
+ five.needsRender = true;
283
+ return _context2.abrupt("return", object);
284
+
285
+ case 41:
286
+ case "end":
287
+ return _context2.stop();
288
+ }
289
+ }
290
+ }, _callee2);
291
+ }));
292
+
293
+ return function select(_x3, _x4) {
294
+ return _ref2.apply(this, arguments);
295
+ };
296
+ }();
297
+
298
+ var erase = function erase() {
299
+ if (!state.box) return;
300
+ state.box.material.forEach(function (m) {
301
+ return m.uniforms.selectedColor.value = new THREE.Color(0.0, 0.0, 0.0);
302
+ });
303
+ five.needsRender = true;
304
+ };
305
+
306
+ var hide = function hide() {
307
+ var _state$box, _state$box$material;
308
+
309
+ (_state$box = state.box) === null || _state$box === void 0 ? void 0 : (_state$box$material = _state$box.material) === null || _state$box$material === void 0 ? void 0 : _state$box$material.forEach(function (material) {
310
+ material.visible = false;
311
+ });
312
+ five.needsRender = true;
313
+ };
314
+
315
+ var show = function show() {
316
+ var _state$box2, _state$box2$material;
317
+
318
+ if (five.currentMode !== _five.Five.Mode.Panorama) {
319
+ return;
320
+ }
321
+
322
+ (_state$box2 = state.box) === null || _state$box2 === void 0 ? void 0 : (_state$box2$material = _state$box2.material) === null || _state$box2$material === void 0 ? void 0 : _state$box2$material.forEach(function (material) {
323
+ material.visible = true;
324
+ });
325
+ five.needsRender = true;
326
+ };
327
+
328
+ var modeChangeListener = function modeChangeListener(mode) {
329
+ if (mode !== _five.Five.Mode.Panorama) {
330
+ hide();
331
+ } else {
332
+ show();
333
+ }
334
+ };
335
+
336
+ five.on('panoArrived', wrapper);
337
+ five.on('modeChange', modeChangeListener);
338
+ return {
339
+ load: load,
340
+ select: select,
341
+ erase: erase,
342
+ dispose: dispose,
343
+ hide: hide,
344
+ show: show
345
+ };
346
+ };
347
+
348
+ exports.PanoMaskSelectorPlugin = PanoMaskSelectorPlugin;
@@ -0,0 +1 @@
1
+ export declare const vertexShader = "\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n}\n\n";
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.vertexShader = void 0;
9
+ var vertexShader = "\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n}\n\n";
10
+ exports.vertexShader = vertexShader;
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.object.define-property.js");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.object.define-property.js");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -1,39 +1,87 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.array.from.js");
4
+
5
+ require("core-js/modules/es.string.iterator.js");
6
+
7
+ require("core-js/modules/es.symbol.js");
8
+
9
+ require("core-js/modules/es.symbol.description.js");
10
+
11
+ require("core-js/modules/es.symbol.iterator.js");
12
+
13
+ require("core-js/modules/es.array.iterator.js");
14
+
15
+ require("core-js/modules/web.dom-collections.iterator.js");
16
+
17
+ require("core-js/modules/es.array.is-array.js");
18
+
19
+ require("core-js/modules/es.object.define-property.js");
20
+
21
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
22
+
3
23
  Object.defineProperty(exports, "__esModule", {
4
24
  value: true
5
25
  });
6
26
  exports["default"] = exports.PanoRulerPlugin = void 0;
7
27
 
8
- var _five = require("@realsee/five");
28
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
29
 
10
- var _three = require("three");
30
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
31
 
12
- var _planimetry = require("../../shared-utils/math/planimetry");
32
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
33
 
14
- var _nextFrame = require("../../shared-utils/nextFrame");
34
+ require("core-js/modules/es.array.for-each.js");
15
35
 
16
- var _throttle = _interopRequireDefault(require("../../shared-utils/throttle"));
36
+ require("core-js/modules/web.dom-collections.for-each.js");
17
37
 
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
38
+ require("core-js/modules/es.function.name.js");
19
39
 
20
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
40
+ require("core-js/modules/es.array.sort.js");
21
41
 
22
- function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
42
+ require("core-js/modules/es.number.to-fixed.js");
23
43
 
24
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
44
+ require("core-js/modules/es.array.map.js");
25
45
 
26
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
46
+ require("core-js/modules/es.object.assign.js");
27
47
 
28
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
48
+ require("core-js/modules/es.object.to-string.js");
29
49
 
30
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
50
+ require("core-js/modules/es.promise.js");
31
51
 
32
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
52
+ require("core-js/modules/es.object.keys.js");
53
+
54
+ require("core-js/modules/es.array.index-of.js");
55
+
56
+ require("core-js/modules/es.regexp.exec.js");
33
57
 
34
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
58
+ require("core-js/modules/es.string.split.js");
35
59
 
36
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
60
+ require("core-js/modules/es.date.to-string.js");
61
+
62
+ require("core-js/modules/es.regexp.to-string.js");
63
+
64
+ require("core-js/modules/es.array.filter.js");
65
+
66
+ require("core-js/modules/es.array.slice.js");
67
+
68
+ require("core-js/modules/es.string.sub.js");
69
+
70
+ var _five = require("@realsee/five");
71
+
72
+ var _three = require("three");
73
+
74
+ var _planimetry = require("../../shared-utils/math/planimetry");
75
+
76
+ var _nextFrame = require("../../shared-utils/nextFrame");
77
+
78
+ var _throttle = _interopRequireDefault(require("../../shared-utils/throttle"));
79
+
80
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
81
+
82
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
83
+
84
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
37
85
 
38
86
  var getDistance = function getDistance(p1, p2) {
39
87
  return Math.sqrt(Math.pow(p1.z - p2.z, 2) + Math.pow(p1.x - p2.x, 2));
@@ -51,7 +99,7 @@ var getRoomHeightInfo = function getRoomHeightInfo(roomInfo, five) {
51
99
  raycaster.set(point, new _three.Vector3(0, 1, 0));
52
100
 
53
101
  var _five$model$intersect = five.model.intersectRaycaster(raycaster),
54
- _five$model$intersect2 = _slicedToArray(_five$model$intersect, 1),
102
+ _five$model$intersect2 = (0, _slicedToArray2["default"])(_five$model$intersect, 1),
55
103
  intersection = _five$model$intersect2[0];
56
104
 
57
105
  var verticalY = intersection ? intersection.point.y : null;
@@ -242,9 +290,9 @@ var PanoRulerPlugin = function PanoRulerPlugin(five, params) {
242
290
  };
243
291
 
244
292
  var load = /*#__PURE__*/function () {
245
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(_roomInfo, _roomRules, options) {
293
+ var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_roomInfo, _roomRules, options) {
246
294
  var roomInfo, roomRules;
247
- return regeneratorRuntime.wrap(function _callee$(_context) {
295
+ return _regenerator["default"].wrap(function _callee$(_context) {
248
296
  while (1) {
249
297
  switch (_context.prev = _context.next) {
250
298
  case 0:
@@ -401,7 +449,7 @@ var PanoRulerPlugin = function PanoRulerPlugin(five, params) {
401
449
  var angleB = pointB.clone().setY(0).sub(cameraPosition).normalize().angleTo(cameraDirection.clone().setY(0));
402
450
  return angleA - angleB;
403
451
  }),
404
- _rule$name$origins$s2 = _slicedToArray(_rule$name$origins$s, 1),
452
+ _rule$name$origins$s2 = (0, _slicedToArray2["default"])(_rule$name$origins$s, 1),
405
453
  visibleOrigin = _rule$name$origins$s2[0];
406
454
 
407
455
  var shownNotVerticalRules = [];
@@ -416,7 +464,7 @@ var PanoRulerPlugin = function PanoRulerPlugin(five, params) {
416
464
  vertical = _step4$value.vertical,
417
465
  _$element3 = _step4$value.$element;
418
466
 
419
- var _rule = _slicedToArray(rule, 2),
467
+ var _rule = (0, _slicedToArray2["default"])(rule, 2),
420
468
  start = _rule[0],
421
469
  end = _rule[1];
422
470
 
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.object.define-property.js");
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -1,3 +1,4 @@
1
+ import * as THREE from 'three';
1
2
  import { FivePlugin } from '@realsee/five';
2
3
  export declare type PanoTVVideoPluginPoints = Record<string, {
3
4
  position: {
@@ -19,6 +20,7 @@ export interface PanoTVVideoPluginExportType {
19
20
  enable: () => void;
20
21
  disable: () => void;
21
22
  load: (data: PanoTVVideoPluginData, videoElement?: HTMLVideoElement) => void;
23
+ getVideoTexture: () => THREE.VideoTexture | undefined;
22
24
  }
23
25
  export declare const PanoTVVideoPlugin: FivePlugin<PanoTVVideoPluginParameterType, PanoTVVideoPluginExportType>;
24
26
  export default PanoTVVideoPlugin;