@tsparticles/simplex-noise 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/cjs/Classes/SimplexNoise2D.js +4 -8
- package/cjs/Classes/SimplexNoise3D.js +4 -8
- package/cjs/Classes/SimplexNoise4D.js +4 -8
- package/cjs/Contributions.js +1 -2
- package/cjs/SimplexNoise.js +7 -11
- package/cjs/index.js +1 -5
- package/cjs/utils.js +1 -4
- package/package.json +3 -2
- package/report.html +5 -4
- package/tsparticles.simplex.noise.js +25 -19
- package/tsparticles.simplex.noise.min.js.LICENSE.txt +1 -1
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.SimplexNoise2D = void 0;
|
|
4
|
-
const utils_js_1 = require("../utils.js");
|
|
5
|
-
class SimplexNoise2D {
|
|
1
|
+
import { shuffleSeed } from "../utils.js";
|
|
2
|
+
export class SimplexNoise2D {
|
|
6
3
|
constructor() {
|
|
7
4
|
this._NORM_2D = 1.0 / 47.0;
|
|
8
5
|
this._SQUISH_2D = (Math.sqrt(2 + 1) - 1) / 2;
|
|
@@ -130,9 +127,9 @@ class SimplexNoise2D {
|
|
|
130
127
|
}
|
|
131
128
|
let seed = new Uint32Array(1);
|
|
132
129
|
seed[0] = clientSeed;
|
|
133
|
-
seed =
|
|
130
|
+
seed = shuffleSeed(shuffleSeed(shuffleSeed(seed)));
|
|
134
131
|
for (let i = 255; i >= 0; i--) {
|
|
135
|
-
seed =
|
|
132
|
+
seed = shuffleSeed(seed);
|
|
136
133
|
const r = new Uint32Array(1);
|
|
137
134
|
r[0] = (seed[0] + 31) % (i + 1);
|
|
138
135
|
if (r[0] < 0) {
|
|
@@ -153,4 +150,3 @@ class SimplexNoise2D {
|
|
|
153
150
|
};
|
|
154
151
|
}
|
|
155
152
|
}
|
|
156
|
-
exports.SimplexNoise2D = SimplexNoise2D;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.SimplexNoise3D = void 0;
|
|
4
|
-
const utils_js_1 = require("../utils.js");
|
|
5
|
-
class SimplexNoise3D {
|
|
1
|
+
import { shuffleSeed } from "../utils.js";
|
|
2
|
+
export class SimplexNoise3D {
|
|
6
3
|
constructor() {
|
|
7
4
|
this._NORM_3D = 1.0 / 103.0;
|
|
8
5
|
this._SQUISH_3D = (Math.sqrt(3 + 1) - 1) / 3;
|
|
@@ -504,9 +501,9 @@ class SimplexNoise3D {
|
|
|
504
501
|
}
|
|
505
502
|
let seed = new Uint32Array(1);
|
|
506
503
|
seed[0] = clientSeed;
|
|
507
|
-
seed =
|
|
504
|
+
seed = shuffleSeed(shuffleSeed(shuffleSeed(seed)));
|
|
508
505
|
for (let i = 255; i >= 0; i--) {
|
|
509
|
-
seed =
|
|
506
|
+
seed = shuffleSeed(seed);
|
|
510
507
|
const r = new Uint32Array(1);
|
|
511
508
|
r[0] = (seed[0] + 31) % (i + 1);
|
|
512
509
|
if (r[0] < 0) {
|
|
@@ -529,4 +526,3 @@ class SimplexNoise3D {
|
|
|
529
526
|
};
|
|
530
527
|
}
|
|
531
528
|
}
|
|
532
|
-
exports.SimplexNoise3D = SimplexNoise3D;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.SimplexNoise4D = void 0;
|
|
4
|
-
const utils_js_1 = require("../utils.js");
|
|
5
|
-
class SimplexNoise4D {
|
|
1
|
+
import { shuffleSeed } from "../utils.js";
|
|
2
|
+
export class SimplexNoise4D {
|
|
6
3
|
constructor() {
|
|
7
4
|
this._NORM_4D = 1.0 / 30.0;
|
|
8
5
|
this._SQUISH_4D = (Math.sqrt(4 + 1) - 1) * 0.25;
|
|
@@ -2841,9 +2838,9 @@ class SimplexNoise4D {
|
|
|
2841
2838
|
}
|
|
2842
2839
|
let seed = new Uint32Array(1);
|
|
2843
2840
|
seed[0] = clientSeed;
|
|
2844
|
-
seed =
|
|
2841
|
+
seed = shuffleSeed(shuffleSeed(shuffleSeed(seed)));
|
|
2845
2842
|
for (let i = 255; i >= 0; i--) {
|
|
2846
|
-
seed =
|
|
2843
|
+
seed = shuffleSeed(seed);
|
|
2847
2844
|
const r = new Uint32Array(1);
|
|
2848
2845
|
r[0] = (seed[0] + 31) % (i + 1);
|
|
2849
2846
|
if (r[0] < 0) {
|
|
@@ -2868,4 +2865,3 @@ class SimplexNoise4D {
|
|
|
2868
2865
|
};
|
|
2869
2866
|
}
|
|
2870
2867
|
}
|
|
2871
|
-
exports.SimplexNoise4D = SimplexNoise4D;
|
package/cjs/Contributions.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/cjs/SimplexNoise.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const SimplexNoise3D_js_1 = require("./Classes/SimplexNoise3D.js");
|
|
6
|
-
const SimplexNoise4D_js_1 = require("./Classes/SimplexNoise4D.js");
|
|
7
|
-
class SimplexNoise {
|
|
1
|
+
import { SimplexNoise2D } from "./Classes/SimplexNoise2D.js";
|
|
2
|
+
import { SimplexNoise3D } from "./Classes/SimplexNoise3D.js";
|
|
3
|
+
import { SimplexNoise4D } from "./Classes/SimplexNoise4D.js";
|
|
4
|
+
export class SimplexNoise {
|
|
8
5
|
constructor() {
|
|
9
|
-
this.noise2d = new
|
|
10
|
-
this.noise3d = new
|
|
11
|
-
this.noise4d = new
|
|
6
|
+
this.noise2d = new SimplexNoise2D();
|
|
7
|
+
this.noise3d = new SimplexNoise3D();
|
|
8
|
+
this.noise4d = new SimplexNoise4D();
|
|
12
9
|
}
|
|
13
10
|
}
|
|
14
|
-
exports.SimplexNoise = SimplexNoise;
|
package/cjs/index.js
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SimplexNoise = void 0;
|
|
4
|
-
var SimplexNoise_js_1 = require("./SimplexNoise.js");
|
|
5
|
-
Object.defineProperty(exports, "SimplexNoise", { enumerable: true, get: function () { return SimplexNoise_js_1.SimplexNoise; } });
|
|
1
|
+
export { SimplexNoise } from "./SimplexNoise.js";
|
package/cjs/utils.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.shuffleSeed = shuffleSeed;
|
|
4
|
-
function shuffleSeed(seed) {
|
|
1
|
+
export function shuffleSeed(seed) {
|
|
5
2
|
const newSeed = new Uint32Array(1);
|
|
6
3
|
newSeed[0] = seed[0] * 1664525 + 1013904223;
|
|
7
4
|
return newSeed;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/simplex-noise",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.0",
|
|
4
4
|
"description": "tsParticles simplex noise library",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -101,5 +101,6 @@
|
|
|
101
101
|
"default": "./cjs/index.js"
|
|
102
102
|
},
|
|
103
103
|
"./package.json": "./package.json"
|
|
104
|
-
}
|
|
104
|
+
},
|
|
105
|
+
"type": "module"
|
|
105
106
|
}
|