@woosh/meep-engine 2.119.100 → 2.119.103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/editor/view/ecs/ComponentControlView.d.ts.map +1 -1
  2. package/package.json +1 -1
  3. package/src/core/collection/array/typed/is_typed_array_equals.d.ts.map +1 -1
  4. package/src/core/collection/array/typed/is_typed_array_equals.js +4 -1
  5. package/src/core/collection/list/List.d.ts.map +1 -1
  6. package/src/core/collection/list/List.js +1 -0
  7. package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts +1 -0
  8. package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.d.ts.map +1 -1
  9. package/src/core/geom/3d/topology/struct/binary/BinaryElementPool.js +1 -0
  10. package/src/core/geom/3d/topology/struct/binary/io/bt_edge_create.d.ts +9 -0
  11. package/src/core/geom/3d/topology/struct/binary/io/bt_edge_create.d.ts.map +1 -0
  12. package/src/core/geom/3d/topology/struct/binary/io/{create_edge.js → bt_edge_create.js} +2 -2
  13. package/src/core/geom/3d/topology/struct/binary/io/bt_edge_get_or_create.d.ts +10 -0
  14. package/src/core/geom/3d/topology/struct/binary/io/bt_edge_get_or_create.d.ts.map +1 -0
  15. package/src/core/geom/3d/topology/struct/binary/io/bt_edge_get_or_create.js +45 -0
  16. package/src/core/geom/3d/topology/struct/binary/io/bt_index_geometry_to_topology.d.ts.map +1 -1
  17. package/src/core/geom/3d/topology/struct/binary/io/bt_index_geometry_to_topology.js +26 -61
  18. package/src/core/geom/3d/topology/struct/binary/io/get_or_create_edge_map.js +2 -2
  19. package/src/core/math/clamp.js +3 -3
  20. package/src/core/math/hash/computeObjectHash.d.ts.map +1 -1
  21. package/src/core/math/hash/computeObjectHash.js +3 -1
  22. package/src/core/math/inverseLerp.d.ts +6 -1
  23. package/src/core/math/inverseLerp.d.ts.map +1 -1
  24. package/src/core/math/inverseLerp.js +6 -1
  25. package/src/core/model/DebouncedObservedBoolean.d.ts +0 -2
  26. package/src/core/model/DebouncedObservedBoolean.d.ts.map +1 -1
  27. package/src/core/model/ObservedBoolean.d.ts +81 -11
  28. package/src/core/model/ObservedBoolean.d.ts.map +1 -1
  29. package/src/core/model/ObservedBoolean.js +19 -5
  30. package/src/core/model/node-graph/NodeGraph.d.ts +21 -3
  31. package/src/core/model/node-graph/NodeGraph.d.ts.map +1 -1
  32. package/src/core/model/node-graph/NodeGraph.js +20 -2
  33. package/src/core/model/node-graph/node/NodeDescription.d.ts.map +1 -1
  34. package/src/core/model/node-graph/node/NodeDescription.js +1 -1
  35. package/src/core/primitives/strings/string_jaro_distance.d.ts +2 -1
  36. package/src/core/primitives/strings/string_jaro_distance.d.ts.map +1 -1
  37. package/src/core/primitives/strings/string_jaro_distance.js +6 -1
  38. package/src/core/primitives/strings/string_jaro_winkler.d.ts +1 -1
  39. package/src/core/primitives/strings/string_jaro_winkler.d.ts.map +1 -1
  40. package/src/core/primitives/strings/string_jaro_winkler.js +11 -6
  41. package/src/core/process/worker/WorkerBuilder.d.ts.map +1 -1
  42. package/src/core/process/worker/WorkerBuilder.js +47 -29
  43. package/src/engine/achievements/AchievementGateway.d.ts.map +1 -1
  44. package/src/engine/achievements/AchievementGateway.js +0 -3
  45. package/src/engine/animation/curve/AnimationCurve.d.ts +2 -2
  46. package/src/engine/animation/curve/AnimationCurve.js +2 -2
  47. package/src/engine/animation/curve/Keyframe.d.ts +6 -2
  48. package/src/engine/animation/curve/Keyframe.d.ts.map +1 -1
  49. package/src/engine/animation/curve/Keyframe.js +6 -2
  50. package/src/engine/animation/keyed2/AnimationTrack.d.ts +4 -0
  51. package/src/engine/animation/keyed2/AnimationTrack.d.ts.map +1 -1
  52. package/src/engine/animation/keyed2/AnimationTrack.js +4 -0
  53. package/src/engine/ecs/gui/position/ViewportPosition.d.ts +1 -1
  54. package/src/engine/ecs/terrain/ecs/Terrain.d.ts.map +1 -1
  55. package/src/engine/ecs/terrain/ecs/Terrain.js +3 -3
  56. package/src/engine/grid/transform2grid/Transform2GridPositionMode.js +6 -0
  57. package/src/engine/input/devices/InputDeviceSwitch.d.ts.map +1 -1
  58. package/src/engine/input/devices/InputDeviceSwitch.js +24 -3
  59. package/src/engine/input/devices/events/eventToSourceIdentifier.d.ts +1 -1
  60. package/src/engine/input/devices/events/eventToSourceIdentifier.js +1 -1
  61. package/src/view/View.js +1 -1
  62. package/editor/view/ecs/ComponentControlFactory.d.ts.map +0 -1
  63. package/editor/view/ecs/EntityEditor.d.ts.map +0 -1
  64. package/editor/view/ecs/EntityList.d.ts.map +0 -1
  65. package/editor/view/ecs/HierarchicalEntityListView.d.ts.map +0 -1
  66. package/src/core/geom/3d/topology/struct/binary/io/create_edge.d.ts +0 -9
  67. package/src/core/geom/3d/topology/struct/binary/io/create_edge.d.ts.map +0 -1
