@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,43 +1,32 @@
|
|
|
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
1
|
var _class, _descriptor;
|
|
3
2
|
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
|
4
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
-
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); } }
|
|
6
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
-
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
8
|
-
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
9
|
-
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); }
|
|
10
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
11
|
-
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); }; }
|
|
12
|
-
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); }
|
|
13
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
14
|
-
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; } }
|
|
15
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
16
3
|
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; }
|
|
17
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" ==
|
|
18
|
-
function _toPrimitive(t, r) { if ("object" !=
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
5
|
+
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
6
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
20
7
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
21
8
|
/* eslint-disable max-statements-per-line */
|
|
22
9
|
|
|
23
10
|
import { Box3, LoaderModule, utils } from '@anov/3d-core';
|
|
24
11
|
import { BaseTraffic } from "../base";
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
12
|
+
const {
|
|
13
|
+
moveWithLine
|
|
14
|
+
} = utils;
|
|
15
|
+
const loaderModule = new LoaderModule();
|
|
16
|
+
const overrideVisible = (target, propertyKey) => {
|
|
17
|
+
const getter = () => {
|
|
29
18
|
return target._visible;
|
|
30
19
|
};
|
|
31
|
-
|
|
20
|
+
const setter = newValue => {
|
|
32
21
|
target._visible = newValue;
|
|
33
22
|
if (newValue === false) {
|
|
34
23
|
var _target$_control;
|
|
35
|
-
(_target$_control = target._control) !== null && _target$_control !== void 0 ? _target$_control : [].forEach(
|
|
24
|
+
(_target$_control = target._control) !== null && _target$_control !== void 0 ? _target$_control : [].forEach(control => {
|
|
36
25
|
control.stop();
|
|
37
26
|
});
|
|
38
27
|
} else {
|
|
39
28
|
var _target$_control2;
|
|
40
|
-
(_target$_control2 = target._control) !== null && _target$_control2 !== void 0 ? _target$_control2 : [].forEach(
|
|
29
|
+
(_target$_control2 = target._control) !== null && _target$_control2 !== void 0 ? _target$_control2 : [].forEach(control => {
|
|
41
30
|
control.continue();
|
|
42
31
|
});
|
|
43
32
|
}
|
|
@@ -53,290 +42,244 @@ var overrideVisible = function overrideVisible(target, propertyKey) {
|
|
|
53
42
|
/**
|
|
54
43
|
* 写实风格车辆交通组件
|
|
55
44
|
*/
|
|
56
|
-
export
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
45
|
+
export let RealismTraffic = (_class = class RealismTraffic extends BaseTraffic {
|
|
46
|
+
get width() {
|
|
47
|
+
return this._width;
|
|
48
|
+
}
|
|
49
|
+
set width(w) {
|
|
50
|
+
this._width = w;
|
|
51
|
+
this.generateLaneLines();
|
|
52
|
+
this.loadBenchmarkModel();
|
|
53
|
+
}
|
|
54
|
+
get divide() {
|
|
55
|
+
return this._divide;
|
|
56
|
+
}
|
|
57
|
+
set divide(num) {
|
|
58
|
+
this._divide = num;
|
|
59
|
+
this.generateLaneLines();
|
|
60
|
+
this.loadBenchmarkModel();
|
|
61
|
+
}
|
|
62
|
+
get baseTime() {
|
|
63
|
+
return this._baseTime;
|
|
64
|
+
}
|
|
65
|
+
constructor(params) {
|
|
66
|
+
super(params);
|
|
63
67
|
/** 车辆模型池 */
|
|
64
|
-
_defineProperty(
|
|
68
|
+
_defineProperty(this, "_resource", void 0);
|
|
65
69
|
/** 基准时间 */
|
|
66
|
-
_defineProperty(
|
|
70
|
+
_defineProperty(this, "_baseTime", void 0);
|
|
67
71
|
/** 车辆数量 */
|
|
68
|
-
_defineProperty(
|
|
69
|
-
_defineProperty(
|
|
70
|
-
_defineProperty(
|
|
71
|
-
_defineProperty(
|
|
72
|
-
_defineProperty(
|
|
73
|
-
_defineProperty(
|
|
74
|
-
_defineProperty(
|
|
75
|
-
_defineProperty(
|
|
72
|
+
_defineProperty(this, "_totalNum", 5);
|
|
73
|
+
_defineProperty(this, "_startingPoints", []);
|
|
74
|
+
_defineProperty(this, "_startingLookatPoints", []);
|
|
75
|
+
_defineProperty(this, "_startingProgressPoints", []);
|
|
76
|
+
_defineProperty(this, "_startinglanelinePoints", []);
|
|
77
|
+
_defineProperty(this, "_visible", true);
|
|
78
|
+
_defineProperty(this, "_control", []);
|
|
79
|
+
_defineProperty(this, "_lanelineControl", []);
|
|
76
80
|
/** 基准载具池 */
|
|
77
|
-
_defineProperty(
|
|
81
|
+
_defineProperty(this, "_benchmarkVehicles", []);
|
|
78
82
|
/** 实际载具 */
|
|
79
|
-
_defineProperty(
|
|
83
|
+
_defineProperty(this, "_vehicles", []);
|
|
80
84
|
/** 车道线 */
|
|
81
|
-
_defineProperty(
|
|
82
|
-
_initializerDefineProperty(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
width =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
_this._totalNum = totalNum;
|
|
102
|
-
_this._baseTime = baseTime;
|
|
103
|
-
_this._lanelineControl = control;
|
|
104
|
-
_this._corner = corner;
|
|
85
|
+
_defineProperty(this, "lanelines", []);
|
|
86
|
+
_initializerDefineProperty(this, "visible", _descriptor, this);
|
|
87
|
+
const {
|
|
88
|
+
path,
|
|
89
|
+
width = 2,
|
|
90
|
+
divide = 1,
|
|
91
|
+
resource,
|
|
92
|
+
totalNum = 5,
|
|
93
|
+
baseTime = 10,
|
|
94
|
+
control = [],
|
|
95
|
+
corner = 10
|
|
96
|
+
} = params;
|
|
97
|
+
this._path = path;
|
|
98
|
+
this._width = width;
|
|
99
|
+
this._divide = divide;
|
|
100
|
+
this._resource = resource;
|
|
101
|
+
this._totalNum = totalNum;
|
|
102
|
+
this._baseTime = baseTime;
|
|
103
|
+
this._lanelineControl = control;
|
|
104
|
+
this._corner = corner;
|
|
105
105
|
if (width === 0 || divide === 0) {
|
|
106
106
|
console.error('宽度或车道数不能为0');
|
|
107
107
|
throw new Error('宽度或车道数不能为0');
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return _this;
|
|
109
|
+
this.generateLaneLines();
|
|
110
|
+
this.loadBenchmarkModel();
|
|
111
|
+
this.handleVisibilityChange();
|
|
113
112
|
}
|
|
114
113
|
|
|
115
114
|
/**
|
|
116
115
|
* load benchmark model
|
|
117
116
|
*/
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
get: function get() {
|
|
131
|
-
return this._divide;
|
|
132
|
-
},
|
|
133
|
-
set: function set(num) {
|
|
134
|
-
this._divide = num;
|
|
135
|
-
this.generateLaneLines();
|
|
136
|
-
this.loadBenchmarkModel();
|
|
137
|
-
}
|
|
138
|
-
}, {
|
|
139
|
-
key: "baseTime",
|
|
140
|
-
get: function get() {
|
|
141
|
-
return this._baseTime;
|
|
142
|
-
}
|
|
143
|
-
}, {
|
|
144
|
-
key: "loadBenchmarkModel",
|
|
145
|
-
value: function loadBenchmarkModel() {
|
|
146
|
-
var _this2 = this;
|
|
147
|
-
this._benchmarkVehicles = [];
|
|
148
|
-
if (!this._resource.length) return;
|
|
149
|
-
var promises = this._resource.map(function (_ref) {
|
|
150
|
-
var _utils$storeManagemen;
|
|
151
|
-
var url = _ref.url;
|
|
152
|
-
return loaderModule.loadGLTF({
|
|
153
|
-
url: url,
|
|
154
|
-
draco: true,
|
|
155
|
-
// todo sdk 接口支持 decoderPath
|
|
156
|
-
dracoPath: (_utils$storeManagemen = utils.storeManagement.get('decoderPath')) !== null && _utils$storeManagemen !== void 0 ? _utils$storeManagemen : '/draco/'
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
Promise.allSettled(promises).then(function (res) {
|
|
160
|
-
res.forEach(function (modelRes) {
|
|
161
|
-
if (modelRes.status === 'fulfilled') _this2._benchmarkVehicles.push(_this2.normalizedVehicleSize(modelRes.value.scene));
|
|
162
|
-
});
|
|
163
|
-
var randomPool = _this2.generateRandomPool();
|
|
164
|
-
_this2.generateInitPosition(randomPool);
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* get max vehicle length
|
|
170
|
-
*/
|
|
171
|
-
}, {
|
|
172
|
-
key: "getMaxVehicleLength",
|
|
173
|
-
value: function getMaxVehicleLength() {
|
|
174
|
-
var maxLength = this._benchmarkVehicles.reduce(function (max, vehicle) {
|
|
175
|
-
var box = new Box3().setFromObject(vehicle);
|
|
176
|
-
var currentLength = box.max.z - box.min.z;
|
|
177
|
-
return currentLength > max ? currentLength : max;
|
|
178
|
-
}, 0);
|
|
179
|
-
return maxLength;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* check reasonable location
|
|
184
|
-
*/
|
|
185
|
-
}, {
|
|
186
|
-
key: "generateRandomPool",
|
|
187
|
-
value: function generateRandomPool() {
|
|
188
|
-
var _this3 = this;
|
|
189
|
-
var lineLengths = this.lanelines.map(function (line) {
|
|
190
|
-
return line.getLength();
|
|
117
|
+
loadBenchmarkModel() {
|
|
118
|
+
this._benchmarkVehicles = [];
|
|
119
|
+
if (!this._resource.length) return;
|
|
120
|
+
const promises = this._resource.map(({
|
|
121
|
+
url
|
|
122
|
+
}) => {
|
|
123
|
+
var _utils$storeManagemen;
|
|
124
|
+
return loaderModule.loadGLTF({
|
|
125
|
+
url,
|
|
126
|
+
draco: true,
|
|
127
|
+
// todo sdk 接口支持 decoderPath
|
|
128
|
+
dracoPath: (_utils$storeManagemen = utils.storeManagement.get('decoderPath')) !== null && _utils$storeManagemen !== void 0 ? _utils$storeManagemen : '/draco/'
|
|
191
129
|
});
|
|
192
|
-
|
|
193
|
-
|
|
130
|
+
});
|
|
131
|
+
Promise.allSettled(promises).then(res => {
|
|
132
|
+
res.forEach(modelRes => {
|
|
133
|
+
if (modelRes.status === 'fulfilled') this._benchmarkVehicles.push(this.normalizedVehicleSize(modelRes.value.scene));
|
|
194
134
|
});
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
return this.buildRandomPool(part);
|
|
200
|
-
}
|
|
135
|
+
const randomPool = this.generateRandomPool();
|
|
136
|
+
this.generateInitPosition(randomPool);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
201
139
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
line: i
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
return pool;
|
|
218
|
-
}
|
|
140
|
+
/**
|
|
141
|
+
* get max vehicle length
|
|
142
|
+
*/
|
|
143
|
+
getMaxVehicleLength() {
|
|
144
|
+
const maxLength = this._benchmarkVehicles.reduce((max, vehicle) => {
|
|
145
|
+
const box = new Box3().setFromObject(vehicle);
|
|
146
|
+
const currentLength = box.max.z - box.min.z;
|
|
147
|
+
return currentLength > max ? currentLength : max;
|
|
148
|
+
}, 0);
|
|
149
|
+
return maxLength;
|
|
150
|
+
}
|
|
219
151
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
} else {
|
|
233
|
-
_this4._control.forEach(function (control) {
|
|
234
|
-
control.continue();
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
}
|
|
152
|
+
/**
|
|
153
|
+
* check reasonable location
|
|
154
|
+
*/
|
|
155
|
+
generateRandomPool() {
|
|
156
|
+
const lineLengths = this.lanelines.map(line => line.getLength());
|
|
157
|
+
const part = lineLengths.map(length => Math.floor(length / this.getMaxVehicleLength()));
|
|
158
|
+
const capacity = part.reduce((pre, next) => {
|
|
159
|
+
return pre + next;
|
|
160
|
+
}, 0);
|
|
161
|
+
if (capacity < this._totalNum) throw new Error('载具数量不合理');
|
|
162
|
+
return this.buildRandomPool(part);
|
|
163
|
+
}
|
|
239
164
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
for (
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
this._startingPoints.push(point);
|
|
252
|
-
this._startingLookatPoints.push(currentLaneline.getPointAt((current.t + 0.01) % 1));
|
|
253
|
-
this._startingProgressPoints.push(current.t);
|
|
254
|
-
this._startinglanelinePoints.push(current.line);
|
|
255
|
-
randomPool.splice(index, 1);
|
|
165
|
+
/**
|
|
166
|
+
* build random pool
|
|
167
|
+
*/
|
|
168
|
+
buildRandomPool(part) {
|
|
169
|
+
const pool = [];
|
|
170
|
+
part.forEach((part, i) => {
|
|
171
|
+
for (let j = 0; j < part; j++) {
|
|
172
|
+
pool.push({
|
|
173
|
+
t: 1 / part * j,
|
|
174
|
+
line: i
|
|
175
|
+
});
|
|
256
176
|
}
|
|
257
|
-
|
|
258
|
-
|
|
177
|
+
});
|
|
178
|
+
return pool;
|
|
179
|
+
}
|
|
259
180
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
for (var i = 0; i < this._startingPoints.length; i++) {
|
|
274
|
-
var randomModelIndex = Math.floor(Math.random() * this._benchmarkVehicles.length);
|
|
275
|
-
var currentVehicle = this._benchmarkVehicles[randomModelIndex].clone();
|
|
276
|
-
currentVehicle.position.copy(this._startingPoints[i]);
|
|
277
|
-
currentVehicle.lookAt(this._startingLookatPoints[i]);
|
|
278
|
-
this._vehicles.push(currentVehicle);
|
|
279
|
-
this.add(currentVehicle);
|
|
280
|
-
this.run(this.lanelines[this._startinglanelinePoints[i]], currentVehicle, this._startingProgressPoints[i], this._startinglanelinePoints[i]);
|
|
181
|
+
/**
|
|
182
|
+
* handle requestAnimationFrame pause
|
|
183
|
+
*/
|
|
184
|
+
handleVisibilityChange() {
|
|
185
|
+
document.addEventListener('visibilitychange', () => {
|
|
186
|
+
if (document.hidden) {
|
|
187
|
+
this._control.forEach(control => {
|
|
188
|
+
control.stop();
|
|
189
|
+
});
|
|
190
|
+
} else {
|
|
191
|
+
this._control.forEach(control => {
|
|
192
|
+
control.continue();
|
|
193
|
+
});
|
|
281
194
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
});
|
|
285
|
-
}
|
|
195
|
+
});
|
|
196
|
+
}
|
|
286
197
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
console.log('baseTime is 0');
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
var control = moveWithLine(model, laneline, {
|
|
305
|
-
duration: this.baseTime,
|
|
306
|
-
direction: lc && (lc === null || lc === void 0 ? void 0 : lc.direction) === 0 ? -1 : 1
|
|
307
|
-
});
|
|
308
|
-
this._control.push(control);
|
|
309
|
-
control.setProgress(progress);
|
|
198
|
+
/**
|
|
199
|
+
* generate random movement starting point
|
|
200
|
+
*/
|
|
201
|
+
generateInitPosition(randomPool) {
|
|
202
|
+
for (let i = 0; i < this._totalNum; i++) {
|
|
203
|
+
const index = Math.floor(Math.random() * randomPool.length);
|
|
204
|
+
const current = randomPool[index];
|
|
205
|
+
const currentLaneline = this.lanelines[current.line];
|
|
206
|
+
const point = currentLaneline.getPointAt(current.t);
|
|
207
|
+
this._startingPoints.push(point);
|
|
208
|
+
this._startingLookatPoints.push(currentLaneline.getPointAt((current.t + 0.01) % 1));
|
|
209
|
+
this._startingProgressPoints.push(current.t);
|
|
210
|
+
this._startinglanelinePoints.push(current.line);
|
|
211
|
+
randomPool.splice(index, 1);
|
|
310
212
|
}
|
|
213
|
+
this.placeVehicle();
|
|
214
|
+
}
|
|
311
215
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
216
|
+
/**
|
|
217
|
+
* place vehicle
|
|
218
|
+
*/
|
|
219
|
+
placeVehicle() {
|
|
220
|
+
this._vehicles.forEach((vehicle, i) => {
|
|
221
|
+
vehicle.removeFromParent();
|
|
222
|
+
this._control[i].remove();
|
|
223
|
+
});
|
|
224
|
+
this._vehicles = [];
|
|
225
|
+
this._control = [];
|
|
226
|
+
for (let i = 0; i < this._startingPoints.length; i++) {
|
|
227
|
+
const randomModelIndex = Math.floor(Math.random() * this._benchmarkVehicles.length);
|
|
228
|
+
const currentVehicle = this._benchmarkVehicles[randomModelIndex].clone();
|
|
229
|
+
currentVehicle.position.copy(this._startingPoints[i]);
|
|
230
|
+
currentVehicle.lookAt(this._startingLookatPoints[i]);
|
|
231
|
+
this._vehicles.push(currentVehicle);
|
|
232
|
+
this.add(currentVehicle);
|
|
233
|
+
this.run(this.lanelines[this._startinglanelinePoints[i]], currentVehicle, this._startingProgressPoints[i], this._startinglanelinePoints[i]);
|
|
323
234
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
235
|
+
this.dispatchEvent({
|
|
236
|
+
type: 'realismTraffic-loaded'
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* run
|
|
242
|
+
* @param laneline
|
|
243
|
+
* @param model
|
|
244
|
+
* @param progress
|
|
245
|
+
* @param laneIndex
|
|
246
|
+
*/
|
|
247
|
+
run(laneline, model, progress, laneIndex) {
|
|
248
|
+
const lc = this._lanelineControl.find(lc => lc.index === laneIndex);
|
|
249
|
+
if (this.baseTime === 0) {
|
|
250
|
+
console.log('baseTime is 0');
|
|
251
|
+
return;
|
|
332
252
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
253
|
+
const control = moveWithLine(model, laneline, {
|
|
254
|
+
duration: this.baseTime,
|
|
255
|
+
direction: lc && (lc === null || lc === void 0 ? void 0 : lc.direction) === 0 ? -1 : 1
|
|
256
|
+
});
|
|
257
|
+
this._control.push(control);
|
|
258
|
+
control.setProgress(progress);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* normalized vehicle size
|
|
263
|
+
*/
|
|
264
|
+
normalizedVehicleSize(model) {
|
|
265
|
+
const box = new Box3().setFromObject(model);
|
|
266
|
+
const currentWidth = box.max.x - box.min.x;
|
|
267
|
+
const scalingFactor = this._width / (this._divide + 1) / currentWidth * 0.7;
|
|
268
|
+
model.scale.set(scalingFactor, scalingFactor, scalingFactor);
|
|
269
|
+
return model;
|
|
270
|
+
}
|
|
271
|
+
removeFromParent() {
|
|
272
|
+
// todo: 升级three.js后,父对象变化,会触发此函数,重组内部引起关系
|
|
273
|
+
this.parent && this._control.forEach(control => {
|
|
274
|
+
control.remove();
|
|
275
|
+
});
|
|
276
|
+
return super.removeFromParent();
|
|
277
|
+
}
|
|
278
|
+
}, (_descriptor = _applyDecoratedDescriptor(_class.prototype, "visible", [overrideVisible], {
|
|
336
279
|
configurable: true,
|
|
337
280
|
enumerable: true,
|
|
338
281
|
writable: true,
|
|
339
|
-
initializer: function
|
|
282
|
+
initializer: function () {
|
|
340
283
|
return true;
|
|
341
284
|
}
|
|
342
285
|
})), _class);
|