@onerjs/core 8.44.7 → 8.44.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/Bones/skeleton.d.ts +5 -0
  2. package/Bones/skeleton.js +35 -8
  3. package/Bones/skeleton.js.map +1 -1
  4. package/Collisions/collider.js +2 -2
  5. package/Collisions/collider.js.map +1 -1
  6. package/Culling/Helper/computeShaderBoundingHelper.js +8 -1
  7. package/Culling/Helper/computeShaderBoundingHelper.js.map +1 -1
  8. package/Culling/Helper/transformFeedbackBoundingHelper.js +1 -1
  9. package/Culling/Helper/transformFeedbackBoundingHelper.js.map +1 -1
  10. package/Engines/WebGPU/webgpuShaderProcessingContext.d.ts +1 -0
  11. package/Engines/WebGPU/webgpuShaderProcessingContext.js.map +1 -1
  12. package/Engines/WebGPU/webgpuShaderProcessor.d.ts +1 -1
  13. package/Engines/WebGPU/webgpuShaderProcessor.js +2 -2
  14. package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
  15. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +20 -2
  16. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  17. package/Engines/abstractEngine.js +2 -2
  18. package/Engines/abstractEngine.js.map +1 -1
  19. package/Engines/engine.d.ts +2 -1
  20. package/Engines/engineCapabilities.d.ts +2 -0
  21. package/Engines/engineCapabilities.js.map +1 -1
  22. package/Engines/nullEngine.js +1 -0
  23. package/Engines/nullEngine.js.map +1 -1
  24. package/Engines/thinEngine.js +1 -0
  25. package/Engines/thinEngine.js.map +1 -1
  26. package/Engines/thinNativeEngine.js +1 -0
  27. package/Engines/thinNativeEngine.js.map +1 -1
  28. package/Engines/webgpuEngine.js +1 -0
  29. package/Engines/webgpuEngine.js.map +1 -1
  30. package/FlowGraph/Blocks/Data/flowGraphDebugBlock.d.ts +45 -0
  31. package/FlowGraph/Blocks/Data/flowGraphDebugBlock.js +98 -0
  32. package/FlowGraph/Blocks/Data/flowGraphDebugBlock.js.map +1 -0
  33. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +16 -0
  34. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +15 -2
  35. package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
  36. package/FlowGraph/Blocks/Event/flowGraphPointerDownEventBlock.d.ts +64 -0
  37. package/FlowGraph/Blocks/Event/flowGraphPointerDownEventBlock.js +54 -0
  38. package/FlowGraph/Blocks/Event/flowGraphPointerDownEventBlock.js.map +1 -0
  39. package/FlowGraph/Blocks/Event/flowGraphPointerMoveEventBlock.d.ts +64 -0
  40. package/FlowGraph/Blocks/Event/flowGraphPointerMoveEventBlock.js +54 -0
  41. package/FlowGraph/Blocks/Event/flowGraphPointerMoveEventBlock.js.map +1 -0
  42. package/FlowGraph/Blocks/Event/flowGraphPointerUpEventBlock.d.ts +64 -0
  43. package/FlowGraph/Blocks/Event/flowGraphPointerUpEventBlock.js +54 -0
  44. package/FlowGraph/Blocks/Event/flowGraphPointerUpEventBlock.js.map +1 -0
  45. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +1 -0
  46. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +17 -1
  47. package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
  48. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.d.ts +1 -0
  49. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js +23 -3
  50. package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.js.map +1 -1
  51. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.js +2 -2
  52. package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.js.map +1 -1
  53. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +7 -1
  54. package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
  55. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.d.ts +4 -0
  56. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js +6 -2
  57. package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -1
  58. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +2 -2
  59. package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
  60. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +0 -4
  61. package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
  62. package/FlowGraph/Blocks/flowGraphBlockFactory.js +16 -0
  63. package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
  64. package/FlowGraph/Blocks/flowGraphBlockNames.d.ts +2 -1
  65. package/FlowGraph/Blocks/flowGraphBlockNames.js +1 -0
  66. package/FlowGraph/Blocks/flowGraphBlockNames.js.map +1 -1
  67. package/FlowGraph/flowGraph.d.ts +63 -2
  68. package/FlowGraph/flowGraph.js +210 -19
  69. package/FlowGraph/flowGraph.js.map +1 -1
  70. package/FlowGraph/flowGraphContext.d.ts +73 -0
  71. package/FlowGraph/flowGraphContext.js +115 -0
  72. package/FlowGraph/flowGraphContext.js.map +1 -1
  73. package/FlowGraph/flowGraphExecutionBlock.d.ts +7 -0
  74. package/FlowGraph/flowGraphExecutionBlock.js +7 -0
  75. package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
  76. package/FlowGraph/flowGraphParser.js +1 -0
  77. package/FlowGraph/flowGraphParser.js.map +1 -1
  78. package/FlowGraph/flowGraphSceneEventCoordinator.d.ts +3 -0
  79. package/FlowGraph/flowGraphSceneEventCoordinator.js +13 -1
  80. package/FlowGraph/flowGraphSceneEventCoordinator.js.map +1 -1
  81. package/FlowGraph/flowGraphSignalConnection.d.ts +5 -0
  82. package/FlowGraph/flowGraphSignalConnection.js +12 -0
  83. package/FlowGraph/flowGraphSignalConnection.js.map +1 -1
  84. package/FlowGraph/flowGraphValidator.d.ts +66 -0
  85. package/FlowGraph/flowGraphValidator.js +324 -0
  86. package/FlowGraph/flowGraphValidator.js.map +1 -0
  87. package/FlowGraph/index.d.ts +1 -0
  88. package/FlowGraph/index.js +1 -0
  89. package/FlowGraph/index.js.map +1 -1
  90. package/FlowGraph/serialization.js +10 -3
  91. package/FlowGraph/serialization.js.map +1 -1
  92. package/Layers/thinEffectLayer.js +1 -1
  93. package/Layers/thinEffectLayer.js.map +1 -1
  94. package/Layers/thinSelectionOutlineLayer.js +1 -1
  95. package/Layers/thinSelectionOutlineLayer.js.map +1 -1
  96. package/Lights/Shadows/shadowGenerator.js +1 -1
  97. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  98. package/Materials/Node/Blocks/Vertex/bonesBlock.js +2 -2
  99. package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
  100. package/Materials/PBR/openpbrMaterial.js +1 -1
  101. package/Materials/PBR/openpbrMaterial.js.map +1 -1
  102. package/Materials/PBR/pbrBaseMaterial.js +1 -1
  103. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  104. package/Materials/materialHelper.functions.js +2 -2
  105. package/Materials/materialHelper.functions.js.map +1 -1
  106. package/Materials/materialHelper.geometryrendering.js +1 -1
  107. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  108. package/Materials/standardMaterial.js +1 -1
  109. package/Materials/standardMaterial.js.map +1 -1
  110. package/Meshes/mesh.js +2 -2
  111. package/Meshes/mesh.js.map +1 -1
  112. package/Misc/bitArray.js +1 -1
  113. package/Misc/bitArray.js.map +1 -1
  114. package/Misc/tools.js +3 -3
  115. package/Misc/tools.js.map +1 -1
  116. package/Particles/thinParticleSystem.js +2 -2
  117. package/Particles/thinParticleSystem.js.map +1 -1
  118. package/PostProcesses/volumetricLightScatteringPostProcess.js +1 -1
  119. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  120. package/Rendering/depthRenderer.js +1 -1
  121. package/Rendering/depthRenderer.js.map +1 -1
  122. package/Rendering/geometryBufferRenderer.js +3 -3
  123. package/Rendering/geometryBufferRenderer.js.map +1 -1
  124. package/Rendering/outlineRenderer.js +1 -1
  125. package/Rendering/outlineRenderer.js.map +1 -1
  126. package/Shaders/ShadersInclude/bonesDeclaration.js +5 -7
  127. package/Shaders/ShadersInclude/bonesDeclaration.js.map +1 -1
  128. package/ShadersWGSL/ShadersInclude/bonesDeclaration.js +3 -3
  129. package/ShadersWGSL/ShadersInclude/bonesDeclaration.js.map +1 -1
  130. package/ShadersWGSL/boundingInfo.compute.js +4 -3
  131. package/ShadersWGSL/boundingInfo.compute.js.map +1 -1
  132. package/package.json +1 -1
