@woosh/meep-engine 2.59.6 → 2.60.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.
- package/build/meep.cjs +90 -91
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +90 -91
- package/package.json +1 -1
- package/src/core/bvh2/binary/IndexedBinaryBVH.js +2 -1
- package/src/core/bvh2/bvh3/ExplicitBinaryBoundingVolumeHierarchy.js +1 -1
- package/src/core/bvh2/serialization/serializeBinaryNode.js +4 -4
- package/src/core/collection/map/HashMap.js +1 -1
- package/src/core/collection/table/RowFirstTableSpec.js +1 -1
- package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_vectors_array_2d.js +1 -1
- package/src/core/geom/2d/quad-tree/QuadTreeNode.js +2 -2
- package/src/core/geom/2d/quad-tree/qt_collect_by_circle.js +1 -1
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +1 -1
- package/src/core/geom/3d/tetrahedra/validate_tetrahedral_mesh.js +1 -1
- package/src/core/geom/packing/miniball/Miniball.js +0 -1
- package/src/core/geom/packing/miniball/Subspan.js +1 -3
- package/src/core/graph/coloring/colorizeGraph.js +1 -1
- package/src/core/localization/Localization.js +11 -11
- package/src/core/model/ModuleRegistry.js +4 -4
- package/src/core/process/task/Task.js +3 -3
- package/src/engine/EngineConfiguration.js +0 -1
- package/src/engine/EngineHarness.js +1 -1
- package/src/engine/ecs/EntityComponentDataset.js +2 -2
- package/src/engine/ecs/parent/EntityNode.js +10 -10
- package/src/engine/graphics/camera/testClippingPlaneComputation.js +1 -1
- package/src/engine/graphics/ecs/camera/CameraSystem.d.ts +2 -3
- package/src/engine/graphics/ecs/camera/CameraSystem.js +2 -3
- package/src/engine/graphics/ecs/path/testPathDisplaySystem.js +1 -1
- package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +1 -1
- package/src/engine/graphics/ecs/water2/shader/testWaterShader.js +2 -2
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +2 -2
- package/src/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +1 -1
- package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +1 -1
- package/src/engine/graphics/render/view/CameraView.js +1 -1
- package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +1 -1
- package/src/engine/graphics/shaders/ClearShader.js +1 -1
- package/src/engine/graphics/shadows/testShadowMapRendering.js +1 -1
- package/src/misc/makeMaterialIconCached.js +8 -1
package/build/meep.module.js
CHANGED
|
@@ -55940,8 +55940,9 @@ class IndexedBinaryBVH {
|
|
|
55940
55940
|
}
|
|
55941
55941
|
|
|
55942
55942
|
/**
|
|
55943
|
+
* @template T
|
|
55943
55944
|
* @deprecated use {@link #writeLeaf} instead followed by {@link #unsortedBuiltIntermediate}
|
|
55944
|
-
* @param {function(index:number,offset:number,data
|
|
55945
|
+
* @param {function(index:number,offset:number,data:T, writeBox:function):void} visitor
|
|
55945
55946
|
*/
|
|
55946
55947
|
setLeafs(visitor) {
|
|
55947
55948
|
let offset = this.binaryNodeCount * 6;
|
|
@@ -60407,7 +60408,7 @@ class HashMap {
|
|
|
60407
60408
|
|
|
60408
60409
|
/**
|
|
60409
60410
|
* Note that dead entries are marked as such with a special reserved hash values, so records can be reused for new entries
|
|
60410
|
-
* @type {MapEntry<K,V
|
|
60411
|
+
* @type {Array<MapEntry<K,V>>}
|
|
60411
60412
|
*/
|
|
60412
60413
|
#entries = new Array(0);
|
|
60413
60414
|
|
|
@@ -64122,7 +64123,7 @@ class Task {
|
|
|
64122
64123
|
|
|
64123
64124
|
/**
|
|
64124
64125
|
*
|
|
64125
|
-
* @type {function(Task, executor:
|
|
64126
|
+
* @type {function(Task, executor:ConcurrentExecutor)}
|
|
64126
64127
|
*/
|
|
64127
64128
|
this.initialize = initializer;
|
|
64128
64129
|
|
|
@@ -64216,7 +64217,7 @@ class Task {
|
|
|
64216
64217
|
|
|
64217
64218
|
/**
|
|
64218
64219
|
*
|
|
64219
|
-
* @param {(Task|TaskGroup)
|
|
64220
|
+
* @param {Array<(Task|TaskGroup)>} tasks
|
|
64220
64221
|
*/
|
|
64221
64222
|
addDependencies(tasks) {
|
|
64222
64223
|
if (!Array.isArray(tasks)) {
|
|
@@ -64272,7 +64273,7 @@ class Task {
|
|
|
64272
64273
|
|
|
64273
64274
|
/**
|
|
64274
64275
|
*
|
|
64275
|
-
* @param {(Task|TaskGroup)
|
|
64276
|
+
* @param {Array<(Task|TaskGroup)>} tasks
|
|
64276
64277
|
* @return {Promise}
|
|
64277
64278
|
*/
|
|
64278
64279
|
static promiseAll(tasks) {
|
|
@@ -70652,14 +70653,13 @@ ResourceAccessSpecification.prototype.isResourceAccessSpecification = true;
|
|
|
70652
70653
|
class CameraSystem extends System {
|
|
70653
70654
|
/**
|
|
70654
70655
|
*
|
|
70655
|
-
* @param {THREE.Scene} scene
|
|
70656
70656
|
* @param {GraphicsEngine} graphics
|
|
70657
70657
|
* @constructor
|
|
70658
70658
|
*/
|
|
70659
|
-
constructor(
|
|
70659
|
+
constructor(graphics) {
|
|
70660
70660
|
super();
|
|
70661
70661
|
|
|
70662
|
-
this.scene = scene;
|
|
70662
|
+
this.scene = graphics.scene;
|
|
70663
70663
|
|
|
70664
70664
|
this.dependencies = [Camera, Transform];
|
|
70665
70665
|
|
|
@@ -72063,55 +72063,28 @@ class TerrainSystem extends System {
|
|
|
72063
72063
|
}
|
|
72064
72064
|
|
|
72065
72065
|
/**
|
|
72066
|
-
*
|
|
72066
|
+
* Remove first occurrence of element from the array
|
|
72067
|
+
* @template T
|
|
72068
|
+
* @param {T[]} array
|
|
72069
|
+
* @param {T} element
|
|
72070
|
+
* @param {number} [start_index]
|
|
72071
|
+
* @param {number} [length]
|
|
72072
|
+
* @return {boolean} true if element was removed, false if it was not found
|
|
72067
72073
|
*/
|
|
72068
|
-
|
|
72069
|
-
/**
|
|
72070
|
-
* * @constructor
|
|
72071
|
-
*/
|
|
72072
|
-
constructor() {
|
|
72073
|
-
/**
|
|
72074
|
-
* Entity representing logical parent.
|
|
72075
|
-
* Must not be mutated (changed) while component is attached to a dataset
|
|
72076
|
-
* @type {number}
|
|
72077
|
-
*/
|
|
72078
|
-
this.entity = -1;
|
|
72079
|
-
}
|
|
72080
|
-
|
|
72081
|
-
/**
|
|
72082
|
-
*
|
|
72083
|
-
* @param {number} entity
|
|
72084
|
-
* @returns {ParentEntity}
|
|
72085
|
-
*/
|
|
72086
|
-
static from(entity) {
|
|
72087
|
-
const r = new ParentEntity();
|
|
72088
|
-
|
|
72089
|
-
r.entity = entity;
|
|
72074
|
+
function array_remove_first(array, element, start_index = 0, length = array.length) {
|
|
72090
72075
|
|
|
72091
|
-
|
|
72092
|
-
}
|
|
72076
|
+
const end_index = start_index + length;
|
|
72093
72077
|
|
|
72094
|
-
|
|
72095
|
-
|
|
72096
|
-
|
|
72097
|
-
};
|
|
72098
|
-
}
|
|
72078
|
+
for (let i = start_index; i < end_index; i++) {
|
|
72079
|
+
if (array[i] === element) {
|
|
72080
|
+
array.splice(i, 1);
|
|
72099
72081
|
|
|
72100
|
-
|
|
72101
|
-
|
|
72082
|
+
return true;
|
|
72083
|
+
}
|
|
72102
72084
|
}
|
|
72103
|
-
}
|
|
72104
72085
|
|
|
72105
|
-
|
|
72106
|
-
|
|
72107
|
-
* @type {string}
|
|
72108
|
-
*/
|
|
72109
|
-
ParentEntity.typeName = "ParentEntity";
|
|
72110
|
-
/**
|
|
72111
|
-
*
|
|
72112
|
-
* @type {boolean}
|
|
72113
|
-
*/
|
|
72114
|
-
ParentEntity.serializable = false;
|
|
72086
|
+
return false;
|
|
72087
|
+
}
|
|
72115
72088
|
|
|
72116
72089
|
/**
|
|
72117
72090
|
* de Bruijn sequence
|
|
@@ -75136,30 +75109,6 @@ function checkExistingComponents(entity, components, dataset) {
|
|
|
75136
75109
|
return true;
|
|
75137
75110
|
}
|
|
75138
75111
|
|
|
75139
|
-
/**
|
|
75140
|
-
* Remove first occurrence of element from the array
|
|
75141
|
-
* @template T
|
|
75142
|
-
* @param {T[]} array
|
|
75143
|
-
* @param {T} element
|
|
75144
|
-
* @param {number} [start_index]
|
|
75145
|
-
* @param {number} [length]
|
|
75146
|
-
* @return {boolean} true if element was removed, false if it was not found
|
|
75147
|
-
*/
|
|
75148
|
-
function array_remove_first(array, element, start_index = 0, length = array.length) {
|
|
75149
|
-
|
|
75150
|
-
const end_index = start_index + length;
|
|
75151
|
-
|
|
75152
|
-
for (let i = start_index; i < end_index; i++) {
|
|
75153
|
-
if (array[i] === element) {
|
|
75154
|
-
array.splice(i, 1);
|
|
75155
|
-
|
|
75156
|
-
return true;
|
|
75157
|
-
}
|
|
75158
|
-
}
|
|
75159
|
-
|
|
75160
|
-
return false;
|
|
75161
|
-
}
|
|
75162
|
-
|
|
75163
75112
|
const TransformAttachmentFlags = {
|
|
75164
75113
|
/**
|
|
75165
75114
|
* Update will be performed when component is attached.
|
|
@@ -75277,6 +75226,57 @@ const EntityNodeFlags = {
|
|
|
75277
75226
|
TransformObserved: 2
|
|
75278
75227
|
};
|
|
75279
75228
|
|
|
75229
|
+
/**
|
|
75230
|
+
* Component representing logical attachment to another entity, when parent disappears - so does the child
|
|
75231
|
+
*/
|
|
75232
|
+
class ParentEntity {
|
|
75233
|
+
/**
|
|
75234
|
+
* * @constructor
|
|
75235
|
+
*/
|
|
75236
|
+
constructor() {
|
|
75237
|
+
/**
|
|
75238
|
+
* Entity representing logical parent.
|
|
75239
|
+
* Must not be mutated (changed) while component is attached to a dataset
|
|
75240
|
+
* @type {number}
|
|
75241
|
+
*/
|
|
75242
|
+
this.entity = -1;
|
|
75243
|
+
}
|
|
75244
|
+
|
|
75245
|
+
/**
|
|
75246
|
+
*
|
|
75247
|
+
* @param {number} entity
|
|
75248
|
+
* @returns {ParentEntity}
|
|
75249
|
+
*/
|
|
75250
|
+
static from(entity) {
|
|
75251
|
+
const r = new ParentEntity();
|
|
75252
|
+
|
|
75253
|
+
r.entity = entity;
|
|
75254
|
+
|
|
75255
|
+
return r;
|
|
75256
|
+
}
|
|
75257
|
+
|
|
75258
|
+
toJSON() {
|
|
75259
|
+
return {
|
|
75260
|
+
entity: this.entity,
|
|
75261
|
+
};
|
|
75262
|
+
}
|
|
75263
|
+
|
|
75264
|
+
fromJSON({ entity }) {
|
|
75265
|
+
this.entity = entity;
|
|
75266
|
+
}
|
|
75267
|
+
}
|
|
75268
|
+
|
|
75269
|
+
/**
|
|
75270
|
+
* @readonly
|
|
75271
|
+
* @type {string}
|
|
75272
|
+
*/
|
|
75273
|
+
ParentEntity.typeName = "ParentEntity";
|
|
75274
|
+
/**
|
|
75275
|
+
*
|
|
75276
|
+
* @type {boolean}
|
|
75277
|
+
*/
|
|
75278
|
+
ParentEntity.serializable = false;
|
|
75279
|
+
|
|
75280
75280
|
const DEFAULT_FLAGS$1 = EntityNodeFlags.LiveManagement;
|
|
75281
75281
|
|
|
75282
75282
|
class EntityNode {
|
|
@@ -75385,7 +75385,7 @@ class EntityNode {
|
|
|
75385
75385
|
|
|
75386
75386
|
/**
|
|
75387
75387
|
*
|
|
75388
|
-
* @param {(EntityNode)
|
|
75388
|
+
* @param {function(node:EntityNode):*} visitor
|
|
75389
75389
|
* @param {*} [context]
|
|
75390
75390
|
*/
|
|
75391
75391
|
traverseChildren(visitor, context) {
|
|
@@ -75394,7 +75394,7 @@ class EntityNode {
|
|
|
75394
75394
|
|
|
75395
75395
|
/**
|
|
75396
75396
|
*
|
|
75397
|
-
* @return {Readonly<EntityNode
|
|
75397
|
+
* @return {Readonly<Array<EntityNode>>}
|
|
75398
75398
|
*/
|
|
75399
75399
|
get children() {
|
|
75400
75400
|
return this.__children;
|
|
@@ -79615,7 +79615,7 @@ class ExplicitBinaryBoundingVolumeHierarchy {
|
|
|
79615
79615
|
|
|
79616
79616
|
/**
|
|
79617
79617
|
*
|
|
79618
|
-
* @param {(node:number, tree:ExplicitBinaryBoundingVolumeHierarchy)
|
|
79618
|
+
* @param {function(node:number, tree:ExplicitBinaryBoundingVolumeHierarchy):void} callback
|
|
79619
79619
|
* @param {*} [ctx]
|
|
79620
79620
|
*/
|
|
79621
79621
|
traverse(callback, ctx) {
|
|
@@ -90391,7 +90391,7 @@ class CameraView {
|
|
|
90391
90391
|
|
|
90392
90392
|
/**
|
|
90393
90393
|
*
|
|
90394
|
-
* @type {{transform:(Float32Array, Float32Array)
|
|
90394
|
+
* @type {Array<{transform:function(Float32Array, Float32Array):void, context:*}>}
|
|
90395
90395
|
*/
|
|
90396
90396
|
this.projection_modifiers = [];
|
|
90397
90397
|
}
|
|
@@ -93760,7 +93760,7 @@ class EntityComponentDataset {
|
|
|
93760
93760
|
* Performs traversal on a subset of entities which have specified components.
|
|
93761
93761
|
* @example traverseEntities([Transform,Renderable,Tag],function(transform, renderable, tag, entity){ ... }, this);
|
|
93762
93762
|
* @param {Array} classes
|
|
93763
|
-
* @param {function:boolean
|
|
93763
|
+
* @param {function(...args):boolean} visitor Visitor can return optional "false" to terminate traversal earlier
|
|
93764
93764
|
* @param {object} [thisArg] specifies context object on which callbacks are to be called, optional
|
|
93765
93765
|
*/
|
|
93766
93766
|
traverseEntities(classes, visitor, thisArg) {
|
|
@@ -94385,7 +94385,7 @@ class EntityComponentDataset {
|
|
|
94385
94385
|
/**
|
|
94386
94386
|
* Main utility of this method is to facilitate serialization.
|
|
94387
94387
|
* @param {Array} componentClasses
|
|
94388
|
-
* @param {function(componentIndex:number,components:
|
|
94388
|
+
* @param {function(componentIndex:number,components:Array, componentCount:number)} visitor
|
|
94389
94389
|
*/
|
|
94390
94390
|
traverseEntitiesCompactedFiltered(componentClasses, visitor) {
|
|
94391
94391
|
|
|
@@ -105511,7 +105511,7 @@ class Localization {
|
|
|
105511
105511
|
this.debug = true;
|
|
105512
105512
|
|
|
105513
105513
|
/**
|
|
105514
|
-
* @type {Cache<string
|
|
105514
|
+
* @type {Cache<Array<string>, string>}
|
|
105515
105515
|
* @private
|
|
105516
105516
|
*/
|
|
105517
105517
|
this.__failure_cache = new Cache({
|
|
@@ -105631,7 +105631,7 @@ class Localization {
|
|
|
105631
105631
|
* @param {number} value
|
|
105632
105632
|
*/
|
|
105633
105633
|
formatIntegerByThousands(value) {
|
|
105634
|
-
const formatter = new Intl.NumberFormat(this.locale.getValue(), {
|
|
105634
|
+
const formatter = new Intl.NumberFormat(this.locale.getValue(), {useGrouping: true});
|
|
105635
105635
|
|
|
105636
105636
|
return formatter.format(value);
|
|
105637
105637
|
}
|
|
@@ -105716,7 +105716,7 @@ class ModuleRegistry {
|
|
|
105716
105716
|
#modules = new Map();
|
|
105717
105717
|
/**
|
|
105718
105718
|
*
|
|
105719
|
-
* @type {Map<*,string
|
|
105719
|
+
* @type {Map<*,Array<string>>}
|
|
105720
105720
|
*/
|
|
105721
105721
|
#reverse_lookup = new Map();
|
|
105722
105722
|
|
|
@@ -105744,7 +105744,7 @@ class ModuleRegistry {
|
|
|
105744
105744
|
|
|
105745
105745
|
/**
|
|
105746
105746
|
*
|
|
105747
|
-
* @param {(name:string,
|
|
105747
|
+
* @param {function(name:string,module:*):void} visitor
|
|
105748
105748
|
*/
|
|
105749
105749
|
traverse(visitor) {
|
|
105750
105750
|
this.#modules.forEach((klass, name) => visitor(name, klass));
|
|
@@ -105762,7 +105762,7 @@ class ModuleRegistry {
|
|
|
105762
105762
|
|
|
105763
105763
|
/**
|
|
105764
105764
|
*
|
|
105765
|
-
* @param {
|
|
105765
|
+
* @param {string} name
|
|
105766
105766
|
* @returns {boolean}
|
|
105767
105767
|
*/
|
|
105768
105768
|
has(name) {
|
|
@@ -105771,7 +105771,7 @@ class ModuleRegistry {
|
|
|
105771
105771
|
|
|
105772
105772
|
/**
|
|
105773
105773
|
* @template T
|
|
105774
|
-
* @param {
|
|
105774
|
+
* @param {string} name
|
|
105775
105775
|
* @param {T} module
|
|
105776
105776
|
* @returns {boolean}
|
|
105777
105777
|
*/
|
|
@@ -112571,7 +112571,7 @@ class QuadTreeNode extends AABB2 {
|
|
|
112571
112571
|
|
|
112572
112572
|
/**
|
|
112573
112573
|
*
|
|
112574
|
-
* @param {QuadTreeDatum<D
|
|
112574
|
+
* @param {Array<QuadTreeDatum<D>>} result
|
|
112575
112575
|
* @param {number} x
|
|
112576
112576
|
* @param {number} y
|
|
112577
112577
|
* @returns {number} number of intersecting objects added to the result
|
|
@@ -112590,7 +112590,7 @@ class QuadTreeNode extends AABB2 {
|
|
|
112590
112590
|
|
|
112591
112591
|
/**
|
|
112592
112592
|
*
|
|
112593
|
-
* @param {QuadTreeDatum<D
|
|
112593
|
+
* @param {Array<QuadTreeDatum<D>>} result
|
|
112594
112594
|
* @param {number} x0
|
|
112595
112595
|
* @param {number} y0
|
|
112596
112596
|
* @param {number} x1
|
|
@@ -120169,7 +120169,6 @@ class EngineConfiguration {
|
|
|
120169
120169
|
}
|
|
120170
120170
|
|
|
120171
120171
|
/**
|
|
120172
|
-
*
|
|
120173
120172
|
* @param {System} systems
|
|
120174
120173
|
*/
|
|
120175
120174
|
addManySystems(...systems) {
|
|
@@ -121035,7 +121034,7 @@ class EngineHarness {
|
|
|
121035
121034
|
em.addSystem(new TopDownCameraControllerSystem());
|
|
121036
121035
|
}
|
|
121037
121036
|
if (em.getSystem(CameraSystem) === null) {
|
|
121038
|
-
em.addSystem(new CameraSystem(engine.graphics
|
|
121037
|
+
em.addSystem(new CameraSystem(engine.graphics));
|
|
121039
121038
|
}
|
|
121040
121039
|
|
|
121041
121040
|
if (em.getSystem(SoundListenerSystem) === null) {
|
package/package.json
CHANGED
|
@@ -164,8 +164,9 @@ export default class IndexedBinaryBVH {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
/**
|
|
167
|
+
* @template T
|
|
167
168
|
* @deprecated use {@link #writeLeaf} instead followed by {@link #unsortedBuiltIntermediate}
|
|
168
|
-
* @param {function(index:number,offset:number,data
|
|
169
|
+
* @param {function(index:number,offset:number,data:T, writeBox:function):void} visitor
|
|
169
170
|
*/
|
|
170
171
|
setLeafs(visitor) {
|
|
171
172
|
let offset = this.binaryNodeCount * 6;
|
|
@@ -993,7 +993,7 @@ export class ExplicitBinaryBoundingVolumeHierarchy {
|
|
|
993
993
|
|
|
994
994
|
/**
|
|
995
995
|
*
|
|
996
|
-
* @param {(node:number, tree:ExplicitBinaryBoundingVolumeHierarchy)
|
|
996
|
+
* @param {function(node:number, tree:ExplicitBinaryBoundingVolumeHierarchy):void} callback
|
|
997
997
|
* @param {*} [ctx]
|
|
998
998
|
*/
|
|
999
999
|
traverse(callback, ctx) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import {serializeAABB3} from "../../geom/3d/aabb/serializeAABB3.js";
|
|
2
|
+
import {isLeaf, serializeLeafNode} from "../LeafNode.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
6
|
* @param {BinaryBuffer} buffer
|
|
7
7
|
* @param {BinaryNode} node
|
|
8
|
-
* @param {function(buffer:BinaryBuffer,
|
|
8
|
+
* @param {function(buffer:BinaryBuffer,value:any):void} leafValueSerializer
|
|
9
9
|
*/
|
|
10
10
|
function serializeBinaryNode(buffer, node, leafValueSerializer) {
|
|
11
11
|
serializeAABB3(buffer, node);
|
|
@@ -28,4 +28,4 @@ function serializeBinaryNode(buffer, node, leafValueSerializer) {
|
|
|
28
28
|
serializeChild(node.right);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export {
|
|
31
|
+
export {serializeBinaryNode};
|
|
@@ -168,7 +168,7 @@ export class HashMap {
|
|
|
168
168
|
|
|
169
169
|
/**
|
|
170
170
|
* Note that dead entries are marked as such with a special reserved hash values, so records can be reused for new entries
|
|
171
|
-
* @type {MapEntry<K,V
|
|
171
|
+
* @type {Array<MapEntry<K,V>>}
|
|
172
172
|
*/
|
|
173
173
|
#entries = new Array(0);
|
|
174
174
|
|
|
@@ -54,7 +54,7 @@ export const DataType2DataViewWriters = {
|
|
|
54
54
|
*
|
|
55
55
|
* @param {BinaryDataType[]} types
|
|
56
56
|
* @param {EndianType} [endianType]
|
|
57
|
-
* @returns {(data_view:DataView, byte_offset:number, result:number[])
|
|
57
|
+
* @returns {function(data_view:DataView, byte_offset:number, result:number[]):void}
|
|
58
58
|
*/
|
|
59
59
|
function genRowReader(types, endianType = EndianType.BigEndian) {
|
|
60
60
|
let offset = 0;
|
package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_vectors_array_2d.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
* @param {Vector2} p1
|
|
8
8
|
* @param {Vector2} p2
|
|
9
9
|
* @param {Vector2} p3
|
|
10
|
-
* @returns {[
|
|
10
|
+
* @returns {number[]} 2 elements
|
|
11
11
|
*/
|
|
12
12
|
export function line_segment_compute_line_segment_intersection_vectors_array_2d(p0, p1, p2, p3) {
|
|
13
13
|
const p0_x = p0.x;
|
|
@@ -487,7 +487,7 @@ export class QuadTreeNode extends AABB2 {
|
|
|
487
487
|
|
|
488
488
|
/**
|
|
489
489
|
*
|
|
490
|
-
* @param {QuadTreeDatum<D
|
|
490
|
+
* @param {Array<QuadTreeDatum<D>>} result
|
|
491
491
|
* @param {number} x
|
|
492
492
|
* @param {number} y
|
|
493
493
|
* @returns {number} number of intersecting objects added to the result
|
|
@@ -506,7 +506,7 @@ export class QuadTreeNode extends AABB2 {
|
|
|
506
506
|
|
|
507
507
|
/**
|
|
508
508
|
*
|
|
509
|
-
* @param {QuadTreeDatum<D
|
|
509
|
+
* @param {Array<QuadTreeDatum<D>>} result
|
|
510
510
|
* @param {number} x0
|
|
511
511
|
* @param {number} y0
|
|
512
512
|
* @param {number} x1
|
|
@@ -135,7 +135,7 @@ export class TetrahedralMesh {
|
|
|
135
135
|
|
|
136
136
|
/**
|
|
137
137
|
* Traverse tetrahedrons
|
|
138
|
-
* @param {(tet:number,mesh:TetrahedralMesh)
|
|
138
|
+
* @param {function(tet:number,mesh:TetrahedralMesh):*} visitor
|
|
139
139
|
* @param {*} [thisArg]
|
|
140
140
|
*/
|
|
141
141
|
forEach(visitor, thisArg) {
|
|
@@ -134,7 +134,7 @@ function is_tetrahedron_degenerate(mesh, tet) {
|
|
|
134
134
|
*
|
|
135
135
|
* @param {TetrahedralMesh} mesh
|
|
136
136
|
* @param {ArrayLike<number>} points
|
|
137
|
-
* @param {(problem:string)
|
|
137
|
+
* @param {function(problem:string):*} [consumer]
|
|
138
138
|
* @returns {boolean}
|
|
139
139
|
*/
|
|
140
140
|
export function validate_tetrahedral_mesh(mesh, points, consumer = noop) {
|
|
@@ -273,8 +273,7 @@ export class Subspan {
|
|
|
273
273
|
*
|
|
274
274
|
* Complexity: O(dim^2).
|
|
275
275
|
*
|
|
276
|
-
* @param {number} index
|
|
277
|
-
* index into <i>S</i> of the point to add
|
|
276
|
+
* @param {number} index index into <i>S</i> of the point to add
|
|
278
277
|
*/
|
|
279
278
|
add(index) {
|
|
280
279
|
let o = this.origin();
|
|
@@ -310,7 +309,6 @@ export class Subspan {
|
|
|
310
309
|
* Euclidean coordinates of point <i>p</i>
|
|
311
310
|
* @param {Array} w
|
|
312
311
|
* the squared length of <i>w</i>
|
|
313
|
-
* @return
|
|
314
312
|
* @return {number}
|
|
315
313
|
*/
|
|
316
314
|
shortestVectorToSpan(p, w) {
|
|
@@ -118,7 +118,7 @@ function updateNN(NN, a, vertexCount, colors, colorNumber) {
|
|
|
118
118
|
* @param {number[]} NN
|
|
119
119
|
* @param {number[]} color
|
|
120
120
|
* @param {number} colorNumber
|
|
121
|
-
* @return {
|
|
121
|
+
* @return {number[]}
|
|
122
122
|
*/
|
|
123
123
|
function findSuitableY(vertexCount, a, NN, color, colorNumber) {
|
|
124
124
|
var temp, tmp_y, y = 0;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {distance as levenshtein_distance} from "fastest-levenshtein";
|
|
2
|
+
import {parseTooltipString} from "../../view/tooltip/gml/parser/parseTooltipString.js";
|
|
3
|
+
import {assert} from "../assert.js";
|
|
4
|
+
import {Cache} from "../cache/Cache.js";
|
|
5
|
+
import {computeHashArray} from "../collection/array/computeHashArray.js";
|
|
4
6
|
import ObservedString from "../model/ObservedString.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { computeHashArray } from "../collection/array/computeHashArray.js";
|
|
10
|
-
import { LanguageMetadata } from "./LanguageMetadata.js";
|
|
7
|
+
import {seedVariablesIntoTemplateString} from "../parser/seedVariablesIntoTemplateString.js";
|
|
8
|
+
import {STRING_TEMPLATE_VARIABLE_REGEX} from "../parser/STRING_TEMPLATE_VARIABLE_REGEX.js";
|
|
9
|
+
import {computeStringHash} from "../primitives/strings/computeStringHash.js";
|
|
10
|
+
import {LanguageMetadata} from "./LanguageMetadata.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Validation utility method
|
|
@@ -56,7 +56,7 @@ export class Localization {
|
|
|
56
56
|
this.debug = true;
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
* @type {Cache<string
|
|
59
|
+
* @type {Cache<Array<string>, string>}
|
|
60
60
|
* @private
|
|
61
61
|
*/
|
|
62
62
|
this.__failure_cache = new Cache({
|
|
@@ -176,7 +176,7 @@ export class Localization {
|
|
|
176
176
|
* @param {number} value
|
|
177
177
|
*/
|
|
178
178
|
formatIntegerByThousands(value) {
|
|
179
|
-
const formatter = new Intl.NumberFormat(this.locale.getValue(), {
|
|
179
|
+
const formatter = new Intl.NumberFormat(this.locale.getValue(), {useGrouping: true});
|
|
180
180
|
|
|
181
181
|
return formatter.format(value);
|
|
182
182
|
}
|
|
@@ -9,7 +9,7 @@ export class ModuleRegistry {
|
|
|
9
9
|
#modules = new Map();
|
|
10
10
|
/**
|
|
11
11
|
*
|
|
12
|
-
* @type {Map<*,string
|
|
12
|
+
* @type {Map<*,Array<string>>}
|
|
13
13
|
*/
|
|
14
14
|
#reverse_lookup = new Map();
|
|
15
15
|
|
|
@@ -37,7 +37,7 @@ export class ModuleRegistry {
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
*
|
|
40
|
-
* @param {(name:string,
|
|
40
|
+
* @param {function(name:string,module:*):void} visitor
|
|
41
41
|
*/
|
|
42
42
|
traverse(visitor) {
|
|
43
43
|
this.#modules.forEach((klass, name) => visitor(name, klass));
|
|
@@ -55,7 +55,7 @@ export class ModuleRegistry {
|
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
*
|
|
58
|
-
* @param {
|
|
58
|
+
* @param {string} name
|
|
59
59
|
* @returns {boolean}
|
|
60
60
|
*/
|
|
61
61
|
has(name) {
|
|
@@ -64,7 +64,7 @@ export class ModuleRegistry {
|
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* @template T
|
|
67
|
-
* @param {
|
|
67
|
+
* @param {string} name
|
|
68
68
|
* @param {T} module
|
|
69
69
|
* @returns {boolean}
|
|
70
70
|
*/
|
|
@@ -55,7 +55,7 @@ class Task {
|
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
*
|
|
58
|
-
* @type {function(Task, executor:
|
|
58
|
+
* @type {function(Task, executor:ConcurrentExecutor)}
|
|
59
59
|
*/
|
|
60
60
|
this.initialize = initializer;
|
|
61
61
|
|
|
@@ -149,7 +149,7 @@ class Task {
|
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
151
|
*
|
|
152
|
-
* @param {(Task|TaskGroup)
|
|
152
|
+
* @param {Array<(Task|TaskGroup)>} tasks
|
|
153
153
|
*/
|
|
154
154
|
addDependencies(tasks) {
|
|
155
155
|
if (!Array.isArray(tasks)) {
|
|
@@ -205,7 +205,7 @@ class Task {
|
|
|
205
205
|
|
|
206
206
|
/**
|
|
207
207
|
*
|
|
208
|
-
* @param {(Task|TaskGroup)
|
|
208
|
+
* @param {Array<(Task|TaskGroup)>} tasks
|
|
209
209
|
* @return {Promise}
|
|
210
210
|
*/
|
|
211
211
|
static promiseAll(tasks) {
|
|
@@ -184,7 +184,7 @@ export class EngineHarness {
|
|
|
184
184
|
em.addSystem(new TopDownCameraControllerSystem());
|
|
185
185
|
}
|
|
186
186
|
if (em.getSystem(CameraSystem) === null) {
|
|
187
|
-
em.addSystem(new CameraSystem(engine.graphics
|
|
187
|
+
em.addSystem(new CameraSystem(engine.graphics))
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
if (em.getSystem(SoundListenerSystem) === null) {
|
|
@@ -1094,7 +1094,7 @@ export class EntityComponentDataset {
|
|
|
1094
1094
|
* Performs traversal on a subset of entities which have specified components.
|
|
1095
1095
|
* @example traverseEntities([Transform,Renderable,Tag],function(transform, renderable, tag, entity){ ... }, this);
|
|
1096
1096
|
* @param {Array} classes
|
|
1097
|
-
* @param {function:boolean
|
|
1097
|
+
* @param {function(...args):boolean} visitor Visitor can return optional "false" to terminate traversal earlier
|
|
1098
1098
|
* @param {object} [thisArg] specifies context object on which callbacks are to be called, optional
|
|
1099
1099
|
*/
|
|
1100
1100
|
traverseEntities(classes, visitor, thisArg) {
|
|
@@ -1719,7 +1719,7 @@ export class EntityComponentDataset {
|
|
|
1719
1719
|
/**
|
|
1720
1720
|
* Main utility of this method is to facilitate serialization.
|
|
1721
1721
|
* @param {Array} componentClasses
|
|
1722
|
-
* @param {function(componentIndex:number,components:
|
|
1722
|
+
* @param {function(componentIndex:number,components:Array, componentCount:number)} visitor
|
|
1723
1723
|
*/
|
|
1724
1724
|
traverseEntitiesCompactedFiltered(componentClasses, visitor) {
|
|
1725
1725
|
|