@woosh/meep-engine 2.49.0 → 2.49.2

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.49.0",
8
+ "version": "2.49.2",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -0,0 +1,7 @@
1
+ import IndexedBinaryBVH from "./IndexedBinaryBVH.js";
2
+
3
+ test("constructor does not throw", () => {
4
+ expect(() => new IndexedBinaryBVH()).not.toThrow();
5
+ });
6
+
7
+
@@ -368,20 +368,20 @@ export class CuckooFilter {
368
368
  }
369
369
 
370
370
  /**
371
- * Puts an element into this {@code CuckooFilter}. Ensures that subsequent
371
+ * Puts an element into this {@link CuckooFilter}. Ensures that subsequent
372
372
  * invocations of {@link #mightContain(Object)} with the same element will
373
- * always return {@code true}.
374
- * <p>
373
+ * always return `true`.
374
+ *
375
375
  * Note that the filter should be considered full after insertion failure.
376
376
  * Further inserts <i>may</i> fail, although deleting items can also make
377
377
  * the filter usable again.
378
- * <p>
378
+ *
379
379
  * Also note that inserting the same item more than 8 times will cause an
380
380
  * insertion failure.
381
381
  *
382
382
  * @param {number} hash hash of item to insert
383
- * @returns {boolean} {@code true} if the cuckoo filter inserts this item successfully.
384
- * Returns {@code false} if insertion failed.
383
+ * @returns {boolean} `true` if the cuckoo filter inserts this item successfully.
384
+ * Returns `false` if insertion failed.
385
385
  */
