@anov/3d-ability 0.0.142 → 0.0.143
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 +56 -35
- 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 +187 -146
- package/dist/business/Area/Fence/FenceBase.js.map +1 -1
- package/dist/business/Area/Fence/fence_base_01.js +112 -120
- package/dist/business/Area/Fence/fence_base_01.js.map +1 -1
- package/dist/business/Area/Fence/fence_feeting_01.js +130 -218
- package/dist/business/Area/Fence/fence_feeting_01.js.map +1 -1
- package/dist/business/Area/Fence/fence_roll_01.js +130 -140
- package/dist/business/Area/Fence/fence_roll_01.js.map +1 -1
- package/dist/business/Area/FillArea/FillAreaBase.js +126 -87
- package/dist/business/Area/FillArea/FillAreaBase.js.map +1 -1
- package/dist/business/Area/FillArea/fillArea_face_01.js +98 -72
- package/dist/business/Area/FillArea/fillArea_face_01.js.map +1 -1
- package/dist/business/Area/FillArea/fillArea_line_01.js +94 -66
- package/dist/business/Area/FillArea/fillArea_line_01.js.map +1 -1
- package/dist/business/Area/index.js +483 -267
- package/dist/business/Area/index.js.map +1 -1
- package/dist/business/Area/tool.js +26 -14
- package/dist/business/Area/tool.js.map +1 -1
- package/dist/business/Base/ObjectLayer.js +46 -21
- package/dist/business/Base/ObjectLayer.js.map +1 -1
- package/dist/business/Batch/index.js +234 -189
- package/dist/business/Batch/index.js.map +1 -1
- package/dist/business/Box/index.js +81 -52
- package/dist/business/Box/index.js.map +1 -1
- package/dist/business/Cylinder/index.js +79 -51
- package/dist/business/Cylinder/index.js.map +1 -1
- package/dist/business/Flyline/bubble/CircleBubble.js +9 -1
- package/dist/business/Flyline/bubble/CircleBubble.js.map +1 -1
- package/dist/business/Flyline/bubble/index.js +21 -7
- package/dist/business/Flyline/bubble/index.js.map +1 -1
- package/dist/business/Flyline/index.js +162 -96
- package/dist/business/Flyline/index.js.map +1 -1
- package/dist/business/Flyline/line/ArcLine.js +291 -208
- package/dist/business/Flyline/line/ArcLine.js.map +1 -1
- package/dist/business/Flyline/line/index.js +22 -8
- package/dist/business/Flyline/line/index.js.map +1 -1
- package/dist/business/HeatMap/HeatMap.js +467 -380
- package/dist/business/HeatMap/HeatMap.js.map +1 -1
- package/dist/business/HeatMap/core.js +525 -405
- package/dist/business/HeatMap/core.js.map +1 -1
- package/dist/business/HeatMap/shader.js +3 -69
- package/dist/business/HeatMap/shader.js.map +1 -1
- package/dist/business/InfoPanel/index.js +242 -201
- package/dist/business/InfoPanel/index.js.map +1 -1
- package/dist/business/Line/index.js +88 -55
- package/dist/business/Line/index.js.map +1 -1
- package/dist/business/Mark/KeyframeAnimation.js +176 -145
- package/dist/business/Mark/KeyframeAnimation.js.map +1 -1
- package/dist/business/Mark/index.js +294 -196
- package/dist/business/Mark/index.js.map +1 -1
- package/dist/business/Mark/shader/tanhao.js +3 -36
- package/dist/business/Mark/shader/tanhao.js.map +1 -1
- package/dist/business/Mark/type.js +1 -1
- package/dist/business/MaterialSwitch/MaterialSwitchSystem.js +551 -377
- package/dist/business/MaterialSwitch/MaterialSwitchSystem.js.map +1 -1
- package/dist/business/MaterialSwitch/inject.js +58 -92
- package/dist/business/MaterialSwitch/inject.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/finalFade.js +2 -74
- package/dist/business/MaterialSwitch/shader/finalFade.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/ground.js +16 -95
- package/dist/business/MaterialSwitch/shader/ground.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/groundBase64.js +3 -9
- package/dist/business/MaterialSwitch/shader/groundBase64.js.map +1 -1
- package/dist/business/MaterialSwitch/shader/realFade.js +9 -48
- package/dist/business/MaterialSwitch/shader/realFade.js.map +1 -1
- package/dist/business/Plane/index.js +78 -51
- package/dist/business/Plane/index.js.map +1 -1
- package/dist/business/Poi/index.js +336 -248
- package/dist/business/Poi/index.js.map +1 -1
- package/dist/business/Poi/link/Cylinder.js +89 -56
- package/dist/business/Poi/link/Cylinder.js.map +1 -1
- package/dist/business/Poi/link/Pyramid.js +165 -104
- package/dist/business/Poi/link/Pyramid.js.map +1 -1
- package/dist/business/Poi/link/index.js +114 -54
- package/dist/business/Poi/link/index.js.map +1 -1
- package/dist/business/Poi/panel/index.js +373 -315
- package/dist/business/Poi/panel/index.js.map +1 -1
- package/dist/business/Poi/panel/utils.js +10 -5
- package/dist/business/Poi/panel/utils.js.map +1 -1
- package/dist/business/Poi/particle/DoubleCircle.js +107 -71
- package/dist/business/Poi/particle/DoubleCircle.js.map +1 -1
- package/dist/business/Poi/particle/DynamicCircle.js +111 -75
- package/dist/business/Poi/particle/DynamicCircle.js.map +1 -1
- package/dist/business/Poi/particle/SingleCircle.js +98 -62
- package/dist/business/Poi/particle/SingleCircle.js.map +1 -1
- package/dist/business/Poi/particle/index.js +117 -49
- package/dist/business/Poi/particle/index.js.map +1 -1
- package/dist/business/Poi/shader/circle.js +3 -31
- package/dist/business/Poi/shader/circle.js.map +1 -1
- package/dist/business/Poi/shader/cylinder.js +3 -37
- package/dist/business/Poi/shader/cylinder.js.map +1 -1
- package/dist/business/Poi/shader/doubleCircle.js +3 -55
- package/dist/business/Poi/shader/doubleCircle.js.map +1 -1
- package/dist/business/Poi/shader/dynamicCircle.js +3 -67
- package/dist/business/Poi/shader/dynamicCircle.js.map +1 -1
- package/dist/business/Poi/title/Border.js +27 -7
- package/dist/business/Poi/title/Border.js.map +1 -1
- package/dist/business/Poi/title/Ellipse.js +27 -7
- package/dist/business/Poi/title/Ellipse.js.map +1 -1
- package/dist/business/Poi/title/index.js +292 -208
- package/dist/business/Poi/title/index.js.map +1 -1
- package/dist/business/Poi/tools.js +17 -18
- package/dist/business/Poi/tools.js.map +1 -1
- package/dist/business/Sphere/index.js +72 -47
- package/dist/business/Sphere/index.js.map +1 -1
- package/dist/business/Spline/index.js +245 -190
- package/dist/business/Spline/index.js.map +1 -1
- package/dist/business/SplitBuilding/index.js +536 -327
- package/dist/business/SplitBuilding/index.js.map +1 -1
- package/dist/business/SplitBuilding/type.js +2 -2
- package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js +275 -218
- package/dist/business/TrafficComponents/RealismTraffic/RealismTraffic.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js +177 -132
- package/dist/business/TrafficComponents/StreamerTraffic/StreamerTraffic.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js +1 -51
- package/dist/business/TrafficComponents/StreamerTraffic/fragmentShader.js.map +1 -1
- package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js +1 -6
- package/dist/business/TrafficComponents/StreamerTraffic/vertexShader.js.map +1 -1
- package/dist/business/TrafficComponents/base.js +55 -32
- package/dist/business/TrafficComponents/base.js.map +1 -1
- package/dist/business/TrafficComponents/utils.js +24 -25
- package/dist/business/TrafficComponents/utils.js.map +1 -1
- package/dist/business/Utils/Curve.js +56 -40
- 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 +14 -13
- package/dist/business/Utils/defineProps.js.map +1 -1
- package/dist/business/Utils/round-curve.js +153 -127
- package/dist/business/Utils/round-curve.js.map +1 -1
- package/dist/business/VideoPanel/index.js +319 -258
- package/dist/business/VideoPanel/index.js.map +1 -1
- package/dist/business/Water/index.js +108 -78
- 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 +449 -383
- package/dist/core/Camera/PerspectiveCamera/CameraExpand.js.map +1 -1
- package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js +142 -107
- package/dist/core/Camera/PerspectiveCamera/FollowOrbitControls.js.map +1 -1
- package/dist/core/Controls/FirstViewControl/index.js +96 -84
- package/dist/core/Controls/FirstViewControl/index.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/action/input.js +98 -77
- 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 +28 -19
- package/dist/core/Controls/ThirdViewControl/index.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/animation.js +155 -126
- package/dist/core/Controls/ThirdViewControl/player/animation.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/camera.js +63 -47
- package/dist/core/Controls/ThirdViewControl/player/camera.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player/control.js +49 -39
- package/dist/core/Controls/ThirdViewControl/player/control.js.map +1 -1
- package/dist/core/Controls/ThirdViewControl/player.js +91 -66
- package/dist/core/Controls/ThirdViewControl/player.js.map +1 -1
- package/dist/core/Controls/base.js +30 -14
- package/dist/core/Controls/base.js.map +1 -1
- package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js +131 -92
- package/dist/core/Curve/RoundedCornersCurve/RoundedCornersCurve.js.map +1 -1
- package/dist/core/Debug/PerformanceInfo/Performance.js +47 -22
- package/dist/core/Debug/PerformanceInfo/Performance.js.map +1 -1
- package/dist/core/Light/PointLight/PointLightExt.js +21 -4
- package/dist/core/Light/PointLight/PointLightExt.js.map +1 -1
- package/dist/core/Material/FinirMaterial/FinirMaterial.js +57 -37
- package/dist/core/Material/FinirMaterial/FinirMaterial.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js +153 -116
- package/dist/core/Material/PristineGridMaterial/PristineGridMaterial.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/shader/fragment.js +1 -95
- package/dist/core/Material/PristineGridMaterial/shader/fragment.js.map +1 -1
- package/dist/core/Material/PristineGridMaterial/shader/vertex.js +1 -26
- package/dist/core/Material/PristineGridMaterial/shader/vertex.js.map +1 -1
- package/dist/core/Material/SurfaceMaterial/index.js +172 -76
- package/dist/core/Material/SurfaceMaterial/index.js.map +1 -1
- package/dist/core/Material/decorators.js +11 -6
- package/dist/core/Material/decorators.js.map +1 -1
- package/dist/core/PostEffects/addACESFilmicToneMappingPass.js +12 -16
- package/dist/core/PostEffects/addACESFilmicToneMappingPass.js.map +1 -1
- package/dist/core/PostEffects/addBrightnessContrastPass.js +13 -17
- package/dist/core/PostEffects/addBrightnessContrastPass.js.map +1 -1
- package/dist/core/PostEffects/bloomPass.js +10 -17
- package/dist/core/PostEffects/bloomPass.js.map +1 -1
- package/dist/core/PostEffects/bloomSelect.js +43 -60
- package/dist/core/PostEffects/bloomSelect.js.map +1 -1
- package/dist/core/PostEffects/colorifyPass.js +13 -17
- package/dist/core/PostEffects/colorifyPass.js.map +1 -1
- package/dist/core/PostEffects/index.js +22 -28
- package/dist/core/PostEffects/index.js.map +1 -1
- package/dist/core/PostEffects/outlinePass.js +50 -37
- package/dist/core/PostEffects/outlinePass.js.map +1 -1
- package/dist/core/PostEffects/postprocessing.js +12 -14
- package/dist/core/PostEffects/postprocessing.js.map +1 -1
- package/dist/core/PostEffects/saoPass.js +10 -15
- package/dist/core/PostEffects/saoPass.js.map +1 -1
- package/dist/core/PostEffects/shader/colorify.js +3 -22
- package/dist/core/PostEffects/shader/colorify.js.map +1 -1
- package/dist/core/PostEffects/shader/gammaCorrectionShader.js +3 -27
- package/dist/core/PostEffects/shader/gammaCorrectionShader.js.map +1 -1
- package/dist/core/PostEffects/shader/mapping.js +3 -66
- package/dist/core/PostEffects/shader/mapping.js.map +1 -1
- package/dist/core/PostEffects/shader/thermalMaging.js +3 -28
- package/dist/core/PostEffects/shader/thermalMaging.js.map +1 -1
- package/dist/core/SceneEffect/grow/grow.js +101 -85
- package/dist/core/SceneEffect/grow/grow.js.map +1 -1
- package/dist/core/SceneEffect/grow/style_down.js +77 -60
- package/dist/core/SceneEffect/grow/style_down.js.map +1 -1
- package/dist/core/SceneEffect/grow/style_up.js +81 -64
- 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 +76 -51
- package/dist/core/WeatherSystem/DynamicWeatherSystem.js.map +1 -1
- package/dist/core/WeatherSystem/hdr/index.js +105 -69
- package/dist/core/WeatherSystem/hdr/index.js.map +1 -1
- package/dist/core/WeatherSystem/index.js +124 -77
- package/dist/core/WeatherSystem/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/fog/index.js +80 -52
- package/dist/core/WeatherSystem/objects/fog/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/index.js +84 -72
- package/dist/core/WeatherSystem/objects/rain/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/lineRain.js +118 -88
- package/dist/core/WeatherSystem/objects/rain/lineRain.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/plane.js +146 -116
- package/dist/core/WeatherSystem/objects/rain/plane.js.map +1 -1
- package/dist/core/WeatherSystem/objects/rain/point.js +148 -100
- package/dist/core/WeatherSystem/objects/rain/point.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/cloud.js +104 -71
- package/dist/core/WeatherSystem/objects/sky/cloud.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/index.js +84 -66
- package/dist/core/WeatherSystem/objects/sky/index.js.map +1 -1
- package/dist/core/WeatherSystem/objects/sky/outline.js +45 -25
- package/dist/core/WeatherSystem/objects/sky/outline.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/cloud.js +3 -74
- package/dist/core/WeatherSystem/shaders/cloud.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/fog.js +3 -103
- package/dist/core/WeatherSystem/shaders/fog.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/rain.js +7 -206
- package/dist/core/WeatherSystem/shaders/rain.js.map +1 -1
- package/dist/core/WeatherSystem/shaders/sky.js +3 -87
- package/dist/core/WeatherSystem/shaders/sky.js.map +1 -1
- package/dist/core/WeatherSystem/sky/index.js +135 -104
- package/dist/core/WeatherSystem/sky/index.js.map +1 -1
- package/dist/core/WeatherSystem/utils/constant.js +38 -44
- package/dist/core/WeatherSystem/utils/constant.js.map +1 -1
- package/dist/core/WeatherSystem/utils/math.js +25 -18
- 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 +141 -96
- 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,32 +1,43 @@
|
|
|
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); }
|
|
1
2
|
var _class, _descriptor;
|
|
2
3
|
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); }
|
|
3
16
|
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; }
|
|
4
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" ==
|
|
5
|
-
function _toPrimitive(t, r) { if ("object" !=
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
18
|
+
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); }
|
|
6
19
|
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; }
|
|
7
20
|
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.'); }
|
|
8
21
|
/* eslint-disable max-statements-per-line */
|
|
9
22
|
|
|
10
23
|
import { Box3, LoaderModule, utils } from '@anov/3d-core';
|
|
11
24
|
import { BaseTraffic } from "../base";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const overrideVisible = (target, propertyKey) => {
|
|
17
|
-
const getter = () => {
|
|
25
|
+
var moveWithLine = utils.moveWithLine;
|
|
26
|
+
var loaderModule = new LoaderModule();
|
|
27
|
+
var overrideVisible = function overrideVisible(target, propertyKey) {
|
|
28
|
+
var getter = function getter() {
|
|
18
29
|
return target._visible;
|
|
19
30
|
};
|
|
20
|
-
|
|
31
|
+
var setter = function setter(newValue) {
|
|
21
32
|
target._visible = newValue;
|
|
22
33
|
if (newValue === false) {
|
|
23
34
|
var _target$_control;
|
|
24
|
-
(_target$_control = target._control) !== null && _target$_control !== void 0 ? _target$_control : [].forEach(control
|
|
35
|
+
(_target$_control = target._control) !== null && _target$_control !== void 0 ? _target$_control : [].forEach(function (control) {
|
|
25
36
|
control.stop();
|
|
26
37
|
});
|
|
27
38
|
} else {
|
|
28
39
|
var _target$_control2;
|
|
29
|
-
(_target$_control2 = target._control) !== null && _target$_control2 !== void 0 ? _target$_control2 : [].forEach(control
|
|
40
|
+
(_target$_control2 = target._control) !== null && _target$_control2 !== void 0 ? _target$_control2 : [].forEach(function (control) {
|
|
30
41
|
control.continue();
|
|
31
42
|
});
|
|
32
43
|
}
|
|
@@ -42,244 +53,290 @@ const overrideVisible = (target, propertyKey) => {
|
|
|
42
53
|
/**
|
|
43
54
|
* 写实风格车辆交通组件
|
|
44
55
|
*/
|
|
45
|
-
export
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this
|
|
51
|
-
|
|
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);
|
|
56
|
+
export var RealismTraffic = (_class = /*#__PURE__*/function (_BaseTraffic) {
|
|
57
|
+
_inherits(RealismTraffic, _BaseTraffic);
|
|
58
|
+
var _super = _createSuper(RealismTraffic);
|
|
59
|
+
function RealismTraffic(params) {
|
|
60
|
+
var _this;
|
|
61
|
+
_classCallCheck(this, RealismTraffic);
|
|
62
|
+
_this = _super.call(this, params);
|
|
67
63
|
/** 车辆模型池 */
|
|
68
|
-
_defineProperty(
|
|
64
|
+
_defineProperty(_assertThisInitialized(_this), "_resource", void 0);
|
|
69
65
|
/** 基准时间 */
|
|
70
|
-
_defineProperty(
|
|
66
|
+
_defineProperty(_assertThisInitialized(_this), "_baseTime", void 0);
|
|
71
67
|
/** 车辆数量 */
|
|
72
|
-
_defineProperty(
|
|
73
|
-
_defineProperty(
|
|
74
|
-
_defineProperty(
|
|
75
|
-
_defineProperty(
|
|
76
|
-
_defineProperty(
|
|
77
|
-
_defineProperty(
|
|
78
|
-
_defineProperty(
|
|
79
|
-
_defineProperty(
|
|
68
|
+
_defineProperty(_assertThisInitialized(_this), "_totalNum", 5);
|
|
69
|
+
_defineProperty(_assertThisInitialized(_this), "_startingPoints", []);
|
|
70
|
+
_defineProperty(_assertThisInitialized(_this), "_startingLookatPoints", []);
|
|
71
|
+
_defineProperty(_assertThisInitialized(_this), "_startingProgressPoints", []);
|
|
72
|
+
_defineProperty(_assertThisInitialized(_this), "_startinglanelinePoints", []);
|
|
73
|
+
_defineProperty(_assertThisInitialized(_this), "_visible", true);
|
|
74
|
+
_defineProperty(_assertThisInitialized(_this), "_control", []);
|
|
75
|
+
_defineProperty(_assertThisInitialized(_this), "_lanelineControl", []);
|
|
80
76
|
/** 基准载具池 */
|
|
81
|
-
_defineProperty(
|
|
77
|
+
_defineProperty(_assertThisInitialized(_this), "_benchmarkVehicles", []);
|
|
82
78
|
/** 实际载具 */
|
|
83
|
-
_defineProperty(
|
|
79
|
+
_defineProperty(_assertThisInitialized(_this), "_vehicles", []);
|
|
84
80
|
/** 车道线 */
|
|
85
|
-
_defineProperty(
|
|
86
|
-
_initializerDefineProperty(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
width = 2,
|
|
90
|
-
divide =
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
81
|
+
_defineProperty(_assertThisInitialized(_this), "lanelines", []);
|
|
82
|
+
_initializerDefineProperty(_assertThisInitialized(_this), "visible", _descriptor, _assertThisInitialized(_this));
|
|
83
|
+
var path = params.path,
|
|
84
|
+
_params$width = params.width,
|
|
85
|
+
width = _params$width === void 0 ? 2 : _params$width,
|
|
86
|
+
_params$divide = params.divide,
|
|
87
|
+
divide = _params$divide === void 0 ? 1 : _params$divide,
|
|
88
|
+
resource = params.resource,
|
|
89
|
+
_params$totalNum = params.totalNum,
|
|
90
|
+
totalNum = _params$totalNum === void 0 ? 5 : _params$totalNum,
|
|
91
|
+
_params$baseTime = params.baseTime,
|
|
92
|
+
baseTime = _params$baseTime === void 0 ? 10 : _params$baseTime,
|
|
93
|
+
_params$control = params.control,
|
|
94
|
+
control = _params$control === void 0 ? [] : _params$control,
|
|
95
|
+
_params$corner = params.corner,
|
|
96
|
+
corner = _params$corner === void 0 ? 10 : _params$corner;
|
|
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
|
-
|
|
109
|
+
_this.generateLaneLines();
|
|
110
|
+
_this.loadBenchmarkModel();
|
|
111
|
+
_this.handleVisibilityChange();
|
|
112
|
+
return _this;
|
|
112
113
|
}
|
|
113
114
|
|
|
114
115
|
/**
|
|
115
116
|
* load benchmark model
|
|
116
117
|
*/
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
118
|
+
_createClass(RealismTraffic, [{
|
|
119
|
+
key: "width",
|
|
120
|
+
get: function get() {
|
|
121
|
+
return this._width;
|
|
122
|
+
},
|
|
123
|
+
set: function set(w) {
|
|
124
|
+
this._width = w;
|
|
125
|
+
this.generateLaneLines();
|
|
126
|
+
this.loadBenchmarkModel();
|
|
127
|
+
}
|
|
128
|
+
}, {
|
|
129
|
+
key: "divide",
|
|
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
|
+
});
|
|
129
158
|
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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);
|
|
134
165
|
});
|
|
135
|
-
|
|
136
|
-
this.generateInitPosition(randomPool);
|
|
137
|
-
});
|
|
138
|
-
}
|
|
166
|
+
}
|
|
139
167
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
+
}
|
|
151
181
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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();
|
|
191
|
+
});
|
|
192
|
+
var part = lineLengths.map(function (length) {
|
|
193
|
+
return Math.floor(length / _this3.getMaxVehicleLength());
|
|
194
|
+
});
|
|
195
|
+
var capacity = part.reduce(function (pre, next) {
|
|
196
|
+
return pre + next;
|
|
197
|
+
}, 0);
|
|
198
|
+
if (capacity < this._totalNum) throw new Error('载具数量不合理');
|
|
199
|
+
return this.buildRandomPool(part);
|
|
200
|
+
}
|
|
164
201
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
202
|
+
/**
|
|
203
|
+
* build random pool
|
|
204
|
+
*/
|
|
205
|
+
}, {
|
|
206
|
+
key: "buildRandomPool",
|
|
207
|
+
value: function buildRandomPool(part) {
|
|
208
|
+
var pool = [];
|
|
209
|
+
part.forEach(function (part, i) {
|
|
210
|
+
for (var j = 0; j < part; j++) {
|
|
211
|
+
pool.push({
|
|
212
|
+
t: 1 / part * j,
|
|
213
|
+
line: i
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
return pool;
|
|
218
|
+
}
|
|
180
219
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
220
|
+
/**
|
|
221
|
+
* handle requestAnimationFrame pause
|
|
222
|
+
*/
|
|
223
|
+
}, {
|
|
224
|
+
key: "handleVisibilityChange",
|
|
225
|
+
value: function handleVisibilityChange() {
|
|
226
|
+
var _this4 = this;
|
|
227
|
+
document.addEventListener('visibilitychange', function () {
|
|
228
|
+
if (document.hidden) {
|
|
229
|
+
_this4._control.forEach(function (control) {
|
|
230
|
+
control.stop();
|
|
231
|
+
});
|
|
232
|
+
} else {
|
|
233
|
+
_this4._control.forEach(function (control) {
|
|
234
|
+
control.continue();
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
}
|
|
197
239
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
240
|
+
/**
|
|
241
|
+
* generate random movement starting point
|
|
242
|
+
*/
|
|
243
|
+
}, {
|
|
244
|
+
key: "generateInitPosition",
|
|
245
|
+
value: function generateInitPosition(randomPool) {
|
|
246
|
+
for (var i = 0; i < this._totalNum; i++) {
|
|
247
|
+
var index = Math.floor(Math.random() * randomPool.length);
|
|
248
|
+
var current = randomPool[index];
|
|
249
|
+
var currentLaneline = this.lanelines[current.line];
|
|
250
|
+
var point = currentLaneline.getPointAt(current.t);
|
|
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);
|
|
256
|
+
}
|
|
257
|
+
this.placeVehicle();
|
|
212
258
|
}
|
|
213
|
-
this.placeVehicle();
|
|
214
|
-
}
|
|
215
259
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
this
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
260
|
+
/**
|
|
261
|
+
* place vehicle
|
|
262
|
+
*/
|
|
263
|
+
}, {
|
|
264
|
+
key: "placeVehicle",
|
|
265
|
+
value: function placeVehicle() {
|
|
266
|
+
var _this5 = this;
|
|
267
|
+
this._vehicles.forEach(function (vehicle, i) {
|
|
268
|
+
vehicle.removeFromParent();
|
|
269
|
+
_this5._control[i].remove();
|
|
270
|
+
});
|
|
271
|
+
this._vehicles = [];
|
|
272
|
+
this._control = [];
|
|
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]);
|
|
281
|
+
}
|
|
282
|
+
this.dispatchEvent({
|
|
283
|
+
type: 'realismTraffic-loaded'
|
|
284
|
+
});
|
|
234
285
|
}
|
|
235
|
-
this.dispatchEvent({
|
|
236
|
-
type: 'realismTraffic-loaded'
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
286
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
287
|
+
/**
|
|
288
|
+
* run
|
|
289
|
+
* @param laneline
|
|
290
|
+
* @param model
|
|
291
|
+
* @param progress
|
|
292
|
+
* @param laneIndex
|
|
293
|
+
*/
|
|
294
|
+
}, {
|
|
295
|
+
key: "run",
|
|
296
|
+
value: function run(laneline, model, progress, laneIndex) {
|
|
297
|
+
var lc = this._lanelineControl.find(function (lc) {
|
|
298
|
+
return lc.index === laneIndex;
|
|
299
|
+
});
|
|
300
|
+
if (this.baseTime === 0) {
|
|
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);
|
|
252
310
|
}
|
|
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
311
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
312
|
+
/**
|
|
313
|
+
* normalized vehicle size
|
|
314
|
+
*/
|
|
315
|
+
}, {
|
|
316
|
+
key: "normalizedVehicleSize",
|
|
317
|
+
value: function normalizedVehicleSize(model) {
|
|
318
|
+
var box = new Box3().setFromObject(model);
|
|
319
|
+
var currentWidth = box.max.x - box.min.x;
|
|
320
|
+
var scalingFactor = this._width / (this._divide + 1) / currentWidth * 0.7;
|
|
321
|
+
model.scale.set(scalingFactor, scalingFactor, scalingFactor);
|
|
322
|
+
return model;
|
|
323
|
+
}
|
|
324
|
+
}, {
|
|
325
|
+
key: "removeFromParent",
|
|
326
|
+
value: function removeFromParent() {
|
|
327
|
+
// todo: 升级three.js后,父对象变化,会触发此函数,重组内部引起关系
|
|
328
|
+
this.parent && this._control.forEach(function (control) {
|
|
329
|
+
control.remove();
|
|
330
|
+
});
|
|
331
|
+
return _get(_getPrototypeOf(RealismTraffic.prototype), "removeFromParent", this).call(this);
|
|
332
|
+
}
|
|
333
|
+
}]);
|
|
334
|
+
return RealismTraffic;
|
|
335
|
+
}(BaseTraffic), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "visible", [overrideVisible], {
|
|
279
336
|
configurable: true,
|
|
280
337
|
enumerable: true,
|
|
281
338
|
writable: true,
|
|
282
|
-
initializer: function () {
|
|
339
|
+
initializer: function initializer() {
|
|
283
340
|
return true;
|
|
284
341
|
}
|
|
285
342
|
})), _class);
|