@babylonjs/loaders 7.51.1 → 7.51.3

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 (56) hide show
  1. package/glTF/2.0/Extensions/KHR_animation_pointer.d.ts +1 -0
  2. package/glTF/2.0/Extensions/KHR_animation_pointer.data.d.ts +0 -299
  3. package/glTF/2.0/Extensions/KHR_animation_pointer.data.js +190 -224
  4. package/glTF/2.0/Extensions/KHR_animation_pointer.data.js.map +1 -1
  5. package/glTF/2.0/Extensions/KHR_animation_pointer.js +11 -14
  6. package/glTF/2.0/Extensions/KHR_animation_pointer.js.map +1 -1
  7. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.d.ts +339 -0
  8. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js +1546 -0
  9. package/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.js.map +1 -0
  10. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.d.ts +33 -0
  11. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.js +20 -0
  12. package/glTF/2.0/Extensions/KHR_interactivity/flowGraphGLTFDataProvider.js.map +1 -0
  13. package/glTF/2.0/Extensions/KHR_interactivity/index.d.ts +3 -0
  14. package/glTF/2.0/Extensions/KHR_interactivity/index.js +4 -0
  15. package/glTF/2.0/Extensions/KHR_interactivity/index.js.map +1 -0
  16. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.d.ts +71 -0
  17. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js +443 -0
  18. package/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.js.map +1 -0
  19. package/glTF/2.0/Extensions/KHR_interactivity.d.ts +7 -1
  20. package/glTF/2.0/Extensions/KHR_interactivity.js +105 -7
  21. package/glTF/2.0/Extensions/KHR_interactivity.js.map +1 -1
  22. package/glTF/2.0/Extensions/KHR_node_hoverability.js +153 -0
  23. package/glTF/2.0/Extensions/KHR_node_hoverability.js.map +1 -1
  24. package/glTF/2.0/Extensions/KHR_node_selectability.d.ts +30 -0
  25. package/glTF/2.0/Extensions/KHR_node_selectability.js +123 -0
  26. package/glTF/2.0/Extensions/KHR_node_selectability.js.map +1 -0
  27. package/glTF/2.0/Extensions/KHR_node_visibility.js +25 -0
  28. package/glTF/2.0/Extensions/KHR_node_visibility.js.map +1 -1
  29. package/glTF/2.0/Extensions/gltfPathToObjectConverter.d.ts +5 -2
  30. package/glTF/2.0/Extensions/gltfPathToObjectConverter.js +26 -5
  31. package/glTF/2.0/Extensions/gltfPathToObjectConverter.js.map +1 -1
  32. package/glTF/2.0/Extensions/index.d.ts +4 -0
  33. package/glTF/2.0/Extensions/index.js +5 -0
  34. package/glTF/2.0/Extensions/index.js.map +1 -1
  35. package/glTF/2.0/Extensions/objectModelMapping.d.ts +289 -0
  36. package/glTF/2.0/Extensions/objectModelMapping.js +801 -0
  37. package/glTF/2.0/Extensions/objectModelMapping.js.map +1 -0
  38. package/glTF/2.0/glTFLoader.d.ts +4 -1
  39. package/glTF/2.0/glTFLoader.js +24 -12
  40. package/glTF/2.0/glTFLoader.js.map +1 -1
  41. package/glTF/2.0/glTFLoaderAnimation.d.ts +12 -10
  42. package/glTF/2.0/glTFLoaderAnimation.js +13 -11
  43. package/glTF/2.0/glTFLoaderAnimation.js.map +1 -1
  44. package/glTF/2.0/index.d.ts +1 -0
  45. package/glTF/2.0/index.js +1 -0
  46. package/glTF/2.0/index.js.map +1 -1
  47. package/package.json +3 -3
  48. package/glTF/2.0/Extensions/interactivityFunctions.d.ts +0 -9
  49. package/glTF/2.0/Extensions/interactivityFunctions.js +0 -198
  50. package/glTF/2.0/Extensions/interactivityFunctions.js.map +0 -1
  51. package/glTF/2.0/Extensions/interactivityPathToObjectConverter.d.ts +0 -9
  52. package/glTF/2.0/Extensions/interactivityPathToObjectConverter.js +0 -32
  53. package/glTF/2.0/Extensions/interactivityPathToObjectConverter.js.map +0 -1
  54. package/glTF/2.0/Extensions/interactivityUtils.d.ts +0 -4
  55. package/glTF/2.0/Extensions/interactivityUtils.js +0 -108
  56. package/glTF/2.0/Extensions/interactivityUtils.js.map +0 -1
