@tsparticles/path-simplex-noise 3.0.0-beta.0 → 3.0.0-beta.2
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/README.md +1 -1
- package/browser/SimplexNoiseGenerator.js +1 -1
- package/browser/index.js +1 -1
- package/browser/package.json +1 -0
- package/cjs/SimplexNoiseGenerator.js +3 -3
- package/cjs/index.js +2 -2
- package/cjs/package.json +1 -0
- package/esm/SimplexNoiseGenerator.js +1 -1
- package/esm/index.js +1 -1
- package/esm/package.json +1 -0
- package/package.json +18 -6
- package/report.html +23 -5
- package/tsparticles.path.simplex.noise.js +1 -1
- package/tsparticles.path.simplex.noise.min.js.LICENSE.txt +1 -1
- package/types/SimplexNoiseGenerator.d.ts +2 -2
- package/umd/SimplexNoiseGenerator.js +4 -4
- package/umd/index.js +3 -3
|
@@ -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
|
-
* v3.0.0-beta.
|
|
7
|
+
* v3.0.0-beta.2
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/*! tsParticles Simplex Noise Path v3.0.0-beta.
|
|
1
|
+
/*! tsParticles Simplex Noise Path v3.0.0-beta.2 by Matteo Bruni */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Container, type IMovePathGenerator, type Particle, Vector } from "@tsparticles/engine";
|
|
2
|
-
import type { ISimplexOptions } from "./ISimplexOptions";
|
|
3
|
-
import type { Noise4D } from "./simplex";
|
|
2
|
+
import type { ISimplexOptions } from "./ISimplexOptions.js";
|
|
3
|
+
import type { Noise4D } from "./simplex.js";
|
|
4
4
|
export declare class SimplexNoiseGenerator implements IMovePathGenerator {
|
|
5
5
|
container?: Container;
|
|
6
6
|
field: number[][][][];
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "@tsparticles/engine", "./simplex"], factory);
|
|
7
|
+
define(["require", "exports", "@tsparticles/engine", "./simplex.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.SimplexNoiseGenerator = void 0;
|
|
13
13
|
const engine_1 = require("@tsparticles/engine");
|
|
14
|
-
const
|
|
14
|
+
const simplex_js_1 = require("./simplex.js");
|
|
15
15
|
class SimplexNoiseGenerator {
|
|
16
16
|
constructor() {
|
|
17
17
|
this._calculateField = () => {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
this.options.increment = sourceOptions.increment > 0 ? sourceOptions.increment : 0.004;
|
|
43
43
|
this.options.width = container.canvas.size.width;
|
|
44
44
|
this.options.height = container.canvas.size.height;
|
|
45
|
-
this.noiseFunc = (0,
|
|
45
|
+
this.noiseFunc = (0, simplex_js_1.makeNoise4D)(sourceOptions.seed ?? (0, engine_1.getRandom)());
|
|
46
46
|
this.options.columns = Math.floor(this.options.width / this.options.size) + 1;
|
|
47
47
|
this.options.rows = Math.floor(this.options.height / this.options.size) + 1;
|
|
48
48
|
this.options.layers = Math.floor(container.zLayers / this.options.size) + 1;
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
addEventListener("resize", () => this._resetField(container));
|
|
55
55
|
};
|
|
56
56
|
this.field = [];
|
|
57
|
-
this.noiseFunc = (0,
|
|
57
|
+
this.noiseFunc = (0, simplex_js_1.makeNoise4D)((0, engine_1.getRandom)());
|
|
58
58
|
this.noiseW = 0;
|
|
59
59
|
this.options = {
|
|
60
60
|
size: 20,
|
package/umd/index.js
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports", "./SimplexNoiseGenerator"], factory);
|
|
7
|
+
define(["require", "exports", "./SimplexNoiseGenerator.js"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
"use strict";
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.loadSimplexNoisePath = exports.simplexNoisePathName = void 0;
|
|
13
|
-
const
|
|
13
|
+
const SimplexNoiseGenerator_js_1 = require("./SimplexNoiseGenerator.js");
|
|
14
14
|
exports.simplexNoisePathName = "simplexNoise";
|
|
15
15
|
async function loadSimplexNoisePath(engine, refresh = true) {
|
|
16
|
-
await engine.addPathGenerator(exports.simplexNoisePathName, new
|
|
16
|
+
await engine.addPathGenerator(exports.simplexNoisePathName, new SimplexNoiseGenerator_js_1.SimplexNoiseGenerator(), refresh);
|
|
17
17
|
}
|
|
18
18
|
exports.loadSimplexNoisePath = loadSimplexNoisePath;
|
|
19
19
|
});
|