@woosh/meep-engine 2.89.5 → 2.91.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.
Files changed (63) hide show
  1. package/build/bundle-worker-terrain.js +1 -1
  2. package/build/meep.cjs +55 -36
  3. package/build/meep.min.js +1 -1
  4. package/build/meep.module.js +55 -36
  5. package/package.json +1 -1
  6. package/src/core/binary/de_interleave_2_bits.spec.d.ts.map +1 -0
  7. package/src/core/binary/de_interleave_bits_by_2.d.ts.map +1 -0
  8. package/src/core/binary/reinterpret_float32_as_int32.d.ts.map +1 -0
  9. package/src/core/binary/split_by_2.d.ts.map +1 -0
  10. package/src/core/binary/split_by_3.d.ts.map +1 -0
  11. package/src/core/bvh2/binary/2/BinaryUint32BVH.d.ts.map +1 -1
  12. package/src/core/bvh2/binary/2/BinaryUint32BVH.js +3 -4
  13. package/src/core/bvh2/bvh3/BVH.js +1 -1
  14. package/src/core/geom/2d/aabb/AABB2.d.ts.map +1 -1
  15. package/src/core/geom/2d/aabb/AABB2.js +2 -4
  16. package/src/core/geom/2d/aabb/aabb2_array_combine.d.ts +11 -0
  17. package/src/core/geom/2d/aabb/aabb2_array_combine.d.ts.map +1 -0
  18. package/src/core/geom/2d/aabb/aabb2_array_combine.js +35 -0
  19. package/src/core/geom/2d/aabb/aabb2_array_set.d.ts +11 -0
  20. package/src/core/geom/2d/aabb/aabb2_array_set.d.ts.map +1 -0
  21. package/src/core/geom/2d/aabb/aabb2_array_set.js +21 -0
  22. package/src/core/geom/2d/aabb/aabb2_compute_area.d.ts +10 -0
  23. package/src/core/geom/2d/aabb/aabb2_compute_area.d.ts.map +1 -0
  24. package/src/core/geom/2d/aabb/aabb2_compute_area.js +14 -0
  25. package/src/core/geom/2d/bvh/BVH2D.d.ts +289 -0
  26. package/src/core/geom/2d/bvh/BVH2D.d.ts.map +1 -0
  27. package/src/core/geom/2d/bvh/BVH2D.js +1143 -0
  28. package/src/core/geom/2d/bvh/BVH2D.spec.d.ts +2 -0
  29. package/src/core/geom/2d/bvh/BVH2D.spec.d.ts.map +1 -0
  30. package/src/core/geom/2d/bvh/BVH2D.spec.js +358 -0
  31. package/src/core/geom/2d/lt-grid/LooseTightGrid.js +2 -2
  32. package/src/core/geom/2d/quad-tree/QuadTreeNode.spec.js +1 -1
  33. package/src/core/geom/2d/r-tree/StaticR2Tree.d.ts +79 -0
  34. package/src/core/geom/2d/r-tree/StaticR2Tree.d.ts.map +1 -0
  35. package/src/core/geom/2d/r-tree/StaticR2Tree.js +384 -0
  36. package/src/core/geom/2d/r-tree/StaticR2Tree.spec.d.ts +2 -0
  37. package/src/core/geom/2d/r-tree/StaticR2Tree.spec.d.ts.map +1 -0
  38. package/src/core/geom/2d/r-tree/StaticR2Tree.spec.js +62 -0
  39. package/src/core/geom/3d/morton/mortonEncode_magicbits.js +1 -1
  40. package/src/core/geom/3d/topology/struct/binary/io/OrderedEdge.js +1 -1
  41. package/src/engine/graphics/render/forward_plus/LightManager.d.ts.map +1 -1
  42. package/src/engine/graphics/render/forward_plus/LightManager.js +2 -0
  43. package/src/engine/graphics/render/forward_plus/cluster/read_plane_pair.d.ts +1 -1
  44. package/src/engine/graphics/render/forward_plus/cluster/read_plane_pair.js +1 -1
  45. package/src/engine/graphics/texture/virtual/tile/compose_tile_address.js +1 -1
  46. package/src/engine/graphics/texture/virtual/tile/tile_address_to_finger_print.js +1 -1
  47. package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
  48. package/src/engine/input/devices/KeyboardDevice.js +7 -1
  49. package/src/core/geom/3d/morton/de_interleave_2_bits.spec.d.ts.map +0 -1
  50. package/src/core/geom/3d/morton/de_interleave_bits_by_2.d.ts.map +0 -1
  51. package/src/core/geom/3d/morton/reinterpret_float32_as_int32.d.ts.map +0 -1
  52. package/src/core/geom/3d/morton/split_by_2.d.ts.map +0 -1
  53. package/src/core/geom/3d/morton/split_by_3.d.ts.map +0 -1
  54. /package/src/core/{geom/3d/morton → binary}/de_interleave_2_bits.spec.d.ts +0 -0
  55. /package/src/core/{geom/3d/morton → binary}/de_interleave_2_bits.spec.js +0 -0
  56. /package/src/core/{geom/3d/morton → binary}/de_interleave_bits_by_2.d.ts +0 -0
  57. /package/src/core/{geom/3d/morton → binary}/de_interleave_bits_by_2.js +0 -0
  58. /package/src/core/{geom/3d/morton → binary}/reinterpret_float32_as_int32.d.ts +0 -0
  59. /package/src/core/{geom/3d/morton → binary}/reinterpret_float32_as_int32.js +0 -0
  60. /package/src/core/{geom/3d/morton → binary}/split_by_2.d.ts +0 -0
  61. /package/src/core/{geom/3d/morton → binary}/split_by_2.js +0 -0
  62. /package/src/core/{geom/3d/morton → binary}/split_by_3.d.ts +0 -0
  63. /package/src/core/{geom/3d/morton → binary}/split_by_3.js +0 -0