@@ -0,0 +1,1546 @@
1
+ import { Logger } from "@babylonjs/core/Misc/logger.js";
2
+ import { getAnimationTypeByFlowGraphType } from "@babylonjs/core/FlowGraph/flowGraphRichTypes.js";
3
+ export function getMappingForFullOperationName(fullOperationName) {
4
+ const [op, extension] = fullOperationName.split(":");
5
+ return getMappingForDeclaration({ op, extension });
6
+ }
7
+ export function getMappingForDeclaration(declaration, returnNoOpIfNotAvailable = true) {
8
+ const mapping = declaration.extension ? gltfExtensionsToFlowGraphMapping[declaration.extension]?.[declaration.op] : gltfToFlowGraphMapping[declaration.op];
9
+ if (!mapping) {
10
+ Logger.Warn(`No mapping found for operation ${declaration.op} and extension ${declaration.extension || "KHR_interactivity"}`);
11
+ if (returnNoOpIfNotAvailable) {
12
+ const inputs = {};
13
+ const outputs = {
14
+ flows: {},
15
+ };
16
+ if (declaration.inputValueSockets) {
17
+ inputs.values = {};
18
+ for (const key in declaration.inputValueSockets) {
19
+ inputs.values[key] = {
20
+ name: key,
21
+ };
22
+ }
23
+ }
24
+ if (declaration.outputValueSockets) {
25
+ outputs.values = {};
26
+ Object.keys(declaration.outputValueSockets).forEach((key) => {
27
+ outputs.values[key] = {
28
+ name: key,
29
+ };
30
+ });
31
+ }
32
+ return {
33
+ blocks: [], // no blocks, just mapping
34
+ inputs,
35
+ outputs,
36
+ };
37
+ }
38
+ }
39
+ return mapping;
40
+ }
41
+ /**
42
+ * This function will add new mapping to glTF interactivity.
43
+ * Other extensions can define new types of blocks, this is the way to let interactivity know how to parse them.
44
+ * @param key the type of node, i.e. "variable/get"
45
+ * @param extension the extension of the interactivity operation, i.e. "KHR_selectability"
46
+ * @param mapping The mapping object. See documentation or examples below.
47
+ */
48
+ export function addNewInteractivityFlowGraphMapping(key, extension, mapping) {
49
+ gltfExtensionsToFlowGraphMapping[extension] || (gltfExtensionsToFlowGraphMapping[extension] = {});
50
+ gltfExtensionsToFlowGraphMapping[extension][key] = mapping;
51
+ }
52
+ const gltfExtensionsToFlowGraphMapping = {
53
+ /**
54
+ * This is the BABYLON extension for glTF interactivity.
55
+ * It defines babylon-specific blocks and operations.
56
+ */
57
+ BABYLON: {
58
+ /**
59
+ * flow/log is a flow node that logs input to the console.
60
+ * It has "in" and "out" flows, and takes a message as input.
61
+ * The message can be any type of value.
62
+ * The message is logged to the console when the "in" flow is triggered.
63
+ * The "out" flow is triggered when the message is logged.
64
+ */
65
+ "flow/log": {
66
+ blocks: ["FlowGraphConsoleLogBlock" /* FlowGraphBlockNames.ConsoleLog */],
67
+ inputs: {
68
+ values: {
69
+ message: { name: "message" },
70
+ },
71
+ },
72
+ },
73
+ },
74
+ };
75
+ // this mapper is just a way to convert the glTF nodes to FlowGraph nodes in terms of input/output connection names and values.
76
+ const gltfToFlowGraphMapping = {
77
+ "event/onStart": {
78
+ blocks: ["FlowGraphSceneReadyEventBlock" /* FlowGraphBlockNames.SceneReadyEvent */],
79
+ outputs: {
80
+ flows: {
81
+ out: { name: "done" },
82
+ },
83
+ },
84
+ },
85
+ "event/onTick": {
86
+ blocks: ["FlowGraphSceneTickEventBlock" /* FlowGraphBlockNames.SceneTickEvent */],
87
+ inputs: {},
88
+ outputs: {
89
+ values: {
90
+ timeSinceLastTick: { name: "deltaTime", gltfType: "number" /*, dataTransformer: (time: number) => time / 1000*/ },
91
+ },
92
+ flows: {
93
+ out: { name: "done" },
94
+ },
95
+ },
96
+ },
97
+ "event/send": {
98
+ blocks: ["FlowGraphSendCustomEventBlock" /* FlowGraphBlockNames.SendCustomEvent */],
99
+ outputs: {
100
+ flows: {
101
+ out: { name: "done" },
102
+ },
103
+ },
104
+ extraProcessor(gltfBlock, declaration, _mapping, parser, serializedObjects) {
105
+ // set eventId and eventData. The configuration object of the glTF should have a single object.
106
+ // validate that we are running it on the right block.
107
+ if (declaration.op !== "event/send" || !gltfBlock.configuration || Object.keys(gltfBlock.configuration).length !== 1) {
108
+ throw new Error("Receive event should have a single configuration object, the event itself");
109
+ }
110
+ const eventConfiguration = gltfBlock.configuration["event"];
111
+ const eventId = eventConfiguration.value[0];
112
+ if (typeof eventId !== "number") {
113
+ throw new Error("Event id should be a number");
114
+ }
115
+ const event = parser.arrays.events[eventId];
116
+ const serializedObject = serializedObjects[0];
117
+ serializedObject.config || (serializedObject.config = {});
118
+ serializedObject.config.eventId = event.eventId;
119
+ serializedObject.config.eventData = event.eventData;
120
+ return serializedObjects;
121
+ },
122
+ },
123
+ "event/receive": {
124
+ blocks: ["FlowGraphReceiveCustomEventBlock" /* FlowGraphBlockNames.ReceiveCustomEvent */],
125
+ outputs: {
126
+ flows: {
127
+ out: { name: "done" },
128
+ },
129
+ },
130
+ validation(gltfBlock, interactivityGraph) {
131
+ if (!gltfBlock.configuration) {
132
+ Logger.Error("Receive event should have a configuration object");
133
+ return false;
134
+ }
135
+ const eventConfiguration = gltfBlock.configuration["event"];
136
+ if (!eventConfiguration) {
137
+ Logger.Error("Receive event should have a single configuration object, the event itself");
138
+ return false;
139
+ }
140
+ const eventId = eventConfiguration.value[0];
141
+ if (typeof eventId !== "number") {
142
+ Logger.Error("Event id should be a number");
143
+ return false;
144
+ }
145
+ const event = interactivityGraph.events?.[eventId];
146
+ if (!event) {
147
+ Logger.Error(`Event with id ${eventId} not found`);
148
+ return false;
149
+ }
150
+ return true;
151
+ },
152
+ extraProcessor(gltfBlock, declaration, _mapping, parser, serializedObjects) {
153
+ // set eventId and eventData. The configuration object of the glTF should have a single object.
154
+ // validate that we are running it on the right block.
155
+ if (declaration.op !== "event/receive" || !gltfBlock.configuration || Object.keys(gltfBlock.configuration).length !== 1) {
156
+ throw new Error("Receive event should have a single configuration object, the event itself");
157
+ }
158
+ const eventConfiguration = gltfBlock.configuration["event"];
159
+ const eventId = eventConfiguration.value[0];
160
+ if (typeof eventId !== "number") {
161
+ throw new Error("Event id should be a number");
162
+ }
163
+ const event = parser.arrays.events[eventId];
164
+ const serializedObject = serializedObjects[0];
165
+ serializedObject.config || (serializedObject.config = {});
166
+ serializedObject.config.eventId = event.eventId;
167
+ serializedObject.config.eventData = event.eventData;
168
+ return serializedObjects;
169
+ },
170
+ },
171
+ "math/e": getSimpleInputMapping("FlowGraphEBlock" /* FlowGraphBlockNames.E */),
172
+ "math/pi": getSimpleInputMapping("FlowGraphPIBlock" /* FlowGraphBlockNames.PI */),
173
+ "math/inf": getSimpleInputMapping("FlowGraphInfBlock" /* FlowGraphBlockNames.Inf */),
174
+ "math/nan": getSimpleInputMapping("FlowGraphNaNBlock" /* FlowGraphBlockNames.NaN */),
175
+ "math/abs": getSimpleInputMapping("FlowGraphAbsBlock" /* FlowGraphBlockNames.Abs */),
176
+ "math/sign": getSimpleInputMapping("FlowGraphSignBlock" /* FlowGraphBlockNames.Sign */),
177
+ "math/trunc": getSimpleInputMapping("FlowGraphTruncBlock" /* FlowGraphBlockNames.Trunc */),
178
+ "math/floor": getSimpleInputMapping("FlowGraphFloorBlock" /* FlowGraphBlockNames.Floor */),
179
+ "math/ceil": getSimpleInputMapping("FlowGraphCeilBlock" /* FlowGraphBlockNames.Ceil */),
180
+ "math/round": {
181
+ blocks: ["FlowGraphRoundBlock" /* FlowGraphBlockNames.Round */],
182
+ configuration: {},
183
+ inputs: {
184
+ values: {
185
+ a: { name: "a" },
186
+ },
187
+ },
188
+ outputs: {
189
+ values: {
190
+ value: { name: "value" },
191
+ },
192
+ },
193
+ extraProcessor(gltfBlock, declaration, _mapping, parser, serializedObjects) {
194
+ // configure it to work the way glTF specifies
195
+ serializedObjects[0].config = serializedObjects[0].config || {};
196
+ serializedObjects[0].config.roundHalfAwayFromZero = true;
197
+ return serializedObjects;
198
+ },
199
+ },
200
+ "math/fract": getSimpleInputMapping("FlowGraphFractBlock" /* FlowGraphBlockNames.Fraction */),
201
+ "math/neg": getSimpleInputMapping("FlowGraphNegationBlock" /* FlowGraphBlockNames.Negation */),
202
+ "math/add": getSimpleInputMapping("FlowGraphAddBlock" /* FlowGraphBlockNames.Add */, ["a", "b"], true),
203
+ "math/sub": getSimpleInputMapping("FlowGraphSubtractBlock" /* FlowGraphBlockNames.Subtract */, ["a", "b"], true),
204
+ "math/mul": {
205
+ blocks: ["FlowGraphMultiplyBlock" /* FlowGraphBlockNames.Multiply */],
206
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects) {
207
+ // configure it to work the way glTF specifies
208
+ serializedObjects[0].config = serializedObjects[0].config || {};
209
+ serializedObjects[0].config.useMatrixPerComponent = true;
210
+ // try to infer the type or fallback to Integer
211
+ // check the gltf block for the inputs, see if they have a type
212
+ let type = -1;
213
+ Object.keys(_gltfBlock.values || {}).find((value) => {
214
+ if (_gltfBlock.values?.[value].type !== undefined) {
215
+ type = _gltfBlock.values[value].type;
216
+ return true;
217
+ }
218
+ return false;
219
+ });
220
+ if (type !== -1) {
221
+ serializedObjects[0].config.type = _parser.arrays.types[type].flowGraphType;
222
+ }
223
+ return serializedObjects;
224
+ },
225
+ },
226
+ "math/div": getSimpleInputMapping("FlowGraphDivideBlock" /* FlowGraphBlockNames.Divide */, ["a", "b"], true),
227
+ "math/rem": getSimpleInputMapping("FlowGraphModuloBlock" /* FlowGraphBlockNames.Modulo */, ["a", "b"]),
228
+ "math/min": getSimpleInputMapping("FlowGraphMinBlock" /* FlowGraphBlockNames.Min */, ["a", "b"]),
229
+ "math/max": getSimpleInputMapping("FlowGraphMaxBlock" /* FlowGraphBlockNames.Max */, ["a", "b"]),
230
+ "math/clamp": getSimpleInputMapping("FlowGraphClampBlock" /* FlowGraphBlockNames.Clamp */, ["a", "b", "c"]),
231
+ "math/saturate": getSimpleInputMapping("FlowGraphSaturateBlock" /* FlowGraphBlockNames.Saturate */),
232
+ "math/mix": getSimpleInputMapping("FlowGraphMathInterpolationBlock" /* FlowGraphBlockNames.MathInterpolation */, ["a", "b", "c"]),
233
+ "math/eq": getSimpleInputMapping("FlowGraphEqualityBlock" /* FlowGraphBlockNames.Equality */, ["a", "b"]),
234
+ "math/lt": getSimpleInputMapping("FlowGraphLessThanBlock" /* FlowGraphBlockNames.LessThan */, ["a", "b"]),
235
+ "math/le": getSimpleInputMapping("FlowGraphLessThanOrEqualBlock" /* FlowGraphBlockNames.LessThanOrEqual */, ["a", "b"]),
236
+ "math/gt": getSimpleInputMapping("FlowGraphGreaterThanBlock" /* FlowGraphBlockNames.GreaterThan */, ["a", "b"]),
237
+ "math/ge": getSimpleInputMapping("FlowGraphGreaterThanOrEqualBlock" /* FlowGraphBlockNames.GreaterThanOrEqual */, ["a", "b"]),
238
+ "math/isnan": getSimpleInputMapping("FlowGraphIsNaNBlock" /* FlowGraphBlockNames.IsNaN */),
239
+ "math/isinf": getSimpleInputMapping("FlowGraphIsInfBlock" /* FlowGraphBlockNames.IsInfinity */),
240
+ "math/select": {
241
+ blocks: ["FlowGraphConditionalBlock" /* FlowGraphBlockNames.Conditional */],
242
+ inputs: {
243
+ values: {
244
+ condition: { name: "condition" },
245
+ // Should we validate those have the same type here, or assume it is already validated?
246
+ a: { name: "onTrue" },
247
+ b: { name: "onFalse" },
248
+ },
249
+ },
250
+ outputs: {
251
+ values: {
252
+ value: { name: "output" },
253
+ },
254
+ },
255
+ },
256
+ "math/random": {
257
+ blocks: ["FlowGraphRandomBlock" /* FlowGraphBlockNames.Random */],
258
+ outputs: {
259
+ values: {
260
+ value: { name: "value" },
261
+ },
262
+ },
263
+ },
264
+ "math/sin": getSimpleInputMapping("FlowGraphSinBlock" /* FlowGraphBlockNames.Sin */),
265
+ "math/cos": getSimpleInputMapping("FlowGraphCosBlock" /* FlowGraphBlockNames.Cos */),
266
+ "math/tan": getSimpleInputMapping("FlowGraphTanBlock" /* FlowGraphBlockNames.Tan */),
267
+ "math/asin": getSimpleInputMapping("FlowGraphASinBlock" /* FlowGraphBlockNames.Asin */),
268
+ "math/acos": getSimpleInputMapping("FlowGraphACosBlock" /* FlowGraphBlockNames.Acos */),
269
+ "math/atan": getSimpleInputMapping("FlowGraphATanBlock" /* FlowGraphBlockNames.Atan */),
270
+ "math/atan2": getSimpleInputMapping("FlowGraphATan2Block" /* FlowGraphBlockNames.Atan2 */, ["a", "b"]),
271
+ "math/sinh": getSimpleInputMapping("FlowGraphSinhBlock" /* FlowGraphBlockNames.Sinh */),
272
+ "math/cosh": getSimpleInputMapping("FlowGraphCoshBlock" /* FlowGraphBlockNames.Cosh */),
273
+ "math/tanh": getSimpleInputMapping("FlowGraphTanhBlock" /* FlowGraphBlockNames.Tanh */),
274
+ "math/asinh": getSimpleInputMapping("FlowGraphASinhBlock" /* FlowGraphBlockNames.Asinh */),
275
+ "math/acosh": getSimpleInputMapping("FlowGraphACoshBlock" /* FlowGraphBlockNames.Acosh */),
276
+ "math/atanh": getSimpleInputMapping("FlowGraphATanhBlock" /* FlowGraphBlockNames.Atanh */),
277
+ "math/exp": getSimpleInputMapping("FlowGraphExponentialBlock" /* FlowGraphBlockNames.Exponential */),
278
+ "math/log": getSimpleInputMapping("FlowGraphLogBlock" /* FlowGraphBlockNames.Log */),
279
+ "math/log2": getSimpleInputMapping("FlowGraphLog2Block" /* FlowGraphBlockNames.Log2 */),
280
+ "math/log10": getSimpleInputMapping("FlowGraphLog10Block" /* FlowGraphBlockNames.Log10 */),
281
+ "math/sqrt": getSimpleInputMapping("FlowGraphSquareRootBlock" /* FlowGraphBlockNames.SquareRoot */),
282
+ "math/cbrt": getSimpleInputMapping("FlowGraphCubeRootBlock" /* FlowGraphBlockNames.CubeRoot */),
283
+ "math/pow": getSimpleInputMapping("FlowGraphPowerBlock" /* FlowGraphBlockNames.Power */, ["a", "b"]),
284
+ "math/length": getSimpleInputMapping("FlowGraphLengthBlock" /* FlowGraphBlockNames.Length */),
285
+ "math/normalize": getSimpleInputMapping("FlowGraphNormalizeBlock" /* FlowGraphBlockNames.Normalize */),
286
+ "math/dot": getSimpleInputMapping("FlowGraphDotBlock" /* FlowGraphBlockNames.Dot */, ["a", "b"]),
287
+ "math/cross": getSimpleInputMapping("FlowGraphCrossBlock" /* FlowGraphBlockNames.Cross */, ["a", "b"]),
288
+ "math/rotate2d": getSimpleInputMapping("FlowGraphRotate2DBlock" /* FlowGraphBlockNames.Rotate2D */, ["a", "b"]),
289
+ "math/rotate3d": getSimpleInputMapping("FlowGraphRotate3DBlock" /* FlowGraphBlockNames.Rotate3D */, ["a", "b", "c"]),
290
+ "math/transform": {
291
+ // glTF transform is vectorN with matrixN
292
+ blocks: ["FlowGraphTransformVectorBlock" /* FlowGraphBlockNames.TransformVector */],
293
+ inputs: {
294
+ values: {
295
+ a: { name: "a" },
296
+ b: { name: "b" },
297
+ },
298
+ },
299
+ outputs: {
300
+ values: {
301
+ value: { name: "value" },
302
+ },
303
+ },
304
+ },
305
+ "math/combine2": {
306
+ blocks: ["FlowGraphCombineVector2Block" /* FlowGraphBlockNames.CombineVector2 */],
307
+ inputs: {
308
+ values: {
309
+ a: { name: "input_0", gltfType: "number" },
310
+ b: { name: "input_1", gltfType: "number" },
311
+ },
312
+ },
313
+ outputs: {
314
+ values: {
315
+ value: { name: "value" },
316
+ },
317
+ },
318
+ },
319
+ "math/combine3": {
320
+ blocks: ["FlowGraphCombineVector3Block" /* FlowGraphBlockNames.CombineVector3 */],
321
+ inputs: {
322
+ values: {
323
+ a: { name: "input_0", gltfType: "number" },
324
+ b: { name: "input_1", gltfType: "number" },
325
+ c: { name: "input_2", gltfType: "number" },
326
+ },
327
+ },
328
+ outputs: {
329
+ values: {
330
+ value: { name: "value" },
331
+ },
332
+ },
333
+ },
334
+ "math/combine4": {
335
+ blocks: ["FlowGraphCombineVector4Block" /* FlowGraphBlockNames.CombineVector4 */],
336
+ inputs: {
337
+ values: {
338
+ a: { name: "input_0", gltfType: "number" },
339
+ b: { name: "input_1", gltfType: "number" },
340
+ c: { name: "input_2", gltfType: "number" },
341
+ d: { name: "input_3", gltfType: "number" },
342
+ },
343
+ },
344
+ outputs: {
345
+ values: {
346
+ value: { name: "value" },
347
+ },
348
+ },
349
+ },
350
+ // one input, N outputs! outputs named using numbers.
351
+ "math/extract2": {
352
+ blocks: ["FlowGraphExtractVector2Block" /* FlowGraphBlockNames.ExtractVector2 */],
353
+ inputs: {
354
+ values: {
355
+ a: { name: "input", gltfType: "number" },
356
+ },
357
+ },
358
+ outputs: {
359
+ values: {
360
+ "0": { name: "output_0" },
361
+ "1": { name: "output_1" },
362
+ },
363
+ },
364
+ },
365
+ "math/extract3": {
366
+ blocks: ["FlowGraphExtractVector3Block" /* FlowGraphBlockNames.ExtractVector3 */],
367
+ inputs: {
368
+ values: {
369
+ a: { name: "input", gltfType: "number" },
370
+ },
371
+ },
372
+ outputs: {
373
+ values: {
374
+ "0": { name: "output_0" },
375
+ "1": { name: "output_1" },
376
+ "2": { name: "output_2" },
377
+ },
378
+ },
379
+ },
380
+ "math/extract4": {
381
+ blocks: ["FlowGraphExtractVector4Block" /* FlowGraphBlockNames.ExtractVector4 */],
382
+ inputs: {
383
+ values: {
384
+ a: { name: "input", gltfType: "number" },
385
+ },
386
+ },
387
+ outputs: {
388
+ values: {
389
+ "0": { name: "output_0" },
390
+ "1": { name: "output_1" },
391
+ "2": { name: "output_2" },
392
+ "3": { name: "output_3" },
393
+ },
394
+ },
395
+ },
396
+ "math/transpose": getSimpleInputMapping("FlowGraphTransposeBlock" /* FlowGraphBlockNames.Transpose */),
397
+ "math/determinant": getSimpleInputMapping("FlowGraphDeterminantBlock" /* FlowGraphBlockNames.Determinant */),
398
+ "math/inverse": getSimpleInputMapping("FlowGraphInvertMatrixBlock" /* FlowGraphBlockNames.InvertMatrix */),
399
+ "math/matmul": getSimpleInputMapping("FlowGraphMatrixMultiplicationBlock" /* FlowGraphBlockNames.MatrixMultiplication */, ["a", "b"]),
400
+ "math/matCompose": {
401
+ blocks: ["FlowGraphMatrixCompose" /* FlowGraphBlockNames.MatrixCompose */],
402
+ inputs: {
403
+ values: {
404
+ translation: { name: "position", gltfType: "float3" },
405
+ rotation: { name: "rotationQuaternion", gltfType: "float4" },
406
+ scale: { name: "scaling", gltfType: "float3" },
407
+ },
408
+ },
409
+ outputs: {
410
+ values: {
411
+ value: { name: "value" },
412
+ },
413
+ },
414
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects, context) {
415
+ // configure it to work the way glTF specifies
416
+ const d = serializedObjects[0].dataInputs.find((input) => input.name === "rotationQuaternion");
417
+ if (!d) {
418
+ throw new Error("Rotation quaternion input not found");
419
+ }
420
+ context._connectionValues[d.uniqueId].type = "Quaternion" /* FlowGraphTypes.Quaternion */;
421
+ return serializedObjects;
422
+ },
423
+ },
424
+ "math/matDecompose": {
425
+ blocks: ["FlowGraphMatrixDecompose" /* FlowGraphBlockNames.MatrixDecompose */],
426
+ inputs: {
427
+ values: {
428
+ a: { name: "input", gltfType: "number" },
429
+ },
430
+ },
431
+ outputs: {
432
+ values: {
433
+ translation: { name: "position" },
434
+ rotation: { name: "rotationQuaternion" },
435
+ scale: { name: "scaling" },
436
+ },
437
+ },
438
+ },
439
+ "math/combine2x2": {
440
+ blocks: ["FlowGraphCombineMatrix2DBlock" /* FlowGraphBlockNames.CombineMatrix2D */],
441
+ inputs: {
442
+ values: {
443
+ a: { name: "input_0", gltfType: "number" },
444
+ b: { name: "input_1", gltfType: "number" },
445
+ c: { name: "input_2", gltfType: "number" },
446
+ d: { name: "input_3", gltfType: "number" },
447
+ },
448
+ },
449
+ outputs: {
450
+ values: {
451
+ value: { name: "value" },
452
+ },
453
+ },
454
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects) {
455
+ // configure it to work the way glTF specifies
456
+ serializedObjects[0].config = serializedObjects[0].config || {};
457
+ serializedObjects[0].config.inputIsColumnMajor = true;
458
+ return serializedObjects;
459
+ },
460
+ },
461
+ "math/extract2x2": {
462
+ blocks: ["FlowGraphExtractMatrix2DBlock" /* FlowGraphBlockNames.ExtractMatrix2D */],
463
+ inputs: {
464
+ values: {
465
+ a: { name: "input", gltfType: "float2x2" },
466
+ },
467
+ },
468
+ outputs: {
469
+ values: {
470
+ "0": { name: "output_0" },
471
+ "1": { name: "output_1" },
472
+ "2": { name: "output_2" },
473
+ "3": { name: "output_3" },
474
+ },
475
+ },
476
+ },
477
+ "math/combine3x3": {
478
+ blocks: ["FlowGraphCombineMatrix3DBlock" /* FlowGraphBlockNames.CombineMatrix3D */],
479
+ inputs: {
480
+ values: {
481
+ a: { name: "input_0", gltfType: "number" },
482
+ b: { name: "input_1", gltfType: "number" },
483
+ c: { name: "input_2", gltfType: "number" },
484
+ d: { name: "input_3", gltfType: "number" },
485
+ e: { name: "input_4", gltfType: "number" },
486
+ f: { name: "input_5", gltfType: "number" },
487
+ g: { name: "input_6", gltfType: "number" },
488
+ h: { name: "input_7", gltfType: "number" },
489
+ i: { name: "input_8", gltfType: "number" },
490
+ },
491
+ },
492
+ outputs: {
493
+ values: {
494
+ value: { name: "value" },
495
+ },
496
+ },
497
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects) {
498
+ // configure it to work the way glTF specifies
499
+ serializedObjects[0].config = serializedObjects[0].config || {};
500
+ serializedObjects[0].config.inputIsColumnMajor = true;
501
+ return serializedObjects;
502
+ },
503
+ },
504
+ "math/extract3x3": {
505
+ blocks: ["FlowGraphExtractMatrix3DBlock" /* FlowGraphBlockNames.ExtractMatrix3D */],
506
+ inputs: {
507
+ values: {
508
+ a: { name: "input", gltfType: "float3x3" },
509
+ },
510
+ },
511
+ outputs: {
512
+ values: {
513
+ "0": { name: "output_0" },
514
+ "1": { name: "output_1" },
515
+ "2": { name: "output_2" },
516
+ "3": { name: "output_3" },
517
+ "4": { name: "output_4" },
518
+ "5": { name: "output_5" },
519
+ "6": { name: "output_6" },
520
+ "7": { name: "output_7" },
521
+ "8": { name: "output_8" },
522
+ },
523
+ },
524
+ },
525
+ "math/combine4x4": {
526
+ blocks: ["FlowGraphCombineMatrixBlock" /* FlowGraphBlockNames.CombineMatrix */],
527
+ inputs: {
528
+ values: {
529
+ a: { name: "input_0", gltfType: "number" },
530
+ b: { name: "input_1", gltfType: "number" },
531
+ c: { name: "input_2", gltfType: "number" },
532
+ d: { name: "input_3", gltfType: "number" },
533
+ e: { name: "input_4", gltfType: "number" },
534
+ f: { name: "input_5", gltfType: "number" },
535
+ g: { name: "input_6", gltfType: "number" },
536
+ h: { name: "input_7", gltfType: "number" },
537
+ i: { name: "input_8", gltfType: "number" },
538
+ j: { name: "input_9", gltfType: "number" },
539
+ k: { name: "input_10", gltfType: "number" },
540
+ l: { name: "input_11", gltfType: "number" },
541
+ m: { name: "input_12", gltfType: "number" },
542
+ n: { name: "input_13", gltfType: "number" },
543
+ o: { name: "input_14", gltfType: "number" },
544
+ p: { name: "input_15", gltfType: "number" },
545
+ },
546
+ },
547
+ outputs: {
548
+ values: {
549
+ value: { name: "value" },
550
+ },
551
+ },
552
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects) {
553
+ // configure it to work the way glTF specifies
554
+ serializedObjects[0].config = serializedObjects[0].config || {};
555
+ serializedObjects[0].config.inputIsColumnMajor = true;
556
+ return serializedObjects;
557
+ },
558
+ },
559
+ "math/extract4x4": {
560
+ blocks: ["FlowGraphExtractMatrixBlock" /* FlowGraphBlockNames.ExtractMatrix */],
561
+ configuration: {},
562
+ inputs: {
563
+ values: {
564
+ a: { name: "input", gltfType: "number" },
565
+ },
566
+ },
567
+ outputs: {
568
+ values: {
569
+ "0": { name: "output_0" },
570
+ "1": { name: "output_1" },
571
+ "2": { name: "output_2" },
572
+ "3": { name: "output_3" },
573
+ "4": { name: "output_4" },
574
+ "5": { name: "output_5" },
575
+ "6": { name: "output_6" },
576
+ "7": { name: "output_7" },
577
+ "8": { name: "output_8" },
578
+ "9": { name: "output_9" },
579
+ "10": { name: "output_10" },
580
+ "11": { name: "output_11" },
581
+ "12": { name: "output_12" },
582
+ "13": { name: "output_13" },
583
+ "14": { name: "output_14" },
584
+ "15": { name: "output_15" },
585
+ },
586
+ },
587
+ },
588
+ "math/compose": {
589
+ blocks: ["FlowGraphMatrixCompose" /* FlowGraphBlockNames.MatrixCompose */],
590
+ configuration: {},
591
+ inputs: {
592
+ values: {
593
+ translation: { name: "position", gltfType: "float3" },
594
+ rotation: { name: "rotationQuaternion", gltfType: "float4" },
595
+ scale: { name: "scaling", gltfType: "float3" },
596
+ },
597
+ },
598
+ outputs: {
599
+ values: {
600
+ value: { name: "output" },
601
+ },
602
+ },
603
+ },
604
+ "math/decompose": {
605
+ blocks: ["FlowGraphMatrixDecompose" /* FlowGraphBlockNames.MatrixDecompose */],
606
+ configuration: {},
607
+ inputs: {
608
+ values: {
609
+ a: { name: "input" },
610
+ },
611
+ },
612
+ outputs: {
613
+ values: {
614
+ translation: { name: "position" },
615
+ rotation: { name: "rotationQuaternion" },
616
+ scale: { name: "scaling" },
617
+ },
618
+ },
619
+ },
620
+ "math/not": {
621
+ blocks: ["FlowGraphBitwiseNotBlock" /* FlowGraphBlockNames.BitwiseNot */],
622
+ inputs: {
623
+ values: {
624
+ a: { name: "a" },
625
+ },
626
+ },
627
+ outputs: {
628
+ values: {
629
+ value: { name: "value" },
630
+ },
631
+ },
632
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects, context) {
633
+ // configure it to work the way glTF specifies
634
+ serializedObjects[0].config = serializedObjects[0].config || {};
635
+ // try to infer the type or fallback to Integer
636
+ const socketIn = serializedObjects[0].dataInputs[0];
637
+ serializedObjects[0].config.valueType = context._connectionValues[socketIn.uniqueId]?.type ?? "FlowGraphInteger" /* FlowGraphTypes.Integer */;
638
+ return serializedObjects;
639
+ },
640
+ },
641
+ "math/and": {
642
+ blocks: ["FlowGraphBitwiseAndBlock" /* FlowGraphBlockNames.BitwiseAnd */],
643
+ inputs: {
644
+ values: {
645
+ a: { name: "a" },
646
+ b: { name: "b" },
647
+ },
648
+ },
649
+ outputs: {
650
+ values: {
651
+ value: { name: "value" },
652
+ },
653
+ },
654
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects, context) {
655
+ // configure it to work the way glTF specifies
656
+ serializedObjects[0].config = serializedObjects[0].config || {};
657
+ // try to infer the type or fallback to Integer
658
+ const socketInA = serializedObjects[0].dataInputs[0];
659
+ const socketInB = serializedObjects[0].dataInputs[1];
660
+ serializedObjects[0].config.valueType =
661
+ context._connectionValues[socketInA.uniqueId]?.type ?? context._connectionValues[socketInB.uniqueId]?.type ?? "FlowGraphInteger" /* FlowGraphTypes.Integer */;
662
+ return serializedObjects;
663
+ },
664
+ },
665
+ "math/or": {
666
+ blocks: ["FlowGraphBitwiseOrBlock" /* FlowGraphBlockNames.BitwiseOr */],
667
+ inputs: {
668
+ values: {
669
+ a: { name: "a" },
670
+ b: { name: "b" },
671
+ },
672
+ },
673
+ outputs: {
674
+ values: {
675
+ value: { name: "value" },
676
+ },
677
+ },
678
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects, context) {
679
+ // configure it to work the way glTF specifies
680
+ serializedObjects[0].config = serializedObjects[0].config || {};
681
+ // try to infer the type or fallback to Integer
682
+ const socketInA = serializedObjects[0].dataInputs[0];
683
+ const socketInB = serializedObjects[0].dataInputs[1];
684
+ serializedObjects[0].config.valueType =
685
+ context._connectionValues[socketInA.uniqueId]?.type ?? context._connectionValues[socketInB.uniqueId]?.type ?? "FlowGraphInteger" /* FlowGraphTypes.Integer */;
686
+ return serializedObjects;
687
+ },
688
+ },
689
+ "math/xor": {
690
+ blocks: ["FlowGraphBitwiseXorBlock" /* FlowGraphBlockNames.BitwiseXor */],
691
+ inputs: {
692
+ values: {
693
+ a: { name: "a" },
694
+ b: { name: "b" },
695
+ },
696
+ },
697
+ outputs: {
698
+ values: {
699
+ value: { name: "value" },
700
+ },
701
+ },
702
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects, context) {
703
+ // configure it to work the way glTF specifies
704
+ serializedObjects[0].config = serializedObjects[0].config || {};
705
+ // try to infer the type or fallback to Integer
706
+ const socketInA = serializedObjects[0].dataInputs[0];
707
+ const socketInB = serializedObjects[0].dataInputs[1];
708
+ serializedObjects[0].config.valueType =
709
+ context._connectionValues[socketInA.uniqueId]?.type ?? context._connectionValues[socketInB.uniqueId]?.type ?? "FlowGraphInteger" /* FlowGraphTypes.Integer */;
710
+ return serializedObjects;
711
+ },
712
+ },
713
+ "math/asr": getSimpleInputMapping("FlowGraphBitwiseRightShiftBlock" /* FlowGraphBlockNames.BitwiseRightShift */, ["a", "b"]),
714
+ "math/lsl": getSimpleInputMapping("FlowGraphBitwiseLeftShiftBlock" /* FlowGraphBlockNames.BitwiseLeftShift */, ["a", "b"]),
715
+ "math/clz": getSimpleInputMapping("FlowGraphLeadingZerosBlock" /* FlowGraphBlockNames.LeadingZeros */),
716
+ "math/ctz": getSimpleInputMapping("FlowGraphTrailingZerosBlock" /* FlowGraphBlockNames.TrailingZeros */),
717
+ "math/popcnt": getSimpleInputMapping("FlowGraphOneBitsCounterBlock" /* FlowGraphBlockNames.OneBitsCounter */),
718
+ "math/rad": getSimpleInputMapping("FlowGraphDegToRadBlock" /* FlowGraphBlockNames.DegToRad */),
719
+ "math/deg": getSimpleInputMapping("FlowGraphRadToDegBlock" /* FlowGraphBlockNames.RadToDeg */),
720
+ "type/boolToInt": getSimpleInputMapping("FlowGraphBooleanToInt" /* FlowGraphBlockNames.BooleanToInt */),
721
+ "type/boolToFloat": getSimpleInputMapping("FlowGraphBooleanToFloat" /* FlowGraphBlockNames.BooleanToFloat */),
722
+ "type/intToBool": getSimpleInputMapping("FlowGraphIntToBoolean" /* FlowGraphBlockNames.IntToBoolean */),
723
+ "type/intToFloat": getSimpleInputMapping("FlowGraphIntToFloat" /* FlowGraphBlockNames.IntToFloat */),
724
+ "type/floatToInt": getSimpleInputMapping("FlowGraphFloatToInt" /* FlowGraphBlockNames.FloatToInt */),
725
+ "type/floatToBool": getSimpleInputMapping("FlowGraphFloatToBoolean" /* FlowGraphBlockNames.FloatToBoolean */),
726
+ // flows
727
+ "flow/sequence": {
728
+ blocks: ["FlowGraphSequenceBlock" /* FlowGraphBlockNames.Sequence */],
729
+ extraProcessor(gltfBlock, _declaration, _mapping, _arrays, serializedObjects) {
730
+ const serializedObject = serializedObjects[0];
731
+ serializedObject.config || (serializedObject.config = {});
732
+ serializedObject.config.outputSignalCount = Object.keys(gltfBlock.flows || []).length;
733
+ serializedObject.signalOutputs.forEach((output, index) => {
734
+ output.name = "out_" + index;
735
+ });
736
+ return serializedObjects;
737
+ },
738
+ },
739
+ "flow/branch": {
740
+ blocks: ["FlowGraphBranchBlock" /* FlowGraphBlockNames.Branch */],
741
+ outputs: {
742
+ flows: {
743
+ true: { name: "onTrue" },
744
+ false: { name: "onFalse" },
745
+ },
746
+ },
747
+ },
748
+ "flow/switch": {
749
+ blocks: ["FlowGraphSwitchBlock" /* FlowGraphBlockNames.Switch */],
750
+ configuration: {
751
+ cases: { name: "cases", inOptions: true, defaultValue: [] },
752
+ },
753
+ inputs: {
754
+ values: {
755
+ selection: { name: "case" },
756
+ },
757
+ },
758
+ validation(gltfBlock) {
759
+ if (gltfBlock.configuration && gltfBlock.configuration.cases) {
760
+ const cases = gltfBlock.configuration.cases.value;
761
+ const onlyIntegers = cases.every((caseValue) => {
762
+ // case value should be an integer. Since Number.isInteger(1.0) is true, we need to check if toString has only digits.
763
+ return typeof caseValue === "number" && /^\d+$/.test(caseValue.toString());
764
+ });
765
+ if (!onlyIntegers) {
766
+ gltfBlock.configuration.cases.value = [];
767
+ return true;
768
+ }
769
+ // check for duplicates
770
+ const uniqueCases = new Set(cases);
771
+ gltfBlock.configuration.cases.value = Array.from(uniqueCases);
772
+ }
773
+ return true;
774
+ },
775
+ extraProcessor(gltfBlock, declaration, _mapping, _arrays, serializedObjects) {
776
+ // convert all names of output flow to out_$1 apart from "default"
777
+ if (declaration.op !== "flow/switch" || !gltfBlock.flows || Object.keys(gltfBlock.flows).length === 0) {
778
+ throw new Error("Switch should have a single configuration object, the cases array");
779
+ }
780
+ const serializedObject = serializedObjects[0];
781
+ serializedObject.signalOutputs.forEach((output) => {
782
+ if (output.name !== "default") {
783
+ output.name = "out_" + output.name;
784
+ }
785
+ });
786
+ return serializedObjects;
787
+ },
788
+ },
789
+ "flow/while": {
790
+ blocks: ["FlowGraphWhileLoopBlock" /* FlowGraphBlockNames.WhileLoop */],
791
+ outputs: {
792
+ flows: {
793
+ loopBody: { name: "executionFlow" },
794
+ },
795
+ },
796
+ },
797
+ "flow/for": {
798
+ blocks: ["FlowGraphForLoopBlock" /* FlowGraphBlockNames.ForLoop */],
799
+ configuration: {
800
+ initialIndex: { name: "initialIndex", gltfType: "number", inOptions: true, defaultValue: 0 },
801
+ },
802
+ inputs: {
803
+ values: {
804
+ startIndex: { name: "startIndex", gltfType: "number" },
805
+ endIndex: { name: "endIndex", gltfType: "number" },
806
+ },
807
+ },
808
+ outputs: {
809
+ values: {
810
+ index: { name: "index" },
811
+ },
812
+ flows: {
813
+ loopBody: { name: "executionFlow" },
814
+ },
815
+ },
816
+ },
817
+ "flow/doN": {
818
+ blocks: ["FlowGraphDoNBlock" /* FlowGraphBlockNames.DoN */],
819
+ configuration: {},
820
+ inputs: {
821
+ values: {
822
+ n: { name: "maxExecutions", gltfType: "number" },
823
+ },
824
+ },
825
+ outputs: {
826
+ values: {
827
+ currentCount: { name: "executionCount" },
828
+ },
829
+ },
830
+ },
831
+ "flow/multiGate": {
832
+ blocks: ["FlowGraphMultiGateBlock" /* FlowGraphBlockNames.MultiGate */],
833
+ configuration: {
834
+ isRandom: { name: "isRandom", gltfType: "boolean", inOptions: true, defaultValue: false },
835
+ isLoop: { name: "isLoop", gltfType: "boolean", inOptions: true, defaultValue: false },
836
+ },
837
+ extraProcessor(gltfBlock, declaration, _mapping, _arrays, serializedObjects) {
838
+ if (declaration.op !== "flow/multiGate" || !gltfBlock.flows || Object.keys(gltfBlock.flows).length === 0) {
839
+ throw new Error("MultiGate should have a single configuration object, the number of output flows");
840
+ }
841
+ const serializedObject = serializedObjects[0];
842
+ serializedObject.config || (serializedObject.config = {});
843
+ serializedObject.config.outputSignalCount = Object.keys(gltfBlock.flows).length;
844
+ serializedObject.signalOutputs.forEach((output, index) => {
845
+ output.name = "out_" + index;
846
+ });
847
+ return serializedObjects;
848
+ },
849
+ },
850
+ "flow/waitAll": {
851
+ blocks: ["FlowGraphWaitAllBlock" /* FlowGraphBlockNames.WaitAll */],
852
+ configuration: {
853
+ inputFlows: { name: "inputSignalCount", gltfType: "number", inOptions: true, defaultValue: 0 },
854
+ },
855
+ inputs: {
856
+ flows: {
857
+ "[segment]": { name: "in_$1" },
858
+ },
859
+ },
860
+ validation(gltfBlock) {
861
+ // check that the configuration value is an integer
862
+ if (typeof gltfBlock.configuration?.inputFlows?.value[0] !== "number") {
863
+ gltfBlock.configuration = gltfBlock.configuration || {
864
+ inputFlows: { value: [0] },
865
+ };
866
+ gltfBlock.configuration.inputFlows.value = [0];
867
+ }
868
+ return true;
869
+ },
870
+ },
871
+ "flow/throttle": {
872
+ blocks: ["FlowGraphThrottleBlock" /* FlowGraphBlockNames.Throttle */],
873
+ outputs: {
874
+ flows: {
875
+ err: { name: "error" },
876
+ },
877
+ },
878
+ },
879
+ "flow/setDelay": {
880
+ blocks: ["FlowGraphSetDelayBlock" /* FlowGraphBlockNames.SetDelay */],
881
+ outputs: {
882
+ flows: {
883
+ err: { name: "error" },
884
+ },
885
+ },
886
+ },
887
+ "flow/cancelDelay": {
888
+ blocks: ["FlowGraphCancelDelayBlock" /* FlowGraphBlockNames.CancelDelay */],
889
+ },
890
+ "variable/get": {
891
+ blocks: ["FlowGraphGetVariableBlock" /* FlowGraphBlockNames.GetVariable */],
892
+ validation(gltfBlock) {
893
+ if (!gltfBlock.configuration?.variable?.value) {
894
+ Logger.Error("Variable get block should have a variable configuration");
895
+ return false;
896
+ }
897
+ return true;
898
+ },
899
+ configuration: {
900
+ variable: {
901
+ name: "variable",
902
+ gltfType: "number",
903
+ flowGraphType: "string",
904
+ inOptions: true,
905
+ isVariable: true,
906
+ dataTransformer(index, parser) {
907
+ return [parser.getVariableName(index[0])];
908
+ },
909
+ },
910
+ },
911
+ },
912
+ "variable/set": {
913
+ blocks: ["FlowGraphSetVariableBlock" /* FlowGraphBlockNames.SetVariable */],
914
+ configuration: {
915
+ variable: {
916
+ name: "variable",
917
+ gltfType: "number",
918
+ flowGraphType: "string",
919
+ inOptions: true,
920
+ isVariable: true,
921
+ dataTransformer(index, parser) {
922
+ return [parser.getVariableName(index[0])];
923
+ },
924
+ },
925
+ },
926
+ },
927
+ "variable/interpolate": {
928
+ blocks: [
929
+ "FlowGraphInterpolationBlock" /* FlowGraphBlockNames.ValueInterpolation */,
930
+ "FlowGraphContextBlock" /* FlowGraphBlockNames.Context */,
931
+ "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */,
932
+ "FlowGraphBezierCurveEasing" /* FlowGraphBlockNames.BezierCurveEasing */,
933
+ "FlowGraphGetVariableBlock" /* FlowGraphBlockNames.GetVariable */,
934
+ ],
935
+ configuration: {
936
+ variable: {
937
+ name: "propertyName",
938
+ inOptions: true,
939
+ isVariable: true,
940
+ dataTransformer(index, parser) {
941
+ return [parser.getVariableName(index[0])];
942
+ },
943
+ },
944
+ useSlerp: {
945
+ name: "animationType",
946
+ inOptions: true,
947
+ defaultValue: false,
948
+ dataTransformer: (value) => {
949
+ if (value[0] === true) {
950
+ return ["Quaternion" /* FlowGraphTypes.Quaternion */];
951
+ }
952
+ else {
953
+ return [undefined];
954
+ }
955
+ },
956
+ },
957
+ },
958
+ inputs: {
959
+ values: {
960
+ value: { name: "value_1" },
961
+ duration: { name: "duration_1", gltfType: "number" },
962
+ p1: { name: "controlPoint1", toBlock: "FlowGraphBezierCurveEasing" /* FlowGraphBlockNames.BezierCurveEasing */ },
963
+ p2: { name: "controlPoint2", toBlock: "FlowGraphBezierCurveEasing" /* FlowGraphBlockNames.BezierCurveEasing */ },
964
+ },
965
+ flows: {
966
+ in: { name: "in", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
967
+ },
968
+ },
969
+ outputs: {
970
+ flows: {
971
+ err: { name: "error", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
972
+ out: { name: "out", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
973
+ done: { name: "done", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
974
+ },
975
+ },
976
+ interBlockConnectors: [
977
+ {
978
+ input: "object",
979
+ output: "userVariables",
980
+ inputBlockIndex: 2,
981
+ outputBlockIndex: 1,
982
+ isVariable: true,
983
+ },
984
+ {
985
+ input: "animation",
986
+ output: "animation",
987
+ inputBlockIndex: 2,
988
+ outputBlockIndex: 0,
989
+ isVariable: true,
990
+ },
991
+ {
992
+ input: "easingFunction",
993
+ output: "easingFunction",
994
+ inputBlockIndex: 0,
995
+ outputBlockIndex: 3,
996
+ isVariable: true,
997
+ },
998
+ {
999
+ input: "value_0",
1000
+ output: "value",
1001
+ inputBlockIndex: 0,
1002
+ outputBlockIndex: 4,
1003
+ isVariable: true,
1004
+ },
1005
+ ],
1006
+ extraProcessor(gltfBlock, _declaration, _mapping, parser, serializedObjects) {
1007
+ var _a, _b;
1008
+ // is useSlerp is used, animationType should be set to be quaternion!
1009
+ const serializedValueInterpolation = serializedObjects[0];
1010
+ const propertyIndex = gltfBlock.configuration?.variable.value[0];
1011
+ if (typeof propertyIndex !== "number") {
1012
+ Logger.Error("Variable index is not defined for variable interpolation block");
1013
+ throw new Error("Variable index is not defined for variable interpolation block");
1014
+ }
1015
+ const variable = parser.arrays.staticVariables[propertyIndex];
1016
+ // if not set by useSlerp
1017
+ if (typeof serializedValueInterpolation.config.animationType.value === "undefined") {
1018
+ // get the value type
1019
+ parser.arrays.staticVariables;
1020
+ serializedValueInterpolation.config.animationType.value = getAnimationTypeByFlowGraphType(variable.type);
1021
+ }
1022
+ // variable/get configuration
1023
+ const serializedGetVariable = serializedObjects[4];
1024
+ serializedGetVariable.config || (serializedGetVariable.config = {});
1025
+ (_a = serializedGetVariable.config).variable || (_a.variable = {});
1026
+ serializedGetVariable.config.variable.value = parser.getVariableName(propertyIndex);
1027
+ // get the control points from the easing block
1028
+ (_b = serializedObjects[3]).config || (_b.config = {});
1029
+ return serializedObjects;
1030
+ },
1031
+ },
1032
+ "pointer/get": {
1033
+ blocks: ["FlowGraphGetPropertyBlock" /* FlowGraphBlockNames.GetProperty */, "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */],
1034
+ configuration: {
1035
+ pointer: { name: "jsonPointer", toBlock: "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */ },
1036
+ },
1037
+ inputs: {
1038
+ values: {
1039
+ "[segment]": { name: "$1", toBlock: "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */ },
1040
+ },
1041
+ },
1042
+ interBlockConnectors: [
1043
+ {
1044
+ input: "object",
1045
+ output: "object",
1046
+ inputBlockIndex: 0,
1047
+ outputBlockIndex: 1,
1048
+ isVariable: true,
1049
+ },
1050
+ {
1051
+ input: "propertyName",
1052
+ output: "propertyName",
1053
+ inputBlockIndex: 0,
1054
+ outputBlockIndex: 1,
1055
+ isVariable: true,
1056
+ },
1057
+ {
1058
+ input: "customGetFunction",
1059
+ output: "getFunction",
1060
+ inputBlockIndex: 0,
1061
+ outputBlockIndex: 1,
1062
+ isVariable: true,
1063
+ },
1064
+ ],
1065
+ extraProcessor(gltfBlock, _declaration, _mapping, parser, serializedObjects) {
1066
+ serializedObjects.forEach((serializedObject) => {
1067
+ // check if it is the json pointer block
1068
+ if (serializedObject.className === "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */) {
1069
+ serializedObject.config || (serializedObject.config = {});
1070
+ serializedObject.config.outputValue = true;
1071
+ }
1072
+ });
1073
+ return serializedObjects;
1074
+ },
1075
+ },
1076
+ "pointer/set": {
1077
+ blocks: ["FlowGraphSetPropertyBlock" /* FlowGraphBlockNames.SetProperty */, "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */],
1078
+ configuration: {
1079
+ pointer: { name: "jsonPointer", toBlock: "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */ },
1080
+ },
1081
+ inputs: {
1082
+ values: {
1083
+ // must be defined due to the array taking over
1084
+ value: { name: "value" },
1085
+ "[segment]": { name: "$1", toBlock: "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */ },
1086
+ },
1087
+ },
1088
+ outputs: {
1089
+ flows: {
1090
+ err: { name: "error" },
1091
+ },
1092
+ },
1093
+ interBlockConnectors: [
1094
+ {
1095
+ input: "object",
1096
+ output: "object",
1097
+ inputBlockIndex: 0,
1098
+ outputBlockIndex: 1,
1099
+ isVariable: true,
1100
+ },
1101
+ {
1102
+ input: "propertyName",
1103
+ output: "propertyName",
1104
+ inputBlockIndex: 0,
1105
+ outputBlockIndex: 1,
1106
+ isVariable: true,
1107
+ },
1108
+ {
1109
+ input: "customSetFunction",
1110
+ output: "setFunction",
1111
+ inputBlockIndex: 0,
1112
+ outputBlockIndex: 1,
1113
+ isVariable: true,
1114
+ },
1115
+ ],
1116
+ extraProcessor(gltfBlock, _declaration, _mapping, parser, serializedObjects) {
1117
+ serializedObjects.forEach((serializedObject) => {
1118
+ // check if it is the json pointer block
1119
+ if (serializedObject.className === "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */) {
1120
+ serializedObject.config || (serializedObject.config = {});
1121
+ serializedObject.config.outputValue = true;
1122
+ }
1123
+ });
1124
+ return serializedObjects;
1125
+ },
1126
+ },
1127
+ "pointer/interpolate": {
1128
+ // interpolate, parse the pointer and play the animation generated. 3 blocks!
1129
+ blocks: ["FlowGraphInterpolationBlock" /* FlowGraphBlockNames.ValueInterpolation */, "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */, "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */, "FlowGraphEasingBlock" /* FlowGraphBlockNames.Easing */],
1130
+ configuration: {
1131
+ pointer: { name: "jsonPointer", toBlock: "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */ },
1132
+ },
1133
+ inputs: {
1134
+ values: {
1135
+ value: { name: "value_1" },
1136
+ "[segment]": { name: "$1", toBlock: "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */ },
1137
+ duration: { name: "duration_1", gltfType: "number" /*, inOptions: true */ },
1138
+ p1: { name: "controlPoint1", toBlock: "FlowGraphEasingBlock" /* FlowGraphBlockNames.Easing */ },
1139
+ p2: { name: "controlPoint2", toBlock: "FlowGraphEasingBlock" /* FlowGraphBlockNames.Easing */ },
1140
+ },
1141
+ flows: {
1142
+ in: { name: "in", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
1143
+ },
1144
+ },
1145
+ outputs: {
1146
+ flows: {
1147
+ err: { name: "error", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
1148
+ out: { name: "out", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
1149
+ done: { name: "done", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
1150
+ },
1151
+ },
1152
+ interBlockConnectors: [
1153
+ {
1154
+ input: "object",
1155
+ output: "object",
1156
+ inputBlockIndex: 2,
1157
+ outputBlockIndex: 1,
1158
+ isVariable: true,
1159
+ },
1160
+ {
1161
+ input: "propertyName",
1162
+ output: "propertyName",
1163
+ inputBlockIndex: 0,
1164
+ outputBlockIndex: 1,
1165
+ isVariable: true,
1166
+ },
1167
+ {
1168
+ input: "customBuildAnimation",
1169
+ output: "generateAnimationsFunction",
1170
+ inputBlockIndex: 0,
1171
+ outputBlockIndex: 1,
1172
+ isVariable: true,
1173
+ },
1174
+ {
1175
+ input: "animation",
1176
+ output: "animation",
1177
+ inputBlockIndex: 2,
1178
+ outputBlockIndex: 0,
1179
+ isVariable: true,
1180
+ },
1181
+ {
1182
+ input: "easingFunction",
1183
+ output: "easingFunction",
1184
+ inputBlockIndex: 0,
1185
+ outputBlockIndex: 3,
1186
+ isVariable: true,
1187
+ },
1188
+ {
1189
+ input: "value_0",
1190
+ output: "value",
1191
+ inputBlockIndex: 0,
1192
+ outputBlockIndex: 1,
1193
+ isVariable: true,
1194
+ },
1195
+ ],
1196
+ extraProcessor(gltfBlock, _declaration, _mapping, parser, serializedObjects) {
1197
+ serializedObjects.forEach((serializedObject) => {
1198
+ // check if it is the json pointer block
1199
+ if (serializedObject.className === "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */) {
1200
+ serializedObject.config || (serializedObject.config = {});
1201
+ serializedObject.config.outputValue = true;
1202
+ }
1203
+ else if (serializedObject.className === "FlowGraphInterpolationBlock" /* FlowGraphBlockNames.ValueInterpolation */) {
1204
+ serializedObject.config || (serializedObject.config = {});
1205
+ Object.keys(gltfBlock.values || []).forEach((key) => {
1206
+ const value = gltfBlock.values?.[key];
1207
+ if (key === "value" && value) {
1208
+ // get the type of the value
1209
+ const type = value.type;
1210
+ if (type !== undefined) {
1211
+ serializedObject.config.animationType = parser.arrays.types[type].flowGraphType;
1212
+ }
1213
+ }
1214
+ });
1215
+ }
1216
+ });
1217
+ return serializedObjects;
1218
+ },
1219
+ },
1220
+ "animation/start": {
1221
+ blocks: ["FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */, "FlowGraphArrayIndexBlock" /* FlowGraphBlockNames.ArrayIndex */, "KHR_interactivity/FlowGraphGLTFDataProvider"],
1222
+ inputs: {
1223
+ values: {
1224
+ animation: { name: "index", gltfType: "number", toBlock: "FlowGraphArrayIndexBlock" /* FlowGraphBlockNames.ArrayIndex */ },
1225
+ speed: { name: "speed", gltfType: "number" },
1226
+ // 60 is a const from the glTF loader
1227
+ startTime: { name: "from", gltfType: "number", dataTransformer: (time, parser) => [time[0] * parser._loader.parent.targetFps] },
1228
+ endTime: { name: "to", gltfType: "number", dataTransformer: (time, parser) => [time[0] * parser._loader.parent.targetFps] },
1229
+ },
1230
+ },
1231
+ outputs: {
1232
+ flows: {
1233
+ err: { name: "error" },
1234
+ },
1235
+ },
1236
+ interBlockConnectors: [
1237
+ {
1238
+ input: "animationGroup",
1239
+ output: "value",
1240
+ inputBlockIndex: 0,
1241
+ outputBlockIndex: 1,
1242
+ isVariable: true,
1243
+ },
1244
+ {
1245
+ input: "array",
1246
+ output: "animationGroups",
1247
+ inputBlockIndex: 1,
1248
+ outputBlockIndex: 2,
1249
+ isVariable: true,
1250
+ },
1251
+ ],
1252
+ extraProcessor(_gltfBlock, _declaration, _mapping, _arrays, serializedObjects, _context, globalGLTF) {
1253
+ // add the glTF to the configuration of the last serialized object
1254
+ const serializedObject = serializedObjects[serializedObjects.length - 1];
1255
+ serializedObject.config || (serializedObject.config = {});
1256
+ serializedObject.config.glTF = globalGLTF;
1257
+ return serializedObjects;
1258
+ },
1259
+ },
1260
+ "animation/stop": {
1261
+ blocks: ["FlowGraphStopAnimationBlock" /* FlowGraphBlockNames.StopAnimation */, "FlowGraphArrayIndexBlock" /* FlowGraphBlockNames.ArrayIndex */, "KHR_interactivity/FlowGraphGLTFDataProvider"],
1262
+ inputs: {
1263
+ values: {
1264
+ animation: { name: "index", gltfType: "number", toBlock: "FlowGraphArrayIndexBlock" /* FlowGraphBlockNames.ArrayIndex */ },
1265
+ },
1266
+ },
1267
+ outputs: {
1268
+ flows: {
1269
+ err: { name: "error" },
1270
+ },
1271
+ },
1272
+ interBlockConnectors: [
1273
+ {
1274
+ input: "animationGroup",
1275
+ output: "value",
1276
+ inputBlockIndex: 0,
1277
+ outputBlockIndex: 1,
1278
+ isVariable: true,
1279
+ },
1280
+ {
1281
+ input: "array",
1282
+ output: "animationGroups",
1283
+ inputBlockIndex: 1,
1284
+ outputBlockIndex: 2,
1285
+ isVariable: true,
1286
+ },
1287
+ ],
1288
+ extraProcessor(_gltfBlock, _declaration, _mapping, _arrays, serializedObjects, _context, globalGLTF) {
1289
+ // add the glTF to the configuration of the last serialized object
1290
+ const serializedObject = serializedObjects[serializedObjects.length - 1];
1291
+ serializedObject.config || (serializedObject.config = {});
1292
+ serializedObject.config.glTF = globalGLTF;
1293
+ return serializedObjects;
1294
+ },
1295
+ },
1296
+ "animation/stopAt": {
1297
+ blocks: ["FlowGraphStopAnimationBlock" /* FlowGraphBlockNames.StopAnimation */, "FlowGraphArrayIndexBlock" /* FlowGraphBlockNames.ArrayIndex */, "KHR_interactivity/FlowGraphGLTFDataProvider"],
1298
+ configuration: {},
1299
+ inputs: {
1300
+ values: {
1301
+ animation: { name: "index", gltfType: "number", toBlock: "FlowGraphArrayIndexBlock" /* FlowGraphBlockNames.ArrayIndex */ },
1302
+ stopTime: { name: "stopAtFrame", gltfType: "number", dataTransformer: (time, parser) => [time[0] * parser._loader.parent.targetFps] },
1303
+ },
1304
+ },
1305
+ outputs: {
1306
+ flows: {
1307
+ err: { name: "error" },
1308
+ },
1309
+ },
1310
+ interBlockConnectors: [
1311
+ {
1312
+ input: "animationGroup",
1313
+ output: "value",
1314
+ inputBlockIndex: 0,
1315
+ outputBlockIndex: 1,
1316
+ isVariable: true,
1317
+ },
1318
+ {
1319
+ input: "array",
1320
+ output: "animationGroups",
1321
+ inputBlockIndex: 1,
1322
+ outputBlockIndex: 2,
1323
+ isVariable: true,
1324
+ },
1325
+ ],
1326
+ extraProcessor(_gltfBlock, _declaration, _mapping, _arrays, serializedObjects, _context, globalGLTF) {
1327
+ // add the glTF to the configuration of the last serialized object
1328
+ const serializedObject = serializedObjects[serializedObjects.length - 1];
1329
+ serializedObject.config || (serializedObject.config = {});
1330
+ serializedObject.config.glTF = globalGLTF;
1331
+ return serializedObjects;
1332
+ },
1333
+ },
1334
+ };
1335
+ function getSimpleInputMapping(type, inputs = ["a"], inferType) {
1336
+ return {
1337
+ blocks: [type],
1338
+ inputs: {
1339
+ values: inputs.reduce((acc, input) => {
1340
+ acc[input] = { name: input };
1341
+ return acc;
1342
+ }, {}),
1343
+ },
1344
+ outputs: {
1345
+ values: {
1346
+ value: { name: "value" },
1347
+ },
1348
+ },
1349
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects) {
1350
+ if (inferType) {
1351
+ // configure it to work the way glTF specifies
1352
+ serializedObjects[0].config = serializedObjects[0].config || {};
1353
+ // try to infer the type or fallback to Integer
1354
+ // check the gltf block for the inputs, see if they have a type
1355
+ let type = -1;
1356
+ Object.keys(_gltfBlock.values || {}).find((value) => {
1357
+ if (_gltfBlock.values?.[value].type !== undefined) {
1358
+ type = _gltfBlock.values[value].type;
1359
+ return true;
1360
+ }
1361
+ return false;
1362
+ });
1363
+ if (type !== -1) {
1364
+ serializedObjects[0].config.type = _parser.arrays.types[type].flowGraphType;
1365
+ }
1366
+ }
1367
+ return serializedObjects;
1368
+ },
1369
+ };
1370
+ }
1371
+ export function getAllSupportedNativeNodeTypes() {
1372
+ return Object.keys(gltfToFlowGraphMapping);
1373
+ }
1374
+ /**
1375
+ *
1376
+ * These are the nodes from the specs:
1377
+
1378
+ ### Math Nodes
1379
+ 1. **Constants**
1380
+ - E (`math/e`) FlowGraphBlockNames.E
1381
+ - Pi (`math/pi`) FlowGraphBlockNames.PI
1382
+ - Infinity (`math/inf`) FlowGraphBlockNames.Inf
1383
+ - Not a Number (`math/nan`) FlowGraphBlockNames.NaN
1384
+ 2. **Arithmetic Nodes**
1385
+ - Absolute Value (`math/abs`) FlowGraphBlockNames.Abs
1386
+ - Sign (`math/sign`) FlowGraphBlockNames.Sign
1387
+ - Truncate (`math/trunc`) FlowGraphBlockNames.Trunc
1388
+ - Floor (`math/floor`) FlowGraphBlockNames.Floor
1389
+ - Ceil (`math/ceil`) FlowGraphBlockNames.Ceil
1390
+ - Round (`math/round`) FlowGraphBlockNames.Round
1391
+ - Fraction (`math/fract`) FlowGraphBlockNames.Fract
1392
+ - Negation (`math/neg`) FlowGraphBlockNames.Negation
1393
+ - Addition (`math/add`) FlowGraphBlockNames.Add
1394
+ - Subtraction (`math/sub`) FlowGraphBlockNames.Subtract
1395
+ - Multiplication (`math/mul`) FlowGraphBlockNames.Multiply
1396
+ - Division (`math/div`) FlowGraphBlockNames.Divide
1397
+ - Remainder (`math/rem`) FlowGraphBlockNames.Modulo
1398
+ - Minimum (`math/min`) FlowGraphBlockNames.Min
1399
+ - Maximum (`math/max`) FlowGraphBlockNames.Max
1400
+ - Clamp (`math/clamp`) FlowGraphBlockNames.Clamp
1401
+ - Saturate (`math/saturate`) FlowGraphBlockNames.Saturate
1402
+ - Interpolate (`math/mix`) FlowGraphBlockNames.MathInterpolation
1403
+ 3. **Comparison Nodes**
1404
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
1405
+ - Less Than (`math/lt`) FlowGraphBlockNames.LessThan
1406
+ - Less Than Or Equal To (`math/le`) FlowGraphBlockNames.LessThanOrEqual
1407
+ - Greater Than (`math/gt`) FlowGraphBlockNames.GreaterThan
1408
+ - Greater Than Or Equal To (`math/ge`) FlowGraphBlockNames.GreaterThanOrEqual
1409
+ 4. **Special Nodes**
1410
+ - Is Not a Number (`math/isnan`) FlowGraphBlockNames.IsNaN
1411
+ - Is Infinity (`math/isinf`) FlowGraphBlockNames.IsInfinity
1412
+ - Select (`math/select`) FlowGraphBlockNames.Conditional
1413
+ - Random (`math/random`) FlowGraphBlockNames.Random
1414
+ 5. **Angle and Trigonometry Nodes**
1415
+ - Degrees-To-Radians (`math/rad`) FlowGraphBlockNames.DegToRad
1416
+ - Radians-To-Degrees (`math/deg`) FlowGraphBlockNames.RadToDeg
1417
+ - Sine (`math/sin`) FlowGraphBlockNames.Sin
1418
+ - Cosine (`math/cos`) FlowGraphBlockNames.Cos
1419
+ - Tangent (`math/tan`) FlowGraphBlockNames.Tan
1420
+ - Arcsine (`math/asin`) FlowGraphBlockNames.Asin
1421
+ - Arccosine (`math/acos`) FlowGraphBlockNames.Acos
1422
+ - Arctangent (`math/atan`) FlowGraphBlockNames.Atan
1423
+ - Arctangent 2 (`math/atan2`) FlowGraphBlockNames.Atan2
1424
+ 6. **Hyperbolic Nodes**
1425
+ - Hyperbolic Sine (`math/sinh`) FlowGraphBlockNames.Sinh
1426
+ - Hyperbolic Cosine (`math/cosh`) FlowGraphBlockNames.Cosh
1427
+ - Hyperbolic Tangent (`math/tanh`) FlowGraphBlockNames.Tanh
1428
+ - Inverse Hyperbolic Sine (`math/asinh`) FlowGraphBlockNames.Asinh
1429
+ - Inverse Hyperbolic Cosine (`math/acosh`) FlowGraphBlockNames.Acosh
1430
+ - Inverse Hyperbolic Tangent (`math/atanh`) FlowGraphBlockNames.Atanh
1431
+ 7. **Exponential Nodes**
1432
+ - Exponent (`math/exp`) FlowGraphBlockNames.Exponential
1433
+ - Natural Logarithm (`math/log`) FlowGraphBlockNames.Log
1434
+ - Base-2 Logarithm (`math/log2`) FlowGraphBlockNames.Log2
1435
+ - Base-10 Logarithm (`math/log10`) FlowGraphBlockNames.Log10
1436
+ - Square Root (`math/sqrt`) FlowGraphBlockNames.SquareRoot
1437
+ - Cube Root (`math/cbrt`) FlowGraphBlockNames.CubeRoot
1438
+ - Power (`math/pow`) FlowGraphBlockNames.Power
1439
+ 8. **Vector Nodes**
1440
+ - Length (`math/length`) FlowGraphBlockNames.Length
1441
+ - Normalize (`math/normalize`) FlowGraphBlockNames.Normalize
1442
+ - Dot Product (`math/dot`) FlowGraphBlockNames.Dot
1443
+ - Cross Product (`math/cross`) FlowGraphBlockNames.Cross
1444
+ - Rotate 2D (`math/rotate2d`) FlowGraphBlockNames.Rotate2D
1445
+ - Rotate 3D (`math/rotate3d`) FlowGraphBlockNames.Rotate3D
1446
+ - Transform (`math/transform`) FlowGraphBlockNames.TransformVector
1447
+ 9. **Matrix Nodes**
1448
+ - Transpose (`math/transpose`) FlowGraphBlockNames.Transpose
1449
+ - Determinant (`math/determinant`) FlowGraphBlockNames.Determinant
1450
+ - Inverse (`math/inverse`) FlowGraphBlockNames.InvertMatrix
1451
+ - Multiplication (`math/matmul`) FlowGraphBlockNames.MatrixMultiplication
1452
+ 10. **Swizzle Nodes**
1453
+ - Combine (`math/combine2`, `math/combine3`, `math/combine4`, `math/combine2x2`, `math/combine3x3`, `math/combine4x4`)
1454
+ FlowGraphBlockNames.CombineVector2, FlowGraphBlockNames.CombineVector3, FlowGraphBlockNames.CombineVector4
1455
+ FlowGraphBlockNames.CombineMatrix2D, FlowGraphBlockNames.CombineMatrix3D, FlowGraphBlockNames.CombineMatrix
1456
+ - Extract (`math/extract2`, `math/extract3`, `math/extract4`, `math/extract2x2`, `math/extract3x3`, `math/extract4x4`)
1457
+ FlowGraphBlockNames.ExtractVector2, FlowGraphBlockNames.ExtractVector3, FlowGraphBlockNames.ExtractVector4
1458
+ FlowGraphBlockNames.ExtractMatrix2D, FlowGraphBlockNames.ExtractMatrix3D, FlowGraphBlockNames.ExtractMatrix
1459
+ 11. **Integer Arithmetic Nodes**
1460
+ - Absolute Value (`math/abs`) FlowGraphBlockNames.Abs
1461
+ - Sign (`math/sign`) FlowGraphBlockNames.Sign
1462
+ - Negation (`math/neg`) FlowGraphBlockNames.Negation
1463
+ - Addition (`math/add`) FlowGraphBlockNames.Add
1464
+ - Subtraction (`math/sub`) FlowGraphBlockNames.Subtract
1465
+ - Multiplication (`math/mul`) FlowGraphBlockNames.Multiply
1466
+ - Division (`math/div`) FlowGraphBlockNames.Divide
1467
+ - Remainder (`math/rem`) FlowGraphBlockNames.Modulo
1468
+ - Minimum (`math/min`) FlowGraphBlockNames.Min
1469
+ - Maximum (`math/max`) FlowGraphBlockNames.Max
1470
+ - Clamp (`math/clamp`) FlowGraphBlockNames.Clamp
1471
+ 12. **Integer Comparison Nodes**
1472
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
1473
+ - Less Than (`math/lt`) FlowGraphBlockNames.LessThan
1474
+ - Less Than Or Equal To (`math/le`) FlowGraphBlockNames.LessThanOrEqual
1475
+ - Greater Than (`math/gt`) FlowGraphBlockNames.GreaterThan
1476
+ - Greater Than Or Equal To (`math/ge`) FlowGraphBlockNames.GreaterThanOrEqual
1477
+ 13. **Integer Bitwise Nodes**
1478
+ - Bitwise NOT (`math/not`) FlowGraphBlockNames.BitwiseNot
1479
+ - Bitwise AND (`math/and`) FlowGraphBlockNames.BitwiseAnd
1480
+ - Bitwise OR (`math/or`) FlowGraphBlockNames.BitwiseOr
1481
+ - Bitwise XOR (`math/xor`) FlowGraphBlockNames.BitwiseXor
1482
+ - Right Shift (`math/asr`) FlowGraphBlockNames.BitwiseRightShift
1483
+ - Left Shift (`math/lsl`) FlowGraphBlockNames.BitwiseLeftShift
1484
+ - Count Leading Zeros (`math/clz`) FlowGraphBlockNames.LeadingZeros
1485
+ - Count Trailing Zeros (`math/ctz`) FlowGraphBlockNames.TrailingZeros
1486
+ - Count One Bits (`math/popcnt`) FlowGraphBlockNames.OneBitsCounter
1487
+ 14. **Boolean Arithmetic Nodes**
1488
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
1489
+ - Boolean NOT (`math/not`) FlowGraphBlockNames.BitwiseNot
1490
+ - Boolean AND (`math/and`) FlowGraphBlockNames.BitwiseAnd
1491
+ - Boolean OR (`math/or`) FlowGraphBlockNames.BitwiseOr
1492
+ - Boolean XOR (`math/xor`) FlowGraphBlockNames.BitwiseXor
1493
+
1494
+ ### Type Conversion Nodes
1495
+ 1. **Boolean Conversion Nodes**
1496
+ - Boolean to Integer (`type/boolToInt`) FlowGraphBlockNames.BooleanToInt
1497
+ - Boolean to Float (`type/boolToFloat`) FlowGraphBlockNames.BooleanToFloat
1498
+ 2. **Integer Conversion Nodes**
1499
+ - Integer to Boolean (`type/intToBool`) FlowGraphBlockNames.IntToBoolean
1500
+ - Integer to Float (`type/intToFloat`) FlowGraphBlockNames.IntToFloat
1501
+ 3. **Float Conversion Nodes**
1502
+ - Float to Boolean (`type/floatToBool`) FlowGraphBlockNames.FloatToBoolean
1503
+ - Float to Integer (`type/floatToInt`) FlowGraphBlockNames.FloatToInt
1504
+
1505
+ ### Control Flow Nodes
1506
+ 1. **Sync Nodes**
1507
+ - Sequence (`flow/sequence`) FlowGraphBlockNames.Sequence
1508
+ - Branch (`flow/branch`) FlowGraphBlockNames.Branch
1509
+ - Switch (`flow/switch`) FlowGraphBlockNames.Switch
1510
+ - While Loop (`flow/while`) FlowGraphBlockNames.WhileLoop
1511
+ - For Loop (`flow/for`) FlowGraphBlockNames.ForLoop
1512
+ - Do N (`flow/doN`) FlowGraphBlockNames.DoN
1513
+ - Multi Gate (`flow/multiGate`) FlowGraphBlockNames.MultiGate
1514
+ - Wait All (`flow/waitAll`) FlowGraphBlockNames.WaitAll
1515
+ - Throttle (`flow/throttle`) FlowGraphBlockNames.Throttle
1516
+ 2. **Delay Nodes**
1517
+ - Set Delay (`flow/setDelay`) FlowGraphBlockNames.SetDelay
1518
+ - Cancel Delay (`flow/cancelDelay`) FlowGraphBlockNames.CancelDelay
1519
+
1520
+ ### State Manipulation Nodes
1521
+ 1. **Custom Variable Access**
1522
+ - Variable Get (`variable/get`) FlowGraphBlockNames.GetVariable
1523
+ - Variable Set (`variable/set`) FlowGraphBlockNames.SetVariable
1524
+ - Variable Interpolate (`variable/interpolate`)
1525
+ 2. **Object Model Access** // TODO fully test this!!!
1526
+ - JSON Pointer Template Parsing (`pointer/get`) [FlowGraphBlockNames.GetProperty, FlowGraphBlockNames.JsonPointerParser]
1527
+ - Effective JSON Pointer Generation (`pointer/set`) [FlowGraphBlockNames.SetProperty, FlowGraphBlockNames.JsonPointerParser]
1528
+ - Pointer Get (`pointer/get`) [FlowGraphBlockNames.GetProperty, FlowGraphBlockNames.JsonPointerParser]
1529
+ - Pointer Set (`pointer/set`) [FlowGraphBlockNames.SetProperty, FlowGraphBlockNames.JsonPointerParser]
1530
+ - Pointer Interpolate (`pointer/interpolate`) [FlowGraphBlockNames.ValueInterpolation, FlowGraphBlockNames.JsonPointerParser, FlowGraphBlockNames.PlayAnimation, FlowGraphBlockNames.Easing]
1531
+
1532
+ ### Animation Control Nodes
1533
+ 1. **Animation Play** (`animation/start`) FlowGraphBlockNames.PlayAnimation
1534
+ 2. **Animation Stop** (`animation/stop`) FlowGraphBlockNames.StopAnimation
1535
+ 3. **Animation Stop At** (`animation/stopAt`) FlowGraphBlockNames.StopAnimation
1536
+
1537
+ ### Event Nodes
1538
+ 1. **Lifecycle Event Nodes**
1539
+ - On Start (`event/onStart`) FlowGraphBlockNames.SceneReadyEvent
1540
+ - On Tick (`event/onTick`) FlowGraphBlockNames.SceneTickEvent
1541
+ 2. **Custom Event Nodes**
1542
+ - Receive (`event/receive`) FlowGraphBlockNames.ReceiveCustomEvent
1543
+ - Send (`event/send`) FlowGraphBlockNames.SendCustomEvent
1544
+
1545
+ */
1546
+ //# sourceMappingURL=declarationMapper.js.map