@realsee/dnalogel 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (271) hide show
  1. package/README.md +94 -0
  2. package/TERMS.txt +56 -0
  3. package/components/ARVideoFigure/ARVideoFigureMesh.d.ts +44 -0
  4. package/components/ARVideoFigure/ARVideoFigureMesh.js +347 -0
  5. package/components/ARVideoFigure/ARVideoFigureScene.d.ts +11 -0
  6. package/components/ARVideoFigure/ARVideoFigureScene.js +74 -0
  7. package/components/ARVideoFigure/ImgBgTransparent.d.ts +16 -0
  8. package/components/ARVideoFigure/ImgBgTransparent.js +49 -0
  9. package/components/ARVideoFigure/ImgBgTransparentMesh.d.ts +30 -0
  10. package/components/ARVideoFigure/ImgBgTransparentMesh.js +173 -0
  11. package/components/ARVideoFigure/fragmentShader.d.ts +5 -0
  12. package/components/ARVideoFigure/fragmentShader.js +16 -0
  13. package/components/ARVideoFigure/index.d.ts +15 -0
  14. package/components/ARVideoFigure/index.js +64 -0
  15. package/components/ARVideoFigure/vertexShader.d.ts +1 -0
  16. package/components/ARVideoFigure/vertexShader.js +8 -0
  17. package/components/GlassFilters/index.d.ts +32 -0
  18. package/components/GlassFilters/index.js +54 -0
  19. package/components/ModelView/ModelViewController.d.ts +18 -0
  20. package/components/ModelView/ModelViewController.js +147 -0
  21. package/components/ModelView/index.d.ts +10 -0
  22. package/components/ModelView/index.js +22 -0
  23. package/components/PBRView/index.d.ts +14 -0
  24. package/components/PBRView/index.js +31 -0
  25. package/components/PaintBrush/index.d.ts +16 -0
  26. package/components/PaintBrush/index.js +33 -0
  27. package/components/PanoTag/index.d.ts +4 -0
  28. package/components/PanoTag/index.js +11 -0
  29. package/custom.d.js +3 -0
  30. package/data/1aGKl9JmrlXMXx8d.d.ts +104 -0
  31. package/data/1aGKl9JmrlXMXx8d.js +535 -0
  32. package/data/6gyq3v1verxD7JO1.d.ts +104 -0
  33. package/data/6gyq3v1verxD7JO1.js +460 -0
  34. package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.d.ts +84 -0
  35. package/data/KpokNd82rwjhackhQTBEoYKHg8zGbPXe.js +598 -0
  36. package/data/PrXel3aqGbp34JQn.d.ts +389 -0
  37. package/data/PrXel3aqGbp34JQn.js +4639 -0
  38. package/data/YdoNP9K4rwQDwjJr.d.ts +83 -0
  39. package/data/YdoNP9K4rwQDwjJr.js +1451 -0
  40. package/data/auto3d-njL5J99VwCmnjtQElOmXQr.d.ts +86 -0
  41. package/data/auto3d-njL5J99VwCmnjtQElOmXQr.js +709 -0
  42. package/data/oPzy3ApbjjpD8YdR.d.ts +83 -0
  43. package/data/oPzy3ApbjjpD8YdR.js +281 -0
  44. package/data/qjAxMG4XbPn96wKG.d.ts +104 -0
  45. package/data/qjAxMG4XbPn96wKG.js +635 -0
  46. package/data/rXel3aPQRRBD4JQn.d.ts +86 -0
  47. package/data/rXel3aPQRRBD4JQn.js +620 -0
  48. package/data/vLykj3NWrllMrG06.d.ts +89 -0
  49. package/data/vLykj3NWrllMrG06.js +2532 -0
  50. package/data/wYnRjQ4KZoV1yPoG.d.ts +114 -0
  51. package/data/wYnRjQ4KZoV1yPoG.js +512 -0
  52. package/data/wz0QV9KA4ugyo9ME.d.ts +39 -0
  53. package/data/wz0QV9KA4ugyo9ME.js +134 -0
  54. package/examples/FiveStateController/index.js +140 -0
  55. package/examples/VRHouse/Mobile.js +22 -0
  56. package/examples/VRHouse/PC.js +22 -0
  57. package/examples/VRHouse/index.js +22 -0
  58. package/index.d.ts +15 -0
  59. package/index.js +43 -0
  60. package/package.json +19 -0
  61. package/plugins/CSS3DRenderPlugin/components/Marker/index.d.ts +12 -0
  62. package/plugins/CSS3DRenderPlugin/components/Marker/index.js +113 -0
  63. package/plugins/CSS3DRenderPlugin/index.d.ts +49 -0
  64. package/plugins/CSS3DRenderPlugin/index.js +220 -0
  65. package/plugins/CameraMovementPlugin/index.d.ts +7 -0
  66. package/plugins/CameraMovementPlugin/index.js +338 -0
  67. package/plugins/CameraMovementPlugin/typing.d.ts +68 -0
  68. package/plugins/CameraMovementPlugin/typing.js +35 -0
  69. package/plugins/ModelChassisCompassPlugin/index.d.ts +15 -0
  70. package/plugins/ModelChassisCompassPlugin/index.js +156 -0
  71. package/plugins/ModelEntryDoorGuidePlugin/index.d.ts +10 -0
  72. package/plugins/ModelEntryDoorGuidePlugin/index.js +16 -0
  73. package/plugins/ModelTVVideoPlugin/index.d.ts +21 -0
  74. package/plugins/ModelTVVideoPlugin/index.js +313 -0
  75. package/plugins/ModelViewPlugin/index.d.ts +17 -0
  76. package/plugins/ModelViewPlugin/index.js +199 -0
  77. package/plugins/PanoCursorRaycasterPlugin/PanoCursorRaycasterPluginUsage.d.ts +48 -0
  78. package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.d.ts +9 -0
  79. package/plugins/PanoCursorRaycasterPlugin/components/MovePointTowardsCamera.js +113 -0
  80. package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.d.ts +11 -0
  81. package/plugins/PanoCursorRaycasterPlugin/components/PointAxesHelper.js +25 -0
  82. package/plugins/PanoCursorRaycasterPlugin/index.d.ts +49 -0
  83. package/plugins/PanoCursorRaycasterPlugin/index.js +119 -0
  84. package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.d.ts +5 -0
  85. package/plugins/PanoCursorRaycasterPlugin/utils/addLineToFive.js +25 -0
  86. package/plugins/PanoCursorRaycasterPlugin/utils/createLine.d.ts +3 -0
  87. package/plugins/PanoCursorRaycasterPlugin/utils/createLine.js +34 -0
  88. package/plugins/PanoCursorRaycasterPlugin/utils/vecror3.d.ts +7 -0
  89. package/plugins/PanoCursorRaycasterPlugin/utils/vecror3.js +18 -0
  90. package/plugins/PanoDoorLabelPlugin/index.d.ts +4 -0
  91. package/plugins/PanoDoorLabelPlugin/index.js +12 -0
  92. package/plugins/PanoIRobotPlugin/index.d.ts +10 -0
  93. package/plugins/PanoIRobotPlugin/index.js +16 -0
  94. package/plugins/PanoRulerPlugin/data/roomInfo.d.ts +3 -0
  95. package/plugins/PanoRulerPlugin/data/roomInfo.js +49 -0
  96. package/plugins/PanoRulerPlugin/data/roomRules.d.ts +3 -0
  97. package/plugins/PanoRulerPlugin/data/roomRules.js +233 -0
  98. package/plugins/PanoRulerPlugin/index.d.ts +27 -0
  99. package/plugins/PanoRulerPlugin/index.js +589 -0
  100. package/plugins/PanoRulerPlugin/typings.d.ts +21 -0
  101. package/plugins/PanoRulerPlugin/typings.js +5 -0
  102. package/plugins/PanoTVVideoPlugin/index.d.ts +24 -0
  103. package/plugins/PanoTVVideoPlugin/index.js +351 -0
  104. package/plugins/TreasurePlugin/Controller.d.ts +32 -0
  105. package/plugins/TreasurePlugin/Controller.js +175 -0
  106. package/plugins/TreasurePlugin/TreasureFaceAnime.d.ts +23 -0
  107. package/plugins/TreasurePlugin/TreasureFaceAnime.js +128 -0
  108. package/plugins/TreasurePlugin/TreasureObject.d.ts +35 -0
  109. package/plugins/TreasurePlugin/TreasureObject.js +186 -0
  110. package/plugins/TreasurePlugin/TreasureOpenAnime.d.ts +23 -0
  111. package/plugins/TreasurePlugin/TreasureOpenAnime.js +103 -0
  112. package/plugins/TreasurePlugin/constants.d.ts +12 -0
  113. package/plugins/TreasurePlugin/constants.js +30 -0
  114. package/plugins/TreasurePlugin/index.d.ts +11 -0
  115. package/plugins/TreasurePlugin/index.js +16 -0
  116. package/plugins/TreasurePlugin/treasureDataMap.d.ts +7 -0
  117. package/plugins/TreasurePlugin/treasureDataMap.js +20 -0
  118. package/plugins/TreasurePlugin/typings.d.ts +2 -0
  119. package/plugins/TreasurePlugin/typings.js +5 -0
  120. package/plugins/TreasurePlugin/utils/loadTreasureTextures.d.ts +7 -0
  121. package/plugins/TreasurePlugin/utils/loadTreasureTextures.js +115 -0
  122. package/plugins/floorplan/Assets/floorplanExtraObject.d.ts +1 -0
  123. package/plugins/floorplan/Assets/floorplanExtraObject.js +8 -0
  124. package/plugins/floorplan/ModelFloorplanPlugin/Controller.d.ts +100 -0
  125. package/plugins/floorplan/ModelFloorplanPlugin/Controller.js +643 -0
  126. package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.d.ts +13 -0
  127. package/plugins/floorplan/ModelFloorplanPlugin/components/Camera.js +58 -0
  128. package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.d.ts +5 -0
  129. package/plugins/floorplan/ModelFloorplanPlugin/components/Compass.js +69 -0
  130. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.d.ts +10 -0
  131. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomHighlight.js +105 -0
  132. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.d.ts +13 -0
  133. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/RoomLabels.js +95 -0
  134. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.d.ts +13 -0
  135. package/plugins/floorplan/ModelFloorplanPlugin/components/NowFloor/index.js +48 -0
  136. package/plugins/floorplan/ModelFloorplanPlugin/components/index.d.ts +20 -0
  137. package/plugins/floorplan/ModelFloorplanPlugin/components/index.js +66 -0
  138. package/plugins/floorplan/ModelFloorplanPlugin/controller.style.d.ts +1 -0
  139. package/plugins/floorplan/ModelFloorplanPlugin/controller.style.js +14 -0
  140. package/plugins/floorplan/ModelFloorplanPlugin/index.d.ts +9 -0
  141. package/plugins/floorplan/ModelFloorplanPlugin/index.js +18 -0
  142. package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.d.ts +23 -0
  143. package/plugins/floorplan/ModelFloorplanPlugin/typings/events.type.js +5 -0
  144. package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.d.ts +15 -0
  145. package/plugins/floorplan/ModelFloorplanPlugin/utils/constant.js +31 -0
  146. package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.d.ts +14 -0
  147. package/plugins/floorplan/ModelFloorplanPlugin/utils/correctFiveState.js +162 -0
  148. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.d.ts +13 -0
  149. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.js +91 -0
  150. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.d.ts +3 -0
  151. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/Camera.style.js +35 -0
  152. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.d.ts +5 -0
  153. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/ExtraObjects.js +50 -0
  154. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.d.ts +9 -0
  155. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/RoomHighlight.js +102 -0
  156. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.d.ts +11 -0
  157. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/NowFloor/index.js +42 -0
  158. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.d.ts +17 -0
  159. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.js +75 -0
  160. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.d.ts +2 -0
  161. package/plugins/floorplan/PanoFloorplanRadarPlugin/Content/index.style.js +13 -0
  162. package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +33 -0
  163. package/plugins/floorplan/PanoFloorplanRadarPlugin/Controller.js +214 -0
  164. package/plugins/floorplan/PanoFloorplanRadarPlugin/index.d.ts +8 -0
  165. package/plugins/floorplan/PanoFloorplanRadarPlugin/index.js +18 -0
  166. package/plugins/floorplan/TopviewFloorplanPlugin/Controller.d.ts +55 -0
  167. package/plugins/floorplan/TopviewFloorplanPlugin/Controller.js +267 -0
  168. package/plugins/floorplan/TopviewFloorplanPlugin/index.d.ts +5 -0
  169. package/plugins/floorplan/TopviewFloorplanPlugin/index.js +16 -0
  170. package/plugins/floorplan/TopviewFloorplanPlugin/style.d.ts +1 -0
  171. package/plugins/floorplan/TopviewFloorplanPlugin/style.js +14 -0
  172. package/plugins/floorplan/components/FloorplanImage.d.ts +7 -0
  173. package/plugins/floorplan/components/FloorplanImage.js +76 -0
  174. package/plugins/floorplan/typings/floorplanData.d.ts +127 -0
  175. package/plugins/floorplan/typings/floorplanData.js +5 -0
  176. package/plugins/floorplan/typings/floorplanServerData.d.ts +125 -0
  177. package/plugins/floorplan/typings/floorplanServerData.js +380 -0
  178. package/plugins/floorplan/utils/formatData.d.ts +5 -0
  179. package/plugins/floorplan/utils/formatData.js +220 -0
  180. package/plugins/floorplan/utils/formatPosition.d.ts +37 -0
  181. package/plugins/floorplan/utils/formatPosition.js +87 -0
  182. package/shared-utils/Preloader.d.ts +6 -0
  183. package/shared-utils/Preloader.js +51 -0
  184. package/shared-utils/Subscribe.d.ts +45 -0
  185. package/shared-utils/Subscribe.js +210 -0
  186. package/shared-utils/animationFrame/BetterTween.d.ts +11 -0
  187. package/shared-utils/animationFrame/BetterTween.js +102 -0
  188. package/shared-utils/animationFrame/calculateProgress.d.ts +8 -0
  189. package/shared-utils/animationFrame/calculateProgress.js +38 -0
  190. package/shared-utils/animationFrame/formatRad.d.ts +15 -0
  191. package/shared-utils/animationFrame/formatRad.js +34 -0
  192. package/shared-utils/animationFrame/index.d.ts +15 -0
  193. package/shared-utils/animationFrame/index.js +69 -0
  194. package/shared-utils/animationFrame/tween.d.ts +75 -0
  195. package/shared-utils/animationFrame/tween.js +76 -0
  196. package/shared-utils/changeModelCanvansOpacity.d.ts +2 -0
  197. package/shared-utils/changeModelCanvansOpacity.js +24 -0
  198. package/shared-utils/createFiveContainer.d.ts +10 -0
  199. package/shared-utils/createFiveContainer.js +165 -0
  200. package/shared-utils/createLine/index.d.ts +3 -0
  201. package/shared-utils/createLine/index.js +29 -0
  202. package/shared-utils/debounce.d.ts +6 -0
  203. package/shared-utils/debounce.js +26 -0
  204. package/shared-utils/equal.d.ts +11 -0
  205. package/shared-utils/equal.js +96 -0
  206. package/shared-utils/filter.d.ts +27 -0
  207. package/shared-utils/filter.js +93 -0
  208. package/shared-utils/five/changeMode.d.ts +2 -0
  209. package/shared-utils/five/changeMode.js +86 -0
  210. package/shared-utils/five/useFivePlugin.d.ts +1 -0
  211. package/shared-utils/five/useFivePlugin.js +15 -0
  212. package/shared-utils/formatRad.d.ts +7 -0
  213. package/shared-utils/formatRad.js +16 -0
  214. package/shared-utils/getPxmm.d.ts +6 -0
  215. package/shared-utils/getPxmm.js +37 -0
  216. package/shared-utils/getRandomColor.d.ts +1 -0
  217. package/shared-utils/getRandomColor.js +13 -0
  218. package/shared-utils/isTruelyObject.d.ts +18 -0
  219. package/shared-utils/isTruelyObject.js +27 -0
  220. package/shared-utils/math/evenNumber.d.ts +1 -0
  221. package/shared-utils/math/evenNumber.js +11 -0
  222. package/shared-utils/math/planimetry.d.ts +116 -0
  223. package/shared-utils/math/planimetry.js +342 -0
  224. package/shared-utils/math/rad2Deg.d.ts +1 -0
  225. package/shared-utils/math/rad2Deg.js +10 -0
  226. package/shared-utils/nearlyEqual.d.ts +7 -0
  227. package/shared-utils/nearlyEqual.js +17 -0
  228. package/shared-utils/nextFrame.d.ts +1 -0
  229. package/shared-utils/nextFrame.js +13 -0
  230. package/shared-utils/noop.d.ts +5 -0
  231. package/shared-utils/noop.js +17 -0
  232. package/shared-utils/object3d2LocalMatrix.d.ts +12 -0
  233. package/shared-utils/object3d2LocalMatrix.js +73 -0
  234. package/shared-utils/px2rem.d.ts +1 -0
  235. package/shared-utils/px2rem.js +12 -0
  236. package/shared-utils/tap.d.ts +8 -0
  237. package/shared-utils/tap.js +19 -0
  238. package/shared-utils/three/centerPoint.d.ts +2 -0
  239. package/shared-utils/three/centerPoint.js +12 -0
  240. package/shared-utils/three/getNormal.d.ts +2 -0
  241. package/shared-utils/three/getNormal.js +13 -0
  242. package/shared-utils/three/loadFbxObj.d.ts +3 -0
  243. package/shared-utils/three/loadFbxObj.js +42 -0
  244. package/shared-utils/three/loadTexture.d.ts +2 -0
  245. package/shared-utils/three/loadTexture.js +38 -0
  246. package/shared-utils/three/vecror3.d.ts +7 -0
  247. package/shared-utils/three/vecror3.js +18 -0
  248. package/shared-utils/throttle.d.ts +7 -0
  249. package/shared-utils/throttle.js +25 -0
  250. package/shared-utils/to.d.ts +9 -0
  251. package/shared-utils/to.js +25 -0
  252. package/shared-utils/useDebounce.d.ts +8 -0
  253. package/shared-utils/useDebounce.js +43 -0
  254. package/shared-utils/useThrottle.d.ts +8 -0
  255. package/shared-utils/useThrottle.js +41 -0
  256. package/shared-utils/uuid.d.ts +4 -0
  257. package/shared-utils/uuid.js +20 -0
  258. package/shared-utils/vectorTocoordinates.d.ts +7 -0
  259. package/shared-utils/vectorTocoordinates.js +16 -0
  260. package/typedoc/components.d.ts +6 -0
  261. package/typedoc/components.js +5 -0
  262. package/typedoc/plugins.d.ts +17 -0
  263. package/typedoc/plugins.js +113 -0
  264. package/typedoc/shared-utils.d.ts +3 -0
  265. package/typedoc/shared-utils.js +5 -0
  266. package/typedoc/typings.d.ts +3 -0
  267. package/typedoc/typings.js +5 -0
  268. package/typings/math.type.d.ts +44 -0
  269. package/typings/math.type.js +5 -0
  270. package/typings/utils.type.d.ts +2 -0
  271. package/typings/utils.type.js +5 -0
