@anov/3d-ability 0.0.142 → 0.0.144

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 (257) hide show
  1. package/dist/business/Animation/motion/index.js +56 -35
  2. package/dist/business/Animation/motion/index.js.map +1 -1
  3. package/dist/business/Animation/type.js +2 -2
  4. package/dist/business/Area/Fence/FenceBase.js +187 -146
  5. package/dist/business/Area/Fence/FenceBase.js.map +1 -1
  6. package/dist/business/Area/Fence/fence_base_01.js +112 -120
  7. package/dist/business/Area/Fence/fence_base_01.js.map +1 -1
  8. package/dist/business/Area/Fence/fence_feeting_01.js +130 -218
  9. package/dist/business/Area/Fence/fence_feeting_01.js.map +1 -1
  10. package/dist/business/Area/Fence/fence_roll_01.js +130 -140
  11. package/dist/business/Area/Fence/fence_roll_01.js.map +1 -1
  12. package/dist/business/Area/FillArea/FillAreaBase.js +126 -87
  13. package/dist/business/Area/FillArea/FillAreaBase.js.map +1 -1
  14. package/dist/business/Area/FillArea/fillArea_face_01.js +98 -72
  15. package/dist/business/Area/FillArea/fillArea_face_01.js.map +1 -1
  16. package/dist/business/Area/FillArea/fillArea_line_01.js +94 -66
  17. package/dist/business/Area/FillArea/fillArea_line_01.js.map +1 -1
  18. package/dist/business/Area/index.js +483 -267
  19. package/dist/business/Area/index.js.map +1 -1
  20. package/dist/business/Area/tool.js +26 -14
  21. package/dist/business/Area/tool.js.map +1 -1
  22. package/dist/business/Base/ObjectLayer.js +46 -21
  23. package/dist/business/Base/ObjectLayer.js.map +1 -1
  24. package/dist/business/Batch/index.js +234 -189
  25. package/dist/business/Batch/index.js.map +1 -1
  26. package/dist/business/Box/index.js +81 -52
  27. package/dist/business/Box/index.js.map +1 -1
  28. package/dist/business/Cylinder/index.js +79 -51
  29. package/dist/business/Cylinder/index.js.map +1 -1
  30. package/dist/business/Flyline/bubble/CircleBubble.js +9 -1
  31. package/dist/business/Flyline/bubble/CircleBubble.js.map +1 -1
  32. package/dist/business/Flyline/bubble/index.js +21 -7
  33. package/dist/business/Flyline/bubble/index.js.map +1 -1
  34. package/dist/business/Flyline/index.js +162 -96
  35. package/dist/business/Flyline/index.js.map +1 -1
  36. package/dist/business/Flyline/line/ArcLine.js +291 -208
  37. package/dist/business/Flyline/line/ArcLine.js.map +1 -1
  38. package/dist/business/Flyline/line/index.js +22 -8
  39. package/dist/business/Flyline/line/index.js.map +1 -1
  40. package/dist/business/HeatMap/HeatMap.js +467 -380
  41. package/dist/business/HeatMap/HeatMap.js.map +1 -1
  42. package/dist/business/HeatMap/core.js +525 -405
  43. package/dist/business/HeatMap/core.js.map +1 -1
  44. package/dist/business/HeatMap/shader.js +3 -69
  45. package/dist/business/HeatMap/shader.js.map +1 -1
  46. package/dist/business/InfoPanel/index.js +242 -201
  47. package/dist/business/InfoPanel/index.js.map +1 -1
  48. package/dist/business/Line/index.js +88 -55
  49. package/dist/business/Line/index.js.map +1 -1
  50. package/dist/business/Mark/KeyframeAnimation.js +176 -145
  51. package/dist/business/Mark/KeyframeAnimation.js.map +1 -1
  52. package/dist/business/Mark/index.js +294 -196
  53. package/dist/business/Mark/index.js.map +1 -1
  54. package/dist/business/Mark/shader/tanhao.js +3 -36
  55. package/dist/business/Mark/shader/tanhao.js.map +1 -1
  56. package/dist/business/Mark/type.js +1 -1
  57. package/dist/business/MaterialSwitch/MaterialSwitchSystem.js +551 -377
  58. package/dist/business/MaterialSwitch/MaterialSwitchSystem.js.map +1 -1
  59. package/dist/business/MaterialSwitch/inject.js +58 -92
  60. package/dist/business/MaterialSwitch/inject.js.map +1 -1
  61. package/dist/business/MaterialSwitch/shader/finalFade.js +2 -74
  62. package/dist/business/MaterialSwitch/shader/finalFade.js.map +1 -1
  63. package/dist/business/MaterialSwitch/shader/ground.js +16 -95
  64. package/dist/business/MaterialSwitch/shader/ground.js.map +1 -1
  65. package/dist/business/MaterialSwitch/shader/groundBase64.js +3 -9
  66. package/dist/business/MaterialSwitch/shader/groundBase64.js.map +1 -1
  67. package/dist/business/MaterialSwitch/shader/realFade.js +9 -48
  68. package/dist/business/MaterialSwitch/shader/realFade.js.map +1 -1
  69. package/dist/business/Plane/index.js +78 -51
  70. package/dist/business/Plane/index.js.map +1 -1
  71. package/dist/business/Poi/index.js +336 -248
  72. package/dist/business/Poi/index.js.map +1 -1
  73. package/dist/business/Poi/link/Cylinder.js +89 -56
  74. package/dist/business/Poi/link/Cylinder.js.map +1 -1
  75. package/dist/business/Poi/link/Pyramid.js +165 -104
  76. package/dist/business/Poi/link/Pyramid.js.map +1 -1
  77. package/dist/business/Poi/link/index.d.ts +1 -1
  78. package/dist/business/Poi/link/index.js +114 -54
  79. package/dist/business/Poi/link/index.js.map +1 -1
  80. package/dist/business/Poi/panel/index.js +373 -315
  81. package/dist/business/Poi/panel/index.js.map +1 -1
  82. package/dist/business/Poi/panel/utils.js +10 -5
  83. package/dist/business/Poi/panel/utils.js.map +1 -1
  84. package/dist/business/Poi/particle/DoubleCircle.js +107 -71
  85. package/dist/business/Poi/particle/DoubleCircle.js.map +1 -1
  86. package/dist/business/Poi/particle/DynamicCircle.js +111 -75
  87. package/dist/business/Poi/particle/DynamicCircle.js.map +1 -1
  88. package/dist/business/Poi/particle/SingleCircle.js +98 -62
  89. package/dist/business/Poi/particle/SingleCircle.js.map +1 -1
  90. package/dist/business/Poi/particle/index.js +117 -49
  91. package/dist/business/Poi/particle/index.js.map +1 -1
  92. package/dist/business/Poi/shader/circle.js +3 -31
  93. package/dist/business/Poi/shader/circle.js.map +1 -1
  94. package/dist/business/Poi/shader/cylinder.js +3 -37
  95. package/dist/business/Poi/shader/cylinder.js.map +1 -1
  96. package/dist/business/Poi/shader/doubleCircle.js +3 -55
  97. package/dist/business/Poi/shader/doubleCircle.js.map +1 -1
  98. package/dist/business/Poi/shader/dynamicCircle.js +3 -67
  99. package/dist/business/Poi/shader/dynamicCircle.js.map +1 -1
  100. package/dist/business/Poi/title/Border.js +27 -7
  101. package/dist/business/Poi/title/Border.js.map +1 -1
  102. package/dist/business/Poi/title/Ellipse.js +27 -7
  103. package/dist/business/Poi/title/Ellipse.js.map +1 -1
  104. package/dist/business/Poi/title/index.js +292 -208
  105. package/dist/business/Poi/title/index.js.map +1 -1
  106. package/dist/business/Poi/tools.js +17 -18
  107. package/dist/business/Poi/tools.js.map +1 -1
  108. package/dist/business/Sphere/index.js +72 -47
  109. package/dist/business/Sphere/index.js.map +1 -1
  110. package/dist/business/Spline/index.js +245 -190
  111. package/dist/business/Spline/index.js.map +1 -1
  112. package/dist/business/SplitBuilding/index.js +536 -327
  113. package/dist/business/SplitBuilding/index.js.map +1 -1
  114. package/dist/business/SplitBuilding/type.js +2 -2
  115. package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js +275 -218
  116. package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js.map +1 -1
  117. package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js +177 -132
  118. package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js.map +1 -1
  119. package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js +1 -51
  120. package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js.map +1 -1
  121. package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js +1 -6
  122. package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js.map +1 -1
  123. package/dist/business/TrafficComponents/base.js +55 -32
  124. package/dist/business/TrafficComponents/base.js.map +1 -1
  125. package/dist/business/TrafficComponents/utils.js +24 -25
  126. package/dist/business/TrafficComponents/utils.js.map +1 -1
  127. package/dist/business/Utils/Curve.js +56 -40
  128. package/dist/business/Utils/Curve.js.map +1 -1
  129. package/dist/business/Utils/constant.js +1 -1
  130. package/dist/business/Utils/constant.js.map +1 -1
  131. package/dist/business/Utils/defineProps.js +14 -13
  132. package/dist/business/Utils/defineProps.js.map +1 -1
  133. package/dist/business/Utils/round-curve.js +153 -127
  134. package/dist/business/Utils/round-curve.js.map +1 -1
  135. package/dist/business/VideoPanel/index.js +319 -258
  136. package/dist/business/VideoPanel/index.js.map +1 -1
  137. package/dist/business/Water/index.js +108 -78
  138. package/dist/business/Water/index.js.map +1 -1
  139. package/dist/business/Water/types.js +1 -1
  140. package/dist/business/Water/types.js.map +1 -1
  141. package/dist/core/Camera/PerspectiveCamera/CameraExpand.js +449 -383
  142. package/dist/core/Camera/PerspectiveCamera/CameraExpand.js.map +1 -1
  143. package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js +142 -107
  144. package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js.map +1 -1
  145. package/dist/core/Controls/FirstViewControl/index.js +96 -84
  146. package/dist/core/Controls/FirstViewControl/index.js.map +1 -1
  147. package/dist/core/Controls/ThirdViewControl/action/input.js +98 -77
  148. package/dist/core/Controls/ThirdViewControl/action/input.js.map +1 -1
  149. package/dist/core/Controls/ThirdViewControl/config/constants.js +1 -1
  150. package/dist/core/Controls/ThirdViewControl/config/constants.js.map +1 -1
  151. package/dist/core/Controls/ThirdViewControl/index.js +28 -19
  152. package/dist/core/Controls/ThirdViewControl/index.js.map +1 -1
  153. package/dist/core/Controls/ThirdViewControl/player/animation.js +155 -126
  154. package/dist/core/Controls/ThirdViewControl/player/animation.js.map +1 -1
  155. package/dist/core/Controls/ThirdViewControl/player/camera.js +63 -47
  156. package/dist/core/Controls/ThirdViewControl/player/camera.js.map +1 -1
  157. package/dist/core/Controls/ThirdViewControl/player/control.js +49 -39
  158. package/dist/core/Controls/ThirdViewControl/player/control.js.map +1 -1
  159. package/dist/core/Controls/ThirdViewControl/player.js +91 -66
  160. package/dist/core/Controls/ThirdViewControl/player.js.map +1 -1
  161. package/dist/core/Controls/base.js +30 -14
  162. package/dist/core/Controls/base.js.map +1 -1
  163. package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js +131 -92
  164. package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js.map +1 -1
  165. package/dist/core/Debug/PerformanceInfo/Performance.js +47 -22
  166. package/dist/core/Debug/PerformanceInfo/Performance.js.map +1 -1
  167. package/dist/core/Light/PointLight/PointLightExt.js +21 -4
  168. package/dist/core/Light/PointLight/PointLightExt.js.map +1 -1
  169. package/dist/core/Material/FinirMaterial/FinirMaterial.js +57 -37
  170. package/dist/core/Material/FinirMaterial/FinirMaterial.js.map +1 -1
  171. package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js +153 -116
  172. package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js.map +1 -1
  173. package/dist/core/Material/PristineGridMaterial/shader/fragment.js +1 -95
  174. package/dist/core/Material/PristineGridMaterial/shader/fragment.js.map +1 -1
  175. package/dist/core/Material/PristineGridMaterial/shader/vertex.js +1 -26
  176. package/dist/core/Material/PristineGridMaterial/shader/vertex.js.map +1 -1
  177. package/dist/core/Material/SurfaceMaterial/index.js +172 -76
  178. package/dist/core/Material/SurfaceMaterial/index.js.map +1 -1
  179. package/dist/core/Material/decorators.js +11 -6
  180. package/dist/core/Material/decorators.js.map +1 -1
  181. package/dist/core/PostEffects/addACESFilmicToneMappingPass.js +12 -16
  182. package/dist/core/PostEffects/addACESFilmicToneMappingPass.js.map +1 -1
  183. package/dist/core/PostEffects/addBrightnessContrastPass.js +13 -17
  184. package/dist/core/PostEffects/addBrightnessContrastPass.js.map +1 -1
  185. package/dist/core/PostEffects/bloomPass.js +10 -17
  186. package/dist/core/PostEffects/bloomPass.js.map +1 -1
  187. package/dist/core/PostEffects/bloomSelect.js +43 -60
  188. package/dist/core/PostEffects/bloomSelect.js.map +1 -1
  189. package/dist/core/PostEffects/colorifyPass.js +13 -17
  190. package/dist/core/PostEffects/colorifyPass.js.map +1 -1
  191. package/dist/core/PostEffects/index.js +22 -28
  192. package/dist/core/PostEffects/index.js.map +1 -1
  193. package/dist/core/PostEffects/outlinePass.js +50 -37
  194. package/dist/core/PostEffects/outlinePass.js.map +1 -1
  195. package/dist/core/PostEffects/postprocessing.js +12 -14
  196. package/dist/core/PostEffects/postprocessing.js.map +1 -1
  197. package/dist/core/PostEffects/saoPass.js +10 -15
  198. package/dist/core/PostEffects/saoPass.js.map +1 -1
  199. package/dist/core/PostEffects/shader/colorify.js +3 -22
  200. package/dist/core/PostEffects/shader/colorify.js.map +1 -1
  201. package/dist/core/PostEffects/shader/gammaCorrectionShader.js +3 -27
  202. package/dist/core/PostEffects/shader/gammaCorrectionShader.js.map +1 -1
  203. package/dist/core/PostEffects/shader/mapping.js +3 -66
  204. package/dist/core/PostEffects/shader/mapping.js.map +1 -1
  205. package/dist/core/PostEffects/shader/thermalMaging.js +3 -28
  206. package/dist/core/PostEffects/shader/thermalMaging.js.map +1 -1
  207. package/dist/core/SceneEffect/grow/grow.js +101 -85
  208. package/dist/core/SceneEffect/grow/grow.js.map +1 -1
  209. package/dist/core/SceneEffect/grow/style_down.js +77 -60
  210. package/dist/core/SceneEffect/grow/style_down.js.map +1 -1
  211. package/dist/core/SceneEffect/grow/style_up.js +81 -64
  212. package/dist/core/SceneEffect/grow/style_up.js.map +1 -1
  213. package/dist/core/SceneEffect/grow/type.js +2 -2
  214. package/dist/core/SceneEffect/grow/type.js.map +1 -1
  215. package/dist/core/WeatherSystem/DynamicWeatherSystem.js +76 -51
  216. package/dist/core/WeatherSystem/DynamicWeatherSystem.js.map +1 -1
  217. package/dist/core/WeatherSystem/hdr/index.js +105 -69
  218. package/dist/core/WeatherSystem/hdr/index.js.map +1 -1
  219. package/dist/core/WeatherSystem/index.js +124 -77
  220. package/dist/core/WeatherSystem/index.js.map +1 -1
  221. package/dist/core/WeatherSystem/objects/fog/index.js +80 -52
  222. package/dist/core/WeatherSystem/objects/fog/index.js.map +1 -1
  223. package/dist/core/WeatherSystem/objects/rain/index.js +84 -72
  224. package/dist/core/WeatherSystem/objects/rain/index.js.map +1 -1
  225. package/dist/core/WeatherSystem/objects/rain/lineRain.js +118 -88
  226. package/dist/core/WeatherSystem/objects/rain/lineRain.js.map +1 -1
  227. package/dist/core/WeatherSystem/objects/rain/plane.js +146 -116
  228. package/dist/core/WeatherSystem/objects/rain/plane.js.map +1 -1
  229. package/dist/core/WeatherSystem/objects/rain/point.js +148 -100
  230. package/dist/core/WeatherSystem/objects/rain/point.js.map +1 -1
  231. package/dist/core/WeatherSystem/objects/sky/cloud.js +104 -71
  232. package/dist/core/WeatherSystem/objects/sky/cloud.js.map +1 -1
  233. package/dist/core/WeatherSystem/objects/sky/index.js +84 -66
  234. package/dist/core/WeatherSystem/objects/sky/index.js.map +1 -1
  235. package/dist/core/WeatherSystem/objects/sky/outline.js +45 -25
  236. package/dist/core/WeatherSystem/objects/sky/outline.js.map +1 -1
  237. package/dist/core/WeatherSystem/shaders/cloud.js +3 -74
  238. package/dist/core/WeatherSystem/shaders/cloud.js.map +1 -1
  239. package/dist/core/WeatherSystem/shaders/fog.js +3 -103
  240. package/dist/core/WeatherSystem/shaders/fog.js.map +1 -1
  241. package/dist/core/WeatherSystem/shaders/rain.js +7 -206
  242. package/dist/core/WeatherSystem/shaders/rain.js.map +1 -1
  243. package/dist/core/WeatherSystem/shaders/sky.js +3 -87
  244. package/dist/core/WeatherSystem/shaders/sky.js.map +1 -1
  245. package/dist/core/WeatherSystem/sky/index.js +135 -104
  246. package/dist/core/WeatherSystem/sky/index.js.map +1 -1
  247. package/dist/core/WeatherSystem/utils/constant.js +38 -44
  248. package/dist/core/WeatherSystem/utils/constant.js.map +1 -1
  249. package/dist/core/WeatherSystem/utils/math.js +25 -18
  250. package/dist/core/WeatherSystem/utils/math.js.map +1 -1
  251. package/dist/core/WeatherSystem/utils/type.js +1 -1
  252. package/dist/core/WeatherSystem/utils/type.js.map +1 -1
  253. package/dist/core/WeatherSystem/weather/index.js +141 -96
  254. package/dist/core/WeatherSystem/weather/index.js.map +1 -1
  255. package/dist/utils/index.js +1 -1
  256. package/dist/utils/index.js.map +1 -1
  257. package/package.json +3 -3
