@woosh/meep-engine 2.113.4 → 2.113.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bundle-worker-terrain.js +1 -1
- package/build/meep.cjs +179 -94
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +179 -94
- package/package.json +1 -1
- package/src/core/binary/Base64.d.ts.map +1 -1
- package/src/core/binary/Base64.js +73 -31
- package/src/core/binary/BitSet.d.ts +2 -2
- package/src/core/binary/BitSet.d.ts.map +1 -1
- package/src/core/binary/BitSet.js +8 -8
- package/src/core/binary/align_32.d.ts +2 -2
- package/src/core/binary/align_32.d.ts.map +1 -1
- package/src/core/binary/align_32.js +7 -3
- package/src/core/binary/bitset_find_clear_gap.d.ts +10 -0
- package/src/core/binary/bitset_find_clear_gap.d.ts.map +1 -0
- package/src/core/binary/bitset_find_clear_gap.js +30 -0
- package/src/core/binary/dec2hex.d.ts +2 -2
- package/src/core/binary/dec2hex.d.ts.map +1 -1
- package/src/core/binary/dec2hex.js +7 -3
- package/src/core/binary/downloadAsFile.d.ts +7 -1
- package/src/core/binary/downloadAsFile.d.ts.map +1 -1
- package/src/core/binary/downloadAsFile.js +10 -7
- package/src/core/binary/downloadUrlAsFile.d.ts +1 -1
- package/src/core/binary/downloadUrlAsFile.d.ts.map +1 -1
- package/src/core/binary/downloadUrlAsFile.js +6 -1
- package/src/core/binary/int32_to_binary_string.d.ts +1 -2
- package/src/core/binary/int32_to_binary_string.d.ts.map +1 -1
- package/src/core/binary/int32_to_binary_string.js +4 -2
- package/src/core/binary/url_to_data_url.d.ts +2 -1
- package/src/core/binary/url_to_data_url.d.ts.map +1 -1
- package/src/core/binary/url_to_data_url.js +2 -1
- package/src/core/codegen/LineBuilder.d.ts +4 -3
- package/src/core/codegen/LineBuilder.d.ts.map +1 -1
- package/src/core/codegen/LineBuilder.js +35 -6
- package/src/core/collection/array/arrayIndexByEquality.d.ts +1 -1
- package/src/core/collection/array/arrayIndexByEquality.js +1 -1
- package/src/core/collection/array/array_push_if_unique.d.ts.map +1 -1
- package/src/core/collection/array/array_push_if_unique.js +4 -0
- package/src/core/collection/array/typed/uint_array_for_count.d.ts +2 -2
- package/src/core/collection/array/typed/uint_array_for_count.d.ts.map +1 -1
- package/src/core/collection/array/typed/uint_array_for_count.js +5 -2
- package/src/core/collection/list/List.d.ts.map +1 -1
- package/src/core/collection/list/List.js +7 -2
- package/src/core/collection/map/HashMap.js +1 -1
- package/src/core/collection/table/RowFirstTable.d.ts +12 -12
- package/src/core/collection/table/RowFirstTable.d.ts.map +1 -1
- package/src/core/collection/table/RowFirstTable.js +39 -36
- package/src/core/collection/table/RowFirstTableSpec.d.ts +1 -0
- package/src/core/collection/table/RowFirstTableSpec.d.ts.map +1 -1
- package/src/core/collection/table/RowFirstTableSpec.js +1 -0
- package/src/core/collection/table/serializeRowFirstTable.d.ts.map +1 -1
- package/src/core/collection/table/serializeRowFirstTable.js +6 -4
- package/src/core/math/{isPowerOrTwo.d.ts → isPowerOfTwo.d.ts} +2 -2
- package/src/core/math/isPowerOfTwo.d.ts.map +1 -0
- package/src/core/math/{isPowerOrTwo.js → isPowerOfTwo.js} +2 -4
- package/src/core/model/LinearValue.d.ts +5 -1
- package/src/core/model/LinearValue.d.ts.map +1 -1
- package/src/core/model/LinearValue.js +16 -5
- package/src/core/model/ModuleRegistry.d.ts.map +1 -1
- package/src/core/model/ModuleRegistry.js +33 -29
- package/src/core/model/ResourceAccessSpecification.d.ts.map +1 -1
- package/src/core/model/ResourceAccessSpecification.js +7 -1
- package/src/core/model/node-graph/Connection.d.ts.map +1 -1
- package/src/core/model/node-graph/Connection.js +13 -7
- package/src/core/model/node-graph/NodeGraph.d.ts +10 -1
- package/src/core/model/node-graph/NodeGraph.d.ts.map +1 -1
- package/src/core/model/node-graph/NodeGraph.js +30 -1
- package/src/core/model/node-graph/node/NodeDescription.d.ts.map +1 -1
- package/src/core/model/node-graph/node/NodeDescription.js +8 -0
- package/src/core/model/node-graph/node/NodeInstance.d.ts.map +1 -1
- package/src/core/model/node-graph/node/NodeInstance.js +4 -0
- package/src/core/model/node-graph/node/NodeInstancePortReference.d.ts.map +1 -1
- package/src/core/model/node-graph/node/NodeInstancePortReference.js +6 -10
- package/src/core/primitives/strings/computeStringHash.d.ts.map +1 -1
- package/src/core/primitives/strings/computeStringHash.js +13 -4
- package/src/engine/animation/curve/compression/downsample_float_array_curve_by_error.js +4 -4
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +1 -1
- package/src/core/math/isPowerOrTwo.d.ts.map +0 -1
|
@@ -1,43 +1,47 @@
|
|
|
1
1
|
import { assert } from "../assert.js";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @template T
|
|
5
|
+
*/
|
|
3
6
|
export class ModuleRegistry {
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
*
|
|
7
|
-
* @type {Map<string,
|
|
10
|
+
* @type {Map<string, T>}
|
|
8
11
|
*/
|
|
9
12
|
#modules = new Map();
|
|
10
13
|
/**
|
|
11
14
|
*
|
|
12
|
-
* @type {Map
|
|
15
|
+
* @type {Map<T,Array<string>>}
|
|
13
16
|
*/
|
|
14
17
|
#reverse_lookup = new Map();
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return module;
|
|
19
|
+
/**
|
|
20
|
+
* @readonly
|
|
21
|
+
* @type {ModuleRegistry}
|
|
22
|
+
*/
|
|
23
|
+
proxy = new Proxy(this, {
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param target
|
|
27
|
+
* @param {string} p
|
|
28
|
+
* @param receiver
|
|
29
|
+
* @returns {Class}
|
|
30
|
+
*/
|
|
31
|
+
get(target, p, receiver) {
|
|
32
|
+
const module = target.get(p);
|
|
33
|
+
|
|
34
|
+
if (module === undefined) {
|
|
35
|
+
throw new Error(`Module '${p}' not found in the registry`);
|
|
34
36
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
|
|
38
|
+
return module;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
37
41
|
|
|
38
42
|
/**
|
|
39
43
|
*
|
|
40
|
-
* @param {function(name:string,module
|
|
44
|
+
* @param {function(name:string,module:T):void} visitor
|
|
41
45
|
*/
|
|
42
46
|
traverse(visitor) {
|
|
43
47
|
this.#modules.forEach((klass, name) => visitor(name, klass));
|
|
@@ -45,9 +49,9 @@ export class ModuleRegistry {
|
|
|
45
49
|
|
|
46
50
|
|
|
47
51
|
/**
|
|
48
|
-
* @template T
|
|
52
|
+
* @template {T} M
|
|
49
53
|
* @param {String} name
|
|
50
|
-
* @returns {
|
|
54
|
+
* @returns {M}
|
|
51
55
|
*/
|
|
52
56
|
get(name) {
|
|
53
57
|
return this.#modules.get(name);
|
|
@@ -63,9 +67,9 @@ export class ModuleRegistry {
|
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
/**
|
|
66
|
-
* @template T
|
|
70
|
+
* @template {T} M
|
|
67
71
|
* @param {string} name
|
|
68
|
-
* @param {
|
|
72
|
+
* @param {M} module
|
|
69
73
|
* @returns {boolean}
|
|
70
74
|
*/
|
|
71
75
|
add(name, module) {
|
|
@@ -96,8 +100,8 @@ export class ModuleRegistry {
|
|
|
96
100
|
|
|
97
101
|
/**
|
|
98
102
|
* Find all names associated with the given module
|
|
99
|
-
* @template T
|
|
100
|
-
* @param {
|
|
103
|
+
* @template {T} M
|
|
104
|
+
* @param {M} module
|
|
101
105
|
* @returns {string[]}
|
|
102
106
|
* @throws if module is not registered
|
|
103
107
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceAccessSpecification.d.ts","sourceRoot":"","sources":["../../../../src/core/model/ResourceAccessSpecification.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ResourceAccessSpecification.d.ts","sourceRoot":"","sources":["../../../../src/core/model/ResourceAccessSpecification.js"],"names":[],"mappings":"AAKA;;GAEG;AACH;IAaI;;;;;OAKG;IACH,yCAHW,MAAM,GAAC,kBAAkB,oCAenC;IA9BD;;;OAGG;IACH,QAFU,MAAM,GAAC,kBAAkB,CAEZ;IAEvB;;;OAGG;IACH,UAFU,CAAC,GAAC,IAAI,CAED;IAuBnB;;;OAGG;IACH,wCAFU,OAAO,CAEkD;CANlE;mCAvCkC,yBAAyB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { assert } from "../assert.js";
|
|
1
2
|
import { ResourceAccessKind } from "./ResourceAccessKind.js";
|
|
2
3
|
|
|
3
4
|
const DEFAULT_ACCESS = ResourceAccessKind.Read | ResourceAccessKind.Write;
|
|
@@ -24,7 +25,12 @@ export class ResourceAccessSpecification {
|
|
|
24
25
|
* @param {number|ResourceAccessKind} access
|
|
25
26
|
* @returns {ResourceAccessSpecification<R>}
|
|
26
27
|
*/
|
|
27
|
-
static from(resource, access = DEFAULT_ACCESS){
|
|
28
|
+
static from(resource, access = DEFAULT_ACCESS) {
|
|
29
|
+
assert.defined(resource, 'resource');
|
|
30
|
+
assert.notNull(resource, 'resource');
|
|
31
|
+
|
|
32
|
+
assert.isNonNegativeInteger(access, 'access');
|
|
33
|
+
|
|
28
34
|
const r = new ResourceAccessSpecification();
|
|
29
35
|
|
|
30
36
|
r.access = access;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Connection.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/node-graph/Connection.js"],"names":[],"mappings":"AAYA;IACI;;;OAGG;IACH,aAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,kCAAc;IAEd;;;OAGG;IACH,kCAAc;IAEd;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"Connection.d.ts","sourceRoot":"","sources":["../../../../../src/core/model/node-graph/Connection.js"],"names":[],"mappings":"AAYA;IACI;;;OAGG;IACH,aAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,kCAAc;IAEd;;;OAGG;IACH,kCAAc;IAEd;;;;OAIG;IACH,mCAHoB,MAAM,WACb,OAAO,CAwCnB;IAED;;;OAGG;IACH,qDAKC;IAED;;;OAGG;IACH,qDAKC;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,OAAO,CAQnB;IAED;;;;OAIG;IACH,cAHW,UAAU,GACR,OAAO,CAMnB;IAED;;;OAGG;IACH,QAFY,MAAM,CAUjB;IAED,mBAEC;IAIL;;;OAGG;IACH,uBAFU,OAAO,CAEgB;CAPhC"}
|
|
@@ -31,31 +31,33 @@ export class Connection {
|
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
*
|
|
34
|
-
* @param {function} [
|
|
34
|
+
* @param {function(string):*} [problem_consumer]
|
|
35
35
|
* @returns {boolean} true if connection is valid
|
|
36
36
|
*/
|
|
37
|
-
validate(
|
|
37
|
+
validate(problem_consumer = noop) {
|
|
38
|
+
assert.isFunction(problem_consumer, "problem_consumer");
|
|
39
|
+
|
|
38
40
|
const source = this.source;
|
|
39
41
|
const target = this.target;
|
|
40
42
|
|
|
41
43
|
let result = true;
|
|
42
44
|
|
|
43
45
|
if (source === null) {
|
|
44
|
-
|
|
46
|
+
problem_consumer(`Source port is not set`);
|
|
45
47
|
|
|
46
48
|
result = false;
|
|
47
49
|
} else if (source.port.direction !== PortDirection.Out) {
|
|
48
|
-
|
|
50
|
+
problem_consumer(`Source port must be directed OUT, instead was ${objectKeyByValue(PortDirection, source.port.direction)}`);
|
|
49
51
|
|
|
50
52
|
result = false;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
if (target === null) {
|
|
54
|
-
|
|
56
|
+
problem_consumer(`Target port is not set`);
|
|
55
57
|
|
|
56
58
|
result = false;
|
|
57
59
|
} else if (target.port.direction !== PortDirection.In) {
|
|
58
|
-
|
|
60
|
+
problem_consumer(`Target port must be directed IN, instead was ${objectKeyByValue(PortDirection, target.port.direction)}`);
|
|
59
61
|
|
|
60
62
|
result = false;
|
|
61
63
|
}
|
|
@@ -64,7 +66,7 @@ export class Connection {
|
|
|
64
66
|
(source !== null && target !== null)
|
|
65
67
|
&& (source.port.dataType !== target.port.dataType)
|
|
66
68
|
) {
|
|
67
|
-
|
|
69
|
+
problem_consumer(`Source and Target port data types don't match`);
|
|
68
70
|
|
|
69
71
|
result = false;
|
|
70
72
|
}
|
|
@@ -118,6 +120,10 @@ export class Connection {
|
|
|
118
120
|
;
|
|
119
121
|
}
|
|
120
122
|
|
|
123
|
+
/**
|
|
124
|
+
*
|
|
125
|
+
* @return {number}
|
|
126
|
+
*/
|
|
121
127
|
hash() {
|
|
122
128
|
const source_hash = this.source !== null ? this.source.id : 0;
|
|
123
129
|
const target_hash = this.target !== null ? this.target.id : 0;
|
|
@@ -25,6 +25,12 @@ export class NodeGraph {
|
|
|
25
25
|
* @private
|
|
26
26
|
*/
|
|
27
27
|
private readonly __idpConnections;
|
|
28
|
+
/**
|
|
29
|
+
* Gets incremented every time structure of the graph changes, meaning nodes or connections are added/removed
|
|
30
|
+
* Unsigned integer value
|
|
31
|
+
* @return {number}
|
|
32
|
+
*/
|
|
33
|
+
get version(): number;
|
|
28
34
|
/**
|
|
29
35
|
* @readonly
|
|
30
36
|
*/
|
|
@@ -138,6 +144,7 @@ export class NodeGraph {
|
|
|
138
144
|
* Same as getNode but throw exception when node doesn't exist
|
|
139
145
|
* @param {number} id
|
|
140
146
|
* @returns {NodeInstance}
|
|
147
|
+
* @throws if node doesn't exist
|
|
141
148
|
*/
|
|
142
149
|
getNodeSafe(id: number): NodeInstance;
|
|
143
150
|
/**
|
|
@@ -187,12 +194,13 @@ export class NodeGraph {
|
|
|
187
194
|
* @param {number} targetNode
|
|
188
195
|
* @param {number} targetPort
|
|
189
196
|
* @returns {number} ID of created or already existing connection
|
|
197
|
+
* @throws if any node or port are not found
|
|
190
198
|
*/
|
|
191
199
|
createConnection(sourceNode: number, sourcePort: number, targetNode: number, targetPort: number): number;
|
|
192
200
|
/**
|
|
193
201
|
*
|
|
194
202
|
* @param {number} id
|
|
195
|
-
* @returns {boolean} True if
|
|
203
|
+
* @returns {boolean} True if deleted, false if connection was not found
|
|
196
204
|
*/
|
|
197
205
|
deleteConnection(id: number): boolean;
|
|
198
206
|
/**
|
|
@@ -207,6 +215,7 @@ export class NodeGraph {
|
|
|
207
215
|
* @type {boolean}
|
|
208
216
|
*/
|
|
209
217
|
readonly isNodeGraph: boolean;
|
|
218
|
+
#private;
|
|
210
219
|
}
|
|
211
220
|
import { NodeInstance } from "./node/NodeInstance.js";
|
|
212
221
|
import { Connection } from "./Connection.js";
|
|
@@ -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;
|
|
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,sBAEC;IAED;;OAEG;IACH;QACI;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;QAGH;;;WAGG;;MAEL;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,8BAHoB,YAAY,+BAK/B;IAED;;;;OAIG;IACH,oCAHoB,UAAU,+BAK7B;IAED;;;OAGG;IACH,YAFY,YAAY,EAAE,CAIzB;IAED;;;OAGG;IACH,kBAFY,UAAU,EAAE,CAIvB;IAED;;;;OAIG;IACH,cAHW,YAAY,GACV,OAAO,CAgBnB;IAED;;;;OAIG;IACH,qDAFa,YAAY,EAAE,CAsB1B;IAED;;;;OAIG;IACH,0DAFa,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,4BAA0B,SAAS,CAY/C;IAED;;;;OAIG;IACH,mCAFa,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;;;OAGG;IACH,sBAFU,OAAO,CAEc;;CAN9B;6BAzpB4B,wBAAwB;2BAD1B,iBAAiB"}
|
|
@@ -39,6 +39,21 @@ export class NodeGraph {
|
|
|
39
39
|
*/
|
|
40
40
|
__idpConnections = new IdPool();
|
|
41
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Gets incremented every time structure of the graph changes
|
|
44
|
+
* @type {number}
|
|
45
|
+
*/
|
|
46
|
+
#version = 0;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Gets incremented every time structure of the graph changes, meaning nodes or connections are added/removed
|
|
50
|
+
* Unsigned integer value
|
|
51
|
+
* @return {number}
|
|
52
|
+
*/
|
|
53
|
+
get version() {
|
|
54
|
+
return this.#version;
|
|
55
|
+
}
|
|
56
|
+
|
|
42
57
|
/**
|
|
43
58
|
* @readonly
|
|
44
59
|
*/
|
|
@@ -77,6 +92,8 @@ export class NodeGraph {
|
|
|
77
92
|
|
|
78
93
|
this.__idpNodes.reset();
|
|
79
94
|
this.__idpConnections.reset();
|
|
95
|
+
|
|
96
|
+
this.#version++;
|
|
80
97
|
}
|
|
81
98
|
|
|
82
99
|
/**
|
|
@@ -261,6 +278,7 @@ export class NodeGraph {
|
|
|
261
278
|
* @returns {boolean}
|
|
262
279
|
*/
|
|
263
280
|
hasNode(node) {
|
|
281
|
+
|
|
264
282
|
const existing_node = this.getNode(node.id);
|
|
265
283
|
|
|
266
284
|
if (existing_node === undefined) {
|
|
@@ -281,6 +299,7 @@ export class NodeGraph {
|
|
|
281
299
|
* @returns {NodeInstance[]}
|
|
282
300
|
*/
|
|
283
301
|
getNodesByDescription(description) {
|
|
302
|
+
|
|
284
303
|
assert.defined(description, 'description');
|
|
285
304
|
assert.notNull(description, 'description');
|
|
286
305
|
assert.equal(description.isNodeDescription, true, 'description.isNodeDescription !== true');
|
|
@@ -354,6 +373,7 @@ export class NodeGraph {
|
|
|
354
373
|
* Same as getNode but throw exception when node doesn't exist
|
|
355
374
|
* @param {number} id
|
|
356
375
|
* @returns {NodeInstance}
|
|
376
|
+
* @throws if node doesn't exist
|
|
357
377
|
*/
|
|
358
378
|
getNodeSafe(id) {
|
|
359
379
|
const result = this.getNode(id);
|
|
@@ -441,6 +461,8 @@ export class NodeGraph {
|
|
|
441
461
|
|
|
442
462
|
//record the node
|
|
443
463
|
this.nodes.add(node);
|
|
464
|
+
|
|
465
|
+
this.#version++;
|
|
444
466
|
}
|
|
445
467
|
|
|
446
468
|
/**
|
|
@@ -473,6 +495,8 @@ export class NodeGraph {
|
|
|
473
495
|
//release id
|
|
474
496
|
this.__idpNodes.release(id);
|
|
475
497
|
|
|
498
|
+
this.#version++;
|
|
499
|
+
|
|
476
500
|
return true;
|
|
477
501
|
}
|
|
478
502
|
|
|
@@ -529,6 +553,7 @@ export class NodeGraph {
|
|
|
529
553
|
* @param {number} targetNode
|
|
530
554
|
* @param {number} targetPort
|
|
531
555
|
* @returns {number} ID of created or already existing connection
|
|
556
|
+
* @throws if any node or port are not found
|
|
532
557
|
*/
|
|
533
558
|
createConnection(sourceNode, sourcePort, targetNode, targetPort) {
|
|
534
559
|
assert.isNonNegativeInteger(sourceNode, 'sourceNode');
|
|
@@ -579,13 +604,15 @@ export class NodeGraph {
|
|
|
579
604
|
array_push_if_unique(sourceEndpoint.connections, connection);
|
|
580
605
|
array_push_if_unique(targetEndpoint.connections, connection);
|
|
581
606
|
|
|
607
|
+
this.#version++;
|
|
608
|
+
|
|
582
609
|
return id;
|
|
583
610
|
}
|
|
584
611
|
|
|
585
612
|
/**
|
|
586
613
|
*
|
|
587
614
|
* @param {number} id
|
|
588
|
-
* @returns {boolean} True if
|
|
615
|
+
* @returns {boolean} True if deleted, false if connection was not found
|
|
589
616
|
*/
|
|
590
617
|
deleteConnection(id) {
|
|
591
618
|
|
|
@@ -607,6 +634,8 @@ export class NodeGraph {
|
|
|
607
634
|
array_remove_first(sourceEndpoint.connections, connection);
|
|
608
635
|
array_remove_first(targetEndpoint.connections, connection);
|
|
609
636
|
|
|
637
|
+
this.#version++;
|
|
638
|
+
|
|
610
639
|
return true;
|
|
611
640
|
}
|
|
612
641
|
|
|
@@ -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,OAAO,IAAI,CAAC;QAGtB;;;WAGG;8BADO,OAAO,IAAI,CAAC;MAGxB;IAEF;;;;OAIG;IACH,4CAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;OAGG;IACH,sBAEC;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,oDAHW,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;;;;OAIG;IACH,cAHW,eAAe,GACb,OAAO,CAYnB;IAED,mBAEC;IAED;;;;MAMC;IAED;;;;;;OAMG;IACH,8BALW,EAAE,gCAaZ;IAKL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAR1C;;;;
|
|
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,OAAO,IAAI,CAAC;QAGtB;;;WAGG;8BADO,OAAO,IAAI,CAAC;MAGxB;IAEF;;;;OAIG;IACH,4CAEC;IAED;;;OAGG;IACH,uBAEC;IAED;;;OAGG;IACH,sBAEC;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,oDAHW,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,gCAaZ;IAKL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;CAR1C;;;;qBAvaoB,WAAW;yCADS,yCAAyC;mBAH/D,kCAAkC;sCAEf,sCAAsC;8BAG9C,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeInstance.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeInstance.js"],"names":[],"mappings":"AAcA;;;;GAIG;AACH;IAEI;;;;OAIG;IACH,aAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,6BAAmB;IAEnB;;;OAGG;IACH,WAFU,yBAAyB,EAAE,CAEtB;IAEf;;;OAGG;IACH,gBAAgB;IAEhB;;;OAGG;IACH,qBAAmB;IAEnB;;;OAGG;IACH,sBAFU,gBAAgB,CAED;IAEzB;;;;;;OAMG;IACH,wBAFU,MAAM,CAEE;IAElB;;OAEG;IACH;QACI;;;WAGG;mCADO,OAAO,MAAM,WAAO;QAG9B;;;WAGG;iCADO,OAAO,MAAM,MAAI;QAG3B;;;WAGG;mCADO,OAAO,MAAM,MAAI;QAI3B;;;;WAIG;qCADO,yCAAyC,YAAY,CAAC;MAGlE;IAEF;;;;;;OAMG;IACH,8BALW,MAAM,aACN,aAAa,UACb,YAAY,GACV,MAAM,CAsBlB;IAED;;;OAGG;IACH,gDAEC;IAED;;;OAGG;IACH,+CAEC;IAGD;;;OAGG;IACH,mCAEC;IAED;;;;OAIG;IACH,kCAEC;IAED;;;;OAIG;IACH,mBAHW,MAAM,oBAKhB;IAED;;;;OAIG;IACH,mBAHW,MAAM,OAKhB;IAED;;;;OAIG;IACH,yBAHW,MAAM,KAOhB;IAED;;;;OAIG;IACH,2BAHW,MAAM,oBAmChB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,OAAO,CAkBnB;IAED;;;OAGG;IACH,uCAQC;IAED,wBAIC;IAED;;;OAGG;IACH,mDAoCC;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,yBAAyB,GAAC,SAAS,CAoB/C;IAED;;;;OAIG;IACH,6BAHW,MAAM,GACJ,SAAS,GAAC,yBAAyB,CAa/C;IAED,
|
|
1
|
+
{"version":3,"file":"NodeInstance.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeInstance.js"],"names":[],"mappings":"AAcA;;;;GAIG;AACH;IAEI;;;;OAIG;IACH,aAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,6BAAmB;IAEnB;;;OAGG;IACH,WAFU,yBAAyB,EAAE,CAEtB;IAEf;;;OAGG;IACH,gBAAgB;IAEhB;;;OAGG;IACH,qBAAmB;IAEnB;;;OAGG;IACH,sBAFU,gBAAgB,CAED;IAEzB;;;;;;OAMG;IACH,wBAFU,MAAM,CAEE;IAElB;;OAEG;IACH;QACI;;;WAGG;mCADO,OAAO,MAAM,WAAO;QAG9B;;;WAGG;iCADO,OAAO,MAAM,MAAI;QAG3B;;;WAGG;mCADO,OAAO,MAAM,MAAI;QAI3B;;;;WAIG;qCADO,yCAAyC,YAAY,CAAC;MAGlE;IAEF;;;;;;OAMG;IACH,8BALW,MAAM,aACN,aAAa,UACb,YAAY,GACV,MAAM,CAsBlB;IAED;;;OAGG;IACH,gDAEC;IAED;;;OAGG;IACH,+CAEC;IAGD;;;OAGG;IACH,mCAEC;IAED;;;;OAIG;IACH,kCAEC;IAED;;;;OAIG;IACH,mBAHW,MAAM,oBAKhB;IAED;;;;OAIG;IACH,mBAHW,MAAM,OAKhB;IAED;;;;OAIG;IACH,yBAHW,MAAM,KAOhB;IAED;;;;OAIG;IACH,2BAHW,MAAM,oBAmChB;IAED;;;;OAIG;IACH,iBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,OAAO,CAkBnB;IAED;;;OAGG;IACH,uCAQC;IAED,wBAIC;IAED;;;OAGG;IACH,mDAoCC;IAED;;;;OAIG;IACH,qBAHW,MAAM,GACJ,yBAAyB,GAAC,SAAS,CAoB/C;IAED;;;;OAIG;IACH,6BAHW,MAAM,GACJ,SAAS,GAAC,yBAAyB,CAa/C;IAED;;;OAGG;IACH,QAFY,MAAM,CAIjB;IAED;;;;OAIG;IACH,cAHW,YAAY,GACV,OAAO,CAQnB;IAED,mBAEC;IAIL;;;OAGG;IACH,yBAFU,OAAO,CAEoB;CAPpC;0CA9XyC,gCAAgC;iBAHzD,kCAAkC;mBAChC,kCAAkC;8BAGvB,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeInstancePortReference.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeInstancePortReference.js"],"names":[],"mappings":"AASA;;GAEG;AACH;IAgFI;;;;;OAKG;IACH,iDAFa,yBAAyB,
|
|
1
|
+
{"version":3,"file":"NodeInstancePortReference.d.ts","sourceRoot":"","sources":["../../../../../../src/core/model/node-graph/node/NodeInstancePortReference.js"],"names":[],"mappings":"AASA;;GAEG;AACH;IAgFI;;;;;OAKG;IACH,iDAFa,yBAAyB,CAUrC;IA5FD;;;OAGG;IACH,aAFU,MAAM,CAEE;IAElB;;;OAGG;IACH,gCAAgB;IAEhB;;;OAGG;IACH,oBAAY;IAEZ;;;;;OAKG;IACH,sBAFU,YAAY,CAEL;IAEjB;;;OAGG;IACH,mCAEC;IAED;;;OAGG;IACH,kCAEC;IAED;;;OAGG;IACH,kBAFY,OAAO,CAIlB;IAED;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,OAAO,CAqBnB;IAmBD;;;;OAIG;IACH,8CAWC;IAED;;;OAGG;IACH,QAFY,MAAM,CAOjB;IAED;;;;OAIG;IACH,cAHW,yBAAyB,GACvB,OAAO,CAMnB;IAED,mBAEC;IAGL;;;OAGG;IACH,sCAFU,OAAO,CAE8C;CAN9D"}
|
|
@@ -97,19 +97,11 @@ export class NodeInstancePortReference {
|
|
|
97
97
|
* @returns {NodeInstancePortReference}
|
|
98
98
|
*/
|
|
99
99
|
static from(instance, port) {
|
|
100
|
-
assert.defined(instance, 'instance');
|
|
101
|
-
assert.notNull(instance, 'instance');
|
|
102
|
-
assert.equal(instance.isNodeInstance, true, 'instance.isNodeInstance !== true');
|
|
103
|
-
|
|
104
|
-
assert.defined(port, 'port');
|
|
105
|
-
assert.notNull(port, 'port');
|
|
106
|
-
assert.equal(port.isPort, true, 'port.isPort !== true');
|
|
107
|
-
|
|
108
100
|
const r = new NodeInstancePortReference();
|
|
109
101
|
|
|
102
|
+
r.set(instance,port);
|
|
103
|
+
|
|
110
104
|
r.id = port.id;
|
|
111
|
-
r.instance = instance;
|
|
112
|
-
r.port = port;
|
|
113
105
|
|
|
114
106
|
return r;
|
|
115
107
|
}
|
|
@@ -132,6 +124,10 @@ export class NodeInstancePortReference {
|
|
|
132
124
|
this.port = port;
|
|
133
125
|
}
|
|
134
126
|
|
|
127
|
+
/**
|
|
128
|
+
*
|
|
129
|
+
* @return {number}
|
|
130
|
+
*/
|
|
135
131
|
hash() {
|
|
136
132
|
return combine_hash(
|
|
137
133
|
this.instance.hash(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeStringHash.d.ts","sourceRoot":"","sources":["../../../../../src/core/primitives/strings/computeStringHash.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"computeStringHash.d.ts","sourceRoot":"","sources":["../../../../../src/core/primitives/strings/computeStringHash.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,0CAHW,MAAM,GAAC,IAAI,GAAC,SAAS,GACnB,MAAM,CA8BlB"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { assert } from "../../assert.js";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
*
|
|
3
5
|
* @param {string|null|undefined} string
|
|
@@ -12,16 +14,23 @@ export function computeStringHash(string) {
|
|
|
12
14
|
return 1;
|
|
13
15
|
}
|
|
14
16
|
|
|
17
|
+
assert.isString(string,'string');
|
|
18
|
+
|
|
15
19
|
const length = string.length;
|
|
16
20
|
|
|
17
|
-
let hash =
|
|
21
|
+
let hash = length;
|
|
18
22
|
|
|
19
23
|
for (let i = 0; i < length; i++) {
|
|
20
|
-
const
|
|
24
|
+
const code_point = string.charCodeAt(i);
|
|
21
25
|
|
|
22
|
-
|
|
26
|
+
/*
|
|
27
|
+
* Avoiding potentially expensive multiplication operation by using 2 cheaper operation instead
|
|
28
|
+
* (h<<5) - h === h*31
|
|
29
|
+
*/
|
|
30
|
+
hash = ((hash << 5) - hash) + code_point;
|
|
23
31
|
|
|
24
32
|
}
|
|
25
33
|
|
|
26
|
-
|
|
34
|
+
// force uint32
|
|
35
|
+
return hash >>> 0;
|
|
27
36
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
//
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { array_copy } from "../../../../core/collection/array/array_copy.js";
|
|
5
|
+
import { isPowerOfTwo } from "../../../../core/math/isPowerOfTwo.js";
|
|
5
6
|
import { lerp } from "../../../../core/math/lerp.js";
|
|
6
|
-
import {
|
|
7
|
+
import { max2 } from "../../../../core/math/max2.js";
|
|
7
8
|
import { max3 } from "../../../../core/math/max3.js";
|
|
9
|
+
import { min3 } from "../../../../core/math/min3.js";
|
|
8
10
|
import { downsample_float_array } from "./downsample_float_array.js";
|
|
9
|
-
import { array_copy } from "../../../../core/collection/array/array_copy.js";
|
|
10
|
-
import { isPowerOfTwo } from "../../../../core/math/isPowerOrTwo.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
*
|
|
@@ -4,7 +4,7 @@ import { assert } from "../../../../core/assert.js";
|
|
|
4
4
|
import { collectIteratorValueToArray } from "../../../../core/collection/collectIteratorValueToArray.js";
|
|
5
5
|
import { HashMap } from "../../../../core/collection/map/HashMap.js";
|
|
6
6
|
import Signal from "../../../../core/events/signal/Signal.js";
|
|
7
|
-
import { isPowerOfTwo } from "../../../../core/math/
|
|
7
|
+
import { isPowerOfTwo } from "../../../../core/math/isPowerOfTwo.js";
|
|
8
8
|
import { computeMaterialEquality } from "../../../asset/loaders/material/computeMaterialEquality.js";
|
|
9
9
|
import { computeMaterialHash } from "../../../asset/loaders/material/computeMaterialHash.js";
|
|
10
10
|
import { Sampler2D } from "../../texture/sampler/Sampler2D.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isPowerOrTwo.d.ts","sourceRoot":"","sources":["../../../../src/core/math/isPowerOrTwo.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,oCAHW,MAAM,GACJ,OAAO,CAQnB"}
|