@anov/3d-ability 0.0.139 → 0.0.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/business/Animation/motion/index.js +35 -56
- package/dist/business/Animation/motion/index.js.map +1 -1
- package/dist/business/Animation/type.js +2 -2
- package/dist/business/Area/Fence/FenceBase.js +146 -187
- package/dist/business/Area/Fence/FenceBase.js.map +1 -1
- package/dist/business/Area/Fence/fence_base_01.js +120 -112
- package/dist/business/Area/Fence/fence_base_01.js.map +1 -1
- package/dist/business/Area/Fence/fence_feeting_01.js +218 -130
- package/dist/business/Area/Fence/fence_feeting_01.js.map +1 -1
- package/dist/business/Area/Fence/fence_roll_01.js +140 -130
- package/dist/business/Area/Fence/fence_roll_01.js.map +1 -1
- package/dist/business/Area/FillArea/FillAreaBase.js +87 -126
- package/dist/business/Area/FillArea/FillAreaBase.js.map +1 -1
- package/dist/business/Area/FillArea/fillArea_face_01.js +72 -98
- package/dist/business/Area/FillArea/fillArea_face_01.js.map +1 -1
- package/dist/business/Area/FillArea/fillArea_line_01.js +66 -94
- package/dist/business/Area/FillArea/fillArea_line_01.js.map +1 -1
- package/dist/business/Area/index.js +267 -483
- package/dist/business/Area/index.js.map +1 -1
- package/dist/business/Area/tool.js +14 -26
- package/dist/business/Area/tool.js.map +1 -1
- package/dist/business/Base/ObjectLayer.js +21 -46
- package/dist/business/Base/ObjectLayer.js.map +1 -1
- package/dist/business/Batch/index.js +189 -234
- package/dist/business/Batch/index.js.map +1 -1
- package/dist/business/Box/index.js +52 -81
- package/dist/business/Box/index.js.map +1 -1
- package/dist/business/Cylinder/index.js +51 -79
- package/dist/business/Cylinder/index.js.map +1 -1
- package/dist/business/Flyline/bubble/CircleBubble.js +1 -9
- package/dist/business/Flyline/bubble/CircleBubble.js.map +1 -1
- package/dist/business/Flyline/bubble/index.js +7 -21
- package/dist/business/Flyline/bubble/index.js.map +1 -1
- package/dist/business/Flyline/index.js +96 -162
- package/dist/business/Flyline/index.js.map +1 -1
- package/dist/business/Flyline/line/ArcLine.js +208 -291
- package/dist/business/Flyline/line/ArcLine.js.map +1 -1
- package/dist/business/Flyline/line/index.js +8 -22
- package/dist/business/Flyline/line/index.js.map +1 -1
- package/dist/business/HeatMap/HeatMap.js +380 -467
- package/dist/business/HeatMap/HeatMap.js.map +1 -1
- package/dist/business/HeatMap/core.js +405 -525
- package/dist/business/HeatMap/core.js.map +1 -1
- package/dist/business/HeatMap/shader.js +69 -3
- package/dist/business/HeatMap/shader.js.map +1 -1
- package/dist/business/InfoPanel/index.js +201 -242
- package/dist/business/InfoPanel/index.js.map +1 -1
- package/dist/business/Line/index.js +55 -88
- package/dist/business/Line/index.js.map +1 -1
- package/dist/business/Mark/KeyframeAnimation.js +145 -176
- package/dist/business/Mark/KeyframeAnimation.js.map +1 -1
- package/dist/business/Mark/index.js +196 -294
- package/dist/business/Mark/index.js.map +1 -1
- package/dist/business/Mark/shader/tanhao.js +36 -3
- package/dist/business/Mark/shader/tanhao.js.map +1 -1
- package/dist/business/Mark/type.js +1 -1
- package/dist/business/MaterialSwitch/MaterialSwitchSystem.js +377 -551
- package/dist/business/MaterialSwitch/MaterialSwitchSystem.js.map +1 -1
- package/dist/business/MaterialSwitch/inject.js +92 -58
- package/dist/business/MaterialSwitch/inject.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/finalFade.js +74 -2
- package/dist/business/MaterialSwitch/shader/finalFade.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/ground.js +95 -16
- package/dist/business/MaterialSwitch/shader/ground.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/groundBase64.js +9 -3
- package/dist/business/MaterialSwitch/shader/groundBase64.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/realFade.js +48 -9
- package/dist/business/MaterialSwitch/shader/realFade.js.map +1 -1
- package/dist/business/Plane/index.js +51 -78
- package/dist/business/Plane/index.js.map +1 -1
- package/dist/business/Poi/index.d.ts +5 -0
- package/dist/business/Poi/index.js +256 -295
- package/dist/business/Poi/index.js.map +1 -1
- package/dist/business/Poi/link/Cylinder.js +56 -89
- package/dist/business/Poi/link/Cylinder.js.map +1 -1
- package/dist/business/Poi/link/Pyramid.js +104 -165
- package/dist/business/Poi/link/Pyramid.js.map +1 -1
- package/dist/business/Poi/link/index.d.ts +1 -1
- package/dist/business/Poi/link/index.js +54 -114
- package/dist/business/Poi/link/index.js.map +1 -1
- package/dist/business/Poi/panel/index.d.ts +124 -0
- package/dist/business/Poi/panel/index.js +474 -0
- package/dist/business/Poi/panel/index.js.map +1 -0
- package/dist/business/Poi/panel/interfaces.d.ts +67 -0
- package/dist/business/Poi/panel/interfaces.js +2 -0
- package/dist/business/Poi/panel/interfaces.js.map +1 -0
- package/dist/business/Poi/panel/utils.d.ts +72 -0
- package/dist/business/Poi/panel/utils.js +126 -0
- package/dist/business/Poi/panel/utils.js.map +1 -0
- package/dist/business/Poi/particle/DoubleCircle.js +71 -107
- package/dist/business/Poi/particle/DoubleCircle.js.map +1 -1
- package/dist/business/Poi/particle/DynamicCircle.js +75 -111
- package/dist/business/Poi/particle/DynamicCircle.js.map +1 -1
- package/dist/business/Poi/particle/SingleCircle.js +62 -98
- package/dist/business/Poi/particle/SingleCircle.js.map +1 -1
- package/dist/business/Poi/particle/index.js +49 -117
- package/dist/business/Poi/particle/index.js.map +1 -1
- package/dist/business/Poi/shader/circle.js +31 -3
- package/dist/business/Poi/shader/circle.js.map +1 -1
- package/dist/business/Poi/shader/cylinder.js +37 -3
- package/dist/business/Poi/shader/cylinder.js.map +1 -1
- package/dist/business/Poi/shader/doubleCircle.js +55 -3
- package/dist/business/Poi/shader/doubleCircle.js.map +1 -1
- package/dist/business/Poi/shader/dynamicCircle.js +67 -3
- package/dist/business/Poi/shader/dynamicCircle.js.map +1 -1
- package/dist/business/Poi/title/Border.js +7 -27
- package/dist/business/Poi/title/Border.js.map +1 -1
- package/dist/business/Poi/title/Ellipse.js +7 -27
- package/dist/business/Poi/title/Ellipse.js.map +1 -1
- package/dist/business/Poi/title/index.js +208 -292
- package/dist/business/Poi/title/index.js.map +1 -1
- package/dist/business/Poi/tools.js +22 -19
- package/dist/business/Poi/tools.js.map +1 -1
- package/dist/business/Poi/types.d.ts +3 -0
- package/dist/business/Poi/types.js.map +1 -1
- package/dist/business/Sphere/index.js +47 -72
- package/dist/business/Sphere/index.js.map +1 -1
- package/dist/business/Spline/index.js +190 -245
- package/dist/business/Spline/index.js.map +1 -1
- package/dist/business/SplitBuilding/index.js +327 -536
- package/dist/business/SplitBuilding/index.js.map +1 -1
- package/dist/business/SplitBuilding/type.js +2 -2
- package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js +218 -275
- package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js +132 -177
- package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js +51 -1
- package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js +6 -1
- package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js.map +1 -1
- package/dist/business/TrafficComponents/base.js +32 -55
- package/dist/business/TrafficComponents/base.js.map +1 -1
- package/dist/business/TrafficComponents/utils.js +25 -24
- package/dist/business/TrafficComponents/utils.js.map +1 -1
- package/dist/business/Utils/Curve.js +40 -56
- package/dist/business/Utils/Curve.js.map +1 -1
- package/dist/business/Utils/constant.js +1 -1
- package/dist/business/Utils/constant.js.map +1 -1
- package/dist/business/Utils/defineProps.js +13 -14
- package/dist/business/Utils/defineProps.js.map +1 -1
- package/dist/business/Utils/round-curve.js +127 -153
- package/dist/business/Utils/round-curve.js.map +1 -1
- package/dist/business/VideoPanel/index.js +258 -319
- package/dist/business/VideoPanel/index.js.map +1 -1
- package/dist/business/Water/index.js +78 -108
- package/dist/business/Water/index.js.map +1 -1
- package/dist/business/Water/types.js +1 -1
- package/dist/business/Water/types.js.map +1 -1
- package/dist/core/Camera/PerspectiveCamera/CameraExpand.js +383 -449
- package/dist/core/Camera/PerspectiveCamera/CameraExpand.js.map +1 -1
- package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js +107 -142
- package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js.map +1 -1
- package/dist/core/Controls/FirstViewControl/index.js +84 -96
- package/dist/core/Controls/FirstViewControl/index.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/action/input.js +77 -98
- package/dist/core/Controls/ThirdViewControl/action/input.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/config/constants.js +1 -1
- package/dist/core/Controls/ThirdViewControl/config/constants.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/index.js +19 -28
- package/dist/core/Controls/ThirdViewControl/index.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/animation.js +126 -155
- package/dist/core/Controls/ThirdViewControl/player/animation.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/camera.js +47 -63
- package/dist/core/Controls/ThirdViewControl/player/camera.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/control.js +39 -49
- package/dist/core/Controls/ThirdViewControl/player/control.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player.js +66 -91
- package/dist/core/Controls/ThirdViewControl/player.js.map +1 -1
- package/dist/core/Controls/base.js +14 -30
- package/dist/core/Controls/base.js.map +1 -1
- package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js +92 -131
- package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js.map +1 -1
- package/dist/core/Debug/PerformanceInfo/Performance.js +22 -47
- package/dist/core/Debug/PerformanceInfo/Performance.js.map +1 -1
- package/dist/core/Light/PointLight/PointLightExt.js +4 -21
- package/dist/core/Light/PointLight/PointLightExt.js.map +1 -1
- package/dist/core/Material/FinirMaterial/FinirMaterial.js +37 -57
- package/dist/core/Material/FinirMaterial/FinirMaterial.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js +116 -153
- package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/shader/fragment.js +95 -1
- package/dist/core/Material/PristineGridMaterial/shader/fragment.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/shader/vertex.js +26 -1
- package/dist/core/Material/PristineGridMaterial/shader/vertex.js.map +1 -1
- package/dist/core/Material/SurfaceMaterial/index.js +76 -172
- package/dist/core/Material/SurfaceMaterial/index.js.map +1 -1
- package/dist/core/Material/decorators.js +6 -11
- package/dist/core/Material/decorators.js.map +1 -1
- package/dist/core/PostEffects/addACESFilmicToneMappingPass.js +16 -12
- package/dist/core/PostEffects/addACESFilmicToneMappingPass.js.map +1 -1
- package/dist/core/PostEffects/addBrightnessContrastPass.js +17 -13
- package/dist/core/PostEffects/addBrightnessContrastPass.js.map +1 -1
- package/dist/core/PostEffects/bloomPass.js +17 -10
- package/dist/core/PostEffects/bloomPass.js.map +1 -1
- package/dist/core/PostEffects/bloomSelect.js +60 -43
- package/dist/core/PostEffects/bloomSelect.js.map +1 -1
- package/dist/core/PostEffects/colorifyPass.js +17 -13
- package/dist/core/PostEffects/colorifyPass.js.map +1 -1
- package/dist/core/PostEffects/index.js +28 -22
- package/dist/core/PostEffects/index.js.map +1 -1
- package/dist/core/PostEffects/outlinePass.js +37 -50
- package/dist/core/PostEffects/outlinePass.js.map +1 -1
- package/dist/core/PostEffects/postprocessing.js +14 -12
- package/dist/core/PostEffects/postprocessing.js.map +1 -1
- package/dist/core/PostEffects/saoPass.js +15 -10
- package/dist/core/PostEffects/saoPass.js.map +1 -1
- package/dist/core/PostEffects/shader/colorify.js +22 -3
- package/dist/core/PostEffects/shader/colorify.js.map +1 -1
- package/dist/core/PostEffects/shader/gammaCorrectionShader.js +27 -3
- package/dist/core/PostEffects/shader/gammaCorrectionShader.js.map +1 -1
- package/dist/core/PostEffects/shader/mapping.js +66 -3
- package/dist/core/PostEffects/shader/mapping.js.map +1 -1
- package/dist/core/PostEffects/shader/thermalMaging.js +28 -3
- package/dist/core/PostEffects/shader/thermalMaging.js.map +1 -1
- package/dist/core/SceneEffect/grow/grow.js +85 -101
- package/dist/core/SceneEffect/grow/grow.js.map +1 -1
- package/dist/core/SceneEffect/grow/style_down.js +60 -77
- package/dist/core/SceneEffect/grow/style_down.js.map +1 -1
- package/dist/core/SceneEffect/grow/style_up.js +64 -81
- package/dist/core/SceneEffect/grow/style_up.js.map +1 -1
- package/dist/core/SceneEffect/grow/type.js +2 -2
- package/dist/core/SceneEffect/grow/type.js.map +1 -1
- package/dist/core/WeatherSystem/DynamicWeatherSystem.js +51 -76
- package/dist/core/WeatherSystem/DynamicWeatherSystem.js.map +1 -1
- package/dist/core/WeatherSystem/hdr/index.js +69 -105
- package/dist/core/WeatherSystem/hdr/index.js.map +1 -1
- package/dist/core/WeatherSystem/index.js +77 -124
- package/dist/core/WeatherSystem/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/fog/index.js +52 -80
- package/dist/core/WeatherSystem/objects/fog/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/index.js +72 -84
- package/dist/core/WeatherSystem/objects/rain/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/lineRain.js +88 -118
- package/dist/core/WeatherSystem/objects/rain/lineRain.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/plane.js +116 -146
- package/dist/core/WeatherSystem/objects/rain/plane.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/point.js +100 -148
- package/dist/core/WeatherSystem/objects/rain/point.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/cloud.js +71 -104
- package/dist/core/WeatherSystem/objects/sky/cloud.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/index.js +66 -84
- package/dist/core/WeatherSystem/objects/sky/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/outline.js +25 -45
- package/dist/core/WeatherSystem/objects/sky/outline.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/cloud.js +74 -3
- package/dist/core/WeatherSystem/shaders/cloud.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/fog.js +103 -3
- package/dist/core/WeatherSystem/shaders/fog.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/rain.js +206 -7
- package/dist/core/WeatherSystem/shaders/rain.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/sky.js +87 -3
- package/dist/core/WeatherSystem/shaders/sky.js.map +1 -1
- package/dist/core/WeatherSystem/sky/index.js +104 -135
- package/dist/core/WeatherSystem/sky/index.js.map +1 -1
- package/dist/core/WeatherSystem/utils/constant.js +44 -38
- package/dist/core/WeatherSystem/utils/constant.js.map +1 -1
- package/dist/core/WeatherSystem/utils/math.js +18 -25
- package/dist/core/WeatherSystem/utils/math.js.map +1 -1
- package/dist/core/WeatherSystem/utils/type.js +1 -1
- package/dist/core/WeatherSystem/utils/type.js.map +1 -1
- package/dist/core/WeatherSystem/weather/index.js +96 -141
- package/dist/core/WeatherSystem/weather/index.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,593 +1,384 @@
|
|
|
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 _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; } } }; }
|
|
3
|
-
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); }
|
|
4
|
-
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; }
|
|
5
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
-
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); } }
|
|
7
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
-
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); }
|
|
9
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
10
|
-
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); }; }
|
|
11
|
-
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); }
|
|
12
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
13
|
-
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; } }
|
|
14
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
15
1
|
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; }
|
|
16
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" ==
|
|
17
|
-
function _toPrimitive(t, r) { if ("object" !=
|
|
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); }
|
|
18
4
|
import { Vector3 } from '@anov/3d-core';
|
|
19
5
|
import ObjectLayer from "../Base/ObjectLayer";
|
|
20
6
|
import { EBuildingSplitType, EDirection } from "./type";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
_defineProperty(
|
|
29
|
-
_defineProperty(
|
|
30
|
-
_defineProperty(_assertThisInitialized(_this), "aboveGroundFloorCount", 0);
|
|
31
|
-
_defineProperty(_assertThisInitialized(_this), "undergroundFloorCount", 0);
|
|
32
|
-
_defineProperty(_assertThisInitialized(_this), "hasRoof", false);
|
|
33
|
-
_defineProperty(_assertThisInitialized(_this), "currentAnimation", {
|
|
7
|
+
class BuildingSplit extends ObjectLayer {
|
|
8
|
+
constructor(building) {
|
|
9
|
+
super();
|
|
10
|
+
_defineProperty(this, "floorGroups", new Map());
|
|
11
|
+
_defineProperty(this, "sortedFloorLevels", []);
|
|
12
|
+
_defineProperty(this, "aboveGroundFloorCount", 0);
|
|
13
|
+
_defineProperty(this, "undergroundFloorCount", 0);
|
|
14
|
+
_defineProperty(this, "hasRoof", false);
|
|
15
|
+
_defineProperty(this, "currentAnimation", {
|
|
34
16
|
timer: null
|
|
35
17
|
});
|
|
36
|
-
_defineProperty(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
18
|
+
_defineProperty(this, "_building", void 0);
|
|
19
|
+
this._building = building;
|
|
20
|
+
this.init();
|
|
21
|
+
}
|
|
22
|
+
get building() {
|
|
23
|
+
return this._building;
|
|
40
24
|
}
|
|
41
|
-
_createClass(BuildingSplit, [{
|
|
42
|
-
key: "building",
|
|
43
|
-
get: function get() {
|
|
44
|
-
return this._building;
|
|
45
|
-
}
|
|
46
25
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.undergroundFloorCount = 0;
|
|
58
|
-
this.hasRoof = false;
|
|
26
|
+
/**
|
|
27
|
+
* 初始化建筑拆分器
|
|
28
|
+
* @param building 建筑模型
|
|
29
|
+
*/
|
|
30
|
+
init() {
|
|
31
|
+
this.floorGroups = new Map();
|
|
32
|
+
this.sortedFloorLevels = [];
|
|
33
|
+
this.aboveGroundFloorCount = 0;
|
|
34
|
+
this.undergroundFloorCount = 0;
|
|
35
|
+
this.hasRoof = false;
|
|
59
36
|
|
|
60
|
-
|
|
61
|
-
|
|
37
|
+
// 解析所有楼层
|
|
38
|
+
this.parseFloors();
|
|
62
39
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}).sort(function (a, b) {
|
|
67
|
-
return a - b;
|
|
68
|
-
});
|
|
69
|
-
}
|
|
40
|
+
// 排序楼层编号从低到高
|
|
41
|
+
this.sortedFloorLevels = Array.from(this.floorGroups.values()).map(group => group.level).sort((a, b) => a - b);
|
|
42
|
+
}
|
|
70
43
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
if (
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
_this2.hasRoof = true;
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
44
|
+
/**
|
|
45
|
+
* 解析建筑模型中的楼层
|
|
46
|
+
*/
|
|
47
|
+
parseFloors() {
|
|
48
|
+
this.building.traverse(object => {
|
|
49
|
+
if (object.type === 'Mesh' || object.type === 'Group') {
|
|
50
|
+
const name = object.name;
|
|
51
|
+
// 检查是否为屋顶
|
|
52
|
+
if (name.startsWith('Roof')) {
|
|
53
|
+
this.addToFloorGroup('Roof', {
|
|
54
|
+
mesh: object,
|
|
55
|
+
originalPosition: object.position.clone(),
|
|
56
|
+
originalVisibility: object.visible
|
|
57
|
+
});
|
|
58
|
+
this.hasRoof = true;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
91
61
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
} else if (name.startsWith('B') && name.length >= 3) {
|
|
106
|
-
// 地下楼层
|
|
107
|
-
var _floorNum = parseInt(name.substring(1, 3));
|
|
108
|
-
if (!isNaN(_floorNum)) {
|
|
109
|
-
prefix = "B".concat(name.substring(1, 3));
|
|
110
|
-
level = -_floorNum;
|
|
111
|
-
isUnderground = true;
|
|
112
|
-
_this2.undergroundFloorCount = Math.max(_this2.undergroundFloorCount, _floorNum);
|
|
113
|
-
}
|
|
62
|
+
// 提取楼层前缀
|
|
63
|
+
let prefix = null;
|
|
64
|
+
let level = 0;
|
|
65
|
+
let isUnderground = false;
|
|
66
|
+
if (name.startsWith('F') && name.length >= 3) {
|
|
67
|
+
// 地上楼层
|
|
68
|
+
const floorNum = parseInt(name.substring(1, 3));
|
|
69
|
+
if (!isNaN(floorNum)) {
|
|
70
|
+
prefix = `F${name.substring(1, 3)}`;
|
|
71
|
+
level = floorNum;
|
|
72
|
+
isUnderground = false;
|
|
73
|
+
this.aboveGroundFloorCount = Math.max(this.aboveGroundFloorCount, floorNum);
|
|
114
74
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
75
|
+
} else if (name.startsWith('B') && name.length >= 3) {
|
|
76
|
+
// 地下楼层
|
|
77
|
+
const floorNum = parseInt(name.substring(1, 3));
|
|
78
|
+
if (!isNaN(floorNum)) {
|
|
79
|
+
prefix = `B${name.substring(1, 3)}`;
|
|
80
|
+
level = -floorNum;
|
|
81
|
+
isUnderground = true;
|
|
82
|
+
this.undergroundFloorCount = Math.max(this.undergroundFloorCount, floorNum);
|
|
121
83
|
}
|
|
122
84
|
}
|
|
85
|
+
if (prefix) {
|
|
86
|
+
this.addToFloorGroup(prefix, {
|
|
87
|
+
mesh: object,
|
|
88
|
+
originalPosition: object.position.clone(),
|
|
89
|
+
originalVisibility: object.visible
|
|
90
|
+
}, level, isUnderground);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* 将组件添加到对应楼层分组
|
|
98
|
+
*/
|
|
99
|
+
addToFloorGroup(prefix, component, level = this.aboveGroundFloorCount + 1, isUnderground = false) {
|
|
100
|
+
var _this$floorGroups$get;
|
|
101
|
+
if (!this.floorGroups.has(prefix)) {
|
|
102
|
+
this.floorGroups.set(prefix, {
|
|
103
|
+
level,
|
|
104
|
+
isUnderground,
|
|
105
|
+
isRoof: prefix === 'Roof',
|
|
106
|
+
components: []
|
|
123
107
|
});
|
|
124
108
|
}
|
|
109
|
+
(_this$floorGroups$get = this.floorGroups.get(prefix)) === null || _this$floorGroups$get === void 0 || _this$floorGroups$get.components.push(component);
|
|
110
|
+
}
|
|
125
111
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
(
|
|
112
|
+
/**
|
|
113
|
+
* 拆分楼层
|
|
114
|
+
* @param options 拆分选项
|
|
115
|
+
* @returns 成功或错误信息
|
|
116
|
+
*/
|
|
117
|
+
split(options) {
|
|
118
|
+
const {
|
|
119
|
+
floor,
|
|
120
|
+
animation
|
|
121
|
+
} = options;
|
|
122
|
+
const animOption = animation || {
|
|
123
|
+
type: EBuildingSplitType.Move,
|
|
124
|
+
duration: 1000
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// 取消当前动画
|
|
128
|
+
if (this.currentAnimation.timer !== null) {
|
|
129
|
+
window.clearTimeout(this.currentAnimation.timer);
|
|
130
|
+
this.currentAnimation.timer = null;
|
|
144
131
|
}
|
|
145
132
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}, {
|
|
152
|
-
key: "split",
|
|
153
|
-
value: function split(options) {
|
|
154
|
-
var floor = options.floor,
|
|
155
|
-
animation = options.animation;
|
|
156
|
-
var animOption = animation || {
|
|
157
|
-
type: EBuildingSplitType.Move,
|
|
158
|
-
duration: 1000
|
|
133
|
+
// 处理 floor = 0 的情况:恢复完整状态
|
|
134
|
+
if (floor === 0) {
|
|
135
|
+
this.resetBuilding();
|
|
136
|
+
return {
|
|
137
|
+
success: true
|
|
159
138
|
};
|
|
139
|
+
}
|
|
160
140
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
window.clearTimeout(this.currentAnimation.timer);
|
|
164
|
-
this.currentAnimation.timer = null;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// 处理 floor = 0 的情况:恢复完整状态
|
|
168
|
-
if (floor === 0) {
|
|
169
|
-
this.resetBuilding();
|
|
170
|
-
return {
|
|
171
|
-
success: true
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// 验证楼层参数
|
|
176
|
-
if (floor > 0 && floor > this.aboveGroundFloorCount) {
|
|
177
|
-
return {
|
|
178
|
-
success: false,
|
|
179
|
-
message: "\u5730\u4E0A\u697C\u5C42\u6570\u8D85\u51FA\u8303\u56F4\uFF0C\u6700\u5927\u697C\u5C42\u4E3A ".concat(this.aboveGroundFloorCount)
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
if (floor < 0 && Math.abs(floor) > this.undergroundFloorCount) {
|
|
183
|
-
return {
|
|
184
|
-
success: false,
|
|
185
|
-
message: "\u5730\u4E0B\u697C\u5C42\u6570\u8D85\u51FA\u8303\u56F4\uFF0C\u6700\u5927\u5730\u4E0B\u697C\u5C42\u4E3A ".concat(this.undergroundFloorCount)
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// 执行拆分操作
|
|
190
|
-
switch (animOption.type) {
|
|
191
|
-
case EBuildingSplitType.Hide:
|
|
192
|
-
this.hideAboveFloors(floor);
|
|
193
|
-
break;
|
|
194
|
-
case EBuildingSplitType.Move:
|
|
195
|
-
this.moveAboveFloorsDirection(floor, animOption);
|
|
196
|
-
break;
|
|
197
|
-
case EBuildingSplitType.Solo:
|
|
198
|
-
this.showSoloFloor(floor);
|
|
199
|
-
break;
|
|
200
|
-
}
|
|
141
|
+
// 验证楼层参数
|
|
142
|
+
if (floor > 0 && floor > this.aboveGroundFloorCount) {
|
|
201
143
|
return {
|
|
202
|
-
success:
|
|
144
|
+
success: false,
|
|
145
|
+
message: `地上楼层数超出范围,最大楼层为 ${this.aboveGroundFloorCount}`
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
if (floor < 0 && Math.abs(floor) > this.undergroundFloorCount) {
|
|
149
|
+
return {
|
|
150
|
+
success: false,
|
|
151
|
+
message: `地下楼层数超出范围,最大地下楼层为 ${this.undergroundFloorCount}`
|
|
203
152
|
};
|
|
204
153
|
}
|
|
205
154
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
155
|
+
// 执行拆分操作
|
|
156
|
+
switch (animOption.type) {
|
|
157
|
+
case EBuildingSplitType.Hide:
|
|
158
|
+
this.hideAboveFloors(floor);
|
|
159
|
+
break;
|
|
160
|
+
case EBuildingSplitType.Move:
|
|
161
|
+
this.moveAboveFloorsDirection(floor, animOption);
|
|
162
|
+
break;
|
|
163
|
+
case EBuildingSplitType.Solo:
|
|
164
|
+
this.showSoloFloor(floor);
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
success: true
|
|
169
|
+
};
|
|
170
|
+
}
|
|
219
171
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
172
|
+
/**
|
|
173
|
+
* 隐藏指定楼层以上的楼层
|
|
174
|
+
* @param targetFloor 目标楼层
|
|
175
|
+
*/
|
|
176
|
+
hideAboveFloors(targetFloor) {
|
|
177
|
+
for (const floorGroup of this.floorGroups.values()) {
|
|
178
|
+
const floorLevel = floorGroup.level;
|
|
228
179
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
var shouldBeVisible = floorLevel <= targetFloor;
|
|
236
|
-
var _iterator3 = _createForOfIteratorHelper(floorGroup.components),
|
|
237
|
-
_step3;
|
|
238
|
-
try {
|
|
239
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
240
|
-
var _component = _step3.value;
|
|
241
|
-
_component.mesh.visible = shouldBeVisible;
|
|
242
|
-
}
|
|
243
|
-
} catch (err) {
|
|
244
|
-
_iterator3.e(err);
|
|
245
|
-
} finally {
|
|
246
|
-
_iterator3.f();
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
} catch (err) {
|
|
250
|
-
_iterator.e(err);
|
|
251
|
-
} finally {
|
|
252
|
-
_iterator.f();
|
|
253
|
-
}
|
|
180
|
+
// 重置所有楼层组件位置
|
|
181
|
+
for (const component of floorGroup.components) component.mesh.position.copy(component.originalPosition);
|
|
182
|
+
|
|
183
|
+
// 设置可见性
|
|
184
|
+
const shouldBeVisible = floorLevel <= targetFloor;
|
|
185
|
+
for (const component of floorGroup.components) component.mesh.visible = shouldBeVisible;
|
|
254
186
|
}
|
|
187
|
+
}
|
|
255
188
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
var distance = 10;
|
|
265
|
-
var duration = animation.duration;
|
|
189
|
+
/**
|
|
190
|
+
* 将指定楼层以上的楼层整体上移
|
|
191
|
+
* @param targetFloor 目标楼层
|
|
192
|
+
* @param animation 动画选项
|
|
193
|
+
*/
|
|
194
|
+
moveAboveFloorsUp(targetFloor, animation) {
|
|
195
|
+
const distance = 10;
|
|
196
|
+
const duration = animation.duration;
|
|
266
197
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
272
|
-
var floorGroup = _step4.value;
|
|
273
|
-
var _iterator6 = _createForOfIteratorHelper(floorGroup.components),
|
|
274
|
-
_step6;
|
|
275
|
-
try {
|
|
276
|
-
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
277
|
-
var component = _step6.value;
|
|
278
|
-
component.mesh.visible = true;
|
|
279
|
-
}
|
|
280
|
-
} catch (err) {
|
|
281
|
-
_iterator6.e(err);
|
|
282
|
-
} finally {
|
|
283
|
-
_iterator6.f();
|
|
284
|
-
}
|
|
285
|
-
}
|
|
198
|
+
// 重置所有楼层可见性
|
|
199
|
+
for (const floorGroup of this.floorGroups.values()) {
|
|
200
|
+
for (const component of floorGroup.components) component.mesh.visible = true;
|
|
201
|
+
}
|
|
286
202
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
_step7;
|
|
303
|
-
try {
|
|
304
|
-
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
305
|
-
var _component2 = _step7.value;
|
|
306
|
-
startPositions.set(_component2.mesh, _component2.mesh.position.clone());
|
|
307
|
-
if (floorLevel > targetFloor) {
|
|
308
|
-
// 上方楼层需要上移
|
|
309
|
-
var targetPos = _component2.originalPosition.clone();
|
|
310
|
-
targetPos.y += distance;
|
|
311
|
-
targetPositions.set(_component2.mesh, targetPos);
|
|
312
|
-
} else {
|
|
313
|
-
// 其他楼层保持原位
|
|
314
|
-
targetPositions.set(_component2.mesh, _component2.originalPosition.clone());
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
} catch (err) {
|
|
318
|
-
_iterator7.e(err);
|
|
319
|
-
} finally {
|
|
320
|
-
_iterator7.f();
|
|
321
|
-
}
|
|
203
|
+
// 计算起始位置和目标位置
|
|
204
|
+
const startPositions = new Map();
|
|
205
|
+
const targetPositions = new Map();
|
|
206
|
+
for (const floorGroup of this.floorGroups.values()) {
|
|
207
|
+
const floorLevel = floorGroup.level;
|
|
208
|
+
for (const component of floorGroup.components) {
|
|
209
|
+
startPositions.set(component.mesh, component.mesh.position.clone());
|
|
210
|
+
if (floorLevel > targetFloor) {
|
|
211
|
+
// 上方楼层需要上移
|
|
212
|
+
const targetPos = component.originalPosition.clone();
|
|
213
|
+
targetPos.y += distance;
|
|
214
|
+
targetPositions.set(component.mesh, targetPos);
|
|
215
|
+
} else {
|
|
216
|
+
// 其他楼层保持原位
|
|
217
|
+
targetPositions.set(component.mesh, component.originalPosition.clone());
|
|
322
218
|
}
|
|
323
|
-
|
|
324
|
-
// 执行动画
|
|
325
|
-
} catch (err) {
|
|
326
|
-
_iterator5.e(err);
|
|
327
|
-
} finally {
|
|
328
|
-
_iterator5.f();
|
|
329
219
|
}
|
|
330
|
-
this.animatePositions(startPositions, targetPositions, duration);
|
|
331
220
|
}
|
|
332
221
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
* @param animation 动画选项
|
|
337
|
-
*/
|
|
338
|
-
}, {
|
|
339
|
-
key: "moveAboveFloorsDirection",
|
|
340
|
-
value: function moveAboveFloorsDirection(targetFloor, animation) {
|
|
341
|
-
var _ref = animation.rule || {},
|
|
342
|
-
_ref$direction = _ref.direction,
|
|
343
|
-
direction = _ref$direction === void 0 ? [10, 10, 0] : _ref$direction;
|
|
344
|
-
var duration = animation.duration;
|
|
222
|
+
// 执行动画
|
|
223
|
+
this.animatePositions(startPositions, targetPositions, duration);
|
|
224
|
+
}
|
|
345
225
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
var component = _step10.value;
|
|
357
|
-
component.mesh.visible = true;
|
|
358
|
-
}
|
|
359
|
-
} catch (err) {
|
|
360
|
-
_iterator10.e(err);
|
|
361
|
-
} finally {
|
|
362
|
-
_iterator10.f();
|
|
363
|
-
}
|
|
364
|
-
}
|
|
226
|
+
/**
|
|
227
|
+
* 将指定楼层以上的楼层向指定方向移动
|
|
228
|
+
* @param targetFloor 目标楼层
|
|
229
|
+
* @param animation 动画选项
|
|
230
|
+
*/
|
|
231
|
+
moveAboveFloorsDirection(targetFloor, animation) {
|
|
232
|
+
const {
|
|
233
|
+
direction = [10, 10, 0]
|
|
234
|
+
} = animation.rule || {};
|
|
235
|
+
const duration = animation.duration;
|
|
365
236
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
_iterator8.f();
|
|
371
|
-
}
|
|
372
|
-
var startPositions = new Map();
|
|
373
|
-
var targetPositions = new Map();
|
|
374
|
-
var _iterator9 = _createForOfIteratorHelper(this.floorGroups.values()),
|
|
375
|
-
_step9;
|
|
376
|
-
try {
|
|
377
|
-
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
378
|
-
var _floorGroup2 = _step9.value;
|
|
379
|
-
var floorLevel = _floorGroup2.level;
|
|
380
|
-
var _iterator11 = _createForOfIteratorHelper(_floorGroup2.components),
|
|
381
|
-
_step11;
|
|
382
|
-
try {
|
|
383
|
-
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
384
|
-
var _component3 = _step11.value;
|
|
385
|
-
startPositions.set(_component3.mesh, _component3.mesh.position.clone());
|
|
386
|
-
if (floorLevel > targetFloor) {
|
|
387
|
-
// 上方楼层需要移动
|
|
388
|
-
var targetPos = _component3.originalPosition.clone().add(new Vector3().fromArray(direction));
|
|
389
|
-
targetPositions.set(_component3.mesh, targetPos);
|
|
390
|
-
} else {
|
|
391
|
-
// 其他楼层保持原位
|
|
392
|
-
targetPositions.set(_component3.mesh, _component3.originalPosition.clone());
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
} catch (err) {
|
|
396
|
-
_iterator11.e(err);
|
|
397
|
-
} finally {
|
|
398
|
-
_iterator11.f();
|
|
399
|
-
}
|
|
400
|
-
}
|
|
237
|
+
// 重置所有楼层可见性
|
|
238
|
+
for (const floorGroup of this.floorGroups.values()) {
|
|
239
|
+
for (const component of floorGroup.components) component.mesh.visible = true;
|
|
240
|
+
}
|
|
401
241
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
242
|
+
// 计算起始位置和目标位置
|
|
243
|
+
const startPositions = new Map();
|
|
244
|
+
const targetPositions = new Map();
|
|
245
|
+
for (const floorGroup of this.floorGroups.values()) {
|
|
246
|
+
const floorLevel = floorGroup.level;
|
|
247
|
+
for (const component of floorGroup.components) {
|
|
248
|
+
startPositions.set(component.mesh, component.mesh.position.clone());
|
|
249
|
+
if (floorLevel > targetFloor) {
|
|
250
|
+
// 上方楼层需要移动
|
|
251
|
+
const targetPos = component.originalPosition.clone().add(new Vector3().fromArray(direction));
|
|
252
|
+
targetPositions.set(component.mesh, targetPos);
|
|
253
|
+
} else {
|
|
254
|
+
// 其他楼层保持原位
|
|
255
|
+
targetPositions.set(component.mesh, component.originalPosition.clone());
|
|
256
|
+
}
|
|
407
257
|
}
|
|
408
|
-
this.animatePositions(startPositions, targetPositions, duration);
|
|
409
258
|
}
|
|
410
259
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
260
|
+
// 执行动画
|
|
261
|
+
this.animatePositions(startPositions, targetPositions, duration);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* 计算方向向量
|
|
266
|
+
* 规则:往右方(X)、前方(Z)是正、往左方(X)、后方(Z)是负数
|
|
267
|
+
* @param direction 方向枚举
|
|
268
|
+
* @param distance 移动距离
|
|
269
|
+
* @returns Vector3 方向向量
|
|
270
|
+
*/
|
|
271
|
+
getDirectionVector(direction, distance) {
|
|
272
|
+
const vector = new Vector3(0, 0, 0);
|
|
273
|
+
const coefficient = 0.7071; // cos(45°) ≈ 0.7071
|
|
274
|
+
switch (direction) {
|
|
275
|
+
case EDirection.Right:
|
|
276
|
+
vector.set(distance, 0, 0);
|
|
277
|
+
break;
|
|
278
|
+
case EDirection.Left:
|
|
279
|
+
vector.set(-distance, 0, 0);
|
|
280
|
+
break;
|
|
281
|
+
case EDirection.Front:
|
|
282
|
+
vector.set(0, 0, distance);
|
|
283
|
+
break;
|
|
284
|
+
case EDirection.Back:
|
|
285
|
+
vector.set(0, 0, -distance);
|
|
286
|
+
break;
|
|
287
|
+
case EDirection.Right_Front:
|
|
288
|
+
vector.set(distance * coefficient, distance * coefficient, distance * coefficient);
|
|
289
|
+
break;
|
|
290
|
+
case EDirection.Left_Front:
|
|
291
|
+
vector.set(-distance * coefficient, distance * coefficient, distance * coefficient);
|
|
292
|
+
break;
|
|
293
|
+
case EDirection.Right_Back:
|
|
294
|
+
vector.set(distance * coefficient, distance * coefficient, -distance * coefficient);
|
|
295
|
+
break;
|
|
296
|
+
case EDirection.Left_Back:
|
|
297
|
+
vector.set(-distance * coefficient, distance * coefficient, -distance * coefficient);
|
|
298
|
+
break;
|
|
299
|
+
default:
|
|
300
|
+
// 默认向右移动
|
|
301
|
+
vector.set(distance, 0, 0);
|
|
453
302
|
}
|
|
303
|
+
return vector;
|
|
304
|
+
}
|
|
454
305
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
var _iterator12 = _createForOfIteratorHelper(this.floorGroups.values()),
|
|
463
|
-
_step12;
|
|
464
|
-
try {
|
|
465
|
-
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
466
|
-
var floorGroup = _step12.value;
|
|
467
|
-
var floorLevel = floorGroup.level;
|
|
306
|
+
/**
|
|
307
|
+
* 只显示指定楼层
|
|
308
|
+
* @param targetFloor 目标楼层
|
|
309
|
+
*/
|
|
310
|
+
showSoloFloor(targetFloor) {
|
|
311
|
+
for (const floorGroup of this.floorGroups.values()) {
|
|
312
|
+
const floorLevel = floorGroup.level;
|
|
468
313
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
_step13;
|
|
472
|
-
try {
|
|
473
|
-
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
474
|
-
var component = _step13.value;
|
|
475
|
-
component.mesh.position.copy(component.originalPosition);
|
|
476
|
-
}
|
|
314
|
+
// 重置所有楼层组件位置
|
|
315
|
+
for (const component of floorGroup.components) component.mesh.position.copy(component.originalPosition);
|
|
477
316
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
} finally {
|
|
482
|
-
_iterator13.f();
|
|
483
|
-
}
|
|
484
|
-
var shouldBeVisible = floorLevel === targetFloor;
|
|
485
|
-
var _iterator14 = _createForOfIteratorHelper(floorGroup.components),
|
|
486
|
-
_step14;
|
|
487
|
-
try {
|
|
488
|
-
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
|
|
489
|
-
var _component4 = _step14.value;
|
|
490
|
-
_component4.mesh.visible = shouldBeVisible;
|
|
491
|
-
}
|
|
492
|
-
} catch (err) {
|
|
493
|
-
_iterator14.e(err);
|
|
494
|
-
} finally {
|
|
495
|
-
_iterator14.f();
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
} catch (err) {
|
|
499
|
-
_iterator12.e(err);
|
|
500
|
-
} finally {
|
|
501
|
-
_iterator12.f();
|
|
502
|
-
}
|
|
317
|
+
// 设置可见性
|
|
318
|
+
const shouldBeVisible = floorLevel === targetFloor;
|
|
319
|
+
for (const component of floorGroup.components) component.mesh.visible = shouldBeVisible;
|
|
503
320
|
}
|
|
321
|
+
}
|
|
504
322
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
if (startPos) {
|
|
523
|
-
// 线性插值计算当前位置
|
|
524
|
-
mesh.position.lerpVectors(startPos, targetPos, progress);
|
|
525
|
-
}
|
|
526
|
-
});
|
|
527
|
-
if (progress < 1) {
|
|
528
|
-
requestAnimationFrame(animate);
|
|
529
|
-
} else {
|
|
530
|
-
// 动画结束
|
|
531
|
-
_this3.currentAnimation.timer = null;
|
|
323
|
+
/**
|
|
324
|
+
* 执行位置动画
|
|
325
|
+
* @param startPositions 起始位置
|
|
326
|
+
* @param targetPositions 目标位置
|
|
327
|
+
* @param duration 动画时长
|
|
328
|
+
*/
|
|
329
|
+
animatePositions(startPositions, targetPositions, duration) {
|
|
330
|
+
const startTime = performance.now();
|
|
331
|
+
const animate = () => {
|
|
332
|
+
const currentTime = performance.now();
|
|
333
|
+
const elapsed = currentTime - startTime;
|
|
334
|
+
const progress = Math.min(elapsed / duration, 1);
|
|
335
|
+
targetPositions.forEach((targetPos, mesh) => {
|
|
336
|
+
const startPos = startPositions.get(mesh);
|
|
337
|
+
if (startPos) {
|
|
338
|
+
// 线性插值计算当前位置
|
|
339
|
+
mesh.position.lerpVectors(startPos, targetPos, progress);
|
|
532
340
|
}
|
|
533
|
-
};
|
|
534
|
-
|
|
341
|
+
});
|
|
342
|
+
if (progress < 1) {
|
|
343
|
+
requestAnimationFrame(animate);
|
|
344
|
+
} else {
|
|
345
|
+
// 动画结束
|
|
346
|
+
this.currentAnimation.timer = null;
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
animate();
|
|
535
350
|
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
351
|
+
// 设置超时以确保动画完成
|
|
352
|
+
this.currentAnimation.timer = window.setTimeout(() => {
|
|
353
|
+
this.currentAnimation.timer = null;
|
|
354
|
+
}, duration + 100);
|
|
355
|
+
}
|
|
541
356
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
try {
|
|
551
|
-
for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
|
|
552
|
-
var floorGroup = _step15.value;
|
|
553
|
-
var _iterator16 = _createForOfIteratorHelper(floorGroup.components),
|
|
554
|
-
_step16;
|
|
555
|
-
try {
|
|
556
|
-
for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
|
|
557
|
-
var component = _step16.value;
|
|
558
|
-
// 恢复原始位置
|
|
559
|
-
component.mesh.position.copy(component.originalPosition);
|
|
357
|
+
/**
|
|
358
|
+
* 重置建筑到初始状态
|
|
359
|
+
*/
|
|
360
|
+
resetBuilding() {
|
|
361
|
+
for (const floorGroup of this.floorGroups.values()) {
|
|
362
|
+
for (const component of floorGroup.components) {
|
|
363
|
+
// 恢复原始位置
|
|
364
|
+
component.mesh.position.copy(component.originalPosition);
|
|
560
365
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
}
|
|
564
|
-
} catch (err) {
|
|
565
|
-
_iterator16.e(err);
|
|
566
|
-
} finally {
|
|
567
|
-
_iterator16.f();
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
} catch (err) {
|
|
571
|
-
_iterator15.e(err);
|
|
572
|
-
} finally {
|
|
573
|
-
_iterator15.f();
|
|
366
|
+
// 恢复原始可见性
|
|
367
|
+
component.mesh.visible = component.originalVisibility;
|
|
574
368
|
}
|
|
575
369
|
}
|
|
370
|
+
}
|
|
576
371
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
}
|
|
589
|
-
}]);
|
|
590
|
-
return BuildingSplit;
|
|
591
|
-
}(ObjectLayer);
|
|
372
|
+
/**
|
|
373
|
+
* 获取楼层总数信息
|
|
374
|
+
*/
|
|
375
|
+
getFloorCounts() {
|
|
376
|
+
return {
|
|
377
|
+
aboveGround: this.aboveGroundFloorCount,
|
|
378
|
+
underground: this.undergroundFloorCount,
|
|
379
|
+
hasRoof: this.hasRoof
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
}
|
|
592
383
|
export { BuildingSplit, EBuildingSplitType };
|
|
593
384
|
//# sourceMappingURL=index.js.map
|