@woosh/meep-engine 2.93.3 → 2.94.1
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/bundle-worker-terrain.js +1 -1
- package/build/meep.cjs +336 -269
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +336 -269
- package/package.json +1 -1
- package/src/core/bvh2/bvh3/BVH.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/BVH.js +4 -2
- package/src/core/bvh2/bvh3/build_triangle_morton_codes.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/build_triangle_morton_codes.js +2 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js +12 -1
- package/src/core/bvh2/bvh3/ebvh_build_hierarchy.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_hierarchy.js +11 -1
- package/src/core/bvh2/bvh3/ebvh_geometry_query_nearest_triangle_ray.d.ts +14 -0
- package/src/core/bvh2/bvh3/ebvh_geometry_query_nearest_triangle_ray.d.ts.map +1 -0
- package/src/core/bvh2/bvh3/ebvh_geometry_query_nearest_triangle_ray.js +146 -0
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray.d.ts +16 -0
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray.d.ts.map +1 -0
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray.js +90 -0
- package/src/core/collection/heap/Uint32Heap.d.ts.map +1 -1
- package/src/core/collection/heap/Uint32Heap.js +22 -17
- package/src/core/color/Color.d.ts.map +1 -1
- package/src/core/color/Color.js +17 -7
- package/src/core/geom/2d/bvh/BVH2D.d.ts.map +1 -1
- package/src/core/geom/2d/bvh/BVH2D.js +24 -29
- package/src/core/geom/2d/bvh/BVH2D.spec.js +10 -9
- package/src/core/geom/2d/bvh/bvh2d_query_all_data_by_circle.spec.d.ts +2 -0
- package/src/core/geom/2d/bvh/bvh2d_query_all_data_by_circle.spec.d.ts.map +1 -0
- package/src/core/geom/2d/bvh/bvh2d_query_all_data_by_circle.spec.js +89 -0
- package/src/core/geom/2d/quad-tree/QuadTreeNode.spec.js +1 -1
- package/src/core/geom/3d/aabb/AABB3.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/AABB3.js +8 -1
- package/src/core/geom/3d/aabb/aabb3_array_combine.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_array_combine.js +5 -0
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentric.js +2 -0
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricEdge.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricEdge.js +9 -1
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricGeometry.d.ts +16 -0
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricGeometry.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricGeometry.js +55 -0
- package/src/core/math/build_gaussian_kernel_1d.d.ts +8 -0
- package/src/core/math/build_gaussian_kernel_1d.d.ts.map +1 -0
- package/src/core/math/build_gaussian_kernel_1d.js +26 -0
- package/src/core/math/build_gaussian_kernel_2d.d.ts +10 -0
- package/src/core/math/build_gaussian_kernel_2d.d.ts.map +1 -0
- package/src/core/math/build_gaussian_kernel_2d.js +55 -0
- package/src/core/math/nextOdd.d.ts +8 -0
- package/src/core/math/nextOdd.d.ts.map +1 -0
- package/src/core/math/nextOdd.js +15 -0
- package/src/core/math/nextOdd.spec.d.ts +2 -0
- package/src/core/math/nextOdd.spec.d.ts.map +1 -0
- package/src/core/math/nextOdd.spec.js +9 -0
- package/src/engine/animation/curve/prototypeGLTF.js +4 -1
- package/src/engine/graphics/ecs/light/binding/LightBinding.d.ts +2 -0
- package/src/engine/graphics/ecs/light/binding/LightBinding.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/binding/LightBinding.js +16 -0
- package/src/engine/graphics/ecs/light/binding/fp/FPLightBinding.d.ts +13 -2
- package/src/engine/graphics/ecs/light/binding/fp/FPLightBinding.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/binding/fp/FPLightBinding.js +37 -4
- package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/binding/three/ThreeLightBinding.js +12 -8
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +1 -1
- package/src/engine/graphics/sh3/path_tracer/GeometryBVHBatched.d.ts +0 -9
- package/src/engine/graphics/sh3/path_tracer/GeometryBVHBatched.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/GeometryBVHBatched.js +100 -129
- package/src/engine/graphics/sh3/path_tracer/PathTracer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracer.js +6 -4
- package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +11 -4
- package/src/engine/graphics/sh3/path_tracer/sample_triangle_attribute.d.ts +2 -2
- package/src/engine/graphics/sh3/path_tracer/sample_triangle_attribute.js +2 -2
- package/src/engine/graphics/texture/sampler/Sampler2D.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +6 -4
- package/src/engine/graphics/texture/sampler/convertSampler2D2DataURL.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/convertSampler2D2DataURL.js +1 -2
- package/src/engine/graphics/texture/sampler/downloadSamplerAsPNG.d.ts +2 -2
- package/src/engine/graphics/texture/sampler/downloadSamplerAsPNG.d.ts.map +1 -1
- package/src/engine/graphics/texture/sampler/downloadSamplerAsPNG.js +3 -3
- 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 +5 -31
- package/src/engine/graphics/texture/virtual/VirtualTextureMaterial.d.ts +3 -6
- package/src/engine/graphics/texture/virtual/VirtualTextureMaterial.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureMaterial.js +8 -27
- package/src/engine/graphics/texture/virtual/VirtualTextureMemoryMapping.d.ts +4 -0
- package/src/engine/graphics/texture/virtual/VirtualTextureMemoryMapping.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureMemoryMapping.js +12 -0
- package/src/engine/graphics/texture/virtual/VirtualTextureSystem.d.ts +29 -0
- package/src/engine/graphics/texture/virtual/VirtualTextureSystem.d.ts.map +1 -0
- package/src/engine/graphics/texture/virtual/VirtualTextureSystem.js +102 -0
- package/src/engine/graphics/texture/virtual/VirtualTextureUsageUpdater.js +1 -1
- package/src/engine/graphics/texture/virtual/prototype.js +221 -79
- package/src/engine/navigation/grid/find_path_on_grid_astar.d.ts.map +1 -1
- package/src/engine/navigation/grid/find_path_on_grid_astar.js +18 -19
- package/src/engine/navigation/grid/find_path_on_grid_astar.spec.js +2 -2
- package/src/engine/ui/GUIEngine.js +1 -1
- package/src/generation/filtering/numeric/CellFilterCache.d.ts.map +1 -1
- package/src/generation/filtering/numeric/CellFilterCache.js +7 -7
- package/src/generation/filtering/numeric/complex/CellFilterFXAA.d.ts.map +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterFXAA.js +9 -6
- package/src/generation/filtering/numeric/complex/CellFilterGaussianBlur.d.ts +1 -13
- package/src/generation/filtering/numeric/complex/CellFilterGaussianBlur.d.ts.map +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterGaussianBlur.js +39 -111
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +6 -5
- package/src/generation/grid/generation/util/buildDistanceMapToObjective.d.ts +1 -1
- package/src/generation/grid/generation/util/buildDistanceMapToObjective.d.ts.map +1 -1
- package/src/generation/grid/generation/util/buildDistanceMapToObjective.js +5 -12
- package/src/core/math/makeNextOdd.d.ts +0 -8
- package/src/core/math/makeNextOdd.d.ts.map +0 -1
- package/src/core/math/makeNextOdd.js +0 -15
|
@@ -1,118 +1,45 @@
|
|
|
1
1
|
import { assert } from "../../../../core/assert.js";
|
|
2
|
-
import {
|
|
3
|
-
import { makeNextOdd } from "../../../../core/math/makeNextOdd.js";
|
|
2
|
+
import { build_gaussian_kernel_2d } from "../../../../core/math/build_gaussian_kernel_2d.js";
|
|
4
3
|
import { max2 } from "../../../../core/math/max2.js";
|
|
4
|
+
import { nextOdd } from "../../../../core/math/nextOdd.js";
|
|
5
5
|
import { CellFilter } from "../../CellFilter.js";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* @param {number} samplesX
|
|
11
|
-
* @param {number} samplesY
|
|
12
|
-
* @param {number} sigma_x
|
|
13
|
-
* @param {number} sigma_y
|
|
14
|
-
* @return {number}
|
|
15
|
-
*/
|
|
16
|
-
function buildKernel(
|
|
17
|
-
result,
|
|
18
|
-
samplesX, samplesY,
|
|
19
|
-
sigma_x, sigma_y
|
|
20
|
-
) {
|
|
21
|
-
assert.isNonNegativeInteger(samplesX, 'samplesX');
|
|
22
|
-
assert.isNonNegativeInteger(samplesY, 'samplesY');
|
|
23
|
-
|
|
24
|
-
const half_samples_x = (samplesX - 1) * 0.5;
|
|
25
|
-
const half_samples_y = (samplesY - 1) * 0.5;
|
|
26
|
-
|
|
27
|
-
let powerTotal = 0;
|
|
28
|
-
let ix, iy;
|
|
29
|
-
|
|
30
|
-
const i_samples_x = samplesX | 0;
|
|
31
|
-
|
|
32
|
-
for (iy = 0; iy < samplesY; iy++) {
|
|
33
|
-
const local_y = iy - half_samples_y;
|
|
34
|
-
|
|
35
|
-
const fy = gaussian(sigma_y, local_y);
|
|
36
|
-
|
|
37
|
-
for (ix = 0; ix < samplesX; ix++) {
|
|
38
|
-
|
|
39
|
-
const local_x = ix - half_samples_x;
|
|
40
|
-
|
|
41
|
-
const fx = gaussian(sigma_x, local_x);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const power = fx * fy;
|
|
7
|
+
export class CellFilterGaussianBlur extends CellFilter {
|
|
8
|
+
samples_x = 5;
|
|
9
|
+
samples_y = 5;
|
|
45
10
|
|
|
46
|
-
|
|
11
|
+
sigma_x = 10;
|
|
12
|
+
sigma_y = 10;
|
|
47
13
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @type {CellFilter}
|
|
17
|
+
*/
|
|
18
|
+
source = null;
|
|
51
19
|
|
|
52
|
-
|
|
20
|
+
size_x = 1;
|
|
21
|
+
size_y = 1;
|
|
53
22
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @type {Float32Array}
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
28
|
+
__kernel = new Float32Array(0);
|
|
58
29
|
|
|
59
|
-
|
|
60
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Written by 'initialize' stage
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
__local_u_scale = 0;
|
|
61
36
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
this.sigma_x = 10;
|
|
70
|
-
this.sigma_y = 10;
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
*
|
|
74
|
-
* @type {CellFilter}
|
|
75
|
-
*/
|
|
76
|
-
this.source = null;
|
|
77
|
-
|
|
78
|
-
this.size_x = 1;
|
|
79
|
-
this.size_y = 1;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
*
|
|
83
|
-
* @type {number[]|ArrayLike<number>}
|
|
84
|
-
* @private
|
|
85
|
-
*/
|
|
86
|
-
this.__kernel = [];
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
90
|
-
* @type {number}
|
|
91
|
-
* @private
|
|
92
|
-
*/
|
|
93
|
-
this.__kernel_total_power = 0;
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
*
|
|
97
|
-
* @type {number}
|
|
98
|
-
* @private
|
|
99
|
-
*/
|
|
100
|
-
this.__inv_kernel_total_power = 0;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Written by 'initialize' stage
|
|
104
|
-
* @type {number}
|
|
105
|
-
* @private
|
|
106
|
-
*/
|
|
107
|
-
this.__local_u_scale = 0;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Written by 'initialize' stage
|
|
111
|
-
* @type {number}
|
|
112
|
-
* @private
|
|
113
|
-
*/
|
|
114
|
-
this.__local_v_scale = 0;
|
|
115
|
-
}
|
|
37
|
+
/**
|
|
38
|
+
* Written by 'initialize' stage
|
|
39
|
+
* @type {number}
|
|
40
|
+
* @private
|
|
41
|
+
*/
|
|
42
|
+
__local_v_scale = 0;
|
|
116
43
|
|
|
117
44
|
initialize(grid, seed) {
|
|
118
45
|
if (this.initialized) {
|
|
@@ -123,10 +50,13 @@ export class CellFilterGaussianBlur extends CellFilter {
|
|
|
123
50
|
this.source.initialize(grid, seed);
|
|
124
51
|
}
|
|
125
52
|
|
|
53
|
+
assert.isNonNegativeInteger(this.samples_x, 'samples_x');
|
|
54
|
+
assert.isNonNegativeInteger(this.samples_y, 'samples_y');
|
|
55
|
+
|
|
126
56
|
this.__kernel = new Float32Array(this.samples_x * this.samples_y);
|
|
127
57
|
|
|
128
58
|
// initialize kernel
|
|
129
|
-
|
|
59
|
+
build_gaussian_kernel_2d(this.__kernel, this.samples_x, this.samples_y, this.sigma_x, this.sigma_y);
|
|
130
60
|
|
|
131
61
|
|
|
132
62
|
// precompute scaling for the sampling(execute) stage
|
|
@@ -150,8 +80,8 @@ export class CellFilterGaussianBlur extends CellFilter {
|
|
|
150
80
|
|
|
151
81
|
r.source = source;
|
|
152
82
|
|
|
153
|
-
r.samples_x = max2(3,
|
|
154
|
-
r.samples_y = max2(3,
|
|
83
|
+
r.samples_x = max2(3, nextOdd(Math.round(quality * x)));
|
|
84
|
+
r.samples_y = max2(3, nextOdd(Math.round(quality * y)));
|
|
155
85
|
|
|
156
86
|
r.size_x = x;
|
|
157
87
|
r.size_y = y;
|
|
@@ -181,14 +111,12 @@ export class CellFilterGaussianBlur extends CellFilter {
|
|
|
181
111
|
const source = this.source;
|
|
182
112
|
const kernel = this.__kernel;
|
|
183
113
|
|
|
184
|
-
const i_samples_x = samplesX | 0;
|
|
185
|
-
|
|
186
114
|
for (; iy < samplesY; iy++) {
|
|
187
115
|
const local_y = iy - half_samples_y;
|
|
188
116
|
|
|
189
117
|
const sample_y = y + local_y * local_v_scale;
|
|
190
118
|
|
|
191
|
-
const row_address = iy *
|
|
119
|
+
const row_address = iy * samplesX;
|
|
192
120
|
|
|
193
121
|
for (ix = 0; ix < samplesX; ix++) {
|
|
194
122
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskConnectRooms.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/discrete/GridTaskConnectRooms.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GridTaskConnectRooms.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/discrete/GridTaskConnectRooms.js"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH;IAuDI;;;;;;;OAOG;IACH;;;;;QAFa,oBAAoB,CAiBhC;IA1EG;;;OAGG;IACH,qBAAmB;IAEnB;;;OAGG;IACH,wBAAwC;IAExC;;;OAGG;IACH,yBAFU,MAAM,EAAE,CASjB;IAED;;;OAGG;IACH,uBAFU,MAAM,EAAE,CAajB;IAED,kBAAkB;IAElB;;;OAGG;IACH,uBAAkB;IA4BtB;;;;;OAKG;IACH,sCAHW,OAAO,GACL,IAAI,CAqChB;IAED;;;;;;OAMG;IACH,qBALW,MAAM,KACN,MAAM,6BAEN,MAAM,QA8DhB;IAED;;;;;;;OAOG;IACH,mCANW,OAAO,aACP,WAAW,6BAEX,MAAM,GACJ,OAAO,CAwFnB;IAED;;;;;;;;OAQG;IACH,gBAPW,MAAM,KACN,MAAM,aACN,MAAM,6BAEN,WAAW,aACX,MAAM,QAuEhB;IAED;;;;;;;OAOG;IACH,mCALW,MAAM,EAAE,aACR,MAAM,aACN,MAAM,EAAE,GACN,SAAS,CAyBrB;IAED;;;;;;;OAOG;IACH,0BANW,MAAM,0BAEN,MAAM,EAAE,aACR,MAAM,aACN,MAAM,EAAE,QAWlB;IAED,iDAuEC;CACJ;kCA1fiC,4BAA4B;oBAT1C,kCAAkC;iBAErC,uCAAuC;uBANjC,mCAAmC;0BAUhC,0DAA0D;sBAH9D,4CAA4C"}
|
|
@@ -2,6 +2,7 @@ import { matcher_tag_unoccupied } from "../../../../../samples/generation/rules/
|
|
|
2
2
|
import { assert } from "../../../../core/assert.js";
|
|
3
3
|
import { BitSet } from "../../../../core/binary/BitSet.js";
|
|
4
4
|
import BinaryHeap from "../../../../core/collection/heap/FastBinaryHeap.js";
|
|
5
|
+
import { Uint32Heap } from "../../../../core/collection/heap/Uint32Heap.js";
|
|
5
6
|
import { passThrough } from "../../../../core/function/passThrough.js";
|
|
6
7
|
import Vector2 from "../../../../core/geom/Vector2.js";
|
|
7
8
|
import { min2 } from "../../../../core/math/min2.js";
|
|
@@ -237,7 +238,9 @@ export class GridTaskConnectRooms extends GridTaskGenerator {
|
|
|
237
238
|
|
|
238
239
|
distances.fill(65535);
|
|
239
240
|
|
|
240
|
-
const open = new BinaryHeap(i => distances[i]);
|
|
241
|
+
// const open = new BinaryHeap(i => distances[i]);
|
|
242
|
+
|
|
243
|
+
const open = new Uint32Heap();
|
|
241
244
|
|
|
242
245
|
const closed = new BitSet();
|
|
243
246
|
|
|
@@ -291,7 +294,7 @@ export class GridTaskConnectRooms extends GridTaskGenerator {
|
|
|
291
294
|
const isInOpen = open.contains(neighbour_index);
|
|
292
295
|
|
|
293
296
|
if (!isInOpen) {
|
|
294
|
-
open.
|
|
297
|
+
open.insert(neighbour_index, 1);
|
|
295
298
|
|
|
296
299
|
distances[neighbour_index] = 1;
|
|
297
300
|
}
|
|
@@ -419,9 +422,7 @@ export class GridTaskConnectRooms extends GridTaskGenerator {
|
|
|
419
422
|
for (let i = 0; i < gridSize; i++) {
|
|
420
423
|
const distance = distances[i];
|
|
421
424
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
result.data[i * result.itemSize + 2] = v;
|
|
425
|
+
result.data[i * result.itemSize + 2] = min2(distance * 10, 255);
|
|
425
426
|
}
|
|
426
427
|
|
|
427
428
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildDistanceMapToObjective.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/util/buildDistanceMapToObjective.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,4IAFa,OAAO,
|
|
1
|
+
{"version":3,"file":"buildDistanceMapToObjective.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/util/buildDistanceMapToObjective.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,4IAFa,OAAO,CA4FnB"}
|
|
@@ -3,7 +3,7 @@ import { assert } from "../../../../core/assert.js";
|
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
5
5
|
* @param {Vector2} result
|
|
6
|
-
* @param {
|
|
6
|
+
* @param {Uint32Heap} open
|
|
7
7
|
* @param {BitSet} closed
|
|
8
8
|
* @param {number[]} distances
|
|
9
9
|
* @param {GridData} grid
|
|
@@ -42,9 +42,9 @@ export function buildDistanceMapToObjective(
|
|
|
42
42
|
|
|
43
43
|
const neighbourhoodMaskSize = neighbourhoodMask.length;
|
|
44
44
|
|
|
45
|
-
while (open.
|
|
45
|
+
while (!open.is_empty()) {
|
|
46
46
|
|
|
47
|
-
const current = open.
|
|
47
|
+
const current = open.pop_min();
|
|
48
48
|
|
|
49
49
|
closed.set(current, true);
|
|
50
50
|
|
|
@@ -84,18 +84,11 @@ export function buildDistanceMapToObjective(
|
|
|
84
84
|
|
|
85
85
|
const distance = distances[current] + 1;
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
if (distance < distances[neighbour_index]) {
|
|
88
88
|
|
|
89
|
-
if (!isInOpen) {
|
|
90
|
-
|
|
91
|
-
open.push(neighbour_index);
|
|
92
89
|
distances[neighbour_index] = distance;
|
|
93
90
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
distances[neighbour_index] = distances;
|
|
97
|
-
open.updateElementScore(neighbour_index);
|
|
98
|
-
|
|
91
|
+
open.insert_or_update(neighbour_index, distance)
|
|
99
92
|
}
|
|
100
93
|
|
|
101
94
|
if (isMatch) {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"makeNextOdd.d.ts","sourceRoot":"","sources":["../../../../src/core/math/makeNextOdd.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,+BAHW,MAAM,GACL,MAAM,CAUjB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* even number of samples, make odd to ensure we sample reference point
|
|
4
|
-
* @param {number} x
|
|
5
|
-
* @return {number}
|
|
6
|
-
*/
|
|
7
|
-
export function makeNextOdd(x) {
|
|
8
|
-
if (x % 2 === 0) {
|
|
9
|
-
// even, make odd
|
|
10
|
-
return x + 1;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// already odd
|
|
14
|
-
return x;
|
|
15
|
-
}
|