@woosh/meep-engine 2.118.5 → 2.118.7
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 +533 -485
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +533 -485
- package/package.json +4 -4
- package/src/core/binary/BitSet.d.ts +0 -5
- package/src/core/binary/BitSet.d.ts.map +1 -1
- package/src/core/binary/BitSet.js +2 -10
- package/src/core/binary/base64/Base64.d.ts.map +1 -0
- package/src/core/binary/largest_common_alignment_uint32.d.ts.map +1 -0
- package/src/core/{collection/array/typed → binary}/largest_common_alignment_uint32.js +1 -1
- package/src/core/collection/CuckooFilter.d.ts +34 -8
- package/src/core/collection/CuckooFilter.d.ts.map +1 -1
- package/src/core/collection/CuckooFilter.js +29 -1
- package/src/core/collection/array/typed/array_buffer_copy.d.ts.map +1 -1
- package/src/core/collection/array/typed/array_buffer_copy.js +3 -1
- package/src/core/collection/array/typed/is_array_buffer_equals.js +1 -1
- package/src/core/collection/array/typed/is_typed_array_equals.js +1 -1
- package/src/core/collection/map/HashMap.js +7 -7
- package/src/core/color/Color.d.ts.map +1 -1
- package/src/core/color/Color.js +12 -5
- package/src/core/color/operations/color_desaturate.d.ts +7 -0
- package/src/core/color/operations/color_desaturate.d.ts.map +1 -0
- package/src/core/color/operations/color_desaturate.js +16 -0
- package/src/core/geom/2d/aabb/AABB2.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/AABB2.js +43 -22
- package/src/core/geom/2d/aabb/aabb2_compute_center_from_multiple.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/aabb2_compute_center_from_multiple.js +6 -1
- package/src/core/geom/2d/quad-tree/QuadTreeDatum.d.ts +3 -5
- package/src/core/geom/2d/quad-tree/QuadTreeDatum.d.ts.map +1 -1
- package/src/core/geom/2d/quad-tree/QuadTreeDatum.js +9 -19
- package/src/core/geom/2d/rectangle_to_aabb.d.ts +8 -0
- package/src/core/geom/2d/rectangle_to_aabb.d.ts.map +1 -0
- package/src/core/geom/2d/rectangle_to_aabb.js +29 -0
- package/src/core/geom/3d/tetrahedra/TetrahedralMesh.js +1 -1
- package/src/core/graph/graph_compute_distance_matrix.d.ts +1 -1
- package/src/core/graph/graph_compute_distance_matrix.d.ts.map +1 -1
- package/src/core/graph/graph_compute_distance_matrix.js +1 -1
- package/src/core/graph/graph_compute_laplacian_matrix.d.ts +1 -1
- package/src/core/graph/graph_compute_laplacian_matrix.d.ts.map +1 -1
- package/src/core/graph/graph_compute_laplacian_matrix.js +1 -1
- package/src/core/graph/layout/CircleLayout.js +2 -2
- package/src/core/graph/layout/box/BoxLayouter.d.ts.map +1 -1
- package/src/core/graph/layout/box/BoxLayouter.js +11 -5
- package/src/core/graph/layout/box/aabb2_force_into_container.d.ts +7 -0
- package/src/core/graph/layout/box/aabb2_force_into_container.d.ts.map +1 -0
- package/src/core/graph/layout/box/aabb2_force_into_container.js +56 -0
- package/src/core/graph/layout/box/applyCentralGravityAABB2.d.ts.map +1 -1
- package/src/core/graph/layout/box/applyCentralGravityAABB2.js +2 -8
- package/src/core/graph/layout/box/forceIntoBox.d.ts +4 -2
- package/src/core/graph/layout/box/forceIntoBox.d.ts.map +1 -1
- package/src/core/graph/layout/box/forceIntoBox.js +5 -31
- package/src/core/graph/layout/box/position_box_next_to_box.d.ts +10 -0
- package/src/core/graph/layout/box/position_box_next_to_box.d.ts.map +1 -0
- package/src/core/graph/layout/box/position_box_next_to_box.js +218 -0
- package/src/core/graph/layout/box/pullBoxTowardsPoint.d.ts.map +1 -1
- package/src/core/graph/layout/box/pullBoxTowardsPoint.js +8 -3
- package/src/core/graph/layout/box/resolveAABB2Overlap.d.ts +2 -2
- package/src/core/graph/layout/box/resolveAABB2Overlap.d.ts.map +1 -1
- package/src/core/graph/layout/box/resolveAABB2Overlap.js +12 -4
- package/src/core/graph/layout/box/resolveBoxOverlapUsingForce.d.ts +1 -0
- package/src/core/graph/layout/box/resolveBoxOverlapUsingForce.d.ts.map +1 -1
- package/src/core/graph/layout/box/resolveBoxOverlapUsingForce.js +1 -0
- package/src/core/math/matrix/SquareMatrix.d.ts.map +1 -0
- package/src/core/{graph → math/matrix}/SquareMatrix.js +3 -3
- package/src/core/math/spline/cubicCurve.d.ts +3 -8
- package/src/core/math/spline/cubicCurve.d.ts.map +1 -1
- package/src/core/math/spline/cubicCurve.js +4 -32
- package/src/core/model/reactive/js/compileReactiveToJS.d.ts.map +1 -1
- package/src/core/model/reactive/js/compileReactiveToJS.js +56 -1
- package/src/core/model/reactive/model/terminal/ReactiveReference.d.ts.map +1 -1
- package/src/core/model/reactive/model/terminal/ReactiveReference.js +2 -2
- package/src/core/model/reactive/trigger/ReactiveTrigger.d.ts +2 -2
- package/src/core/model/reactive/trigger/ReactiveTrigger.d.ts.map +1 -1
- package/src/core/model/reactive/trigger/ReactiveTrigger.js +1 -1
- package/src/core/process/BaseProcess.d.ts.map +1 -1
- package/src/core/process/BaseProcess.js +8 -7
- package/src/core/process/SimpleLifecycle.d.ts +5 -0
- package/src/core/process/SimpleLifecycle.d.ts.map +1 -1
- package/src/core/process/SimpleLifecycle.js +8 -0
- package/src/core/process/task/Task.js +1 -1
- package/src/engine/animation/clip/AnimationClip.d.ts.map +1 -1
- package/src/engine/animation/clip/AnimationClip.js +50 -8
- package/src/engine/animation/clip/AnimationClipBinding.js +1 -1
- package/src/engine/animation/clip/AnimationTrack.d.ts +11 -1
- package/src/engine/animation/clip/AnimationTrack.d.ts.map +1 -1
- package/src/engine/animation/clip/AnimationTrack.js +50 -7
- package/src/engine/animation/curve/binding/BoundPlainNumericPropertyWriter.d.ts +8 -0
- package/src/engine/animation/curve/binding/BoundPlainNumericPropertyWriter.d.ts.map +1 -0
- package/src/engine/animation/curve/binding/BoundPlainNumericPropertyWriter.js +16 -0
- package/src/engine/ecs/terrain/ecs/Terrain.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/splat/SplatMapping.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/splat/SplatMapping.js +6 -6
- package/src/engine/graphics/ecs/light/LightSystem.js +1 -1
- package/src/engine/graphics/texture/sampler/Sampler2D.js +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.d.ts +3 -3
- package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.d.ts.map +1 -1
- package/src/generation/filtering/numeric/complex/CellFilterSimplexNoise.js +6 -6
- package/src/generation/grid/generation/discrete/GridTaskCellularAutomata.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskCellularAutomata.js +35 -31
- package/src/generation/grid/generation/grid/GridTaskAddNodesFixed.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/GridTaskAddNodesFixed.js +8 -11
- package/src/generation/grid/generation/road/RoadConnectionNetwork.d.ts +6 -2
- package/src/generation/grid/generation/road/RoadConnectionNetwork.d.ts.map +1 -1
- package/src/generation/grid/generation/road/RoadConnectionNetwork.js +36 -30
- package/src/generation/placement/action/GridCellAction.js +1 -1
- package/src/generation/theme/AreaTheme.d.ts.map +1 -1
- package/src/generation/theme/AreaTheme.js +0 -1
- package/src/generation/theme/TerrainLayerRule.d.ts.map +1 -1
- package/src/generation/theme/TerrainLayerRule.js +2 -1
- package/src/generation/theme/TerrainLayerRuleAggregator.d.ts +5 -1
- package/src/generation/theme/TerrainLayerRuleAggregator.d.ts.map +1 -1
- package/src/generation/theme/TerrainLayerRuleAggregator.js +7 -2
- package/src/generation/theme/ThemeEngine.d.ts +2 -2
- package/src/generation/theme/ThemeEngine.d.ts.map +1 -1
- package/src/generation/theme/ThemeEngine.js +1 -4
- package/src/generation/theme/cell/CellProcessingRule.d.ts.map +1 -1
- package/src/generation/theme/cell/CellProcessingRule.js +10 -13
- package/src/generation/theme/cell/CellProcessingRuleSet.d.ts.map +1 -1
- package/src/generation/theme/cell/CellProcessingRuleSet.js +6 -7
- package/src/view/SVG.d.ts.map +1 -1
- package/src/view/SVG.js +0 -15
- package/src/view/html_element_to_aabb.d.ts +8 -0
- package/src/view/html_element_to_aabb.d.ts.map +1 -0
- package/src/view/html_element_to_aabb.js +29 -0
- package/src/view/tooltip/TooltipManager.d.ts.map +1 -1
- package/src/view/tooltip/TooltipManager.js +7 -9
- package/src/view/tooltip/TooltipView.d.ts +0 -1
- package/src/view/tooltip/TooltipView.d.ts.map +1 -1
- package/src/view/tooltip/TooltipView.js +10 -280
- package/src/view/tooltip/gml/TooltipParser.d.ts.map +1 -1
- package/src/view/tooltip/gml/TooltipParser.js +1 -13
- package/src/core/binary/Base64.d.ts.map +0 -1
- package/src/core/collection/array/typed/largest_common_alignment_uint32.d.ts.map +0 -1
- package/src/core/graph/SquareMatrix.d.ts.map +0 -1
- package/src/engine/simulation/DormandPrince.d.ts +0 -19
- package/src/engine/simulation/DormandPrince.d.ts.map +0 -1
- package/src/engine/simulation/DormandPrince.js +0 -242
- /package/src/core/binary/{Base64.d.ts → base64/Base64.d.ts} +0 -0
- /package/src/core/binary/{Base64.js → base64/Base64.js} +0 -0
- /package/src/core/{collection/array/typed → binary}/largest_common_alignment_uint32.d.ts +0 -0
- /package/src/core/{graph → math/matrix}/SquareMatrix.d.ts +0 -0
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.118.
|
|
8
|
+
"version": "2.118.7",
|
|
9
9
|
"main": "build/meep.module.js",
|
|
10
10
|
"module": "build/meep.module.js",
|
|
11
11
|
"exports": {
|
|
@@ -62,9 +62,9 @@
|
|
|
62
62
|
"@rollup/plugin-terser": "0.4.3",
|
|
63
63
|
"@types/jest": "29.5.12",
|
|
64
64
|
"@types/three": "^0.135.0",
|
|
65
|
-
"babel-jest": "29.
|
|
66
|
-
"jest": "29.
|
|
67
|
-
"jest-environment-jsdom": "29.
|
|
65
|
+
"babel-jest": "29.7.0",
|
|
66
|
+
"jest": "29.7.0",
|
|
67
|
+
"jest-environment-jsdom": "29.7.0",
|
|
68
68
|
"jest-junit": "16.0.0",
|
|
69
69
|
"rollup": "3.26.2",
|
|
70
70
|
"typescript": "5.2.2"
|
|
@@ -108,11 +108,6 @@ export class BitSet {
|
|
|
108
108
|
* @param {number} endIndex clear up to here, excluding this position
|
|
109
109
|
*/
|
|
110
110
|
clearRange(startIndex: number, endIndex: number): void;
|
|
111
|
-
/**
|
|
112
|
-
*
|
|
113
|
-
* @param {BitSet} set
|
|
114
|
-
*/
|
|
115
|
-
and(set: BitSet): void;
|
|
116
111
|
/**
|
|
117
112
|
* Returns the value of the bit with the specified index.
|
|
118
113
|
* @param {int} bitIndex
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BitSet.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/BitSet.js"],"names":[],"mappings":"AAgCA;
|
|
1
|
+
{"version":3,"file":"BitSet.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/BitSet.js"],"names":[],"mappings":"AAgCA;IAiiBI;;;;OAIG;IACH,oBAHW,MAAM,GACJ,MAAM,CASlB;IA5iBD;;;;OAIG;IACH,+BAFW,MAAM,EA8BhB;IAzBG;;;;OAIG;IACH,iBAAiB;IAEjB;;;;OAIG;IACH,mBAA4C;IAE5C;;;;OAIG;IACH,sBAA0D;IAE1D;;OAEG;IACH,gBAFU,MAAM,CAE2B;IAG/C,sBAEC;IAED;;;OAGG;IACH,mBAFW,MAAM,QAOhB;IAED;;;OAGG;IACH,uBAFW,MAAM,QAUhB;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,iBAsBC;IAED,uBAMC;IAED;;;;OAIG;IACH,oBAyBC;IAED;;;;OAIG;IACH,oCAqCC;IAED;;;;OAIG;IACH,4BAFa,MAAM,CAuDlB;IAED;;;;OAIG;IACH,8BAFa,MAAM,CAkDlB;IAED;;;;OAIG;IACH,2BAFW,OAAO,QAmCjB;IAED;;;OAGG;IACH,2BAEC;IAED;;;;OAIG;IACH,qBAHW,MAAM,YACN,MAAM,QAWhB;IAED;;;;OAIG;IACH,uBAHW,MAAM,YACN,MAAM,QAShB;IAED;;;;OAIG;IACH,oBAFa,OAAO,CAkBnB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,OAAO,CAUnB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,OAAO,CAUnB;IAED;;;;;OAKG;IACH,sBAJW,MAAM,eACN,MAAM,aACN,MAAM,QAShB;IAED;;;;;OAKG;IACH,qBAJW,MAAM,eACN,MAAM,aACN,MAAM,QAShB;IAED;;;;;OAKG;IACH,gBAJW,MAAM,eACN,MAAM,aACN,MAAM,QAQhB;IAED;;OAEG;IACH,cAgBC;IAED;;;OAGG;IACH,YAFW,MAAM,QAoChB;CAeJ"}
|
|
@@ -16,7 +16,7 @@ const GROW_FACTOR = 1.3;
|
|
|
16
16
|
* @constant
|
|
17
17
|
* @type {number}
|
|
18
18
|
*/
|
|
19
|
-
const
|
|
19
|
+
const DEFAULT_SHRINK_FACTOR = 0.5;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Minimum number of bits to increase the capacity by
|
|
@@ -63,7 +63,7 @@ export class BitSet {
|
|
|
63
63
|
/**
|
|
64
64
|
* @type {number}
|
|
65
65
|
*/
|
|
66
|
-
this.__shrinkFactor =
|
|
66
|
+
this.__shrinkFactor = DEFAULT_SHRINK_FACTOR;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
preventShrink() {
|
|
@@ -417,14 +417,6 @@ export class BitSet {
|
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
-
/**
|
|
421
|
-
*
|
|
422
|
-
* @param {BitSet} set
|
|
423
|
-
*/
|
|
424
|
-
and(set) {
|
|
425
|
-
throw new Error("NIY");
|
|
426
|
-
}
|
|
427
|
-
|
|
428
420
|
/**
|
|
429
421
|
* Returns the value of the bit with the specified index.
|
|
430
422
|
* @param {int} bitIndex
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Base64.d.ts","sourceRoot":"","sources":["../../../../../src/core/binary/base64/Base64.js"],"names":[],"mappings":"AAgOA;IACI;;;;OAIG;IACH,qBAHW,WAAW,GACT,MAAM,CAOlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,WAAW,CAUvB;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"largest_common_alignment_uint32.d.ts","sourceRoot":"","sources":["../../../../src/core/binary/largest_common_alignment_uint32.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,0DALW,MAAM,YACN,MAAM,eACN,MAAM,GACJ,MAAM,CAoBlB"}
|
|
@@ -13,28 +13,54 @@ export class CuckooFilter {
|
|
|
13
13
|
constructor({ fpp, maxKeys }?: number);
|
|
14
14
|
/**
|
|
15
15
|
* how many bits are needed per tag
|
|
16
|
+
* @readonly
|
|
16
17
|
* @type {number}
|
|
17
18
|
*/
|
|
18
|
-
bits_per_tag: number;
|
|
19
|
-
|
|
19
|
+
readonly bits_per_tag: number;
|
|
20
|
+
/**
|
|
21
|
+
* @readonly
|
|
22
|
+
* @type {number}
|
|
23
|
+
*/
|
|
24
|
+
readonly tag_hash_mask: number;
|
|
20
25
|
/**
|
|
21
26
|
* compute how many buckets we'll need
|
|
27
|
+
* @readonly
|
|
22
28
|
* @type {number}
|
|
23
29
|
*/
|
|
24
|
-
bucket_count: number;
|
|
30
|
+
readonly bucket_count: number;
|
|
25
31
|
/**
|
|
26
32
|
* Actual data storage
|
|
33
|
+
* @readonly
|
|
27
34
|
* @type {BitSet}
|
|
28
35
|
*/
|
|
29
|
-
data: BitSet;
|
|
36
|
+
readonly data: BitSet;
|
|
37
|
+
/**
|
|
38
|
+
* @private
|
|
39
|
+
* @type {number}
|
|
40
|
+
*/
|
|
41
|
+
private __count;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {boolean}
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
private __victim_exists;
|
|
30
48
|
/**
|
|
31
49
|
*
|
|
32
50
|
* @type {number}
|
|
51
|
+
* @private
|
|
52
|
+
*/
|
|
53
|
+
private __victim_tag;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @type {number}
|
|
57
|
+
* @private
|
|
58
|
+
*/
|
|
59
|
+
private __victim_index;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @returns {number}
|
|
33
63
|
*/
|
|
34
|
-
__count: number;
|
|
35
|
-
__victim_exists: boolean;
|
|
36
|
-
__victim_tag: number;
|
|
37
|
-
__victim_index: number;
|
|
38
64
|
get count(): number;
|
|
39
65
|
/**
|
|
40
66
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CuckooFilter.d.ts","sourceRoot":"","sources":["../../../../src/core/collection/CuckooFilter.js"],"names":[],"mappings":"AAqDA;;;;;GAKG;AACH;IACI;;;;OAIG;IACH,+BAHW,MAAM,
|
|
1
|
+
{"version":3,"file":"CuckooFilter.d.ts","sourceRoot":"","sources":["../../../../src/core/collection/CuckooFilter.js"],"names":[],"mappings":"AAqDA;;;;;GAKG;AACH;IACI;;;;OAIG;IACH,+BAHW,MAAM,EAmEhB;IApDG;;;;OAIG;IACH,uBAFU,MAAM,CAEgC;IAEhD;;;OAGG;IACH,wBAFU,MAAM,CAE8C;IAE9D;;;;OAIG;IACH,uBAFU,MAAM,CAE8C;IAE9D;;;;OAIG;IACH,eAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,gBAAgB;IAEhB;;;;OAIG;IACH,wBAA4B;IAC5B;;;;OAIG;IACH,qBAAqB;IAErB;;;;OAIG;IACH,uBAAuB;IAG3B;;;OAGG;IACH,oBAEC;IAED;;;;;;OAMG;IACH,uBAEC;IAED;;;;;;;;;OASG;IACH,mBAkBC;IAED;;;;;;OAMG;IACH,yBASC;IAED;;;;;;OAMG;IACH,0BAUC;IAED;;;;;OAKG;IACH,oBAIC;IAED;;;;;;OAMG;IACH,2BAUC;IAED;;;;;;;OAOG;IACH,2BALW,MAAM,kBACN,MAAM,OACN,MAAM,GACJ,MAAM,CAelB;IAED;;;;;;OAMG;IACH,0BALW,MAAM,kBACN,MAAM,OACN,MAAM,GACJ,OAAO,CAanB;IAED;;;;;;;;OAQG;IACH,wBAsBC;IAED;;;;;;;OAOG;IACH,gCAaC;IAED;;;;;OAKG;IACH,yCASC;IAED;;;;;;;;;;OAUG;IACH,mCAIC;IAED;;;;;OAKG;IACH,gCAWC;IAED;;;;;;;;;;;;;;;OAeG;IACH,aAJW,MAAM,GACJ,OAAO,CA8CnB;IAED,+BAcC;IAED;;;;;;;OAOG;IACH,sBAMC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,aAJW,MAAM,GACJ,OAAO,CA6BnB;IAGD;;;;;;OAMG;IACH,mBAHW,MAAM,GACJ,OAAO,CAUnB;CACJ;uBA3iBsB,qBAAqB"}
|
|
@@ -77,34 +77,62 @@ export class CuckooFilter {
|
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* how many bits are needed per tag
|
|
80
|
+
* @readonly
|
|
80
81
|
* @type {number}
|
|
81
82
|
*/
|
|
82
83
|
this.bits_per_tag = computeBitsPerTagForFPP(fpp);
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @readonly
|
|
87
|
+
* @type {number}
|
|
88
|
+
*/
|
|
83
89
|
this.tag_hash_mask = createMaskFromBitCount(this.bits_per_tag);
|
|
84
90
|
|
|
85
91
|
/**
|
|
86
92
|
* compute how many buckets we'll need
|
|
93
|
+
* @readonly
|
|
87
94
|
* @type {number}
|
|
88
95
|
*/
|
|
89
96
|
this.bucket_count = computeBucketsNeeded(maxKeys, BUCKET_SIZE);
|
|
90
97
|
|
|
91
98
|
/**
|
|
92
99
|
* Actual data storage
|
|
100
|
+
* @readonly
|
|
93
101
|
* @type {BitSet}
|
|
94
102
|
*/
|
|
95
103
|
this.data = new BitSet();
|
|
96
104
|
|
|
97
105
|
/**
|
|
98
|
-
*
|
|
106
|
+
* @private
|
|
99
107
|
* @type {number}
|
|
100
108
|
*/
|
|
101
109
|
this.__count = 0;
|
|
102
110
|
|
|
111
|
+
/**
|
|
112
|
+
*
|
|
113
|
+
* @type {boolean}
|
|
114
|
+
* @private
|
|
115
|
+
*/
|
|
103
116
|
this.__victim_exists = false;
|
|
117
|
+
/**
|
|
118
|
+
*
|
|
119
|
+
* @type {number}
|
|
120
|
+
* @private
|
|
121
|
+
*/
|
|
104
122
|
this.__victim_tag = 0;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
*
|
|
126
|
+
* @type {number}
|
|
127
|
+
* @private
|
|
128
|
+
*/
|
|
105
129
|
this.__victim_index = 0;
|
|
106
130
|
}
|
|
107
131
|
|
|
132
|
+
/**
|
|
133
|
+
*
|
|
134
|
+
* @returns {number}
|
|
135
|
+
*/
|
|
108
136
|
get count() {
|
|
109
137
|
return this.__count;
|
|
110
138
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array_buffer_copy.d.ts","sourceRoot":"","sources":["../../../../../../src/core/collection/array/typed/array_buffer_copy.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,0CANW,WAAW,iBACX,MAAM,UACN,WAAW,iBACX,MAAM,eACN,MAAM,
|
|
1
|
+
{"version":3,"file":"array_buffer_copy.d.ts","sourceRoot":"","sources":["../../../../../../src/core/collection/array/typed/array_buffer_copy.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,0CANW,WAAW,iBACX,MAAM,UACN,WAAW,iBACX,MAAM,eACN,MAAM,QA6ChB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { assert } from "../../../assert.js";
|
|
2
|
-
import { largest_common_alignment_uint32 } from "
|
|
2
|
+
import { largest_common_alignment_uint32 } from "../../../binary/largest_common_alignment_uint32.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* This is essentially a {@link memcopy} implementation for ArrayBuffers
|
|
@@ -18,6 +18,8 @@ export function array_buffer_copy(
|
|
|
18
18
|
assert.isNonNegativeInteger(source_offset, 'source_offset');
|
|
19
19
|
assert.isNonNegativeInteger(target_offset, 'target_offset');
|
|
20
20
|
assert.isNonNegativeInteger(byte_length, 'byte_length');
|
|
21
|
+
assert.ok(source instanceof ArrayBuffer || source instanceof SharedArrayBuffer,'source is not an ArrayBuffer');
|
|
22
|
+
assert.ok(target instanceof ArrayBuffer || target instanceof SharedArrayBuffer,'source is not an ArrayBuffer');
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
25
|
* @type {Uint8Array|Uint16Array|Uint32Array}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { assert } from "../../../assert.js";
|
|
2
|
+
import { largest_common_alignment_uint32 } from "../../../binary/largest_common_alignment_uint32.js";
|
|
2
3
|
import { isArrayEqualStrict } from "../isArrayEqualStrict.js";
|
|
3
|
-
import { largest_common_alignment_uint32 } from "./largest_common_alignment_uint32.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
|
+
import { largest_common_alignment_uint32 } from "../../../binary/largest_common_alignment_uint32.js";
|
|
2
3
|
import { isArrayEqualStrict } from "../isArrayEqualStrict.js";
|
|
3
|
-
import { largest_common_alignment_uint32 } from "./largest_common_alignment_uint32.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Optimized equality method for typed arrays, typically significantly faster than `isArrayEqualStrict`, especially for larger arrays
|
|
@@ -358,17 +358,17 @@ export class HashMap {
|
|
|
358
358
|
|
|
359
359
|
this.__entries_bound++;
|
|
360
360
|
|
|
361
|
-
|
|
361
|
+
const existing_entry = this.__entries[i];
|
|
362
362
|
|
|
363
|
-
|
|
363
|
+
if (existing_entry !== undefined) {
|
|
364
364
|
|
|
365
|
-
|
|
365
|
+
// entry exists, let's reuse it
|
|
366
366
|
|
|
367
|
-
assert.equal(
|
|
367
|
+
assert.equal(existing_entry.hash, RESERVED_HASH, 'Entry is occupied');
|
|
368
368
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
369
|
+
existing_entry.hash = hash;
|
|
370
|
+
existing_entry.key = k;
|
|
371
|
+
existing_entry.value = v;
|
|
372
372
|
|
|
373
373
|
} else {
|
|
374
374
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../../src/core/color/Color.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH;IAumBI;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,KAAK,CAIjB;IAED;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,KACN,MAAM,GACL,KAAK,CAQhB;IAGD;;;;OAIG;IACH,kBAHW,MAAM,GACL,KAAK,CAQhB;IAED
|
|
1
|
+
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../../src/core/color/Color.js"],"names":[],"mappings":"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"}
|
package/src/core/color/Color.js
CHANGED
|
@@ -678,22 +678,29 @@ export class Color {
|
|
|
678
678
|
/**
|
|
679
679
|
*
|
|
680
680
|
* @param {Color} input
|
|
681
|
-
* @param {Color} output
|
|
681
|
+
* @param {Color} [output]
|
|
682
|
+
* @returns {Color}
|
|
682
683
|
*/
|
|
683
|
-
static from_linear_to_sRGB(input, output) {
|
|
684
|
+
static from_linear_to_sRGB(input, output=new Color()) {
|
|
685
|
+
|
|
684
686
|
linear_to_sRGB(output, 0, input, 0);
|
|
687
|
+
|
|
688
|
+
return output;
|
|
685
689
|
}
|
|
686
690
|
|
|
687
691
|
/**
|
|
688
692
|
*
|
|
689
693
|
* @param {Color} input
|
|
690
|
-
* @param {Color} output
|
|
694
|
+
* @param {Color} [output]
|
|
695
|
+
* @returns {Color}
|
|
691
696
|
*/
|
|
692
|
-
static from_sRGB_to_linear(input, output) {
|
|
697
|
+
static from_sRGB_to_linear(input, output = new Color()) {
|
|
693
698
|
sRGB_to_linear(output, 0, input, 0);
|
|
699
|
+
|
|
700
|
+
return output;
|
|
694
701
|
}
|
|
695
702
|
}
|
|
696
|
-
|
|
703
|
+
ex
|
|
697
704
|
/**
|
|
698
705
|
* @deprecated use {@link Color#toArray} instead
|
|
699
706
|
* @readonly
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color_desaturate.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_desaturate.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,uDAFW,MAAM,OAUhB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { clamp01 } from "../../math/clamp01.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {Color} input
|
|
6
|
+
* @param {number} amount
|
|
7
|
+
*/
|
|
8
|
+
export function color_desaturate(input, amount) {
|
|
9
|
+
const r = input.clone();
|
|
10
|
+
|
|
11
|
+
const hsv = r.getHSV();
|
|
12
|
+
|
|
13
|
+
r.setHSV(hsv.h, hsv.s * clamp01(1 - amount), hsv.v);
|
|
14
|
+
|
|
15
|
+
return r;
|
|
16
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AABB2.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/aabb/AABB2.js"],"names":[],"mappings":";AAYA;;;GAGG;AACH;IACI;;;;;;OAMG;IACH,gEA+BC;IApBG;;;OAGG;IACH,WAAY;IACZ;;;OAGG;IACH,WAAY;IACZ;;;OAGG;IACH,WAAY;IACZ;;;OAGG;IACH,WAAY;IAGhB;;;OAGG;IACH,gBAFW,MAAM,QAQhB;IAED;;;OAGG;IACH,iBAFW,MAAM,QAQhB;IAED;;;OAGG;IACH,WAFW,MAAM,QAMhB;IAED;;;OAGG;IACH,aAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QA8BlB;IAED;;;OAGG;IACH,sBAFW,MAAM,QAShB;IAED;;;;;OAKG;IACH,sBAJW,KAAK,UACL,KAAK,GACH,OAAO,CAcnB;IAED;;;;OAIG;IACH,qBAHW,KAAK,GACH,OAAO,CAcnB;IAED;;;;;;;OAOG;IACH,0EAMC;IAED;;;;OAIG;IACH,qBAHW,MAAM,KACN,MAAM,QAKhB;IAED
|
|
1
|
+
{"version":3,"file":"AABB2.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/aabb/AABB2.js"],"names":[],"mappings":";AAYA;;;GAGG;AACH;IACI;;;;;;OAMG;IACH,gEA+BC;IApBG;;;OAGG;IACH,WAAY;IACZ;;;OAGG;IACH,WAAY;IACZ;;;OAGG;IACH,WAAY;IACZ;;;OAGG;IACH,WAAY;IAGhB;;;OAGG;IACH,gBAFW,MAAM,QAQhB;IAED;;;OAGG;IACH,iBAFW,MAAM,QAQhB;IAED;;;OAGG;IACH,WAFW,MAAM,QAMhB;IAED;;;OAGG;IACH,aAFW,MAAM,QAIhB;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QA8BlB;IAED;;;OAGG;IACH,sBAFW,MAAM,QAShB;IAED;;;;;OAKG;IACH,sBAJW,KAAK,UACL,KAAK,GACH,OAAO,CAcnB;IAED;;;;OAIG;IACH,qBAHW,KAAK,GACH,OAAO,CAcnB;IAED;;;;;;;OAOG;IACH,0EAMC;IAED;;;;OAIG;IACH,qBAHW,MAAM,KACN,MAAM,QAKhB;IAED;;;;;;OAMG;IACH,0BALW,OAAO,MACP,OAAO,UACP,OAAO,GACL,OAAO,CA0BnB;IAED;;;;OAIG;IACH,kCAHW,OAAO,UACP,OAAO,QAmBjB;IAED;;;;OAIG;IACH,wBAHW,KAAK,GACH,MAAM,CAIlB;IAED;;;;;;;OAOG;IACH,sBANW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CA4BlB;IAED;;;OAGG;IACH,eAFa,MAAM,CASlB;IAED;;;OAGG;IACH,sBAFY,MAAM,CAYjB;IAED;;;;;OAKG;IACH,iBAJW,MAAM,KACN,MAAM,GACJ,OAAO,CAInB;IAED;;;OAGG;IACH,mBAFW,KAAK,QAIf;IAED;;;OAGG;IACH,mBAFW,OAAO,WAOjB;IAED;;;;OAIG;IACH,QAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,QAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,sBAEC;IAED;;;OAGG;IACH,sBAGC;IAED;;;OAGG;IACH,YAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,aAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,qBAEC;IAED;;;;;;;OAOG;IACH,0DAiBC;IAED;;;;OAIG;IACH,eAHW,MAAM,KACN,MAAM,QAOhB;IAED;;;;OAIG;IACH,aAHW,MAAM,UACN,MAAM,QAOhB;IAED;;;OAGG;IACH,SAFa,KAAK,CAIjB;IAED;;;;OAIG;IACH,YAHW,KAAK,GACH,KAAK,CAIjB;IAED;;;;OAIG;IACH,cAHW,KAAK,GACH,OAAO,CAOnB;IAED;;;;;;OAMG;IACH,UALW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAQhB;IAED;;;;;;OAMG;IACH,uBALW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAsBhB;IAED;;OAEG;IACH,oCAEC;IAED,mBAEC;IAED;;;;;MAOC;IAED,0BAEC;IAED;;;;OAIG;IACH,iBAJW,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,GACJ,MAAM,EAAE,GAAC,YAAY,CAUjC;CACJ;;;qBAqCS,KAAK;qBAML,KAAK;;oBA/nBK,kBAAkB;AAulBtC;;;;;;;GAOG;AACH,gDANW,KAAK,MACL,KAAK,MACL,OAAO,MACP,OAAO,GACL,OAAO,CAsBnB"}
|
|
@@ -209,22 +209,6 @@ class AABB2 {
|
|
|
209
209
|
this._expandToFit(x, y, x, y);
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
/**
|
|
213
|
-
* retrieve midpoint of AABB along X axis
|
|
214
|
-
* @returns {number}
|
|
215
|
-
*/
|
|
216
|
-
midX() {
|
|
217
|
-
return (this.x1 + this.x0) / 2;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* retrieve midpoint of AABB along Y axis
|
|
222
|
-
* @returns {number}
|
|
223
|
-
*/
|
|
224
|
-
midY() {
|
|
225
|
-
return (this.y1 + this.y0) / 2;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
212
|
/**
|
|
229
213
|
* NOTE: only 1 intersection point is produced
|
|
230
214
|
* @param {Vector2} p0
|
|
@@ -376,16 +360,35 @@ class AABB2 {
|
|
|
376
360
|
|
|
377
361
|
/**
|
|
378
362
|
*
|
|
379
|
-
* @param {Vector2} result
|
|
363
|
+
* @param {Vector2} [result]
|
|
380
364
|
*/
|
|
381
365
|
getCenter(result = new Vector2()) {
|
|
366
|
+
|
|
382
367
|
result.set(this.centerX, this.centerY);
|
|
383
368
|
|
|
384
369
|
return result;
|
|
385
370
|
}
|
|
386
371
|
|
|
387
372
|
/**
|
|
388
|
-
*
|
|
373
|
+
* retrieve midpoint of AABB along X axis
|
|
374
|
+
* @deprecated use {@link centerX} instead
|
|
375
|
+
* @returns {number}
|
|
376
|
+
*/
|
|
377
|
+
midX() {
|
|
378
|
+
return this.centerX;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* retrieve midpoint of AABB along Y axis
|
|
383
|
+
* @deprecated use {@link centerY} instead
|
|
384
|
+
* @returns {number}
|
|
385
|
+
*/
|
|
386
|
+
midY() {
|
|
387
|
+
return this.centerY;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* midpoint along X axis
|
|
389
392
|
* @return {number}
|
|
390
393
|
*/
|
|
391
394
|
get centerX() {
|
|
@@ -393,7 +396,7 @@ class AABB2 {
|
|
|
393
396
|
}
|
|
394
397
|
|
|
395
398
|
/**
|
|
396
|
-
*
|
|
399
|
+
* midpoint along Y axis
|
|
397
400
|
* @return {number}
|
|
398
401
|
*/
|
|
399
402
|
get centerY() {
|
|
@@ -478,7 +481,10 @@ class AABB2 {
|
|
|
478
481
|
* @param {number} deltaY
|
|
479
482
|
*/
|
|
480
483
|
move(deltaX, deltaY) {
|
|
481
|
-
this.set(
|
|
484
|
+
this.set(
|
|
485
|
+
this.x0 + deltaX, this.y0 + deltaY,
|
|
486
|
+
this.x1 + deltaX, this.y1 + deltaY
|
|
487
|
+
);
|
|
482
488
|
}
|
|
483
489
|
|
|
484
490
|
/**
|
|
@@ -577,6 +583,21 @@ class AABB2 {
|
|
|
577
583
|
fromJSON(json) {
|
|
578
584
|
this.set(json.x0, json.y0, json.x1, json.y1);
|
|
579
585
|
}
|
|
586
|
+
|
|
587
|
+
/**
|
|
588
|
+
* @param {number[]|Float32Array} target
|
|
589
|
+
* @param {number} offset
|
|
590
|
+
* @returns {number[]|Float32Array}
|
|
591
|
+
*/
|
|
592
|
+
toArray(target=[], offset=0){
|
|
593
|
+
|
|
594
|
+
target[offset] = this.x0;
|
|
595
|
+
target[offset+1] = this.y0;
|
|
596
|
+
target[offset+2] = this.x1;
|
|
597
|
+
target[offset+3] = this.y1;
|
|
598
|
+
|
|
599
|
+
return target;
|
|
600
|
+
}
|
|
580
601
|
}
|
|
581
602
|
|
|
582
603
|
|
|
@@ -590,8 +611,8 @@ class AABB2 {
|
|
|
590
611
|
*/
|
|
591
612
|
function computeLineBetweenTwoBoxes(b0, b1, p0, p1) {
|
|
592
613
|
//compute box centers
|
|
593
|
-
const c0 = new Vector2(b0.
|
|
594
|
-
const c1 = new Vector2(b1.
|
|
614
|
+
const c0 = new Vector2(b0.centerX, b0.centerY);
|
|
615
|
+
const c1 = new Vector2(b1.centerX, b1.centerY);
|
|
595
616
|
|
|
596
617
|
const i0 = b0.lineIntersectionPoint(c0, c1, p0);
|
|
597
618
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aabb2_compute_center_from_multiple.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/aabb/aabb2_compute_center_from_multiple.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,0DAHW,YAAa,GACX,OAAO,
|
|
1
|
+
{"version":3,"file":"aabb2_compute_center_from_multiple.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/aabb/aabb2_compute_center_from_multiple.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,0DAHW,YAAa,GACX,OAAO,CAkBnB;oBAvBmB,kBAAkB"}
|
|
@@ -9,10 +9,15 @@ export function aabb2_compute_center_from_multiple(boxes) {
|
|
|
9
9
|
const numBoxes = boxes.length;
|
|
10
10
|
|
|
11
11
|
const center = new Vector2();
|
|
12
|
+
|
|
12
13
|
for (let i = 0; i < numBoxes; i++) {
|
|
14
|
+
|
|
13
15
|
const box = boxes[i];
|
|
14
|
-
|
|
16
|
+
|
|
17
|
+
center._add(box.centerX, box.centerY);
|
|
18
|
+
|
|
15
19
|
}
|
|
20
|
+
|
|
16
21
|
center.multiplyScalar(1 / numBoxes);
|
|
17
22
|
|
|
18
23
|
return center;
|
|
@@ -5,12 +5,10 @@
|
|
|
5
5
|
export class QuadTreeDatum<D> extends AABB2 {
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
|
-
* @
|
|
9
|
-
* @param {Number} [y0=0]
|
|
10
|
-
* @param {Number} [x1=0]
|
|
11
|
-
* @param {Number} [y1=0]
|
|
8
|
+
* @type {QuadTreeNode|null}
|
|
12
9
|
*/
|
|
13
|
-
constructor(x0
|
|
10
|
+
constructor(x0: number, y0: number, x1: number, y1: number);
|
|
11
|
+
constructor();
|
|
14
12
|
/**
|
|
15
13
|
*
|
|
16
14
|
* @type {D|null}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuadTreeDatum.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/quad-tree/QuadTreeDatum.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH;
|
|
1
|
+
{"version":3,"file":"QuadTreeDatum.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/quad-tree/QuadTreeDatum.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH;IAQI;;;OAGG;IACH,4DAAD;IAAC,cACJ;IAXI;;;OAGG;IACH,MAFU,CAAC,GAAC,IAAI,CAEJ;IAEZ;;;OAGG;IACH,YAFU,eAAa,IAAI,CAET;IAElB,mBA2BC;IAED;;;;;;OAMG;IACH,WALW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QA8BhB;IAED;;;;OAIG;IACH,SAHW,MAAM,MACN,MAAM,QAUhB;IAGL,yBAAuC;CAFtC;kBApGiB,wBAAwB"}
|
|
@@ -6,28 +6,18 @@ import AABB2 from "../../2d/aabb/AABB2.js";
|
|
|
6
6
|
* @extends {AABB2}
|
|
7
7
|
*/
|
|
8
8
|
export class QuadTreeDatum extends AABB2 {
|
|
9
|
+
|
|
9
10
|
/**
|
|
10
11
|
*
|
|
11
|
-
* @
|
|
12
|
-
* @param {Number} [y0=0]
|
|
13
|
-
* @param {Number} [x1=0]
|
|
14
|
-
* @param {Number} [y1=0]
|
|
12
|
+
* @type {D|null}
|
|
15
13
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
this.data = null;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @type {QuadTreeNode|null}
|
|
28
|
-
*/
|
|
29
|
-
this.parentNode = null;
|
|
30
|
-
}
|
|
14
|
+
data = null;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @type {QuadTreeNode|null}
|
|
19
|
+
*/
|
|
20
|
+
parentNode = null;
|
|
31
21
|
|
|
32
22
|
disconnect() {
|
|
33
23
|
const parentNode = this.parentNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rectangle_to_aabb.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/2d/rectangle_to_aabb.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,oDAFa,KAAK,CAuBjB;kBA5BiB,iBAAiB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import AABB2 from "./aabb/AABB2.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {Rectangle} rect
|
|
6
|
+
* @returns {AABB2}
|
|
7
|
+
*/
|
|
8
|
+
export function rectangle_to_aabb(rect) {
|
|
9
|
+
const position = rect.position;
|
|
10
|
+
|
|
11
|
+
const x0 = position.x;
|
|
12
|
+
const y0 = position.y;
|
|
13
|
+
|
|
14
|
+
const size = rect.size;
|
|
15
|
+
|
|
16
|
+
let x1 = x0;
|
|
17
|
+
let y1 = y0;
|
|
18
|
+
|
|
19
|
+
// sanitize bounds
|
|
20
|
+
if (size.x > 0) {
|
|
21
|
+
x1 += size.x;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (size.y > 0) {
|
|
25
|
+
y1 += size.y;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return new AABB2(x0, y0, x1, y1);
|
|
29
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { orient3d } from "robust-predicates";
|
|
2
2
|
import { assert } from "../../../assert.js";
|
|
3
|
-
import { Base64 } from "../../../binary/Base64.js";
|
|
3
|
+
import { Base64 } from "../../../binary/base64/Base64.js";
|
|
4
4
|
import { BinaryBuffer } from "../../../binary/BinaryBuffer.js";
|
|
5
5
|
import { EndianType } from "../../../binary/EndianType.js";
|
|
6
6
|
import { array_copy } from "../../../collection/array/array_copy.js";
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
* @returns {SquareMatrix}
|
|
10
10
|
*/
|
|
11
11
|
export function graph_compute_distance_matrix<T>(graph: Graph<T>, node_array: T[], targets: number[], node_index_map: Map<T, number>): SquareMatrix;
|
|
12
|
-
import { SquareMatrix } from "
|
|
12
|
+
import { SquareMatrix } from "../math/matrix/SquareMatrix.js";
|
|
13
13
|
//# sourceMappingURL=graph_compute_distance_matrix.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph_compute_distance_matrix.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/graph_compute_distance_matrix.js"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,4FAJW,MAAM,EAAE,mCAEN,YAAY,CAyFxB;6BAnG4B,
|
|
1
|
+
{"version":3,"file":"graph_compute_distance_matrix.d.ts","sourceRoot":"","sources":["../../../../src/core/graph/graph_compute_distance_matrix.js"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,4FAJW,MAAM,EAAE,mCAEN,YAAY,CAyFxB;6BAnG4B,gCAAgC"}
|