@@ -1,3 +1,12 @@
1
+ /**
2
+ * Graph of nodes, implements node-based programming pattern
3
+ * Notable contemporary examples include:
4
+ * * SideFX Houdini
5
+ * * Blender - geometry nodes, shaders
6
+ * * Unreal Engine - blueprints
7
+ * * Grasshopper
8
+ * @see https://en.wikipedia.org/wiki/Node_graph_architecture
9
+ */
1
10
  export class NodeGraph {
2
11
  /**
3
12
  * @private
@@ -6,6 +15,7 @@ export class NodeGraph {
6
15
  */
7
16
  private readonly nodes;
8
17
  /**
18
+ * Flat hierarchy of all connections between nodes
9
19
  * @private
10
20
  * @readonly
11
21
  * @type {List<Connection>}
@@ -28,9 +38,10 @@ export class NodeGraph {
28
38
  /**
29
39
  * Gets incremented every time structure of the graph changes, meaning nodes or connections are added/removed
30
40
  * Unsigned integer value
41
+ * @readonly
31
42
  * @return {number}
32
43
  */
33
- get version(): number;
44
+ readonly get version(): number;
34
45
  /**
35
46
  * @readonly
36
47
  */
@@ -107,12 +118,14 @@ export class NodeGraph {
107
118
  */
108
119
  traverseConnections(visitor: (arg0: Connection) => any, thisArg?: any): void;
109
120
  /**
110
- * Returns an array of all node instances, note that this array is a copy
121
+ * Returns an array of all node instances
122
+ * NOTE: this array is a copy
111
123
  * @return {NodeInstance[]}
112
124
  */
113
125
  getNodes(): NodeInstance[];
114
126
  /**
115
- * Returns an array of all connections, note that this array is a copy
127
+ * Returns an array of all connections
128
+ * NOTE: this array is a copy
116
129
  * @return {Connection[]}
117
130
  */
118
131
  getConnections(): Connection[];
@@ -211,6 +224,11 @@ export class NodeGraph {
211
224
  */
212
225
  getConnectionsAttachedToNode(id: number, result: number[]): number;
213
226
  /**
227
+ * Useful for type checks
228
+ * @example
229
+ * if(graph.isNodeGraph === true){
230
+ * // yep, that's a NodeGraph alright!
231
+ * }
214
232
  * @readonly
215
233
  * @type {boolean}
216
234
  */
@@ -1 +1 @@
1
- {"version":3,"file":"NodeGraph.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/node-graph/NodeGraph.js"],"names":[],"mappings":"AASA;IAEI;;;;OAIG;IACH,uBAAmB;IAEnB;;;;OAIG;IACH,6BAAyB;IAEzB;;;;;OAKG;IACH,4BAA0B;IAE1B;;;;;OAKG;IACH,kCAAgC;IAQhC;;;;OAIG;IACH,eAFY,MAAM,CAIjB;IAED;;OAEG;IACH;QACI;;;WAGG;4BADO,MAAM,CAAC,YAAY,EAAC,MAAM,CAAC;QAIrC;;;WAGG;8BADO,MAAM,CAAC,YAAY,EAAC,MAAM,CAAC;QAIrC;;;WAGG;kCADO,MAAM,CAAC,UAAU,EAAC,MAAM,CAAC;QAInC;;;WAGG;oCADO,MAAM,CAAC,UAAU,EAAC,MAAM,CAAC;MAGrC;IAEF;;OAEG;IACH,cAQC;IAED;;;OAGG;IACH,YAFW,SAAS,QAYnB;IAED;;;OAGG;IACH,SAFa,SAAS,CAQrB;IAED;;;;;;OAMG;IACH,aAHW,SAAS,GACP;QAAC,WAAW,EAAC,UAAU,EAAE,CAAC;QAAC,KAAK,EAAC,YAAY,EAAE,CAAA;KAAC,CAe5D;IAED;;;;;;;;OAQG;IACH,sCAJW,YAAY,EAAE,GAEZ;QAAC,WAAW,EAAC,UAAU,EAAE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wBAAwB;2BAD1B,iBAAiB"}
1
+ {"version":3,"file":"NodeGraph.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/node-graph/NodeGraph.js"],"names":[],"mappings":"AASA;;;;;;;;GAQG;AACH;IAEI;;;;OAIG;IACH,uBAAmB;IAEnB;;;;;OAKG;IACH,6BAAyB;IAEzB;;;;;OAKG;IACH,4BAA0B;IAE1B;;;;;OAKG;IACH,kCAAgC;IAQhC;;;;;OAKG;IACH,wBAFY,MAAM,CAIjB;IAED;;OAEG;IACH;QACI;;;WAGG;4BADO,MAAM,CAAC,YAAY,EAAC,MAAM,CAAC;QAIrC;;;WAGG;8BADO,MAAM,CAAC,YAAY,EAAC,MAAM,CAAC;QAIrC;;;WAGG;kCADO,MAAM,CAAC,UAAU,EAAC,MAAM,CAAC;QAInC;;;WAGG;oCADO,MAAM,CAAC,UAAU,EAAC,MAAM,CAAC;MAGrC;IAEF;;OAEG;IACH,cAQC;IAED;;;OAGG;IACH,YAFW,SAAS,QAYnB;IAED;;;OAGG;IACH,SAFa,SAAS,CAQrB;IAED;;;;;;OAMG;IACH,aAHW,SAAS,GACP;QAAC,WAAW,EAAC,UAAU,EAAE,CAAC;QAAC,KAAK,EAAC,YAAY,EAAE,CAAA;KAAC,CAe5D;IAED;;;;;;;;OAQG;IACH,sCAJW,YAAY,EAAE,GAEZ;QAAC,WAAW,EAAC,UAAU,EAAE,CAAC;QAAC,KAAK,EAAC,YAAY,EAAE,CAAA;KAAC,CAmF5D;IAED;;;;OAIG;IACH,uBAHW,CAAS,IAAY,EAAZ,YAAY,KAAE,GAAC,uBAKlC;IAED;;;;OAIG;IACH,6BAHW,CAAS,IAAU,EAAV,UAAU,KAAE,GAAC,uBAKhC;IAED;;;;OAIG;IACH,YAFY,YAAY,EAAE,CAIzB;IAED;;;;OAIG;IACH,kBAFY,UAAU,EAAE,CAIvB;IAED;;;;OAIG;IACH,cAHW,YAAY,GACV,OAAO,CAgBnB;IAED;;;;OAIG;IACH,mCAHW,eAAe,GACb,YAAY,EAAE,CAsB1B;IAED;;;;OAIG;IACH,kCAHW,IAAI,CAAC,eAAe,CAAC,GACnB,YAAY,EAAE,CAqB1B;IAED;;;;OAIG;IACH,YAHW,MAAM,GACJ,YAAY,GAAC,SAAS,CAkBlC;IAED;;;;;OAKG;IACH,gBAJW,MAAM,GACJ,YAAY,CAWxB;IAED;;;;OAIG;IACH,kBAHW,MAAM,GACJ,UAAU,GAAC,SAAS,CAgBhC;IAED;;;;;OAKG;IACH,+BAJW,MAAM,WACN,MAAM,GACJ,yBAAyB,GAAC,SAAS,CAY/C;IAED;;;;OAIG;IACH,iBAHW,eAAe,GACb,MAAM,CAclB;IAED;;;OAGG;IACH,cAFW,YAAY,QAkBtB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,OAAO,CA8BnB;IAED;;;;;;;;OAQG;IACH,uCANW,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,GACJ,MAAM,CAqClB;IAED;;;;;;;;OAQG;IACH,6BAPW,MAAM,cACN,MAAM,cACN,MAAM,cACN,MAAM,GACJ,MAAM,CAuDlB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,OAAO,CAyBnB;IAED;;;;;OAKG;IACH,iCAJW,MAAM,UACN,MAAM,EAAE,GACN,MAAM,CAyBlB;IAGL;;;;;;;;OAQG;IACH,sBAFU,OAAO,CAEc;;CAX9B;6BAtqB4B,wBAAwB;2BAD1B,iBAAiB"}
@@ -7,6 +7,15 @@ import { Connection } from "./Connection.js";
7
7
  import { NodeInstance } from "./node/NodeInstance.js";
8
8
  import { PortDirection } from "./node/PortDirection.js";
9
9
 
10
+ /**
11
+ * Graph of nodes, implements node-based programming pattern
12
+ * Notable contemporary examples include:
13
+ * * SideFX Houdini
14
+ * * Blender - geometry nodes, shaders
15
+ * * Unreal Engine - blueprints
16
+ * * Grasshopper
17
+ * @see https://en.wikipedia.org/wiki/Node_graph_architecture
18
+ */
10
19
  export class NodeGraph {
11
20
 
12
21
  /**
@@ -17,6 +26,7 @@ export class NodeGraph {
17
26
  nodes = new List();
18
27
 
19
28
  /**
29
+ * Flat hierarchy of all connections between nodes
20
30
  * @private
21
31
  * @readonly
22
32
  * @type {List<Connection>}
@@ -48,6 +58,7 @@ export class NodeGraph {
48
58
  /**
49
59
  * Gets incremented every time structure of the graph changes, meaning nodes or connections are added/removed
50
60
  * Unsigned integer value
61
+ * @readonly
51
62
  * @return {number}
52
63
  */
53
64
  get version() {
@@ -257,7 +268,8 @@ export class NodeGraph {
257
268
  }
258
269
 
259
270
  /**
260
- * Returns an array of all node instances, note that this array is a copy
271
+ * Returns an array of all node instances
272
+ * NOTE: this array is a copy
261
273
  * @return {NodeInstance[]}
262
274
  */
263
275
  getNodes() {
@@ -265,7 +277,8 @@ export class NodeGraph {
265
277
  }
266
278
 
267
279
  /**
268
- * Returns an array of all connections, note that this array is a copy
280
+ * Returns an array of all connections
281
+ * NOTE: this array is a copy
269
282
  * @return {Connection[]}
270
283
  */
271
284
  getConnections() {
@@ -672,6 +685,11 @@ export class NodeGraph {
672
685
  }
673
686
 
674
687
  /**
688
+ * Useful for type checks
689
+ * @example
690
+ * if(graph.isNodeGraph === true){
691
+ * // yep, that's a NodeGraph alright!
692
+ * }
675
693
  * @readonly
676
694
  * @type {boolean}
677
695
  */
@@ -1 +1 @@
1
- {"version":3,"file":"NodeDescription.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeDescription.js"],"names":[],"mappings":"AAwCA;IACI;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV;;;;;;OAMG;IACH,IAFU,MAAM,CAEO;IAEvB;;;OAGG;IACH,iBAFU,IAAI,EAAE,CAEL;IAEX;;;OAGG;IACH,YAFU,wBAAwB,EAAE,CAEpB;IAEhB;;OAEG;IACH;QACI;;;WAGG;4BADO,MAAM,CAAC,IAAI,CAAC;QAGtB;;;WAGG;8BADO,MAAM,CAAC,IAAI,CAAC;MAGxB;IAEF;;;;OAIG;IACH,wBAFW,YAAY,QAItB;IAED;;;OAGG;IACH,gBAFa,IAAI,EAAE,CAIlB;IAED;;;OAGG;IACH,eAFa,IAAI,EAAE,CAIlB;IAED;;;;;;OAMG;IACH,sBALW,MAAM,QACN,qBAAqB,iBACrB,MAAM,GAAC,OAAO,GAAC,MAAM,GACnB,MAAM,CA0ClB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,wBAAwB,CAiBpC;IAGD;;;;;;OAMG;IACH,iBALW,QAAQ,2BAER,aAAa,GACX,MAAM,CA2BlB;IAED;;;;OAIG;IACH,eAHW,MAAM,GACJ,OAAO,CAuBnB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GACJ,IAAI,GAAC,IAAI,CAgBrB;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACL,IAAI,EAAE,CAwBjB;IAED;;;;;OAKG;IACH,+BAHW,aAAa,GACZ,OAAO,CAiBlB;IAED;;;;OAIG;IACH,+BAHW,aAAa,GACZ,IAAI,EAAE,CAuBjB;IAED;;;;;OAKG;IACH,iCAJW,MAAM,aACN,aAAa,GACZ,IAAI,GAAC,SAAS,CAmBzB;IAED;;;OAGG;IACH,YAFa,IAAI,EAAE,CAIlB;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,cAHW,eAAe,GACb,OAAO,CAYnB;IAED,mBAEC;IAED;;;;MAMC;IAED;;;;;;OAMG;IACH,8BALW,EAAE,YAGF,YAAY,QAUtB;IAKL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAR1C;;;;qBAvaoB,WAAW;yCADS,yCAAyC;mBAH/D,kCAAkC;sCAEf,sCAAsC;8BAG9C,oBAAoB"}
1
+ {"version":3,"file":"NodeDescription.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeDescription.js"],"names":[],"mappings":"AAwCA;IACI;;;OAGG;IACH,MAFU,MAAM,CAEN;IAEV;;;;;;OAMG;IACH,IAFU,MAAM,CAEO;IAEvB;;;OAGG;IACH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f,sCAAsC;8BAG9C,oBAAoB"}
@@ -159,7 +159,7 @@ export class NodeDescription {
159
159
  /**
160
160
  *
161
161
  * @param {number} id
162
- * @returns {NodeParameterDescription}
162
+ * @returns {NodeParameterDescription|null}
163
163
  */
164
164
  getParameter(id) {
165
165
  assert.isNonNegativeInteger(id, 'id');
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Calculate Jaro distance between two strings, this is a measure of string similarity. Higher value means more similarity.
2
+ * Calculate Jaro distance between two strings, this is a measure of string similarity.
3
+ * Higher value means more similarity.
3
4
  * @param {string} first
4
5
  * @param {string} second
5
6
  * @param {number} first_length
@@ -1 +1 @@
1
- {"version":3,"file":"string_jaro_distance.d.ts","sourceRoot":"","sources":["../../../../../src/core/primitives/strings/string_jaro_distance.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,4CANW,MAAM,UACN,MAAM,gBACN,MAAM,iBACN,MAAM,GACL,MAAM,CAmBjB"}
1
+ {"version":3,"file":"string_jaro_distance.d.ts","sourceRoot":"","sources":["../../../../../src/core/primitives/strings/string_jaro_distance.js"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,4CANW,MAAM,UACN,MAAM,gBACN,MAAM,iBACN,MAAM,GACL,MAAM,CAsBjB"}
@@ -1,9 +1,11 @@
1
+ import { assert } from "../../assert.js";
1
2
  import { BitSet } from "../../binary/BitSet.js";
2
3
  import { max2 } from "../../math/max2.js";
3
4
  import { min2 } from "../../math/min2.js";
4
5
 
5
6
  /**
6
- * Calculate Jaro distance between two strings, this is a measure of string similarity. Higher value means more similarity.
7
+ * Calculate Jaro distance between two strings, this is a measure of string similarity.
8
+ * Higher value means more similarity.
7
9
  * @param {string} first
8
10
  * @param {string} second
9
11
  * @param {number} first_length
@@ -14,7 +16,10 @@ export function string_jaro_distance(
14
16
  first, second,
15
17
  first_length, second_length
16
18
  ) {
19
+ assert.isString(first,'first');
20
+ assert.isString(second,'second');
17
21
 
22
+ // TODO can do better for short strings under 32 characters by using int32 bitmask. This would avoid allocation entirely
18
23
  const matches1 = BitSet.fixedSize(first_length);
19
24
  const matches2 = BitSet.fixedSize(second_length);
20
25
 
@@ -2,7 +2,7 @@
2
2
  * Calculate the Jaro-Winkler distance between two strings
3
3
  * @param {string} first The string to compare
4
4
  * @param {string} second The string to compare with
5
- * @returns {number} similarity score, higher value means strings are more similar
5
+ * @returns {number} similarity score, higher value means strings are more similar, between 0 and 1
6
6
  */
7
7
  export function string_jaro_winkler(first: string, second: string): number;
8
8
  //# sourceMappingURL=string_jaro_winkler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"string_jaro_winkler.d.ts","sourceRoot":"","sources":["../../../../../src/core/primitives/strings/string_jaro_winkler.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,2CAJW,MAAM,UACN,MAAM,GACJ,MAAM,CAwBlB"}
1
+ {"version":3,"file":"string_jaro_winkler.d.ts","sourceRoot":"","sources":["../../../../../src/core/primitives/strings/string_jaro_winkler.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,2CAJW,MAAM,UACN,MAAM,GACJ,MAAM,CA6BlB"}
@@ -1,3 +1,4 @@
1
+ import { assert } from "../../assert.js";
1
2
  import { min3 } from "../../math/min3.js";
2
3
  import { string_jaro_distance } from "./string_jaro_distance.js";
3
4
 
@@ -5,9 +6,12 @@ import { string_jaro_distance } from "./string_jaro_distance.js";
5
6
  * Calculate the Jaro-Winkler distance between two strings
6
7
  * @param {string} first The string to compare
7
8
  * @param {string} second The string to compare with
8
- * @returns {number} similarity score, higher value means strings are more similar
9
+ * @returns {number} similarity score, higher value means strings are more similar, between 0 and 1
9
10
  */
10
11
  export function string_jaro_winkler(first, second) {
12
+ assert.isString(first, 'first');
13
+ assert.isString(second, 'second');
14
+
11
15
  const l1 = first.length;
12
16
  const l2 = second.length;
13
17
 
@@ -24,20 +28,21 @@ export function string_jaro_winkler(first, second) {
24
28
  return 0;
25
29
  }
26
30
 
27
- // Transform to Jaro-Winkler:
28
- // Prefix scale gives more favorable ratings to strings that share common prefixes:
31
+ // Transform to Jaro-Winkler
32
+ // Prefix scale gives more favorable ratings to strings that share common prefixes
33
+
29
34
  const prefix_scale = 0.1;
30
35
  const prefix = getPrefix(first, second, min3(l1, l2, 4));
36
+
31
37
  return similarity + prefix * prefix_scale * (1 - similarity);
32
38
  }
33
39
 
34
40
  /**
35
- * Counts the number of common characters at the beginning
36
- * of each word up to a maximum of 4
41
+ * Counts the number of common characters at the beginning of each word up to a maximum of {@link character_limit}
37
42
  * @param {string} a1 The first string to compare
38
43
  * @param {string} a2 The second string to compare
39
44
  * @param {number} character_limit
40
- * @returns {number}
45
+ * @returns {number} number of matching characters from the start of the string, up to limit
41
46
  */
42
47
  function getPrefix(a1, a2, character_limit) {
43
48
 
@@ -1 +1 @@
1
- {"version":3,"file":"WorkerBuilder.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/worker/WorkerBuilder.js"],"names":[],"mappings":";AAQA;IAEI;;;OAGG;IACH,SAFU,MAAM,EAAE,CAEL;IACb,YAAa;IACb;;;OAGG;IACH,WAFU;QAAC,CAAC,WAAU;QAAC,IAAI,EAAC,MAAM,CAAA;KAAC,EAAE,CAEtB;IACf,sBAA6B;IAE7B;;;OAGG;IACH,cAFW,MAAM,QAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,UACN,WAAS,MAAM,QAIzB;IAED;;;;;OAKG;IACH,6CAKC;IAED;;;OAGG;IACH,mBAFW,MAAM,QAMhB;IAED;;;OAGG;IACH,SAFa,WAAW,CAyGvB;CACJ;wBAzKuB,8BAA8B;wBAC9B,kBAAkB"}
1
+ {"version":3,"file":"WorkerBuilder.d.ts","sourceRoot":"","sources":["../../../../../src/core/process/worker/WorkerBuilder.js"],"names":[],"mappings":";AAQA;IAEI;;;OAGG;IACH,SAFU,MAAM,EAAE,CAEL;IACb,YAAa;IACb;;;OAGG;IACH,WAFU;QAAC,CAAC,WAAU;QAAC,IAAI,EAAC,MAAM,CAAA;KAAC,EAAE,CAEtB;IACf,sBAA6B;IAE7B;;;OAGG;IACH,cAFW,MAAM,QAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM,UACN,WAAS,MAAM,QAIzB;IAED;;;;;OAKG;IACH,6CAKC;IAED;;;OAGG;IACH,mBAFW,MAAM,QAMhB;IAED;;;OAGG;IACH,SAFa,WAAW,CA2HvB;CACJ;wBA3LuB,8BAA8B;wBAC9B,kBAAkB"}
@@ -116,6 +116,7 @@ class WorkerBuilder {
116
116
 
117
117
  //api handler
118
118
  Array.prototype.push.apply(codeLines, [
119
+ //language=js
119
120
  `function extractTransferables(obj, result) {
120
121
  if (typeof obj !== "object") {
121
122
  return; //not an object, skip
@@ -133,35 +134,52 @@ class WorkerBuilder {
133
134
  }
134
135
  }
135
136
  }`,
136
- 'globalScope.onmessage = function(event){',
137
- ' var eventData = event.data;',
138
- ' var requestId = eventData.id',
139
- ' var methodName = eventData.methodName;',
140
- ' var parameters = eventData.parameters;',
141
- ' var method = api[methodName];',
142
-
143
- ' function sendResult(result){',
144
- ' var transferables = [];',
145
- ' extractTransferables(result, transferables);',
146
- ' globalScope.postMessage({methodName: methodName, id: requestId, result: result}, transferables);',
147
- ' }',
148
-
149
- ' function sendError(error){',
150
- ' let stack = "";',
151
- ' try{stack = error.stack.split("\\n")}catch(e){}',
152
- ' globalScope.postMessage({methodName: methodName, id: requestId, error: {message: error.message, stack: stack }});',
153
- ' }',
154
-
155
- ' if(method === undefined){',
156
- ' sendError(new Error("API named \'"+methodName+"\' was not found."));',
157
- ' }else{',
158
- ' try{',
159
- ' method.apply(null,parameters).then(sendResult, sendError);',
160
- ' }catch(e){',
161
- ' sendError(e);',
162
- ' }',
163
- ' }',
164
- '};'
137
+ //language=js
138
+ `globalScope.onmessage = function (event) {
139
+ const eventData = event.data;
140
+ const requestId = eventData.id
141
+ const methodName = eventData.methodName;
142
+ const parameters = eventData.parameters;
143
+ const method = api[methodName];
144
+
145
+ function sendResult(result) {
146
+ const transferables = [];
147
+ extractTransferables(result, transferables);
148
+ globalScope.postMessage({ methodName: methodName, id: requestId, result: result }, transferables);
149
+ }
150
+
151
+ function sendError(error) {
152
+ let stack = "";
153
+ try {
154
+ stack = error.stack.split("\\n")
155
+ } catch (e) {
156
+ }
157
+ globalScope.postMessage({
158
+ methodName: methodName,
159
+ id: requestId,
160
+ error: { message: error.message, stack: stack }
161
+ });
162
+ }
163
+
164
+ if (method === undefined) {
165
+ sendError(new Error("API named \'" + methodName + "\' was not found."));
166
+ } else {
167
+ try {
168
+ const method_result = method.apply(null, parameters);
169
+
170
+ if(typeof method_result.then === "function"){
171
+ // thenable
172
+ method_result.then(sendResult, sendError);
173
+ }else{
174
+ // straight value
175
+ sendResult(method_result);
176
+ }
177
+
178
+ } catch (e) {
179
+ sendError(e);
180
+ }
181
+ }
182
+ };`
165
183
  ]);
166
184
 
167
185
  const code = codeLines.join("\n");
@@ -1 +1 @@
1
- {"version":3,"file":"AchievementGateway.d.ts","sourceRoot":"","sources":["../../../../src/engine/achievements/AchievementGateway.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAKI;;;OAGG;IACH,eAFa,OAAO,CAAC,MAAM,EAAE,CAAC,CAK7B;IAED;;;;OAIG;IACH,iCAGC;CACJ"}
1
+ {"version":3,"file":"AchievementGateway.d.ts","sourceRoot":"","sources":["../../../../src/engine/achievements/AchievementGateway.js"],"names":[],"mappings":"AAAA;;GAEG;AACH;IAEI;;;OAGG;IACH,eAFa,OAAO,CAAC,MAAM,EAAE,CAAC,CAK7B;IAED;;;;OAIG;IACH,iCAGC;CACJ"}
@@ -2,9 +2,6 @@
2
2
  * Base class for implementing achievement system API connectors
3
3
  */
4
4
  export class AchievementGateway {
5
- constructor() {
6
-
7
- }
8
5
 
9
6
  /**
10
7
  * Retrieve list of unlocked achievements
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Modelled on unity's AnimationCurve
3
- * @see https://github.com/nothke/ThreadableCurve/blob/master/ThreadableCurve.cs
2
+ * Describes change of a numeric value over time. Values are stored in {@link Keyframe}s, interpolation is defined by tangents on keyframes
3
+ * Inspired by unity's AnimationCurve, see https://docs.unity3d.com/ScriptReference/AnimationCurve.html
4
4
  */
5
5
  export class AnimationCurve {
6
6
  /**
@@ -20,8 +20,8 @@ function compareKeyframeToTime(time, keyframe) {
20
20
  }
21
21
 
22
22
  /**
23
- * Modelled on unity's AnimationCurve
24
- * @see https://github.com/nothke/ThreadableCurve/blob/master/ThreadableCurve.cs
23
+ * Describes change of a numeric value over time. Values are stored in {@link Keyframe}s, interpolation is defined by tangents on keyframes
24
+ * Inspired by unity's AnimationCurve, see https://docs.unity3d.com/ScriptReference/AnimationCurve.html
25
25
  */
26
26
  export class AnimationCurve {
27
27
  /**
@@ -1,3 +1,6 @@
1
+ /**
2
+ * Single keyframe of {@link AnimationCurve}
3
+ */
1
4
  export class Keyframe {
2
5
  /**
3
6
  *
@@ -19,12 +22,12 @@ export class Keyframe {
19
22
  */
20
23
  time: number;
21
24
  /**
22
- * Incoming tangent
25
+ * Incoming tangent, affects the slope of the curve from previous key
23
26
  * @type {number}
24
27
  */
25
28
  inTangent: number;
26
29
  /**
27
- * Outgoing tangent
30
+ * Outgoing tangent, affect the slope of the curve from this key to the next key
28
31
  * @type {number}
29
32
  */
30
33
  outTangent: number;
@@ -70,6 +73,7 @@ export class Keyframe {
70
73
  outTangent: any;
71
74
  }): void;
72
75
  /**
76
+ * Useful for type checks
73
77
  * @readonly
74
78
  * @type {boolean}
75
79
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Keyframe.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/Keyframe.js"],"names":[],"mappings":"AAGA;IAyBI;;;;;;;OAOG;IACH,kBANW,MAAM,SACN,MAAM,cACN,MAAM,eACN,MAAM,GACL,QAAQ,CAQnB;IAtCD;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,MAFU,MAAM,CAEP;IAET;;;OAGG;IACH,WAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,YAFU,MAAM,CAED;IAkBf;;;;;;OAMG;IACH,UALW,MAAM,SACN,MAAM,aACN,MAAM,cACN,MAAM,QAmBhB;IAED;;;;OAIG;IACH,cAHW,QAAQ,GACN,OAAO,CAQnB;IAED;;;OAGG;IACH,YAFW,QAAQ,QAOlB;IAED;;;OAGG;IACH,SAFY,QAAQ,CAQnB;IAED;;;OAGG;IACH,QAFY,MAAM,CAKjB;IAED;;;;;MAOC;IAED;;;;;aAQC;IAIL;;;OAGG;IACH,qBAFU,OAAO,CAEY;CAN5B"}
1
+ {"version":3,"file":"Keyframe.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/curve/Keyframe.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IAyBI;;;;;;;OAOG;IACH,kBANW,MAAM,SACN,MAAM,cACN,MAAM,eACN,MAAM,GACL,QAAQ,CAQnB;IAtCD;;;OAGG;IACH,OAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,MAFU,MAAM,CAEP;IAET;;;OAGG;IACH,WAFU,MAAM,CAEF;IAEd;;;OAGG;IACH,YAFU,MAAM,CAED;IAkBf;;;;;;OAMG;IACH,UALW,MAAM,SACN,MAAM,aACN,MAAM,cACN,MAAM,QAmBhB;IAED;;;;OAIG;IACH,cAHW,QAAQ,GACN,OAAO,CAQnB;IAED;;;OAGG;IACH,YAFW,QAAQ,QAOlB;IAED;;;OAGG;IACH,SAFY,QAAQ,CAQnB;IAED;;;OAGG;IACH,QAFY,MAAM,CAKjB;IAED;;;;;MAOC;IAED;;;;;aAQC;IAIL;;;;OAIG;IACH,qBAFU,OAAO,CAEY;CAP5B"}
@@ -1,6 +1,9 @@
1
1
  import { assert } from "../../../core/assert.js";
2
2
  import { computeHashFloat } from "../../../core/primitives/numbers/computeHashFloat.js";
3
3
 
4
+ /**
5
+ * Single keyframe of {@link AnimationCurve}
6
+ */
4
7
  export class Keyframe {
5
8
  /**
6
9
  *
@@ -15,13 +18,13 @@ export class Keyframe {
15
18
  time = 0;
16
19
 
17
20
  /**
18
- * Incoming tangent
21
+ * Incoming tangent, affects the slope of the curve from previous key
19
22
  * @type {number}
20
23
  */
21
24
  inTangent = 0;
22
25
 
23
26
  /**
24
- * Outgoing tangent
27
+ * Outgoing tangent, affect the slope of the curve from this key to the next key
25
28
  * @type {number}
26
29
  */
27
30
  outTangent = 0;
@@ -135,6 +138,7 @@ export class Keyframe {
135
138
  }
136
139
 
137
140
  /**
141
+ * Useful for type checks
138
142
  * @readonly
139
143
  * @type {boolean}
140
144
  */
@@ -1,4 +1,8 @@
1
1
  export default AnimationTrack;
2
+ /**
3
+ * Optimize multi-variable animation descriptor
4
+ * Consider using {@link AnimationCurve} if you're starting a new project as it's simpler to use and is more streamlined
5
+ */
2
6
  declare class AnimationTrack {
3
7
  /**
4
8
  *
@@ -1 +1 @@
1
- {"version":3,"file":"AnimationTrack.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/keyed2/AnimationTrack.js"],"names":[],"mappings":";AAGA;IACI;;;;OAIG;IACH,wBAHW,QAAQ,EA0ClB;IAtCG;;;OAGG;IACH,YAFU,QAAQ,CAEU;IAE5B;;;OAGG;IACH,eAFU,MAAM,CAEsB;IAEtC;;;OAGG;IACH,WAFU,MAAM,EAAE,CAEC;IAEnB;;;OAGG;IACH,UAFU,MAAM,EAAE,CAEA;IAElB,kBAAyC;IACzC,gBAAuC;IAEvC;;;OAGG;IACH,gBAFU,MAAM,EAAE,CAEM;IAExB;;;OAGG;IACH,qBAFU,UAAU,CAES;IAGjC,iBAmBC;IAED;;;;OAIG;IACH,gBAHW,MAAM,UACN,MAAM,EAAE,QAwBlB;IAED;;;;OAIG;IACH,6BAHW,MAAM,sBACN,CAAS,IAAM,EAAN,MAAM,KAAE,MAAM,QAKjC;IAED;;;;OAIG;IACH,2BAHW,MAAM,GACJ,MAAM,CAgBlB;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,MAAM,CA8BlB;IAED;;;;OAIG;IACH,wBAHW,MAAM,UACN,MAAM,EAAE,QAkBlB;CACJ"}
1
+ {"version":3,"file":"AnimationTrack.d.ts","sourceRoot":"","sources":["../../../../../src/engine/animation/keyed2/AnimationTrack.js"],"names":[],"mappings":";AAGA;;;GAGG;AACH;IACI;;;;OAIG;IACH,wBAHW,QAAQ,EA0ClB;IAtCG;;;OAGG;IACH,YAFU,QAAQ,CAEU;IAE5B;;;OAGG;IACH,eAFU,MAAM,CAEsB;IAEtC;;;OAGG;IACH,WAFU,MAAM,EAAE,CAEC;IAEnB;;;OAGG;IACH,UAFU,MAAM,EAAE,CAEA;IAElB,kBAAyC;IACzC,gBAAuC;IAEvC;;;OAGG;IACH,gBAFU,MAAM,EAAE,CAEM;IAExB;;;OAGG;IACH,qBAFU,UAAU,CAES;IAGjC,iBAmBC;IAED;;;;OAIG;IACH,gBAHW,MAAM,UACN,MAAM,EAAE,QAwBlB;IAED;;;;OAIG;IACH,6BAHW,MAAM,sBACN,CAAS,IAAM,EAAN,MAAM,KAAE,MAAM,QAKjC;IAED;;;;OAIG;IACH,2BAHW,MAAM,GACJ,MAAM,CAgBlB;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,MAAM,CA8BlB;IAED;;;;OAIG;IACH,wBAHW,MAAM,UACN,MAAM,EAAE,QAkBlB;CACJ"}
@@ -1,6 +1,10 @@
1
1
  import { assert } from "../../../core/assert.js";
2
2
  import { isTypedArray } from "../../../core/collection/array/typed/isTypedArray.js";
3
3
 
4
+ /**
5
+ * Optimize multi-variable animation descriptor
6
+ * Consider using {@link AnimationCurve} if you're starting a new project as it's simpler to use and is more streamlined
7
+ */
4
8
  class AnimationTrack {
5
9
  /**
6
10
  *
@@ -64,7 +64,7 @@ declare class ViewportPosition {
64
64
  anchor: any;
65
65
  screenEdgeWidth: number;
66
66
  stickToScreenEdge: boolean;
67
- enabled: any;
67
+ enabled: boolean;
68
68
  };
69
69
  }
70
70
  declare namespace ViewportPosition {
@@ -1 +1 @@
1
- {"version":3,"file":"Terrain.d.ts","sourceR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KACN,MAAM,UACN,OAAO,QAgBjB;IAED;;;;OAIG;IACH,uBAHW,OAAO,UACP,OAAO,QASjB;IAED;;;OAGG;IACH,gCAsBC;IAED,uBA8BC;IAED;;;OAGG;IACH,kBAFW,IAAI,GAAC,YAAY,GAAC,MAAM,EAAE,EAMpC;IAED;;;OAGG;IACH,iBAFY,YAAY,CAIvB;IAED;;;OAGG;IACH,gBAFW,YAAY,UA2BtB;IAED;;;OAGG;IACH,iBAFa,OAAO,CAAC,IAAI,CAAC,CAKzB;IAED,4BAiBC;IAED;;;OAGG;IACH,8BAFW,YAAY,QAItB;IAED,0BAGC;IAED,oCAUC;IAED,yBAEC;IAED,2BAeC;IAED,uBAkBC;IAED;;;OAGG;IACH,oBAFW,YAAY,QAoDtB;IArBG;;;;OAIG;IACH,WAHU,OAAO,CAAC,cAAc,CAAC,CAGc;IAE/C;;;;OAIG;IACH,QAHU,OAAO,CAAC,kBAAkB,CAAC,CAGM;IAW/C;;;OAGG;IACH,aAFY,kBAAkB,CAI7B;IAED;;;OAGG;IACH,aAFa,OAAO,GAAC,IAAI,CAcxB;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACL,OAAO,CAAC,WAAW,CAAC,CAqD/B;IAED;;;;OAIG;IACH;;;;eAFW,MAAM,QAmDhB;IAxBG,kBAA4B;IA0BhC;;;;;;;;;;;;;;;;;;;;;MAeC;CACJ;;;;uCAr8BsC,6BAA6B;oBAhBhD,kCAAkC;+BASvB,sBAAsB;6BAQxB,yBAAyB;8BAHxB,2BAA2B;0BAjB/B,yCAAyC;mBAWhD,qBAAqB;0BAJd,gDAAgD;4BATnE,OAAO;+BAWiB,8BAA8B;6BAYhC,mBAAmB;8BAnBlB,2CAA2C;qBAbpD,WAAW;+BAyBD,gCAAgC"}
@@ -34,9 +34,11 @@ import { TerrainFlags } from "./TerrainFlags.js";
34
34
 
35
35
  let idCounter = 0;
36
36
 
37
+ const TILE_SIZE = 7;
38
+
37
39
  class Terrain {
38
40
  /**
39
- *
41
+ * @readonly
40
42
  * @type {number}
41
43
  */
42
44
  id = idCounter++;
@@ -1029,7 +1031,5 @@ function mendMissedPoints(points, missIndices) {
1029
1031
  }
1030
1032
 
1031
1033
 
1032
- const TILE_SIZE = 7;
1033
-
1034
1034
  export default Terrain;
1035
1035
 
@@ -3,7 +3,13 @@
3
3
  * @enum {number}
4
4
  */
5
5
  export const Transform2GridPositionMode = {
6
+ /**
7
+ * Maps to fractional grid position
8
+ */
6
9
  Continuous: 0,
10
+ /**
11
+ * Maps transform to the lowest grid position on each axis (floor operation)
12
+ */
7
13
  Floor: 1,
8
14
  Ceil: 2,
9
15
  Round: 3
@@ -1 +1 @@
1
- {"version":3,"file":"InputDeviceSwitch.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/InputDeviceSwitch.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IACI;;;OAGG;IACH,MAFU,MAAM,CAEG;IACnB;;;OAGG;IACH,IAFU,MAAM,CAEC;IACjB;;;OAGG;IACH,SAFU,OAAO,CAEF;IAEf,cAOC;IAED,gBAOC;CACJ;mBAvCkB,uCAAuC"}
1
+ {"version":3,"file":"InputDeviceSwitch.d.ts","sourceRoot":"","sources":["../../../../../src/engine/input/devices/InputDeviceSwitch.js"],"names":[],"mappings":"AAEA;;GAEG;AACH;IAEI;;;;OAIG;IACH,eAFU,MAAM,CAEG;IAEnB;;;;OAIG;IACH,aAFU,MAAM,CAEC;IAEjB;;;OAGG;IACH,SAFU,OAAO,CAEF;IAEf;;;OAGG;IACH,aAFa,OAAO,CAInB;IAED;;;OAGG;IACH,cAOC;IAED;;;OAGG;IACH,gBAOC;CACJ;mBA5DkB,uCAAuC"}
@@ -1,25 +1,42 @@
1
1
  import Signal from "../../../core/events/signal/Signal.js";
2
2
 
3
3
  /**
4
- * Representation of an input device key
4
+ * Representation of an input device key/button
5
5
  */
6
6
  export class InputDeviceSwitch {
7
+
7
8
  /**
8
- * Button press
9
+ * Switch press
10
+ * @readonly
9
11
  * @type {Signal}
10
12
  */
11
13
  down = new Signal()
14
+
12
15
  /**
13
- * Button release
16
+ * Switch release
17
+ * @readonly
14
18
  * @type {Signal}
15
19
  */
16
20
  up = new Signal()
21
+
17
22
  /**
18
23
  * is button currently being pressed?
19
24
  * @type {boolean}
20
25
  */
21
26
  is_down = false
22
27
 
28
+ /**
29
+ * Convenience accessor, dual of {@link is_down}
30
+ * @returns {boolean}
31
+ */
32
+ get is_up() {
33
+ return !this.is_down;
34
+ }
35
+
36
+ /**
37
+ * Execute press, will trigger {@link down} signal if previous state was up
38
+ * Idempotent
39
+ */
23
40
  press() {
24
41
  if (this.is_down) {
25
42
  return;
@@ -29,6 +46,10 @@ export class InputDeviceSwitch {
29
46
  this.down.send0();
30
47
  }
31
48
 
49
+ /**
50
+ * Execute release, will trigger {@link up} signal if previous state was down
51
+ * Idempotent
52
+ */
32
53
  release() {
33
54
  if (!this.is_down) {
34
55
  return;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  *
3
3
  * @param {TouchEvent|MouseEvent} event
4
- * @returns {number}
4
+ * @returns {number} index of touch or mouse button that corresponded to this event, multiplexed with the device ID in MSB area
5
5
  */
6
6
  export function eventToSourceIdentifier(event: TouchEvent | MouseEvent): number;
7
7
  //# sourceMappingURL=eventToSourceIdentifier.d.ts.map
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  *
3
3
  * @param {TouchEvent|MouseEvent} event
4
- * @returns {number}
4
+ * @returns {number} index of touch or mouse button that corresponded to this event, multiplexed with the device ID in MSB area
5
5
  */
6
6
  export function eventToSourceIdentifier(event) {
7
7
  let device_id = 0;
package/src/view/View.js CHANGED
@@ -351,7 +351,7 @@ class View {
351
351
  /**
352
352
  *
353
353
  * @param {View} child
354
- * @returns {View}
354
+ * @returns {View} this
355
355
  */
356
356
  addChild(child) {
357
357
  assert.defined(child, 'child');