@woosh/meep-engine 2.119.17 → 2.119.19
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 +2 -2
- package/build/bundle-worker-image-decoder.js +1 -1
- package/package.json +1 -1
- package/src/core/binary/BinaryBuffer.d.ts +2 -6
- package/src/core/binary/BinaryBuffer.d.ts.map +1 -1
- package/src/core/binary/BinaryBuffer.js +7 -8
- package/src/core/binary/BitSet.d.ts.map +1 -1
- package/src/core/binary/BitSet.js +2 -3
- package/src/core/bvh2/bvh3/BVH.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/BVH.js +8 -0
- package/src/core/cache/FrequencySketch.js +1 -1
- package/src/core/codegen/LineBuilder.d.ts +7 -1
- package/src/core/codegen/LineBuilder.d.ts.map +1 -1
- package/src/core/codegen/LineBuilder.js +10 -1
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.d.ts.map +1 -1
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.js +1 -0
- package/src/core/geom/3d/Ray3.d.ts +12 -0
- package/src/core/geom/3d/Ray3.d.ts.map +1 -1
- package/src/core/geom/3d/Ray3.js +32 -0
- package/src/core/geom/3d/aabb/AABB3.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/AABB3.js +17 -7
- package/src/core/geom/3d/sphere/harmonics/sh3_basis_at.d.ts +2 -2
- package/src/core/geom/3d/sphere/harmonics/sh3_basis_at.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/harmonics/sh3_basis_at.js +11 -11
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js +2 -1
- package/src/core/geom/3d/tetrahedra/bvh/tetrahedral_mesh_to_bvh.d.ts +8 -0
- package/src/core/geom/3d/tetrahedra/bvh/tetrahedral_mesh_to_bvh.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/bvh/tetrahedral_mesh_to_bvh.js +36 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_compute_tet_aabb3.d.ts +10 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_compute_tet_aabb3.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_compute_tet_aabb3.js +49 -0
- package/src/core/geom/random/randomPointInCircle.d.ts +3 -2
- package/src/core/geom/random/randomPointInCircle.d.ts.map +1 -1
- package/src/core/geom/random/randomPointInCircle.js +6 -3
- package/src/core/geom/vec2/v2_magnitude.d.ts +3 -5
- package/src/core/geom/vec2/v2_magnitude.d.ts.map +1 -1
- package/src/core/geom/vec2/v2_magnitude.js +3 -8
- package/src/core/graph/v2/NodeContainer.d.ts.map +1 -1
- package/src/core/graph/v2/NodeContainer.js +3 -9
- package/src/core/lang/reactive/AbstractCachingParser.d.ts +8 -5
- package/src/core/lang/reactive/AbstractCachingParser.d.ts.map +1 -1
- package/src/core/lang/reactive/AbstractCachingParser.js +19 -24
- package/src/core/lang/reactive/pegjs/ReactivePegParser.d.ts +2 -1
- package/src/core/lang/reactive/pegjs/ReactivePegParser.d.ts.map +1 -1
- package/src/core/localization/Localization.js +1 -1
- package/src/engine/achievements/AchievementManager.d.ts +1 -1
- package/src/engine/achievements/AchievementManager.d.ts.map +1 -1
- package/src/engine/achievements/AchievementManager.js +11 -28
- package/src/engine/ecs/EntityComponentDataset.d.ts.map +1 -1
- package/src/engine/ecs/EntityComponentDataset.js +5 -2
- package/src/engine/ecs/EntityReference.d.ts +6 -0
- package/src/engine/ecs/EntityReference.d.ts.map +1 -1
- package/src/engine/ecs/EntityReference.js +16 -1
- package/src/engine/ecs/storage/BinaryBufferDeSerializer.js +1 -1
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.d.ts +10 -0
- package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureTileLoader.js +39 -19
- package/src/engine/graphics/texture/virtual/VirtualTextureUsage.d.ts +8 -0
- package/src/engine/graphics/texture/virtual/VirtualTextureUsage.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureUsage.js +8 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureUsageUpdater.d.ts.map +1 -1
- package/src/engine/graphics/texture/virtual/VirtualTextureUsageUpdater.js +2 -1
- package/src/engine/intelligence/behavior/composite/SequenceBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/composite/SequenceBehavior.js +17 -5
- package/src/engine/intelligence/behavior/ecs/DieBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/DieBehavior.js +2 -7
- package/src/engine/intelligence/behavior/ecs/SendEventBehavior.d.ts +4 -0
- package/src/engine/intelligence/behavior/ecs/SendEventBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/SendEventBehavior.js +8 -7
- package/src/engine/intelligence/behavior/ecs/WaitForEventBehavior.d.ts.map +1 -1
- package/src/engine/intelligence/behavior/ecs/WaitForEventBehavior.js +21 -22
- package/src/core/bvh2/bvh3/query/cache/BVH_QUERY_CACHE_SIZE.d.ts +0 -2
- package/src/core/bvh2/bvh3/query/cache/BVH_QUERY_CACHE_SIZE.d.ts.map +0 -1
- package/src/core/bvh2/bvh3/query/cache/BVH_QUERY_CACHE_SIZE.js +0 -1
- package/src/core/bvh2/bvh3/query/cache/bvh_query_cache_hash_v3.d.ts +0 -9
- package/src/core/bvh2/bvh3/query/cache/bvh_query_cache_hash_v3.d.ts.map +0 -1
- package/src/core/bvh2/bvh3/query/cache/bvh_query_cache_hash_v3.js +0 -31
- package/src/core/geom/2d/lt-grid/LooseTightGrid.d.ts +0 -55
- package/src/core/geom/2d/lt-grid/LooseTightGrid.d.ts.map +0 -1
- package/src/core/geom/2d/lt-grid/LooseTightGrid.js +0 -221
package/src/core/geom/3d/Ray3.js
CHANGED
|
@@ -212,4 +212,36 @@ export class Ray3 extends Float32Array {
|
|
|
212
212
|
equals(other) {
|
|
213
213
|
return array_range_equal_strict(this, 0, other, 0, 7);
|
|
214
214
|
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
*
|
|
218
|
+
* @param {number} origin_x
|
|
219
|
+
* @param {number} origin_y
|
|
220
|
+
* @param {number} origin_z
|
|
221
|
+
* @param {number} direction_x
|
|
222
|
+
* @param {number} direction_y
|
|
223
|
+
* @param {number} direction_z
|
|
224
|
+
* @param {number} t_max
|
|
225
|
+
* @return {Ray3}
|
|
226
|
+
*/
|
|
227
|
+
static from(
|
|
228
|
+
origin_x, origin_y, origin_z,
|
|
229
|
+
direction_x, direction_y, direction_z,
|
|
230
|
+
t_max = Infinity
|
|
231
|
+
) {
|
|
232
|
+
|
|
233
|
+
const ray = new Ray3();
|
|
234
|
+
|
|
235
|
+
ray[0] = origin_x;
|
|
236
|
+
ray[1] = origin_y;
|
|
237
|
+
ray[2] = origin_z;
|
|
238
|
+
|
|
239
|
+
ray[3] = direction_x;
|
|
240
|
+
ray[4] = direction_y;
|
|
241
|
+
ray[5] = direction_z;
|
|
242
|
+
|
|
243
|
+
ray[6] = t_max;
|
|
244
|
+
|
|
245
|
+
return ray;
|
|
246
|
+
}
|
|
215
247
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AABB3.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/aabb/AABB3.js"],"names":[],"mappings":"AAeA;;;GAGG;AACH;IACI;;;;;;;;;OASG;IACH,iBARW,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,EAYhB;IAyCD,gBAEC;IA7BD,aAEC;IA6BD,gBAEC;IA5BD,aAEC;IA4BD,gBAEC;IA5BD,aAEC;IA4BD,gBAEC;IA3BD,aAEC;IA2BD,gBAEC;IA1BD,aAEC;IA0BD,gBAEC;IA1BD,aAEC;IAGG,QAAW;IAIX,QAAW;IAI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;IAED;;;;;;;;;OASG;IACH,iBARW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,iBAHW,KAAK,GACH,OAAO,CAInB;IAED;;;OAGG;IACH,eAFa,MAAM,CAIlB;IAED,oBAEC;IAED;;;OAGG;IACH,eAFa,MAAM,CAIlB;IAED,qBAEC;IAED;;;OAGG;IACH,eAFa,MAAM,CAIlB;IAED,oBAEC;IAED;;;OAGG;IACH,mBAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,mBAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,mBAFa,MAAM,CAIlB;IAED;;;OAGG;IACH,mBAFW,OAAO,QAQjB;IAED;;;OAGG;IACH,cAFa,MAAM,CAIlB;IAED,sBAEC;IAED;;;OAGG;IACH,cAFa,MAAM,CAIlB;IAED,sBAEC;IAED;;;OAGG;IACH,cAFa,MAAM,CAIlB;IAED,sBAEC;IAED;;;OAGG;IACH,mBAFW,OAAO,
|
|
1
|
+
{"version":3,"file":"AABB3.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/aabb/AABB3.js"],"names":[],"mappings":"AAeA;;;GAGG;AACH;IACI;;;;;;;;;OASG;IACH,iBARW,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,OACN,MAAM,EAYhB;IAyCD,gBAEC;IA7BD,aAEC;IA6BD,gBAEC;IA5BD,aAEC;IA4BD,gBAEC;IA5BD,aAEC;IA4BD,gBAEC;IA3BD,aAEC;IA2BD,gBAEC;IA1BD,aAEC;IA0BD,gBAEC;IA1BD,aAEC;IAGG,QAAW;IAIX,QAAW;IAIX,QAAW;IAIX,QAAW;IAIX,QAAW;IAIX,QAAW;IAGf;;;;;;OAMG;IACH,iBALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,OAAO,CAInB;IAED;;;;;;;OAOG;IACH,8BANW,MAAM,KACN,MAAM,KACN,MAAM,aACN,M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AFa,OAAO,CAYnB;IAED;;;;OAIG;IACH,gCAHW,UAAU,MAAM,CAAC,GAAC,MAAM,EAAE,GAAC,YAAY,GACrC,OAAO,CAYnB;IAED;;;OAGG;IACH,qBAFW,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,QAWjD;IAED;;;OAGG;IACH,YAFW,MAAM,QAUhB;IAED;;;OAGG;IACH,SAFa,KAAK,CAQjB;IAED;;;;;;;aAEC;IAIL;;;OAGG;IACH,kBAFU,OAAO,CAEM;IAEvB,mBArOe,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,WAClC,MAAM,4CAoOE;IACvB,oBAnNe,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,WAClC,MAAM,UAkNI;IAEzB;;;;OAIG;IACH,iBAFU,MAAM,CAEM;IA74BlB,mDAUC;CAk3BJ;oBAp6BmB,kBAAkB"}
|
|
@@ -576,11 +576,11 @@ export class AABB3 {
|
|
|
576
576
|
* @param {Vector3} target
|
|
577
577
|
*/
|
|
578
578
|
getExtents(target) {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
579
|
+
target.set(
|
|
580
|
+
this.width,
|
|
581
|
+
this.height,
|
|
582
|
+
this.height,
|
|
583
|
+
);
|
|
584
584
|
}
|
|
585
585
|
|
|
586
586
|
/**
|
|
@@ -627,7 +627,12 @@ export class AABB3 {
|
|
|
627
627
|
const x = this.getCenterX();
|
|
628
628
|
const y = this.getCenterY();
|
|
629
629
|
const z = this.getCenterZ();
|
|
630
|
-
|
|
630
|
+
|
|
631
|
+
target.set(
|
|
632
|
+
x,
|
|
633
|
+
y,
|
|
634
|
+
z
|
|
635
|
+
);
|
|
631
636
|
|
|
632
637
|
return target;
|
|
633
638
|
}
|
|
@@ -709,7 +714,7 @@ export class AABB3 {
|
|
|
709
714
|
* @param {number[]|Float32Array|Float64Array} result
|
|
710
715
|
* @param {number} offset
|
|
711
716
|
*/
|
|
712
|
-
writeToArray(result, offset = 0) {
|
|
717
|
+
writeToArray(result = [], offset = 0) {
|
|
713
718
|
assert.isNonNegativeInteger(offset, 'offset');
|
|
714
719
|
|
|
715
720
|
result[offset] = this.x0;
|
|
@@ -719,6 +724,8 @@ export class AABB3 {
|
|
|
719
724
|
result[offset + 3] = this.x1;
|
|
720
725
|
result[offset + 4] = this.y1;
|
|
721
726
|
result[offset + 5] = this.z1;
|
|
727
|
+
|
|
728
|
+
return result;
|
|
722
729
|
}
|
|
723
730
|
|
|
724
731
|
/**
|
|
@@ -933,6 +940,9 @@ export class AABB3 {
|
|
|
933
940
|
*/
|
|
934
941
|
AABB3.prototype.isAABB3 = true;
|
|
935
942
|
|
|
943
|
+
AABB3.prototype.toArray = AABB3.prototype.writeToArray;
|
|
944
|
+
AABB3.prototype.fromArray = AABB3.prototype.readFromArray;
|
|
945
|
+
|
|
936
946
|
/**
|
|
937
947
|
* Pretending to be an array
|
|
938
948
|
* @readonly
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param {number} x
|
|
6
6
|
* @param {number} y
|
|
7
7
|
* @param {number} z
|
|
8
|
-
* @param {number[]|ArrayLike<number>|Float32Array|Float64Array}
|
|
8
|
+
* @param {number[]|ArrayLike<number>|Float32Array|Float64Array} output output is written here
|
|
9
9
|
*/
|
|
10
|
-
export function sh3_basis_at(x: number, y: number, z: number,
|
|
10
|
+
export function sh3_basis_at(x: number, y: number, z: number, output: number[] | ArrayLike<number> | Float32Array | Float64Array): void;
|
|
11
11
|
//# sourceMappingURL=sh3_basis_at.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sh3_basis_at.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/sphere/harmonics/sh3_basis_at.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,gCALW,MAAM,KACN,MAAM,KACN,MAAM,
|
|
1
|
+
{"version":3,"file":"sh3_basis_at.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/sphere/harmonics/sh3_basis_at.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,gCALW,MAAM,KACN,MAAM,KACN,MAAM,UACN,MAAM,EAAE,GAAC,UAAU,MAAM,CAAC,GAAC,YAAY,GAAC,YAAY,QA+B9D"}
|
|
@@ -8,9 +8,9 @@ import { assert } from "../../../../assert.js";
|
|
|
8
8
|
* @param {number} x
|
|
9
9
|
* @param {number} y
|
|
10
10
|
* @param {number} z
|
|
11
|
-
* @param {number[]|ArrayLike<number>|Float32Array|Float64Array}
|
|
11
|
+
* @param {number[]|ArrayLike<number>|Float32Array|Float64Array} output output is written here
|
|
12
12
|
*/
|
|
13
|
-
export function sh3_basis_at(x, y, z,
|
|
13
|
+
export function sh3_basis_at(x, y, z, output) {
|
|
14
14
|
|
|
15
15
|
assert.isNumber(x,'x');
|
|
16
16
|
assert.notNaN(x,'x');
|
|
@@ -25,18 +25,18 @@ export function sh3_basis_at(x, y, z, shBasis) {
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
// band 0
|
|
28
|
-
|
|
28
|
+
output[0] = 0.28209479177387814;
|
|
29
29
|
|
|
30
30
|
// band 1
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
output[1] = -0.4886025119029199 * y;
|
|
32
|
+
output[2] = 0.4886025119029199 * z;
|
|
33
|
+
output[3] = -0.4886025119029199 * x;
|
|
34
34
|
|
|
35
35
|
// band 2
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
output[4] = 1.0925484305920792 * x * y;
|
|
37
|
+
output[5] = -1.0925484305920792 * y * z;
|
|
38
|
+
output[6] = 0.31539156525252005 * (3 * z * z - 1);
|
|
39
|
+
output[7] = -1.0925484305920792 * x * z;
|
|
40
|
+
output[8] = 0.5462742152960396 * (x * x - y * y);
|
|
41
41
|
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sh3_dering_optimize_positive.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sh3_dering_optimize_positive.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js"],"names":[],"mappings":"AAiSA;;;;;;;GAOG;AACH,qDANW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,aACN,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,oBAClC,MAAM,oBACN,MAAM,QAIhB"}
|
|
@@ -2,6 +2,7 @@ import { mat3, vec3 } from "gl-matrix";
|
|
|
2
2
|
import { assert } from "../../../../assert.js";
|
|
3
3
|
import { array_copy } from "../../../../collection/array/array_copy.js";
|
|
4
4
|
import { min2 } from "../../../../math/min2.js";
|
|
5
|
+
import { sinc } from "../../../../math/sinc.js";
|
|
5
6
|
import { SH3_COEFFICIENTS } from "./SH3_COEFFICIENTS.js";
|
|
6
7
|
import { sh3_rotate_bl } from "./sh3_rotate_bl.js";
|
|
7
8
|
import { sh_index } from "./sh_index.js";
|
|
@@ -34,7 +35,7 @@ function sinc_window(l, w) {
|
|
|
34
35
|
// a sinc window only has zonal harmonics
|
|
35
36
|
let x = (Math.PI * l) / w;
|
|
36
37
|
|
|
37
|
-
x =
|
|
38
|
+
x = sinc(x);
|
|
38
39
|
|
|
39
40
|
// The convolution of a SH function f and a ZH function h is just the product of both
|
|
40
41
|
// scaled by 1 / K(0,l) -- the window coefficients include this scale factor.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tetrahedral_mesh_to_bvh.d.ts","sourceRoot":"","sources":["../../../../../../../src/core/geom/3d/tetrahedra/bvh/tetrahedral_mesh_to_bvh.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,oFAFW,MAAM,EAAE,QA4BlB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ELEMENT_WORD_COUNT } from "../../../../bvh2/bvh3/BVH.js";
|
|
2
|
+
import { tetrahedral_mesh_compute_tet_aabb3 } from "../tetrahedral_mesh_compute_tet_aabb3.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param {BVH} bvh
|
|
7
|
+
* @param {TetrahedralMesh} mesh
|
|
8
|
+
* @param {number[]} positions
|
|
9
|
+
*/
|
|
10
|
+
export function tetrahedral_mesh_to_bvh(bvh, mesh, positions) {
|
|
11
|
+
|
|
12
|
+
const count = mesh.count;
|
|
13
|
+
|
|
14
|
+
bvh.release_all();
|
|
15
|
+
bvh.node_capacity = Math.max(0, count * 2 - 1);
|
|
16
|
+
|
|
17
|
+
const float32 = bvh.data_float32;
|
|
18
|
+
|
|
19
|
+
for (let tet_index = 0; tet_index < count; tet_index++) {
|
|
20
|
+
|
|
21
|
+
const node_id = bvh.allocate_node();
|
|
22
|
+
|
|
23
|
+
const address = node_id * ELEMENT_WORD_COUNT
|
|
24
|
+
|
|
25
|
+
tetrahedral_mesh_compute_tet_aabb3(
|
|
26
|
+
float32, address,
|
|
27
|
+
mesh, tet_index, positions
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
bvh.node_set_user_data(node_id, tet_index);
|
|
31
|
+
|
|
32
|
+
bvh.insert_leaf(node_id);
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number[]|Float32Array} out
|
|
4
|
+
* @param {number} out_offset
|
|
5
|
+
* @param {TetrahedralMesh} mesh
|
|
6
|
+
* @param {number} tet_index
|
|
7
|
+
* @param {number[]|Float32Array} positions
|
|
8
|
+
*/
|
|
9
|
+
export function tetrahedral_mesh_compute_tet_aabb3(out: number[] | Float32Array, out_offset: number, mesh: TetrahedralMesh, tet_index: number, positions: number[] | Float32Array): void;
|
|
10
|
+
//# sourceMappingURL=tetrahedral_mesh_compute_tet_aabb3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tetrahedral_mesh_compute_tet_aabb3.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/tetrahedra/tetrahedral_mesh_compute_tet_aabb3.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wDANW,MAAM,EAAE,GAAC,YAAY,cACrB,MAAM,oCAEN,MAAM,aACN,MAAM,EAAE,GAAC,YAAY,QA0C/B"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {number[]|Float32Array} out
|
|
4
|
+
* @param {number} out_offset
|
|
5
|
+
* @param {TetrahedralMesh} mesh
|
|
6
|
+
* @param {number} tet_index
|
|
7
|
+
* @param {number[]|Float32Array} positions
|
|
8
|
+
*/
|
|
9
|
+
export function tetrahedral_mesh_compute_tet_aabb3(
|
|
10
|
+
out, out_offset,
|
|
11
|
+
mesh, tet_index,
|
|
12
|
+
positions
|
|
13
|
+
) {
|
|
14
|
+
|
|
15
|
+
const vertex_index = mesh.getVertexIndex(tet_index, 0);
|
|
16
|
+
out[out_offset] = out[out_offset + 3] = positions[vertex_index * 3];
|
|
17
|
+
out[out_offset + 1] = out[out_offset + 4] = positions[vertex_index * 3 + 1];
|
|
18
|
+
out[out_offset + 2] = out[out_offset + 5] = positions[vertex_index * 3 + 2];
|
|
19
|
+
|
|
20
|
+
for (let j = 1; j < 4; j++) {
|
|
21
|
+
|
|
22
|
+
const vertex_index = mesh.getVertexIndex(tet_index, j);
|
|
23
|
+
|
|
24
|
+
const v3 = vertex_index * 3;
|
|
25
|
+
|
|
26
|
+
const x = positions[v3];
|
|
27
|
+
const y = positions[v3 + 1];
|
|
28
|
+
const z = positions[v3 + 2];
|
|
29
|
+
|
|
30
|
+
if (x < out[out_offset]) {
|
|
31
|
+
out[out_offset] = x;
|
|
32
|
+
} else if (x > out[out_offset + 3]) {
|
|
33
|
+
out[out_offset + 3] = x;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (y < out[out_offset + 1]) {
|
|
37
|
+
out[out_offset + 1] = y;
|
|
38
|
+
} else if (y > out[out_offset + 4]) {
|
|
39
|
+
out[out_offset + 4] = y;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (z < out[out_offset + 2]) {
|
|
43
|
+
out[out_offset + 2] = z;
|
|
44
|
+
} else if (z > out[out_offset + 5]) {
|
|
45
|
+
out[out_offset + 5] = z;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* Pick a random point within a unit circle
|
|
3
3
|
* Based on: https://stackoverflow.com/questions/5837572/generate-a-random-point-within-a-circle-uniformly
|
|
4
4
|
* @param {function} random
|
|
5
|
-
* @param {
|
|
5
|
+
* @param {number[]|Float32Array} result
|
|
6
|
+
* @param {number} result_offset
|
|
6
7
|
*/
|
|
7
|
-
export function randomPointInCircle(random: Function, result:
|
|
8
|
+
export function randomPointInCircle(random: Function, result: number[] | Float32Array, result_offset: number): void;
|
|
8
9
|
//# sourceMappingURL=randomPointInCircle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"randomPointInCircle.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/random/randomPointInCircle.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"randomPointInCircle.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/random/randomPointInCircle.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,8DAHW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,QAahB"}
|
|
@@ -4,9 +4,10 @@ import { PI2 } from "../../math/PI2.js";
|
|
|
4
4
|
* Pick a random point within a unit circle
|
|
5
5
|
* Based on: https://stackoverflow.com/questions/5837572/generate-a-random-point-within-a-circle-uniformly
|
|
6
6
|
* @param {function} random
|
|
7
|
-
* @param {
|
|
7
|
+
* @param {number[]|Float32Array} result
|
|
8
|
+
* @param {number} result_offset
|
|
8
9
|
*/
|
|
9
|
-
export function randomPointInCircle(random, result) {
|
|
10
|
+
export function randomPointInCircle(random, result, result_offset) {
|
|
10
11
|
const r = Math.sqrt(random());
|
|
11
12
|
|
|
12
13
|
const theta = random() * PI2;
|
|
@@ -14,5 +15,7 @@ export function randomPointInCircle(random, result) {
|
|
|
14
15
|
const x = r * Math.cos(theta);
|
|
15
16
|
const y = r * Math.sin(theta);
|
|
16
17
|
|
|
17
|
-
result
|
|
18
|
+
result[result_offset] = x;
|
|
19
|
+
result[result_offset + 1] = y;
|
|
20
|
+
|
|
18
21
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {number} x
|
|
4
|
-
* @param {number} y
|
|
5
|
-
* @returns {number}
|
|
2
|
+
* @deprecated
|
|
6
3
|
*/
|
|
7
|
-
export
|
|
4
|
+
export const v2_magnitude: typeof v2_length;
|
|
5
|
+
import { v2_length } from "./v2_length.js";
|
|
8
6
|
//# sourceMappingURL=v2_magnitude.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2_magnitude.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec2/v2_magnitude.js"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"v2_magnitude.d.ts","sourceRoot":"","sources":["../../../../../src/core/geom/vec2/v2_magnitude.js"],"names":[],"mappings":"AAEA;;GAEG;AACH,4CAAsC;0BALZ,gBAAgB"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v2_length } from "./v2_length.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @param {number} x
|
|
6
|
-
* @param {number} y
|
|
7
|
-
* @returns {number}
|
|
4
|
+
* @deprecated
|
|
8
5
|
*/
|
|
9
|
-
export
|
|
10
|
-
return Math.sqrt(v2_length_sqr(x, y));
|
|
11
|
-
}
|
|
6
|
+
export const v2_magnitude = v2_length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeContainer.d.ts","sourceRoot":"","sources":["../../../../../src/core/graph/v2/NodeContainer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeContainer.d.ts","sourceRoot":"","sources":["../../../../../src/core/graph/v2/NodeContainer.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;IACI;;;OAGG;IACH,MAFU,CAAC,CAEC;IAEZ;;;;OAIG;IACH,gBAAa;IAEb;;;;;OAKG;IACH,oBAAwB;IAExB;;;OAGG;IACH,sBAEC;IAED;;;OAGG;IACH,gBAFY,MAAM,CAIjB;IAED;;;OAGG;IACH,YAFY,SAAS,CAIpB;IAED;;;OAGG;IACH,mBAEC;IAED;;;OAGG;IACH,oBAEC;IAGD;;;OAGG;IACH,0BAUC;IAED;;;OAGG;IACH,yBAUC;IAGD;;;;OAIG;IACH,yBAHW,SAAS,GACP,MAAM,CAsBlB;IAED;;;;OAIG;IACH,yBAHW,SAAS,GACP,MAAM,CAsBlB;IAED;;;OAGG;IACH,wBAFY,MAAM,CAmBjB;IAGD;;;;OAIG;IACH,0BAHW,CAAC,GACC,OAAO,CAMnB;IAED;;;;;OAKG;IACH,+DAFa,MAAM,CAclB;IAED;;;;OAIG;IACH,sBAHW,CAAC,GACC,UAAQ,SAAS,CAwB7B;IAED;;;;OAIG;IACH,6BAHW,CAAC,GACC,UAAQ,SAAS,CA0B7B;IAED;;;;OAIG;IACH,kBAFa,OAAO,CAoBnB;IAED;;;;OAIG;IACH,qBAFa,OAAO,CAsBnB;CACJ"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { EdgeDirectionType } from "../Edge.js";
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Supplementary structure to `Graph`, holds edges and neighbour nodes for fast access
|
|
5
3
|
* Used internally by `Graph`
|
|
@@ -170,11 +168,7 @@ export class NodeContainer {
|
|
|
170
168
|
for (let i = 0; i < edge_count; i++) {
|
|
171
169
|
const edge = edges[i];
|
|
172
170
|
|
|
173
|
-
if (
|
|
174
|
-
(edge.first === current_node && edge.direction === EdgeDirectionType.Forward)
|
|
175
|
-
|| (edge.second === current_node && edge.direction === EdgeDirectionType.Backward)
|
|
176
|
-
|
|
177
|
-
) {
|
|
171
|
+
if (edge.isDirectedTowards(current_node)) {
|
|
178
172
|
r++;
|
|
179
173
|
}
|
|
180
174
|
}
|
|
@@ -262,8 +256,8 @@ export class NodeContainer {
|
|
|
262
256
|
const edge = edges[i];
|
|
263
257
|
|
|
264
258
|
if (
|
|
265
|
-
(edge.second === other && edge.
|
|
266
|
-
|| (edge.first === other && edge.
|
|
259
|
+
(edge.second === other && edge.traversableForward())
|
|
260
|
+
|| (edge.first === other && edge.traversableBackward())
|
|
267
261
|
|
|
268
262
|
) {
|
|
269
263
|
return edge;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @template T
|
|
3
|
+
*/
|
|
4
|
+
export class AbstractCachingParser<T> {
|
|
2
5
|
/**
|
|
3
6
|
* Parser cache
|
|
4
|
-
* @type {Cache<string,
|
|
7
|
+
* @type {Cache<string, T>}
|
|
5
8
|
*/
|
|
6
|
-
__cache: Cache<string,
|
|
9
|
+
__cache: Cache<string, T>;
|
|
7
10
|
/**
|
|
8
11
|
*
|
|
9
12
|
* @param {string} code
|
|
@@ -14,9 +17,9 @@ export class AbstractCachingParser {
|
|
|
14
17
|
/**
|
|
15
18
|
*
|
|
16
19
|
* @param {string} code
|
|
17
|
-
* @returns {
|
|
20
|
+
* @returns {T}
|
|
18
21
|
*/
|
|
19
|
-
parse(code: string):
|
|
22
|
+
parse(code: string): T;
|
|
20
23
|
/**
|
|
21
24
|
*
|
|
22
25
|
* @param {string} code
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractCachingParser.d.ts","sourceRoot":"","sources":["../../../../../src/core/lang/reactive/AbstractCachingParser.js"],"names":[],"mappings":"AAMA;
|
|
1
|
+
{"version":3,"file":"AbstractCachingParser.d.ts","sourceRoot":"","sources":["../../../../../src/core/lang/reactive/AbstractCachingParser.js"],"names":[],"mappings":"AAMA;;GAEG;AACH;IAEI;;;OAGG;IACH,SAFU,MAAM,MAAM,EAAE,CAAC,CAAC,CAKvB;IAGH;;;;;OAKG;IACH,wBAEC;IAED;;;;OAIG;IACH,YAHW,MAAM,GACJ,CAAC,CAWb;IAED;;;;OAIG;IACH,eAHW,MAAM,wCAgBhB;CACJ;sBAjEqB,sBAAsB;qBAEvB,wBAAwB"}
|
|
@@ -4,17 +4,20 @@ import { Cache } from "../../cache/Cache.js";
|
|
|
4
4
|
import { noop } from "../../function/noop.js";
|
|
5
5
|
import { computeStringHash } from "../../primitives/strings/computeStringHash.js";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* @template T
|
|
9
|
+
*/
|
|
7
10
|
export class AbstractCachingParser {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Parser cache
|
|
14
|
+
* @type {Cache<string, T>}
|
|
15
|
+
*/
|
|
16
|
+
__cache = new Cache({
|
|
17
|
+
maxWeight: 1000,
|
|
18
|
+
keyHashFunction: computeStringHash
|
|
19
|
+
});
|
|
20
|
+
|
|
18
21
|
|
|
19
22
|
/**
|
|
20
23
|
*
|
|
@@ -29,25 +32,17 @@ export class AbstractCachingParser {
|
|
|
29
32
|
/**
|
|
30
33
|
*
|
|
31
34
|
* @param {string} code
|
|
32
|
-
* @returns {
|
|
35
|
+
* @returns {T}
|
|
33
36
|
*/
|
|
34
37
|
parse(code) {
|
|
35
|
-
assert.
|
|
38
|
+
assert.isString(code, 'code');
|
|
36
39
|
|
|
40
|
+
// applying trim increases chances of cache keys matching
|
|
37
41
|
const trimmedCode = code.trim();
|
|
38
42
|
|
|
39
43
|
assert.notEqual(trimmedCode, "", 'code is empty');
|
|
40
|
-
//check cache
|
|
41
|
-
let parseTree = this.__cache.get(trimmedCode);
|
|
42
|
-
|
|
43
|
-
if (parseTree === null) {
|
|
44
|
-
parseTree = this.__invoke_parser(trimmedCode);
|
|
45
|
-
|
|
46
|
-
//cache compiled expression
|
|
47
|
-
this.__cache.put(trimmedCode, parseTree);
|
|
48
|
-
}
|
|
49
44
|
|
|
50
|
-
return
|
|
45
|
+
return this.__cache.getOrCompute(trimmedCode, this.__invoke_parser, this);
|
|
51
46
|
}
|
|
52
47
|
|
|
53
48
|
/**
|
|
@@ -56,8 +51,8 @@ export class AbstractCachingParser {
|
|
|
56
51
|
* @param {function(e:Error)} [errorConsumer]
|
|
57
52
|
*/
|
|
58
53
|
validate(code, errorConsumer = noop) {
|
|
59
|
-
assert.
|
|
60
|
-
assert.
|
|
54
|
+
assert.isString(code, 'code');
|
|
55
|
+
assert.isFunction(errorConsumer, 'errorConsumer');
|
|
61
56
|
|
|
62
57
|
try {
|
|
63
58
|
this.parse(code);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactivePegParser.d.ts","sourceRoot":"","sources":["../../../../../../src/core/lang/reactive/pegjs/ReactivePegParser.js"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"ReactivePegParser.d.ts","sourceRoot":"","sources":["../../../../../../src/core/lang/reactive/pegjs/ReactivePegParser.js"],"names":[],"mappings":"AAGA;;IAEI,gCAEC;CACJ;;kBAIS,iBAAiB;;sCAZW,6BAA6B"}
|
|
@@ -209,7 +209,7 @@ export class Localization {
|
|
|
209
209
|
|
|
210
210
|
const suggestions = similarities.slice(0, 3).map(p => p.key);
|
|
211
211
|
|
|
212
|
-
return `No localization value for id='${id}', seed=${seed_string}, approximate matches: ${suggestions.join(', ')}`;
|
|
212
|
+
return `No localization value for id='${id}', seed=${seed_string}, best approximate matches: ${suggestions.join(', ')}`;
|
|
213
213
|
});
|
|
214
214
|
|
|
215
215
|
console.warn(message);
|
|
@@ -85,7 +85,7 @@ export class AchievementManager extends EnginePlugin {
|
|
|
85
85
|
*
|
|
86
86
|
* @param {AssetManager} assetManager
|
|
87
87
|
*/
|
|
88
|
-
loadDefinitions(assetManager: AssetManager): Promise<
|
|
88
|
+
loadDefinitions(assetManager: AssetManager): Promise<void>;
|
|
89
89
|
/**
|
|
90
90
|
* Visually present an achievement
|
|
91
91
|
* @param {Achievement} achievement
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AchievementManager.d.ts","sourceRoot":"","sources":["../../../../src/engine/achievements/AchievementManager.js"],"names":[],"mappings":"AA0CA;IAGQ,WAAwB;IAExB;;;OAGG;IACH,SAFU,qBAAmB,IAAI,CAEd;IAEnB;;;OAGG;IACH,SAFU,WAAW,EAAE,CAEN;IAGjB;;;OAGG;IACH,cAFU,eAAa,IAAI,CAEH;IAExB;;;OAGG;IACH,YAFU,aAAW,IAAI,CAEH;IAEtB;;;OAGG;IACH,eAFU,gBAAc,IAAI,CAEH;IAEzB;;;OAGG;IACH,cAFU,eAAa,IAAI,CAEH;IAExB;;;OAGG;IACH,oBAFU,eAAe,CAEkB;IAG3C;;;OAGG;IACH,+BAFU,eAAe,CAE6B;IAEtD;;;OAGG;IACH,+BAFU,eAAe,CAE6B;IAEtD;;;OAGG;IACH,mBAFU,WAAW,CAKpB;IAUD,aAAkB;IAGtB;;;;OAIG;IACH,gCAFY,WAAW,GAAC,SAAS,CAIhC;IAGD;;;OAGG;IACH,yBA6BC;IAED;;;OAGG;IACH,sBAcC;IAED;;;OAGG;IACH,wBAUC;IAGD;;OAEG;IACH,iBAUC;IAED;;OAEG;IACH,mBAMC;IAED,uCAMC;IAED;;;OAGG;IACH,
|
|
1
|
+
{"version":3,"file":"AchievementManager.d.ts","sourceRoot":"","sources":["../../../../src/engine/achievements/AchievementManager.js"],"names":[],"mappings":"AA0CA;IAGQ,WAAwB;IAExB;;;OAGG;IACH,SAFU,qBAAmB,IAAI,CAEd;IAEnB;;;OAGG;IACH,SAFU,WAAW,EAAE,CAEN;IAGjB;;;OAGG;IACH,cAFU,eAAa,IAAI,CAEH;IAExB;;;OAGG;IACH,YAFU,aAAW,IAAI,CAEH;IAEtB;;;OAGG;IACH,eAFU,gBAAc,IAAI,CAEH;IAEzB;;;OAGG;IACH,cAFU,eAAa,IAAI,CAEH;IAExB;;;OAGG;IACH,oBAFU,eAAe,CAEkB;IAG3C;;;OAGG;IACH,+BAFU,eAAe,CAE6B;IAEtD;;;OAGG;IACH,+BAFU,eAAe,CAE6B;IAEtD;;;OAGG;IACH,mBAFU,WAAW,CAKpB;IAUD,aAAkB;IAGtB;;;;OAIG;IACH,gCAFY,WAAW,GAAC,SAAS,CAIhC;IAGD;;;OAGG;IACH,yBA6BC;IAED;;;OAGG;IACH,sBAcC;IAED;;;OAGG;IACH,wBAUC;IAGD;;OAEG;IACH,iBAUC;IAED;;OAEG;IACH,mBAMC;IAED,uCAMC;IAED;;;OAGG;IACH,2DAaC;IAED;;;OAGG;IACH,qBAFW,WAAW,QA2FrB;IAED;;;OAGG;IACH,+CAGC;IAED,mCAoDC;IAED,yBAOC;IAED,0BAEC;CACJ;6BApZ4B,2BAA2B;4BAG5B,kBAAkB;4BAxBlB,qCAAqC;4BACrC,sDAAsD"}
|
|
@@ -18,7 +18,7 @@ import { Transform } from "../ecs/transform/Transform.js";
|
|
|
18
18
|
import { SequenceBehavior } from "../intelligence/behavior/composite/SequenceBehavior.js";
|
|
19
19
|
import { BehaviorComponent } from "../intelligence/behavior/ecs/BehaviorComponent.js";
|
|
20
20
|
import { ClockChannelType } from "../intelligence/behavior/ecs/ClockChannelType.js";
|
|
21
|
-
import {
|
|
21
|
+
import { DieBehavior } from "../intelligence/behavior/ecs/DieBehavior.js";
|
|
22
22
|
import { logger } from "../logging/GlobalLogger.js";
|
|
23
23
|
import { globalMetrics } from "../metrics/GlobalMetrics.js";
|
|
24
24
|
import { MetricsCategory } from "../metrics/MetricsCategory.js";
|
|
@@ -241,35 +241,19 @@ export class AchievementManager extends EnginePlugin {
|
|
|
241
241
|
*
|
|
242
242
|
* @param {AssetManager} assetManager
|
|
243
243
|
*/
|
|
244
|
-
loadDefinitions(assetManager) {
|
|
245
|
-
|
|
246
|
-
assetManager.get(
|
|
247
|
-
{
|
|
248
|
-
path: "data/database/achievements/data.json", type: GameAssetType.JSON, callback: (asset) => {
|
|
249
|
-
try {
|
|
250
|
-
|
|
251
|
-
const json = asset.create();
|
|
252
|
-
|
|
253
|
-
json.forEach(def => {
|
|
254
|
-
const achievement = new Achievement();
|
|
255
|
-
|
|
256
|
-
achievement.fromJSON(def);
|
|
257
|
-
|
|
258
|
-
this.entries.push(achievement);
|
|
259
|
-
});
|
|
244
|
+
async loadDefinitions(assetManager) {
|
|
245
|
+
const asset = await assetManager.promise("data/database/achievements/data.json", GameAssetType.JSON)
|
|
260
246
|
|
|
261
|
-
|
|
247
|
+
const json = asset.create();
|
|
262
248
|
|
|
263
|
-
|
|
249
|
+
json.forEach(def => {
|
|
250
|
+
const achievement = new Achievement();
|
|
264
251
|
|
|
265
|
-
|
|
266
|
-
}
|
|
252
|
+
achievement.fromJSON(def);
|
|
267
253
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}, failure: reject
|
|
271
|
-
});
|
|
254
|
+
this.entries.push(achievement);
|
|
272
255
|
});
|
|
256
|
+
|
|
273
257
|
}
|
|
274
258
|
|
|
275
259
|
/**
|
|
@@ -330,12 +314,11 @@ export class AchievementManager extends EnginePlugin {
|
|
|
330
314
|
opacity: alpha
|
|
331
315
|
});
|
|
332
316
|
})),
|
|
333
|
-
|
|
334
|
-
builder.destroy();
|
|
335
|
-
})
|
|
317
|
+
DieBehavior.create()
|
|
336
318
|
]);
|
|
337
319
|
|
|
338
320
|
const cBehavior = BehaviorComponent.fromOne(sequenceBehavior);
|
|
321
|
+
|
|
339
322
|
//use system clock for behavior
|
|
340
323
|
cBehavior.clock = ClockChannelType.Simulation;
|
|
341
324
|
|