@@ -0,0 +1,45 @@
1
+ import type { FlowGraphContext } from "../../flowGraphContext.js";
2
+ import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
3
+ import { FlowGraphBlock } from "../../flowGraphBlock.js";
4
+ import type { FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
5
+ /**
6
+ * A passthrough block used to debug data values flowing through connections.
7
+ * Spliced into a data connection to observe the value passing through it.
8
+ */
9
+ export declare class FlowGraphDebugBlock extends FlowGraphBlock {
10
+ /**
11
+ * Input connection: The value to observe.
12
+ */
13
+ readonly input: FlowGraphDataConnection<any>;
14
+ /**
15
+ * Output connection: The same value, passed through unchanged.
16
+ */
17
+ readonly output: FlowGraphDataConnection<any>;
18
+ /**
19
+ * Log of values that have passed through this block.
20
+ * Each entry is a [displayString, tooltipString] tuple.
21
+ */
22
+ log: string[][];
23
+ /**
24
+ * Whether this block is a debug block.
25
+ * Used by the editor to identify debug blocks.
26
+ */
27
+ readonly _isDebug: boolean;
28
+ constructor(config?: IFlowGraphBlockConfiguration);
29
+ /**
30
+ * @internal
31
+ */
32
+ _updateOutputs(context: FlowGraphContext): void;
33
+ /**
34
+ * Format and store a value in the log.
35
+ * @param value
36
+ */
37
+ private _logValue;
38
+ /**
39
+ * Type-aware value formatting.
40
+ * @param value the value to format
41
+ * @returns a human-readable string
42
+ */
43
+ private static _FormatValue;
44
+ getClassName(): string;
45
+ }
@@ -0,0 +1,98 @@
1
+ import { FlowGraphBlock } from "../../flowGraphBlock.js";
2
+ import { RichTypeAny } from "../../flowGraphRichTypes.js";
3
+ import { RegisterClass } from "../../../Misc/typeStore.js";
4
+ /**
5
+ * Maximum number of log entries stored by the debug block.
6
+ */
7
+ // eslint-disable-next-line @typescript-eslint/naming-convention
8
+ const MAX_LOG_ENTRIES = 100;
9
+ /**
10
+ * A passthrough block used to debug data values flowing through connections.
11
+ * Spliced into a data connection to observe the value passing through it.
12
+ */
13
+ export class FlowGraphDebugBlock extends FlowGraphBlock {
14
+ constructor(config) {
15
+ super(config);
16
+ /**
17
+ * Log of values that have passed through this block.
18
+ * Each entry is a [displayString, tooltipString] tuple.
19
+ */
20
+ this.log = [];
21
+ /**
22
+ * Whether this block is a debug block.
23
+ * Used by the editor to identify debug blocks.
24
+ */
25
+ this._isDebug = true;
26
+ this.input = this.registerDataInput("input", RichTypeAny);
27
+ this.output = this.registerDataOutput("output", RichTypeAny);
28
+ }
29
+ /**
30
+ * @internal
31
+ */
32
+ _updateOutputs(context) {
33
+ const value = this.input.getValue(context);
34
+ this.output.setValue(value, context);
35
+ this._logValue(value);
36
+ }
37
+ /**
38
+ * Format and store a value in the log.
39
+ * @param value
40
+ */
41
+ _logValue(value) {
42
+ if (value === null || value === undefined) {
43
+ this.log.push(["null", "null"]);
44
+ }
45
+ else {
46
+ const formatted = FlowGraphDebugBlock._FormatValue(value);
47
+ this.log.push([formatted, String(value)]);
48
+ }
49
+ if (this.log.length > MAX_LOG_ENTRIES) {
50
+ this.log.shift();
51
+ }
52
+ }
53
+ /**
54
+ * Type-aware value formatting.
55
+ * @param value the value to format
56
+ * @returns a human-readable string
57
+ */
58
+ static _FormatValue(value) {
59
+ if (typeof value === "number") {
60
+ return Number.isInteger(value) ? value.toString() : value.toFixed(4);
61
+ }
62
+ if (typeof value === "boolean" || typeof value === "string") {
63
+ return String(value);
64
+ }
65
+ // Vector-like objects with x, y, z, w
66
+ if (value && typeof value === "object") {
67
+ if ("w" in value && "x" in value && "y" in value && "z" in value) {
68
+ return `(${value.x.toFixed(3)}, ${value.y.toFixed(3)}, ${value.z.toFixed(3)}, ${value.w.toFixed(3)})`;
69
+ }
70
+ if ("z" in value && "x" in value && "y" in value) {
71
+ return `(${value.x.toFixed(3)}, ${value.y.toFixed(3)}, ${value.z.toFixed(3)})`;
72
+ }
73
+ if ("x" in value && "y" in value) {
74
+ return `(${value.x.toFixed(3)}, ${value.y.toFixed(3)})`;
75
+ }
76
+ // Color3/Color4 with r, g, b
77
+ if ("r" in value && "g" in value && "b" in value) {
78
+ const a = "a" in value ? `, ${value.a.toFixed(3)}` : "";
79
+ return `(${value.r.toFixed(3)}, ${value.g.toFixed(3)}, ${value.b.toFixed(3)}${a})`;
80
+ }
81
+ if (typeof value.toString === "function" && value.toString !== Object.prototype.toString) {
82
+ return value.toString();
83
+ }
84
+ }
85
+ try {
86
+ const str = JSON.stringify(value);
87
+ return str.length > 64 ? str.substring(0, 61) + "..." : str;
88
+ }
89
+ catch {
90
+ return String(value);
91
+ }
92
+ }
93
+ getClassName() {
94
+ return "FlowGraphDebugBlock" /* FlowGraphBlockNames.DebugBlock */;
95
+ }
96
+ }
97
+ RegisterClass("FlowGraphDebugBlock" /* FlowGraphBlockNames.DebugBlock */, FlowGraphDebugBlock);
98
+ //# sourceMappingURL=flowGraphDebugBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphDebugBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphDebugBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAIxD;;GAEG;AACH,gEAAgE;A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\"../../flowGraphBlock\";\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\nimport { RichTypeAny } from \"../../flowGraphRichTypes\";\nimport { RegisterClass } from \"../../../Misc/typeStore\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\nimport type { Nullable } from \"../../../types\";\n\n/**\n * Maximum number of log entries stored by the debug block.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst MAX_LOG_ENTRIES = 100;\n\n/**\n * A passthrough block used to debug data values flowing through connections.\n * Spliced into a data connection to observe the value passing through it.\n */\nexport class FlowGraphDebugBlock extends FlowGraphBlock {\n /**\n * Input connection: The value to observe.\n */\n public readonly input: FlowGraphDataConnection<any>;\n\n /**\n * Output connection: The same value, passed through unchanged.\n */\n public readonly output: FlowGraphDataConnection<any>;\n\n /**\n * Log of values that have passed through this block.\n * Each entry is a [displayString, tooltipString] tuple.\n */\n public log: string[][] = [];\n\n /**\n * Whether this block is a debug block.\n * Used by the editor to identify debug blocks.\n */\n public readonly _isDebug: boolean = true;\n\n constructor(config?: IFlowGraphBlockConfiguration) {\n super(config);\n this.input = this.registerDataInput(\"input\", RichTypeAny);\n this.output = this.registerDataOutput(\"output\", RichTypeAny);\n }\n\n /**\n * @internal\n */\n public override _updateOutputs(context: FlowGraphContext): void {\n const value = this.input.getValue(context);\n this.output.setValue(value, context);\n this._logValue(value);\n }\n\n /**\n * Format and store a value in the log.\n * @param value\n */\n private _logValue(value: Nullable<any>): void {\n if (value === null || value === undefined) {\n this.log.push([\"null\", \"null\"]);\n } else {\n const formatted = FlowGraphDebugBlock._FormatValue(value);\n this.log.push([formatted, String(value)]);\n }\n if (this.log.length > MAX_LOG_ENTRIES) {\n this.log.shift();\n }\n }\n\n /**\n * Type-aware value formatting.\n * @param value the value to format\n * @returns a human-readable string\n */\n private static _FormatValue(value: any): string {\n if (typeof value === \"number\") {\n return Number.isInteger(value) ? value.toString() : value.toFixed(4);\n }\n if (typeof value === \"boolean\" || typeof value === \"string\") {\n return String(value);\n }\n // Vector-like objects with x, y, z, w\n if (value && typeof value === \"object\") {\n if (\"w\" in value && \"x\" in value && \"y\" in value && \"z\" in value) {\n return `(${value.x.toFixed(3)}, ${value.y.toFixed(3)}, ${value.z.toFixed(3)}, ${value.w.toFixed(3)})`;\n }\n if (\"z\" in value && \"x\" in value && \"y\" in value) {\n return `(${value.x.toFixed(3)}, ${value.y.toFixed(3)}, ${value.z.toFixed(3)})`;\n }\n if (\"x\" in value && \"y\" in value) {\n return `(${value.x.toFixed(3)}, ${value.y.toFixed(3)})`;\n }\n // Color3/Color4 with r, g, b\n if (\"r\" in value && \"g\" in value && \"b\" in value) {\n const a = \"a\" in value ? `, ${value.a.toFixed(3)}` : \"\";\n return `(${value.r.toFixed(3)}, ${value.g.toFixed(3)}, ${value.b.toFixed(3)}${a})`;\n }\n if (typeof value.toString === \"function\" && value.toString !== Object.prototype.toString) {\n return value.toString();\n }\n }\n try {\n const str = JSON.stringify(value);\n return str.length > 64 ? str.substring(0, 61) + \"...\" : str;\n } catch {\n return String(value);\n }\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.DebugBlock;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.DebugBlock, FlowGraphDebugBlock);\n"]}
@@ -3,6 +3,9 @@ import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
3
3
  import type { FlowGraphContext } from "../../flowGraphContext.js";
4
4
  import type { FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
5
5
  import { FlowGraphCachedOperationBlock } from "./flowGraphCachedOperationBlock.js";
6
+ /**
7
+ * Configuration for the FlowGraphGetPropertyBlock.
8
+ */
6
9
  export interface IFlowGraphGetPropertyBlockConfiguration<O extends FlowGraphAssetType> extends IFlowGraphBlockConfiguration {
7
10
  /**
8
11
  * The name of the property that will be set
@@ -43,12 +46,25 @@ export declare class FlowGraphGetPropertyBlock<P extends any, O extends FlowGrap
43
46
  * This will be used if defined, instead of the default get function.
44
47
  */
45
48
  readonly customGetFunction: FlowGraphDataConnection<(target: AssetType<O>, propertyName: string, context: FlowGraphContext) => P | undefined>;
49
+ /**
50
+ * Constructs a new FlowGraphGetPropertyBlock.
51
+ * @param config - the configuration of the block
52
+ */
46
53
  constructor(
47
54
  /**
48
55
  * the configuration of the block
49
56
  */
50
57
  config: IFlowGraphGetPropertyBlockConfiguration<O>);
58
+ /**
59
+ * Retrieves the property value from the target object.
60
+ * @param context - the flow graph context
61
+ * @returns the property value, or undefined if the target or property name is not set
62
+ */
51
63
  _doOperation(context: FlowGraphContext): P | undefined;
52
64
  private _getPropertyValue;
65
+ /**
66
+ * Returns the class name of this block.
67
+ * @returns the class name
68
+ */
53
69
  getClassName(): string;
54
70
  }
@@ -1,4 +1,4 @@
1
- import { RichTypeAny } from "../../flowGraphRichTypes.js";
1
+ import { RichTypeAny, RichTypeString } from "../../flowGraphRichTypes.js";
2
2
  import { RegisterClass } from "../../../Misc/typeStore.js";
3
3
  import { FlowGraphCachedOperationBlock } from "./flowGraphCachedOperationBlock.js";
4
4
  /**
@@ -10,6 +10,10 @@ import { FlowGraphCachedOperationBlock } from "./flowGraphCachedOperationBlock.j
10
10
  * Note that it is recommended to input the object on which you are working on (i.e. a material) rather than providing a mesh as object and then getting the material from it.
11
11
  */
12
12
  export class FlowGraphGetPropertyBlock extends FlowGraphCachedOperationBlock {
13
+ /**
14
+ * Constructs a new FlowGraphGetPropertyBlock.
15
+ * @param config - the configuration of the block
16
+ */
13
17
  constructor(
14
18
  /**
15
19
  * the configuration of the block
@@ -18,9 +22,14 @@ export class FlowGraphGetPropertyBlock extends FlowGraphCachedOperationBlock {
18
22
  super(RichTypeAny, config);
19
23
  this.config = config;
20
24
  this.object = this.registerDataInput("object", RichTypeAny, config.object);
21
- this.propertyName = this.registerDataInput("propertyName", RichTypeAny, config.propertyName);
25
+ this.propertyName = this.registerDataInput("propertyName", RichTypeString, config.propertyName);
22
26
  this.customGetFunction = this.registerDataInput("customGetFunction", RichTypeAny);
23
27
  }
28
+ /**
29
+ * Retrieves the property value from the target object.
30
+ * @param context - the flow graph context
31
+ * @returns the property value, or undefined if the target or property name is not set
32
+ */
24
33
  _doOperation(context) {
25
34
  const getter = this.customGetFunction.getValue(context);
26
35
  let value;
@@ -45,6 +54,10 @@ export class FlowGraphGetPropertyBlock extends FlowGraphCachedOperationBlock {
45
54
  }
46
55
  return value;
47
56
  }
57
+ /**
58
+ * Returns the class name of this block.
59
+ * @returns the class name
60
+ */
48
61
  getClassName() {
49
62
  return "FlowGraphGetPropertyBlock" /* FlowGraphBlockNames.GetProperty */;
50
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"flowGraphGetPropertyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,oCAA0C;AAChE,OAAO,EAAE,aAAa,EAAE,mCAA4B;AAEpD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAmBhF;;;;;;;GAOG;AACH,MAAM,OAAO,yBAAuE,SAAQ,6BAAgC;IAiBxH;IACI;;OAEG;IACa,MAAkD;QAElE,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAFX,WAAM,GAAN,MAAM,CAA4C;QAGlE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAC3E,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,WAAW,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QAC7F,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;IACtF,CAAC;IAEe,YAAY,CAAC,OAAyB;QAClD,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,KAAK,CAAC;QACV,IAAI,MAAM,EAAE,CAAC;YACT,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;QAChG,CAAC;aAAM,CAAC;YACJ,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACzD,KAAK,GAAG,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9F,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAEO,iBAAiB,CAAC,MAAoB,EAAE,YAAoB;QAChE,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,KAAK,GAAQ,MAAM,CAAC;QACxB,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;YACtB,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;YACpB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACtB,OAAO;YACX,CAAC;QACL,CAAC;QACD,OAAO,KAAU,CAAC;IACtB,CAAC;IAEe,YAAY;QACxB,yEAAuC;IAC3C,CAAC;CACJ;AAED,aAAa,oEAAkC,yBAAyB,CAAC,CAAC","sourcesContent":["import type { AssetType, FlowGraphAssetType } from \"core/FlowGraph/flowGraphAssetsContext\";\nimport type { IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { RichTypeAny } from \"core/FlowGraph/flowGraphRichTypes\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\nimport { FlowGraphCachedOperationBlock } from \"./flowGraphCachedOperationBlock\";\n\nexport interface IFlowGraphGetPropertyBlockConfiguration<O extends FlowGraphAssetType> extends IFlowGraphBlockConfiguration {\n /**\n * The name of the property that will be set\n */\n propertyName?: string;\n\n /**\n * The target asset from which the property will be retrieved\n */\n object?: AssetType<O>;\n\n /**\n * If true, the block will reset the output to the default value when the target asset is undefined.\n */\n resetToDefaultWhenUndefined?: boolean;\n}\n\n/**\n * This block will deliver a property of an asset, based on the property name and an input asset.\n * The property name can include dots (\".\"), which will be interpreted as a path to the property.\n *\n * For example, with an input of a mesh asset, the property name \"position.x\" will deliver the x component of the position of the mesh.\n *\n * Note that it is recommended to input the object on which you are working on (i.e. a material) rather than providing a mesh as object and then getting the material from it.\n */\nexport class FlowGraphGetPropertyBlock<P extends any, O extends FlowGraphAssetType> extends FlowGraphCachedOperationBlock<P> {\n /**\n * Input connection: The asset from which the property will be retrieved\n */\n public readonly object: FlowGraphDataConnection<AssetType<O>>;\n\n /**\n * Input connection: The name of the property that will be set\n */\n public readonly propertyName: FlowGraphDataConnection<string>;\n\n /**\n * Input connection: A function that can be used to get the value of the property.\n * This will be used if defined, instead of the default get function.\n */\n public readonly customGetFunction: FlowGraphDataConnection<(target: AssetType<O>, propertyName: string, context: FlowGraphContext) => P | undefined>;\n\n constructor(\n /**\n * the configuration of the block\n */\n public override config: IFlowGraphGetPropertyBlockConfiguration<O>\n ) {\n super(RichTypeAny, config);\n this.object = this.registerDataInput(\"object\", RichTypeAny, config.object);\n this.propertyName = this.registerDataInput(\"propertyName\", RichTypeAny, config.propertyName);\n this.customGetFunction = this.registerDataInput(\"customGetFunction\", RichTypeAny);\n }\n\n public override _doOperation(context: FlowGraphContext): P | undefined {\n const getter = this.customGetFunction.getValue(context);\n let value;\n if (getter) {\n value = getter(this.object.getValue(context), this.propertyName.getValue(context), context);\n } else {\n const target = this.object.getValue(context);\n const propertyName = this.propertyName.getValue(context);\n value = target && propertyName ? this._getPropertyValue(target, propertyName) : undefined;\n }\n return value;\n }\n\n private _getPropertyValue(target: AssetType<O>, propertyName: string): P | undefined {\n const path = propertyName.split(\".\");\n let value: any = target;\n for (const prop of path) {\n value = value[prop];\n if (value === undefined) {\n return;\n }\n }\n return value as P;\n }\n\n public override getClassName(): string {\n return FlowGraphBlockNames.GetProperty;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.GetProperty, FlowGraphGetPropertyBlock);\n"]}
1
+ {"version":3,"file":"flowGraphGetPropertyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,oCAA0C;AAChF,OAAO,EAAE,aAAa,EAAE,mCAA4B;AAEpD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAsBhF;;;;;;;GAOG;AACH,MAAM,OAAO,yBAAuE,SAAQ,6BAAgC;IAiBxH;;;OAGG;IACH;IACI;;OAEG;IACa,MAAkD;QAElE,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAFX,WAAM,GAAN,MAAM,CAA4C;QAGlE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QAC3E,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,cAAc,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QAChG,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;IACtF,CAAC;IAED;;;;OAIG;IACa,YAAY,CAAC,OAAyB;QAClD,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,KAAK,CAAC;QACV,IAAI,MAAM,EAAE,CAAC;YACT,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;QAChG,CAAC;aAAM,CAAC;YACJ,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACzD,KAAK,GAAG,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9F,CAAC;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAEO,iBAAiB,CAAC,MAAoB,EAAE,YAAoB;QAChE,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,KAAK,GAAQ,MAAM,CAAC;QACxB,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;YACtB,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;YACpB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACtB,OAAO;YACX,CAAC;QACL,CAAC;QACD,OAAO,KAAU,CAAC;IACtB,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,yEAAuC;IAC3C,CAAC;CACJ;AAED,aAAa,oEAAkC,yBAAyB,CAAC,CAAC","sourcesContent":["import type { AssetType, FlowGraphAssetType } from \"core/FlowGraph/flowGraphAssetsContext\";\nimport type { IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { RichTypeAny, RichTypeString } from \"core/FlowGraph/flowGraphRichTypes\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\nimport { FlowGraphCachedOperationBlock } from \"./flowGraphCachedOperationBlock\";\n\n/**\n * Configuration for the FlowGraphGetPropertyBlock.\n */\nexport interface IFlowGraphGetPropertyBlockConfiguration<O extends FlowGraphAssetType> extends IFlowGraphBlockConfiguration {\n /**\n * The name of the property that will be set\n */\n propertyName?: string;\n\n /**\n * The target asset from which the property will be retrieved\n */\n object?: AssetType<O>;\n\n /**\n * If true, the block will reset the output to the default value when the target asset is undefined.\n */\n resetToDefaultWhenUndefined?: boolean;\n}\n\n/**\n * This block will deliver a property of an asset, based on the property name and an input asset.\n * The property name can include dots (\".\"), which will be interpreted as a path to the property.\n *\n * For example, with an input of a mesh asset, the property name \"position.x\" will deliver the x component of the position of the mesh.\n *\n * Note that it is recommended to input the object on which you are working on (i.e. a material) rather than providing a mesh as object and then getting the material from it.\n */\nexport class FlowGraphGetPropertyBlock<P extends any, O extends FlowGraphAssetType> extends FlowGraphCachedOperationBlock<P> {\n /**\n * Input connection: The asset from which the property will be retrieved\n */\n public readonly object: FlowGraphDataConnection<AssetType<O>>;\n\n /**\n * Input connection: The name of the property that will be set\n */\n public readonly propertyName: FlowGraphDataConnection<string>;\n\n /**\n * Input connection: A function that can be used to get the value of the property.\n * This will be used if defined, instead of the default get function.\n */\n public readonly customGetFunction: FlowGraphDataConnection<(target: AssetType<O>, propertyName: string, context: FlowGraphContext) => P | undefined>;\n\n /**\n * Constructs a new FlowGraphGetPropertyBlock.\n * @param config - the configuration of the block\n */\n constructor(\n /**\n * the configuration of the block\n */\n public override config: IFlowGraphGetPropertyBlockConfiguration<O>\n ) {\n super(RichTypeAny, config);\n this.object = this.registerDataInput(\"object\", RichTypeAny, config.object);\n this.propertyName = this.registerDataInput(\"propertyName\", RichTypeString, config.propertyName);\n this.customGetFunction = this.registerDataInput(\"customGetFunction\", RichTypeAny);\n }\n\n /**\n * Retrieves the property value from the target object.\n * @param context - the flow graph context\n * @returns the property value, or undefined if the target or property name is not set\n */\n public override _doOperation(context: FlowGraphContext): P | undefined {\n const getter = this.customGetFunction.getValue(context);\n let value;\n if (getter) {\n value = getter(this.object.getValue(context), this.propertyName.getValue(context), context);\n } else {\n const target = this.object.getValue(context);\n const propertyName = this.propertyName.getValue(context);\n value = target && propertyName ? this._getPropertyValue(target, propertyName) : undefined;\n }\n return value;\n }\n\n private _getPropertyValue(target: AssetType<O>, propertyName: string): P | undefined {\n const path = propertyName.split(\".\");\n let value: any = target;\n for (const prop of path) {\n value = value[prop];\n if (value === undefined) {\n return;\n }\n }\n return value as P;\n }\n\n /**\n * Returns the class name of this block.\n * @returns the class name\n */\n public override getClassName(): string {\n return FlowGraphBlockNames.GetProperty;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.GetProperty, FlowGraphGetPropertyBlock);\n"]}
@@ -0,0 +1,64 @@
1
+ import type { AbstractMesh } from "../../../Meshes/abstractMesh.js";
2
+ import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
3
+ import type { PointerInfo } from "../../../Events/pointerEvents.js";
4
+ import type { FlowGraphContext } from "../../flowGraphContext.js";
5
+ import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
6
+ import type { FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
7
+ import type { Vector3 } from "../../../Maths/math.vector.js";
8
+ import { FlowGraphEventType } from "../../flowGraphEventType.js";
9
+ import type { Nullable } from "../../../types.js";
10
+ /**
11
+ * Configuration for the pointer down event block.
12
+ */
13
+ export interface IFlowGraphPointerDownEventBlockConfiguration extends IFlowGraphBlockConfiguration {
14
+ /**
15
+ * Should this block stop propagation of the event to other listeners.
16
+ */
17
+ stopPropagation?: boolean;
18
+ /**
19
+ * Optional mesh to filter events to. If set, the block only fires when the pointer
20
+ * is pressed on this mesh or a descendant of it. If not set, fires on any pointer down.
21
+ */
22
+ targetMesh?: AbstractMesh;
23
+ }
24
+ /**
25
+ * A pointer down event block.
26
+ * This block fires when a pointer is pressed (mouse button down / touch start).
27
+ * Optionally filters to a specific mesh via the `targetMesh` input.
28
+ */
29
+ export declare class FlowGraphPointerDownEventBlock extends FlowGraphEventBlock {
30
+ /**
31
+ * Optional input connection: restrict firing to this mesh (and its descendants).
32
+ * Leave disconnected to fire on any pointer down.
33
+ */
34
+ readonly targetMesh: FlowGraphDataConnection<AbstractMesh>;
35
+ /**
36
+ * Output connection: The id of the pointer that triggered the event.
37
+ */
38
+ readonly pointerId: FlowGraphDataConnection<number>;
39
+ /**
40
+ * Output connection: The mesh that was picked (if any).
41
+ */
42
+ readonly pickedMesh: FlowGraphDataConnection<Nullable<AbstractMesh>>;
43
+ /**
44
+ * Output connection: The world-space point that was picked (if any).
45
+ */
46
+ readonly pickedPoint: FlowGraphDataConnection<Nullable<Vector3>>;
47
+ /** @internal */
48
+ readonly type: FlowGraphEventType;
49
+ /**
50
+ * Creates a new FlowGraphPointerDownEventBlock.
51
+ * @param config optional configuration
52
+ */
53
+ constructor(config?: IFlowGraphPointerDownEventBlockConfiguration);
54
+ /** @internal */
55
+ _executeEvent(context: FlowGraphContext, pointerInfo: PointerInfo): boolean;
56
+ /** @internal */
57
+ _preparePendingTasks(_context: FlowGraphContext): void;
58
+ /** @internal */
59
+ _cancelPendingTasks(_context: FlowGraphContext): void;
60
+ /**
61
+ * @returns the class name of the block.
62
+ */
63
+ getClassName(): string;
64
+ }
@@ -0,0 +1,54 @@
1
+ import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
2
+ import { RegisterClass } from "../../../Misc/typeStore.js";
3
+ import { _IsDescendantOf } from "../../utils.js";
4
+ import { RichTypeAny, RichTypeNumber } from "../../flowGraphRichTypes.js";
5
+ /**
6
+ * A pointer down event block.
7
+ * This block fires when a pointer is pressed (mouse button down / touch start).
8
+ * Optionally filters to a specific mesh via the `targetMesh` input.
9
+ */
10
+ export class FlowGraphPointerDownEventBlock extends FlowGraphEventBlock {
11
+ /**
12
+ * Creates a new FlowGraphPointerDownEventBlock.
13
+ * @param config optional configuration
14
+ */
15
+ constructor(config) {
16
+ super(config);
17
+ /** @internal */
18
+ this.type = "PointerDown" /* FlowGraphEventType.PointerDown */;
19
+ this.targetMesh = this.registerDataInput("targetMesh", RichTypeAny, config?.targetMesh);
20
+ this.pointerId = this.registerDataOutput("pointerId", RichTypeNumber);
21
+ this.pickedMesh = this.registerDataOutput("pickedMesh", RichTypeAny);
22
+ this.pickedPoint = this.registerDataOutput("pickedPoint", RichTypeAny);
23
+ }
24
+ /** @internal */
25
+ _executeEvent(context, pointerInfo) {
26
+ const mesh = this.targetMesh.getValue(context);
27
+ const pickedMesh = pointerInfo.pickInfo?.pickedMesh;
28
+ // If a target mesh is set, only fire when that mesh (or a descendant) is picked.
29
+ if (mesh && !(pickedMesh === mesh || (pickedMesh && _IsDescendantOf(pickedMesh, mesh)))) {
30
+ return true;
31
+ }
32
+ this.pointerId.setValue(pointerInfo.event.pointerId, context);
33
+ this.pickedMesh.setValue(pickedMesh ?? null, context);
34
+ this.pickedPoint.setValue(pointerInfo.pickInfo?.pickedPoint ?? null, context);
35
+ this._execute(context);
36
+ return !this.config?.stopPropagation;
37
+ }
38
+ /** @internal */
39
+ _preparePendingTasks(_context) {
40
+ // no-op
41
+ }
42
+ /** @internal */
43
+ _cancelPendingTasks(_context) {
44
+ // no-op
45
+ }
46
+ /**
47
+ * @returns the class name of the block.
48
+ */
49
+ getClassName() {
50
+ return "FlowGraphPointerDownEventBlock" /* FlowGraphBlockNames.PointerDownEvent */;
51
+ }
52
+ }
53
+ RegisterClass("FlowGraphPointerDownEventBlock" /* FlowGraphBlockNames.PointerDownEvent */, FlowGraphPointerDownEventBlock);
54
+ //# sourceMappingURL=flowGraphPointerDownEventBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphPointerDownEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphPointerDownEventBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,qCAA2C;AAIzE,OAAO,EAAE,aAAa,EAAE,mCAA4B;AACpD,OAAO,EAAE,eAAe,EAAE,uBAA6B;AAGvD,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,oCAA0C;AAqBhF;;;;GAIG;AACH,MAAM,OAAO,8BAA+B,SAAQ,mBAAmB;IAyBnE;;;OAGG;IACH,YAAmB,MAAqD;QACpE,KAAK,CAAC,MAAM,CAAC,CAAC;QARlB,gBAAgB;QACS,SAAI,sDAAsD;QAQ/E,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QACxF,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QACtE,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;QACrE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IAC3E,CAAC;IAED,gBAAgB;IACA,aAAa,CAAC,OAAyB,EAAE,WAAwB;QAC7E,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,EAAE,UAAU,CAAC;QAEpD,iFAAiF;QACjF,IAAI,IAAI,IAAI,CAAC,CAAC,UAAU,KAAK,IAAI,IAAI,CAAC,UAAU,IAAI,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YACtF,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAE,WAAW,CAAC,KAAsB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAChF,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,IAAI,IAAI,EAAE,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,WAAW,IAAI,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9E,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvB,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC;IACzC,CAAC;IAED,gBAAgB;IACA,oBAAoB,CAAC,QAA0B;QAC3D,QAAQ;IACZ,CAAC;IAED,gBAAgB;IACA,mBAAmB,CAAC,QAA0B;QAC1D,QAAQ;IACZ,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,mFAA4C;IAChD,CAAC;CACJ;AAED,aAAa,8EAAuC,8BAA8B,CAAC,CAAC","sourcesContent":["import type { AbstractMesh } from \"core/Meshes/abstractMesh\";\nimport { FlowGraphEventBlock } from \"core/FlowGraph/flowGraphEventBlock\";\nimport type { PointerInfo } from \"core/Events/pointerEvents\";\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport type { IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { _IsDescendantOf } from \"core/FlowGraph/utils\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { RichTypeAny, RichTypeNumber } from \"core/FlowGraph/flowGraphRichTypes\";\nimport type { Vector3 } from \"core/Maths/math.vector\";\nimport { FlowGraphEventType } from \"core/FlowGraph/flowGraphEventType\";\nimport type { Nullable } from \"core/types\";\n\n/**\n * Configuration for the pointer down event block.\n */\nexport interface IFlowGraphPointerDownEventBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * Should this block stop propagation of the event to other listeners.\n */\n stopPropagation?: boolean;\n\n /**\n * Optional mesh to filter events to. If set, the block only fires when the pointer\n * is pressed on this mesh or a descendant of it. If not set, fires on any pointer down.\n */\n targetMesh?: AbstractMesh;\n}\n\n/**\n * A pointer down event block.\n * This block fires when a pointer is pressed (mouse button down / touch start).\n * Optionally filters to a specific mesh via the `targetMesh` input.\n */\nexport class FlowGraphPointerDownEventBlock extends FlowGraphEventBlock {\n /**\n * Optional input connection: restrict firing to this mesh (and its descendants).\n * Leave disconnected to fire on any pointer down.\n */\n public readonly targetMesh: FlowGraphDataConnection<AbstractMesh>;\n\n /**\n * Output connection: The id of the pointer that triggered the event.\n */\n public readonly pointerId: FlowGraphDataConnection<number>;\n\n /**\n * Output connection: The mesh that was picked (if any).\n */\n public readonly pickedMesh: FlowGraphDataConnection<Nullable<AbstractMesh>>;\n\n /**\n * Output connection: The world-space point that was picked (if any).\n */\n public readonly pickedPoint: FlowGraphDataConnection<Nullable<Vector3>>;\n\n /** @internal */\n public override readonly type: FlowGraphEventType = FlowGraphEventType.PointerDown;\n\n /**\n * Creates a new FlowGraphPointerDownEventBlock.\n * @param config optional configuration\n */\n public constructor(config?: IFlowGraphPointerDownEventBlockConfiguration) {\n super(config);\n this.targetMesh = this.registerDataInput(\"targetMesh\", RichTypeAny, config?.targetMesh);\n this.pointerId = this.registerDataOutput(\"pointerId\", RichTypeNumber);\n this.pickedMesh = this.registerDataOutput(\"pickedMesh\", RichTypeAny);\n this.pickedPoint = this.registerDataOutput(\"pickedPoint\", RichTypeAny);\n }\n\n /** @internal */\n public override _executeEvent(context: FlowGraphContext, pointerInfo: PointerInfo): boolean {\n const mesh = this.targetMesh.getValue(context);\n const pickedMesh = pointerInfo.pickInfo?.pickedMesh;\n\n // If a target mesh is set, only fire when that mesh (or a descendant) is picked.\n if (mesh && !(pickedMesh === mesh || (pickedMesh && _IsDescendantOf(pickedMesh, mesh)))) {\n return true;\n }\n\n this.pointerId.setValue((pointerInfo.event as PointerEvent).pointerId, context);\n this.pickedMesh.setValue(pickedMesh ?? null, context);\n this.pickedPoint.setValue(pointerInfo.pickInfo?.pickedPoint ?? null, context);\n this._execute(context);\n return !this.config?.stopPropagation;\n }\n\n /** @internal */\n public override _preparePendingTasks(_context: FlowGraphContext): void {\n // no-op\n }\n\n /** @internal */\n public override _cancelPendingTasks(_context: FlowGraphContext): void {\n // no-op\n }\n\n /**\n * @returns the class name of the block.\n */\n public override getClassName(): string {\n return FlowGraphBlockNames.PointerDownEvent;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.PointerDownEvent, FlowGraphPointerDownEventBlock);\n"]}
@@ -0,0 +1,64 @@
1
+ import type { AbstractMesh } from "../../../Meshes/abstractMesh.js";
2
+ import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
3
+ import type { PointerInfo } from "../../../Events/pointerEvents.js";
4
+ import type { FlowGraphContext } from "../../flowGraphContext.js";
5
+ import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
6
+ import type { FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
7
+ import type { Vector3 } from "../../../Maths/math.vector.js";
8
+ import { FlowGraphEventType } from "../../flowGraphEventType.js";
9
+ import type { Nullable } from "../../../types.js";
10
+ /**
11
+ * Configuration for the pointer move event block.
12
+ */
13
+ export interface IFlowGraphPointerMoveEventBlockConfiguration extends IFlowGraphBlockConfiguration {
14
+ /**
15
+ * Should this block stop propagation of the event to other listeners.
16
+ */
17
+ stopPropagation?: boolean;
18
+ /**
19
+ * Optional mesh to filter events to. If set, the block only fires when the pointer
20
+ * is moving over this mesh or a descendant of it. If not set, fires on any pointer move.
21
+ */
22
+ targetMesh?: AbstractMesh;
23
+ }
24
+ /**
25
+ * A pointer move event block.
26
+ * This block fires when the pointer moves.
27
+ * Optionally filters to a specific mesh via the `targetMesh` input.
28
+ */
29
+ export declare class FlowGraphPointerMoveEventBlock extends FlowGraphEventBlock {
30
+ /**
31
+ * Optional input connection: restrict firing to when the pointer is over this mesh (and its descendants).
32
+ * Leave disconnected to fire on any pointer move.
33
+ */
34
+ readonly targetMesh: FlowGraphDataConnection<AbstractMesh>;
35
+ /**
36
+ * Output connection: The id of the pointer that triggered the event.
37
+ */
38
+ readonly pointerId: FlowGraphDataConnection<number>;
39
+ /**
40
+ * Output connection: The mesh currently under the pointer (if any).
41
+ */
42
+ readonly meshUnderPointer: FlowGraphDataConnection<Nullable<AbstractMesh>>;
43
+ /**
44
+ * Output connection: The world-space point under the pointer (if any).
45
+ */
46
+ readonly pickedPoint: FlowGraphDataConnection<Nullable<Vector3>>;
47
+ /** @internal */
48
+ readonly type: FlowGraphEventType;
49
+ /**
50
+ * Creates a new FlowGraphPointerMoveEventBlock.
51
+ * @param config optional configuration
52
+ */
53
+ constructor(config?: IFlowGraphPointerMoveEventBlockConfiguration);
54
+ /** @internal */
55
+ _executeEvent(context: FlowGraphContext, pointerInfo: PointerInfo): boolean;
56
+ /** @internal */
57
+ _preparePendingTasks(_context: FlowGraphContext): void;
58
+ /** @internal */
59
+ _cancelPendingTasks(_context: FlowGraphContext): void;
60
+ /**
61
+ * @returns the class name of the block.
62
+ */
63
+ getClassName(): string;
64
+ }
@@ -0,0 +1,54 @@
1
+ import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
2
+ import { RegisterClass } from "../../../Misc/typeStore.js";
3
+ import { _IsDescendantOf } from "../../utils.js";
4
+ import { RichTypeAny, RichTypeNumber } from "../../flowGraphRichTypes.js";
5
+ /**
6
+ * A pointer move event block.
7
+ * This block fires when the pointer moves.
8
+ * Optionally filters to a specific mesh via the `targetMesh` input.
9
+ */
10
+ export class FlowGraphPointerMoveEventBlock extends FlowGraphEventBlock {
11
+ /**
12
+ * Creates a new FlowGraphPointerMoveEventBlock.
13
+ * @param config optional configuration
14
+ */
15
+ constructor(config) {
16
+ super(config);
17
+ /** @internal */
18
+ this.type = "PointerMove" /* FlowGraphEventType.PointerMove */;
19
+ this.targetMesh = this.registerDataInput("targetMesh", RichTypeAny, config?.targetMesh);
20
+ this.pointerId = this.registerDataOutput("pointerId", RichTypeNumber);
21
+ this.meshUnderPointer = this.registerDataOutput("meshUnderPointer", RichTypeAny);
22
+ this.pickedPoint = this.registerDataOutput("pickedPoint", RichTypeAny);
23
+ }
24
+ /** @internal */
25
+ _executeEvent(context, pointerInfo) {
26
+ const mesh = this.targetMesh.getValue(context);
27
+ const pickedMesh = pointerInfo.pickInfo?.pickedMesh;
28
+ // If a target mesh is set, only fire when that mesh (or a descendant) is under the pointer.
29
+ if (mesh && !(pickedMesh === mesh || (pickedMesh && _IsDescendantOf(pickedMesh, mesh)))) {
30
+ return true;
31
+ }
32
+ this.pointerId.setValue(pointerInfo.event.pointerId, context);
33
+ this.meshUnderPointer.setValue(pickedMesh ?? null, context);
34
+ this.pickedPoint.setValue(pointerInfo.pickInfo?.pickedPoint ?? null, context);
35
+ this._execute(context);
36
+ return !this.config?.stopPropagation;
37
+ }
38
+ /** @internal */
39
+ _preparePendingTasks(_context) {
40
+ // no-op
41
+ }
42
+ /** @internal */
43
+ _cancelPendingTasks(_context) {
44
+ // no-op
45
+ }
46
+ /**
47
+ * @returns the class name of the block.
48
+ */
49
+ getClassName() {
50
+ return "FlowGraphPointerMoveEventBlock" /* FlowGraphBlockNames.PointerMoveEvent */;
51
+ }
52
+ }
53
+ RegisterClass("FlowGraphPointerMoveEventBlock" /* FlowGraphBlockNames.PointerMoveEvent */, FlowGraphPointerMoveEventBlock);
54
+ //# sourceMappingURL=flowGraphPointerMoveEventBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flowGraphPointerMoveEventBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Event/flowGraphPointerMoveEventBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,qCAA2C;AAIzE,OAAO,EAAE,aAAa,EAAE,mCAA4B;AACpD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AAW,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,WAAW,IAAI,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9E,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvB,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC;IACzC,CAAC;IAED,gBAAgB;IACA,oBAAoB,CAAC,QAA0B;QAC3D,QAAQ;IACZ,CAAC;IAED,gBAAgB;IACA,mBAAmB,CAAC,QAA0B;QAC1D,QAAQ;IACZ,CAAC;IAED;;OAEG;IACa,YAAY;QACxB,mFAA4C;IAChD,CAAC;CACJ;AAED,aAAa,8EAAuC,8BAA8B,CAAC,CAAC","sourcesContent":["import type { AbstractMesh } from \"core/Meshes/abstractMesh\";\nimport { FlowGraphEventBlock } from \"core/FlowGraph/flowGraphEventBlock\";\nimport type { PointerInfo } from \"core/Events/pointerEvents\";\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport type { IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport { _IsDescendantOf } from \"core/FlowGraph/utils\";\nimport { FlowGraphBlockNames } from \"../flowGraphBlockNames\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { RichTypeAny, RichTypeNumber } from \"core/FlowGraph/flowGraphRichTypes\";\nimport type { Vector3 } from \"core/Maths/math.vector\";\nimport { FlowGraphEventType } from \"core/FlowGraph/flowGraphEventType\";\nimport type { Nullable } from \"core/types\";\n\n/**\n * Configuration for the pointer move event block.\n */\nexport interface IFlowGraphPointerMoveEventBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * Should this block stop propagation of the event to other listeners.\n */\n stopPropagation?: boolean;\n\n /**\n * Optional mesh to filter events to. If set, the block only fires when the pointer\n * is moving over this mesh or a descendant of it. If not set, fires on any pointer move.\n */\n targetMesh?: AbstractMesh;\n}\n\n/**\n * A pointer move event block.\n * This block fires when the pointer moves.\n * Optionally filters to a specific mesh via the `targetMesh` input.\n */\nexport class FlowGraphPointerMoveEventBlock extends FlowGraphEventBlock {\n /**\n * Optional input connection: restrict firing to when the pointer is over this mesh (and its descendants).\n * Leave disconnected to fire on any pointer move.\n */\n public readonly targetMesh: FlowGraphDataConnection<AbstractMesh>;\n\n /**\n * Output connection: The id of the pointer that triggered the event.\n */\n public readonly pointerId: FlowGraphDataConnection<number>;\n\n /**\n * Output connection: The mesh currently under the pointer (if any).\n */\n public readonly meshUnderPointer: FlowGraphDataConnection<Nullable<AbstractMesh>>;\n\n /**\n * Output connection: The world-space point under the pointer (if any).\n */\n public readonly pickedPoint: FlowGraphDataConnection<Nullable<Vector3>>;\n\n /** @internal */\n public override readonly type: FlowGraphEventType = FlowGraphEventType.PointerMove;\n\n /**\n * Creates a new FlowGraphPointerMoveEventBlock.\n * @param config optional configuration\n */\n public constructor(config?: IFlowGraphPointerMoveEventBlockConfiguration) {\n super(config);\n this.targetMesh = this.registerDataInput(\"targetMesh\", RichTypeAny, config?.targetMesh);\n this.pointerId = this.registerDataOutput(\"pointerId\", RichTypeNumber);\n this.meshUnderPointer = this.registerDataOutput(\"meshUnderPointer\", RichTypeAny);\n this.pickedPoint = this.registerDataOutput(\"pickedPoint\", RichTypeAny);\n }\n\n /** @internal */\n public override _executeEvent(context: FlowGraphContext, pointerInfo: PointerInfo): boolean {\n const mesh = this.targetMesh.getValue(context);\n const pickedMesh = pointerInfo.pickInfo?.pickedMesh;\n\n // If a target mesh is set, only fire when that mesh (or a descendant) is under the pointer.\n if (mesh && !(pickedMesh === mesh || (pickedMesh && _IsDescendantOf(pickedMesh, mesh)))) {\n return true;\n }\n\n this.pointerId.setValue((pointerInfo.event as PointerEvent).pointerId, context);\n this.meshUnderPointer.setValue(pickedMesh ?? null, context);\n this.pickedPoint.setValue(pointerInfo.pickInfo?.pickedPoint ?? null, context);\n this._execute(context);\n return !this.config?.stopPropagation;\n }\n\n /** @internal */\n public override _preparePendingTasks(_context: FlowGraphContext): void {\n // no-op\n }\n\n /** @internal */\n public override _cancelPendingTasks(_context: FlowGraphContext): void {\n // no-op\n }\n\n /**\n * @returns the class name of the block.\n */\n public override getClassName(): string {\n return FlowGraphBlockNames.PointerMoveEvent;\n }\n}\n\nRegisterClass(FlowGraphBlockNames.PointerMoveEvent, FlowGraphPointerMoveEventBlock);\n"]}
@@ -0,0 +1,64 @@
1
+ import type { AbstractMesh } from "../../../Meshes/abstractMesh.js";
2
+ import { FlowGraphEventBlock } from "../../flowGraphEventBlock.js";
3
+ import type { PointerInfo } from "../../../Events/pointerEvents.js";
4
+ import type { FlowGraphContext } from "../../flowGraphContext.js";
5
+ import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
6
+ import type { FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
7
+ import type { Vector3 } from "../../../Maths/math.vector.js";
8
+ import { FlowGraphEventType } from "../../flowGraphEventType.js";
9
+ import type { Nullable } from "../../../types.js";
10
+ /**
11
+ * Configuration for the pointer up event block.
12
+ */
13
+ export interface IFlowGraphPointerUpEventBlockConfiguration extends IFlowGraphBlockConfiguration {
14
+ /**
15
+ * Should this block stop propagation of the event to other listeners.
16
+ */
17
+ stopPropagation?: boolean;
18
+ /**
19
+ * Optional mesh to filter events to. If set, the block only fires when the pointer
20
+ * is released over this mesh or a descendant of it. If not set, fires on any pointer up.
21
+ */
22
+ targetMesh?: AbstractMesh;
23
+ }
24
+ /**
25
+ * A pointer up event block.
26
+ * This block fires when a pointer is released (mouse button up / touch end).
27
+ * Optionally filters to a specific mesh via the `targetMesh` input.
28
+ */
29
+ export declare class FlowGraphPointerUpEventBlock extends FlowGraphEventBlock {
30
+ /**
31
+ * Optional input connection: restrict firing to this mesh (and its descendants).
32
+ * Leave disconnected to fire on any pointer up.
33
+ */
34
+ readonly targetMesh: FlowGraphDataConnection<AbstractMesh>;
35
+ /**
36
+ * Output connection: The id of the pointer that triggered the event.
37
+ */
38
+ readonly pointerId: FlowGraphDataConnection<number>;
39
+ /**
40
+ * Output connection: The mesh that was picked (if any).
41
+ */
42
+ readonly pickedMesh: FlowGraphDataConnection<Nullable<AbstractMesh>>;
43
+ /**
44
+ * Output connection: The world-space point that was picked (if any).
45
+ */
46
+ readonly pickedPoint: FlowGraphDataConnection<Nullable<Vector3>>;
47
+ /** @internal */
48
+ readonly type: FlowGraphEventType;
49
+ /**
50
+ * Creates a new FlowGraphPointerUpEventBlock.
51
+ * @param config optional configuration
52
+ */
53
+ constructor(config?: IFlowGraphPointerUpEventBlockConfiguration);
54
+ /** @internal */
55
+ _executeEvent(context: FlowGraphContext, pointerInfo: PointerInfo): boolean;
56
+ /** @internal */
57
+ _preparePendingTasks(_context: FlowGraphContext): void;
58
+ /** @internal */
59
+ _cancelPendingTasks(_context: FlowGraphContext): void;
60
+ /**
61
+ * @returns the class name of the block.
62
+ */
63
+ getClassName(): string;
64
+ }