@woosh/meep-engine 2.118.8 → 2.118.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/meep.cjs +10 -144
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +10 -144
- package/package.json +1 -1
- package/samples/generation/SampleGenerator0.js +55 -55
- package/samples/generation/generators/interactive/mir_generator_place_buff_objects.js +21 -23
- package/samples/generation/generators/mir_generator_place_bases.js +20 -20
- package/samples/generation/generators/mir_generator_place_road_decorators.js +11 -11
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.d.ts +9 -0
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.d.ts.map +1 -0
- package/src/core/geom/2d/quad-tree/qt_collect_data_all.js +29 -0
- package/src/core/math/gaussian.d.ts.map +1 -1
- package/src/core/math/gaussian.js +4 -1
- package/src/core/math/physics/pdf/pdf_GGX.d.ts +3 -3
- package/src/core/math/physics/pdf/pdf_GGX.d.ts.map +1 -1
- package/src/core/math/physics/pdf/pdf_GGX.js +7 -6
- package/src/core/model/ObservedBoolean.js +1 -1
- package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.d.ts +1 -1
- package/src/core/model/node-graph/json/deserializeNodeGraphFromJSON.js +7 -7
- package/src/core/model/object/validatedObjectValueByKey.js +1 -1
- package/src/core/model/reactive/transform/{ReactiveTypeInferrence.d.ts → inferReactiveExpressionTypes.d.ts} +1 -1
- package/src/core/model/reactive/transform/inferReactiveExpressionTypes.d.ts.map +1 -0
- package/src/core/model/reactive/transform/inferReactiveExpressionTypes.js +60 -0
- package/src/core/model/reactive/trigger/ReactiveTrigger.js +1 -1
- package/src/core/process/delay.d.ts.map +1 -1
- package/src/core/process/delay.js +6 -0
- package/src/core/process/task/TaskGroup.d.ts.map +1 -1
- package/src/core/process/task/TaskGroup.js +3 -8
- package/src/core/process/undo/ActionGroup.d.ts.map +1 -1
- package/src/core/process/undo/ActionGroup.js +6 -9
- package/src/core/process/worker/extractTransferables.d.ts +3 -2
- package/src/core/process/worker/extractTransferables.d.ts.map +1 -1
- package/src/core/process/worker/extractTransferables.js +32 -12
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.d.ts.map +1 -1
- package/src/engine/ecs/dynamic_actions/rules/DynamicRuleDescription.js +3 -1
- package/src/engine/graphics/GraphicsEngine.d.ts.map +1 -1
- package/src/engine/graphics/GraphicsEngine.js +4 -0
- package/src/engine/graphics/ecs/camera/CameraSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/camera/CameraSystem.js +4 -0
- package/src/generation/grid/actions/ContinuousGridCellAction.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellAction.js +6 -8
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.d.ts.map +1 -1
- package/src/generation/grid/actions/ContinuousGridCellActionSetTerrainHeight.js +20 -22
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskDensityMarkerDistribution.js +23 -28
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskExecuteRuleTimes.js +7 -10
- package/src/generation/grid/generation/GridTaskSequence.d.ts.map +1 -1
- package/src/generation/grid/generation/GridTaskSequence.js +2 -5
- package/src/generation/grid/generation/discrete/{GridTaskCellActionRuleSet.d.ts → GridTaskActionRuleSet.d.ts} +1 -1
- package/src/generation/grid/generation/discrete/GridTaskActionRuleSet.d.ts.map +1 -0
- package/src/generation/grid/generation/discrete/{GridTaskCellActionRuleSet.js → GridTaskActionRuleSet.js} +13 -16
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +51 -53
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js +20 -23
- package/src/generation/grid/generation/grid/select/CellSupplierBestN.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/select/CellSupplierBestN.js +38 -39
- package/src/generation/grid/generation/grid/select/CellSupplierPathUpHill.d.ts.map +1 -1
- package/src/generation/grid/generation/grid/select/CellSupplierPathUpHill.js +8 -11
- package/src/generation/grid/generation/road/PathEndPoint.d.ts.map +1 -1
- package/src/generation/grid/generation/road/PathEndPoint.js +8 -10
- package/src/generation/grid/generation/road/RoadConnection.d.ts.map +1 -1
- package/src/generation/grid/generation/road/RoadConnection.js +4 -5
- package/src/generation/markers/GridCellActionPlaceMarker.d.ts.map +1 -1
- package/src/generation/markers/GridCellActionPlaceMarker.js +7 -5
- package/src/view/common/LabelView.d.ts.map +1 -1
- package/src/view/common/LabelView.js +0 -3
- package/src/core/model/LinearValue.d.ts +0 -88
- package/src/core/model/LinearValue.d.ts.map +0 -1
- package/src/core/model/LinearValue.js +0 -140
- package/src/core/model/reactive/transform/ReactiveTypeInferrence.d.ts.map +0 -1
- package/src/core/model/reactive/transform/ReactiveTypeInferrence.js +0 -54
- package/src/generation/grid/generation/discrete/GridTaskCellActionRuleSet.d.ts.map +0 -1
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import { assert } from "../assert.js";
|
|
2
|
-
import Signal from "../events/signal/Signal.js";
|
|
3
|
-
|
|
4
|
-
class LinearValue {
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @readonly
|
|
8
|
-
* @type {Signal}
|
|
9
|
-
*/
|
|
10
|
-
onChanged = new Signal();
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @param {number} [x = 0]
|
|
15
|
-
* @param {number} [a = 0]
|
|
16
|
-
* @param {number} [b = 1]
|
|
17
|
-
* @constructor
|
|
18
|
-
*/
|
|
19
|
-
constructor(x = 0, a = 0, b = 1) {
|
|
20
|
-
assert.isNumber(x, 'x');
|
|
21
|
-
assert.isNumber(a, 'a');
|
|
22
|
-
assert.isNumber(b, 'b');
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @type {number}
|
|
27
|
-
*/
|
|
28
|
-
this.x = x;
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* @type {number}
|
|
32
|
-
*/
|
|
33
|
-
this.a = a;
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
* @type {number}
|
|
37
|
-
*/
|
|
38
|
-
this.b = b;
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
*
|
|
44
|
-
* @param {LinearValue} other
|
|
45
|
-
* @returns {LinearValue}
|
|
46
|
-
*/
|
|
47
|
-
copy(other) {
|
|
48
|
-
return this.set(other.x, other.a, other.b);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @param {number} x
|
|
54
|
-
* @param {number} a
|
|
55
|
-
* @param {number} b
|
|
56
|
-
* @returns {LinearValue}
|
|
57
|
-
*/
|
|
58
|
-
set(x, a, b) {
|
|
59
|
-
this.x = x;
|
|
60
|
-
this.a = a;
|
|
61
|
-
this.b = b;
|
|
62
|
-
|
|
63
|
-
this.onChanged.dispatch(x, a, b);
|
|
64
|
-
return this;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
*
|
|
69
|
-
* @param v
|
|
70
|
-
* @returns {LinearValue}
|
|
71
|
-
*/
|
|
72
|
-
addMultiplier(v) {
|
|
73
|
-
this.b += v;
|
|
74
|
-
|
|
75
|
-
this.onChanged.dispatch(this.x, this.a, this.b);
|
|
76
|
-
return this;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
*
|
|
81
|
-
* @param v
|
|
82
|
-
* @returns {LinearValue}
|
|
83
|
-
*/
|
|
84
|
-
subMultiplier(v) {
|
|
85
|
-
return this.addMultiplier(-v);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
*
|
|
90
|
-
* @param v
|
|
91
|
-
* @returns {LinearValue}
|
|
92
|
-
*/
|
|
93
|
-
addConstant(v) {
|
|
94
|
-
this.a += v;
|
|
95
|
-
|
|
96
|
-
this.onChanged.dispatch(this.x, this.a, this.b);
|
|
97
|
-
return this;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
*
|
|
102
|
-
* @param v
|
|
103
|
-
* @returns {LinearValue}
|
|
104
|
-
*/
|
|
105
|
-
subConstant(v) {
|
|
106
|
-
return this.addConstant(-v);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
*
|
|
111
|
-
* @returns {number}
|
|
112
|
-
*/
|
|
113
|
-
getValue() {
|
|
114
|
-
// y = b*x + a
|
|
115
|
-
return this.x * this.b + this.a;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
*
|
|
120
|
-
* @param {LinearValue} other
|
|
121
|
-
* @returns {boolean}
|
|
122
|
-
*/
|
|
123
|
-
equals(other) {
|
|
124
|
-
return this.x === other.x && this.a === other.a && this.b === other.b;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
toJSON() {
|
|
128
|
-
return {
|
|
129
|
-
x: this.x,
|
|
130
|
-
a: this.a,
|
|
131
|
-
b: this.b
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
fromJSON(json) {
|
|
136
|
-
this.set(json.x, json.a, json.b);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export default LinearValue;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReactiveTypeInferrence.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/reactive/transform/ReactiveTypeInferrence.js"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,4EAiCC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import DataType from "../../../parser/simple/DataType.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param {ReactiveExpression} node
|
|
6
|
-
* @param {DataType} type
|
|
7
|
-
*/
|
|
8
|
-
function setNodeType(node, type) {
|
|
9
|
-
if (node.dataType === DataType.Any) {
|
|
10
|
-
node.dataType = type;
|
|
11
|
-
} else if (node.dataType !== type) {
|
|
12
|
-
//wrong type
|
|
13
|
-
console.warn(`Expected member or logic expression to have type '${type}', instead was '${node.dataType}'`, node);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Infer types in an expression tree, input tree is mutated as a result
|
|
19
|
-
* @param {ReactiveExpression} exp
|
|
20
|
-
*/
|
|
21
|
-
export function inferReactiveExpressionTypes(exp) {
|
|
22
|
-
exp.traverse(function (v) {
|
|
23
|
-
if (v.isBinaryExpression) {
|
|
24
|
-
if (v.left !== null && v.right !== null) {
|
|
25
|
-
if (v.isLogicExpression) {
|
|
26
|
-
setNodeType(v.left, DataType.Boolean);
|
|
27
|
-
setNodeType(v.right, DataType.Boolean);
|
|
28
|
-
} else if (v.isComparativeExpression) {
|
|
29
|
-
if (v.isReactiveEquals || v.isReactiveNotEquals) {
|
|
30
|
-
if (v.left.dataType !== DataType.Any) {
|
|
31
|
-
setNodeType(v.right, v.left.dataType);
|
|
32
|
-
} else if (v.right.dataType !== DataType.Any) {
|
|
33
|
-
setNodeType(v.left, v.right.dataType);
|
|
34
|
-
}
|
|
35
|
-
} else {
|
|
36
|
-
setNodeType(v.left, DataType.Number);
|
|
37
|
-
setNodeType(v.right, DataType.Number);
|
|
38
|
-
}
|
|
39
|
-
} else if (v.isArithmeticExpression) {
|
|
40
|
-
setNodeType(v.left, DataType.Number);
|
|
41
|
-
setNodeType(v.right, DataType.Number);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
} else if (v.isUnaryExpression) {
|
|
45
|
-
if (v.source !== null) {
|
|
46
|
-
if (v.isLogicExpression) {
|
|
47
|
-
setNodeType(v.source, DataType.Boolean);
|
|
48
|
-
} else if (v.isArithmeticExpression) {
|
|
49
|
-
setNodeType(v.source, DataType.Number);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GridTaskCellActionRuleSet.d.ts","sourceRoot":"","sources":["../../../../../../src/generation/grid/generation/discrete/GridTaskCellActionRuleSet.js"],"names":[],"mappings":"AAGA;IAiBI;;;;;;OAMG;IACH;;;;QAFa,qBAAqB,CAejC;IAjCG;;;OAGG;IACH,yBAAiB;IAEjB;;;OAGG;IACH,YAFU,MAAM,CAEG;IAyBvB,2CAEC;CACJ;kCA7CiC,4BAA4B"}
|