@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,233 +1,316 @@
|
|
|
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 _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
1
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
2
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
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); }
|
|
3
15
|
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" !=
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
17
|
+
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
18
|
import { ClampToEdgeWrapping, Color, DoubleSide, Mesh, MeshBasicMaterial, QuadraticBezierCurve3, RepeatWrapping, TextureLoader, TubeGeometry, Vector3, use } from '@anov/3d-core';
|
|
7
19
|
import ObjectLayer from "../../Base/ObjectLayer";
|
|
8
20
|
import { IMG } from "./index";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
21
|
+
var CurveLine = /*#__PURE__*/function (_ObjectLayer) {
|
|
22
|
+
_inherits(CurveLine, _ObjectLayer);
|
|
23
|
+
var _super = _createSuper(CurveLine);
|
|
24
|
+
function CurveLine(params) {
|
|
25
|
+
var _this;
|
|
26
|
+
_classCallCheck(this, CurveLine);
|
|
27
|
+
_this = _super.call(this);
|
|
28
|
+
_defineProperty(_assertThisInitialized(_this), "_startPoint", void 0);
|
|
29
|
+
_defineProperty(_assertThisInitialized(_this), "_endPoint", void 0);
|
|
30
|
+
_defineProperty(_assertThisInitialized(_this), "_width", void 0);
|
|
31
|
+
_defineProperty(_assertThisInitialized(_this), "_color", void 0);
|
|
32
|
+
_defineProperty(_assertThisInitialized(_this), "_curve", void 0);
|
|
33
|
+
_defineProperty(_assertThisInitialized(_this), "_tiling", void 0);
|
|
34
|
+
_defineProperty(_assertThisInitialized(_this), "_duration", void 0);
|
|
35
|
+
_defineProperty(_assertThisInitialized(_this), "_loop", void 0);
|
|
36
|
+
_defineProperty(_assertThisInitialized(_this), "_delay", void 0);
|
|
37
|
+
_defineProperty(_assertThisInitialized(_this), "_material", void 0);
|
|
38
|
+
_defineProperty(_assertThisInitialized(_this), "_mesh", void 0);
|
|
39
|
+
_defineProperty(_assertThisInitialized(_this), "_readyPromise", void 0);
|
|
40
|
+
_defineProperty(_assertThisInitialized(_this), "_cancelAnimation", void 0);
|
|
41
|
+
var startPoint = params.startPoint,
|
|
42
|
+
endPoint = params.endPoint,
|
|
43
|
+
_params$width = params.width,
|
|
44
|
+
width = _params$width === void 0 ? 0.2 : _params$width,
|
|
45
|
+
_params$color = params.color,
|
|
46
|
+
color = _params$color === void 0 ? '#28FFD9' : _params$color,
|
|
47
|
+
_params$curve = params.curve,
|
|
48
|
+
curve = _params$curve === void 0 ? 0.6 : _params$curve,
|
|
49
|
+
_params$tiling = params.tiling,
|
|
50
|
+
tiling = _params$tiling === void 0 ? 1 : _params$tiling,
|
|
51
|
+
_params$duration = params.duration,
|
|
52
|
+
duration = _params$duration === void 0 ? 1 : _params$duration,
|
|
53
|
+
_params$loop = params.loop,
|
|
54
|
+
loop = _params$loop === void 0 ? true : _params$loop,
|
|
55
|
+
_params$delay = params.delay,
|
|
56
|
+
delay = _params$delay === void 0 ? 0 : _params$delay;
|
|
57
|
+
_this._startPoint = new Vector3().fromArray(startPoint);
|
|
58
|
+
_this._endPoint = new Vector3().fromArray(endPoint);
|
|
59
|
+
_this._width = width;
|
|
60
|
+
_this._color = color;
|
|
61
|
+
_this._curve = curve;
|
|
62
|
+
_this._tiling = tiling;
|
|
63
|
+
_this._duration = duration;
|
|
64
|
+
_this._loop = loop;
|
|
65
|
+
_this._delay = delay;
|
|
66
|
+
_this._readyPromise = _this.init();
|
|
67
|
+
return _this;
|
|
12
68
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
color: _this.color,
|
|
110
|
-
map: texture,
|
|
111
|
-
side: DoubleSide,
|
|
112
|
-
transparent: true // 透明
|
|
113
|
-
});
|
|
114
|
-
_this._mesh = new Mesh(tube, _this._material);
|
|
115
|
-
_this._mesh.renderOrder = 10;
|
|
116
|
-
_this.add(_this._mesh);
|
|
69
|
+
_createClass(CurveLine, [{
|
|
70
|
+
key: "width",
|
|
71
|
+
get: function get() {
|
|
72
|
+
return this._width;
|
|
73
|
+
},
|
|
74
|
+
set: function set(value) {
|
|
75
|
+
this._width = value;
|
|
76
|
+
this.destroy();
|
|
77
|
+
this.init();
|
|
78
|
+
}
|
|
79
|
+
}, {
|
|
80
|
+
key: "color",
|
|
81
|
+
get: function get() {
|
|
82
|
+
return this._color;
|
|
83
|
+
},
|
|
84
|
+
set: function set(value) {
|
|
85
|
+
this._color = value;
|
|
86
|
+
this._material.color = new Color(this._color);
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
key: "curve",
|
|
90
|
+
get: function get() {
|
|
91
|
+
return this._curve;
|
|
92
|
+
},
|
|
93
|
+
set: function set(value) {
|
|
94
|
+
this._curve = value;
|
|
95
|
+
this.destroy();
|
|
96
|
+
this.init();
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
key: "duration",
|
|
100
|
+
get: function get() {
|
|
101
|
+
if (this._duration <= 0) return 1;
|
|
102
|
+
return this._duration;
|
|
103
|
+
},
|
|
104
|
+
set: function set(value) {
|
|
105
|
+
this._duration = value;
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
key: "tiling",
|
|
109
|
+
get: function get() {
|
|
110
|
+
if (this._tiling <= 0) return 0;
|
|
111
|
+
return this._tiling;
|
|
112
|
+
},
|
|
113
|
+
set: function set(value) {
|
|
114
|
+
this._tiling = value;
|
|
115
|
+
}
|
|
116
|
+
}, {
|
|
117
|
+
key: "loop",
|
|
118
|
+
get: function get() {
|
|
119
|
+
return this._loop;
|
|
120
|
+
},
|
|
121
|
+
set: function set(value) {
|
|
122
|
+
this._loop = value;
|
|
123
|
+
}
|
|
124
|
+
}, {
|
|
125
|
+
key: "delay",
|
|
126
|
+
get: function get() {
|
|
127
|
+
return this._delay;
|
|
128
|
+
},
|
|
129
|
+
set: function set(value) {
|
|
130
|
+
this._delay = value;
|
|
131
|
+
}
|
|
132
|
+
}, {
|
|
133
|
+
key: "mesh",
|
|
134
|
+
get: function get() {
|
|
135
|
+
return this._mesh;
|
|
136
|
+
}
|
|
137
|
+
}, {
|
|
138
|
+
key: "ready",
|
|
139
|
+
get: function get() {
|
|
140
|
+
return this._readyPromise;
|
|
141
|
+
}
|
|
142
|
+
}, {
|
|
143
|
+
key: "init",
|
|
144
|
+
value: function () {
|
|
145
|
+
var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
146
|
+
var curve, texture, tube;
|
|
147
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
148
|
+
while (1) switch (_context.prev = _context.next) {
|
|
149
|
+
case 0:
|
|
150
|
+
curve = this.getCurve();
|
|
151
|
+
_context.next = 3;
|
|
152
|
+
return this.loadTexture(IMG);
|
|
153
|
+
case 3:
|
|
154
|
+
texture = _context.sent;
|
|
155
|
+
tube = new TubeGeometry(curve, Math.floor(curve.getLength() * 200), this.width, 2, false);
|
|
156
|
+
this._material = new MeshBasicMaterial({
|
|
157
|
+
color: this.color,
|
|
158
|
+
map: texture,
|
|
159
|
+
side: DoubleSide,
|
|
160
|
+
transparent: true // 透明
|
|
161
|
+
});
|
|
162
|
+
this._mesh = new Mesh(tube, this._material);
|
|
163
|
+
this._mesh.renderOrder = 10;
|
|
164
|
+
this.add(this._mesh);
|
|
117
165
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
166
|
+
// 动画
|
|
167
|
+
this.setupAnimation(texture);
|
|
168
|
+
return _context.abrupt("return", true);
|
|
169
|
+
case 11:
|
|
170
|
+
case "end":
|
|
171
|
+
return _context.stop();
|
|
172
|
+
}
|
|
173
|
+
}, _callee, this);
|
|
174
|
+
}));
|
|
175
|
+
function init() {
|
|
176
|
+
return _init.apply(this, arguments);
|
|
177
|
+
}
|
|
178
|
+
return init;
|
|
179
|
+
}()
|
|
180
|
+
}, {
|
|
181
|
+
key: "loadTexture",
|
|
182
|
+
value: function () {
|
|
183
|
+
var _loadTexture = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(path) {
|
|
184
|
+
var _this2 = this;
|
|
185
|
+
var textLoader;
|
|
186
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
187
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
188
|
+
case 0:
|
|
189
|
+
textLoader = new TextureLoader();
|
|
190
|
+
return _context2.abrupt("return", new Promise(function (resolve) {
|
|
191
|
+
var texture = textLoader.load(path, function () {
|
|
192
|
+
// 纹理加载完成后设置属性
|
|
193
|
+
// texture.center.set(0.5, 0.5) // 设置旋转中心为纹理中心
|
|
194
|
+
// texture.rotation = Math.PI / 2 // 旋转90度
|
|
195
|
+
texture.repeat.set(_this2.tiling, 2);
|
|
196
|
+
texture.offset.set(0, 0);
|
|
197
|
+
texture.wrapS = RepeatWrapping;
|
|
198
|
+
texture.wrapT = ClampToEdgeWrapping;
|
|
199
|
+
resolve(texture);
|
|
200
|
+
});
|
|
201
|
+
}));
|
|
202
|
+
case 2:
|
|
203
|
+
case "end":
|
|
204
|
+
return _context2.stop();
|
|
205
|
+
}
|
|
206
|
+
}, _callee2);
|
|
207
|
+
}));
|
|
208
|
+
function loadTexture(_x) {
|
|
209
|
+
return _loadTexture.apply(this, arguments);
|
|
160
210
|
}
|
|
211
|
+
return loadTexture;
|
|
212
|
+
}()
|
|
213
|
+
}, {
|
|
214
|
+
key: "setupAnimation",
|
|
215
|
+
value: function setupAnimation(texture) {
|
|
216
|
+
var _this3 = this;
|
|
217
|
+
var isAnimating = true;
|
|
218
|
+
var totalOffset = 0;
|
|
219
|
+
var lastTime = performance.now();
|
|
220
|
+
var isDelaying = false;
|
|
221
|
+
var delayStartTime = 0;
|
|
222
|
+
this._cancelAnimation = use.useframe(function () {
|
|
223
|
+
var currentTime = performance.now();
|
|
224
|
+
// 处理延迟状态
|
|
225
|
+
if (isDelaying) {
|
|
226
|
+
// 检查是否延迟时间已结束
|
|
227
|
+
if ((currentTime - delayStartTime) / 1000 >= _this3.delay) {
|
|
228
|
+
isDelaying = false;
|
|
229
|
+
// 重置偏移量计数和动画状态
|
|
230
|
+
totalOffset = 0;
|
|
231
|
+
isAnimating = true;
|
|
232
|
+
lastTime = currentTime;
|
|
233
|
+
}
|
|
234
|
+
return; // 在延迟期间不进行动画
|
|
235
|
+
}
|
|
161
236
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
237
|
+
// 如果不在动画中,直接返回
|
|
238
|
+
if (!isAnimating) return;
|
|
239
|
+
var deltaTime = currentTime - lastTime;
|
|
240
|
+
lastTime = currentTime;
|
|
166
241
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
242
|
+
// 使用 deltaTime 进行动画计算
|
|
243
|
+
var offsetPerFrame = deltaTime / (_this3.duration / _this3.tiling * 1000);
|
|
244
|
+
// 更新总偏移量
|
|
245
|
+
totalOffset += offsetPerFrame;
|
|
171
246
|
|
|
172
|
-
|
|
173
|
-
|
|
247
|
+
// 更新纹理偏移
|
|
248
|
+
texture.offset.x -= offsetPerFrame;
|
|
174
249
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
250
|
+
// 检查是否完成一次完整的UV移动
|
|
251
|
+
if (totalOffset >= _this3.tiling) {
|
|
252
|
+
// 重置偏移量以确保精确的位置
|
|
253
|
+
totalOffset = 0;
|
|
254
|
+
texture.offset.x = 0;
|
|
180
255
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
256
|
+
// 如果不循环,则结束动画
|
|
257
|
+
if (!_this3.loop) {
|
|
258
|
+
isAnimating = false;
|
|
259
|
+
}
|
|
260
|
+
// 如果有延迟且需要循环,则开始延迟
|
|
261
|
+
else if (_this3.delay > 0) {
|
|
262
|
+
isDelaying = true;
|
|
263
|
+
delayStartTime = currentTime;
|
|
264
|
+
isAnimating = false; // 在延迟期间暂停动画
|
|
265
|
+
}
|
|
184
266
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
getCurve() {
|
|
195
|
-
// 计算起点和终点的中点
|
|
196
|
-
const midPoint = new Vector3((this._startPoint.x + this._endPoint.x) / 2, (this._startPoint.y + this._endPoint.y) / 2, (this._startPoint.z + this._endPoint.z) / 2);
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}, {
|
|
270
|
+
key: "getCurve",
|
|
271
|
+
value: function getCurve() {
|
|
272
|
+
// 计算起点和终点的中点
|
|
273
|
+
var midPoint = new Vector3((this._startPoint.x + this._endPoint.x) / 2, (this._startPoint.y + this._endPoint.y) / 2, (this._startPoint.z + this._endPoint.z) / 2);
|
|
197
274
|
|
|
198
|
-
|
|
199
|
-
|
|
275
|
+
// 计算起点和终点的方向向量
|
|
276
|
+
var direction = new Vector3().subVectors(this._endPoint, this._startPoint);
|
|
200
277
|
|
|
201
|
-
|
|
202
|
-
|
|
278
|
+
// 计算距离,用于确定弧的高度
|
|
279
|
+
var distance = direction.length();
|
|
203
280
|
|
|
204
|
-
|
|
205
|
-
|
|
281
|
+
// 使用arcFactor控制弧线的高度
|
|
282
|
+
var height = distance * this.curve;
|
|
206
283
|
|
|
207
|
-
|
|
208
|
-
|
|
284
|
+
// 计算控制点 - 在中点上方
|
|
285
|
+
var controlPoint = new Vector3().copy(midPoint).addScaledVector(new Vector3(0, 1, 0), height);
|
|
209
286
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
287
|
+
// 创建曲线
|
|
288
|
+
var curve = new QuadraticBezierCurve3(this._startPoint, controlPoint, this._endPoint);
|
|
289
|
+
return curve;
|
|
290
|
+
}
|
|
291
|
+
}, {
|
|
292
|
+
key: "destroy",
|
|
293
|
+
value: function destroy() {
|
|
294
|
+
this._cancelAnimation && this._cancelAnimation();
|
|
295
|
+
// 释放几何体资源
|
|
296
|
+
if (this._mesh) {
|
|
297
|
+
if (this._mesh.geometry) this._mesh.geometry.dispose();
|
|
219
298
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
299
|
+
// 释放材质资源
|
|
300
|
+
if (this._mesh.material) {
|
|
301
|
+
// 释放材质
|
|
302
|
+
if (Array.isArray(this._mesh.material)) this._mesh.material.forEach(function (material) {
|
|
303
|
+
return material.dispose();
|
|
304
|
+
});else this._mesh.material.dispose();
|
|
305
|
+
}
|
|
225
306
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
307
|
+
// 从场景中移除网格
|
|
308
|
+
this.remove(this._mesh);
|
|
309
|
+
this._mesh = null;
|
|
310
|
+
}
|
|
229
311
|
}
|
|
230
|
-
}
|
|
231
|
-
|
|
312
|
+
}]);
|
|
313
|
+
return CurveLine;
|
|
314
|
+
}(ObjectLayer);
|
|
232
315
|
export default CurveLine;
|
|
233
316
|
//# sourceMappingURL=ArcLine.js.map
|