@woosh/meep-engine 2.109.23 → 2.109.25
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 +231 -104
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +231 -104
- package/package.json +1 -1
- package/src/core/collection/heap/FastBinaryHeap.d.ts +17 -10
- package/src/core/collection/heap/FastBinaryHeap.d.ts.map +1 -1
- package/src/core/collection/heap/FastBinaryHeap.js +33 -23
- package/src/core/collection/heap/FastBinaryHeap.spec.js +10 -10
- package/src/core/collection/table/RowFirstTable.d.ts +10 -7
- package/src/core/collection/table/RowFirstTable.d.ts.map +1 -1
- package/src/core/collection/table/RowFirstTable.js +23 -6
- package/src/core/collection/table/bind/TableRecord.d.ts.map +1 -1
- package/src/core/collection/table/bind/TableRecord.js +4 -0
- package/src/core/geom/3d/normal/octahedron/encode_unit_to_octahedron.js +2 -2
- package/src/core/geom/packing/max-rect/MaxRectanglesPacker.js +2 -2
- package/src/core/model/validate_enum_schema.d.ts +10 -0
- package/src/core/model/validate_enum_schema.d.ts.map +1 -0
- package/src/core/model/validate_enum_schema.js +31 -0
- package/src/engine/animation/async/TimeSeries.d.ts +76 -0
- package/src/engine/animation/async/TimeSeries.d.ts.map +1 -0
- package/src/engine/animation/async/TimeSeries.js +289 -0
- package/src/engine/animation/async/prototypeAsyncAnimation.js +31 -83
- package/src/engine/animation/async/table_find_min_index_in_ordered_column.d.ts +9 -0
- package/src/engine/animation/async/table_find_min_index_in_ordered_column.d.ts.map +1 -0
- package/src/engine/animation/async/table_find_min_index_in_ordered_column.js +32 -0
- package/src/engine/asset/AssetManager.js +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +14 -11
- package/src/engine/graphics/particles/particular/engine/emitter/ParticlePool.js +1 -1
- package/src/engine/graphics/sh3/gi/material/common.glsl +1 -1
- package/src/engine/graphics/sh3/lpv/LightProbeVolume.js +1 -1
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map.d.ts.map +1 -1
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map.js +5 -0
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +2 -2
- package/src/engine/input/devices/InputDeviceSwitch.d.ts.map +1 -1
- package/src/engine/input/devices/InputDeviceSwitch.js +18 -0
- package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
- package/src/engine/input/devices/KeyboardDevice.js +4 -41
- package/src/engine/input/devices/LocationalInteractionMetadata.d.ts +11 -0
- package/src/engine/input/devices/LocationalInteractionMetadata.d.ts.map +1 -0
- package/src/engine/input/devices/LocationalInteractionMetadata.js +18 -0
- package/src/engine/input/devices/PointerDevice.d.ts.map +1 -1
- package/src/engine/input/devices/PointerDevice.js +90 -37
- package/src/engine/input/devices/eventToSourceIdentifier.d.ts +7 -0
- package/src/engine/input/devices/eventToSourceIdentifier.d.ts.map +1 -0
- package/src/engine/input/devices/eventToSourceIdentifier.js +36 -0
- package/src/engine/input/devices/isHTMLElementFocusable.d.ts +6 -0
- package/src/engine/input/devices/isHTMLElementFocusable.d.ts.map +1 -0
- package/src/engine/input/devices/isHTMLElementFocusable.js +34 -0
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +3 -3
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js +5 -5
- package/src/generation/grid/generation/discrete/layer/GridTaskDistanceToMarkers.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/layer/GridTaskDistanceToMarkers.js +3 -3
- package/src/generation/grid/generation/road/GridTaskGenerateRoads.js +2 -2
|
@@ -5,7 +5,9 @@ import Vector3 from "../../../core/geom/Vector3.js";
|
|
|
5
5
|
import { sign } from "../../../core/math/sign.js";
|
|
6
6
|
import { MouseEvents } from "./events/MouseEvents.js";
|
|
7
7
|
import { TouchEvents } from "./events/TouchEvents.js";
|
|
8
|
+
import { eventToSourceIdentifier } from "./eventToSourceIdentifier.js";
|
|
8
9
|
import { InputDeviceSwitch } from "./InputDeviceSwitch.js";
|
|
10
|
+
import { LocationalInteractionMetadata } from "./LocationalInteractionMetadata.js";
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons
|
|
@@ -84,6 +86,7 @@ function getTouchCenter(touchList, result) {
|
|
|
84
86
|
|
|
85
87
|
}
|
|
86
88
|
|
|
89
|
+
|
|
87
90
|
/**
|
|
88
91
|
*
|
|
89
92
|
* @param {Signal} up
|
|
@@ -92,13 +95,51 @@ function getTouchCenter(touchList, result) {
|
|
|
92
95
|
* @param {number} maxDistance
|
|
93
96
|
* @param {Signal} signal
|
|
94
97
|
*/
|
|
95
|
-
function observeTap(
|
|
98
|
+
function observeTap(
|
|
99
|
+
up,
|
|
100
|
+
down,
|
|
101
|
+
move,
|
|
102
|
+
maxDistance,
|
|
103
|
+
signal
|
|
104
|
+
) {
|
|
96
105
|
|
|
97
|
-
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
* @type {Map<number, LocationalInteractionMetadata>}
|
|
109
|
+
*/
|
|
110
|
+
const active = new Map();
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
*
|
|
114
|
+
* @param {number} id
|
|
115
|
+
*/
|
|
116
|
+
function reset(id) {
|
|
117
|
+
assert.isNonNegativeInteger(id, 'id');
|
|
98
118
|
|
|
119
|
+
if (active.delete(id)) {
|
|
120
|
+
up.remove(handleUp);
|
|
121
|
+
move.remove(handleMove);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
*
|
|
127
|
+
* @param {Vector2} position
|
|
128
|
+
* @param {MouseEvent|TouchEvent} event
|
|
129
|
+
*/
|
|
99
130
|
function handleUp(position, event) {
|
|
100
|
-
|
|
101
|
-
|
|
131
|
+
const id = eventToSourceIdentifier(event);
|
|
132
|
+
|
|
133
|
+
const meta = active.get(id);
|
|
134
|
+
|
|
135
|
+
if (meta === undefined) {
|
|
136
|
+
// this should not happen
|
|
137
|
+
console.warn(`Unregistered up event handler`);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
reset(id);
|
|
142
|
+
|
|
102
143
|
signal.send2(position, event);
|
|
103
144
|
}
|
|
104
145
|
|
|
@@ -108,20 +149,43 @@ function observeTap(up, down, move, maxDistance, signal) {
|
|
|
108
149
|
* @param {MouseEvent|TouchEvent} event
|
|
109
150
|
*/
|
|
110
151
|
function handleMove(position, event) {
|
|
111
|
-
|
|
112
|
-
//we moved too far, abort tap
|
|
113
|
-
move.remove(handleMove);
|
|
152
|
+
const id = eventToSourceIdentifier(event);
|
|
114
153
|
|
|
115
|
-
|
|
154
|
+
const meta = active.get(id);
|
|
155
|
+
|
|
156
|
+
if (meta === undefined) {
|
|
157
|
+
// this should not happen
|
|
158
|
+
console.warn(`Unregistered move event handler`);
|
|
159
|
+
|
|
160
|
+
reset(id);
|
|
161
|
+
|
|
162
|
+
return;
|
|
116
163
|
}
|
|
164
|
+
|
|
165
|
+
if (meta.position.distanceTo(position) > maxDistance) {
|
|
166
|
+
//we moved too far, abort tap
|
|
167
|
+
reset(id);
|
|
168
|
+
}
|
|
169
|
+
|
|
117
170
|
}
|
|
118
171
|
|
|
119
|
-
|
|
172
|
+
/**
|
|
173
|
+
*
|
|
174
|
+
* @param {Vector2} position
|
|
175
|
+
* @param {TouchEvent|MouseEvent} event
|
|
176
|
+
*/
|
|
177
|
+
function handleDown(position, event) {
|
|
178
|
+
const id = eventToSourceIdentifier(event);
|
|
179
|
+
|
|
180
|
+
// make sure to cancel previous pending resolution
|
|
181
|
+
reset(id);
|
|
182
|
+
|
|
183
|
+
active.set(id, LocationalInteractionMetadata.from(position));
|
|
184
|
+
|
|
120
185
|
up.addOne(handleUp);
|
|
186
|
+
|
|
121
187
|
//track move
|
|
122
188
|
move.add(handleMove);
|
|
123
|
-
|
|
124
|
-
origin.copy(position);
|
|
125
189
|
}
|
|
126
190
|
|
|
127
191
|
down.add(handleDown);
|
|
@@ -433,17 +497,11 @@ export class PointerDevice {
|
|
|
433
497
|
this.#domElement = domElement;
|
|
434
498
|
|
|
435
499
|
|
|
436
|
-
this.#touchStart.add(
|
|
437
|
-
this.on.down.send3(param0, param1, param2);
|
|
438
|
-
});
|
|
500
|
+
this.#touchStart.add(this.on.down.send3, this.on.down);
|
|
439
501
|
|
|
440
|
-
this.#touchEnd.add(
|
|
441
|
-
this.on.up.send3(param0, param1, param2);
|
|
442
|
-
});
|
|
443
|
-
this.#touchMove.add((param0, param1, param2) => {
|
|
444
|
-
this.on.move.send3(param0, param1, param2);
|
|
445
|
-
});
|
|
502
|
+
this.#touchEnd.add(this.on.up.send3, this.on.up);
|
|
446
503
|
|
|
504
|
+
this.#touchMove.add(this.on.move.send3, this.on.move);
|
|
447
505
|
|
|
448
506
|
//constructed events
|
|
449
507
|
observeTap(this.on.up, this.on.down, this.on.move, 10, this.on.tap);
|
|
@@ -459,6 +517,16 @@ export class PointerDevice {
|
|
|
459
517
|
});
|
|
460
518
|
}
|
|
461
519
|
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
*
|
|
523
|
+
* @param {TouchEvent} event
|
|
524
|
+
*/
|
|
525
|
+
#eventHandlerGlobalTouchEnd = (event) => {
|
|
526
|
+
getTouchCenter(event.touches, this.position);
|
|
527
|
+
this.#globalUp.send2(this.position, event);
|
|
528
|
+
}
|
|
529
|
+
|
|
462
530
|
/**
|
|
463
531
|
*
|
|
464
532
|
* @param {MouseEvent} event
|
|
@@ -472,19 +540,7 @@ export class PointerDevice {
|
|
|
472
540
|
|
|
473
541
|
const button = this.buttons[button_index];
|
|
474
542
|
|
|
475
|
-
|
|
476
|
-
button.is_down = true;
|
|
477
|
-
button.down.send0();
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
*
|
|
483
|
-
* @param {TouchEvent} event
|
|
484
|
-
*/
|
|
485
|
-
#eventHandlerGlobalTouchEnd = (event) => {
|
|
486
|
-
getTouchCenter(event.touches, this.position);
|
|
487
|
-
this.#globalUp.send2(this.position, event);
|
|
543
|
+
button?.press();
|
|
488
544
|
}
|
|
489
545
|
|
|
490
546
|
/**
|
|
@@ -509,10 +565,7 @@ export class PointerDevice {
|
|
|
509
565
|
|
|
510
566
|
const button = this.buttons[button_index];
|
|
511
567
|
|
|
512
|
-
|
|
513
|
-
button.is_down = false;
|
|
514
|
-
button.up.send0();
|
|
515
|
-
}
|
|
568
|
+
button?.release();
|
|
516
569
|
}
|
|
517
570
|
|
|
518
571
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eventToSourceIdentifier.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/eventToSourceIdentifier.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,+CAHW,UAAU,GAAC,UAAU,GACnB,MAAM,CAgClB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {TouchEvent|MouseEvent} event
|
|
4
|
+
* @returns {number}
|
|
5
|
+
*/
|
|
6
|
+
export function eventToSourceIdentifier(event) {
|
|
7
|
+
let device_id = 0;
|
|
8
|
+
let source_id = 0;
|
|
9
|
+
|
|
10
|
+
if (event instanceof MouseEvent) {
|
|
11
|
+
|
|
12
|
+
// mouse
|
|
13
|
+
|
|
14
|
+
device_id = 1;
|
|
15
|
+
source_id = event.button;
|
|
16
|
+
|
|
17
|
+
} else if (event instanceof TouchEvent) {
|
|
18
|
+
|
|
19
|
+
// touch
|
|
20
|
+
|
|
21
|
+
device_id = 2;
|
|
22
|
+
const touches = event.changedTouches;
|
|
23
|
+
const num_changes = touches.length;
|
|
24
|
+
|
|
25
|
+
if (num_changes > 0) {
|
|
26
|
+
const touch = touches.item(0);
|
|
27
|
+
|
|
28
|
+
source_id = touch.identifier;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return ((device_id & 0b11) << 29)
|
|
34
|
+
| (source_id & 0b11111111111111111111111111111)
|
|
35
|
+
;
|
|
36
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Based on the article about focusable events: https://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus
|
|
3
|
+
* @param {Element} el
|
|
4
|
+
*/
|
|
5
|
+
export function isHTMLElementFocusable(el: Element): boolean;
|
|
6
|
+
//# sourceMappingURL=isHTMLElementFocusable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isHTMLElementFocusable.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/isHTMLElementFocusable.js"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,2CAFW,OAAO,WASjB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param thing
|
|
4
|
+
* @param klass
|
|
5
|
+
* @returns {boolean}
|
|
6
|
+
*/
|
|
7
|
+
function isInstanceOf(thing, klass) {
|
|
8
|
+
if (klass === undefined) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
if (klass === null) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (typeof klass !== "object") {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
return thing instanceof klass;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Based on the article about focusable events: https://stackoverflow.com/questions/1599660/which-html-elements-can-receive-focus
|
|
25
|
+
* @param {Element} el
|
|
26
|
+
*/
|
|
27
|
+
export function isHTMLElementFocusable(el) {
|
|
28
|
+
return isInstanceOf(el, HTMLInputElement)
|
|
29
|
+
|| isInstanceOf(el, HTMLSelectElement)
|
|
30
|
+
|| isInstanceOf(el, HTMLTextAreaElement)
|
|
31
|
+
|| isInstanceOf(el, HTMLAnchorElement)
|
|
32
|
+
|| isInstanceOf(el, HTMLButtonElement)
|
|
33
|
+
|| isInstanceOf(el, HTMLAreaElement)
|
|
34
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { matcher_tag_unoccupied } from "../../../../../samples/generation/rules/matcher_tag_unoccupied.js";
|
|
2
2
|
import { assert } from "../../../../core/assert.js";
|
|
3
3
|
import { BitSet } from "../../../../core/binary/BitSet.js";
|
|
4
|
-
import
|
|
4
|
+
import FastBinaryHeap from "../../../../core/collection/heap/FastBinaryHeap.js";
|
|
5
5
|
import { Uint32Heap } from "../../../../core/collection/heap/Uint32Heap.js";
|
|
6
6
|
import { passThrough } from "../../../../core/function/passThrough.js";
|
|
7
7
|
import Vector2 from "../../../../core/geom/Vector2.js";
|
|
@@ -158,7 +158,7 @@ export class GridTaskConnectRooms extends GridTaskGenerator {
|
|
|
158
158
|
* @param {BitSet} connected
|
|
159
159
|
*/
|
|
160
160
|
fillConnectedArea(x, y, grid, connected) {
|
|
161
|
-
const open = new
|
|
161
|
+
const open = new FastBinaryHeap(passThrough);
|
|
162
162
|
|
|
163
163
|
const width = grid.width;
|
|
164
164
|
const initialIndex = x + y * width;
|
|
@@ -238,7 +238,7 @@ export class GridTaskConnectRooms extends GridTaskGenerator {
|
|
|
238
238
|
|
|
239
239
|
distances.fill(65535);
|
|
240
240
|
|
|
241
|
-
// const open = new
|
|
241
|
+
// const open = new FastBinaryHeap(i => distances[i]);
|
|
242
242
|
|
|
243
243
|
const open = new Uint32Heap();
|
|
244
244
|
|
package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskBuildSourceDistanceMap.d.ts","sourceRoot":"","sources":["../../../../../../../src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js"],"names":[],"mappings":"AAUA;;GAEG;AACH;IA6BI;;;;;;;OAOG;IACH;;;;;;uCAgBC;IAjDG;;;OAGG;IACH,2BAAyB;IAEzB;;;OAGG;IACH,yBAAuB;IAEvB;;;OAGG;IACH,cAAiB;IAEjB;;;OAGG;IACH,SAFU,MAAM,CAEI;IA6BxB,iDA8IC;CACJ;
|
|
1
|
+
{"version":3,"file":"GridTaskBuildSourceDistanceMap.d.ts","sourceRoot":"","sources":["../../../../../../../src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js"],"names":[],"mappings":"AAUA;;GAEG;AACH;IA6BI;;;;;;;OAOG;IACH;;;;;;uCAgBC;IAjDG;;;OAGG;IACH,2BAAyB;IAEzB;;;OAGG;IACH,yBAAuB;IAEvB;;;OAGG;IACH,cAAiB;IAEjB;;;OAGG;IACH,SAFU,MAAM,CAEI;IA6BxB,iDA8IC;CACJ;kCA3MiC,+BAA+B;sBAJ3C,+CAA+C"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { assert } from "../../../../../core/assert.js";
|
|
2
2
|
import { BitSet } from "../../../../../core/binary/BitSet.js";
|
|
3
|
+
import FastBinaryHeap from "../../../../../core/collection/heap/FastBinaryHeap.js";
|
|
4
|
+
import Task from "../../../../../core/process/task/Task.js";
|
|
3
5
|
import TaskGroup from "../../../../../core/process/task/TaskGroup.js";
|
|
4
6
|
import { TaskSignal } from "../../../../../core/process/task/TaskSignal.js";
|
|
5
|
-
import BinaryHeap from "../../../../../core/collection/heap/FastBinaryHeap.js";
|
|
6
|
-
import { GridTaskGenerator } from "../../../GridTaskGenerator.js";
|
|
7
|
-
import { assert } from "../../../../../core/assert.js";
|
|
8
7
|
import { actionTask } from "../../../../../core/process/task/util/actionTask.js";
|
|
9
8
|
import { countTask } from "../../../../../core/process/task/util/countTask.js";
|
|
9
|
+
import { GridTaskGenerator } from "../../../GridTaskGenerator.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Build a map of distances across the grid, using 2 concepts: source cells and passable cells. Source cells are where the distance is 0, and passable cells are those that can be travelled through
|
|
@@ -93,7 +93,7 @@ export class GridTaskBuildSourceDistanceMap extends GridTaskGenerator {
|
|
|
93
93
|
|
|
94
94
|
const target = layer.sampler.data;
|
|
95
95
|
|
|
96
|
-
const open = new
|
|
96
|
+
const open = new FastBinaryHeap(function (i) {
|
|
97
97
|
return target[i];
|
|
98
98
|
});
|
|
99
99
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskDistanceToMarkers.d.ts","sourceRoot":"","sources":["../../../../../../../src/generation/grid/generation/discrete/layer/GridTaskDistanceToMarkers.js"],"names":[],"mappings":"AAIA;IAIQ;;;OAGG;IACH,yBAAuB;IAEvB;;;OAGG;IACH,OAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,SAFU,MAAM,CAEI;IAGxB,oBAKC;IAED,4CAgCC;CACJ;
|
|
1
|
+
{"version":3,"file":"GridTaskDistanceToMarkers.d.ts","sourceRoot":"","sources":["../../../../../../../src/generation/grid/generation/discrete/layer/GridTaskDistanceToMarkers.js"],"names":[],"mappings":"AAIA;IAIQ;;;OAGG;IACH,yBAAuB;IAEvB;;;OAGG;IACH,OAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,SAFU,MAAM,CAEI;IAGxB,oBAKC;IAED,4CAgCC;CACJ;kCAjEiC,+BAA+B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import BinaryHeap from "../../../../../core/collection/heap/FastBinaryHeap.js";
|
|
1
|
+
import FastBinaryHeap from "../../../../../core/collection/heap/FastBinaryHeap.js";
|
|
3
2
|
import { actionTask } from "../../../../../core/process/task/util/actionTask.js";
|
|
3
|
+
import { GridTaskGenerator } from "../../../GridTaskGenerator.js";
|
|
4
4
|
|
|
5
5
|
export class GridTaskDistanceToMarkers extends GridTaskGenerator {
|
|
6
6
|
constructor() {
|
|
@@ -27,7 +27,7 @@ export class GridTaskDistanceToMarkers extends GridTaskGenerator {
|
|
|
27
27
|
|
|
28
28
|
buildChunks() {
|
|
29
29
|
|
|
30
|
-
const open = new
|
|
30
|
+
const open = new FastBinaryHeap(function (i) {
|
|
31
31
|
return target[i];
|
|
32
32
|
});
|
|
33
33
|
}
|
|
@@ -4,7 +4,7 @@ import { matcher_tag_traversable } from "../../../../../samples/generation/rules
|
|
|
4
4
|
import { BitSet } from "../../../../core/binary/BitSet.js";
|
|
5
5
|
import { groupArrayBy } from "../../../../core/collection/array/groupArrayBy.js";
|
|
6
6
|
import { collectIteratorValueToArray } from "../../../../core/collection/collectIteratorValueToArray.js";
|
|
7
|
-
import
|
|
7
|
+
import FastBinaryHeap from "../../../../core/collection/heap/FastBinaryHeap.js";
|
|
8
8
|
import { QuadTreeNode } from "../../../../core/geom/2d/quad-tree/QuadTreeNode.js";
|
|
9
9
|
import { Graph } from "../../../../core/graph/v2/Graph.js";
|
|
10
10
|
import { seededRandom } from "../../../../core/math/random/seededRandom.js";
|
|
@@ -124,7 +124,7 @@ function buildPaths(
|
|
|
124
124
|
|
|
125
125
|
const neighbourhoodMaskSize = neighbourhoodMask.length;
|
|
126
126
|
|
|
127
|
-
const open = new
|
|
127
|
+
const open = new FastBinaryHeap(i => distances[i]);
|
|
128
128
|
|
|
129
129
|
const closed = new BitSet();
|
|
130
130
|
|