@@ -0,0 +1,156 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var THREE = _interopRequireWildcard(require("three"));
11
+
12
+ var _FBXLoader = require("three/examples/jsm/loaders/FBXLoader");
13
+
14
+ var _object3d2LocalMatrix = _interopRequireDefault(require("../../shared-utils/object3d2LocalMatrix"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
+
18
+ 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); }
19
+
20
+ 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; }
21
+
22
+ 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); } }
23
+
24
+ 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); }); }; }
25
+
26
+ /**
27
+ * 模型底盘指南针插件
28
+ */
29
+ var ModelChassisCompassPlugin = function ModelChassisCompassPlugin(five, params) {
30
+ var defaultFbxUrl = params.fbxUrl || '//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX';
31
+ var defaultNorthRad = params.northRad || undefined; // 局部状态
32
+
33
+ var state = {};
34
+
35
+ var load = /*#__PURE__*/function () {
36
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(northRad, fbxUrl) {
37
+ var bounding, xOffset, zOffset, maxOffset, fbxLoader, object, rotation, _five$model$bounding, _five$model$bounding$, xMax, zMax, _five$model$bounding$2, xMin, yMin, zMin, position, scale;
38
+
39
+ return regeneratorRuntime.wrap(function _callee$(_context) {
40
+ while (1) {
41
+ switch (_context.prev = _context.next) {
42
+ case 0:
43
+ fbxUrl = fbxUrl || defaultFbxUrl;
44
+ northRad = northRad || defaultNorthRad;
45
+
46
+ if (northRad) {
47
+ _context.next = 4;
48
+ break;
49
+ }
50
+
51
+ throw new Error('"northRad"配置参数缺失:未配置指南针指向!');
52
+
53
+ case 4:
54
+ bounding = five.model.bounding;
55
+ xOffset = bounding.max.x - bounding.min.x;
56
+ zOffset = bounding.max.z - bounding.min.z;
57
+ maxOffset = Math.max(xOffset, zOffset);
58
+ fbxLoader = new _FBXLoader.FBXLoader();
59
+ _context.next = 11;
60
+ return fbxLoader.loadAsync(fbxUrl);
61
+
62
+ case 11:
63
+ object = _context.sent;
64
+ object.traverse(function (ele) {
65
+ if (ele.type === 'Mesh') {
66
+ var _ele$parent;
67
+
68
+ var mesh = ele;
69
+ var materialConf = Object.assign({
70
+ map: mesh.material.map || {}
71
+ }, {
72
+ transparent: true,
73
+ side: THREE.DoubleSide,
74
+ blending: THREE.AdditiveBlending
75
+ });
76
+ mesh.material = new THREE.MeshBasicMaterial(materialConf);
77
+ mesh.renderOrder = 1;
78
+
79
+ if (((_ele$parent = ele.parent) === null || _ele$parent === void 0 ? void 0 : _ele$parent.type) === 'Mesh') {
80
+ ele.renderOrder = ele.parent.renderOrder + 1;
81
+ }
82
+ }
83
+ });
84
+ rotation = [0, northRad - Math.PI / 2, 0];
85
+ _five$model$bounding = five.model.bounding, _five$model$bounding$ = _five$model$bounding.max, xMax = _five$model$bounding$.x, zMax = _five$model$bounding$.z, _five$model$bounding$2 = _five$model$bounding.min, xMin = _five$model$bounding$2.x, yMin = _five$model$bounding$2.y, zMin = _five$model$bounding$2.z;
86
+ state.yBase = yMin;
87
+ position = {
88
+ x: (xMax + xMin) / 2,
89
+ y: yMin - 1.6,
90
+ z: (zMax + zMin) / 2
91
+ };
92
+ scale = 0.0045 * maxOffset;
93
+ (0, _object3d2LocalMatrix["default"])(object, {
94
+ position: position,
95
+ rotation: rotation,
96
+ scale: scale
97
+ });
98
+ state.object = object;
99
+ return _context.abrupt("return", true);
100
+
101
+ case 21:
102
+ case "end":
103
+ return _context.stop();
104
+ }
105
+ }
106
+ }, _callee);
107
+ }));
108
+
109
+ return function load(_x, _x2) {
110
+ return _ref.apply(this, arguments);
111
+ };
112
+ }();
113
+
114
+ var onCameraUpdate = function onCameraUpdate(_ref2) {
115
+ var latitude = _ref2.latitude;
116
+ if (!state.object) return;
117
+ var y = getPositionY(latitude);
118
+
119
+ if (y) {
120
+ state.object.position.y = y;
121
+ }
122
+ };
123
+
124
+ var getPositionY = function getPositionY(latitude) {
125
+ if (state.yBase === undefined) return;
126
+ var difference = 0.6;
127
+ if (latitude >= Math.PI / 4) return state.yBase - (difference + 1.6);
128
+ var ratio = latitude * (4 / Math.PI);
129
+ return state.yBase - (difference * ratio + 1.6);
130
+ };
131
+
132
+ var enable = function enable() {
133
+ if (!state.object) return;
134
+ var y = getPositionY(five.getPose().latitude);
135
+ if (y) state.object.position.y = y;
136
+ five.scene.add(state.object);
137
+ five.needsRender = true;
138
+ five.on('cameraDirectionUpdate', onCameraUpdate);
139
+ };
140
+
141
+ var disable = function disable() {
142
+ if (!state.object) return;
143
+ five.scene.remove(state.object);
144
+ five.needsRender = true;
145
+ five.off('cameraDirectionUpdate', onCameraUpdate);
146
+ };
147
+
148
+ return {
149
+ load: load,
150
+ disable: disable,
151
+ enable: enable
152
+ };
153
+ };
154
+
155
+ var _default = ModelChassisCompassPlugin;
156
+ exports["default"] = _default;
@@ -0,0 +1,10 @@
1
+ import type { FivePlugin } from '@realsee/five';
2
+ export interface ModelEntryDoorGuidePluginParameterType {
3
+ }
4
+ export interface ModelEntryDoorGuidePluginExportType {
5
+ }
6
+ /**
7
+ * 模型入户门引导插件
8
+ */
9
+ declare const ModelEntryDoorGuidePlugin: FivePlugin<ModelEntryDoorGuidePluginParameterType, ModelEntryDoorGuidePluginExportType>;
10
+ export default ModelEntryDoorGuidePlugin;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ /**
9
+ * 模型入户门引导插件
10
+ */
11
+ var ModelEntryDoorGuidePlugin = function ModelEntryDoorGuidePlugin() {
12
+ return {};
13
+ };
14
+
15
+ var _default = ModelEntryDoorGuidePlugin;
16
+ exports["default"] = _default;
@@ -0,0 +1,21 @@
1
+ import type { FivePlugin } from '@realsee/five';
2
+ export interface ModelTVVideoPluginData {
3
+ enable?: boolean;
4
+ video_src: string;
5
+ video_poster_src: string;
6
+ points: {
7
+ x: number;
8
+ y: number;
9
+ z: number;
10
+ }[][];
11
+ }
12
+ export interface ModelTVVideoPluginParameterType {
13
+ videoElement?: HTMLVideoElement;
14
+ }
15
+ export interface ModelTVVideoPluginExportType {
16
+ enable: () => void;
17
+ disable: () => void;
18
+ load: (data: ModelTVVideoPluginData, videoElement?: HTMLVideoElement) => Promise<void>;
19
+ }
20
+ export declare const ModelTVVideoPlugin: FivePlugin<ModelTVVideoPluginParameterType, ModelTVVideoPluginExportType>;
21
+ export default ModelTVVideoPlugin;
@@ -0,0 +1,313 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = exports.ModelTVVideoPlugin = void 0;
9
+
10
+ var THREE = _interopRequireWildcard(require("three"));
11
+
12
+ 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); }
13
+
14
+ 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; }
15
+
16
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
+
18
+ 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."); }
19
+
20
+ 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); }
21
+
22
+ 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; }
23
+
24
+ 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; }
25
+
26
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
27
+
28
+ 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); } }
29
+
30
+ 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); }); }; }
31
+
32
+ var ModelTVVideoPlugin = function ModelTVVideoPlugin(five, _ref) {
33
+ var videoElement = _ref.videoElement;
34
+ var state = {
35
+ videoMeshes: [],
36
+ videoTextureEnabled: false,
37
+ videoSource: '',
38
+ rectPoints: [],
39
+ enabled: false,
40
+ videoElement: videoElement
41
+ };
42
+
43
+ var setMuted = function setMuted(muted) {
44
+ if (state.videoTexture) {
45
+ state.videoTexture.image.muted = muted;
46
+ state.videoTexture.image.play();
47
+ }
48
+ };
49
+
50
+ var getMuted = function getMuted() {
51
+ if (state.videoTexture) return state.videoTexture.image.muted;else return true;
52
+ };
53
+
54
+ var enable = function enable() {
55
+ if (state.enabled) return;
56
+ if (!state.videoTexture) return;
57
+ state.enabled = true;
58
+ state.videoMeshes = createPanoVideoMeshes();
59
+ console.log('state.videoMeshes', state.videoMeshes);
60
+ state.videoMeshes.forEach(function (mesh) {
61
+ return five.scene.add(mesh);
62
+ });
63
+
64
+ var play = function play() {
65
+ console.log('play', state.videoTexture);
66
+ if (!state.videoTexture) return;
67
+
68
+ var timeupdate = function timeupdate() {
69
+ var _state$videoTexture;
70
+
71
+ if (!state.videoTexture) return;
72
+ (_state$videoTexture = state.videoTexture) === null || _state$videoTexture === void 0 ? void 0 : _state$videoTexture.image.removeEventListener('timeupdate', timeupdate);
73
+ state.videoTextureEnabled = true;
74
+ state.videoMeshes.forEach(function (mesh) {
75
+ if (mesh.material.map !== state.videoTexture) mesh.material.map = state.videoTexture;
76
+ });
77
+ five.needsRender = true;
78
+ };
79
+
80
+ state.videoTexture.image.addEventListener('timeupdate', timeupdate);
81
+
82
+ if (state.videoTexture && state.videoMeshes.length) {
83
+ state.videoTexture.image.play();
84
+ }
85
+ };
86
+
87
+ if (five.model.loaded) play();else {
88
+ return five.once('modelLoaded', function () {
89
+ return play();
90
+ });
91
+ }
92
+ };
93
+
94
+ var disable = function disable() {
95
+ if (!state.enabled) return;
96
+ state.enabled = false;
97
+ state.videoMeshes.forEach(function (mesh) {
98
+ mesh.geometry.dispose();
99
+ mesh.material.dispose();
100
+ five.scene.remove(mesh);
101
+ if (state.videoTexture) state.videoTexture.image.pause();
102
+ });
103
+ state.videoMeshes = [];
104
+ five.needsRender = true;
105
+ };
106
+
107
+ var createPanoVideoMeshes = function createPanoVideoMeshes() {
108
+ return state.rectPoints.map(function (points, index) {
109
+ var geometry = new THREE.BufferGeometry();
110
+ var segments = 128;
111
+ var verticesArray = [];
112
+ verticesArray.push(points[0].x, points[0].y, points[0].z);
113
+
114
+ for (var i = 1; i < segments; i++) {
115
+ verticesArray.push(points[0].x + (points[1].x - points[0].x) * i / segments, points[0].y + (points[1].y - points[0].y) * i / segments, points[0].z + (points[1].z - points[0].z) * i / segments);
116
+ }
117
+
118
+ verticesArray.push(points[1].x, points[1].y, points[1].z);
119
+ verticesArray.push(points[2].x, points[2].y, points[2].z);
120
+
121
+ for (var _i = 1; _i < segments; _i++) {
122
+ verticesArray.push(points[2].x + (points[3].x - points[2].x) * _i / segments, points[2].y + (points[3].y - points[2].y) * _i / segments, points[2].z + (points[3].z - points[2].z) * _i / segments);
123
+ }
124
+
125
+ verticesArray.push(points[3].x, points[3].y, points[3].z);
126
+ var uvArray = [];
127
+ uvArray.push(0, 1);
128
+
129
+ for (var _i2 = 1; _i2 < segments; _i2++) {
130
+ uvArray.push(0, 1 - _i2 / segments);
131
+ }
132
+
133
+ uvArray.push(0, 0);
134
+ uvArray.push(1, 0);
135
+
136
+ for (var _i3 = 1; _i3 < segments; _i3++) {
137
+ uvArray.push(1, _i3 / segments);
138
+ }
139
+
140
+ uvArray.push(1, 1);
141
+ var indicesArray = [];
142
+
143
+ for (var _i4 = 0; _i4 < segments; _i4++) {
144
+ indicesArray.push(_i4, _i4 + 1, segments * 2 - _i4, _i4, segments * 2 - _i4, segments * 2 + 1 - _i4);
145
+ }
146
+
147
+ geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array(verticesArray), 3));
148
+ geometry.setAttribute('uv', new THREE.BufferAttribute(new Float32Array(uvArray), 2));
149
+ geometry.setIndex(new THREE.BufferAttribute(new Uint32Array(indicesArray), 1));
150
+ var material = new THREE.MeshBasicMaterial({
151
+ map: state.videoTextureEnabled ? state.videoTexture : state.imageTexture,
152
+ side: THREE.DoubleSide
153
+ });
154
+ var mesh = new THREE.Mesh(geometry, material);
155
+ mesh.renderOrder = 1;
156
+ mesh.name = "video-".concat(index, "-").concat(performance.now());
157
+ return mesh;
158
+ });
159
+ };
160
+
161
+ var getImageTexture = function getImageTexture(source) {
162
+ var texture = new THREE.TextureLoader().load(source);
163
+ texture.minFilter = THREE.LinearFilter;
164
+ texture.magFilter = THREE.LinearFilter;
165
+ texture.format = THREE.RGBFormat;
166
+ return texture;
167
+ };
168
+
169
+ var getVideoTexture = function getVideoTexture(source, video) {
170
+ return new Promise(function (resolve, reject) {
171
+ var xhr = new XMLHttpRequest();
172
+
173
+ xhr.onreadystatechange = function () {
174
+ if (xhr.readyState == 4) {
175
+ if (xhr.status == 200) {
176
+ var url = window.URL || window.webkitURL;
177
+ video = video || document.createElement('video');
178
+ video.crossOrigin = 'anonymous';
179
+ video.autoplay = true;
180
+ video.muted = true;
181
+ video.loop = true;
182
+ video.playsInline = true;
183
+ video.src = url.createObjectURL(xhr.response);
184
+ var texture = new THREE.VideoTexture(video);
185
+ texture.minFilter = THREE.LinearFilter;
186
+ texture.magFilter = THREE.LinearFilter;
187
+ texture.format = THREE.RGBFormat;
188
+ resolve(Object.assign(texture, {
189
+ videoSource: source
190
+ }));
191
+ } else {
192
+ reject(new Error('Video download Error: ' + xhr.status));
193
+ }
194
+ }
195
+ };
196
+
197
+ xhr.onerror = function (error) {
198
+ return reject(error);
199
+ };
200
+
201
+ xhr.open('GET', source);
202
+ xhr.responseType = 'blob';
203
+ xhr.send();
204
+ });
205
+ };
206
+
207
+ var load = /*#__PURE__*/function () {
208
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(data, videoElement) {
209
+ var video_src, video_poster_src, points;
210
+ return regeneratorRuntime.wrap(function _callee$(_context) {
211
+ while (1) {
212
+ switch (_context.prev = _context.next) {
213
+ case 0:
214
+ video_src = data.video_src, video_poster_src = data.video_poster_src, points = data.points;
215
+ state.videoSource = video_src;
216
+ state.rectPoints = points.map(function (items) {
217
+ return items.map(function (_ref3) {
218
+ var x = _ref3.x,
219
+ y = _ref3.y,
220
+ z = _ref3.z;
221
+ return new THREE.Vector3(x, y, z);
222
+ });
223
+ });
224
+ state.imageTexture = getImageTexture(video_poster_src);
225
+
226
+ if (videoElement) {
227
+ state.videoElement = videoElement;
228
+ }
229
+
230
+ _context.next = 7;
231
+ return getVideoTexture(state.videoSource, state.videoElement);
232
+
233
+ case 7:
234
+ state.videoTexture = _context.sent;
235
+ state.enabled = !!data.enable;
236
+ if (state.enabled) enable();
237
+
238
+ case 10:
239
+ case "end":
240
+ return _context.stop();
241
+ }
242
+ }
243
+ }, _callee);
244
+ }));
245
+
246
+ return function load(_x, _x2) {
247
+ return _ref2.apply(this, arguments);
248
+ };
249
+ }();
250
+
251
+ five.on('modeChange', function () {
252
+ return setMuted(true);
253
+ });
254
+ five.on('wantsTapGesture', function (raycaster) {
255
+ if (!state.enabled) return;
256
+
257
+ var _raycaster$intersectO = raycaster.intersectObjects(five.scene.children, true),
258
+ _raycaster$intersectO2 = _slicedToArray(_raycaster$intersectO, 1),
259
+ intersect = _raycaster$intersectO2[0];
260
+
261
+ if (!!intersect && /^video/.test(intersect.object.name)) {
262
+ if (state.videoTexture) setMuted(!state.videoTexture.image.muted);
263
+ return false;
264
+ }
265
+ });
266
+ five.on('panoArrived', function () {
267
+ if (!state.enabled) return;
268
+ if (getMuted()) return;
269
+ var cameraPosition = five.camera.position;
270
+ var visible = state.rectPoints.find(function (points) {
271
+ var centerVector = points.reduce(function (total, curr) {
272
+ return new THREE.Vector3(total.x + curr.x / points.length, total.y + curr.y / points.length, total.z + curr.z / points.length);
273
+ }, new THREE.Vector3());
274
+ return points.map(function (point) {
275
+ return new THREE.Vector3((point.x + centerVector.x) / 2, (point.y + centerVector.y) / 2, (point.z + centerVector.z) / 2);
276
+ }).filter(function (vector) {
277
+ vector = vector.clone().sub(cameraPosition).normalize();
278
+ var raycaster = new THREE.Raycaster(cameraPosition, vector);
279
+
280
+ var _raycaster$intersectO3 = raycaster.intersectObjects(five.scene.children, true),
281
+ _raycaster$intersectO4 = _slicedToArray(_raycaster$intersectO3, 1),
282
+ intersect = _raycaster$intersectO4[0];
283
+
284
+ return !!intersect && /^video/.test(intersect.object.name);
285
+ }).length >= 2;
286
+ });
287
+ if (!visible) setMuted(true);
288
+ });
289
+ five.on('renderFrame', function () {
290
+ // console.log('renderFrame', state.videoMeshes)
291
+ state.videoMeshes.forEach(function (meshes) {
292
+ if (meshes) //@ts-ignore
293
+ meshes.needsRender = true;
294
+ });
295
+ });
296
+ five.on('load', function (input) {
297
+ if (input.modelTVVideoData) {
298
+ load(input.modelTVVideoData);
299
+ }
300
+ });
301
+ Object.assign(window, {
302
+ $state: state
303
+ });
304
+ return {
305
+ enable: enable,
306
+ disable: disable,
307
+ load: load
308
+ };
309
+ };
310
+
311
+ exports.ModelTVVideoPlugin = ModelTVVideoPlugin;
312
+ var _default = ModelTVVideoPlugin;
313
+ exports["default"] = _default;
@@ -0,0 +1,17 @@
1
+ import type { FivePlugin } from '@realsee/five';
2
+ export interface ModelViewPluginExportType {
3
+ appendTo(element: HTMLElement, size?: {
4
+ width?: number;
5
+ height?: number;
6
+ }): void;
7
+ refresh(size?: {
8
+ width?: number;
9
+ height?: number;
10
+ }): void;
11
+ }
12
+ /**
13
+ * Five 模型插件
14
+ * @template ExportType 导出方法
15
+ */
16
+ export declare const ModelViewPlugin: FivePlugin<void, ModelViewPluginExportType>;
17
+ export default ModelViewPlugin;