@tsparticles/plugin-poisson-disc 3.9.0 → 4.0.0-alpha.0
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/295.min.js +2 -0
- package/295.min.js.LICENSE.txt +1 -0
- package/browser/PoissonDisc.js +34 -7
- package/browser/PoissonDiscPlugin.js +2 -3
- package/browser/PoissonInstance.js +2 -3
- package/browser/index.js +6 -4
- package/cjs/Interfaces/IPoissonPoint.js +1 -2
- package/cjs/Options/Classes/Poisson.js +3 -7
- package/cjs/Options/Interfaces/IPoisson.js +1 -2
- package/cjs/PoissonDisc.js +37 -14
- package/cjs/PoissonDiscPlugin.js +6 -11
- package/cjs/PoissonInstance.js +7 -12
- package/cjs/index.js +6 -7
- package/cjs/types.js +1 -2
- package/dist_browser_PoissonDiscPlugin_js.js +60 -0
- package/esm/PoissonDisc.js +34 -7
- package/esm/PoissonDiscPlugin.js +2 -3
- package/esm/PoissonInstance.js +2 -3
- package/esm/index.js +6 -4
- package/package.json +4 -3
- package/report.html +5 -4
- package/tsparticles.plugin.poisson.js +209 -60
- package/tsparticles.plugin.poisson.min.js +1 -1
- package/tsparticles.plugin.poisson.min.js.LICENSE.txt +1 -1
- package/types/PoissonDiscPlugin.d.ts +2 -3
- package/types/PoissonInstance.d.ts +2 -3
- package/types/index.d.ts +1 -1
- package/umd/PoissonDisc.js +34 -7
- package/umd/PoissonDiscPlugin.js +2 -3
- package/umd/PoissonInstance.js +2 -3
- package/umd/index.js +41 -5
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
*
|
|
7
|
+
* v4.0.0-alpha.0
|
|
8
8
|
*/
|
|
9
9
|
/*
|
|
10
10
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
@@ -28,65 +28,25 @@ return /******/ (() => { // webpackBootstrap
|
|
|
28
28
|
/******/ "use strict";
|
|
29
29
|
/******/ var __webpack_modules__ = ({
|
|
30
30
|
|
|
31
|
-
/***/ "./dist/browser/
|
|
32
|
-
/*!*************************************************!*\
|
|
33
|
-
!*** ./dist/browser/Options/Classes/Poisson.js ***!
|
|
34
|
-
\*************************************************/
|
|
35
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
36
|
-
|
|
37
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Poisson: () => (/* binding */ Poisson)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nclass Poisson {\n constructor() {\n this.enable = false;\n this.dimensions = 2;\n this.radius = 0;\n this.retries = 30;\n this.steps = 0;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.enable !== undefined) {\n this.enable = data.enable;\n }\n if (data.dimensions !== undefined) {\n this.dimensions = data.dimensions;\n }\n if (data.radius !== undefined) {\n this.radius = data.radius;\n }\n if (data.retries !== undefined) {\n this.retries = data.retries;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-poisson-disc/./dist/browser/Options/Classes/Poisson.js?\n}");
|
|
38
|
-
|
|
39
|
-
/***/ }),
|
|
40
|
-
|
|
41
|
-
/***/ "./dist/browser/PoissonDisc.js":
|
|
42
|
-
/*!*************************************!*\
|
|
43
|
-
!*** ./dist/browser/PoissonDisc.js ***!
|
|
44
|
-
\*************************************/
|
|
45
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
46
|
-
|
|
47
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PoissonDisc: () => (/* binding */ PoissonDisc)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nconst double = 2,\n doublePI = Math.PI * double;\nclass PoissonDisc {\n constructor(size, radius, retries, dimensions, firstPoint) {\n this.size = {\n ...size\n };\n this.radius = radius;\n this.retries = retries;\n this.dimensions = dimensions;\n this.cellSize = Math.floor(this.radius / Math.sqrt(this.dimensions));\n this.cols = Math.floor(this.size.width / this.cellSize);\n this.rows = Math.floor(this.size.height / this.cellSize);\n this.points = [];\n this.active = [];\n this.grid = [];\n this.firstPoint = firstPoint ? {\n ...firstPoint\n } : undefined;\n this.reset();\n }\n addPoint(inputPoint) {\n const point = {\n position: {\n ...inputPoint\n },\n gridPosition: {\n x: Math.floor(inputPoint.x / this.cellSize),\n y: Math.floor(inputPoint.y / this.cellSize)\n }\n },\n pointIndex = this.points.length;\n this.points.push(point);\n this.grid[point.gridPosition.y][point.gridPosition.x] = pointIndex;\n this.active.push(pointIndex);\n }\n getRandom(min, max) {\n return Math.floor((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRandom)() * (max - min)) + min;\n }\n initialiseGrid() {\n for (let y = 0; y <= this.rows; y++) {\n this.grid[y] = [];\n for (let x = 0; x <= this.cols; x++) {\n this.grid[y][x] = -1;\n }\n }\n }\n reset() {\n this.points = [];\n this.active = [];\n this.grid = [];\n this.initialiseGrid();\n if (this.firstPoint) {\n this.addPoint(this.firstPoint);\n } else {\n const minCoordinate = 0;\n this.addPoint({\n x: this.getRandom(minCoordinate, this.size.width),\n y: this.getRandom(minCoordinate, this.size.height)\n });\n }\n }\n async run() {\n this.reset();\n const minCount = 0,\n step = 1;\n while (this.active.length > minCount) {\n await this.steps(step);\n }\n }\n async steps(steps) {\n const minCount = 0;\n for (let i = 0; i < steps; i++) {\n if (this.active.length <= minCount) {\n continue;\n }\n await this._step();\n }\n }\n _getNewPoint(currentPoint, tries) {\n const minCoordinate = 0,\n gridMinValue = 0,\n maxNeighbourIndex = 1,\n newAngle = tries * (doublePI / this.retries),\n newDist = this.getRandom(this.radius, this.radius * double),\n offset = {\n x: Math.cos(newAngle) * newDist,\n y: Math.sin(newAngle) * newDist\n },\n newPoint = {\n x: Math.floor(currentPoint.position.x + offset.x),\n y: Math.floor(currentPoint.position.y + offset.y)\n },\n newGridCoords = {\n x: Math.floor(newPoint.x / this.cellSize),\n y: Math.floor(newPoint.y / this.cellSize)\n };\n if (newPoint.x > minCoordinate && newPoint.x < this.size.width && newPoint.y > minCoordinate && newPoint.y < this.size.height) {\n if (this.grid[newGridCoords.y][newGridCoords.x] < gridMinValue) {\n for (let i = -1; i <= maxNeighbourIndex; i++) {\n for (let j = -1; j <= maxNeighbourIndex; j++) {\n const neighbourGrid = {\n x: newGridCoords.x + j,\n y: newGridCoords.y + i\n };\n if (neighbourGrid.x >= minCoordinate && neighbourGrid.y >= minCoordinate && neighbourGrid.x < this.cols && neighbourGrid.y < this.rows && (neighbourGrid.x !== newGridCoords.x || neighbourGrid.y !== newGridCoords.y)) {\n if (this.grid[neighbourGrid.y][neighbourGrid.x] >= gridMinValue) {\n const neighbourIndex = this.grid[neighbourGrid.y][neighbourGrid.x],\n neighbour = this.points[neighbourIndex],\n dist = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistance)(newPoint, neighbour.position);\n if (dist < this.radius) {\n return;\n }\n }\n }\n }\n }\n } else {\n return;\n }\n } else {\n return;\n }\n return newPoint;\n }\n async _step() {\n const minCount = 0,\n randomActive = this.getRandom(minCount, this.active.length);\n return new Promise(resolve => {\n let foundNewPoint = false;\n for (let tries = 0; tries < this.retries; tries++) {\n const newPoint = this._getNewPoint(this.points[this.active[randomActive]], tries);\n if (newPoint) {\n foundNewPoint = true;\n this.addPoint(newPoint);\n break;\n }\n }\n if (!foundNewPoint) {\n const deleteCount = 1;\n this.active.splice(randomActive, deleteCount);\n }\n resolve();\n });\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-poisson-disc/./dist/browser/PoissonDisc.js?\n}");
|
|
48
|
-
|
|
49
|
-
/***/ }),
|
|
50
|
-
|
|
51
|
-
/***/ "./dist/browser/PoissonDiscPlugin.js":
|
|
52
|
-
/*!*******************************************!*\
|
|
53
|
-
!*** ./dist/browser/PoissonDiscPlugin.js ***!
|
|
54
|
-
\*******************************************/
|
|
55
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
56
|
-
|
|
57
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PoissonDiscPlugin: () => (/* binding */ PoissonDiscPlugin)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_Poisson_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/Poisson.js */ \"./dist/browser/Options/Classes/Poisson.js\");\n/* harmony import */ var _PoissonInstance_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PoissonInstance.js */ \"./dist/browser/PoissonInstance.js\");\n\n\nclass PoissonDiscPlugin {\n constructor(engine) {\n this.id = \"poisson\";\n this._engine = engine;\n }\n getPlugin(container) {\n return Promise.resolve(new _PoissonInstance_js__WEBPACK_IMPORTED_MODULE_1__.PoissonInstance(container, this._engine));\n }\n loadOptions(options, source) {\n if (!this.needsPlugin(options) && !this.needsPlugin(source)) {\n return;\n }\n let poissonOptions = options.poisson;\n if (poissonOptions?.load === undefined) {\n options.poisson = poissonOptions = new _Options_Classes_Poisson_js__WEBPACK_IMPORTED_MODULE_0__.Poisson();\n }\n poissonOptions.load(source?.poisson);\n }\n needsPlugin(options) {\n return options?.poisson?.enable ?? false;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-poisson-disc/./dist/browser/PoissonDiscPlugin.js?\n}");
|
|
58
|
-
|
|
59
|
-
/***/ }),
|
|
60
|
-
|
|
61
|
-
/***/ "./dist/browser/PoissonInstance.js":
|
|
62
|
-
/*!*****************************************!*\
|
|
63
|
-
!*** ./dist/browser/PoissonInstance.js ***!
|
|
64
|
-
\*****************************************/
|
|
65
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
66
|
-
|
|
67
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PoissonInstance: () => (/* binding */ PoissonInstance)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _PoissonDisc_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PoissonDisc.js */ \"./dist/browser/PoissonDisc.js\");\n\n\nclass PoissonInstance {\n constructor(container, engine) {\n this._container = container;\n this._engine = engine;\n this._currentIndex = 0;\n }\n async init() {\n await this._initData();\n }\n particlePosition(position) {\n const container = this._container,\n options = container.actualOptions.poisson;\n if (!this.poissonDisc || !(options?.enable ?? false) || this._currentIndex >= this.poissonDisc.points.length) {\n return;\n }\n return position ?? this.poissonDisc?.points[this._currentIndex++]?.position;\n }\n resize() {\n const container = this._container,\n options = container.actualOptions.poisson;\n if (!(options?.enable ?? false)) {\n return;\n }\n if (this.redrawTimeout) {\n clearTimeout(this.redrawTimeout);\n }\n const timeout = 250;\n this.redrawTimeout = setTimeout(() => {\n void (async () => {\n await this._initData();\n await container.particles.redraw();\n })();\n }, timeout);\n }\n stop() {\n delete this.poissonDisc;\n }\n async _initData() {\n const container = this._container,\n poissonOptions = container.actualOptions.poisson,\n particlesOptions = container.actualOptions.particles,\n canvasSize = container.canvas.size,\n pixelRatio = container.retina.pixelRatio;\n if (!poissonOptions?.enable) {\n return;\n }\n this._currentIndex = 0;\n this.poissonDisc = new _PoissonDisc_js__WEBPACK_IMPORTED_MODULE_1__.PoissonDisc(canvasSize, poissonOptions.radius ? poissonOptions.radius * pixelRatio : Math.max((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(particlesOptions.size.value) * pixelRatio, Math.sqrt(canvasSize.width * canvasSize.height / particlesOptions.number.value)), poissonOptions.retries, poissonOptions.dimensions);\n const noSteps = 0;\n if (poissonOptions.steps > noSteps) {\n await this.poissonDisc.steps(poissonOptions.steps);\n } else {\n await this.poissonDisc.run();\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-poisson-disc/./dist/browser/PoissonInstance.js?\n}");
|
|
68
|
-
|
|
69
|
-
/***/ }),
|
|
70
|
-
|
|
71
|
-
/***/ "./dist/browser/index.js":
|
|
31
|
+
/***/ "./dist/browser/index.js"
|
|
72
32
|
/*!*******************************!*\
|
|
73
33
|
!*** ./dist/browser/index.js ***!
|
|
74
34
|
\*******************************/
|
|
75
|
-
|
|
35
|
+
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
76
36
|
|
|
77
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadPoissonDiscPlugin: () => (/* binding */ loadPoissonDiscPlugin)\n/* harmony export */ });\n
|
|
37
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadPoissonDiscPlugin: () => (/* binding */ loadPoissonDiscPlugin)\n/* harmony export */ });\nfunction loadPoissonDiscPlugin(engine) {\n engine.checkVersion(\"4.0.0-alpha.0\");\n engine.register(async e => {\n const {\n PoissonDiscPlugin\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_PoissonDiscPlugin_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./PoissonDiscPlugin.js */ \"./dist/browser/PoissonDiscPlugin.js\"));\n e.addPlugin(new PoissonDiscPlugin());\n });\n}\n\n//# sourceURL=webpack://@tsparticles/plugin-poisson-disc/./dist/browser/index.js?\n}");
|
|
78
38
|
|
|
79
|
-
/***/ }
|
|
39
|
+
/***/ },
|
|
80
40
|
|
|
81
|
-
/***/ "@tsparticles/engine"
|
|
41
|
+
/***/ "@tsparticles/engine"
|
|
82
42
|
/*!*********************************************************************************************************************************!*\
|
|
83
43
|
!*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
|
|
84
44
|
\*********************************************************************************************************************************/
|
|
85
|
-
|
|
45
|
+
(module) {
|
|
86
46
|
|
|
87
47
|
module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
88
48
|
|
|
89
|
-
/***/ }
|
|
49
|
+
/***/ }
|
|
90
50
|
|
|
91
51
|
/******/ });
|
|
92
52
|
/************************************************************************/
|
|
@@ -100,6 +60,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
100
60
|
/******/ if (cachedModule !== undefined) {
|
|
101
61
|
/******/ return cachedModule.exports;
|
|
102
62
|
/******/ }
|
|
63
|
+
/******/ // Check if module exists (development only)
|
|
64
|
+
/******/ if (__webpack_modules__[moduleId] === undefined) {
|
|
65
|
+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
|
|
66
|
+
/******/ e.code = 'MODULE_NOT_FOUND';
|
|
67
|
+
/******/ throw e;
|
|
68
|
+
/******/ }
|
|
103
69
|
/******/ // Create a new module (and put it into the cache)
|
|
104
70
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
105
71
|
/******/ // no module.id needed
|
|
@@ -114,19 +80,10 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
114
80
|
/******/ return module.exports;
|
|
115
81
|
/******/ }
|
|
116
82
|
/******/
|
|
117
|
-
|
|
118
|
-
/******/
|
|
119
|
-
/******/ (() => {
|
|
120
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
121
|
-
/******/ __webpack_require__.n = (module) => {
|
|
122
|
-
/******/ var getter = module && module.__esModule ?
|
|
123
|
-
/******/ () => (module['default']) :
|
|
124
|
-
/******/ () => (module);
|
|
125
|
-
/******/ __webpack_require__.d(getter, { a: getter });
|
|
126
|
-
/******/ return getter;
|
|
127
|
-
/******/ };
|
|
128
|
-
/******/ })();
|
|
83
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
84
|
+
/******/ __webpack_require__.m = __webpack_modules__;
|
|
129
85
|
/******/
|
|
86
|
+
/************************************************************************/
|
|
130
87
|
/******/ /* webpack/runtime/define property getters */
|
|
131
88
|
/******/ (() => {
|
|
132
89
|
/******/ // define getter functions for harmony exports
|
|
@@ -139,11 +96,90 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
139
96
|
/******/ };
|
|
140
97
|
/******/ })();
|
|
141
98
|
/******/
|
|
99
|
+
/******/ /* webpack/runtime/ensure chunk */
|
|
100
|
+
/******/ (() => {
|
|
101
|
+
/******/ __webpack_require__.f = {};
|
|
102
|
+
/******/ // This file contains only the entry chunk.
|
|
103
|
+
/******/ // The chunk loading function for additional chunks
|
|
104
|
+
/******/ __webpack_require__.e = (chunkId) => {
|
|
105
|
+
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
|
|
106
|
+
/******/ __webpack_require__.f[key](chunkId, promises);
|
|
107
|
+
/******/ return promises;
|
|
108
|
+
/******/ }, []));
|
|
109
|
+
/******/ };
|
|
110
|
+
/******/ })();
|
|
111
|
+
/******/
|
|
112
|
+
/******/ /* webpack/runtime/get javascript chunk filename */
|
|
113
|
+
/******/ (() => {
|
|
114
|
+
/******/ // This function allow to reference async chunks
|
|
115
|
+
/******/ __webpack_require__.u = (chunkId) => {
|
|
116
|
+
/******/ // return url for filenames based on template
|
|
117
|
+
/******/ return "" + chunkId + ".js";
|
|
118
|
+
/******/ };
|
|
119
|
+
/******/ })();
|
|
120
|
+
/******/
|
|
121
|
+
/******/ /* webpack/runtime/global */
|
|
122
|
+
/******/ (() => {
|
|
123
|
+
/******/ __webpack_require__.g = (function() {
|
|
124
|
+
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
125
|
+
/******/ try {
|
|
126
|
+
/******/ return this || new Function('return this')();
|
|
127
|
+
/******/ } catch (e) {
|
|
128
|
+
/******/ if (typeof window === 'object') return window;
|
|
129
|
+
/******/ }
|
|
130
|
+
/******/ })();
|
|
131
|
+
/******/ })();
|
|
132
|
+
/******/
|
|
142
133
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
143
134
|
/******/ (() => {
|
|
144
135
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
145
136
|
/******/ })();
|
|
146
137
|
/******/
|
|
138
|
+
/******/ /* webpack/runtime/load script */
|
|
139
|
+
/******/ (() => {
|
|
140
|
+
/******/ var inProgress = {};
|
|
141
|
+
/******/ var dataWebpackPrefix = "@tsparticles/plugin-poisson-disc:";
|
|
142
|
+
/******/ // loadScript function to load a script via script tag
|
|
143
|
+
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
|
|
144
|
+
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
|
|
145
|
+
/******/ var script, needAttach;
|
|
146
|
+
/******/ if(key !== undefined) {
|
|
147
|
+
/******/ var scripts = document.getElementsByTagName("script");
|
|
148
|
+
/******/ for(var i = 0; i < scripts.length; i++) {
|
|
149
|
+
/******/ var s = scripts[i];
|
|
150
|
+
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
|
|
151
|
+
/******/ }
|
|
152
|
+
/******/ }
|
|
153
|
+
/******/ if(!script) {
|
|
154
|
+
/******/ needAttach = true;
|
|
155
|
+
/******/ script = document.createElement('script');
|
|
156
|
+
/******/
|
|
157
|
+
/******/ script.charset = 'utf-8';
|
|
158
|
+
/******/ if (__webpack_require__.nc) {
|
|
159
|
+
/******/ script.setAttribute("nonce", __webpack_require__.nc);
|
|
160
|
+
/******/ }
|
|
161
|
+
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
|
|
162
|
+
/******/
|
|
163
|
+
/******/ script.src = url;
|
|
164
|
+
/******/ }
|
|
165
|
+
/******/ inProgress[url] = [done];
|
|
166
|
+
/******/ var onScriptComplete = (prev, event) => {
|
|
167
|
+
/******/ // avoid mem leaks in IE.
|
|
168
|
+
/******/ script.onerror = script.onload = null;
|
|
169
|
+
/******/ clearTimeout(timeout);
|
|
170
|
+
/******/ var doneFns = inProgress[url];
|
|
171
|
+
/******/ delete inProgress[url];
|
|
172
|
+
/******/ script.parentNode && script.parentNode.removeChild(script);
|
|
173
|
+
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
|
|
174
|
+
/******/ if(prev) return prev(event);
|
|
175
|
+
/******/ }
|
|
176
|
+
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
|
|
177
|
+
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
|
|
178
|
+
/******/ script.onload = onScriptComplete.bind(null, script.onload);
|
|
179
|
+
/******/ needAttach && document.head.appendChild(script);
|
|
180
|
+
/******/ };
|
|
181
|
+
/******/ })();
|
|
182
|
+
/******/
|
|
147
183
|
/******/ /* webpack/runtime/make namespace object */
|
|
148
184
|
/******/ (() => {
|
|
149
185
|
/******/ // define __esModule on exports
|
|
@@ -155,6 +191,119 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
|
|
|
155
191
|
/******/ };
|
|
156
192
|
/******/ })();
|
|
157
193
|
/******/
|
|
194
|
+
/******/ /* webpack/runtime/publicPath */
|
|
195
|
+
/******/ (() => {
|
|
196
|
+
/******/ var scriptUrl;
|
|
197
|
+
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
|
|
198
|
+
/******/ var document = __webpack_require__.g.document;
|
|
199
|
+
/******/ if (!scriptUrl && document) {
|
|
200
|
+
/******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
|
|
201
|
+
/******/ scriptUrl = document.currentScript.src;
|
|
202
|
+
/******/ if (!scriptUrl) {
|
|
203
|
+
/******/ var scripts = document.getElementsByTagName("script");
|
|
204
|
+
/******/ if(scripts.length) {
|
|
205
|
+
/******/ var i = scripts.length - 1;
|
|
206
|
+
/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
|
|
207
|
+
/******/ }
|
|
208
|
+
/******/ }
|
|
209
|
+
/******/ }
|
|
210
|
+
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
|
|
211
|
+
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
|
|
212
|
+
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
|
|
213
|
+
/******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
|
|
214
|
+
/******/ __webpack_require__.p = scriptUrl;
|
|
215
|
+
/******/ })();
|
|
216
|
+
/******/
|
|
217
|
+
/******/ /* webpack/runtime/jsonp chunk loading */
|
|
218
|
+
/******/ (() => {
|
|
219
|
+
/******/ // no baseURI
|
|
220
|
+
/******/
|
|
221
|
+
/******/ // object to store loaded and loading chunks
|
|
222
|
+
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
|
|
223
|
+
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
|
|
224
|
+
/******/ var installedChunks = {
|
|
225
|
+
/******/ "tsparticles.plugin.poisson": 0
|
|
226
|
+
/******/ };
|
|
227
|
+
/******/
|
|
228
|
+
/******/ __webpack_require__.f.j = (chunkId, promises) => {
|
|
229
|
+
/******/ // JSONP chunk loading for javascript
|
|
230
|
+
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
|
|
231
|
+
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
|
|
232
|
+
/******/
|
|
233
|
+
/******/ // a Promise means "currently loading".
|
|
234
|
+
/******/ if(installedChunkData) {
|
|
235
|
+
/******/ promises.push(installedChunkData[2]);
|
|
236
|
+
/******/ } else {
|
|
237
|
+
/******/ if(true) { // all chunks have JS
|
|
238
|
+
/******/ // setup Promise in chunk cache
|
|
239
|
+
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
|
|
240
|
+
/******/ promises.push(installedChunkData[2] = promise);
|
|
241
|
+
/******/
|
|
242
|
+
/******/ // start chunk loading
|
|
243
|
+
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
|
|
244
|
+
/******/ // create error before stack unwound to get useful stacktrace later
|
|
245
|
+
/******/ var error = new Error();
|
|
246
|
+
/******/ var loadingEnded = (event) => {
|
|
247
|
+
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
|
|
248
|
+
/******/ installedChunkData = installedChunks[chunkId];
|
|
249
|
+
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
|
|
250
|
+
/******/ if(installedChunkData) {
|
|
251
|
+
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
|
|
252
|
+
/******/ var realSrc = event && event.target && event.target.src;
|
|
253
|
+
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
|
|
254
|
+
/******/ error.name = 'ChunkLoadError';
|
|
255
|
+
/******/ error.type = errorType;
|
|
256
|
+
/******/ error.request = realSrc;
|
|
257
|
+
/******/ installedChunkData[1](error);
|
|
258
|
+
/******/ }
|
|
259
|
+
/******/ }
|
|
260
|
+
/******/ };
|
|
261
|
+
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
|
|
262
|
+
/******/ }
|
|
263
|
+
/******/ }
|
|
264
|
+
/******/ }
|
|
265
|
+
/******/ };
|
|
266
|
+
/******/
|
|
267
|
+
/******/ // no prefetching
|
|
268
|
+
/******/
|
|
269
|
+
/******/ // no preloaded
|
|
270
|
+
/******/
|
|
271
|
+
/******/ // no HMR
|
|
272
|
+
/******/
|
|
273
|
+
/******/ // no HMR manifest
|
|
274
|
+
/******/
|
|
275
|
+
/******/ // no on chunks loaded
|
|
276
|
+
/******/
|
|
277
|
+
/******/ // install a JSONP callback for chunk loading
|
|
278
|
+
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
|
|
279
|
+
/******/ var [chunkIds, moreModules, runtime] = data;
|
|
280
|
+
/******/ // add "moreModules" to the modules object,
|
|
281
|
+
/******/ // then flag all "chunkIds" as loaded and fire callback
|
|
282
|
+
/******/ var moduleId, chunkId, i = 0;
|
|
283
|
+
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
|
|
284
|
+
/******/ for(moduleId in moreModules) {
|
|
285
|
+
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
|
|
286
|
+
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
|
|
287
|
+
/******/ }
|
|
288
|
+
/******/ }
|
|
289
|
+
/******/ if(runtime) var result = runtime(__webpack_require__);
|
|
290
|
+
/******/ }
|
|
291
|
+
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
|
|
292
|
+
/******/ for(;i < chunkIds.length; i++) {
|
|
293
|
+
/******/ chunkId = chunkIds[i];
|
|
294
|
+
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
|
|
295
|
+
/******/ installedChunks[chunkId][0]();
|
|
296
|
+
/******/ }
|
|
297
|
+
/******/ installedChunks[chunkId] = 0;
|
|
298
|
+
/******/ }
|
|
299
|
+
/******/
|
|
300
|
+
/******/ }
|
|
301
|
+
/******/
|
|
302
|
+
/******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_plugin_poisson_disc"] = this["webpackChunk_tsparticles_plugin_poisson_disc"] || [];
|
|
303
|
+
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
|
|
304
|
+
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
|
|
305
|
+
/******/ })();
|
|
306
|
+
/******/
|
|
158
307
|
/************************************************************************/
|
|
159
308
|
/******/
|
|
160
309
|
/******/ // startup
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see tsparticles.plugin.poisson.min.js.LICENSE.txt */
|
|
2
|
-
!function(
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{var t,r,o={303(t){t.exports=e}},i={};function n(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e](r,r.exports,n),r.exports}n.m=o,n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/plugin-poisson-disc:",n.l=(e,o,i,a)=>{if(t[e])t[e].push(o);else{var s,c;if(void 0!==i)for(var p=document.getElementsByTagName("script"),l=0;l<p.length;l++){var u=p[l];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==r+i){s=u;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",r+i),s.src=e),t[e]=[o];var d=(r,o)=>{s.onerror=s.onload=null,clearTimeout(f);var i=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(o))),r)return r(o)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=d.bind(null,s.onerror),s.onload=d.bind(null,s.onload),c&&document.head.appendChild(s)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={189:0};n.f.j=(t,r)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise(((r,i)=>o=e[t]=[r,i]));r.push(o[2]=i);var a=n.p+n.u(t),s=new Error;n.l(a,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,o[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,i,[a,s,c]=r,p=0;if(a.some((t=>0!==e[t]))){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);if(c)c(n)}for(t&&t(r);p<a.length;p++)i=a[p],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=this.webpackChunk_tsparticles_plugin_poisson_disc=this.webpackChunk_tsparticles_plugin_poisson_disc||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};function s(e){e.checkVersion("4.0.0-alpha.0"),e.register((async e=>{const{PoissonDiscPlugin:t}=await n.e(295).then(n.bind(n,295));e.addPlugin(new t)}))}return n.r(a),n.d(a,{loadPoissonDiscPlugin:()=>s}),a})()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Poisson Disc Plugin
|
|
1
|
+
/*! tsParticles Poisson Disc Plugin v4.0.0-alpha.0 by Matteo Bruni */
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { type Container, type
|
|
1
|
+
import { type Container, type IPlugin, type RecursivePartial } from "@tsparticles/engine";
|
|
2
2
|
import type { IPoissonOptions, PoissonOptions } from "./types.js";
|
|
3
3
|
import { PoissonInstance } from "./PoissonInstance.js";
|
|
4
4
|
export declare class PoissonDiscPlugin implements IPlugin {
|
|
5
5
|
readonly id: string;
|
|
6
|
-
|
|
7
|
-
constructor(engine: Engine);
|
|
6
|
+
constructor();
|
|
8
7
|
getPlugin(container: Container): Promise<PoissonInstance>;
|
|
9
8
|
loadOptions(options: PoissonOptions, source?: RecursivePartial<IPoissonOptions>): void;
|
|
10
9
|
needsPlugin(options?: RecursivePartial<IPoissonOptions>): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IContainerPlugin, type ICoordinates } from "@tsparticles/engine";
|
|
2
2
|
import type { PoissonContainer } from "./types.js";
|
|
3
3
|
import { PoissonDisc } from "./PoissonDisc.js";
|
|
4
4
|
export declare class PoissonInstance implements IContainerPlugin {
|
|
@@ -6,8 +6,7 @@ export declare class PoissonInstance implements IContainerPlugin {
|
|
|
6
6
|
redrawTimeout?: number | NodeJS.Timeout;
|
|
7
7
|
private readonly _container;
|
|
8
8
|
private _currentIndex;
|
|
9
|
-
|
|
10
|
-
constructor(container: PoissonContainer, engine: Engine);
|
|
9
|
+
constructor(container: PoissonContainer);
|
|
11
10
|
init(): Promise<void>;
|
|
12
11
|
particlePosition(position?: ICoordinates): ICoordinates | undefined;
|
|
13
12
|
resize(): void;
|
package/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type Engine } from "@tsparticles/engine";
|
|
2
|
-
export declare function loadPoissonDiscPlugin(engine: Engine
|
|
2
|
+
export declare function loadPoissonDiscPlugin(engine: Engine): void;
|
package/umd/PoissonDisc.js
CHANGED
|
@@ -34,9 +34,12 @@
|
|
|
34
34
|
x: Math.floor(inputPoint.x / this.cellSize),
|
|
35
35
|
y: Math.floor(inputPoint.y / this.cellSize),
|
|
36
36
|
},
|
|
37
|
-
}, pointIndex = this.points.length;
|
|
37
|
+
}, pointIndex = this.points.length, row = this.grid[point.gridPosition.y];
|
|
38
|
+
if (!row) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
38
41
|
this.points.push(point);
|
|
39
|
-
|
|
42
|
+
row[point.gridPosition.x] = pointIndex;
|
|
40
43
|
this.active.push(pointIndex);
|
|
41
44
|
}
|
|
42
45
|
getRandom(min, max) {
|
|
@@ -45,8 +48,12 @@
|
|
|
45
48
|
initialiseGrid() {
|
|
46
49
|
for (let y = 0; y <= this.rows; y++) {
|
|
47
50
|
this.grid[y] = [];
|
|
51
|
+
const row = this.grid[y];
|
|
52
|
+
if (!row) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
48
55
|
for (let x = 0; x <= this.cols; x++) {
|
|
49
|
-
|
|
56
|
+
row[x] = -1;
|
|
50
57
|
}
|
|
51
58
|
}
|
|
52
59
|
}
|
|
@@ -97,7 +104,15 @@
|
|
|
97
104
|
newPoint.x < this.size.width &&
|
|
98
105
|
newPoint.y > minCoordinate &&
|
|
99
106
|
newPoint.y < this.size.height) {
|
|
100
|
-
|
|
107
|
+
const row = this.grid[newGridCoords.y];
|
|
108
|
+
if (!row) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const point = row[newGridCoords.x];
|
|
112
|
+
if (point === undefined) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (point < gridMinValue) {
|
|
101
116
|
for (let i = -1; i <= maxNeighbourIndex; i++) {
|
|
102
117
|
for (let j = -1; j <= maxNeighbourIndex; j++) {
|
|
103
118
|
const neighbourGrid = {
|
|
@@ -109,8 +124,12 @@
|
|
|
109
124
|
neighbourGrid.x < this.cols &&
|
|
110
125
|
neighbourGrid.y < this.rows &&
|
|
111
126
|
(neighbourGrid.x !== newGridCoords.x || neighbourGrid.y !== newGridCoords.y)) {
|
|
112
|
-
if (
|
|
113
|
-
const neighbourIndex =
|
|
127
|
+
if (point >= gridMinValue) {
|
|
128
|
+
const neighbourIndex = point, neighbour = this.points[neighbourIndex];
|
|
129
|
+
if (!neighbour) {
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
const dist = (0, engine_1.getDistance)(newPoint, neighbour.position);
|
|
114
133
|
if (dist < this.radius) {
|
|
115
134
|
return;
|
|
116
135
|
}
|
|
@@ -133,7 +152,15 @@
|
|
|
133
152
|
return new Promise(resolve => {
|
|
134
153
|
let foundNewPoint = false;
|
|
135
154
|
for (let tries = 0; tries < this.retries; tries++) {
|
|
136
|
-
const
|
|
155
|
+
const randomActivePointIndex = this.active[randomActive];
|
|
156
|
+
if (randomActivePointIndex === undefined) {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
const point = this.points[randomActivePointIndex];
|
|
160
|
+
if (!point) {
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
const newPoint = this._getNewPoint(point, tries);
|
|
137
164
|
if (newPoint) {
|
|
138
165
|
foundNewPoint = true;
|
|
139
166
|
this.addPoint(newPoint);
|
package/umd/PoissonDiscPlugin.js
CHANGED
|
@@ -13,12 +13,11 @@
|
|
|
13
13
|
const Poisson_js_1 = require("./Options/Classes/Poisson.js");
|
|
14
14
|
const PoissonInstance_js_1 = require("./PoissonInstance.js");
|
|
15
15
|
class PoissonDiscPlugin {
|
|
16
|
-
constructor(
|
|
16
|
+
constructor() {
|
|
17
17
|
this.id = "poisson";
|
|
18
|
-
this._engine = engine;
|
|
19
18
|
}
|
|
20
19
|
getPlugin(container) {
|
|
21
|
-
return Promise.resolve(new PoissonInstance_js_1.PoissonInstance(container
|
|
20
|
+
return Promise.resolve(new PoissonInstance_js_1.PoissonInstance(container));
|
|
22
21
|
}
|
|
23
22
|
loadOptions(options, source) {
|
|
24
23
|
if (!this.needsPlugin(options) && !this.needsPlugin(source)) {
|
package/umd/PoissonInstance.js
CHANGED
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
14
|
const PoissonDisc_js_1 = require("./PoissonDisc.js");
|
|
15
15
|
class PoissonInstance {
|
|
16
|
-
constructor(container
|
|
16
|
+
constructor(container) {
|
|
17
17
|
this._container = container;
|
|
18
|
-
this._engine = engine;
|
|
19
18
|
this._currentIndex = 0;
|
|
20
19
|
}
|
|
21
20
|
async init() {
|
|
@@ -26,7 +25,7 @@
|
|
|
26
25
|
if (!this.poissonDisc || !(options?.enable ?? false) || this._currentIndex >= this.poissonDisc.points.length) {
|
|
27
26
|
return;
|
|
28
27
|
}
|
|
29
|
-
return position ?? this.poissonDisc
|
|
28
|
+
return position ?? this.poissonDisc.points[this._currentIndex++]?.position;
|
|
30
29
|
}
|
|
31
30
|
resize() {
|
|
32
31
|
const container = this._container, options = container.actualOptions.poisson;
|
package/umd/index.js
CHANGED
|
@@ -1,18 +1,54 @@
|
|
|
1
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
+
if (k2 === undefined) k2 = k;
|
|
3
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
+
}
|
|
7
|
+
Object.defineProperty(o, k2, desc);
|
|
8
|
+
}) : (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
o[k2] = m[k];
|
|
11
|
+
}));
|
|
12
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
13
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
14
|
+
}) : function(o, v) {
|
|
15
|
+
o["default"] = v;
|
|
16
|
+
});
|
|
17
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
18
|
+
var ownKeys = function(o) {
|
|
19
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
20
|
+
var ar = [];
|
|
21
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
22
|
+
return ar;
|
|
23
|
+
};
|
|
24
|
+
return ownKeys(o);
|
|
25
|
+
};
|
|
26
|
+
return function (mod) {
|
|
27
|
+
if (mod && mod.__esModule) return mod;
|
|
28
|
+
var result = {};
|
|
29
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
30
|
+
__setModuleDefault(result, mod);
|
|
31
|
+
return result;
|
|
32
|
+
};
|
|
33
|
+
})();
|
|
1
34
|
(function (factory) {
|
|
2
35
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
36
|
var v = factory(require, exports);
|
|
4
37
|
if (v !== undefined) module.exports = v;
|
|
5
38
|
}
|
|
6
39
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"
|
|
40
|
+
define(["require", "exports"], factory);
|
|
8
41
|
}
|
|
9
42
|
})(function (require, exports) {
|
|
10
43
|
"use strict";
|
|
44
|
+
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
|
11
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
46
|
exports.loadPoissonDiscPlugin = loadPoissonDiscPlugin;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
engine.
|
|
16
|
-
|
|
47
|
+
function loadPoissonDiscPlugin(engine) {
|
|
48
|
+
engine.checkVersion("4.0.0-alpha.0");
|
|
49
|
+
engine.register(async (e) => {
|
|
50
|
+
const { PoissonDiscPlugin } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./PoissonDiscPlugin.js"))) : new Promise((resolve_1, reject_1) => { require(["./PoissonDiscPlugin.js"], resolve_1, reject_1); }).then(__importStar));
|
|
51
|
+
e.addPlugin(new PoissonDiscPlugin());
|
|
52
|
+
});
|
|
17
53
|
}
|
|
18
54
|
});
|