386
386
  insert(hash) {
387
387
  const current_tag = this.__compute_tag_from_hash(hash);
@@ -461,22 +461,22 @@ export class CuckooFilter {
461
461
  }
462
462
 
463
463
  /**
464
- * Deletes an element from this {@code CuckooFilter}. In most cases you
464
+ * Deletes an element from this {@link CuckooFilter}. In most cases you
465
465
  * should only delete items that have been previously added to the filter.
466
466
  * Attempting to delete non-existent items may successfully delete the wrong
467
467
  * item in the filter, causing a false negative. False negatives are defined
468
- * as( {@code #mightContain(Object)} returning false for an item that
468
+ * as( {@link #mightContain(Object)} returning false for an item that
469
469
  * <i>has</i> been added to the filter. Deleting non-existent items doesn't
470
470
  * otherwise adversely affect the state of the filter, so attempting to
471
471
  * delete items that <i>may not</i> have been inserted is fine if false
472
472
  * negatives are acceptable. The false-delete rate is similar to the false
473
473
  * positive rate. False deletes can also cause the
474
- * {@code #approximateCount(Object)} to return both lower and higher than
474
+ * {@link #approximateCount(Object)} to return both lower and higher than
475
475
  * the real count
476
476
  *
477
477
  * @param {number} hash
478
- * @returns {boolean} {@code true} if the cuckoo filter deleted this item successfully.
479
- * Returns {@code false} if the item was not found.
478
+ * @returns {boolean} `true` if the cuckoo filter deleted this item successfully.
479
+ * Returns `false` if the item was not found.
480
480
  */
481
481
  remove(hash) {
482
482
  const tag = this.__compute_tag_from_hash(hash);
@@ -508,8 +508,8 @@ export class CuckooFilter {
508
508
 
509
509
 
510
510
  /**
511
- * Returns {@code true} if the element <i>might</i> have been put in this
512
- * Cuckoo filter, {@code false} if this is <i>definitely</i> not the case.
511
+ * Returns `true` if the element <i>might</i> have been put in this
512
+ * Cuckoo filter, `false` if this is <i>definitely</i> not the case.
513
513
  *
514
514
  * @param {number} hash
515
515
  * @returns {boolean}
@@ -523,4 +523,4 @@ export class CuckooFilter {
523
523
  || (this.__victim_exists && this.__victim_tag === tag && (this.__victim_index === i1 || this.__victim_index === i2)) //check the victim
524
524
  ;
525
525
  }
526
- }
526
+ }
@@ -33,7 +33,7 @@ const MAX_ITERATIONS = 10000;
33
33
  /**
34
34
  * Computes the miniball of the given point set.
35
35
  *
36
- * Notice that the point set {@code pts} is assumed to be immutable during the computation. That
36
+ * Notice that the point set `pts` is assumed to be immutable during the computation. That
37
37
  * is, if you add, remove, or change points in the point set, you have to create a new instance of
38
38
  * {@link Miniball}.
39
39
  *
@@ -102,7 +102,7 @@ class Miniball {
102
102
  }
103
103
 
104
104
  /**
105
- * Whether or not the miniball is the empty set, equivalently, whether {@code points.size() == 0}
105
+ * Whether or not the miniball is the empty set, equivalently, whether `points.size() == 0`
106
106
  * was true when this miniball instance was constructed.
107
107
  *
108
108
  * Notice that the miniball of a point set <i>S</i> is empty if and only if <i>S={}</i>.
@@ -115,8 +115,8 @@ class Miniball {
115
115
 
116
116
  /**
117
117
  * The radius of the miniball.
118
- * <p>
119
- * Precondition: {@code !isEmpty()}
118
+ *
119
+ * Precondition: `!isEmpty()`
120
120
  *
121
121
  * @return {number} the radius of the miniball, a number ≥ 0
122
122
  */
@@ -126,10 +126,10 @@ class Miniball {
126
126
 
127
127
  /**
128
128
  * The squared radius of the miniball.
129
- * <p>
130
- * This is equivalent to {@code radius() * radius()}.
131
- * <p>
132
- * Precondition: {@code !isEmpty()}
129
+ *
130
+ * This is equivalent to `radius() * radius()`.
131
+ *
132
+ * Precondition: `!isEmpty()`
133
133
  *
134
134
  * @return {number} the squared radius of the miniball
135
135
  */
@@ -139,8 +139,8 @@ class Miniball {
139
139
 
140
140
  /**
141
141
  * The Euclidean coordinates of the center of the miniball.
142
- * <p>
143
- * Precondition: {@code !isEmpty()}
142
+ *
143
+ * Precondition: `!isEmpty()`
144
144
  *
145
145
  * @return {number[]} an array holding the coordinates of the center of the miniball
146
146
  */
@@ -151,8 +151,8 @@ class Miniball {
151
151
  /**
152
152
  * The number of input points.
153
153
  *
154
- * @return {number} the number of points in the original point set, i.e., {@code pts.size()} where
155
- * {@code pts} was the {@link PointSet} instance passed to the constructor of this
154
+ * @return {number} the number of points in the original point set, i.e., `pts.size()` where
155
+ * `pts` was the {@link PointSet} instance passed to the constructor of this
156
156
  * instance
157
157
  */
158
158
  size() {
@@ -178,8 +178,8 @@ class Miniball {
178
178
  * Sets up the search ball with an arbitrary point of <i>S</i> as center and with exactly one of
179
179
  * the points farthest from center in the support. So the current ball contains all points of
180
180
  * <i>S</i> and has radius at most twice as large as the minball.
181
- * <p>
182
- * Precondition: {@code size > 0}
181
+ *
182
+ * Precondition: `size > 0`
183
183
  * @return {Subspan}
184
184
  * @private
185
185
  */
@@ -238,7 +238,7 @@ class Miniball {
238
238
 
239
239
  /**
240
240
  * The main function containing the main loop.
241
- * <p>
241
+ *
242
242
  * Iteratively, we compute the point in support that is closest to the current center and then
243
243
  * walk towards this target as far as we can, i.e., we move until some new point touches the
244
244
  * boundary of the ball and must thus be inserted into support. In each of these two alternating
@@ -301,7 +301,7 @@ class Miniball {
301
301
  * {@link #successfulDrop()} elects a suitable point <i>k</i> to be removed from the support and
302
302
  * returns true. If the center lies in the convex hull, however, false is returned (and the
303
303
  * support remains unaltered).
304
- * <p>
304
+ *
305
305
  * Precondition: center lies in <i>aff(support)</i>.
306
306
  * @return {boolean}
307
307
  */
@@ -334,10 +334,10 @@ class Miniball {
334
334
  }
335
335
 
336
336
  /**
337
- * Given the center of the current enclosing ball and the walking direction {@code centerToAff},
337
+ * Given the center of the current enclosing ball and the walking direction `centerToAff`,
338
338
  * determine how much we can walk into this direction without losing a point from <i>S</i>. The
339
- * (positive) factor by which we can walk along {@code centerToAff} is returned. Further,
340
- * {@code stopper} is set to the index of the most restricting point and to -1 if no such point
339
+ * (positive) factor by which we can walk along `centerToAff` is returned. Further,
340
+ * `stopper` is set to the index of the most restricting point and to -1 if no such point
341
341
  * was found.
342
342
  * @return {number}
343
343
  * @private
@@ -403,7 +403,7 @@ class Miniball {
403
403
 
404
404
  /**
405
405
  * Verifies that the computed ball is indeed the miniball.
406
- * <p>
406
+ *
407
407
  * This method should be called for testing purposes only; it may not be very efficient.
408
408
  * @return {Quality}
409
409
  */
@@ -30,7 +30,7 @@ class Quality {
30
30
 
31
31
  /**
32
32
  * A measure for the quality of the internally used support points.
33
- * <p>
33
+ *
34
34
  * The returned number should in theory be zero (but may be non-zero due to rounding errors).
35
35
  * @return {number}
36
36
  */
@@ -52,12 +52,12 @@ class Quality {
52
52
  /**
53
53
  * The maximal over-length of a point from the input set, relative to the computed miniball's
54
54
  * radius.
55
- * <p>
55
+ *
56
56
  * For each point <i>p</i> from the input point set, it is computed how far it is <i>outside</i>
57
57
  * the miniball ("over-length"). The returned number is the maximal such over-length, divided by
58
58
  * the radius of the computed miniball.
59
- * <p>
60
- * Notice that {@code getMaxOverlength() == 0} if and only if all points are contained in the
59
+ *
60
+ * Notice that `getMaxOverlength() == 0` if and only if all points are contained in the
61
61
  * miniball.
62
62
  *
63
63
  * @return {number} the maximal over-length, a number ≥ 0
@@ -69,12 +69,12 @@ class Quality {
69
69
  /**
70
70
  * The maximal under-length of a point from the input set, relative to the computed miniball's
71
71
  * radius.
72
- * <p>
72
+ *
73
73
  * For each point <i>p</i> from the input point set, it is computed how far one has to walk from
74
74
  * this point towards the boundary of the miniball ("under-length"). The returned number is the
75
75
  * maximal such under-length, divided by the radius of the computed miniball.
76
- * <p>
77
- * Notice that in theory {@code getMaxUnderlength()} should be zero, otherwise the computed
76
+ *
77
+ * Notice that in theory `getMaxUnderlength()` should be zero, otherwise the computed
78
78
  * miniball is enclosing but not minimal.
79
79
  *
80
80
  * @return {number} the maximal under-length, a number ≥ 0
@@ -94,7 +94,7 @@ class Quality {
94
94
 
95
95
  /**
96
96
  * The size of the support.
97
- * <p>
97
+ *
98
98
  * Refer to the documentation of {@link Miniball#support()} for more information on the
99
99
  * <i>support</i>.
100
100
  *
@@ -117,8 +117,8 @@ export class Subspan {
117
117
  }
118
118
 
119
119
  /**
120
- * The size of the instance's set <i>M</i>, a number between 0 and {@code dim+1}.
121
- * <p>
120
+ * The size of the instance's set <i>M</i>, a number between 0 and `dim+1`.
121
+ *
122
122
  * Complexity: O(1).
123
123
  *
124
124
  * @returns {int} <i>|M|</i>
@@ -129,7 +129,7 @@ export class Subspan {
129
129
 
130
130
  /**
131
131
  * Whether <i>S[i]</i> is a member of <i>M</i>.
132
- * <p>
132
+ *
133
133
  * Complexity: O(1)
134
134
  *
135
135
  * @param {int} i
@@ -142,10 +142,10 @@ export class Subspan {
142
142
 
143
143
  /**
144
144
  * The global index (into <i>S</i>) of an arbitrary element of <i>M</i>.
145
- * <p>
146
- * Precondition: {@code size()>0}
147
- * <p>
148
- * Postcondition: {@code isMember(anyMember())}
145
+ *
146
+ * Precondition: `size()>0`
147
+ *
148
+ * Postcondition: `isMember(anyMember())`
149
149
  * @returns {number}
150
150
  */
151
151
  anyMember() {
@@ -156,11 +156,11 @@ export class Subspan {
156
156
  * The index (into <i>S</i>) of the <i>i</i>th point in <i>M</i>. The points in <i>M</i> are
157
157
  * internally ordered (in an arbitrary way) and this order only changes when {@link add()} or
158
158
  * {@link remove()} is called.
159
- * <p>
159
+ *
160
160
  * Complexity: O(1)
161
161
  *
162
162
  * @param {number} i
163
- * the "local" index, 0 ≤ i < {@code size()}
163
+ * the "local" index, 0 ≤ i < `size()`
164
164
  * @return {number} <i>j</i> such that <i>S[j]</i> equals the <i>i</i>th point of M
165
165
  */
166
166
  globalIndex(i) {
@@ -184,7 +184,7 @@ export class Subspan {
184
184
  }
185
185
 
186
186
  /**
187
- * The point {@code members[r]} is called the <i>origin</i>.
187
+ * The point `members[r]` is called the <i>origin</i>.
188
188
  *
189
189
  * @return {number} index into <i>S</i> of the origin.
190
190
  * @private
@@ -201,13 +201,13 @@ export class Subspan {
201
201
  * </pre>
202
202
  *
203
203
  * We don't care about the signs here, for efficiency, so make sure not to rely on them anywhere.
204
- * <p>
204
+ *
205
205
  * <i>Source:</i> "Matrix Computations" (2nd edition) by Gene H. B. Golub & Charles F. B. Van Loan
206
206
  * (Johns Hopkins University Press, 1989), p. 216.
207
- * <p>
207
+ *
208
208
  * Note that the code of this class sometimes does not call this method but only mentions it in a
209
209
  * comment. The reason for this is performance; Java does not allow an efficient way of returning
210
- * a pair of doubles, so we sometimes manually "inline" {@code givens()} for the sake of
210
+ * a pair of doubles, so we sometimes manually "inline" `givens()` for the sake of
211
211
  * performance.
212
212
  * @param {number} a
213
213
  * @param {number} b
@@ -233,8 +233,8 @@ export class Subspan {
233
233
  * = QR</i>, updating <i>Q</i> and <i>R</i>. It assumes <i>r</i> to still be the old value, i.e.,
234
234
  * the index of the column used now for insertion; <i>r</i> is not altered by this routine and
235
235
  * should be changed by the caller afterwards.
236
- * <p>
237
- * Precondition: {@code r<dim}
236
+ *
237
+ * Precondition: `r<dim`
238
238
  * @private
239
239
  */
240
240
  appendColumn() {
@@ -268,9 +268,9 @@ export class Subspan {
268
268
 
269
269
  /**
270
270
  * Adds the point <i>S[index]</i> to the instance's set <i>M</i>.
271
- * <p>
272
- * Precondition: {@code !isMember(index)}
273
- * <p>
271
+ *
272
+ * Precondition: `!isMember(index)`
273
+ *
274
274
  * Complexity: O(dim^2).
275
275
  *
276
276
  * @param {number} index
@@ -301,9 +301,9 @@ export class Subspan {
301
301
  /**
302
302
  * Computes the vector <i>w</i> directed from point <i>p</i> to <i>v</i>, where <i>v</i> is the
303
303
  * point in <i>aff(M)</i> that lies nearest to <i>p</i>.
304
- * <p>
305
- * Precondition: {@code size()}>0
306
- * <p>
304
+ *
305
+ * Precondition: `size()>0`
306
+ *
307
307
  * Complexity: O(dim^2)
308
308
  *
309
309
  * @param {Array} p
@@ -389,14 +389,14 @@ export class Subspan {
389
389
  }
390
390
 
391
391
  /**
392
- * Calculates the {@code size()}-many coefficients in the representation of <i>p</i> as an affine
392
+ * Calculates the `size()`-many coefficients in the representation of <i>p</i> as an affine
393
393
  * combination of the points <i>M</i>.
394
- * <p>
395
- * The <i>i</i>th computed coefficient {@code lambdas[i]} corresponds to the <i>i</i>th point in
396
- * <i>M</i>, or, in other words, to the point in <i>S</i> with index {@code globalIndex(i)}.
397
- * <p>
394
+ *
395
+ * The <i>i</i>th computed coefficient `lambdas[i] `corresponds to the <i>i</i>th point in
396
+ * <i>M</i>, or, in other words, to the point in <i>S</i> with index `globalIndex(i)`.
397
+ *
398
398
  * Complexity: O(dim^2)
399
- * <p>
399
+ *
400
400
  * Preconditions: c lies in the affine hull aff(M) and size() > 0.
401
401
  * @param {Array} p
402
402
  * @param {Array} lambdas
@@ -441,7 +441,7 @@ export class Subspan {
441
441
  }
442
442
 
443
443
  /**
444
- * Given <i>R</i> in lower Hessenberg form with subdiagonal entries 0 to {@code pos-1} already all
444
+ * Given <i>R</i> in lower Hessenberg form with subdiagonal entries 0 to `pos-1` already all
445
445
  * zero, clears the remaining subdiagonal entries via Givens rotations.
446
446
  * @param {number} pos
447
447
  * @private