@babylonjs/loaders 7.51.1 → 7.51.2

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 +1507 -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 +442 -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 +22 -11
  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,1507 @@
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/combine2x2": {
401
+ blocks: ["FlowGraphCombineMatrix2DBlock" /* FlowGraphBlockNames.CombineMatrix2D */],
402
+ inputs: {
403
+ values: {
404
+ a: { name: "input_0", gltfType: "number" },
405
+ b: { name: "input_1", gltfType: "number" },
406
+ c: { name: "input_2", gltfType: "number" },
407
+ d: { name: "input_3", gltfType: "number" },
408
+ },
409
+ },
410
+ outputs: {
411
+ values: {
412
+ value: { name: "value" },
413
+ },
414
+ },
415
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects) {
416
+ // configure it to work the way glTF specifies
417
+ serializedObjects[0].config = serializedObjects[0].config || {};
418
+ serializedObjects[0].config.inputIsColumnMajor = true;
419
+ return serializedObjects;
420
+ },
421
+ },
422
+ "math/extract2x2": {
423
+ blocks: ["FlowGraphExtractMatrix2DBlock" /* FlowGraphBlockNames.ExtractMatrix2D */],
424
+ inputs: {
425
+ values: {
426
+ a: { name: "input", gltfType: "float2x2" },
427
+ },
428
+ },
429
+ outputs: {
430
+ values: {
431
+ "0": { name: "output_0" },
432
+ "1": { name: "output_1" },
433
+ "2": { name: "output_2" },
434
+ "3": { name: "output_3" },
435
+ },
436
+ },
437
+ },
438
+ "math/combine3x3": {
439
+ blocks: ["FlowGraphCombineMatrix3DBlock" /* FlowGraphBlockNames.CombineMatrix3D */],
440
+ inputs: {
441
+ values: {
442
+ a: { name: "input_0", gltfType: "number" },
443
+ b: { name: "input_1", gltfType: "number" },
444
+ c: { name: "input_2", gltfType: "number" },
445
+ d: { name: "input_3", gltfType: "number" },
446
+ e: { name: "input_4", gltfType: "number" },
447
+ f: { name: "input_5", gltfType: "number" },
448
+ g: { name: "input_6", gltfType: "number" },
449
+ h: { name: "input_7", gltfType: "number" },
450
+ i: { name: "input_8", gltfType: "number" },
451
+ },
452
+ },
453
+ outputs: {
454
+ values: {
455
+ value: { name: "value" },
456
+ },
457
+ },
458
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects) {
459
+ // configure it to work the way glTF specifies
460
+ serializedObjects[0].config = serializedObjects[0].config || {};
461
+ serializedObjects[0].config.inputIsColumnMajor = true;
462
+ return serializedObjects;
463
+ },
464
+ },
465
+ "math/extract3x3": {
466
+ blocks: ["FlowGraphExtractMatrix3DBlock" /* FlowGraphBlockNames.ExtractMatrix3D */],
467
+ inputs: {
468
+ values: {
469
+ a: { name: "input", gltfType: "float3x3" },
470
+ },
471
+ },
472
+ outputs: {
473
+ values: {
474
+ "0": { name: "output_0" },
475
+ "1": { name: "output_1" },
476
+ "2": { name: "output_2" },
477
+ "3": { name: "output_3" },
478
+ "4": { name: "output_4" },
479
+ "5": { name: "output_5" },
480
+ "6": { name: "output_6" },
481
+ "7": { name: "output_7" },
482
+ "8": { name: "output_8" },
483
+ },
484
+ },
485
+ },
486
+ "math/combine4x4": {
487
+ blocks: ["FlowGraphCombineMatrixBlock" /* FlowGraphBlockNames.CombineMatrix */],
488
+ inputs: {
489
+ values: {
490
+ a: { name: "input_0", gltfType: "number" },
491
+ b: { name: "input_1", gltfType: "number" },
492
+ c: { name: "input_2", gltfType: "number" },
493
+ d: { name: "input_3", gltfType: "number" },
494
+ e: { name: "input_4", gltfType: "number" },
495
+ f: { name: "input_5", gltfType: "number" },
496
+ g: { name: "input_6", gltfType: "number" },
497
+ h: { name: "input_7", gltfType: "number" },
498
+ i: { name: "input_8", gltfType: "number" },
499
+ j: { name: "input_9", gltfType: "number" },
500
+ k: { name: "input_10", gltfType: "number" },
501
+ l: { name: "input_11", gltfType: "number" },
502
+ m: { name: "input_12", gltfType: "number" },
503
+ n: { name: "input_13", gltfType: "number" },
504
+ o: { name: "input_14", gltfType: "number" },
505
+ p: { name: "input_15", gltfType: "number" },
506
+ },
507
+ },
508
+ outputs: {
509
+ values: {
510
+ value: { name: "value" },
511
+ },
512
+ },
513
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects) {
514
+ // configure it to work the way glTF specifies
515
+ serializedObjects[0].config = serializedObjects[0].config || {};
516
+ serializedObjects[0].config.inputIsColumnMajor = true;
517
+ return serializedObjects;
518
+ },
519
+ },
520
+ "math/extract4x4": {
521
+ blocks: ["FlowGraphExtractMatrixBlock" /* FlowGraphBlockNames.ExtractMatrix */],
522
+ configuration: {},
523
+ inputs: {
524
+ values: {
525
+ a: { name: "input", gltfType: "number" },
526
+ },
527
+ },
528
+ outputs: {
529
+ values: {
530
+ "0": { name: "output_0" },
531
+ "1": { name: "output_1" },
532
+ "2": { name: "output_2" },
533
+ "3": { name: "output_3" },
534
+ "4": { name: "output_4" },
535
+ "5": { name: "output_5" },
536
+ "6": { name: "output_6" },
537
+ "7": { name: "output_7" },
538
+ "8": { name: "output_8" },
539
+ "9": { name: "output_9" },
540
+ "10": { name: "output_10" },
541
+ "11": { name: "output_11" },
542
+ "12": { name: "output_12" },
543
+ "13": { name: "output_13" },
544
+ "14": { name: "output_14" },
545
+ "15": { name: "output_15" },
546
+ },
547
+ },
548
+ },
549
+ "math/compose": {
550
+ blocks: ["FlowGraphMatrixCompose" /* FlowGraphBlockNames.MatrixCompose */],
551
+ configuration: {},
552
+ inputs: {
553
+ values: {
554
+ translation: { name: "position", gltfType: "float3" },
555
+ rotation: { name: "rotationQuaternion", gltfType: "float4" },
556
+ scale: { name: "scaling", gltfType: "float3" },
557
+ },
558
+ },
559
+ outputs: {
560
+ values: {
561
+ value: { name: "output" },
562
+ },
563
+ },
564
+ },
565
+ "math/decompose": {
566
+ blocks: ["FlowGraphMatrixDecompose" /* FlowGraphBlockNames.MatrixDecompose */],
567
+ configuration: {},
568
+ inputs: {
569
+ values: {
570
+ a: { name: "input" },
571
+ },
572
+ },
573
+ outputs: {
574
+ values: {
575
+ translation: { name: "position" },
576
+ rotation: { name: "rotationQuaternion" },
577
+ scale: { name: "scaling" },
578
+ },
579
+ },
580
+ },
581
+ "math/not": {
582
+ blocks: ["FlowGraphBitwiseNotBlock" /* FlowGraphBlockNames.BitwiseNot */],
583
+ inputs: {
584
+ values: {
585
+ a: { name: "a" },
586
+ },
587
+ },
588
+ outputs: {
589
+ values: {
590
+ value: { name: "value" },
591
+ },
592
+ },
593
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects, context) {
594
+ // configure it to work the way glTF specifies
595
+ serializedObjects[0].config = serializedObjects[0].config || {};
596
+ // try to infer the type or fallback to Integer
597
+ const socketIn = serializedObjects[0].dataInputs[0];
598
+ serializedObjects[0].config.valueType = context._connectionValues[socketIn.uniqueId]?.type ?? "FlowGraphInteger" /* FlowGraphTypes.Integer */;
599
+ return serializedObjects;
600
+ },
601
+ },
602
+ "math/and": {
603
+ blocks: ["FlowGraphBitwiseAndBlock" /* FlowGraphBlockNames.BitwiseAnd */],
604
+ inputs: {
605
+ values: {
606
+ a: { name: "a" },
607
+ b: { name: "b" },
608
+ },
609
+ },
610
+ outputs: {
611
+ values: {
612
+ value: { name: "value" },
613
+ },
614
+ },
615
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects, context) {
616
+ // configure it to work the way glTF specifies
617
+ serializedObjects[0].config = serializedObjects[0].config || {};
618
+ // try to infer the type or fallback to Integer
619
+ const socketInA = serializedObjects[0].dataInputs[0];
620
+ const socketInB = serializedObjects[0].dataInputs[1];
621
+ serializedObjects[0].config.valueType =
622
+ context._connectionValues[socketInA.uniqueId]?.type ?? context._connectionValues[socketInB.uniqueId]?.type ?? "FlowGraphInteger" /* FlowGraphTypes.Integer */;
623
+ return serializedObjects;
624
+ },
625
+ },
626
+ "math/or": {
627
+ blocks: ["FlowGraphBitwiseOrBlock" /* FlowGraphBlockNames.BitwiseOr */],
628
+ inputs: {
629
+ values: {
630
+ a: { name: "a" },
631
+ b: { name: "b" },
632
+ },
633
+ },
634
+ outputs: {
635
+ values: {
636
+ value: { name: "value" },
637
+ },
638
+ },
639
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects, context) {
640
+ // configure it to work the way glTF specifies
641
+ serializedObjects[0].config = serializedObjects[0].config || {};
642
+ // try to infer the type or fallback to Integer
643
+ const socketInA = serializedObjects[0].dataInputs[0];
644
+ const socketInB = serializedObjects[0].dataInputs[1];
645
+ serializedObjects[0].config.valueType =
646
+ context._connectionValues[socketInA.uniqueId]?.type ?? context._connectionValues[socketInB.uniqueId]?.type ?? "FlowGraphInteger" /* FlowGraphTypes.Integer */;
647
+ return serializedObjects;
648
+ },
649
+ },
650
+ "math/xor": {
651
+ blocks: ["FlowGraphBitwiseXorBlock" /* FlowGraphBlockNames.BitwiseXor */],
652
+ inputs: {
653
+ values: {
654
+ a: { name: "a" },
655
+ b: { name: "b" },
656
+ },
657
+ },
658
+ outputs: {
659
+ values: {
660
+ value: { name: "value" },
661
+ },
662
+ },
663
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects, context) {
664
+ // configure it to work the way glTF specifies
665
+ serializedObjects[0].config = serializedObjects[0].config || {};
666
+ // try to infer the type or fallback to Integer
667
+ const socketInA = serializedObjects[0].dataInputs[0];
668
+ const socketInB = serializedObjects[0].dataInputs[1];
669
+ serializedObjects[0].config.valueType =
670
+ context._connectionValues[socketInA.uniqueId]?.type ?? context._connectionValues[socketInB.uniqueId]?.type ?? "FlowGraphInteger" /* FlowGraphTypes.Integer */;
671
+ return serializedObjects;
672
+ },
673
+ },
674
+ "math/asr": getSimpleInputMapping("FlowGraphBitwiseRightShiftBlock" /* FlowGraphBlockNames.BitwiseRightShift */, ["a", "b"]),
675
+ "math/lsl": getSimpleInputMapping("FlowGraphBitwiseLeftShiftBlock" /* FlowGraphBlockNames.BitwiseLeftShift */, ["a", "b"]),
676
+ "math/clz": getSimpleInputMapping("FlowGraphLeadingZerosBlock" /* FlowGraphBlockNames.LeadingZeros */),
677
+ "math/ctz": getSimpleInputMapping("FlowGraphTrailingZerosBlock" /* FlowGraphBlockNames.TrailingZeros */),
678
+ "math/popcnt": getSimpleInputMapping("FlowGraphOneBitsCounterBlock" /* FlowGraphBlockNames.OneBitsCounter */),
679
+ "math/rad": getSimpleInputMapping("FlowGraphDegToRadBlock" /* FlowGraphBlockNames.DegToRad */),
680
+ "math/deg": getSimpleInputMapping("FlowGraphRadToDegBlock" /* FlowGraphBlockNames.RadToDeg */),
681
+ "type/boolToInt": getSimpleInputMapping("FlowGraphBooleanToInt" /* FlowGraphBlockNames.BooleanToInt */),
682
+ "type/boolToFloat": getSimpleInputMapping("FlowGraphBooleanToFloat" /* FlowGraphBlockNames.BooleanToFloat */),
683
+ "type/intToBool": getSimpleInputMapping("FlowGraphIntToBoolean" /* FlowGraphBlockNames.IntToBoolean */),
684
+ "type/intToFloat": getSimpleInputMapping("FlowGraphIntToFloat" /* FlowGraphBlockNames.IntToFloat */),
685
+ "type/floatToInt": getSimpleInputMapping("FlowGraphFloatToInt" /* FlowGraphBlockNames.FloatToInt */),
686
+ "type/floatToBool": getSimpleInputMapping("FlowGraphFloatToBoolean" /* FlowGraphBlockNames.FloatToBoolean */),
687
+ // flows
688
+ "flow/sequence": {
689
+ blocks: ["FlowGraphSequenceBlock" /* FlowGraphBlockNames.Sequence */],
690
+ extraProcessor(gltfBlock, _declaration, _mapping, _arrays, serializedObjects) {
691
+ const serializedObject = serializedObjects[0];
692
+ serializedObject.config || (serializedObject.config = {});
693
+ serializedObject.config.outputSignalCount = Object.keys(gltfBlock.flows || []).length;
694
+ serializedObject.signalOutputs.forEach((output, index) => {
695
+ output.name = "out_" + index;
696
+ });
697
+ return serializedObjects;
698
+ },
699
+ },
700
+ "flow/branch": {
701
+ blocks: ["FlowGraphBranchBlock" /* FlowGraphBlockNames.Branch */],
702
+ outputs: {
703
+ flows: {
704
+ true: { name: "onTrue" },
705
+ false: { name: "onFalse" },
706
+ },
707
+ },
708
+ },
709
+ "flow/switch": {
710
+ blocks: ["FlowGraphSwitchBlock" /* FlowGraphBlockNames.Switch */],
711
+ configuration: {
712
+ cases: { name: "cases", inOptions: true, defaultValue: [] },
713
+ },
714
+ inputs: {
715
+ values: {
716
+ selection: { name: "case" },
717
+ },
718
+ },
719
+ validation(gltfBlock) {
720
+ if (gltfBlock.configuration && gltfBlock.configuration.cases) {
721
+ const cases = gltfBlock.configuration.cases.value;
722
+ const onlyIntegers = cases.every((caseValue) => {
723
+ // case value should be an integer. Since Number.isInteger(1.0) is true, we need to check if toString has only digits.
724
+ return typeof caseValue === "number" && /^\d+$/.test(caseValue.toString());
725
+ });
726
+ if (!onlyIntegers) {
727
+ gltfBlock.configuration.cases.value = [];
728
+ return true;
729
+ }
730
+ // check for duplicates
731
+ const uniqueCases = new Set(cases);
732
+ gltfBlock.configuration.cases.value = Array.from(uniqueCases);
733
+ }
734
+ return true;
735
+ },
736
+ extraProcessor(gltfBlock, declaration, _mapping, _arrays, serializedObjects) {
737
+ // convert all names of output flow to out_$1 apart from "default"
738
+ if (declaration.op !== "flow/switch" || !gltfBlock.flows || Object.keys(gltfBlock.flows).length === 0) {
739
+ throw new Error("Switch should have a single configuration object, the cases array");
740
+ }
741
+ const serializedObject = serializedObjects[0];
742
+ serializedObject.signalOutputs.forEach((output) => {
743
+ if (output.name !== "default") {
744
+ output.name = "out_" + output.name;
745
+ }
746
+ });
747
+ return serializedObjects;
748
+ },
749
+ },
750
+ "flow/while": {
751
+ blocks: ["FlowGraphWhileLoopBlock" /* FlowGraphBlockNames.WhileLoop */],
752
+ outputs: {
753
+ flows: {
754
+ loopBody: { name: "executionFlow" },
755
+ },
756
+ },
757
+ },
758
+ "flow/for": {
759
+ blocks: ["FlowGraphForLoopBlock" /* FlowGraphBlockNames.ForLoop */],
760
+ configuration: {
761
+ initialIndex: { name: "initialIndex", gltfType: "number", inOptions: true, defaultValue: 0 },
762
+ },
763
+ inputs: {
764
+ values: {
765
+ startIndex: { name: "startIndex", gltfType: "number" },
766
+ endIndex: { name: "endIndex", gltfType: "number" },
767
+ },
768
+ },
769
+ outputs: {
770
+ values: {
771
+ index: { name: "index" },
772
+ },
773
+ flows: {
774
+ loopBody: { name: "executionFlow" },
775
+ },
776
+ },
777
+ },
778
+ "flow/doN": {
779
+ blocks: ["FlowGraphDoNBlock" /* FlowGraphBlockNames.DoN */],
780
+ configuration: {},
781
+ inputs: {
782
+ values: {
783
+ n: { name: "maxExecutions", gltfType: "number" },
784
+ },
785
+ },
786
+ outputs: {
787
+ values: {
788
+ currentCount: { name: "executionCount" },
789
+ },
790
+ },
791
+ },
792
+ "flow/multiGate": {
793
+ blocks: ["FlowGraphMultiGateBlock" /* FlowGraphBlockNames.MultiGate */],
794
+ configuration: {
795
+ isRandom: { name: "isRandom", gltfType: "boolean", inOptions: true, defaultValue: false },
796
+ isLoop: { name: "isLoop", gltfType: "boolean", inOptions: true, defaultValue: false },
797
+ },
798
+ extraProcessor(gltfBlock, declaration, _mapping, _arrays, serializedObjects) {
799
+ if (declaration.op !== "flow/multiGate" || !gltfBlock.flows || Object.keys(gltfBlock.flows).length === 0) {
800
+ throw new Error("MultiGate should have a single configuration object, the number of output flows");
801
+ }
802
+ const serializedObject = serializedObjects[0];
803
+ serializedObject.config || (serializedObject.config = {});
804
+ serializedObject.config.outputSignalCount = Object.keys(gltfBlock.flows).length;
805
+ serializedObject.signalOutputs.forEach((output, index) => {
806
+ output.name = "out_" + index;
807
+ });
808
+ return serializedObjects;
809
+ },
810
+ },
811
+ "flow/waitAll": {
812
+ blocks: ["FlowGraphWaitAllBlock" /* FlowGraphBlockNames.WaitAll */],
813
+ configuration: {
814
+ inputFlows: { name: "inputSignalCount", gltfType: "number", inOptions: true, defaultValue: 0 },
815
+ },
816
+ inputs: {
817
+ flows: {
818
+ "[segment]": { name: "in_$1" },
819
+ },
820
+ },
821
+ validation(gltfBlock) {
822
+ // check that the configuration value is an integer
823
+ if (typeof gltfBlock.configuration?.inputFlows?.value[0] !== "number") {
824
+ gltfBlock.configuration = gltfBlock.configuration || {
825
+ inputFlows: { value: [0] },
826
+ };
827
+ gltfBlock.configuration.inputFlows.value = [0];
828
+ }
829
+ return true;
830
+ },
831
+ },
832
+ "flow/throttle": {
833
+ blocks: ["FlowGraphThrottleBlock" /* FlowGraphBlockNames.Throttle */],
834
+ outputs: {
835
+ flows: {
836
+ err: { name: "error" },
837
+ },
838
+ },
839
+ },
840
+ "flow/setDelay": {
841
+ blocks: ["FlowGraphSetDelayBlock" /* FlowGraphBlockNames.SetDelay */],
842
+ outputs: {
843
+ flows: {
844
+ err: { name: "error" },
845
+ },
846
+ },
847
+ },
848
+ "flow/cancelDelay": {
849
+ blocks: ["FlowGraphCancelDelayBlock" /* FlowGraphBlockNames.CancelDelay */],
850
+ },
851
+ "variable/get": {
852
+ blocks: ["FlowGraphGetVariableBlock" /* FlowGraphBlockNames.GetVariable */],
853
+ validation(gltfBlock) {
854
+ if (!gltfBlock.configuration?.variable?.value) {
855
+ Logger.Error("Variable get block should have a variable configuration");
856
+ return false;
857
+ }
858
+ return true;
859
+ },
860
+ configuration: {
861
+ variable: {
862
+ name: "variable",
863
+ gltfType: "number",
864
+ flowGraphType: "string",
865
+ inOptions: true,
866
+ isVariable: true,
867
+ dataTransformer(index, parser) {
868
+ return [parser.getVariableName(index[0])];
869
+ },
870
+ },
871
+ },
872
+ },
873
+ "variable/set": {
874
+ blocks: ["FlowGraphSetVariableBlock" /* FlowGraphBlockNames.SetVariable */],
875
+ configuration: {
876
+ variable: {
877
+ name: "variable",
878
+ gltfType: "number",
879
+ flowGraphType: "string",
880
+ inOptions: true,
881
+ isVariable: true,
882
+ dataTransformer(index, parser) {
883
+ return [parser.getVariableName(index[0])];
884
+ },
885
+ },
886
+ },
887
+ },
888
+ "variable/interpolate": {
889
+ blocks: [
890
+ "FlowGraphInterpolationBlock" /* FlowGraphBlockNames.ValueInterpolation */,
891
+ "FlowGraphContextBlock" /* FlowGraphBlockNames.Context */,
892
+ "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */,
893
+ "FlowGraphBezierCurveEasing" /* FlowGraphBlockNames.BezierCurveEasing */,
894
+ "FlowGraphGetVariableBlock" /* FlowGraphBlockNames.GetVariable */,
895
+ ],
896
+ configuration: {
897
+ variable: {
898
+ name: "propertyName",
899
+ inOptions: true,
900
+ isVariable: true,
901
+ dataTransformer(index, parser) {
902
+ return [parser.getVariableName(index[0])];
903
+ },
904
+ },
905
+ useSlerp: {
906
+ name: "animationType",
907
+ inOptions: true,
908
+ defaultValue: false,
909
+ dataTransformer: (value) => {
910
+ if (value[0] === true) {
911
+ return ["Quaternion" /* FlowGraphTypes.Quaternion */];
912
+ }
913
+ else {
914
+ return [undefined];
915
+ }
916
+ },
917
+ },
918
+ },
919
+ inputs: {
920
+ values: {
921
+ value: { name: "value_1" },
922
+ duration: { name: "duration_1", gltfType: "number" },
923
+ p1: { name: "controlPoint1", toBlock: "FlowGraphBezierCurveEasing" /* FlowGraphBlockNames.BezierCurveEasing */ },
924
+ p2: { name: "controlPoint2", toBlock: "FlowGraphBezierCurveEasing" /* FlowGraphBlockNames.BezierCurveEasing */ },
925
+ },
926
+ flows: {
927
+ in: { name: "in", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
928
+ },
929
+ },
930
+ outputs: {
931
+ flows: {
932
+ err: { name: "error", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
933
+ out: { name: "out", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
934
+ done: { name: "done", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
935
+ },
936
+ },
937
+ interBlockConnectors: [
938
+ {
939
+ input: "object",
940
+ output: "userVariables",
941
+ inputBlockIndex: 2,
942
+ outputBlockIndex: 1,
943
+ isVariable: true,
944
+ },
945
+ {
946
+ input: "animation",
947
+ output: "animation",
948
+ inputBlockIndex: 2,
949
+ outputBlockIndex: 0,
950
+ isVariable: true,
951
+ },
952
+ {
953
+ input: "easingFunction",
954
+ output: "easingFunction",
955
+ inputBlockIndex: 0,
956
+ outputBlockIndex: 3,
957
+ isVariable: true,
958
+ },
959
+ {
960
+ input: "value_0",
961
+ output: "value",
962
+ inputBlockIndex: 0,
963
+ outputBlockIndex: 4,
964
+ isVariable: true,
965
+ },
966
+ ],
967
+ extraProcessor(gltfBlock, _declaration, _mapping, parser, serializedObjects) {
968
+ var _a, _b;
969
+ // is useSlerp is used, animationType should be set to be quaternion!
970
+ const serializedValueInterpolation = serializedObjects[0];
971
+ const propertyIndex = gltfBlock.configuration?.variable.value[0];
972
+ if (typeof propertyIndex !== "number") {
973
+ Logger.Error("Variable index is not defined for variable interpolation block");
974
+ throw new Error("Variable index is not defined for variable interpolation block");
975
+ }
976
+ const variable = parser.arrays.staticVariables[propertyIndex];
977
+ // if not set by useSlerp
978
+ if (typeof serializedValueInterpolation.config.animationType.value === "undefined") {
979
+ // get the value type
980
+ parser.arrays.staticVariables;
981
+ serializedValueInterpolation.config.animationType.value = getAnimationTypeByFlowGraphType(variable.type);
982
+ }
983
+ // variable/get configuration
984
+ const serializedGetVariable = serializedObjects[4];
985
+ serializedGetVariable.config || (serializedGetVariable.config = {});
986
+ (_a = serializedGetVariable.config).variable || (_a.variable = {});
987
+ serializedGetVariable.config.variable.value = parser.getVariableName(propertyIndex);
988
+ // get the control points from the easing block
989
+ (_b = serializedObjects[3]).config || (_b.config = {});
990
+ return serializedObjects;
991
+ },
992
+ },
993
+ "pointer/get": {
994
+ blocks: ["FlowGraphGetPropertyBlock" /* FlowGraphBlockNames.GetProperty */, "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */],
995
+ configuration: {
996
+ pointer: { name: "jsonPointer", toBlock: "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */ },
997
+ },
998
+ inputs: {
999
+ values: {
1000
+ "[segment]": { name: "$1", toBlock: "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */ },
1001
+ },
1002
+ },
1003
+ interBlockConnectors: [
1004
+ {
1005
+ input: "object",
1006
+ output: "object",
1007
+ inputBlockIndex: 0,
1008
+ outputBlockIndex: 1,
1009
+ isVariable: true,
1010
+ },
1011
+ {
1012
+ input: "propertyName",
1013
+ output: "propertyName",
1014
+ inputBlockIndex: 0,
1015
+ outputBlockIndex: 1,
1016
+ isVariable: true,
1017
+ },
1018
+ {
1019
+ input: "customGetFunction",
1020
+ output: "getFunction",
1021
+ inputBlockIndex: 0,
1022
+ outputBlockIndex: 1,
1023
+ isVariable: true,
1024
+ },
1025
+ ],
1026
+ extraProcessor(gltfBlock, _declaration, _mapping, parser, serializedObjects) {
1027
+ serializedObjects.forEach((serializedObject) => {
1028
+ // check if it is the json pointer block
1029
+ if (serializedObject.className === "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */) {
1030
+ serializedObject.config || (serializedObject.config = {});
1031
+ serializedObject.config.outputValue = true;
1032
+ }
1033
+ });
1034
+ return serializedObjects;
1035
+ },
1036
+ },
1037
+ "pointer/set": {
1038
+ blocks: ["FlowGraphSetPropertyBlock" /* FlowGraphBlockNames.SetProperty */, "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */],
1039
+ configuration: {
1040
+ pointer: { name: "jsonPointer", toBlock: "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */ },
1041
+ },
1042
+ inputs: {
1043
+ values: {
1044
+ // must be defined due to the array taking over
1045
+ value: { name: "value" },
1046
+ "[segment]": { name: "$1", toBlock: "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */ },
1047
+ },
1048
+ },
1049
+ outputs: {
1050
+ flows: {
1051
+ err: { name: "error" },
1052
+ },
1053
+ },
1054
+ interBlockConnectors: [
1055
+ {
1056
+ input: "object",
1057
+ output: "object",
1058
+ inputBlockIndex: 0,
1059
+ outputBlockIndex: 1,
1060
+ isVariable: true,
1061
+ },
1062
+ {
1063
+ input: "propertyName",
1064
+ output: "propertyName",
1065
+ inputBlockIndex: 0,
1066
+ outputBlockIndex: 1,
1067
+ isVariable: true,
1068
+ },
1069
+ {
1070
+ input: "customSetFunction",
1071
+ output: "setFunction",
1072
+ inputBlockIndex: 0,
1073
+ outputBlockIndex: 1,
1074
+ isVariable: true,
1075
+ },
1076
+ ],
1077
+ extraProcessor(gltfBlock, _declaration, _mapping, parser, serializedObjects) {
1078
+ serializedObjects.forEach((serializedObject) => {
1079
+ // check if it is the json pointer block
1080
+ if (serializedObject.className === "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */) {
1081
+ serializedObject.config || (serializedObject.config = {});
1082
+ serializedObject.config.outputValue = true;
1083
+ }
1084
+ });
1085
+ return serializedObjects;
1086
+ },
1087
+ },
1088
+ "pointer/interpolate": {
1089
+ // interpolate, parse the pointer and play the animation generated. 3 blocks!
1090
+ blocks: ["FlowGraphInterpolationBlock" /* FlowGraphBlockNames.ValueInterpolation */, "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */, "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */, "FlowGraphEasingBlock" /* FlowGraphBlockNames.Easing */],
1091
+ configuration: {
1092
+ pointer: { name: "jsonPointer", toBlock: "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */ },
1093
+ },
1094
+ inputs: {
1095
+ values: {
1096
+ value: { name: "value_1" },
1097
+ "[segment]": { name: "$1", toBlock: "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */ },
1098
+ duration: { name: "duration_1", gltfType: "number" /*, inOptions: true */ },
1099
+ p1: { name: "controlPoint1", toBlock: "FlowGraphEasingBlock" /* FlowGraphBlockNames.Easing */ },
1100
+ p2: { name: "controlPoint2", toBlock: "FlowGraphEasingBlock" /* FlowGraphBlockNames.Easing */ },
1101
+ },
1102
+ flows: {
1103
+ in: { name: "in", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
1104
+ },
1105
+ },
1106
+ outputs: {
1107
+ flows: {
1108
+ err: { name: "error", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
1109
+ out: { name: "out", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
1110
+ done: { name: "done", toBlock: "FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */ },
1111
+ },
1112
+ },
1113
+ interBlockConnectors: [
1114
+ {
1115
+ input: "object",
1116
+ output: "object",
1117
+ inputBlockIndex: 2,
1118
+ outputBlockIndex: 1,
1119
+ isVariable: true,
1120
+ },
1121
+ {
1122
+ input: "propertyName",
1123
+ output: "propertyName",
1124
+ inputBlockIndex: 0,
1125
+ outputBlockIndex: 1,
1126
+ isVariable: true,
1127
+ },
1128
+ {
1129
+ input: "customBuildAnimation",
1130
+ output: "generateAnimationsFunction",
1131
+ inputBlockIndex: 0,
1132
+ outputBlockIndex: 1,
1133
+ isVariable: true,
1134
+ },
1135
+ {
1136
+ input: "animation",
1137
+ output: "animation",
1138
+ inputBlockIndex: 2,
1139
+ outputBlockIndex: 0,
1140
+ isVariable: true,
1141
+ },
1142
+ {
1143
+ input: "easingFunction",
1144
+ output: "easingFunction",
1145
+ inputBlockIndex: 0,
1146
+ outputBlockIndex: 3,
1147
+ isVariable: true,
1148
+ },
1149
+ {
1150
+ input: "value_0",
1151
+ output: "value",
1152
+ inputBlockIndex: 0,
1153
+ outputBlockIndex: 1,
1154
+ isVariable: true,
1155
+ },
1156
+ ],
1157
+ extraProcessor(gltfBlock, _declaration, _mapping, parser, serializedObjects) {
1158
+ serializedObjects.forEach((serializedObject) => {
1159
+ // check if it is the json pointer block
1160
+ if (serializedObject.className === "FlowGraphJsonPointerParserBlock" /* FlowGraphBlockNames.JsonPointerParser */) {
1161
+ serializedObject.config || (serializedObject.config = {});
1162
+ serializedObject.config.outputValue = true;
1163
+ }
1164
+ else if (serializedObject.className === "FlowGraphInterpolationBlock" /* FlowGraphBlockNames.ValueInterpolation */) {
1165
+ serializedObject.config || (serializedObject.config = {});
1166
+ Object.keys(gltfBlock.values || []).forEach((key) => {
1167
+ const value = gltfBlock.values?.[key];
1168
+ if (key === "value" && value) {
1169
+ // get the type of the value
1170
+ const type = value.type;
1171
+ if (type !== undefined) {
1172
+ serializedObject.config.animationType = parser.arrays.types[type].flowGraphType;
1173
+ }
1174
+ }
1175
+ });
1176
+ }
1177
+ });
1178
+ return serializedObjects;
1179
+ },
1180
+ },
1181
+ "animation/start": {
1182
+ blocks: ["FlowGraphPlayAnimationBlock" /* FlowGraphBlockNames.PlayAnimation */, "FlowGraphArrayIndexBlock" /* FlowGraphBlockNames.ArrayIndex */, "KHR_interactivity/FlowGraphGLTFDataProvider"],
1183
+ inputs: {
1184
+ values: {
1185
+ animation: { name: "index", gltfType: "number", toBlock: "FlowGraphArrayIndexBlock" /* FlowGraphBlockNames.ArrayIndex */ },
1186
+ speed: { name: "speed", gltfType: "number" },
1187
+ // 60 is a const from the glTF loader
1188
+ startTime: { name: "from", gltfType: "number", dataTransformer: (time, parser) => [time[0] * parser._loader.parent.targetFps] },
1189
+ endTime: { name: "to", gltfType: "number", dataTransformer: (time, parser) => [time[0] * parser._loader.parent.targetFps] },
1190
+ },
1191
+ },
1192
+ outputs: {
1193
+ flows: {
1194
+ err: { name: "error" },
1195
+ },
1196
+ },
1197
+ interBlockConnectors: [
1198
+ {
1199
+ input: "animationGroup",
1200
+ output: "value",
1201
+ inputBlockIndex: 0,
1202
+ outputBlockIndex: 1,
1203
+ isVariable: true,
1204
+ },
1205
+ {
1206
+ input: "array",
1207
+ output: "animationGroups",
1208
+ inputBlockIndex: 1,
1209
+ outputBlockIndex: 2,
1210
+ isVariable: true,
1211
+ },
1212
+ ],
1213
+ extraProcessor(_gltfBlock, _declaration, _mapping, _arrays, serializedObjects, _context, globalGLTF) {
1214
+ // add the glTF to the configuration of the last serialized object
1215
+ const serializedObject = serializedObjects[serializedObjects.length - 1];
1216
+ serializedObject.config || (serializedObject.config = {});
1217
+ serializedObject.config.glTF = globalGLTF;
1218
+ return serializedObjects;
1219
+ },
1220
+ },
1221
+ "animation/stop": {
1222
+ blocks: ["FlowGraphStopAnimationBlock" /* FlowGraphBlockNames.StopAnimation */, "FlowGraphArrayIndexBlock" /* FlowGraphBlockNames.ArrayIndex */, "KHR_interactivity/FlowGraphGLTFDataProvider"],
1223
+ inputs: {
1224
+ values: {
1225
+ animation: { name: "index", gltfType: "number", toBlock: "FlowGraphArrayIndexBlock" /* FlowGraphBlockNames.ArrayIndex */ },
1226
+ },
1227
+ },
1228
+ outputs: {
1229
+ flows: {
1230
+ err: { name: "error" },
1231
+ },
1232
+ },
1233
+ interBlockConnectors: [
1234
+ {
1235
+ input: "animationGroup",
1236
+ output: "value",
1237
+ inputBlockIndex: 0,
1238
+ outputBlockIndex: 1,
1239
+ isVariable: true,
1240
+ },
1241
+ {
1242
+ input: "array",
1243
+ output: "animationGroups",
1244
+ inputBlockIndex: 1,
1245
+ outputBlockIndex: 2,
1246
+ isVariable: true,
1247
+ },
1248
+ ],
1249
+ extraProcessor(_gltfBlock, _declaration, _mapping, _arrays, serializedObjects, _context, globalGLTF) {
1250
+ // add the glTF to the configuration of the last serialized object
1251
+ const serializedObject = serializedObjects[serializedObjects.length - 1];
1252
+ serializedObject.config || (serializedObject.config = {});
1253
+ serializedObject.config.glTF = globalGLTF;
1254
+ return serializedObjects;
1255
+ },
1256
+ },
1257
+ "animation/stopAt": {
1258
+ blocks: ["FlowGraphStopAnimationBlock" /* FlowGraphBlockNames.StopAnimation */, "FlowGraphArrayIndexBlock" /* FlowGraphBlockNames.ArrayIndex */, "KHR_interactivity/FlowGraphGLTFDataProvider"],
1259
+ configuration: {},
1260
+ inputs: {
1261
+ values: {
1262
+ animation: { name: "index", gltfType: "number", toBlock: "FlowGraphArrayIndexBlock" /* FlowGraphBlockNames.ArrayIndex */ },
1263
+ stopTime: { name: "stopAtFrame", gltfType: "number", dataTransformer: (time, parser) => [time[0] * parser._loader.parent.targetFps] },
1264
+ },
1265
+ },
1266
+ outputs: {
1267
+ flows: {
1268
+ err: { name: "error" },
1269
+ },
1270
+ },
1271
+ interBlockConnectors: [
1272
+ {
1273
+ input: "animationGroup",
1274
+ output: "value",
1275
+ inputBlockIndex: 0,
1276
+ outputBlockIndex: 1,
1277
+ isVariable: true,
1278
+ },
1279
+ {
1280
+ input: "array",
1281
+ output: "animationGroups",
1282
+ inputBlockIndex: 1,
1283
+ outputBlockIndex: 2,
1284
+ isVariable: true,
1285
+ },
1286
+ ],
1287
+ extraProcessor(_gltfBlock, _declaration, _mapping, _arrays, serializedObjects, _context, globalGLTF) {
1288
+ // add the glTF to the configuration of the last serialized object
1289
+ const serializedObject = serializedObjects[serializedObjects.length - 1];
1290
+ serializedObject.config || (serializedObject.config = {});
1291
+ serializedObject.config.glTF = globalGLTF;
1292
+ return serializedObjects;
1293
+ },
1294
+ },
1295
+ };
1296
+ function getSimpleInputMapping(type, inputs = ["a"], inferType) {
1297
+ return {
1298
+ blocks: [type],
1299
+ inputs: {
1300
+ values: inputs.reduce((acc, input) => {
1301
+ acc[input] = { name: input };
1302
+ return acc;
1303
+ }, {}),
1304
+ },
1305
+ outputs: {
1306
+ values: {
1307
+ value: { name: "value" },
1308
+ },
1309
+ },
1310
+ extraProcessor(_gltfBlock, _declaration, _mapping, _parser, serializedObjects) {
1311
+ if (inferType) {
1312
+ // configure it to work the way glTF specifies
1313
+ serializedObjects[0].config = serializedObjects[0].config || {};
1314
+ // try to infer the type or fallback to Integer
1315
+ // check the gltf block for the inputs, see if they have a type
1316
+ let type = -1;
1317
+ Object.keys(_gltfBlock.values || {}).find((value) => {
1318
+ if (_gltfBlock.values?.[value].type !== undefined) {
1319
+ type = _gltfBlock.values[value].type;
1320
+ return true;
1321
+ }
1322
+ return false;
1323
+ });
1324
+ if (type !== -1) {
1325
+ serializedObjects[0].config.type = _parser.arrays.types[type].flowGraphType;
1326
+ }
1327
+ }
1328
+ return serializedObjects;
1329
+ },
1330
+ };
1331
+ }
1332
+ export function getAllSupportedNativeNodeTypes() {
1333
+ return Object.keys(gltfToFlowGraphMapping);
1334
+ }
1335
+ /**
1336
+ *
1337
+ * These are the nodes from the specs:
1338
+
1339
+ ### Math Nodes
1340
+ 1. **Constants**
1341
+ - E (`math/e`) FlowGraphBlockNames.E
1342
+ - Pi (`math/pi`) FlowGraphBlockNames.PI
1343
+ - Infinity (`math/inf`) FlowGraphBlockNames.Inf
1344
+ - Not a Number (`math/nan`) FlowGraphBlockNames.NaN
1345
+ 2. **Arithmetic Nodes**
1346
+ - Absolute Value (`math/abs`) FlowGraphBlockNames.Abs
1347
+ - Sign (`math/sign`) FlowGraphBlockNames.Sign
1348
+ - Truncate (`math/trunc`) FlowGraphBlockNames.Trunc
1349
+ - Floor (`math/floor`) FlowGraphBlockNames.Floor
1350
+ - Ceil (`math/ceil`) FlowGraphBlockNames.Ceil
1351
+ - Round (`math/round`) FlowGraphBlockNames.Round
1352
+ - Fraction (`math/fract`) FlowGraphBlockNames.Fract
1353
+ - Negation (`math/neg`) FlowGraphBlockNames.Negation
1354
+ - Addition (`math/add`) FlowGraphBlockNames.Add
1355
+ - Subtraction (`math/sub`) FlowGraphBlockNames.Subtract
1356
+ - Multiplication (`math/mul`) FlowGraphBlockNames.Multiply
1357
+ - Division (`math/div`) FlowGraphBlockNames.Divide
1358
+ - Remainder (`math/rem`) FlowGraphBlockNames.Modulo
1359
+ - Minimum (`math/min`) FlowGraphBlockNames.Min
1360
+ - Maximum (`math/max`) FlowGraphBlockNames.Max
1361
+ - Clamp (`math/clamp`) FlowGraphBlockNames.Clamp
1362
+ - Saturate (`math/saturate`) FlowGraphBlockNames.Saturate
1363
+ - Interpolate (`math/mix`) FlowGraphBlockNames.MathInterpolation
1364
+ 3. **Comparison Nodes**
1365
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
1366
+ - Less Than (`math/lt`) FlowGraphBlockNames.LessThan
1367
+ - Less Than Or Equal To (`math/le`) FlowGraphBlockNames.LessThanOrEqual
1368
+ - Greater Than (`math/gt`) FlowGraphBlockNames.GreaterThan
1369
+ - Greater Than Or Equal To (`math/ge`) FlowGraphBlockNames.GreaterThanOrEqual
1370
+ 4. **Special Nodes**
1371
+ - Is Not a Number (`math/isnan`) FlowGraphBlockNames.IsNaN
1372
+ - Is Infinity (`math/isinf`) FlowGraphBlockNames.IsInfinity
1373
+ - Select (`math/select`) FlowGraphBlockNames.Conditional
1374
+ - Random (`math/random`) FlowGraphBlockNames.Random
1375
+ 5. **Angle and Trigonometry Nodes**
1376
+ - Degrees-To-Radians (`math/rad`) FlowGraphBlockNames.DegToRad
1377
+ - Radians-To-Degrees (`math/deg`) FlowGraphBlockNames.RadToDeg
1378
+ - Sine (`math/sin`) FlowGraphBlockNames.Sin
1379
+ - Cosine (`math/cos`) FlowGraphBlockNames.Cos
1380
+ - Tangent (`math/tan`) FlowGraphBlockNames.Tan
1381
+ - Arcsine (`math/asin`) FlowGraphBlockNames.Asin
1382
+ - Arccosine (`math/acos`) FlowGraphBlockNames.Acos
1383
+ - Arctangent (`math/atan`) FlowGraphBlockNames.Atan
1384
+ - Arctangent 2 (`math/atan2`) FlowGraphBlockNames.Atan2
1385
+ 6. **Hyperbolic Nodes**
1386
+ - Hyperbolic Sine (`math/sinh`) FlowGraphBlockNames.Sinh
1387
+ - Hyperbolic Cosine (`math/cosh`) FlowGraphBlockNames.Cosh
1388
+ - Hyperbolic Tangent (`math/tanh`) FlowGraphBlockNames.Tanh
1389
+ - Inverse Hyperbolic Sine (`math/asinh`) FlowGraphBlockNames.Asinh
1390
+ - Inverse Hyperbolic Cosine (`math/acosh`) FlowGraphBlockNames.Acosh
1391
+ - Inverse Hyperbolic Tangent (`math/atanh`) FlowGraphBlockNames.Atanh
1392
+ 7. **Exponential Nodes**
1393
+ - Exponent (`math/exp`) FlowGraphBlockNames.Exponential
1394
+ - Natural Logarithm (`math/log`) FlowGraphBlockNames.Log
1395
+ - Base-2 Logarithm (`math/log2`) FlowGraphBlockNames.Log2
1396
+ - Base-10 Logarithm (`math/log10`) FlowGraphBlockNames.Log10
1397
+ - Square Root (`math/sqrt`) FlowGraphBlockNames.SquareRoot
1398
+ - Cube Root (`math/cbrt`) FlowGraphBlockNames.CubeRoot
1399
+ - Power (`math/pow`) FlowGraphBlockNames.Power
1400
+ 8. **Vector Nodes**
1401
+ - Length (`math/length`) FlowGraphBlockNames.Length
1402
+ - Normalize (`math/normalize`) FlowGraphBlockNames.Normalize
1403
+ - Dot Product (`math/dot`) FlowGraphBlockNames.Dot
1404
+ - Cross Product (`math/cross`) FlowGraphBlockNames.Cross
1405
+ - Rotate 2D (`math/rotate2d`) FlowGraphBlockNames.Rotate2D
1406
+ - Rotate 3D (`math/rotate3d`) FlowGraphBlockNames.Rotate3D
1407
+ - Transform (`math/transform`) FlowGraphBlockNames.TransformVector
1408
+ 9. **Matrix Nodes**
1409
+ - Transpose (`math/transpose`) FlowGraphBlockNames.Transpose
1410
+ - Determinant (`math/determinant`) FlowGraphBlockNames.Determinant
1411
+ - Inverse (`math/inverse`) FlowGraphBlockNames.InvertMatrix
1412
+ - Multiplication (`math/matmul`) FlowGraphBlockNames.MatrixMultiplication
1413
+ 10. **Swizzle Nodes**
1414
+ - Combine (`math/combine2`, `math/combine3`, `math/combine4`, `math/combine2x2`, `math/combine3x3`, `math/combine4x4`)
1415
+ FlowGraphBlockNames.CombineVector2, FlowGraphBlockNames.CombineVector3, FlowGraphBlockNames.CombineVector4
1416
+ FlowGraphBlockNames.CombineMatrix2D, FlowGraphBlockNames.CombineMatrix3D, FlowGraphBlockNames.CombineMatrix
1417
+ - Extract (`math/extract2`, `math/extract3`, `math/extract4`, `math/extract2x2`, `math/extract3x3`, `math/extract4x4`)
1418
+ FlowGraphBlockNames.ExtractVector2, FlowGraphBlockNames.ExtractVector3, FlowGraphBlockNames.ExtractVector4
1419
+ FlowGraphBlockNames.ExtractMatrix2D, FlowGraphBlockNames.ExtractMatrix3D, FlowGraphBlockNames.ExtractMatrix
1420
+ 11. **Integer Arithmetic Nodes**
1421
+ - Absolute Value (`math/abs`) FlowGraphBlockNames.Abs
1422
+ - Sign (`math/sign`) FlowGraphBlockNames.Sign
1423
+ - Negation (`math/neg`) FlowGraphBlockNames.Negation
1424
+ - Addition (`math/add`) FlowGraphBlockNames.Add
1425
+ - Subtraction (`math/sub`) FlowGraphBlockNames.Subtract
1426
+ - Multiplication (`math/mul`) FlowGraphBlockNames.Multiply
1427
+ - Division (`math/div`) FlowGraphBlockNames.Divide
1428
+ - Remainder (`math/rem`) FlowGraphBlockNames.Modulo
1429
+ - Minimum (`math/min`) FlowGraphBlockNames.Min
1430
+ - Maximum (`math/max`) FlowGraphBlockNames.Max
1431
+ - Clamp (`math/clamp`) FlowGraphBlockNames.Clamp
1432
+ 12. **Integer Comparison Nodes**
1433
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
1434
+ - Less Than (`math/lt`) FlowGraphBlockNames.LessThan
1435
+ - Less Than Or Equal To (`math/le`) FlowGraphBlockNames.LessThanOrEqual
1436
+ - Greater Than (`math/gt`) FlowGraphBlockNames.GreaterThan
1437
+ - Greater Than Or Equal To (`math/ge`) FlowGraphBlockNames.GreaterThanOrEqual
1438
+ 13. **Integer Bitwise Nodes**
1439
+ - Bitwise NOT (`math/not`) FlowGraphBlockNames.BitwiseNot
1440
+ - Bitwise AND (`math/and`) FlowGraphBlockNames.BitwiseAnd
1441
+ - Bitwise OR (`math/or`) FlowGraphBlockNames.BitwiseOr
1442
+ - Bitwise XOR (`math/xor`) FlowGraphBlockNames.BitwiseXor
1443
+ - Right Shift (`math/asr`) FlowGraphBlockNames.BitwiseRightShift
1444
+ - Left Shift (`math/lsl`) FlowGraphBlockNames.BitwiseLeftShift
1445
+ - Count Leading Zeros (`math/clz`) FlowGraphBlockNames.LeadingZeros
1446
+ - Count Trailing Zeros (`math/ctz`) FlowGraphBlockNames.TrailingZeros
1447
+ - Count One Bits (`math/popcnt`) FlowGraphBlockNames.OneBitsCounter
1448
+ 14. **Boolean Arithmetic Nodes**
1449
+ - Equality (`math/eq`) FlowGraphBlockNames.Equality
1450
+ - Boolean NOT (`math/not`) FlowGraphBlockNames.BitwiseNot
1451
+ - Boolean AND (`math/and`) FlowGraphBlockNames.BitwiseAnd
1452
+ - Boolean OR (`math/or`) FlowGraphBlockNames.BitwiseOr
1453
+ - Boolean XOR (`math/xor`) FlowGraphBlockNames.BitwiseXor
1454
+
1455
+ ### Type Conversion Nodes
1456
+ 1. **Boolean Conversion Nodes**
1457
+ - Boolean to Integer (`type/boolToInt`) FlowGraphBlockNames.BooleanToInt
1458
+ - Boolean to Float (`type/boolToFloat`) FlowGraphBlockNames.BooleanToFloat
1459
+ 2. **Integer Conversion Nodes**
1460
+ - Integer to Boolean (`type/intToBool`) FlowGraphBlockNames.IntToBoolean
1461
+ - Integer to Float (`type/intToFloat`) FlowGraphBlockNames.IntToFloat
1462
+ 3. **Float Conversion Nodes**
1463
+ - Float to Boolean (`type/floatToBool`) FlowGraphBlockNames.FloatToBoolean
1464
+ - Float to Integer (`type/floatToInt`) FlowGraphBlockNames.FloatToInt
1465
+
1466
+ ### Control Flow Nodes
1467
+ 1. **Sync Nodes**
1468
+ - Sequence (`flow/sequence`) FlowGraphBlockNames.Sequence
1469
+ - Branch (`flow/branch`) FlowGraphBlockNames.Branch
1470
+ - Switch (`flow/switch`) FlowGraphBlockNames.Switch
1471
+ - While Loop (`flow/while`) FlowGraphBlockNames.WhileLoop
1472
+ - For Loop (`flow/for`) FlowGraphBlockNames.ForLoop
1473
+ - Do N (`flow/doN`) FlowGraphBlockNames.DoN
1474
+ - Multi Gate (`flow/multiGate`) FlowGraphBlockNames.MultiGate
1475
+ - Wait All (`flow/waitAll`) FlowGraphBlockNames.WaitAll
1476
+ - Throttle (`flow/throttle`) FlowGraphBlockNames.Throttle
1477
+ 2. **Delay Nodes**
1478
+ - Set Delay (`flow/setDelay`) FlowGraphBlockNames.SetDelay
1479
+ - Cancel Delay (`flow/cancelDelay`) FlowGraphBlockNames.CancelDelay
1480
+
1481
+ ### State Manipulation Nodes
1482
+ 1. **Custom Variable Access**
1483
+ - Variable Get (`variable/get`) FlowGraphBlockNames.GetVariable
1484
+ - Variable Set (`variable/set`) FlowGraphBlockNames.SetVariable
1485
+ - Variable Interpolate (`variable/interpolate`)
1486
+ 2. **Object Model Access** // TODO fully test this!!!
1487
+ - JSON Pointer Template Parsing (`pointer/get`) [FlowGraphBlockNames.GetProperty, FlowGraphBlockNames.JsonPointerParser]
1488
+ - Effective JSON Pointer Generation (`pointer/set`) [FlowGraphBlockNames.SetProperty, FlowGraphBlockNames.JsonPointerParser]
1489
+ - Pointer Get (`pointer/get`) [FlowGraphBlockNames.GetProperty, FlowGraphBlockNames.JsonPointerParser]
1490
+ - Pointer Set (`pointer/set`) [FlowGraphBlockNames.SetProperty, FlowGraphBlockNames.JsonPointerParser]
1491
+ - Pointer Interpolate (`pointer/interpolate`) [FlowGraphBlockNames.ValueInterpolation, FlowGraphBlockNames.JsonPointerParser, FlowGraphBlockNames.PlayAnimation, FlowGraphBlockNames.Easing]
1492
+
1493
+ ### Animation Control Nodes
1494
+ 1. **Animation Play** (`animation/start`) FlowGraphBlockNames.PlayAnimation
1495
+ 2. **Animation Stop** (`animation/stop`) FlowGraphBlockNames.StopAnimation
1496
+ 3. **Animation Stop At** (`animation/stopAt`) FlowGraphBlockNames.StopAnimation
1497
+
1498
+ ### Event Nodes
1499
+ 1. **Lifecycle Event Nodes**
1500
+ - On Start (`event/onStart`) FlowGraphBlockNames.SceneReadyEvent
1501
+ - On Tick (`event/onTick`) FlowGraphBlockNames.SceneTickEvent
1502
+ 2. **Custom Event Nodes**
1503
+ - Receive (`event/receive`) FlowGraphBlockNames.ReceiveCustomEvent
1504
+ - Send (`event/send`) FlowGraphBlockNames.SendCustomEvent
1505
+
1506
+ */
1507
+ //# sourceMappingURL=declarationMapper.js.map