@@ -1,6 +1,23 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ 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."); }
4
+ 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); }
5
+ 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; }
6
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
12
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
13
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
15
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
16
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
17
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1
18
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
3
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
19
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
20
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
21
  /*
5
22
  * @Descripttion:
6
23
  * @version:
@@ -34,7 +51,7 @@ import { clampAlign, parseWeight, parseStyle, num, color, sanitizeUrl, arr2, arr
34
51
  * - billboard: 看板模式('none'|'yaw'|'full')
35
52
  * - anchor: 面板锚点('top'|'center'|'bottom')
36
53
  */
37
- const defaults = {
54
+ var defaults = {
38
55
  text: {
39
56
  value: '',
40
57
  fontSize: 16,
@@ -100,13 +117,18 @@ const defaults = {
100
117
  * });
101
118
  * panel.updateDynamicScale(camera);
102
119
  */
103
- export default class InfoPanel extends ObjectLayer {
120
+ var InfoPanel = /*#__PURE__*/function (_ObjectLayer) {
121
+ _inherits(InfoPanel, _ObjectLayer);
122
+ var _super = _createSuper(InfoPanel);
104
123
  /**
105
124
  * 构造函数
106
125
  * @param cfg 外部配置对象;仅识别本组件支持的字段,其他字段会忽略
107
126
  */
108
- constructor(cfg = {}) {
109
- super();
127
+ function InfoPanel() {
128
+ var _this;
129
+ var cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
130
+ _classCallCheck(this, InfoPanel);
131
+ _this = _super.call(this);
110
132
  // 新增字段声明,修复类型报错
111
133
  /**
112
134
  * 内部状态与元素引用
@@ -117,37 +139,38 @@ export default class InfoPanel extends ObjectLayer {
117
139
  * - innerWrap: 内部包裹,用于实现锚点与偏移
118
140
  * - _cssObject: three.js CSS3DObject(加入到 scene graph)
119
141
  */
120
- _defineProperty(this, "config", void 0);
121
- _defineProperty(this, "container", void 0);
122
- _defineProperty(this, "titleEl", void 0);
123
- _defineProperty(this, "contentEl", void 0);
124
- _defineProperty(this, "innerWrap", void 0);
125
- _defineProperty(this, "_cssObject", void 0);
142
+ _defineProperty(_assertThisInitialized(_this), "config", void 0);
143
+ _defineProperty(_assertThisInitialized(_this), "container", void 0);
144
+ _defineProperty(_assertThisInitialized(_this), "titleEl", void 0);
145
+ _defineProperty(_assertThisInitialized(_this), "contentEl", void 0);
146
+ _defineProperty(_assertThisInitialized(_this), "innerWrap", void 0);
147
+ _defineProperty(_assertThisInitialized(_this), "_cssObject", void 0);
126
148
  // 复用的临时向量,避免频繁创建对象
127
- _defineProperty(this, "_tmpObjPos", new Vector3());
128
- _defineProperty(this, "_tmpCamPos", new Vector3());
129
- _defineProperty(this, "_tmpCamDir", new Vector3());
130
- this.config = JSON.parse(JSON.stringify(defaults));
131
- this.updateConfig(cfg);
132
- this.container = document.createElement('div');
133
- this.titleEl = document.createElement('div');
134
- this.contentEl = document.createElement('div');
135
- this.innerWrap = document.createElement('div');
149
+ _defineProperty(_assertThisInitialized(_this), "_tmpObjPos", new Vector3());
150
+ _defineProperty(_assertThisInitialized(_this), "_tmpCamPos", new Vector3());
151
+ _defineProperty(_assertThisInitialized(_this), "_tmpCamDir", new Vector3());
152
+ _this.config = JSON.parse(JSON.stringify(defaults));
153
+ _this.updateConfig(cfg);
154
+ _this.container = document.createElement('div');
155
+ _this.titleEl = document.createElement('div');
156
+ _this.contentEl = document.createElement('div');
157
+ _this.innerWrap = document.createElement('div');
136
158
  // 内层包裹用于布局,默认采用容器左上角为参考点
137
- setStyles(this.innerWrap, {
159
+ setStyles(_this.innerWrap, {
138
160
  position: 'relative',
139
161
  left: '0',
140
162
  top: '0',
141
163
  transform: 'none',
142
164
  pointerEvents: 'auto'
143
165
  });
144
- this.innerWrap.appendChild(this.titleEl);
145
- this.innerWrap.appendChild(this.contentEl);
146
- this.container.appendChild(this.innerWrap);
166
+ _this.innerWrap.appendChild(_this.titleEl);
167
+ _this.innerWrap.appendChild(_this.contentEl);
168
+ _this.container.appendChild(_this.innerWrap);
147
169
  // 将 CSS3DObject 作为子节点添加,而非赋值到 this.object3D
148
- this._cssObject = new CSS3DObject(this.container);
149
- this.add(this._cssObject);
150
- this.applyStyle();
170
+ _this._cssObject = new CSS3DObject(_this.container);
171
+ _this.add(_this._cssObject);
172
+ _this.applyStyle();
173
+ return _this;
151
174
  }
152
175
 
153
176
  /**
@@ -158,188 +181,215 @@ export default class InfoPanel extends ObjectLayer {
158
181
  * - `anchor`: 面板锚点。
159
182
  * @param cfg 配置对象
160
183
  */
161
- updateConfig(cfg = {}) {
162
- const t = cfg.text || {};
163
- const c = cfg.content || {};
164
- this.config.text.value = typeof t.value === 'string' ? t.value : this.config.text.value;
165
- this.config.text.fontSize = num(t.fontSize, this.config.text.fontSize);
166
- this.config.text.color = color(t.color, this.config.text.color);
167
- this.config.text.fontWeight = parseWeight(t.fontWeight || this.config.text.fontWeight);
168
- this.config.text.fontStyle = parseStyle(t.fontStyle || this.config.text.fontStyle);
169
- this.config.text.offset = arr2(t.offset, this.config.text.offset);
170
- this.config.text.align = clampAlign(t.align || this.config.text.align);
171
- this.config.text.spacing = num(t.spacing, this.config.text.spacing);
172
- this.config.text.bgUrl = typeof t.bgUrl === 'string' ? sanitizeUrl(t.bgUrl) : this.config.text.bgUrl;
173
- this.config.text.hsl = arr3(t.hsl, this.config.text.hsl).slice(0, 3);
174
- const ns = t.bgNineSlice || {};
175
- this.config.text.bgNineSlice.enabled = typeof ns.enabled === 'boolean' ? ns.enabled : this.config.text.bgNineSlice.enabled;
176
- this.config.text.bgNineSlice.slice = arr4(ns.slice || t.bgSlice, this.config.text.bgNineSlice.slice);
177
- this.config.text.bgNineSlice.width = arr4(ns.width || t.bgSlice, this.config.text.bgNineSlice.width);
178
- this.config.text.bgNineSlice.repeat = rep(ns.repeat || this.config.text.bgNineSlice.repeat);
179
- this.config.text.bgNineSlice.fill = typeof ns.fill === 'boolean' ? ns.fill : this.config.text.bgNineSlice.fill;
180
- this.config.text.bgNineSlice.radius = num(ns.radius, this.config.text.bgNineSlice.radius);
181
- this.config.content.visible = typeof c.visible === 'boolean' ? c.visible : this.config.content.visible;
182
- this.config.content.value = typeof c.value === 'string' ? c.value : this.config.content.value;
183
- this.config.content.fontSize = num(c.fontSize, this.config.content.fontSize);
184
- this.config.content.color = color(c.color, this.config.content.color);
185
- this.config.content.fontWeight = parseWeight(c.fontWeight || this.config.content.fontWeight);
186
- this.config.content.fontStyle = parseStyle(c.fontStyle || this.config.content.fontStyle);
187
- this.config.content.align = clampAlign(c.align || this.config.content.align);
188
- this.config.content.offset = arr2(c.offset, this.config.content.offset);
189
- this.config.content.spacing = num(c.spacing, this.config.content.spacing);
190
- // 支持数值或数组。数值作为统一倍数,数组作为非均匀倍数
191
- if (Array.isArray(cfg.scale) && cfg.scale.length === 3) {
192
- const sx = num(cfg.scale[0], this.config.userScale3[0]);
193
- const sy = num(cfg.scale[1], this.config.userScale3[1]);
194
- const sz = num(cfg.scale[2], this.config.userScale3[2]);
195
- this.config.userScale3 = [sx, sy, sz];
196
- } else {
197
- const s = num(cfg.scale, this.config.scale);
198
- // 用户缩放因子:仅作为乘数,不参与单位换算
199
- this.config.scale = s > 0 ? s : this.config.scale;
184
+ _createClass(InfoPanel, [{
185
+ key: "updateConfig",
186
+ value: function updateConfig() {
187
+ var cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
188
+ var t = cfg.text || {};
189
+ var c = cfg.content || {};
190
+ this.config.text.value = typeof t.value === 'string' ? t.value : this.config.text.value;
191
+ this.config.text.fontSize = num(t.fontSize, this.config.text.fontSize);
192
+ this.config.text.color = color(t.color, this.config.text.color);
193
+ this.config.text.fontWeight = parseWeight(t.fontWeight || this.config.text.fontWeight);
194
+ this.config.text.fontStyle = parseStyle(t.fontStyle || this.config.text.fontStyle);
195
+ this.config.text.offset = arr2(t.offset, this.config.text.offset);
196
+ this.config.text.align = clampAlign(t.align || this.config.text.align);
197
+ this.config.text.spacing = num(t.spacing, this.config.text.spacing);
198
+ this.config.text.bgUrl = typeof t.bgUrl === 'string' ? sanitizeUrl(t.bgUrl) : this.config.text.bgUrl;
199
+ this.config.text.hsl = arr3(t.hsl, this.config.text.hsl).slice(0, 3);
200
+ var ns = t.bgNineSlice || {};
201
+ this.config.text.bgNineSlice.enabled = typeof ns.enabled === 'boolean' ? ns.enabled : this.config.text.bgNineSlice.enabled;
202
+ this.config.text.bgNineSlice.slice = arr4(ns.slice || t.bgSlice, this.config.text.bgNineSlice.slice);
203
+ this.config.text.bgNineSlice.width = arr4(ns.width || t.bgSlice, this.config.text.bgNineSlice.width);
204
+ this.config.text.bgNineSlice.repeat = rep(ns.repeat || this.config.text.bgNineSlice.repeat);
205
+ this.config.text.bgNineSlice.fill = typeof ns.fill === 'boolean' ? ns.fill : this.config.text.bgNineSlice.fill;
206
+ this.config.text.bgNineSlice.radius = num(ns.radius, this.config.text.bgNineSlice.radius);
207
+ this.config.content.visible = typeof c.visible === 'boolean' ? c.visible : this.config.content.visible;
208
+ this.config.content.value = typeof c.value === 'string' ? c.value : this.config.content.value;
209
+ this.config.content.fontSize = num(c.fontSize, this.config.content.fontSize);
210
+ this.config.content.color = color(c.color, this.config.content.color);
211
+ this.config.content.fontWeight = parseWeight(c.fontWeight || this.config.content.fontWeight);
212
+ this.config.content.fontStyle = parseStyle(c.fontStyle || this.config.content.fontStyle);
213
+ this.config.content.align = clampAlign(c.align || this.config.content.align);
214
+ this.config.content.offset = arr2(c.offset, this.config.content.offset);
215
+ this.config.content.spacing = num(c.spacing, this.config.content.spacing);
216
+ // 支持数值或数组。数值作为统一倍数,数组作为非均匀倍数
217
+ if (Array.isArray(cfg.scale) && cfg.scale.length === 3) {
218
+ var sx = num(cfg.scale[0], this.config.userScale3[0]);
219
+ var sy = num(cfg.scale[1], this.config.userScale3[1]);
220
+ var sz = num(cfg.scale[2], this.config.userScale3[2]);
221
+ this.config.userScale3 = [sx, sy, sz];
222
+ } else {
223
+ var s = num(cfg.scale, this.config.scale);
224
+ // 用户缩放因子:仅作为乘数,不参与单位换算
225
+ this.config.scale = s > 0 ? s : this.config.scale;
226
+ }
227
+ var bb = cfg.billboard || this.config.billboard;
228
+ this.config.billboard = bb === 'yaw' || bb === 'full' ? bb : 'none';
229
+ // 面板尺寸可通过 cfg.size 指定,否则使用默认尺寸
230
+ this.config.size = arr2(cfg.size, this.config.size);
231
+ // 屏幕像素锁定
232
+ this.config.pixelLock = !!(typeof cfg.pixelLock === 'boolean' ? cfg.pixelLock : this.config.pixelLock);
233
+ // 面板锚点
234
+ var ac = cfg.anchor || this.config.anchor;
235
+ this.config.anchor = ac === 'top' || ac === 'center' || ac === 'bottom' ? ac : 'bottom';
200
236
  }
201
- const bb = cfg.billboard || this.config.billboard;
202
- this.config.billboard = bb === 'yaw' || bb === 'full' ? bb : 'none';
203
- // 面板尺寸可通过 cfg.size 指定,否则使用默认尺寸
204
- this.config.size = arr2(cfg.size, this.config.size);
205
- // 屏幕像素锁定
206
- this.config.pixelLock = !!(typeof cfg.pixelLock === 'boolean' ? cfg.pixelLock : this.config.pixelLock);
207
- // 面板锚点
208
- const ac = cfg.anchor || this.config.anchor;
209
- this.config.anchor = ac === 'top' || ac === 'center' || ac === 'bottom' ? ac : 'bottom';
210
- }
211
237
 
212
- /**
213
- * 设置面板世界坐标(应用到 CSS3DObject)。
214
- */
215
- setPosition(x, y, z) {
216
- this._cssObject.position.set(x, y, z);
217
- }
218
-
219
- /**
220
- * 设置面板世界旋转(欧拉角,单位:弧度)。
221
- */
222
- setRotation(x, y, z) {
223
- this._cssObject.rotation.set(x, y, z);
224
- }
238
+ /**
239
+ * 设置面板世界坐标(应用到 CSS3DObject)。
240
+ */
241
+ }, {
242
+ key: "setPosition",
243
+ value: function setPosition(x, y, z) {
244
+ this._cssObject.position.set(x, y, z);
245
+ }
225
246
 
226
- /**
227
- * 设置统一缩放因子(立即应用到 CSS3DObject)。
228
- * 注意:若使用 `updateDynamicScale`,每帧会覆盖此值。
229
- */
230
- setScale(s) {
231
- this._cssObject.scale.setScalar(s);
232
- }
247
+ /**
248
+ * 设置面板世界旋转(欧拉角,单位:弧度)。
249
+ */
250
+ }, {
251
+ key: "setRotation",
252
+ value: function setRotation(x, y, z) {
253
+ this._cssObject.rotation.set(x, y, z);
254
+ }
233
255
 
234
- /**
235
- * 设置看板模式。
236
- * @param mode 'none' | 'yaw' | 'full'
237
- */
238
- setBillboard(mode) {
239
- const m = mode === 'yaw' || mode === 'full' ? mode : 'none';
240
- this.config.billboard = m;
241
- }
256
+ /**
257
+ * 设置统一缩放因子(立即应用到 CSS3DObject)。
258
+ * 注意:若使用 `updateDynamicScale`,每帧会覆盖此值。
259
+ */
260
+ }, {
261
+ key: "setScale",
262
+ value: function setScale(s) {
263
+ this._cssObject.scale.setScalar(s);
264
+ }
242
265
 
243
- /**
244
- * 设置可见性。
245
- * @param v 是否可见
246
- */
247
- setVisible(v) {
248
- this._cssObject.visible = !!v;
249
- }
266
+ /**
267
+ * 设置看板模式。
268
+ * @param mode 'none' | 'yaw' | 'full'
269
+ */
270
+ }, {
271
+ key: "setBillboard",
272
+ value: function setBillboard(mode) {
273
+ var m = mode === 'yaw' || mode === 'full' ? mode : 'none';
274
+ this.config.billboard = m;
275
+ }
250
276
 
251
- /**
252
- * 应用所有样式与文本到 DOM。
253
- * 仅影响面板的排版与外观,不涉及 3D 变换。
254
- */
255
- applyStyle() {
256
- const t = this.config.text;
257
- const c = this.config.content;
258
- // 基础容器样式,确保可见尺寸与居中锚点
259
- setStyles(this.container, {
260
- display: 'inline-block',
261
- boxSizing: 'border-box',
262
- transformOrigin: 'center center',
263
- backgroundRepeat: 'no-repeat',
264
- backgroundPosition: 'center',
265
- backfaceVisibility: 'hidden',
266
- padding: '8px'
267
- });
268
- // 最小像素尺寸(默认 320x180,可通过 cfg.size 覆盖),容器尺寸随内容自适应
269
- const [pxW, pxH] = this.config.size;
270
- setStyles(this.container, {
271
- width: '',
272
- height: '',
273
- minWidth: `${pxW}px`,
274
- minHeight: `${pxH}px`
275
- });
276
- // 根据锚点设置内部包裹的定位与偏移(默认 top:以左上角为参考)
277
- if (this.config.anchor === 'top') {
278
- this.innerWrap.style.left = '0';
279
- this.innerWrap.style.top = '0';
280
- this.innerWrap.style.bottom = 'auto';
281
- this.innerWrap.style.transform = 'none';
282
- } else if (this.config.anchor === 'center') {
283
- this.innerWrap.style.left = '50%';
284
- this.innerWrap.style.top = '50%';
285
- this.innerWrap.style.bottom = 'auto';
286
- this.innerWrap.style.transform = 'translate(-50%, -50%)';
287
- } else {
288
- // bottom
289
- this.innerWrap.style.left = '0';
290
- this.innerWrap.style.top = 'auto';
291
- this.innerWrap.style.bottom = '0';
292
- this.innerWrap.style.transform = 'none';
277
+ /**
278
+ * 设置可见性。
279
+ * @param v 是否可见
280
+ */
281
+ }, {
282
+ key: "setVisible",
283
+ value: function setVisible(v) {
284
+ this._cssObject.visible = !!v;
293
285
  }
294
- this.titleEl.textContent = t.value || '';
295
- setStyles(this.titleEl, {
296
- fontSize: `${t.fontSize}px`,
297
- color: t.color,
298
- fontWeight: t.fontWeight,
299
- fontStyle: t.fontStyle,
300
- textAlign: t.align,
301
- letterSpacing: `${num(t.spacing)}px`,
302
- whiteSpace: 'nowrap',
303
- overflow: 'hidden',
304
- textOverflow: 'ellipsis',
305
- marginLeft: `${num(t.offset[0])}px`,
306
- marginTop: `${num(t.offset[1])}px`
307
- });
308
- this.contentEl.style.display = c.visible ? 'block' : 'none';
309
- this.contentEl.textContent = c.value || '';
310
- setStyles(this.contentEl, {
311
- fontSize: `${c.fontSize}px`,
312
- color: c.color,
313
- fontWeight: c.fontWeight,
314
- fontStyle: c.fontStyle,
315
- textAlign: c.align,
316
- letterSpacing: `${num(c.spacing)}px`,
317
- whiteSpace: 'pre-wrap',
318
- wordBreak: 'break-word',
319
- overflow: 'visible',
320
- textOverflow: 'clip',
321
- marginLeft: `${num(c.offset[0])}px`,
322
- marginTop: `${num(c.offset[1])}px`
323
- });
324
- const hasBgUrl = typeof t.bgUrl === 'string' && t.bgUrl.length > 0;
325
- if (hasBgUrl) {
326
- if (t.bgNineSlice && t.bgNineSlice.enabled) {
327
- const s = t.bgNineSlice.slice;
328
- const w = t.bgNineSlice.width;
329
- // 厚度限制,避免边框厚度超过容器尺寸导致异常视觉放大
330
- const wClamped = [Math.min(w[0], pxH * 0.5), Math.min(w[1], pxW * 0.5), Math.min(w[2], pxH * 0.5), Math.min(w[3], pxW * 0.5)];
331
- setStyles(this.container, {
332
- borderStyle: 'solid',
333
- borderWidth: `${wClamped[0]}px ${wClamped[1]}px ${wClamped[2]}px ${wClamped[3]}px`,
334
- borderImageSource: `url(${t.bgUrl})`,
335
- borderImageSlice: `${s[0]} ${s[1]} ${s[2]} ${s[3]}${t.bgNineSlice.fill ? ' fill' : ''}`,
336
- borderImageRepeat: t.bgNineSlice.repeat,
337
- backgroundImage: 'none',
338
- borderRadius: `${num(t.bgNineSlice.radius, 0)}px`
339
- });
286
+
287
+ /**
288
+ * 应用所有样式与文本到 DOM。
289
+ * 仅影响面板的排版与外观,不涉及 3D 变换。
290
+ */
291
+ }, {
292
+ key: "applyStyle",
293
+ value: function applyStyle() {
294
+ var t = this.config.text;
295
+ var c = this.config.content;
296
+ // 基础容器样式,确保可见尺寸与居中锚点
297
+ setStyles(this.container, {
298
+ display: 'inline-block',
299
+ boxSizing: 'border-box',
300
+ transformOrigin: 'center center',
301
+ backgroundRepeat: 'no-repeat',
302
+ backgroundPosition: 'center',
303
+ backfaceVisibility: 'hidden',
304
+ padding: '8px'
305
+ });
306
+ // 最小像素尺寸(默认 320x180,可通过 cfg.size 覆盖),容器尺寸随内容自适应
307
+ var _this$config$size = _slicedToArray(this.config.size, 2),
308
+ pxW = _this$config$size[0],
309
+ pxH = _this$config$size[1];
310
+ setStyles(this.container, {
311
+ width: '',
312
+ height: '',
313
+ minWidth: "".concat(pxW, "px"),
314
+ minHeight: "".concat(pxH, "px")
315
+ });
316
+ // 根据锚点设置内部包裹的定位与偏移(默认 top:以左上角为参考)
317
+ if (this.config.anchor === 'top') {
318
+ this.innerWrap.style.left = '0';
319
+ this.innerWrap.style.top = '0';
320
+ this.innerWrap.style.bottom = 'auto';
321
+ this.innerWrap.style.transform = 'none';
322
+ } else if (this.config.anchor === 'center') {
323
+ this.innerWrap.style.left = '50%';
324
+ this.innerWrap.style.top = '50%';
325
+ this.innerWrap.style.bottom = 'auto';
326
+ this.innerWrap.style.transform = 'translate(-50%, -50%)';
327
+ } else {
328
+ // bottom
329
+ this.innerWrap.style.left = '0';
330
+ this.innerWrap.style.top = 'auto';
331
+ this.innerWrap.style.bottom = '0';
332
+ this.innerWrap.style.transform = 'none';
333
+ }
334
+ this.titleEl.textContent = t.value || '';
335
+ setStyles(this.titleEl, {
336
+ fontSize: "".concat(t.fontSize, "px"),
337
+ color: t.color,
338
+ fontWeight: t.fontWeight,
339
+ fontStyle: t.fontStyle,
340
+ textAlign: t.align,
341
+ letterSpacing: "".concat(num(t.spacing), "px"),
342
+ whiteSpace: 'nowrap',
343
+ overflow: 'hidden',
344
+ textOverflow: 'ellipsis',
345
+ marginLeft: "".concat(num(t.offset[0]), "px"),
346
+ marginTop: "".concat(num(t.offset[1]), "px")
347
+ });
348
+ this.contentEl.style.display = c.visible ? 'block' : 'none';
349
+ this.contentEl.textContent = c.value || '';
350
+ setStyles(this.contentEl, {
351
+ fontSize: "".concat(c.fontSize, "px"),
352
+ color: c.color,
353
+ fontWeight: c.fontWeight,
354
+ fontStyle: c.fontStyle,
355
+ textAlign: c.align,
356
+ letterSpacing: "".concat(num(c.spacing), "px"),
357
+ whiteSpace: 'pre-wrap',
358
+ wordBreak: 'break-word',
359
+ overflow: 'visible',
360
+ textOverflow: 'clip',
361
+ marginLeft: "".concat(num(c.offset[0]), "px"),
362
+ marginTop: "".concat(num(c.offset[1]), "px")
363
+ });
364
+ var hasBgUrl = typeof t.bgUrl === 'string' && t.bgUrl.length > 0;
365
+ if (hasBgUrl) {
366
+ if (t.bgNineSlice && t.bgNineSlice.enabled) {
367
+ var s = t.bgNineSlice.slice;
368
+ var w = t.bgNineSlice.width;
369
+ // 厚度限制,避免边框厚度超过容器尺寸导致异常视觉放大
370
+ var wClamped = [Math.min(w[0], pxH * 0.5), Math.min(w[1], pxW * 0.5), Math.min(w[2], pxH * 0.5), Math.min(w[3], pxW * 0.5)];
371
+ setStyles(this.container, {
372
+ borderStyle: 'solid',
373
+ borderWidth: "".concat(wClamped[0], "px ").concat(wClamped[1], "px ").concat(wClamped[2], "px ").concat(wClamped[3], "px"),
374
+ borderImageSource: "url(".concat(t.bgUrl, ")"),
375
+ borderImageSlice: "".concat(s[0], " ").concat(s[1], " ").concat(s[2], " ").concat(s[3]).concat(t.bgNineSlice.fill ? ' fill' : ''),
376
+ borderImageRepeat: t.bgNineSlice.repeat,
377
+ backgroundImage: 'none',
378
+ borderRadius: "".concat(num(t.bgNineSlice.radius, 0), "px")
379
+ });
380
+ } else {
381
+ setStyles(this.container, {
382
+ backgroundImage: "url(".concat(t.bgUrl, ")"),
383
+ borderImageSource: 'none',
384
+ borderImageSlice: '',
385
+ borderImageRepeat: '',
386
+ borderStyle: 'none',
387
+ borderWidth: '0px'
388
+ });
389
+ }
340
390
  } else {
341
391
  setStyles(this.container, {
342
- backgroundImage: `url(${t.bgUrl})`,
392
+ backgroundImage: 'none',
343
393
  borderImageSource: 'none',
344
394
  borderImageSlice: '',
345
395
  borderImageRepeat: '',
@@ -347,128 +397,136 @@ export default class InfoPanel extends ObjectLayer {
347
397
  borderWidth: '0px'
348
398
  });
349
399
  }
350
- } else {
400
+ // 背景填充整个容器尺寸
351
401
  setStyles(this.container, {
352
- backgroundImage: 'none',
353
- borderImageSource: 'none',
354
- borderImageSlice: '',
355
- borderImageRepeat: '',
356
- borderStyle: 'none',
357
- borderWidth: '0px'
402
+ backgroundSize: '100% 100%',
403
+ textAlign: t.align,
404
+ pointerEvents: 'auto',
405
+ filter: "hue-rotate(".concat(num(t.hsl[0], 0), "deg) saturate(").concat(num(t.hsl[1], 0), "%) brightness(").concat(num(t.hsl[2], 0), "%)")
358
406
  });
359
407
  }
360
- // 背景填充整个容器尺寸
361
- setStyles(this.container, {
362
- backgroundSize: '100% 100%',
363
- textAlign: t.align,
364
- pointerEvents: 'auto',
365
- filter: `hue-rotate(${num(t.hsl[0], 0)}deg) saturate(${num(t.hsl[1], 0)}%) brightness(${num(t.hsl[2], 0)}%)`
366
- });
367
- }
368
408
 
369
- /**
370
- * 更新配置并立即重新应用到 DOM。
371
- * @param cfg 新配置
372
- */
373
- update(cfg = {}) {
374
- this.updateConfig(cfg);
375
- this.applyStyle();
376
- }
409
+ /**
410
+ * 更新配置并立即重新应用到 DOM。
411
+ * @param cfg 新配置
412
+ */
413
+ }, {
414
+ key: "update",
415
+ value: function update() {
416
+ var cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
417
+ this.updateConfig(cfg);
418
+ this.applyStyle();
419
+ }
377
420
 
378
- /**
379
- * 根据看板模式使面板朝向相机。
380
- * - 'full':使用 `lookAt` 全方位朝向相机。
381
- * - 'yaw':仅绕 Y 轴旋转,保持水平面朝向相机。
382
- * - 'none':不处理朝向。
383
- * @param camera three.js 相机
384
- */
385
- updateFacing(camera) {
386
- const mode = this.config.billboard;
387
- if (mode === 'none') return;
388
- const objPos = this._tmpObjPos;
389
- const camPos = this._tmpCamPos;
390
- this._cssObject.getWorldPosition(objPos);
391
- camera.getWorldPosition(camPos);
392
- if (mode === 'full') {
393
- this._cssObject.lookAt(camPos);
394
- } else if (mode === 'yaw') {
395
- const dx = camPos.x - objPos.x;
396
- const dz = camPos.z - objPos.z;
397
- const yaw = Math.atan2(dx, dz);
398
- this._cssObject.rotation.set(0, yaw, 0);
421
+ /**
422
+ * 根据看板模式使面板朝向相机。
423
+ * - 'full':使用 `lookAt` 全方位朝向相机。
424
+ * - 'yaw':仅绕 Y 轴旋转,保持水平面朝向相机。
425
+ * - 'none':不处理朝向。
426
+ * @param camera three.js 相机
427
+ */
428
+ }, {
429
+ key: "updateFacing",
430
+ value: function updateFacing(camera) {
431
+ var mode = this.config.billboard;
432
+ if (mode === 'none') return;
433
+ var objPos = this._tmpObjPos;
434
+ var camPos = this._tmpCamPos;
435
+ this._cssObject.getWorldPosition(objPos);
436
+ camera.getWorldPosition(camPos);
437
+ if (mode === 'full') {
438
+ this._cssObject.lookAt(camPos);
439
+ } else if (mode === 'yaw') {
440
+ var dx = camPos.x - objPos.x;
441
+ var dz = camPos.z - objPos.z;
442
+ var yaw = Math.atan2(dx, dz);
443
+ this._cssObject.rotation.set(0, yaw, 0);
444
+ }
399
445
  }
400
- }
401
446
 
402
- /**
403
- * 动态缩放:根据相机 FOV、沿相机前向的距离 d、视口尺寸,
404
- * 计算“每像素对应的世界单位”,并结合用户缩放得到最终缩放。
405
- * - pixelLock: s = worldPerPixelX * userScale
406
- * - 非锁定: s = userScale
407
- * - 最终各轴缩放: [sx, sy, sz] = s * userScale3
408
- */
409
- updateDynamicScale(camera, viewportWidth = window.innerWidth, viewportHeight = window.innerHeight) {
410
- if (!camera) return;
411
- const objPos = this._tmpObjPos;
412
- const camPos = this._tmpCamPos;
413
- const camDir = this._tmpCamDir;
414
- this._cssObject.getWorldPosition(objPos);
415
- camera.getWorldPosition(camPos);
416
- camera.getWorldDirection(camDir);
417
- const d = objPos.clone().sub(camPos).dot(camDir);
418
- const fovRad = MathUtils.degToRad(camera.fov);
419
- const worldPerPixelY = 2 * d * Math.tan(fovRad / 2) / viewportHeight;
420
- const worldPerPixelX = worldPerPixelY * camera.aspect;
421
- const userScale = this.config.scale;
422
- const userScale3 = this.config.userScale3 || [1, 1, 1];
423
- // pixel-lock:保持屏幕像素尺寸恒定;非锁定:使用统一用户系数
424
- let s = this.config.pixelLock ? worldPerPixelX * (userScale > 0 ? userScale : 1) : userScale > 0 ? userScale : 1;
425
- if (!Number.isFinite(s) || s <= 0) return;
426
- // 简单限幅,避免极端相机参数造成缩放异常
427
- const MAX_S = 1e3;
428
- const MIN_S = 1e-6;
429
- s = Math.max(Math.min(s, MAX_S), MIN_S);
430
- const sx = s * (userScale3[0] || 1);
431
- const sy = s * (userScale3[1] || 1);
432
- const sz = s * (userScale3[2] || 1);
433
- this._cssObject.scale.set(sx, sy, sz);
434
- }
447
+ /**
448
+ * 动态缩放:根据相机 FOV、沿相机前向的距离 d、视口尺寸,
449
+ * 计算“每像素对应的世界单位”,并结合用户缩放得到最终缩放。
450
+ * - pixelLock: s = worldPerPixelX * userScale
451
+ * - 非锁定: s = userScale
452
+ * - 最终各轴缩放: [sx, sy, sz] = s * userScale3
453
+ */
454
+ }, {
455
+ key: "updateDynamicScale",
456
+ value: function updateDynamicScale(camera) {
457
+ var viewportWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.innerWidth;
458
+ var viewportHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : window.innerHeight;
459
+ if (!camera) return;
460
+ var objPos = this._tmpObjPos;
461
+ var camPos = this._tmpCamPos;
462
+ var camDir = this._tmpCamDir;
463
+ this._cssObject.getWorldPosition(objPos);
464
+ camera.getWorldPosition(camPos);
465
+ camera.getWorldDirection(camDir);
466
+ var d = objPos.clone().sub(camPos).dot(camDir);
467
+ var fovRad = MathUtils.degToRad(camera.fov);
468
+ var worldPerPixelY = 2 * d * Math.tan(fovRad / 2) / viewportHeight;
469
+ var worldPerPixelX = worldPerPixelY * camera.aspect;
470
+ var userScale = this.config.scale;
471
+ var userScale3 = this.config.userScale3 || [1, 1, 1];
472
+ // pixel-lock:保持屏幕像素尺寸恒定;非锁定:使用统一用户系数
473
+ var s = this.config.pixelLock ? worldPerPixelX * (userScale > 0 ? userScale : 1) : userScale > 0 ? userScale : 1;
474
+ if (!Number.isFinite(s) || s <= 0) return;
475
+ // 简单限幅,避免极端相机参数造成缩放异常
476
+ var MAX_S = 1e3;
477
+ var MIN_S = 1e-6;
478
+ s = Math.max(Math.min(s, MAX_S), MIN_S);
479
+ var sx = s * (userScale3[0] || 1);
480
+ var sy = s * (userScale3[1] || 1);
481
+ var sz = s * (userScale3[2] || 1);
482
+ this._cssObject.scale.set(sx, sy, sz);
483
+ }
435
484
 
436
- // 移除父级缩放抵消,面板可响应外部实体缩放(含非均匀)
485
+ // 移除父级缩放抵消,面板可响应外部实体缩放(含非均匀)
437
486
 
438
- /**
439
- * 释放面板:从场景移除 CSS3DObject,并清理 DOM。
440
- */
441
- dispose() {
442
- if (this._cssObject.parent) this._cssObject.parent.remove(this._cssObject);
443
- this.container.remove();
444
- }
487
+ /**
488
+ * 释放面板:从场景移除 CSS3DObject,并清理 DOM。
489
+ */
490
+ }, {
491
+ key: "dispose",
492
+ value: function dispose() {
493
+ if (this._cssObject.parent) this._cssObject.parent.remove(this._cssObject);
494
+ this.container.remove();
495
+ }
445
496
 
446
- /**
447
- * 获取当前面板在世界坐标中的宽高(单位:世界单位)。
448
- * 注意:结果受相机参数、面板到相机的距离以及当前 `_cssObject.scale` 影响。
449
- * @param camera three.js 相机
450
- * @param viewportWidth 视口宽度(像素)
451
- * @param viewportHeight 视口高度(像素)
452
- * @returns `{ width, height }` 世界单位
453
- */
454
- getWorldSize(camera, viewportWidth = window.innerWidth, viewportHeight = window.innerHeight) {
455
- const objPos = this._tmpObjPos;
456
- const camPos = this._tmpCamPos;
457
- const camDir = this._tmpCamDir;
458
- this._cssObject.getWorldPosition(objPos);
459
- camera.getWorldPosition(camPos);
460
- camera.getWorldDirection(camDir);
461
- const d = objPos.clone().sub(camPos).dot(camDir);
462
- const fovRad = MathUtils.degToRad(camera.fov);
463
- const worldPerPixelY = 2 * d * Math.tan(fovRad / 2) / viewportHeight;
464
- const worldPerPixelX = worldPerPixelY * camera.aspect;
465
- const wpx = this.container.offsetWidth || 0;
466
- const hpx = this.container.offsetHeight || 0;
467
- const s = this._cssObject.scale.x;
468
- return {
469
- width: wpx * worldPerPixelX * s,
470
- height: hpx * worldPerPixelY * s
471
- };
472
- }
473
- }
497
+ /**
498
+ * 获取当前面板在世界坐标中的宽高(单位:世界单位)。
499
+ * 注意:结果受相机参数、面板到相机的距离以及当前 `_cssObject.scale` 影响。
500
+ * @param camera three.js 相机
501
+ * @param viewportWidth 视口宽度(像素)
502
+ * @param viewportHeight 视口高度(像素)
503
+ * @returns `{ width, height }` 世界单位
504
+ */
505
+ }, {
506
+ key: "getWorldSize",
507
+ value: function getWorldSize(camera) {
508
+ var viewportWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.innerWidth;
509
+ var viewportHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : window.innerHeight;
510
+ var objPos = this._tmpObjPos;
511
+ var camPos = this._tmpCamPos;
512
+ var camDir = this._tmpCamDir;
513
+ this._cssObject.getWorldPosition(objPos);
514
+ camera.getWorldPosition(camPos);
515
+ camera.getWorldDirection(camDir);
516
+ var d = objPos.clone().sub(camPos).dot(camDir);
517
+ var fovRad = MathUtils.degToRad(camera.fov);
518
+ var worldPerPixelY = 2 * d * Math.tan(fovRad / 2) / viewportHeight;
519
+ var worldPerPixelX = worldPerPixelY * camera.aspect;
520
+ var wpx = this.container.offsetWidth || 0;
521
+ var hpx = this.container.offsetHeight || 0;
522
+ var s = this._cssObject.scale.x;
523
+ return {
524
+ width: wpx * worldPerPixelX * s,
525
+ height: hpx * worldPerPixelY * s
526
+ };
527
+ }
528
+ }]);
529
+ return InfoPanel;
530
+ }(ObjectLayer);
531
+ export { InfoPanel as default };
474
532
  //# sourceMappingURL=index.js.map