@woosh/meep-engine 2.86.5 → 2.86.7
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/build/meep.cjs +28 -32
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +28 -32
- package/package.json +1 -1
- package/src/engine/ecs/terrain/ecs/Terrain.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/Terrain.js +4 -2
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts.map +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +17 -25
- package/src/engine/graphics/texture/sampler/filter/sampler2d_blur_gaussian.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/filter/sampler2d_blur_gaussian.js +12 -7
- package/src/generation/filtering/numeric/complex/CellFilterGaussianBlur.d.ts.map +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterGaussianBlur.js +21 -8
package/build/meep.cjs
CHANGED
|
@@ -54284,13 +54284,6 @@ Color.black = Object.freeze(new Color(0, 0, 0));
|
|
|
54284
54284
|
*/
|
|
54285
54285
|
Color.transparent = Object.freeze(new Color(0, 0, 0, 0));
|
|
54286
54286
|
|
|
54287
|
-
/**
|
|
54288
|
-
* No-operation function. Does nothing. Useful when a callback is required to avoid checks for a missing function.
|
|
54289
|
-
* @param {*} arguments
|
|
54290
|
-
*/
|
|
54291
|
-
function noop() {
|
|
54292
|
-
}
|
|
54293
|
-
|
|
54294
54287
|
/**
|
|
54295
54288
|
* Returns true if two 1D lines overlap, touch is not considered overlap
|
|
54296
54289
|
* Parameters are assumed to be ordered, a1 > a0, b1 > b0
|
|
@@ -58338,25 +58331,20 @@ class TerrainTileManager {
|
|
|
58338
58331
|
|
|
58339
58332
|
const tiles = this.tiles;
|
|
58340
58333
|
|
|
58341
|
-
const self = this;
|
|
58342
|
-
|
|
58343
|
-
function ensureBuilt(x, y) {
|
|
58344
|
-
return function (resolve) {
|
|
58345
|
-
self.obtain(x, y).then(resolve);
|
|
58346
|
-
}
|
|
58347
|
-
}
|
|
58348
|
-
|
|
58349
58334
|
//populate tiles
|
|
58350
|
-
|
|
58335
|
+
const tile_resolution_y = gridSize.y;
|
|
58336
|
+
const tile_resolution_x = gridSize.x;
|
|
58337
|
+
|
|
58338
|
+
for (let y = 0; y < tile_resolution_y; y++) {
|
|
58351
58339
|
|
|
58352
|
-
const tY = y <
|
|
58340
|
+
const tY = y < tile_resolution_y - 1 ? time_size.y : (total_size.y - time_size.y * y);
|
|
58353
58341
|
|
|
58354
|
-
for (let x = 0; x <
|
|
58342
|
+
for (let x = 0; x < tile_resolution_x; x++) {
|
|
58355
58343
|
|
|
58356
|
-
const tX = x <
|
|
58344
|
+
const tX = x < tile_resolution_x - 1 ? time_size.x : (total_size.x - time_size.x * x);
|
|
58357
58345
|
|
|
58358
58346
|
const tile = new TerrainTile();
|
|
58359
|
-
const index = y *
|
|
58347
|
+
const index = y * tile_resolution_x + x;
|
|
58360
58348
|
tiles[index] = tile;
|
|
58361
58349
|
|
|
58362
58350
|
this.assignTileMaterial(tile);
|
|
@@ -58371,9 +58359,6 @@ class TerrainTileManager {
|
|
|
58371
58359
|
tile.setInitialHeightBounds(this.heightRange.min, this.heightRange.max);
|
|
58372
58360
|
tile.computeBoundingBox();
|
|
58373
58361
|
|
|
58374
|
-
//hook for building
|
|
58375
|
-
tile.ensureBuilt = ensureBuilt(x, y);
|
|
58376
|
-
|
|
58377
58362
|
tile.external_bvh.link(this.bvh, index);
|
|
58378
58363
|
}
|
|
58379
58364
|
}
|
|
@@ -58479,16 +58464,16 @@ class TerrainTileManager {
|
|
|
58479
58464
|
return Promise.resolve(tile);
|
|
58480
58465
|
|
|
58481
58466
|
} else {
|
|
58482
|
-
const promise = new Promise((resolve, reject) => {
|
|
58483
|
-
tile.onBuilt.addOne(resolve);
|
|
58484
|
-
tile.onDestroyed.addOne(reject);
|
|
58485
|
-
});
|
|
58486
58467
|
|
|
58487
58468
|
if (!tile.isBuildInProgress) {
|
|
58488
|
-
this.build(x, y,
|
|
58469
|
+
return new Promise((resolve, reject) => this.build(x, y, resolve, reject));
|
|
58470
|
+
} else {
|
|
58471
|
+
return new Promise((resolve, reject) => {
|
|
58472
|
+
tile.onBuilt.addOne(resolve);
|
|
58473
|
+
tile.onDestroyed.addOne(reject);
|
|
58474
|
+
});
|
|
58489
58475
|
}
|
|
58490
58476
|
|
|
58491
|
-
return promise;
|
|
58492
58477
|
}
|
|
58493
58478
|
|
|
58494
58479
|
}
|
|
@@ -58604,7 +58589,7 @@ class TerrainTileManager {
|
|
|
58604
58589
|
|
|
58605
58590
|
const tile = this.tiles[tile_index];
|
|
58606
58591
|
|
|
58607
|
-
if(!tile.isBuilt){
|
|
58592
|
+
if (!tile.isBuilt) {
|
|
58608
58593
|
continue;
|
|
58609
58594
|
}
|
|
58610
58595
|
|
|
@@ -58701,6 +58686,8 @@ class TerrainTileManager {
|
|
|
58701
58686
|
// console.timeEnd(processName);
|
|
58702
58687
|
|
|
58703
58688
|
this.on.tileBuilt.send1(tile);
|
|
58689
|
+
|
|
58690
|
+
resolve(tile);
|
|
58704
58691
|
}, reject);
|
|
58705
58692
|
}
|
|
58706
58693
|
}
|
|
@@ -63659,6 +63646,13 @@ function array_push_if_unique(array, element) {
|
|
|
63659
63646
|
return false;
|
|
63660
63647
|
}
|
|
63661
63648
|
|
|
63649
|
+
/**
|
|
63650
|
+
* No-operation function. Does nothing. Useful when a callback is required to avoid checks for a missing function.
|
|
63651
|
+
* @param {*} arguments
|
|
63652
|
+
*/
|
|
63653
|
+
function noop() {
|
|
63654
|
+
}
|
|
63655
|
+
|
|
63662
63656
|
/**
|
|
63663
63657
|
* Created by Alex on 25/08/2016.
|
|
63664
63658
|
*/
|
|
@@ -65121,8 +65115,10 @@ class Terrain {
|
|
|
65121
65115
|
const promisedTiles = [];
|
|
65122
65116
|
|
|
65123
65117
|
tiles.traverse(function (tile) {
|
|
65124
|
-
const
|
|
65125
|
-
|
|
65118
|
+
const position = tile.gridPosition;
|
|
65119
|
+
|
|
65120
|
+
const x = position.x;
|
|
65121
|
+
const y = position.y;
|
|
65126
65122
|
|
|
65127
65123
|
const tilePromise = tiles.obtain(x, y);
|
|
65128
65124
|
|