@woosh/meep-engine 2.120.5 → 2.121.1
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/README.md +1 -1
- package/editor/view/node-graph/NodeGraphEditorView.d.ts.map +1 -1
- package/editor/view/node-graph/NodeGraphView.d.ts.map +1 -1
- package/editor/view/node-graph/NodeView.d.ts.map +1 -1
- package/editor/view/node-graph/PortView.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/codegen/LineBuilder.d.ts +2 -2
- package/src/core/codegen/LineBuilder.d.ts.map +1 -1
- package/src/core/codegen/LineBuilder.js +14 -9
- package/src/core/collection/array/array_set_diff_sorting.d.ts +1 -1
- package/src/core/collection/array/array_set_diff_sorting.js +1 -1
- package/src/core/collection/map/HashMap.d.ts.map +1 -1
- package/src/core/collection/map/HashMap.js +29 -2
- package/src/core/color/oklab/find_cusp.d.ts.map +1 -1
- package/src/core/color/oklab/find_cusp.js +4 -1
- package/src/core/color/oklab/oklab_to_linear_srgb.d.ts.map +1 -1
- package/src/core/color/oklab/oklab_to_linear_srgb.js +1 -0
- package/src/core/color/operations/color_lighten.d.ts +1 -1
- package/src/core/color/operations/color_lighten.d.ts.map +1 -1
- package/src/core/color/operations/color_lighten.js +6 -1
- package/src/core/geom/2d/aabb/aabb2_intersects_point.d.ts +12 -0
- package/src/core/geom/2d/aabb/aabb2_intersects_point.d.ts.map +1 -0
- package/src/core/geom/2d/aabb/aabb2_intersects_point.js +17 -0
- package/src/core/geom/2d/quad-tree/QuadTreeNode.d.ts +17 -6
- package/src/core/geom/2d/quad-tree/QuadTreeNode.d.ts.map +1 -1
- package/src/core/geom/2d/quad-tree/QuadTreeNode.js +59 -98
- package/src/core/geom/2d/quad-tree/qt_collect_by_box.d.ts +14 -0
- package/src/core/geom/2d/quad-tree/qt_collect_by_box.d.ts.map +1 -0
- package/src/core/geom/2d/quad-tree/qt_collect_by_box.js +90 -0
- package/src/core/geom/2d/quad-tree/qt_collect_by_point.d.ts +11 -0
- package/src/core/geom/2d/quad-tree/qt_collect_by_point.d.ts.map +1 -0
- package/src/core/geom/2d/quad-tree/qt_collect_by_point.js +85 -0
- package/src/core/geom/3d/ray/ray3_distance_to_point.d.ts +14 -1
- package/src/core/geom/3d/ray/ray3_distance_to_point.d.ts.map +1 -1
- package/src/core/geom/3d/ray/ray3_distance_to_point.js +18 -1
- package/src/core/geom/3d/shape/UnionShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnionShape3D.js +4 -0
- package/src/core/geom/3d/shape/UnitCubeShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/UnitCubeShape3D.js +4 -0
- package/src/core/geom/ConicRay.d.ts +5 -1
- package/src/core/geom/ConicRay.d.ts.map +1 -1
- package/src/core/geom/ConicRay.js +5 -1
- package/src/core/geom/Vector1.d.ts.map +1 -1
- package/src/core/geom/Vector1.js +15 -2
- package/src/core/geom/Vector3.d.ts.map +1 -1
- package/src/core/geom/Vector3.js +10 -2
- package/src/core/geom/packing/max-rect/MaxRectanglesPacker.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/MaxRectanglesPacker.js +3 -0
- package/src/core/geom/packing/max-rect/cutArea.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/cutArea.js +8 -1
- package/src/core/geom/packing/max-rect/findBestContainer.d.ts +4 -4
- package/src/core/geom/packing/max-rect/findBestContainer.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/findBestContainer.js +30 -8
- package/src/core/geom/packing/max-rect/packOneBox.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/packOneBox.js +7 -2
- package/src/core/geom/packing/max-rect/removeRedundantBoxesArray.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/removeRedundantBoxesArray.js +13 -7
- package/src/core/geom/packing/miniball/Miniball.d.ts.map +1 -1
- package/src/core/geom/packing/miniball/Miniball.js +27 -1
- package/src/core/geom/packing/miniball/PointSet.d.ts.map +1 -1
- package/src/core/geom/packing/miniball/PointSet.js +25 -4
- package/src/core/geom/packing/miniball/Quality.js +1 -3
- package/src/core/process/action/AsynchronousDelayAction.js +1 -1
- package/src/engine/EntityCreator.js +1 -1
- package/src/engine/achievements/AchievementManager.js +1 -1
- package/src/engine/animation/AnimationUtils.js +1 -1
- package/src/engine/animation/async/prototypeAsyncAnimation.js +2 -2
- package/src/engine/animation/behavior/animateProperty.js +1 -1
- package/src/engine/animation/playTrackRealTime.js +1 -1
- package/src/engine/ecs/Entity.d.ts.map +1 -1
- package/src/engine/ecs/Entity.js +12 -7
- package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
- package/src/engine/ecs/EntityComponentDataset.js +14 -7
- package/src/engine/ecs/EntityReference.d.ts +4 -4
- package/src/engine/ecs/EntityReference.js +4 -4
- package/src/engine/ecs/dynamic_actions/DynamicActorSystem.js +1 -1
- package/src/engine/ecs/speaker/VoiceSystem.d.ts +8 -2
- package/src/engine/ecs/speaker/VoiceSystem.d.ts.map +1 -1
- package/src/engine/ecs/speaker/VoiceSystem.js +1 -1
- package/src/engine/ecs/util/hideEntityGracefully.js +3 -3
- package/src/engine/graphics/ecs/camera/filter/setup_filtered_camera_controller.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/filter/setup_filtered_camera_controller.js +6 -6
- package/src/engine/graphics/ecs/decal/v2/prototypeDecalSystem.js +1 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/prototypeSGMesh.js +1 -1
- package/src/engine/graphics/ecs/mesh-v2/sample/prototypeShadedGeometry.js +2 -2
- package/src/engine/graphics/ecs/mesh-v2/sample/prototype_sg_raycast.js +1 -1
- package/src/engine/graphics/ecs/path/tube/prototypeAnimatedPathMask.js +1 -1
- package/src/engine/graphics/ecs/trail2d/prototypeTrail2D.js +1 -1
- package/src/engine/graphics/impostors/octahedral/prototypeBaker.js +1 -1
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +2 -2
- package/src/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +4 -4
- package/src/engine/graphics/sh3/path_tracer/make_one_vector3.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/make_sky_hosek.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/make_sky_rtiw.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/make_zero_vector3.d.ts.map +1 -1
- package/src/engine/input/devices/PointerDevice.js +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorComponent.d.ts +79 -3
- package/src/engine/intelligence/behavior/ecs/BehaviorComponent.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorComponent.js +24 -8
- package/src/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/BehaviorComponentSerializationAdapter.js +2 -2
- package/src/engine/intelligence/behavior/ecs/BehaviorSystem.d.ts +33 -7
- package/src/engine/intelligence/behavior/primitive/ActionBehavior.d.ts +3 -2
- package/src/engine/intelligence/behavior/primitive/ActionBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/primitive/ActionBehavior.js +7 -5
- package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.d.ts +10 -9
- package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/primitive/SucceedingBehavior.js +19 -20
- package/src/engine/physics/fluid/prototype.js +1 -1
- package/src/engine/physics/inverse_kinematics/fabrik/prototype.js +1 -1
- package/src/view/View.d.ts.map +1 -1
- package/src/view/View.js +14 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ To help get you started, various samples are provided under `/samples` folder. F
|
|
|
15
15
|
|
|
16
16
|
Meep is covered by 2,508 unit tests
|
|
17
17
|
|
|
18
|
-
The aim is
|
|
18
|
+
The aim is to [ensure quality](https://about.codecov.io/blog/the-case-against-100-code-coverage/). As a result, the tests are written to cover complex code first and to exhaustively validate critical algorithms.
|
|
19
19
|
Most of the test code is significantly larger than the code that is being tested.
|
|
20
20
|
|
|
21
21
|
## Features
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeGraphEditorView.d.ts","sourceRoot":"","sources":["NodeGraphEditorView.js"],"names":[],"mappings":"AAUA;IACI;;;;;;;OAOG;IACH,
|
|
1
|
+
{"version":3,"file":"NodeGraphEditorView.d.ts","sourceRoot":"","sources":["NodeGraphEditorView.js"],"names":[],"mappings":"AAUA;IACI;;;;;;;OAOG;IACH,8DANW,SAAS,EAqFnB;IA5EG;;;OAGG;IACH,QAFU,eAAe,CAEL;IACpB;;;OAGG;IACH,QAFU,mBAAmB,CAET;IAEpB;;;OAGG;IACH,OAFU,SAAS,CAED;IAElB,mBAAuC;IA6D3C,eAEC;IAED,yBAgEC;CACJ;iBAxKgB,2BAA2B;gCACG,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeGraphView.d.ts","sourceRoot":"","sources":["NodeGraphView.js"],"names":[],"mappings":"AAeA;IAEQ,kBAA6B;IAC7B;;;OAGG;IACH,OAFU,OAAO,CAEU;CAElC;AAOD;IACI;;;;;;OAMG;IACH,
|
|
1
|
+
{"version":3,"file":"NodeGraphView.d.ts","sourceRoot":"","sources":["NodeGraphView.js"],"names":[],"mappings":"AAeA;IAEQ,kBAA6B;IAC7B;;;OAGG;IACH,OAFU,OAAO,CAEU;CAElC;AAOD;IACI;;;;;;OAMG;IACH,2DALW,SAAS,EAsOnB;IA9NG;;;OAGG;IACH,QAFU,eAAe,CAEL;IAEpB;;;OAGG;IACH,OAFU,SAAS,CAED;IAElB;;;OAGG;IACH,QAFU,mBAAmB,CAET;IAEpB;;;OAGG;IACH,WAFU,IAAI,CAAC,MAAM,CAAC,CAEK;IAE3B,mBAAuC;IAwM3C,qCA8DC;IAGD;;;;;;;OAOG;IACH,wDAFa,OAAO,CAcnB;IAED;;;;;;OAMG;IACH,oBALW,wBAAwB,UACxB,OAAO,UACP,OAAO,YACP,cAAc,QAyCxB;IAED;;;;OAIG;IACH,mCAHW,yBAAyB,UACzB,OAAO,QAiBjB;IAED;;;;OAIG;IACH,kCAHW,OAAO,UACP,OAAO,QAUjB;IAED;;;;OAIG;IACH,kCAHW,OAAO,UACP,OAAO,QAUjB;CACJ;oBA9bmB,mCAAmC;oBACnC,mCAAmC;iBAHtC,2BAA2B;iBAM3B,2CAA2C;0CAGlB,sEAAsE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeView.d.ts","sourceRoot":"","sources":["NodeView.js"],"names":[],"mappings":"AAWA;IACI;;;;;;;OAOG;IACH,
|
|
1
|
+
{"version":3,"file":"NodeView.d.ts","sourceRoot":"","sources":["NodeView.js"],"names":[],"mappings":"AAWA;IACI;;;;;;;OAOG;IACH,4EANW,YAAY,EAkHtB;IAzGG;;;OAGG;IACH,MAFU,YAAY,CAEN;IAChB;;;OAGG;IACH,QAFU,cAAc,CAEJ;IAEpB,mBAAuC;IAgG3C,eAGC;CACJ;iBA/HgB,2BAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortView.d.ts","sourceRoot":"","sources":["PortView.js"],"names":[],"mappings":"AAUA;IACI;;;;;OAKG;IACH,
|
|
1
|
+
{"version":3,"file":"PortView.d.ts","sourceRoot":"","sources":["PortView.js"],"names":[],"mappings":"AAUA;IACI;;;;;OAKG;IACH,0CAJW,IAAI,EAkDd;IA3CG;;;OAGG;IACH,MAFU,IAAI,CAEE;IAChB;;;OAGG;IACH,QAFU,cAAc,CAEJ;IAEpB,mBAAuC;IAkC3C,eAEC;CACJ;iBApEgB,2BAA2B"}
|
package/package.json
CHANGED
|
@@ -37,7 +37,7 @@ declare class LineBuilder {
|
|
|
37
37
|
*/
|
|
38
38
|
indent(): LineBuilder;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* NOTE: clamps indentation to 0 (can't go negative)
|
|
41
41
|
* @returns {LineBuilder}
|
|
42
42
|
*/
|
|
43
43
|
dedent(): LineBuilder;
|
|
@@ -54,7 +54,7 @@ declare class LineBuilder {
|
|
|
54
54
|
addLines(lines: LineBuilder): void;
|
|
55
55
|
clear(): void;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Renders out an indented string of lines
|
|
58
58
|
* @returns {string}
|
|
59
59
|
*/
|
|
60
60
|
build(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/codegen/LineBuilder.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"LineBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/codegen/LineBuilder.js"],"names":[],"mappings":";AAgCA;;GAEG;AACH;IAuJI;;;;OAIG;IACH,sBAJW,MAAM,mBACN,MAAM,GACJ,WAAW,CAuBvB;IAnKD;;;;OAIG;IACH,mBAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,cAFU,MAAM,CAEqB;IAErC;;;OAGG;IACH,aAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,wBAFW,MAAM,GADL,OAAO,CAoBlB;IAED;;;OAGG;IACH,UAFa,WAAW,CAKvB;IAED;;;OAGG;IACH,UAFa,WAAW,CAQvB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,WAAW,CASvB;IAED;;;OAGG;IACH,gBAFW,WAAW,QAiBrB;IAED,cAGC;IAED;;;OAGG;IACH,SAFa,MAAM,CAyBlB;IA8BD,mBAEC;;CACJ"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { assert } from "../assert.js";
|
|
2
|
+
import { string_repeat } from "../primitives/strings/string_repeat.js";
|
|
2
3
|
|
|
3
4
|
class Line {
|
|
4
5
|
/**
|
|
@@ -103,13 +104,14 @@ class LineBuilder {
|
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
/**
|
|
106
|
-
*
|
|
107
|
+
* NOTE: clamps indentation to 0 (can't go negative)
|
|
107
108
|
* @returns {LineBuilder}
|
|
108
109
|
*/
|
|
109
110
|
dedent() {
|
|
110
|
-
assert.greaterThan(this.#indentation, 0, 'indentation is already at 0');
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
// clamp to 0
|
|
113
|
+
this.#indentation = Math.max(0, this.#indentation - 1);
|
|
114
|
+
|
|
113
115
|
return this;
|
|
114
116
|
}
|
|
115
117
|
|
|
@@ -154,23 +156,26 @@ class LineBuilder {
|
|
|
154
156
|
}
|
|
155
157
|
|
|
156
158
|
/**
|
|
157
|
-
*
|
|
159
|
+
* Renders out an indented string of lines
|
|
158
160
|
* @returns {string}
|
|
159
161
|
*/
|
|
160
162
|
build() {
|
|
161
163
|
const result = [];
|
|
162
164
|
|
|
163
|
-
let i, j, l;
|
|
164
|
-
|
|
165
165
|
const lines = this.#lines;
|
|
166
|
+
const line_count = lines.length;
|
|
167
|
+
|
|
168
|
+
const indent_string = string_repeat(' ', this.indentSpaces);
|
|
166
169
|
|
|
167
|
-
for (i = 0
|
|
170
|
+
for (let i = 0; i < line_count; i++) {
|
|
168
171
|
const line = lines[i];
|
|
169
172
|
|
|
170
173
|
let indentString = '';
|
|
171
174
|
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
const indent_count = line.indentation;
|
|
176
|
+
|
|
177
|
+
for (let j = 0; j < indent_count; j++) {
|
|
178
|
+
indentString += indent_string;
|
|
174
179
|
}
|
|
175
180
|
|
|
176
181
|
result.push(indentString + line.text);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @template T
|
|
4
4
|
* @param {T[]} a
|
|
5
5
|
* @param {T[]} b
|
|
6
|
-
* @param {function(a:T,b:T):number}
|
|
6
|
+
* @param {function(a:T,b:T):number} compare
|
|
7
7
|
* @returns {{uniqueA:T[], uniqueB:T[], common:T[]}}
|
|
8
8
|
*/
|
|
9
9
|
export function array_set_diff_sorting<T>(a: T[], b: T[], compare: any): {
|
|
@@ -7,7 +7,7 @@ import { assert } from "../../assert.js";
|
|
|
7
7
|
* @template T
|
|
8
8
|
* @param {T[]} a
|
|
9
9
|
* @param {T[]} b
|
|
10
|
-
* @param {function(a:T,b:T):number}
|
|
10
|
+
* @param {function(a:T,b:T):number} compare
|
|
11
11
|
* @returns {{uniqueA:T[], uniqueB:T[], common:T[]}}
|
|
12
12
|
*/
|
|
13
13
|
export function array_set_diff_sorting(a, b, compare) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HashMap.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/map/HashMap.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;GAYG;AACH,uFAIC;AAgGD;;;;;;;GAOG;AACH,qBAHa,CAAC,EAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"HashMap.d.ts","sourceRoot":"","sources":["../../../../../src/core/collection/map/HashMap.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;GAYG;AACH,uFAIC;AAgGD;;;;;;;GAOG;AACH,qBAHa,CAAC,EAAC,CAAC;IAyFZ;;;;;;OAMG;IACH,6EALW,CAAS,IAAC,EAAD,GAAC,KAAE,MAAM,EAsC5B;IA7HD;;;;;OAKG;IACH,eAAoB;IAEpB;;;;OAIG;IACH,kBAAyB;IAEzB;;;;OAIG;IACH,wBAAoB;IAEpB;;;;OAIG;IACH,wBAAoB;IAEpB;;;;OAIG;IACH,eAAW;IAEX;;;;OAIG;IACH,oBAAgB;IAEhB;;;;OAIG;IACH,kCAA8B;IAE9B;;;;OAIG;IACH,iCAA6B;IAE7B;;;;OAIG;IACH,qCAAiC;IAEjC;;;;OAIG;IACH,yBAAqB;IAErB;;;;OAIG;IACH,sBAAoC;IAEpC;;;;OAIG;IACH,kBAAc;IAwBV;;;;;OAKG;IACH,iCAAsC;IACtC;;;;;OAKG;IACH,qCAA8C;IAOlD;;;OAGG;IACH,YAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,kBAFa,MAAM,CAIlB;IA2CD;;;;;OAKG;IACH,0BAUC;IAuGD;;;;OAIG;IACH,SAHW,CAAC,SACD,CAAC,QA0EX;IAED;;;;OAIG;IACH,SAHW,CAAC,GACC,CAAC,GAAC,SAAS,CA+BvB;IAED;;;;;;;;OAQG;IACH,kBALW,CAAC,WACD,CAAS,IAAC,EAAD,CAAC,KAAE,CAAC,oBACb,GAAC,GACA,CAAC,CAgBZ;IAED;;;;;OAKG;IACH,cAJW,CAAC,SACD,CAAC,GACA,CAAC,CAaZ;IAwBD;;;;OAIG;IACH,YAHW,CAAC,GACC,OAAO,CA+CnB;IAED;;;;;OAKG;IACH,sCAHW,GAAC,GACC,OAAO,CA+BnB;IAOD;;OAEG;IACH,gBA0DC;IAmBD,2CA0BC;IAED;;;;OAIG;IACH,SAHW,CAAC,GACC,OAAO,CAInB;IAED;;OAEG;IACH,cA6BC;IA+BD;;;OAGG;IACH,WAFa,QAAQ,CAAC,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAM3B;IAED;;;OAGG;IACH,UAFa,QAAQ,CAAC,CAAC,CAAC,CAOvB;IAED;;;OAGG;IACH,QAFa,QAAQ,CAAC,CAAC,CAAC,CAMvB;IA1DD,yDA2BC;;CAgCJ"}
|
|
@@ -140,48 +140,70 @@ export class HashMap {
|
|
|
140
140
|
* Index pointers to entries array,
|
|
141
141
|
* number of bins is always power or two
|
|
142
142
|
* @type {Uint32Array}
|
|
143
|
+
* @private
|
|
143
144
|
*/
|
|
144
145
|
__bins = EMPTY_BINS;
|
|
145
146
|
|
|
146
147
|
/**
|
|
147
148
|
* Note that dead entries are marked as such with a special reserved hash values, so records can be reused for new entries
|
|
148
149
|
* @type {Array<HashMapEntry<K,V>>}
|
|
150
|
+
* @private
|
|
149
151
|
*/
|
|
150
152
|
__entries = new Array(0);
|
|
151
153
|
|
|
152
154
|
/**
|
|
153
155
|
* Pointer to the end of allocated entries segment
|
|
154
156
|
* @type {number}
|
|
157
|
+
* @private
|
|
155
158
|
*/
|
|
156
159
|
__entries_bound = 0;
|
|
157
160
|
|
|
158
161
|
/**
|
|
159
162
|
*
|
|
160
163
|
* @type {number}
|
|
164
|
+
* @private
|
|
161
165
|
*/
|
|
162
166
|
__entries_start = 0;
|
|
163
167
|
|
|
164
168
|
/**
|
|
165
169
|
* number of records in the map
|
|
166
170
|
* @type {number}
|
|
171
|
+
* @private
|
|
167
172
|
*/
|
|
168
173
|
__size = 0;
|
|
169
174
|
|
|
175
|
+
/**
|
|
176
|
+
*
|
|
177
|
+
* @type {number}
|
|
178
|
+
* @private
|
|
179
|
+
*/
|
|
170
180
|
__bin_count = 0;
|
|
171
181
|
|
|
172
182
|
/**
|
|
173
183
|
* Always exactly half of the number of bins
|
|
174
184
|
* @type {number}
|
|
185
|
+
* @private
|
|
175
186
|
*/
|
|
176
187
|
__entries_allocated_count = 0;
|
|
177
188
|
|
|
189
|
+
/**
|
|
190
|
+
*
|
|
191
|
+
* @type {number}
|
|
192
|
+
* @private
|
|
193
|
+
*/
|
|
178
194
|
__bin_count_power_of_two = 0;
|
|
179
195
|
|
|
196
|
+
/**
|
|
197
|
+
*
|
|
198
|
+
* @type {number}
|
|
199
|
+
* @private
|
|
200
|
+
*/
|
|
180
201
|
__entries_count_power_of_two = 0;
|
|
181
202
|
|
|
182
203
|
/**
|
|
183
204
|
* Mask used to map from hash to a bin index
|
|
184
205
|
* @type {number}
|
|
206
|
+
* @private
|
|
185
207
|
*/
|
|
186
208
|
__bin_count_mask = 0;
|
|
187
209
|
|
|
@@ -194,14 +216,15 @@ export class HashMap {
|
|
|
194
216
|
|
|
195
217
|
/**
|
|
196
218
|
* Used to track modifications to prevent concurrent changes during iteration
|
|
219
|
+
* @private
|
|
197
220
|
* @type {number}
|
|
198
221
|
*/
|
|
199
222
|
__version = 0;
|
|
200
223
|
|
|
201
224
|
/**
|
|
202
225
|
* @template K, V
|
|
203
|
-
* @param {function(K):number} [keyHashFunction]
|
|
204
|
-
* @param {function(K,K):boolean} [keyEqualityFunction]
|
|
226
|
+
* @param {function(K):number} [keyHashFunction] function to compute hash of a given key
|
|
227
|
+
* @param {function(K,K):boolean} [keyEqualityFunction] function to compute equality between two keys
|
|
205
228
|
* @param {number} [capacity] initial number of buckets in the hash table
|
|
206
229
|
* @param {number} [loadFactor] a measure of how full the hash table is allowed to get before its capacity is automatically increased
|
|
207
230
|
*/
|
|
@@ -240,6 +263,10 @@ export class HashMap {
|
|
|
240
263
|
this.#setBinCount(ceilPowerOfTwo(capacity));
|
|
241
264
|
}
|
|
242
265
|
|
|
266
|
+
/**
|
|
267
|
+
*
|
|
268
|
+
* @return {number}
|
|
269
|
+
*/
|
|
243
270
|
get size() {
|
|
244
271
|
return this.__size;
|
|
245
272
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find_cusp.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/oklab/find_cusp.js"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,kCAJW,MAAM,EAAE,KACR,MAAM,KACN,MAAM,
|
|
1
|
+
{"version":3,"file":"find_cusp.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/oklab/find_cusp.js"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,kCAJW,MAAM,EAAE,KACR,MAAM,KACN,MAAM,QAgBhB"}
|
|
@@ -19,7 +19,10 @@ export function find_cusp(output, a, b) {
|
|
|
19
19
|
|
|
20
20
|
// Convert to linear sRGB to find the first point where at least one of r,g or b >= 1:
|
|
21
21
|
oklab_to_linear_srgb(rgb_at_max, 1, S_cusp * a, S_cusp * b);
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
const max_component = max3(rgb_at_max[0], rgb_at_max[1], rgb_at_max[2]);
|
|
24
|
+
|
|
25
|
+
const L_cusp = Math.cbrt(1. / max_component);
|
|
23
26
|
const C_cusp = L_cusp * S_cusp;
|
|
24
27
|
|
|
25
28
|
output[0] = L_cusp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oklab_to_linear_srgb.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/oklab/oklab_to_linear_srgb.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,6CALW,MAAM,EAAE,KACR,MAAM,KACN,MAAM,KACN,MAAM,
|
|
1
|
+
{"version":3,"file":"oklab_to_linear_srgb.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/oklab/oklab_to_linear_srgb.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,6CALW,MAAM,EAAE,KACR,MAAM,KACN,MAAM,KACN,MAAM,QAehB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color_lighten.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_lighten.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,qCAJW,KAAK,WACL,MAAM,GACJ,KAAK,
|
|
1
|
+
{"version":3,"file":"color_lighten.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_lighten.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,qCAJW,KAAK,WACL,MAAM,GACJ,KAAK,CAoBjB;sBA9BqB,aAAa"}
|
|
@@ -9,13 +9,18 @@ const hsv = [0, 0, 0];
|
|
|
9
9
|
/**
|
|
10
10
|
*
|
|
11
11
|
* @param {Color} input
|
|
12
|
-
* @param {number} amount
|
|
12
|
+
* @param {number} [amount]
|
|
13
13
|
* @returns {Color}
|
|
14
14
|
*/
|
|
15
15
|
export function color_lighten(input, amount = 1) {
|
|
16
16
|
assert.isNumber(amount, 'amount');
|
|
17
17
|
assert.greaterThanOrEqual(amount, 0, 'amount');
|
|
18
18
|
|
|
19
|
+
if (amount === 0) {
|
|
20
|
+
// skip allocation, no change
|
|
21
|
+
return input;
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
const r = new Color();
|
|
20
25
|
|
|
21
26
|
linear_srgb_to_okhsv(hsv, input.r, input.g, input.b);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number} x0
|
|
4
|
+
* @param {number} y0
|
|
5
|
+
* @param {number} x1
|
|
6
|
+
* @param {number} y1
|
|
7
|
+
* @param {number} px
|
|
8
|
+
* @param {number} py
|
|
9
|
+
* @return {boolean}
|
|
10
|
+
*/
|
|
11
|
+
export function aabb2_intersects_point(x0: number, y0: number, x1: number, y1: number, px: number, py: number): boolean;
|
|
12
|
+
//# sourceMappingURL=aabb2_intersects_point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aabb2_intersects_point.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/aabb/aabb2_intersects_point.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,2CARW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACL,OAAO,CAQlB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number} x0
|
|
4
|
+
* @param {number} y0
|
|
5
|
+
* @param {number} x1
|
|
6
|
+
* @param {number} y1
|
|
7
|
+
* @param {number} px
|
|
8
|
+
* @param {number} py
|
|
9
|
+
* @return {boolean}
|
|
10
|
+
*/
|
|
11
|
+
export function aabb2_intersects_point(
|
|
12
|
+
x0, y0,
|
|
13
|
+
x1, y1,
|
|
14
|
+
px, py
|
|
15
|
+
) {
|
|
16
|
+
return x0 <= px && x1 >= px && y0 <= py && y1 >= py;
|
|
17
|
+
}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* @extends AABB2
|
|
4
4
|
*/
|
|
5
5
|
export class QuadTreeNode<D> extends AABB2 {
|
|
6
|
-
constructor(x0
|
|
6
|
+
constructor(x0: number, y0: number, x1: number, y1: number);
|
|
7
|
+
constructor();
|
|
7
8
|
/**
|
|
8
9
|
*
|
|
9
10
|
* @type {QuadTreeNode|null}
|
|
@@ -29,6 +30,10 @@ export class QuadTreeNode<D> extends AABB2 {
|
|
|
29
30
|
* @type {QuadTreeNode|null}
|
|
30
31
|
*/
|
|
31
32
|
parentNode: QuadTreeNode<any> | null;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @type {number}
|
|
36
|
+
*/
|
|
32
37
|
treeDataCount: number;
|
|
33
38
|
/**
|
|
34
39
|
*
|
|
@@ -98,12 +103,12 @@ export class QuadTreeNode<D> extends AABB2 {
|
|
|
98
103
|
traverseData(visitor: (arg0: QuadTreeDatum<D>) => any, thisArg?: any): void;
|
|
99
104
|
/**
|
|
100
105
|
*
|
|
101
|
-
* @param {function(QuadTreeNode):boolean} visitor
|
|
106
|
+
* @param {function(QuadTreeNode<D>):boolean} visitor
|
|
102
107
|
* @param {*} [thisArg]
|
|
103
108
|
*/
|
|
104
|
-
traversePreOrder(visitor: (arg0: QuadTreeNode<
|
|
109
|
+
traversePreOrder(visitor: (arg0: QuadTreeNode<D>) => boolean, thisArg?: any): void;
|
|
105
110
|
/**
|
|
106
|
-
*
|
|
111
|
+
* @deprecated use {@link qt_collect_by_point}
|
|
107
112
|
* @param {number} x
|
|
108
113
|
* @param {number} y
|
|
109
114
|
* @param {function(QuadTreeDatum<D>, x:number,y:number):boolean?} visitor
|
|
@@ -111,7 +116,7 @@ export class QuadTreeNode<D> extends AABB2 {
|
|
|
111
116
|
*/
|
|
112
117
|
traversePointIntersections(x: number, y: number, visitor: any, thisArg?: any): void;
|
|
113
118
|
/**
|
|
114
|
-
*
|
|
119
|
+
* @deprecated use {@link qt_collect_by_point} directly
|
|
115
120
|
* @param {Array<QuadTreeDatum<D>>} result
|
|
116
121
|
* @param {number} x
|
|
117
122
|
* @param {number} y
|
|
@@ -119,7 +124,7 @@ export class QuadTreeNode<D> extends AABB2 {
|
|
|
119
124
|
*/
|
|
120
125
|
requestDatumIntersectionsPoint(result: Array<QuadTreeDatum<D>>, x: number, y: number): number;
|
|
121
126
|
/**
|
|
122
|
-
*
|
|
127
|
+
* @deprecated use {@link qt_collect_by_box} instead
|
|
123
128
|
* @param {Array<QuadTreeDatum<D>>} result
|
|
124
129
|
* @param {number} x0
|
|
125
130
|
* @param {number} y0
|
|
@@ -130,6 +135,7 @@ export class QuadTreeNode<D> extends AABB2 {
|
|
|
130
135
|
requestDatumIntersectionsRectangle(result: Array<QuadTreeDatum<D>>, x0: number, y0: number, x1: number, y1: number): number;
|
|
131
136
|
/**
|
|
132
137
|
* NOTE: touching is not counted as intersection
|
|
138
|
+
* @deprecated use {@link qt_collect_by_box} instead
|
|
133
139
|
* @param {number} x0
|
|
134
140
|
* @param {number} y0
|
|
135
141
|
* @param {number} x1
|
|
@@ -138,6 +144,11 @@ export class QuadTreeNode<D> extends AABB2 {
|
|
|
138
144
|
* @param {*} [thisArg]
|
|
139
145
|
*/
|
|
140
146
|
traverseRectangleIntersections(x0: number, y0: number, x1: number, y1: number, visitor: (arg0: QuadTreeDatum<D>) => any, thisArg?: any): void;
|
|
147
|
+
/**
|
|
148
|
+
* @readonly
|
|
149
|
+
* @type {boolean}
|
|
150
|
+
*/
|
|
151
|
+
readonly isQuadTreeNode: boolean;
|
|
141
152
|
}
|
|
142
153
|
import AABB2 from "../../2d/aabb/AABB2.js";
|
|
143
154
|
import { QuadTreeDatum } from "./QuadTreeDatum.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QuadTreeNode.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/quad-tree/QuadTreeNode.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QuadTreeNode.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/quad-tree/QuadTreeNode.js"],"names":[],"mappings":"AAYA;;;GAGG;AACH,0BAHa,CAAC;;;IAIV;;;OAGG;IACH,SAFU,oBAAa,IAAI,CAEZ;IACf;;;OAGG;IACH,UAFU,oBAAa,IAAI,CAEX;IAChB;;;OAGG;IACH,YAFU,oBAAa,IAAI,CAET;IAClB;;;OAGG;IACH,aAFU,oBAAa,IAAI,CAER;IAEnB;;;OAGG;IACH,YAFU,oBAAa,IAAI,CAET;IAElB;;;OAGG;IACH,eAFU,MAAM,CAEE;IAGlB;;;OAGG;IACH,MAFU,aAAa,CAAC,CAAC,CAAC,EAAE,CAElB;IAEV,qBAeC;IAED,wBAYC;IAED;;;;;;OAMG;IACH,WALW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QAkBhB;IAED;;;;;;;;OAQG;IACH,IARa,CAAC,QACH,CAAC,MACD,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,sBAWhB;IAED;;;OAGG;IACH,6CAuEC;IAED;;;OAGG;IACH,iBAaC;IAED;;;OAGG;IACH,WAFY,OAAO,CAIlB;IAED,cA8BC;IAED;;OAEG;IACH,mBAKC;IAED;;;OAGG;IACH,8CAiBC;IAED;;OAEG;IACH,qBA2DC;IAED,cASC;IAED,cAQC;IAED;;OAEG;IACH,mBAFW,CAAC,EAAE,QAUb;IAED;;;;OAIG;IACH,sBAHW,CAAS,IAAgB,EAAhB,aAAa,CAAC,CAAC,CAAC,QAAC,YAC1B,GAAC,QAeX;IAED;;;;OAIG;IACH,0BAHW,CAAS,IAAe,EAAf,YAAY,CAAC,CAAC,CAAC,KAAE,OAAO,YACjC,GAAC,QAgBX;IAED;;;;;;OAMG;IACH,8BALW,MAAM,KACN,MAAM,0BAEN,GAAC,QASX;IAED;;;;;;OAMG;IACH,uCALW,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KACvB,MAAM,KACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;;;OAQG;IACH,2CAPW,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,MACvB,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;;;;OASG;IACH,mCAPW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,WACN,CAAS,IAAgB,EAAhB,aAAa,CAAC,CAAC,CAAC,QAAC,YAC1B,GAAC,QA0CX;IAIL;;;OAGG;IACH,yBAFU,OAAO,CAEoB;CANpC;kBAjhBiB,wBAAwB;8BAGZ,oBAAoB"}
|