@@ -0,0 +1,384 @@
1
+ import { assert } from "../../../assert.js";
2
+ import { ceilPowerOfTwo } from "../../../binary/operations/ceilPowerOfTwo.js";
3
+ import { split_by_2 } from "../../../binary/split_by_2.js";
4
+ import { array_copy } from "../../../collection/array/array_copy.js";
5
+ import { array_swap } from "../../../collection/array/array_swap.js";
6
+ import { SCRATCH_UINT32_TRAVERSAL_STACK } from "../../../collection/SCRATCH_UINT32_TRAVERSAL_STACK.js";
7
+ import { aabb2_array_combine } from "../aabb/aabb2_array_combine.js";
8
+
9
+ const BINARY_NODE_SIZE = 4;
10
+ const LEAF_NODE_SIZE = 5;
11
+ const BOX_BYTE_SIZE = 4;
12
+
13
+ /**
14
+ * Assumes data will be normalized to 0...1 value range
15
+ * @param {Float32Array} data
16
+ * @param {number} address
17
+ * @param {number} bounds_x0
18
+ * @param {number} bounds_y0
19
+ * @param {number} multiplier_x
20
+ * @param {number} multiplier_y
21
+ * @returns {number}
22
+ */
23
+ function build_normalized_morton_2d(
24
+ data, address,
25
+ bounds_x0, bounds_y0,
26
+ multiplier_x, multiplier_y
27
+ ) {
28
+
29
+ const x0 = data[address];
30
+ const y0 = data[address + 1];
31
+ const x1 = data[address + 3];
32
+ const y1 = data[address + 4];
33
+
34
+ const cx = (x0 + x1) * 0.5;
35
+ const cy = (y0 + y1) * 0.5;
36
+
37
+ const normalized_x = (cx - bounds_x0) * multiplier_x
38
+ const normalized_y = (cy - bounds_y0) * multiplier_y
39
+
40
+ return (split_by_2(normalized_y) << 1)
41
+ | split_by_2(normalized_x)
42
+ ;
43
+ }
44
+
45
+ /**
46
+ *
47
+ * @param {Float32Array} data
48
+ * @param {number} destination
49
+ * @param {number} source
50
+ */
51
+ function copy_box_zero_size(data, destination, source) {
52
+ assert.isNonNegativeInteger(destination, 'destination');
53
+ assert.isNonNegativeInteger(source, 'source');
54
+
55
+ const x = data[source];
56
+ const y = data[source + 1];
57
+
58
+ assert.notNaN(x, 'x');
59
+ assert.notNaN(y, 'y');
60
+
61
+ data[destination] = x;
62
+ data[destination + 1] = y;
63
+
64
+ data[destination + 2] = x;
65
+ data[destination + 3] = y;
66
+ }
67
+
68
+
69
+ /**
70
+ * NOTE: code is based on BinaryUint32BVH
71
+ * NOTE: this code is mostly untested
72
+ */
73
+ export class StaticR2Tree {
74
+
75
+ /**
76
+ * @type {ArrayBuffer}
77
+ * @private
78
+ */
79
+ __data_buffer;
80
+
81
+ /**
82
+ * @readonly
83
+ * @private
84
+ * @type {Uint32Array}
85
+ */
86
+ __data_uint32;
87
+
88
+ /**
89
+ *
90
+ * @type {number}
91
+ * @private
92
+ */
93
+ __node_count_binary = 0;
94
+
95
+ /**
96
+ *
97
+ * @type {number}
98
+ * @private
99
+ */
100
+ __node_count_leaf = 0;
101
+
102
+ constructor() {
103
+ this.setBuffer(new ArrayBuffer(320));
104
+ }
105
+
106
+
107
+ /**
108
+ *
109
+ * @param {ArrayBuffer} buffer
110
+ */
111
+ setBuffer(buffer) {
112
+ assert.defined(buffer, 'buffer');
113
+
114
+ this.__data_buffer = buffer;
115
+
116
+ this.__data_float32 = new Float32Array(this.__data_buffer);
117
+ this.__data_uint32 = new Uint32Array(this.__data_buffer);
118
+ }
119
+
120
+
121
+ initialize_structure() {
122
+ // compute memory requirements
123
+ const word_count = this.__node_count_binary * BINARY_NODE_SIZE + this.__node_count_leaf * LEAF_NODE_SIZE;
124
+ const storage_size = word_count * 4;
125
+
126
+ // possibly resize the storage
127
+ if (this.__data_buffer.byteLength < storage_size) {
128
+ this.setBuffer(new ArrayBuffer(storage_size));
129
+ }
130
+ }
131
+
132
+ /**
133
+ *
134
+ * @param {number} count
135
+ */
136
+ setLeafCount(count) {
137
+ this.__node_count_leaf = count;
138
+
139
+ const twoLeafLimit = ceilPowerOfTwo(count);
140
+
141
+ if (count <= 1) {
142
+ // special case
143
+ this.__node_count_binary = twoLeafLimit;
144
+ } else {
145
+ this.__node_count_binary = twoLeafLimit - 1;
146
+ }
147
+
148
+ }
149
+
150
+
151
+ /**
152
+ *
153
+ * @param {number} index
154
+ * @param {number} payload
155
+ * @param {number} x0
156
+ * @param {number} y0
157
+ * @param {number} x1
158
+ * @param {number} y1
159
+ */
160
+ setLeafData(
161
+ index, payload,
162
+ x0, y0,
163
+ x1, y1
164
+ ) {
165
+ assert.notNaN(x0, 'x0');
166
+ assert.notNaN(y0, 'y0');
167
+ assert.notNaN(x1, 'x1');
168
+ assert.notNaN(y1, 'y1');
169
+
170
+ assert.isNonNegativeInteger(payload, 'payload');
171
+
172
+ const address = index * LEAF_NODE_SIZE + this.__node_count_binary * BINARY_NODE_SIZE;
173
+
174
+ const float32 = this.__data_float32;
175
+
176
+ float32[address] = x0;
177
+ float32[address + 1] = y0;
178
+ float32[address + 2] = x1;
179
+ float32[address + 3] = y1;
180
+
181
+ this.__data_uint32[address + 4] = payload;
182
+ }
183
+
184
+ /**
185
+ *
186
+ * @returns {number}
187
+ */
188
+ getLeafBlockAddress() {
189
+ return this.__node_count_binary * BINARY_NODE_SIZE;
190
+ }
191
+
192
+ /**
193
+ *
194
+ * @param {number} leaf_index
195
+ * @returns {number}
196
+ */
197
+ readLeafPayload(leaf_index) {
198
+ const block_address = this.getLeafBlockAddress();
199
+
200
+ const address = block_address + leaf_index * LEAF_NODE_SIZE + BOX_BYTE_SIZE;
201
+
202
+ return this.__data_uint32[address];
203
+ }
204
+
205
+
206
+ /**
207
+ * Sort leaf nodes according to their morton codes
208
+ * @param {number[]} bounds
209
+ */
210
+ sort_morton(bounds) {
211
+
212
+ const leaf_block_address = this.__node_count_binary * BINARY_NODE_SIZE;
213
+
214
+ if (this.__node_count_leaf < 2) {
215
+ // no swaps available
216
+ return;
217
+ }
218
+
219
+ const stack = SCRATCH_UINT32_TRAVERSAL_STACK;
220
+ const stack_top = stack.pointer;
221
+
222
+ let stackPointer = stack_top + 2;
223
+ let iL, iR;
224
+
225
+
226
+ stack[0] = 0; // first node
227
+ stack[1] = this.__node_count_leaf - 1; // last node
228
+
229
+ const data = this.__data_float32;
230
+
231
+
232
+ const bounds_x0 = bounds[0];
233
+ const bounds_y0 = bounds[1];
234
+
235
+ const bounds_span_x = bounds[2] - bounds_x0;
236
+ const bounds_span_y = bounds[3] - bounds_y0;
237
+
238
+ const bounds_multiplier_x = 4095 / bounds_span_x;
239
+ const bounds_multiplier_y = 4095 / bounds_span_y;
240
+
241
+ while (stackPointer > stack_top) {
242
+ stackPointer -= 2;
243
+
244
+ const right = stack[stackPointer + 1];
245
+ const left = stack[stackPointer];
246
+
247
+ iL = left;
248
+ iR = right;
249
+
250
+ const pivot_index = (left + right) >>> 1;
251
+
252
+ const pivot_address = pivot_index * LEAF_NODE_SIZE + leaf_block_address;
253
+
254
+ const pivot = build_normalized_morton_2d(data, pivot_address, bounds_x0, bounds_y0, bounds_multiplier_x, bounds_multiplier_y);
255
+
256
+ /* partition */
257
+ while (iL <= iR) {
258
+ while (build_normalized_morton_2d(data, iL * LEAF_NODE_SIZE + leaf_block_address, bounds_x0, bounds_y0, bounds_multiplier_x, bounds_multiplier_y) < pivot) {
259
+ iL++;
260
+ }
261
+
262
+ while (build_normalized_morton_2d(data, iR * LEAF_NODE_SIZE + leaf_block_address, bounds_x0, bounds_y0, bounds_multiplier_x, bounds_multiplier_y) > pivot) {
263
+ iR--;
264
+ }
265
+
266
+ if (iL <= iR) {
267
+
268
+ if (iL !== iR) {
269
+ //do swap
270
+ this.__swap_leaves(iL, iR);
271
+ }
272
+
273
+ iL++;
274
+ iR--;
275
+ }
276
+ }
277
+
278
+ /* recursion */
279
+ if (left < iR) {
280
+ stack[stackPointer++] = left;
281
+ stack[stackPointer++] = iR;
282
+ }
283
+ if (iL < right) {
284
+ stack[stackPointer++] = iL;
285
+ stack[stackPointer++] = right;
286
+ }
287
+ }
288
+ }
289
+
290
+ /**
291
+ *
292
+ * @param {number} i
293
+ * @param {number} j
294
+ * @private
295
+ */
296
+ __swap_leaves(i, j) {
297
+ const leaf_block_address = this.getLeafBlockAddress();
298
+ const a = i * LEAF_NODE_SIZE + leaf_block_address;
299
+ const b = j * LEAF_NODE_SIZE + leaf_block_address;
300
+
301
+ const float32 = this.__data_float32;
302
+
303
+ array_swap(
304
+ float32, a,
305
+ float32, b,
306
+ LEAF_NODE_SIZE
307
+ );
308
+ }
309
+
310
+ /**
311
+ * Assemble leaf nodes into hierarchy, set binary node bounds iteratively bottom up
312
+ */
313
+ build() {
314
+ const binary_node_count = this.__node_count_binary;
315
+
316
+ const leaf_node_block_address = binary_node_count * BINARY_NODE_SIZE;
317
+
318
+ let level = Math.floor(Math.log(binary_node_count) / Math.log(2));
319
+
320
+ let i, offset, level_node_count;
321
+ //NOTE: building first level separately allows to avoid some switching logic needed to determine what is the type of lower level node
322
+ //build one level above leaf nodes
323
+ level_node_count = Math.pow(2, level);
324
+ offset = (level_node_count - 1) * BINARY_NODE_SIZE;
325
+
326
+ let parentIndex;
327
+
328
+ const node_count_leaf = this.__node_count_leaf;
329
+
330
+ const float32 = this.__data_float32;
331
+
332
+ // build bottom-most level, just above the leaves
333
+ for (i = 0; i < level_node_count; i++) {
334
+ const leaf_index_0 = i << 1;
335
+ const leaf_index_1 = leaf_index_0 + 1;
336
+
337
+ const leaf_offset_0 = leaf_node_block_address + leaf_index_0 * LEAF_NODE_SIZE;
338
+ const leaf_offset_1 = leaf_node_block_address + leaf_index_1 * LEAF_NODE_SIZE;
339
+
340
+ if (leaf_index_1 < node_count_leaf) {
341
+ // both children nodes are valid
342
+ aabb2_array_combine(
343
+ float32, offset,
344
+ float32, leaf_offset_0,
345
+ float32, leaf_offset_1
346
+ );
347
+ } else if (leaf_index_0 < node_count_leaf) {
348
+ // only left child node is valid
349
+ array_copy(float32, leaf_offset_0, float32, offset, 6);
350
+ } else {
351
+ //initialize to 0-size box same position as previous node
352
+ copy_box_zero_size(this.__data_float32, offset, (offset - BINARY_NODE_SIZE));
353
+ }
354
+
355
+ offset += BINARY_NODE_SIZE;
356
+ }
357
+
358
+ level--;
359
+
360
+ //build intermediate nodes
361
+ for (; level >= 0; level--) {
362
+ level_node_count = 1 << level;
363
+ parentIndex = (level_node_count - 1);
364
+
365
+ for (i = 0; i < level_node_count; i++) {
366
+
367
+ const childIndex0 = (parentIndex << 1) + 1;
368
+
369
+ const address_parent = parentIndex * BINARY_NODE_SIZE;
370
+
371
+ const address_child_0 = childIndex0 * BINARY_NODE_SIZE;
372
+ const address_child_1 = address_child_0 + BINARY_NODE_SIZE;
373
+
374
+ aabb2_array_combine(
375
+ float32, address_parent,
376
+ float32, address_child_0,
377
+ float32, address_child_1
378
+ );
379
+
380
+ parentIndex++;
381
+ }
382
+ }
383
+ }
384
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=StaticR2Tree.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StaticR2Tree.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/r-tree/StaticR2Tree.spec.js"],"names":[],"mappings":""}
@@ -0,0 +1,62 @@
1
+ import { randomFloatBetween } from "../../../math/random/randomFloatBetween.js";
2
+ import { seededRandom } from "../../../math/random/seededRandom.js";
3
+ import { StaticR2Tree } from "./StaticR2Tree.js";
4
+
5
+
6
+ test.skip("performance, insertion 1m random", () => {
7
+ const tree = new StaticR2Tree();
8
+
9
+ const random = seededRandom(42);
10
+
11
+ const N = 1000000;
12
+
13
+ const boxes = new Float32Array(N * 4);
14
+
15
+ for (let i = 0; i < N; i++) {
16
+
17
+ const position_x = randomFloatBetween(random, 0, 98);
18
+ const position_y = randomFloatBetween(random, 0, 98);
19
+
20
+ const size_x = randomFloatBetween(random, 0.1, 2);
21
+ const size_y = randomFloatBetween(random, 0.1, 2);
22
+
23
+
24
+ const i4 = i * 4;
25
+ boxes[i4] = position_x;
26
+ boxes[i4 + 1] = position_y;
27
+ boxes[i4 + 2] = position_x + size_x;
28
+ boxes[i4 + 3] = position_y + size_y;
29
+ }
30
+
31
+ tree.setLeafCount(N);
32
+ tree.initialize_structure();
33
+
34
+ // perform insertion
35
+ const t0 = performance.now();
36
+
37
+ for (let i = 0; i < N; i++) {
38
+ const i4 = i * 4;
39
+
40
+ const x0 = boxes[i4];
41
+ const y0 = boxes[i4 + 1];
42
+ const x1 = boxes[i4 + 2];
43
+ const y1 = boxes[i4 + 3];
44
+
45
+ tree.setLeafData(i, i,
46
+ x0,
47
+ y0,
48
+ x1,
49
+ y1
50
+ );
51
+ }
52
+
53
+ tree.sort_morton([0,0,100,100])
54
+
55
+ tree.build();
56
+
57
+ const duration = performance.now() - t0;
58
+
59
+ const duration_seconds = duration * 1e-3;
60
+
61
+ console.log(`Duration ${duration_seconds}s, ${(N / duration_seconds).toFixed(2)} records per second`);
62
+ });
@@ -1,4 +1,4 @@
1
- import { split_by_3 } from "./split_by_3.js";
1
+ import { split_by_3 } from "../../../binary/split_by_3.js";
2
2
 
3
3
  /**
4
4
  * Based on article and C++ source code:
@@ -1,4 +1,4 @@
1
- import { split_by_2 } from "../../../../morton/split_by_2.js";
1
+ import { split_by_2 } from "../../../../../../binary/split_by_2.js";
2
2
 
3
3
  export class OrderedEdge {
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"LightManager.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/forward_plus/LightManager.js"],"names":[],"mappings":"AAqIA;IAiBQ;;;;OAIG;IACH,2BAAgD;IAEhD,oCAAoC;IACpC,yCAA4C;IAE5C;;;;;;;;OAQG;IACH,0BAKC;IAYD;;;;;OAKG;IACH,+BAAoD;IAMpD;;;;;OAKG;IACH,8BAAmD;IAMnD;;;;OAIG;IACH,uCAAiF;IAUjF;;;;;OAKG;IACH,+BAEE;IAEF;;;;OAIG;IACH,iCAA8E;IAE9E;;;;OAIG;IACH,2BAAmC;IAEnC;;;;;OAKG;IACH,kCAAoE;IACpE;;;;;OAKG;IACH,kCAAoE;IAEpE;;;;OAIG;IACH,gCAAiC;IAEjC;;;;OAIG;IACH,6BAAiD;IACjD;;;;OAIG;IACH,6BAAiD;IAEjD;;;;OAIG;IACH,uBAAmC;IAEnC;;;;OAIG;IACH,8BAAiD;IAEjD;;;;OAIG;IACH,4BAA+C;IAG/C;;;;OAIG;IACH,yBAA2C;IAE3C;;;;OAIG;IACH,iCAAmD;IAUnD;;;;;OAKG;IACH,kCAAqC;IAErC;;;;OAIG;IACH,mCAAsC;IAK1C,0BAEC;IAED;;;;;;OAMG;IACH,0CAQC;IAED;;;OAGG;IACH,uCAEC;IAED,qCAQC;IAED;;;;;;OAMG;IACH,4CAgBC;IAED,iCAIC;IAED,gCA6BC;IAED;;;;;OAKG;IACH,6BAEC;IAED;;;OAGG;IACH,oBAFa,WAAW,CAIvB;IAED;;;OAGG;IACH,kBAFa,WAAW,CAIvB;IAED;;OAEG;IACH,sBAFa,aAAa,CAIzB;IAED;;OAEG;IACH,wBAFa,WAAW,CAIvB;IAED;;;OAGG;IACH,iBAFa,SAAS,OAAO,CAAC,CAI7B;IAED;;;OAGG;IACH,yCAKC;IAED;;;;OAIG;IACH,qCAyBC;IAED;;;;OAIG;IACH,uCA8BC;IAED;;;;OAIG;IACH,qCAMC;IAED;;;;OAIG;IACH,uCAKC;IAED;;;;;OAKG;IACH,4CAJW,mBAAmB,GACjB,MAAM,CAalB;IAED;;;;;;OAMG;IACH,+BAgCC;IAED;;;OAGG;IACH,6BAoBC;IAED,6BAYC;IAGD;;;;OAIG;IACH,6BAMC;IAED,mCA0EC;IAED,mCAgFC;IAED;;;OAGG;IACH,oCAiJC;IAED;;;OAGG;IACH,uCAUC;IAED;;;OAGG;IACH,oCAOC;IAED;;;OAGG;IACH,uCAWC;IAED;;;OAGG;IACH,mBAFW,SAAO,MAAM,iBAAiB,QAmDxC;IAED,gBAKC;IAED;;;;;OAKG;IACH,wBAJW,MAAM,KACN,MAAM,KACN,MAAM,QA2ChB;IAED;;;;OAIG;IACH,gCAFa,OAAO,CAInB;IAED;;;OAGG;IACH,qCAMC;IAED;;;;OAIG;IACH,mCAFa,OAAO,CAiBnB;;CACJ;4BAxrCM,OAAO;8BAAP,OAAO;oBAmBM,kCAAkC;oCAiBlB,0BAA0B"}
1
+ {"version":3,"file":"LightManager.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/forward_plus/LightManager.js"],"names":[],"mappings":"AAqIA;IAiBQ;;;;OAIG;IACH,2BAAgD;IAEhD,oCAAoC;IACpC,yCAA4C;IAE5C;;;;;;;;OAQG;IACH,0BAKC;IAYD;;;;;OAKG;IACH,+BAAoD;IAMpD;;;;;OAKG;IACH,8BAAmD;IAMnD;;;;OAIG;IACH,uCAAiF;IAUjF;;;;;OAKG;IACH,+BAEE;IAEF;;;;OAIG;IACH,iCAA8E;IAE9E;;;;OAIG;IACH,2BAAmC;IAEnC;;;;;OAKG;IACH,kCAAoE;IACpE;;;;;OAKG;IACH,kCAAoE;IAEpE;;;;OAIG;IACH,gCAAiC;IAEjC;;;;OAIG;IACH,6BAAiD;IACjD;;;;OAIG;IACH,6BAAiD;IAEjD;;;;OAIG;IACH,uBAAmC;IAEnC;;;;OAIG;IACH,8BAAiD;IAEjD;;;;OAIG;IACH,4BAA+C;IAG/C;;;;OAIG;IACH,yBAA2C;IAE3C;;;;OAIG;IACH,iCAAmD;IAUnD;;;;;OAKG;IACH,kCAAqC;IAErC;;;;OAIG;IACH,mCAAsC;IAK1C,0BAEC;IAED;;;;;;OAMG;IACH,0CAQC;IAED;;;OAGG;IACH,uCAEC;IAED,qCAQC;IAED;;;;;;OAMG;IACH,4CAgBC;IAED,iCAIC;IAED,gCA6BC;IAED;;;;;OAKG;IACH,6BAEC;IAED;;;OAGG;IACH,oBAFa,WAAW,CAIvB;IAED;;;OAGG;IACH,kBAFa,WAAW,CAIvB;IAED;;OAEG;IACH,sBAFa,aAAa,CAIzB;IAED;;OAEG;IACH,wBAFa,WAAW,CAIvB;IAED;;;OAGG;IACH,iBAFa,SAAS,OAAO,CAAC,CAI7B;IAED;;;OAGG;IACH,yCAKC;IAED;;;;OAIG;IACH,qCAyBC;IAED;;;;OAIG;IACH,uCA8BC;IAED;;;;OAIG;IACH,qCAMC;IAED;;;;OAIG;IACH,uCAKC;IAED;;;;;OAKG;IACH,4CAJW,mBAAmB,GACjB,MAAM,CAalB;IAED;;;;;;OAMG;IACH,+BAgCC;IAED;;;OAGG;IACH,6BAoBC;IAED,6BAYC;IAGD;;;;OAIG;IACH,6BAMC;IAED,mCA0EC;IAED,mCAgFC;IAED;;;OAGG;IACH,oCAmJC;IAED;;;OAGG;IACH,uCAUC;IAED;;;OAGG;IACH,oCAOC;IAED;;;OAGG;IACH,uCAWC;IAED;;;OAGG;IACH,mBAFW,SAAO,MAAM,iBAAiB,QAmDxC;IAED,gBAKC;IAED;;;;;OAKG;IACH,wBAJW,MAAM,KACN,MAAM,KACN,MAAM,QA2ChB;IAED;;;;OAIG;IACH,gCAFa,OAAO,CAInB;IAED;;;OAGG;IACH,qCAMC;IAED;;;;OAIG;IACH,mCAFa,OAAO,CAiBnB;;CACJ;4BA1rCM,OAAO;8BAAP,OAAO;oBAmBM,kCAAkC;oCAiBlB,0BAA0B"}
@@ -958,6 +958,7 @@ export class LightManager {
958
958
 
959
959
  const tile_data_offset = tile_index * 4;
960
960
 
961
+ //assign lights
961
962
  lookup_address_offset += assign_cluster(
962
963
  tile_data_offset,
963
964
  bvh_lights,
@@ -967,6 +968,7 @@ export class LightManager {
967
968
  light_source_data
968
969
  );
969
970
 
971
+ // assign decals
970
972
  const decal_count = assign_cluster(
971
973
  tile_data_offset + 2,
972
974
  bvh_decals,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Read out a pair of planes from an numeric array
2
+ * Read out a pair of planes from a numeric array
3
3
  * @param {number[]|Float32Array} source
4
4
  * @param {number} source_offset
5
5
  * @param {number[]|Float64Array|Float32Array} destination
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Read out a pair of planes from an numeric array
2
+ * Read out a pair of planes from a numeric array
3
3
  * @param {number[]|Float32Array} source
4
4
  * @param {number} source_offset
5
5
  * @param {number[]|Float64Array|Float32Array} destination
@@ -1,5 +1,5 @@
1
1
  import { assert } from "../../../../../core/assert.js";
2
- import { split_by_2 } from "../../../../../core/geom/3d/morton/split_by_2.js";
2
+ import { split_by_2 } from "../../../../../core/binary/split_by_2.js";
3
3
 
4
4
  /**
5
5
  *
@@ -1,4 +1,4 @@
1
- import { split_by_2 } from "../../../../../core/geom/3d/morton/split_by_2.js";
1
+ import { split_by_2 } from "../../../../../core/binary/split_by_2.js";
2
2
  import { compose_finger_print } from "./compose_finger_print.js";
3
3
 
4
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"KeyboardDevice.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/KeyboardDevice.js"],"names":[],"mappings":";AAkDA;IAgBI;;;OAGG;IACH,wBAFW,WAAW,GAAC,OAAO,EA+B7B;IA/CD;;OAEG;IACH;;;MAGE;IAEF;;;OAGG;IACH,mBAAU;IAkBN;;;OAGG;IACH,YAFU,WAAW,CAEO;IAyDhC,cAGC;IAED,aAGC;;CACJ;mBApJkB,uCAAuC"}
1
+ {"version":3,"file":"KeyboardDevice.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/KeyboardDevice.js"],"names":[],"mappings":";AAkDA;IAgBI;;;OAGG;IACH,wBAFW,WAAW,GAAC,OAAO,EA+B7B;IA/CD;;OAEG;IACH;;;MAGE;IAEF;;;OAGG;IACH,mBAAU;IAkBN;;;OAGG;IACH,YAFU,WAAW,CAEO;IA+DhC,cAGC;IAED,aAGC;;CACJ;mBA1JkB,uCAAuC"}
@@ -3,9 +3,9 @@
3
3
  */
4
4
 
5
5
  import Signal from "../../../core/events/signal/Signal.js";
6
- import { KeyCodes } from './KeyCodes.js';
7
6
  import { KeyboardEvents } from "./events/KeyboardEvents.js";
8
7
  import { InputDeviceSwitch } from "./InputDeviceSwitch.js";
8
+ import { KeyCodes } from './KeyCodes.js';
9
9
 
10
10
  /**
11
11
  *
@@ -105,6 +105,12 @@ class KeyboardDevice {
105
105
  * @private
106
106
  */
107
107
  #handlerKeyDown = (event) => {
108
+ if (event.repeat) {
109
+ // ignore automatic repetition
110
+ // see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat
111
+ return;
112
+ }
113
+
108
114
  this.on.down.send1(event);
109
115
 
110
116
  //hook up dispatch handler for individual keys
@@ -1 +0,0 @@
1
- {"version":3,"file":"de_interleave_2_bits.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/morton/de_interleave_2_bits.spec.js"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"de_interleave_bits_by_2.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/morton/de_interleave_bits_by_2.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,kDAHW,MAAM,GACJ,MAAM,CAWlB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"reinterpret_float32_as_int32.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/morton/reinterpret_float32_as_int32.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,oDAHW,MAAM,GACJ,MAAM,CAKlB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"split_by_2.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/morton/split_by_2.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,8BAHW,MAAM,GACJ,MAAM,CAUlB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"split_by_3.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/morton/split_by_3.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,8BAHW,MAAM,GACJ,MAAM,CASlB"}