@babylonjs/core 7.52.3 → 7.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.d.ts +0 -3
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js +9 -6
- package/AudioV2/abstractAudio/subNodes/abstractAudioSubGraph.js.map +1 -1
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js +10 -5
- package/AudioV2/abstractAudio/subProperties/spatialAudio.js.map +1 -1
- package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.js +2 -2
- package/AudioV2/webAudio/subNodes/webAudioBaseSubGraph.js.map +1 -1
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js +3 -3
- package/AudioV2/webAudio/subNodes/webAudioBusAndSoundSubGraph.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js +7 -2
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixMathBlocks.js.map +1 -1
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.d.ts +3 -12
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js +16 -36
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +5 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +17 -4
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +3 -11
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +5 -14
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +1 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js +18 -17
- package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
- package/FlowGraph/flowGraphDataConnection.d.ts +10 -1
- package/FlowGraph/flowGraphDataConnection.js +23 -13
- package/FlowGraph/flowGraphDataConnection.js.map +1 -1
- package/FlowGraph/flowGraphRichTypes.d.ts +5 -0
- package/FlowGraph/flowGraphRichTypes.js +12 -0
- package/FlowGraph/flowGraphRichTypes.js.map +1 -1
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.d.ts +30 -0
- package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.js +48 -0
- package/FrameGraph/Node/Blocks/PostProcesses/anaglyphPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.d.ts +3 -3
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js +6 -6
- package/FrameGraph/Node/Blocks/PostProcesses/basePostProcessBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.d.ts +38 -0
- package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.js +88 -0
- package/FrameGraph/Node/Blocks/PostProcesses/chromaticAberrationPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Rendering/utilityLayerRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/clearBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js +7 -7
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js +6 -6
- package/FrameGraph/Node/Blocks/Textures/copyTextureBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.d.ts +2 -2
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js +7 -7
- package/FrameGraph/Node/Blocks/Textures/generateMipmapsBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +2 -0
- package/FrameGraph/Node/Blocks/index.js +2 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +2 -2
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +3 -3
- package/FrameGraph/Tasks/Layers/baseLayerTask.js +12 -12
- package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/anaglyphTask.d.ts +21 -0
- package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js +27 -0
- package/FrameGraph/Tasks/PostProcesses/anaglyphTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +2 -2
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +5 -5
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.d.ts +17 -0
- package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js +23 -0
- package/FrameGraph/Tasks/PostProcesses/chromaticAberrationTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +2 -2
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +5 -5
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.d.ts +2 -2
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.d.ts +2 -2
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js +8 -8
- package/FrameGraph/Tasks/PostProcesses/ssrRenderingPipelineTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +3 -3
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +9 -9
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +7 -7
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.d.ts +3 -3
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js +3 -3
- package/FrameGraph/Tasks/Rendering/utilityLayerRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +3 -3
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +8 -8
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.d.ts +3 -3
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +3 -3
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.d.ts +2 -2
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +5 -5
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -1
- package/FrameGraph/index.d.ts +2 -0
- package/FrameGraph/index.js +2 -0
- package/FrameGraph/index.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +3 -0
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/materialDefines.js +1 -1
- package/Materials/materialDefines.js.map +1 -1
- package/Meshes/Builders/shapeBuilder.d.ts +6 -0
- package/Meshes/Builders/shapeBuilder.js +7 -4
- package/Meshes/Builders/shapeBuilder.js.map +1 -1
- package/PostProcesses/anaglyphPostProcess.d.ts +0 -1
- package/PostProcesses/anaglyphPostProcess.js +14 -11
- package/PostProcesses/anaglyphPostProcess.js.map +1 -1
- package/PostProcesses/chromaticAberrationPostProcess.d.ts +15 -8
- package/PostProcesses/chromaticAberrationPostProcess.js +72 -42
- package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
- package/PostProcesses/index.d.ts +2 -0
- package/PostProcesses/index.js +2 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +5 -0
- package/PostProcesses/postProcess.js +10 -2
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/thinAnaglyphPostProcess.d.ts +23 -0
- package/PostProcesses/thinAnaglyphPostProcess.js +42 -0
- package/PostProcesses/thinAnaglyphPostProcess.js.map +1 -0
- package/PostProcesses/thinChromaticAberrationPostProcess.d.ts +45 -0
- package/PostProcesses/thinChromaticAberrationPostProcess.js +69 -0
- package/PostProcesses/thinChromaticAberrationPostProcess.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,63 +1,43 @@
|
|
|
1
|
-
import { FlowGraphBlock } from "../../../flowGraphBlock.js";
|
|
2
1
|
import { FlowGraphPathConverterComponent } from "../../../flowGraphPathConverterComponent.js";
|
|
3
2
|
import { RichTypeAny } from "../../../flowGraphRichTypes.js";
|
|
4
3
|
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
5
4
|
import { Color3, Color4 } from "../../../../Maths/math.color.js";
|
|
5
|
+
import { FlowGraphCachedOperationBlock } from "../flowGraphCachedOperationBlock.js";
|
|
6
6
|
/**
|
|
7
7
|
* This block will take a JSON pointer and parse it to get the value from the JSON object.
|
|
8
8
|
* The output is an object and a property name.
|
|
9
9
|
* Optionally, the block can also output the value of the property. This is configurable.
|
|
10
10
|
*/
|
|
11
|
-
export class FlowGraphJsonPointerParserBlock extends
|
|
11
|
+
export class FlowGraphJsonPointerParserBlock extends FlowGraphCachedOperationBlock {
|
|
12
12
|
constructor(
|
|
13
13
|
/**
|
|
14
14
|
* the configuration of the block
|
|
15
15
|
*/
|
|
16
16
|
config) {
|
|
17
|
-
super(config);
|
|
17
|
+
super(RichTypeAny, config);
|
|
18
18
|
this.config = config;
|
|
19
19
|
this.object = this.registerDataOutput("object", RichTypeAny);
|
|
20
20
|
this.propertyName = this.registerDataOutput("propertyName", RichTypeAny);
|
|
21
|
-
this.isValid = this.registerDataOutput("isValid", RichTypeAny);
|
|
22
|
-
if (config.outputValue) {
|
|
23
|
-
this.value = this.registerDataOutput("value", RichTypeAny);
|
|
24
|
-
}
|
|
25
21
|
this.setterFunction = this.registerDataOutput("setFunction", RichTypeAny, this._setPropertyValue.bind(this));
|
|
26
22
|
this.getterFunction = this.registerDataOutput("getFunction", RichTypeAny, this._getPropertyValue.bind(this));
|
|
27
23
|
this.generateAnimationsFunction = this.registerDataOutput("generateAnimationsFunction", RichTypeAny, this._getInterpolationAnimationPropertyInfo.bind(this));
|
|
28
24
|
this.templateComponent = new FlowGraphPathConverterComponent(config.jsonPointer, this);
|
|
29
25
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
this.isValid.setValue(false, context);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
this.object.setValue(object, context);
|
|
42
|
-
if (propertyName) {
|
|
43
|
-
this.propertyName.setValue(propertyName, context);
|
|
44
|
-
}
|
|
45
|
-
this.isValid.setValue(true, context);
|
|
46
|
-
}
|
|
47
|
-
if (this.config.outputValue) {
|
|
48
|
-
if (value === undefined) {
|
|
49
|
-
this.isValid.setValue(false, context);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
this.value.setValue(value, context);
|
|
53
|
-
this.isValid.setValue(true, context);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
26
|
+
_doOperation(context) {
|
|
27
|
+
const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);
|
|
28
|
+
const value = accessorContainer.info.get(accessorContainer.object);
|
|
29
|
+
const object = accessorContainer.info.getTarget?.(accessorContainer.object);
|
|
30
|
+
const propertyName = accessorContainer.info.getPropertyName?.[0](accessorContainer.object);
|
|
31
|
+
if (!object) {
|
|
32
|
+
throw new Error("Object is undefined");
|
|
56
33
|
}
|
|
57
|
-
|
|
58
|
-
this.
|
|
59
|
-
|
|
34
|
+
else {
|
|
35
|
+
this.object.setValue(object, context);
|
|
36
|
+
if (propertyName) {
|
|
37
|
+
this.propertyName.setValue(propertyName, context);
|
|
38
|
+
}
|
|
60
39
|
}
|
|
40
|
+
return value;
|
|
61
41
|
}
|
|
62
42
|
_setPropertyValue(_target, _propertyName, value, context) {
|
|
63
43
|
const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphJsonPointerParserBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,mCAAsC;AAG/D,OAAO,EAAE,+BAA+B,EAAE,oDAAuD;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OAAO,CAAC,CAAC;gBACxF,aAAa,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;oBAChC,IAAI,cAAc,EAAE,CAAC;wBACjB,SAAS,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;oBACjE,CAAC;oBACD,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;gBAChD,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;YAEH,OAAO,UAAU,CAAC;QACtB,CAAC,CAAC;IACN,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,qFAA6C;IACjD,CAAC;CACJ;AAED,SAAS,OAAO,CAAC,KAAU,EAAE,aAAqB;IAC9C,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3C,OAAO,KAAmC,CAAC;IAC/C,CAAC;IACD,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;SAAM,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,aAAa,gFAAwC,+BAA+B,CAAC,CAAC","sourcesContent":["import type { FlowGraphAssetType } from \"core/FlowGraph/flowGraphAssetsContext\";\nimport type { IFlowGraphBlockConfiguration } from \"core/FlowGraph/flowGraphBlock\";\nimport { FlowGraphBlock } from \"core/FlowGraph/flowGraphBlock\";\nimport type { FlowGraphContext } from \"core/FlowGraph/flowGraphContext\";\nimport type { FlowGraphDataConnection } from \"core/FlowGraph/flowGraphDataConnection\";\nimport { FlowGraphPathConverterComponent } from \"core/FlowGraph/flowGraphPathConverterComponent\";\nimport { RichTypeAny } from \"core/FlowGraph/flowGraphRichTypes\";\nimport type { IObjectAccessor } from \"core/FlowGraph/typeDefinitions\";\nimport type { IPathToObjectConverter } from \"core/ObjectModel/objectModelInterfaces\";\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport type { Animation } from \"core/Animations/animation\";\nimport type { EasingFunction } from \"core/Animations/easing\";\nimport type { Vector4 } from \"core/Maths/math.vector\";\nimport { Color3, Color4 } from \"core/Maths/math.color\";\n\n/**\n * Configuration for the JSON pointer parser block.\n */\nexport interface IFlowGraphJsonPointerParserBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * The JSON pointer to parse.\n */\n jsonPointer: string;\n /**\n * The path converter to use to convert the path to an object accessor.\n */\n pathConverter: IPathToObjectConverter<IObjectAccessor>;\n\n /**\n * Whether to output the value of the property.\n */\n outputValue?: boolean;\n}\n\n/**\n * This block will take a JSON pointer and parse it to get the value from the JSON object.\n * The output is an object and a property name.\n * Optionally, the block can also output the value of the property. This is configurable.\n */\nexport class FlowGraphJsonPointerParserBlock<P extends any, O extends FlowGraphAssetType> extends FlowGraphBlock {\n /**\n * Output connection: The object that contains the property.\n */\n public readonly object: FlowGraphDataConnection<O>;\n\n /**\n * Output connection: The property name.\n */\n public readonly propertyName: FlowGraphDataConnection<string>;\n\n /**\n * Output connection: The value of the property.\n * Note that per default this is not outputted. It can be enabled by setting the outputValue property to true.\n */\n public readonly value: FlowGraphDataConnection<P>;\n\n /**\n * Output connection: A function that can be used to update the value of the property.\n */\n public readonly setterFunction: FlowGraphDataConnection<(target: O, propertyName: string, value: P, context: FlowGraphContext) => void>;\n\n /**\n * Output connection: A function that can be used to get the value of the property.\n */\n public readonly getterFunction: FlowGraphDataConnection<(target: O, propertyName: string, context: FlowGraphContext) => P | undefined>;\n\n /**\n * Output connection: A function that can be used to get the interpolation animation property info.\n */\n public readonly generateAnimationsFunction: FlowGraphDataConnection<() => (keys: any[], fps: number, easingFunction?: EasingFunction) => Animation[]>;\n\n /**\n * Output connection: Whether the value is valid.\n */\n public readonly isValid: FlowGraphDataConnection<boolean>;\n\n /**\n * The component with the templated inputs for the provided path.\n */\n public readonly templateComponent: FlowGraphPathConverterComponent;\n\n constructor(\n /**\n * the configuration of the block\n */\n public override config: IFlowGraphJsonPointerParserBlockConfiguration\n ) {\n super(config);\n this.object = this.registerDataOutput(\"object\", RichTypeAny);\n this.propertyName = this.registerDataOutput(\"propertyName\", RichTypeAny);\n this.isValid = this.registerDataOutput(\"isValid\", RichTypeAny);\n if (config.outputValue) {\n this.value = this.registerDataOutput(\"value\", RichTypeAny);\n }\n this.setterFunction = this.registerDataOutput(\"setFunction\", RichTypeAny, this._setPropertyValue.bind(this));\n this.getterFunction = this.registerDataOutput(\"getFunction\", RichTypeAny, this._getPropertyValue.bind(this));\n this.generateAnimationsFunction = this.registerDataOutput(\"generateAnimationsFunction\", RichTypeAny, this._getInterpolationAnimationPropertyInfo.bind(this));\n this.templateComponent = new FlowGraphPathConverterComponent(config.jsonPointer, this);\n }\n\n public override _updateOutputs(context: FlowGraphContext) {\n try {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n const value = accessorContainer.info.get(accessorContainer.object);\n const object = accessorContainer.info.getTarget?.(accessorContainer.object);\n const propertyName = accessorContainer.info.getPropertyName?.[0](accessorContainer.object);\n if (!object) {\n this.isValid.setValue(false, context);\n return;\n } else {\n this.object.setValue(object, context);\n if (propertyName) {\n this.propertyName.setValue(propertyName, context);\n }\n this.isValid.setValue(true, context);\n }\n if (this.config.outputValue) {\n if (value === undefined) {\n this.isValid.setValue(false, context);\n } else {\n this.value.setValue(value, context);\n this.isValid.setValue(true, context);\n }\n }\n } catch (e) {\n this.isValid.setValue(false, context);\n return;\n }\n }\n\n private _setPropertyValue(_target: O, _propertyName: string, value: P, context: FlowGraphContext): void {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n const type = accessorContainer.info.type;\n if (type.startsWith(\"Color\")) {\n value = ToColor(value as Vector4, type) as unknown as P;\n }\n accessorContainer.info.set?.(value, accessorContainer.object);\n }\n\n private _getPropertyValue(_target: O, _propertyName: string, context: FlowGraphContext): P | undefined {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n return accessorContainer.info.get(accessorContainer.object);\n }\n\n private _getInterpolationAnimationPropertyInfo(\n _target: O,\n _propertyName: string,\n context: FlowGraphContext\n ): (keys: any[], fps: number, animationType: number, easingFunction?: EasingFunction) => Animation[] {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n return (keys: any[], fps: number, animationType: number, easingFunction?: EasingFunction) => {\n const animations: Animation[] = [];\n // make sure keys are of the right type (in case of float3 color/vector)\n const type = accessorContainer.info.type;\n if (type.startsWith(\"Color\")) {\n keys = keys.map((key) => {\n return {\n frame: key.frame,\n value: ToColor(key.value, type),\n };\n });\n }\n accessorContainer.info.interpolation?.forEach((info, index) => {\n const name = accessorContainer.info.getPropertyName?.[index](accessorContainer.object) || \"Animation-interpolation-\" + index;\n // generate the keys based on interpolation info\n let newKeys: any[] = keys;\n if (animationType !== info.type) {\n // convert the keys to the right type\n newKeys = keys.map((key) => {\n return {\n frame: key.frame,\n value: info.getValue(undefined, key.value.asArray ? key.value.asArray() : [key.value], 0, 1),\n };\n });\n }\n const animationData = info.buildAnimations(accessorContainer.object, name, 60, newKeys);\n animationData.forEach((animation) => {\n if (easingFunction) {\n animation.babylonAnimation.setEasingFunction(easingFunction);\n }\n animations.push(animation.babylonAnimation);\n });\n });\n\n return animations;\n };\n }\n\n /**\n * Gets the class name of this block\n * @returns the class name\n */\n public override getClassName(): string {\n return FlowGraphBlockNames.JsonPointerParser;\n }\n}\n\nfunction ToColor(value: any, expectedValue: string) {\n if (value.getClassName().startsWith(\"Color\")) {\n return value as unknown as Color3 | Color4;\n }\n if (expectedValue === \"Color3\") {\n return new Color3(value.x, value.y, value.z);\n } else if (expectedValue === \"Color4\") {\n return new Color4(value.x, value.y, value.z, value.w);\n }\n return value;\n}\n\nRegisterClass(FlowGraphBlockNames.JsonPointerParser, FlowGraphJsonPointerParserBlock);\n"]}
|
|
1
|
+
{"version":3,"file":"flowGraphJsonPointerParserBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,+BAA+B,EAAE,oDAAuD;AACjG,OAAO,EAAE,WAAW,EAAE,uCAA0C;AAIhE,OAAO,EAAE,aAAa,EAAE,sCAA4B;AAIpD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,wCAA8B;AACvD,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAqBjF;;;;GAIG;AACH,MAAM,OAAO,+BAA6E,SAAQ,6BAAgC;IA+B9H;IACI;;OAEG;IACa,MAAqD;QAErE,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAFX,WAAM,GAAN,MAAM,CAA+C;QAGrE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QAC7D,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QACzE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7G,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,EAAE,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7G,IAAI,CAAC,0BAA0B,GAAG,IAAI,CAAC,kBAAkB,C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O,CAAC,KAAU,EAAE,aAAqB;IAC9C,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3C,OAAO,KAAmC,CAAC;IAC/C,CAAC;IACD,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;SAAM,IAAI,aAAa,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,aAAa,gFAAwC,+BAA+B,CAAC,CAAC","sourcesContent":["import type { 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 { FlowGraphPathConverterComponent } from \"core/FlowGraph/flowGraphPathConverterComponent\";\nimport { RichTypeAny } from \"core/FlowGraph/flowGraphRichTypes\";\nimport type { IObjectAccessor } from \"core/FlowGraph/typeDefinitions\";\nimport type { IPathToObjectConverter } from \"core/ObjectModel/objectModelInterfaces\";\nimport { FlowGraphBlockNames } from \"../../flowGraphBlockNames\";\nimport { RegisterClass } from \"core/Misc/typeStore\";\nimport type { Animation } from \"core/Animations/animation\";\nimport type { EasingFunction } from \"core/Animations/easing\";\nimport type { Vector4 } from \"core/Maths/math.vector\";\nimport { Color3, Color4 } from \"core/Maths/math.color\";\nimport { FlowGraphCachedOperationBlock } from \"../flowGraphCachedOperationBlock\";\n\n/**\n * Configuration for the JSON pointer parser block.\n */\nexport interface IFlowGraphJsonPointerParserBlockConfiguration extends IFlowGraphBlockConfiguration {\n /**\n * The JSON pointer to parse.\n */\n jsonPointer: string;\n /**\n * The path converter to use to convert the path to an object accessor.\n */\n pathConverter: IPathToObjectConverter<IObjectAccessor>;\n\n /**\n * Whether to output the value of the property.\n */\n outputValue?: boolean;\n}\n\n/**\n * This block will take a JSON pointer and parse it to get the value from the JSON object.\n * The output is an object and a property name.\n * Optionally, the block can also output the value of the property. This is configurable.\n */\nexport class FlowGraphJsonPointerParserBlock<P extends any, O extends FlowGraphAssetType> extends FlowGraphCachedOperationBlock<P> {\n /**\n * Output connection: The object that contains the property.\n */\n public readonly object: FlowGraphDataConnection<O>;\n\n /**\n * Output connection: The property name.\n */\n public readonly propertyName: FlowGraphDataConnection<string>;\n\n /**\n * Output connection: A function that can be used to update the value of the property.\n */\n public readonly setterFunction: FlowGraphDataConnection<(target: O, propertyName: string, value: P, context: FlowGraphContext) => void>;\n\n /**\n * Output connection: A function that can be used to get the value of the property.\n */\n public readonly getterFunction: FlowGraphDataConnection<(target: O, propertyName: string, context: FlowGraphContext) => P | undefined>;\n\n /**\n * Output connection: A function that can be used to get the interpolation animation property info.\n */\n public readonly generateAnimationsFunction: FlowGraphDataConnection<() => (keys: any[], fps: number, easingFunction?: EasingFunction) => Animation[]>;\n\n /**\n * The component with the templated inputs for the provided path.\n */\n public readonly templateComponent: FlowGraphPathConverterComponent;\n\n constructor(\n /**\n * the configuration of the block\n */\n public override config: IFlowGraphJsonPointerParserBlockConfiguration\n ) {\n super(RichTypeAny, config);\n this.object = this.registerDataOutput(\"object\", RichTypeAny);\n this.propertyName = this.registerDataOutput(\"propertyName\", RichTypeAny);\n this.setterFunction = this.registerDataOutput(\"setFunction\", RichTypeAny, this._setPropertyValue.bind(this));\n this.getterFunction = this.registerDataOutput(\"getFunction\", RichTypeAny, this._getPropertyValue.bind(this));\n this.generateAnimationsFunction = this.registerDataOutput(\"generateAnimationsFunction\", RichTypeAny, this._getInterpolationAnimationPropertyInfo.bind(this));\n this.templateComponent = new FlowGraphPathConverterComponent(config.jsonPointer, this);\n }\n\n public override _doOperation(context: FlowGraphContext): P {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n const value = accessorContainer.info.get(accessorContainer.object) as P;\n const object = accessorContainer.info.getTarget?.(accessorContainer.object);\n const propertyName = accessorContainer.info.getPropertyName?.[0](accessorContainer.object);\n if (!object) {\n throw new Error(\"Object is undefined\");\n } else {\n this.object.setValue(object, context);\n if (propertyName) {\n this.propertyName.setValue(propertyName, context);\n }\n }\n return value;\n }\n\n private _setPropertyValue(_target: O, _propertyName: string, value: P, context: FlowGraphContext): void {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n const type = accessorContainer.info.type;\n if (type.startsWith(\"Color\")) {\n value = ToColor(value as Vector4, type) as unknown as P;\n }\n accessorContainer.info.set?.(value, accessorContainer.object);\n }\n\n private _getPropertyValue(_target: O, _propertyName: string, context: FlowGraphContext): P | undefined {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n return accessorContainer.info.get(accessorContainer.object);\n }\n\n private _getInterpolationAnimationPropertyInfo(\n _target: O,\n _propertyName: string,\n context: FlowGraphContext\n ): (keys: any[], fps: number, animationType: number, easingFunction?: EasingFunction) => Animation[] {\n const accessorContainer = this.templateComponent.getAccessor(this.config.pathConverter, context);\n return (keys: any[], fps: number, animationType: number, easingFunction?: EasingFunction) => {\n const animations: Animation[] = [];\n // make sure keys are of the right type (in case of float3 color/vector)\n const type = accessorContainer.info.type;\n if (type.startsWith(\"Color\")) {\n keys = keys.map((key) => {\n return {\n frame: key.frame,\n value: ToColor(key.value, type),\n };\n });\n }\n accessorContainer.info.interpolation?.forEach((info, index) => {\n const name = accessorContainer.info.getPropertyName?.[index](accessorContainer.object) || \"Animation-interpolation-\" + index;\n // generate the keys based on interpolation info\n let newKeys: any[] = keys;\n if (animationType !== info.type) {\n // convert the keys to the right type\n newKeys = keys.map((key) => {\n return {\n frame: key.frame,\n value: info.getValue(undefined, key.value.asArray ? key.value.asArray() : [key.value], 0, 1),\n };\n });\n }\n const animationData = info.buildAnimations(accessorContainer.object, name, 60, newKeys);\n animationData.forEach((animation) => {\n if (easingFunction) {\n animation.babylonAnimation.setEasingFunction(easingFunction);\n }\n animations.push(animation.babylonAnimation);\n });\n });\n\n return animations;\n };\n }\n\n /**\n * Gets the class name of this block\n * @returns the class name\n */\n public override getClassName(): string {\n return FlowGraphBlockNames.JsonPointerParser;\n }\n}\n\nfunction ToColor(value: any, expectedValue: string) {\n if (value.getClassName().startsWith(\"Color\")) {\n return value as unknown as Color3 | Color4;\n }\n if (expectedValue === \"Color3\") {\n return new Color3(value.x, value.y, value.z);\n } else if (expectedValue === \"Color4\") {\n return new Color4(value.x, value.y, value.z, value.w);\n }\n return value;\n}\n\nRegisterClass(FlowGraphBlockNames.JsonPointerParser, FlowGraphJsonPointerParserBlock);\n"]}
|
|
@@ -11,12 +11,16 @@ export declare abstract class FlowGraphCachedOperationBlock<OutputT> extends Flo
|
|
|
11
11
|
* The output of the operation
|
|
12
12
|
*/
|
|
13
13
|
readonly value: FlowGraphDataConnection<OutputT>;
|
|
14
|
+
/**
|
|
15
|
+
* Output connection: Whether the value is valid.
|
|
16
|
+
*/
|
|
17
|
+
readonly isValid: FlowGraphDataConnection<boolean>;
|
|
14
18
|
constructor(outputRichType: RichType<OutputT>, config?: IFlowGraphBlockConfiguration);
|
|
15
19
|
/**
|
|
16
20
|
* @internal
|
|
17
21
|
* Operation to realize
|
|
18
22
|
* @param context the graph context
|
|
19
23
|
*/
|
|
20
|
-
abstract _doOperation(context: FlowGraphContext): OutputT;
|
|
24
|
+
abstract _doOperation(context: FlowGraphContext): OutputT | undefined;
|
|
21
25
|
_updateOutputs(context: FlowGraphContext): void;
|
|
22
26
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FlowGraphBlock } from "../../flowGraphBlock.js";
|
|
2
|
+
import { RichTypeBoolean } from "../../flowGraphRichTypes.js";
|
|
2
3
|
const cacheName = "cachedOperationValue";
|
|
3
4
|
const cacheExecIdName = "cachedExecutionId";
|
|
4
5
|
/**
|
|
@@ -8,18 +9,30 @@ export class FlowGraphCachedOperationBlock extends FlowGraphBlock {
|
|
|
8
9
|
constructor(outputRichType, config) {
|
|
9
10
|
super(config);
|
|
10
11
|
this.value = this.registerDataOutput("value", outputRichType);
|
|
12
|
+
this.isValid = this.registerDataOutput("isValid", RichTypeBoolean);
|
|
11
13
|
}
|
|
12
14
|
_updateOutputs(context) {
|
|
13
15
|
const cachedExecutionId = context._getExecutionVariable(this, cacheExecIdName, -1);
|
|
14
16
|
const cachedValue = context._getExecutionVariable(this, cacheName, null);
|
|
15
17
|
if (cachedValue !== undefined && cachedValue !== null && cachedExecutionId === context.executionId) {
|
|
18
|
+
this.isValid.setValue(true, context);
|
|
16
19
|
this.value.setValue(cachedValue, context);
|
|
17
20
|
}
|
|
18
21
|
else {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
try {
|
|
23
|
+
const calculatedValue = this._doOperation(context);
|
|
24
|
+
if (calculatedValue === undefined || calculatedValue === null) {
|
|
25
|
+
this.isValid.setValue(false, context);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
context._setExecutionVariable(this, cacheName, calculatedValue);
|
|
29
|
+
context._setExecutionVariable(this, cacheExecIdName, context.executionId);
|
|
30
|
+
this.value.setValue(calculatedValue, context);
|
|
31
|
+
this.isValid.setValue(true, context);
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
this.isValid.setValue(false, context);
|
|
35
|
+
}
|
|
23
36
|
}
|
|
24
37
|
}
|
|
25
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphCachedOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"flowGraphCachedOperationBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,MAAM,SAAS,GAAG,sBAAsB,CAAC;AACzC,MAAM,eAAe,GAAG,mBAAmB,CAAC;AAE5C;;GAEG;AACH,MAAM,OAAgB,6BAAuC,SAAQ,cAAc;IAW/E,YAAY,cAAiC,EAAE,MAAqC;QAChF,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAC9D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;IACvE,CAAC;IASe,cAAc,CAAC,OAAyB;QACpD,MAAM,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC;QACnF,MAAM,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAoB,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC;QAC5F,IAAI,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,IAAI,IAAI,iBAAiB,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC;YACjG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACrC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC;gBACD,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;gBACnD,IAAI,eAAe,KAAK,SAAS,IAAI,eAAe,KAAK,IAAI,EAAE,CAAC;oBAC5D,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;oBACtC,OAAO;gBACX,CAAC;gBACD,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;gBAChE,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;gBAC1E,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;gBAC9C,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACzC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACT,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;YAC1C,CAAC;QACL,CAAC;IACL,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../../../types\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../flowGraphBlock\";\r\nimport { FlowGraphBlock } from \"../../flowGraphBlock\";\r\nimport type { FlowGraphContext } from \"../../flowGraphContext\";\r\nimport type { FlowGraphDataConnection } from \"../../flowGraphDataConnection\";\r\nimport type { RichType } from \"../../flowGraphRichTypes\";\r\nimport { RichTypeBoolean } from \"../../flowGraphRichTypes\";\r\n\r\nconst cacheName = \"cachedOperationValue\";\r\nconst cacheExecIdName = \"cachedExecutionId\";\r\n\r\n/**\r\n * A block that will cache the result of an operation and deliver it as an output.\r\n */\r\nexport abstract class FlowGraphCachedOperationBlock<OutputT> extends FlowGraphBlock {\r\n /**\r\n * The output of the operation\r\n */\r\n public readonly value: FlowGraphDataConnection<OutputT>;\r\n\r\n /**\r\n * Output connection: Whether the value is valid.\r\n */\r\n public readonly isValid: FlowGraphDataConnection<boolean>;\r\n\r\n constructor(outputRichType: RichType<OutputT>, config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.value = this.registerDataOutput(\"value\", outputRichType);\r\n this.isValid = this.registerDataOutput(\"isValid\", RichTypeBoolean);\r\n }\r\n\r\n /**\r\n * @internal\r\n * Operation to realize\r\n * @param context the graph context\r\n */\r\n public abstract _doOperation(context: FlowGraphContext): OutputT | undefined;\r\n\r\n public override _updateOutputs(context: FlowGraphContext) {\r\n const cachedExecutionId = context._getExecutionVariable(this, cacheExecIdName, -1);\r\n const cachedValue = context._getExecutionVariable<Nullable<OutputT>>(this, cacheName, null);\r\n if (cachedValue !== undefined && cachedValue !== null && cachedExecutionId === context.executionId) {\r\n this.isValid.setValue(true, context);\r\n this.value.setValue(cachedValue, context);\r\n } else {\r\n try {\r\n const calculatedValue = this._doOperation(context);\r\n if (calculatedValue === undefined || calculatedValue === null) {\r\n this.isValid.setValue(false, context);\r\n return;\r\n }\r\n context._setExecutionVariable(this, cacheName, calculatedValue);\r\n context._setExecutionVariable(this, cacheExecIdName, context.executionId);\r\n this.value.setValue(calculatedValue, context);\r\n this.isValid.setValue(true, context);\r\n } catch (e) {\r\n this.isValid.setValue(false, context);\r\n }\r\n }\r\n }\r\n}\r\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { AssetType, FlowGraphAssetType } from "../../flowGraphAssetsContext.js";
|
|
2
2
|
import type { IFlowGraphBlockConfiguration } from "../../flowGraphBlock.js";
|
|
3
|
-
import { FlowGraphBlock } from "../../flowGraphBlock.js";
|
|
4
3
|
import type { FlowGraphContext } from "../../flowGraphContext.js";
|
|
5
4
|
import type { FlowGraphDataConnection } from "../../flowGraphDataConnection.js";
|
|
5
|
+
import { FlowGraphCachedOperationBlock } from "./flowGraphCachedOperationBlock";
|
|
6
6
|
export interface IFlowGraphGetPropertyBlockConfiguration<O extends FlowGraphAssetType> extends IFlowGraphBlockConfiguration {
|
|
7
7
|
/**
|
|
8
8
|
* The name of the property that will be set
|
|
@@ -25,15 +25,11 @@ export interface IFlowGraphGetPropertyBlockConfiguration<O extends FlowGraphAsse
|
|
|
25
25
|
*
|
|
26
26
|
* 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.
|
|
27
27
|
*/
|
|
28
|
-
export declare class FlowGraphGetPropertyBlock<P extends any, O extends FlowGraphAssetType> extends
|
|
28
|
+
export declare class FlowGraphGetPropertyBlock<P extends any, O extends FlowGraphAssetType> extends FlowGraphCachedOperationBlock<P> {
|
|
29
29
|
/**
|
|
30
30
|
* the configuration of the block
|
|
31
31
|
*/
|
|
32
32
|
config: IFlowGraphGetPropertyBlockConfiguration<O>;
|
|
33
|
-
/**
|
|
34
|
-
* Output connection: The value of the property.
|
|
35
|
-
*/
|
|
36
|
-
readonly value: FlowGraphDataConnection<P>;
|
|
37
33
|
/**
|
|
38
34
|
* Input connection: The asset from which the property will be retrieved
|
|
39
35
|
*/
|
|
@@ -42,10 +38,6 @@ export declare class FlowGraphGetPropertyBlock<P extends any, O extends FlowGrap
|
|
|
42
38
|
* Input connection: The name of the property that will be set
|
|
43
39
|
*/
|
|
44
40
|
readonly propertyName: FlowGraphDataConnection<string>;
|
|
45
|
-
/**
|
|
46
|
-
* Output connection: Whether the value is valid.
|
|
47
|
-
*/
|
|
48
|
-
readonly isValid: FlowGraphDataConnection<boolean>;
|
|
49
41
|
/**
|
|
50
42
|
* Input connection: A function that can be used to get the value of the property.
|
|
51
43
|
* This will be used if defined, instead of the default get function.
|
|
@@ -56,7 +48,7 @@ export declare class FlowGraphGetPropertyBlock<P extends any, O extends FlowGrap
|
|
|
56
48
|
* the configuration of the block
|
|
57
49
|
*/
|
|
58
50
|
config: IFlowGraphGetPropertyBlockConfiguration<O>);
|
|
59
|
-
|
|
51
|
+
_doOperation(context: FlowGraphContext): P | undefined;
|
|
60
52
|
private _getPropertyValue;
|
|
61
53
|
getClassName(): string;
|
|
62
54
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FlowGraphBlock } from "../../flowGraphBlock.js";
|
|
2
1
|
import { RichTypeAny } from "../../flowGraphRichTypes.js";
|
|
3
2
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
3
|
+
import { FlowGraphCachedOperationBlock } from "./flowGraphCachedOperationBlock.js";
|
|
4
4
|
/**
|
|
5
5
|
* This block will deliver a property of an asset, based on the property name and an input asset.
|
|
6
6
|
* The property name can include dots ("."), which will be interpreted as a path to the property.
|
|
@@ -9,21 +9,19 @@ import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
|
9
9
|
*
|
|
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
|
-
export class FlowGraphGetPropertyBlock extends
|
|
12
|
+
export class FlowGraphGetPropertyBlock extends FlowGraphCachedOperationBlock {
|
|
13
13
|
constructor(
|
|
14
14
|
/**
|
|
15
15
|
* the configuration of the block
|
|
16
16
|
*/
|
|
17
17
|
config) {
|
|
18
|
-
super(config);
|
|
18
|
+
super(RichTypeAny, config);
|
|
19
19
|
this.config = config;
|
|
20
20
|
this.object = this.registerDataInput("object", RichTypeAny, config.object);
|
|
21
21
|
this.propertyName = this.registerDataInput("propertyName", RichTypeAny, config.propertyName);
|
|
22
|
-
this.value = this.registerDataOutput("value", RichTypeAny);
|
|
23
|
-
this.isValid = this.registerDataOutput("isValid", RichTypeAny, false);
|
|
24
22
|
this.customGetFunction = this.registerDataInput("customGetFunction", RichTypeAny);
|
|
25
23
|
}
|
|
26
|
-
|
|
24
|
+
_doOperation(context) {
|
|
27
25
|
const getter = this.customGetFunction.getValue(context);
|
|
28
26
|
let value;
|
|
29
27
|
if (getter) {
|
|
@@ -34,14 +32,7 @@ export class FlowGraphGetPropertyBlock extends FlowGraphBlock {
|
|
|
34
32
|
const propertyName = this.propertyName.getValue(context);
|
|
35
33
|
value = target && propertyName ? this._getPropertyValue(target, propertyName) : undefined;
|
|
36
34
|
}
|
|
37
|
-
|
|
38
|
-
this.value.resetToDefaultValue(context);
|
|
39
|
-
this.isValid.setValue(false, context);
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
this.value.setValue(value, context);
|
|
43
|
-
this.isValid.setValue(true, context);
|
|
44
|
-
}
|
|
35
|
+
return value;
|
|
45
36
|
}
|
|
46
37
|
_getPropertyValue(target, propertyName) {
|
|
47
38
|
const path = propertyName.split(".");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphGetPropertyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.ts"],"names":[],"mappings":"
|
|
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"]}
|
|
@@ -52,6 +52,7 @@ export interface IFlowGraphMatrix<VectorType> {
|
|
|
52
52
|
multiplyToRef(other: IFlowGraphMatrix<VectorType>, result: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;
|
|
53
53
|
/**
|
|
54
54
|
* Multiplies this matrix with another matrix.
|
|
55
|
+
* To staz conform with the Matrix class, this does B * A
|
|
55
56
|
*
|
|
56
57
|
* @param other - The matrix to multiply with.
|
|
57
58
|
* @returns The result matrix.
|
|
@@ -34,13 +34,14 @@ export class FlowGraphMatrix2D {
|
|
|
34
34
|
return this;
|
|
35
35
|
}
|
|
36
36
|
multiplyToRef(other, result) {
|
|
37
|
-
const
|
|
38
|
-
const
|
|
37
|
+
const otherMatrix = other._m;
|
|
38
|
+
const thisMatrix = this._m;
|
|
39
39
|
const r = result._m;
|
|
40
|
-
|
|
41
|
-
r[
|
|
42
|
-
r[
|
|
43
|
-
r[
|
|
40
|
+
// other * this
|
|
41
|
+
r[0] = otherMatrix[0] * thisMatrix[0] + otherMatrix[1] * thisMatrix[2];
|
|
42
|
+
r[1] = otherMatrix[0] * thisMatrix[1] + otherMatrix[1] * thisMatrix[3];
|
|
43
|
+
r[2] = otherMatrix[2] * thisMatrix[0] + otherMatrix[3] * thisMatrix[2];
|
|
44
|
+
r[3] = otherMatrix[2] * thisMatrix[1] + otherMatrix[3] * thisMatrix[3];
|
|
44
45
|
return result;
|
|
45
46
|
}
|
|
46
47
|
multiply(other) {
|
|
@@ -138,18 +139,18 @@ export class FlowGraphMatrix3D {
|
|
|
138
139
|
return result;
|
|
139
140
|
}
|
|
140
141
|
multiplyToRef(other, result) {
|
|
141
|
-
const
|
|
142
|
-
const
|
|
142
|
+
const otherMatrix = other._m;
|
|
143
|
+
const thisMatrix = this._m;
|
|
143
144
|
const r = result.m;
|
|
144
|
-
r[0] =
|
|
145
|
-
r[1] =
|
|
146
|
-
r[2] =
|
|
147
|
-
r[3] =
|
|
148
|
-
r[4] =
|
|
149
|
-
r[5] =
|
|
150
|
-
r[6] =
|
|
151
|
-
r[7] =
|
|
152
|
-
r[8] =
|
|
145
|
+
r[0] = otherMatrix[0] * thisMatrix[0] + otherMatrix[1] * thisMatrix[3] + otherMatrix[2] * thisMatrix[6];
|
|
146
|
+
r[1] = otherMatrix[0] * thisMatrix[1] + otherMatrix[1] * thisMatrix[4] + otherMatrix[2] * thisMatrix[7];
|
|
147
|
+
r[2] = otherMatrix[0] * thisMatrix[2] + otherMatrix[1] * thisMatrix[5] + otherMatrix[2] * thisMatrix[8];
|
|
148
|
+
r[3] = otherMatrix[3] * thisMatrix[0] + otherMatrix[4] * thisMatrix[3] + otherMatrix[5] * thisMatrix[6];
|
|
149
|
+
r[4] = otherMatrix[3] * thisMatrix[1] + otherMatrix[4] * thisMatrix[4] + otherMatrix[5] * thisMatrix[7];
|
|
150
|
+
r[5] = otherMatrix[3] * thisMatrix[2] + otherMatrix[4] * thisMatrix[5] + otherMatrix[5] * thisMatrix[8];
|
|
151
|
+
r[6] = otherMatrix[6] * thisMatrix[0] + otherMatrix[7] * thisMatrix[3] + otherMatrix[8] * thisMatrix[6];
|
|
152
|
+
r[7] = otherMatrix[6] * thisMatrix[1] + otherMatrix[7] * thisMatrix[4] + otherMatrix[8] * thisMatrix[7];
|
|
153
|
+
r[8] = otherMatrix[6] * thisMatrix[2] + otherMatrix[7] * thisMatrix[5] + otherMatrix[8] * thisMatrix[8];
|
|
153
154
|
return result;
|
|
154
155
|
}
|
|
155
156
|
multiply(other) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphMatrix.js","sourceRoot":"","sources":["../../../../../dev/core/src/FlowGraph/CustomTypes/flowGraphMatrix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mCAA+B;AA8J1D,wGAAwG;AAExG;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAM1B,YAAY,IAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IAChB,CAAC;IAED,IAAW,CAAC;QACR,OAAO,IAAI,CAAC,EAAE,CAAC;IACnB,CAAC;IAEM,eAAe,CAAC,CAAU;QAC7B,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;IACvD,CAAC;IAEM,oBAAoB,CAAC,CAAU,EAAE,MAAe;QACnD,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/C,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/C,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,OAAO;QACV,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;IAEM,OAAO,CAAC,aAAuB,EAAE;QACpC,KAAK,I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AAC,CAAC,GAAG,OAAO;YAC/B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO;YAC/B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAClC,CAAC;IACN,CAAC;IAEM,YAAY;QACf,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,QAAQ;QACX,OAAO,qBAAqB,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IACtD,CAAC;CACJ","sourcesContent":["import { Vector3, Vector2 } from \"core/Maths/math.vector\";\n\n/**\n * Interface representing a generic flow graph matrix.\n */\nexport interface IFlowGraphMatrix<VectorType> {\n /**\n * The matrix elements stored in a row-major order.\n */\n m: number[];\n\n /**\n * Transforms a vector using this matrix.\n *\n * @param v - The vector to transform.\n * @returns The transformed vector.\n */\n transformVector(v: VectorType): VectorType;\n\n /**\n * Transforms a vector using this matrix and stores the result in a reference vector.\n *\n * @param v - The vector to transform.\n * @param result - The vector to store the result.\n * @returns The transformed vector.\n */\n transformVectorToRef(v: VectorType, result: VectorType): VectorType;\n\n /**\n * Returns the matrix elements as an array.\n *\n * @returns The matrix elements as an array.\n */\n asArray(): number[];\n\n /**\n * Copies the matrix elements to an array.\n *\n * @param emptyArray - The array to copy the elements to.\n * @returns The array with the matrix elements.\n */\n toArray(emptyArray: number[]): number[];\n\n /**\n * Sets the matrix elements from an array.\n *\n * @param array - The array containing the matrix elements.\n * @returns The updated matrix.\n */\n fromArray(array: number[]): IFlowGraphMatrix<VectorType>;\n\n /**\n * Multiplies this matrix with another matrix and stores the result in a reference matrix.\n *\n * @param other - The matrix to multiply with.\n * @param result - The matrix to store the result.\n * @returns The result matrix.\n */\n multiplyToRef(other: IFlowGraphMatrix<VectorType>, result: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Multiplies this matrix with another matrix.\n *\n * @param other - The matrix to multiply with.\n * @returns The result matrix.\n */\n multiply(other: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Divides this matrix by another matrix and stores the result in a reference matrix.\n *\n * @param other - The matrix to divide by.\n * @param result - The matrix to store the result.\n * @returns The result matrix.\n */\n divideToRef(other: IFlowGraphMatrix<VectorType>, result: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Divides this matrix by another matrix.\n *\n * @param other - The matrix to divide by.\n * @returns The result matrix.\n */\n divide(other: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Adds another matrix to this matrix and stores the result in a reference matrix.\n *\n * @param other - The matrix to add.\n * @param result - The matrix to store the result.\n * @returns The result matrix.\n */\n addToRef(other: IFlowGraphMatrix<VectorType>, result: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Adds another matrix to this matrix.\n *\n * @param other - The matrix to add.\n * @returns The result matrix.\n */\n add(other: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Subtracts another matrix from this matrix and stores the result in a reference matrix.\n *\n * @param other - The matrix to subtract.\n * @param result - The matrix to store the result.\n * @returns The result matrix.\n */\n subtractToRef(other: IFlowGraphMatrix<VectorType>, result: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Subtracts another matrix from this matrix.\n *\n * @param other - The matrix to subtract.\n * @returns The result matrix.\n */\n subtract(other: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Transposes this matrix.\n *\n * @returns The transposed matrix.\n */\n transpose(): IFlowGraphMatrix<VectorType>;\n\n /**\n * Computes the determinant of this matrix.\n *\n * @returns The determinant of the matrix.\n */\n determinant(): number;\n\n /**\n * Computes the inverse of this matrix.\n *\n * @returns The inverse of the matrix.\n * @throws Error if the matrix is not invertible.\n */\n inverse(): IFlowGraphMatrix<VectorType>;\n\n /**\n * Gets the class name of this matrix.\n *\n * @returns The class name.\n */\n getClassName(): string;\n\n /**\n * Checks if this matrix is equal to another matrix within an optional epsilon.\n *\n * @param other - The matrix to compare with.\n * @param epsilon - The optional epsilon for comparison.\n * @returns True if the matrices are equal, false otherwise.\n */\n equals(other: IFlowGraphMatrix<VectorType>, epsilon?: number): boolean;\n}\n\n// Note - the matrix classes are basically column-major, and work similarly to Babylon.js' Matrix class.\n\n/**\n * A 2x2 matrix.\n */\nexport class FlowGraphMatrix2D implements IFlowGraphMatrix<Vector2> {\n /**\n * @internal\n */\n public _m: number[];\n\n constructor(m: number[] = [1, 0, 0, 1]) {\n this._m = m;\n }\n\n public get m(): number[] {\n return this._m;\n }\n\n public transformVector(v: Vector2): Vector2 {\n return this.transformVectorToRef(v, new Vector2());\n }\n\n public transformVectorToRef(v: Vector2, result: Vector2): Vector2 {\n result.x = v.x * this._m[0] + v.y * this._m[1];\n result.y = v.x * this._m[2] + v.y * this._m[3];\n return result;\n }\n\n public asArray(): number[] {\n return this.toArray();\n }\n\n public toArray(emptyArray: number[] = []): number[] {\n for (let i = 0; i < 4; i++) {\n emptyArray[i] = this._m[i];\n }\n return emptyArray;\n }\n\n public fromArray(array: number[]): FlowGraphMatrix2D {\n for (let i = 0; i < 4; i++) {\n this._m[i] = array[i];\n }\n return this;\n }\n\n public multiplyToRef(other: FlowGraphMatrix2D, result: FlowGraphMatrix2D): FlowGraphMatrix2D {\n const m = this._m;\n const o = other._m;\n const r = result._m;\n\n r[0] = m[0] * o[0] + m[1] * o[2];\n r[1] = m[0] * o[1] + m[1] * o[3];\n r[2] = m[2] * o[0] + m[3] * o[2];\n r[3] = m[2] * o[1] + m[3] * o[3];\n\n return result;\n }\n\n public multiply(other: FlowGraphMatrix2D): FlowGraphMatrix2D {\n return this.multiplyToRef(other, new FlowGraphMatrix2D());\n }\n\n public divideToRef(other: FlowGraphMatrix2D, result: FlowGraphMatrix2D): FlowGraphMatrix2D {\n const m = this._m;\n const o = other._m;\n const r = result._m;\n\n r[0] = m[0] / o[0];\n r[1] = m[1] / o[1];\n r[2] = m[2] / o[2];\n r[3] = m[3] / o[3];\n\n return result;\n }\n\n public divide(other: FlowGraphMatrix2D): FlowGraphMatrix2D {\n return this.divideToRef(other, new FlowGraphMatrix2D());\n }\n\n public addToRef(other: FlowGraphMatrix2D, result: FlowGraphMatrix2D): FlowGraphMatrix2D {\n const m = this._m;\n const o = other.m;\n const r = result.m;\n\n r[0] = m[0] + o[0];\n r[1] = m[1] + o[1];\n r[2] = m[2] + o[2];\n r[3] = m[3] + o[3];\n\n return result;\n }\n\n public add(other: FlowGraphMatrix2D): FlowGraphMatrix2D {\n return this.addToRef(other, new FlowGraphMatrix2D());\n }\n\n public subtractToRef(other: FlowGraphMatrix2D, result: FlowGraphMatrix2D): FlowGraphMatrix2D {\n const m = this._m;\n const o = other.m;\n const r = result.m;\n\n r[0] = m[0] - o[0];\n r[1] = m[1] - o[1];\n r[2] = m[2] - o[2];\n r[3] = m[3] - o[3];\n\n return result;\n }\n\n public subtract(other: FlowGraphMatrix2D): FlowGraphMatrix2D {\n return this.subtractToRef(other, new FlowGraphMatrix2D());\n }\n\n public transpose(): FlowGraphMatrix2D {\n const m = this._m;\n return new FlowGraphMatrix2D([m[0], m[2], m[1], m[3]]);\n }\n\n public determinant(): number {\n const m = this._m;\n return m[0] * m[3] - m[1] * m[2];\n }\n\n public inverse(): FlowGraphMatrix2D {\n const det = this.determinant();\n if (det === 0) {\n throw new Error(\"Matrix is not invertible\");\n }\n const m = this._m;\n const invDet = 1 / det;\n return new FlowGraphMatrix2D([m[3] * invDet, -m[1] * invDet, -m[2] * invDet, m[0] * invDet]);\n }\n\n public equals(other: IFlowGraphMatrix<Vector2>, epsilon: number = 0): boolean {\n const m = this._m;\n const o = other.m;\n if (epsilon === 0) {\n return m[0] === o[0] && m[1] === o[1] && m[2] === o[2] && m[3] === o[3];\n }\n return Math.abs(m[0] - o[0]) < epsilon && Math.abs(m[1] - o[1]) < epsilon && Math.abs(m[2] - o[2]) < epsilon && Math.abs(m[3] - o[3]) < epsilon;\n }\n\n public getClassName(): string {\n return \"FlowGraphMatrix2D\";\n }\n\n public toString(): string {\n return `FlowGraphMatrix2D(${this._m.join(\", \")})`;\n }\n}\n\n/**\n * A 3x3 matrix.\n */\nexport class FlowGraphMatrix3D implements IFlowGraphMatrix<Vector3> {\n /**\n * @internal\n */\n public _m: number[];\n\n constructor(array: number[] = [1, 0, 0, 0, 1, 0, 0, 0, 1]) {\n this._m = array;\n }\n\n public get m(): number[] {\n return this._m;\n }\n\n public transformVector(v: Vector3): Vector3 {\n return this.transformVectorToRef(v, new Vector3());\n }\n\n public transformVectorToRef(v: Vector3, result: Vector3): Vector3 {\n const m = this._m;\n result.x = v.x * m[0] + v.y * m[1] + v.z * m[2];\n result.y = v.x * m[3] + v.y * m[4] + v.z * m[5];\n result.z = v.x * m[6] + v.y * m[7] + v.z * m[8];\n return result;\n }\n\n public multiplyToRef(other: FlowGraphMatrix3D, result: FlowGraphMatrix3D): FlowGraphMatrix3D {\n const m = this._m;\n const o = other.m;\n const r = result.m;\n\n r[0] = m[0] * o[0] + m[1] * o[3] + m[2] * o[6];\n r[1] = m[0] * o[1] + m[1] * o[4] + m[2] * o[7];\n r[2] = m[0] * o[2] + m[1] * o[5] + m[2] * o[8];\n\n r[3] = m[3] * o[0] + m[4] * o[3] + m[5] * o[6];\n r[4] = m[3] * o[1] + m[4] * o[4] + m[5] * o[7];\n r[5] = m[3] * o[2] + m[4] * o[5] + m[5] * o[8];\n\n r[6] = m[6] * o[0] + m[7] * o[3] + m[8] * o[6];\n r[7] = m[6] * o[1] + m[7] * o[4] + m[8] * o[7];\n r[8] = m[6] * o[2] + m[7] * o[5] + m[8] * o[8];\n\n return result;\n }\n\n public multiply(other: FlowGraphMatrix3D): FlowGraphMatrix3D {\n return this.multiplyToRef(other, new FlowGraphMatrix3D());\n }\n\n public divideToRef(other: FlowGraphMatrix3D, result: FlowGraphMatrix3D): FlowGraphMatrix3D {\n const m = this._m;\n const o = other.m;\n const r = result.m;\n\n r[0] = m[0] / o[0];\n r[1] = m[1] / o[1];\n r[2] = m[2] / o[2];\n r[3] = m[3] / o[3];\n r[4] = m[4] / o[4];\n r[5] = m[5] / o[5];\n r[6] = m[6] / o[6];\n r[7] = m[7] / o[7];\n r[8] = m[8] / o[8];\n\n return result;\n }\n\n public divide(other: FlowGraphMatrix3D): FlowGraphMatrix3D {\n return this.divideToRef(other, new FlowGraphMatrix3D());\n }\n\n public addToRef(other: FlowGraphMatrix3D, result: FlowGraphMatrix3D): FlowGraphMatrix3D {\n const m = this._m;\n const o = other.m;\n const r = result.m;\n\n r[0] = m[0] + o[0];\n r[1] = m[1] + o[1];\n r[2] = m[2] + o[2];\n r[3] = m[3] + o[3];\n r[4] = m[4] + o[4];\n r[5] = m[5] + o[5];\n r[6] = m[6] + o[6];\n r[7] = m[7] + o[7];\n r[8] = m[8] + o[8];\n\n return result;\n }\n\n public add(other: FlowGraphMatrix3D): FlowGraphMatrix3D {\n return this.addToRef(other, new FlowGraphMatrix3D());\n }\n\n public subtractToRef(other: FlowGraphMatrix3D, result: FlowGraphMatrix3D): FlowGraphMatrix3D {\n const m = this._m;\n const o = other.m;\n const r = result.m;\n\n r[0] = m[0] - o[0];\n r[1] = m[1] - o[1];\n r[2] = m[2] - o[2];\n r[3] = m[3] - o[3];\n r[4] = m[4] - o[4];\n r[5] = m[5] - o[5];\n r[6] = m[6] - o[6];\n r[7] = m[7] - o[7];\n r[8] = m[8] - o[8];\n\n return result;\n }\n\n public subtract(other: FlowGraphMatrix3D): FlowGraphMatrix3D {\n return this.subtractToRef(other, new FlowGraphMatrix3D());\n }\n\n public toArray(emptyArray: number[] = []): number[] {\n for (let i = 0; i < 9; i++) {\n emptyArray[i] = this._m[i];\n }\n return emptyArray;\n }\n\n public asArray(): number[] {\n return this.toArray();\n }\n\n public fromArray(array: number[]): FlowGraphMatrix3D {\n for (let i = 0; i < 9; i++) {\n this._m[i] = array[i];\n }\n return this;\n }\n\n public transpose(): FlowGraphMatrix3D {\n const m = this._m;\n return new FlowGraphMatrix3D([m[0], m[3], m[6], m[1], m[4], m[7], m[2], m[5], m[8]]);\n }\n\n public determinant(): number {\n const m = this._m;\n return m[0] * (m[4] * m[8] - m[5] * m[7]) - m[1] * (m[3] * m[8] - m[5] * m[6]) + m[2] * (m[3] * m[7] - m[4] * m[6]);\n }\n\n public inverse(): FlowGraphMatrix3D {\n const det = this.determinant();\n if (det === 0) {\n throw new Error(\"Matrix is not invertible\");\n }\n const m = this._m;\n const invDet = 1 / det;\n return new FlowGraphMatrix3D([\n (m[4] * m[8] - m[5] * m[7]) * invDet,\n (m[2] * m[7] - m[1] * m[8]) * invDet,\n (m[1] * m[5] - m[2] * m[4]) * invDet,\n (m[5] * m[6] - m[3] * m[8]) * invDet,\n (m[0] * m[8] - m[2] * m[6]) * invDet,\n (m[2] * m[3] - m[0] * m[5]) * invDet,\n (m[3] * m[7] - m[4] * m[6]) * invDet,\n (m[1] * m[6] - m[0] * m[7]) * invDet,\n (m[0] * m[4] - m[1] * m[3]) * invDet,\n ]);\n }\n\n public equals(other: IFlowGraphMatrix<Vector3>, epsilon: number = 0): boolean {\n const m = this._m;\n const o = other.m;\n // performance shortcut\n if (epsilon === 0) {\n return m[0] === o[0] && m[1] === o[1] && m[2] === o[2] && m[3] === o[3] && m[4] === o[4] && m[5] === o[5] && m[6] === o[6] && m[7] === o[7] && m[8] === o[8];\n }\n return (\n Math.abs(m[0] - o[0]) < epsilon &&\n Math.abs(m[1] - o[1]) < epsilon &&\n Math.abs(m[2] - o[2]) < epsilon &&\n Math.abs(m[3] - o[3]) < epsilon &&\n Math.abs(m[4] - o[4]) < epsilon &&\n Math.abs(m[5] - o[5]) < epsilon &&\n Math.abs(m[6] - o[6]) < epsilon &&\n Math.abs(m[7] - o[7]) < epsilon &&\n Math.abs(m[8] - o[8]) < epsilon\n );\n }\n\n public getClassName(): string {\n return \"FlowGraphMatrix3D\";\n }\n\n public toString(): string {\n return `FlowGraphMatrix3D(${this._m.join(\", \")})`;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"flowGraphMatrix.js","sourceRoot":"","sources":["../../../../../dev/core/src/FlowGraph/CustomTypes/flowGraphMatrix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,mCAA+B;AA+J1D,wGAAwG;AAExG;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAM1B,YAAY,IAAc,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IAChB,CAAC;IAED,IAAW,CAAC;QACR,OAAO,IAAI,CAAC,EAAE,CAAC;IACnB,CAAC;IAEM,eAAe,CAAC,CAAU;QAC7B,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;IACvD,CAAC;IAEM,oBAAoB,CAAC,CAAU,EAAE,MAAe;QACnD,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/C,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/C,OAAO,MAAM,CAAC;IAClB,CAAC;IAEM,OAAO;QACV,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;IAEM,OAAO,CAAC,aAAuB,EAAE;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC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CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO;YAC/B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAClC,CAAC;IACN,CAAC;IAEM,YAAY;QACf,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,QAAQ;QACX,OAAO,qBAAqB,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IACtD,CAAC;CACJ","sourcesContent":["import { Vector3, Vector2 } from \"core/Maths/math.vector\";\n\n/**\n * Interface representing a generic flow graph matrix.\n */\nexport interface IFlowGraphMatrix<VectorType> {\n /**\n * The matrix elements stored in a row-major order.\n */\n m: number[];\n\n /**\n * Transforms a vector using this matrix.\n *\n * @param v - The vector to transform.\n * @returns The transformed vector.\n */\n transformVector(v: VectorType): VectorType;\n\n /**\n * Transforms a vector using this matrix and stores the result in a reference vector.\n *\n * @param v - The vector to transform.\n * @param result - The vector to store the result.\n * @returns The transformed vector.\n */\n transformVectorToRef(v: VectorType, result: VectorType): VectorType;\n\n /**\n * Returns the matrix elements as an array.\n *\n * @returns The matrix elements as an array.\n */\n asArray(): number[];\n\n /**\n * Copies the matrix elements to an array.\n *\n * @param emptyArray - The array to copy the elements to.\n * @returns The array with the matrix elements.\n */\n toArray(emptyArray: number[]): number[];\n\n /**\n * Sets the matrix elements from an array.\n *\n * @param array - The array containing the matrix elements.\n * @returns The updated matrix.\n */\n fromArray(array: number[]): IFlowGraphMatrix<VectorType>;\n\n /**\n * Multiplies this matrix with another matrix and stores the result in a reference matrix.\n *\n * @param other - The matrix to multiply with.\n * @param result - The matrix to store the result.\n * @returns The result matrix.\n */\n multiplyToRef(other: IFlowGraphMatrix<VectorType>, result: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Multiplies this matrix with another matrix.\n * To staz conform with the Matrix class, this does B * A\n *\n * @param other - The matrix to multiply with.\n * @returns The result matrix.\n */\n multiply(other: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Divides this matrix by another matrix and stores the result in a reference matrix.\n *\n * @param other - The matrix to divide by.\n * @param result - The matrix to store the result.\n * @returns The result matrix.\n */\n divideToRef(other: IFlowGraphMatrix<VectorType>, result: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Divides this matrix by another matrix.\n *\n * @param other - The matrix to divide by.\n * @returns The result matrix.\n */\n divide(other: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Adds another matrix to this matrix and stores the result in a reference matrix.\n *\n * @param other - The matrix to add.\n * @param result - The matrix to store the result.\n * @returns The result matrix.\n */\n addToRef(other: IFlowGraphMatrix<VectorType>, result: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Adds another matrix to this matrix.\n *\n * @param other - The matrix to add.\n * @returns The result matrix.\n */\n add(other: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Subtracts another matrix from this matrix and stores the result in a reference matrix.\n *\n * @param other - The matrix to subtract.\n * @param result - The matrix to store the result.\n * @returns The result matrix.\n */\n subtractToRef(other: IFlowGraphMatrix<VectorType>, result: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Subtracts another matrix from this matrix.\n *\n * @param other - The matrix to subtract.\n * @returns The result matrix.\n */\n subtract(other: IFlowGraphMatrix<VectorType>): IFlowGraphMatrix<VectorType>;\n\n /**\n * Transposes this matrix.\n *\n * @returns The transposed matrix.\n */\n transpose(): IFlowGraphMatrix<VectorType>;\n\n /**\n * Computes the determinant of this matrix.\n *\n * @returns The determinant of the matrix.\n */\n determinant(): number;\n\n /**\n * Computes the inverse of this matrix.\n *\n * @returns The inverse of the matrix.\n * @throws Error if the matrix is not invertible.\n */\n inverse(): IFlowGraphMatrix<VectorType>;\n\n /**\n * Gets the class name of this matrix.\n *\n * @returns The class name.\n */\n getClassName(): string;\n\n /**\n * Checks if this matrix is equal to another matrix within an optional epsilon.\n *\n * @param other - The matrix to compare with.\n * @param epsilon - The optional epsilon for comparison.\n * @returns True if the matrices are equal, false otherwise.\n */\n equals(other: IFlowGraphMatrix<VectorType>, epsilon?: number): boolean;\n}\n\n// Note - the matrix classes are basically column-major, and work similarly to Babylon.js' Matrix class.\n\n/**\n * A 2x2 matrix.\n */\nexport class FlowGraphMatrix2D implements IFlowGraphMatrix<Vector2> {\n /**\n * @internal\n */\n public _m: number[];\n\n constructor(m: number[] = [1, 0, 0, 1]) {\n this._m = m;\n }\n\n public get m(): number[] {\n return this._m;\n }\n\n public transformVector(v: Vector2): Vector2 {\n return this.transformVectorToRef(v, new Vector2());\n }\n\n public transformVectorToRef(v: Vector2, result: Vector2): Vector2 {\n result.x = v.x * this._m[0] + v.y * this._m[1];\n result.y = v.x * this._m[2] + v.y * this._m[3];\n return result;\n }\n\n public asArray(): number[] {\n return this.toArray();\n }\n\n public toArray(emptyArray: number[] = []): number[] {\n for (let i = 0; i < 4; i++) {\n emptyArray[i] = this._m[i];\n }\n return emptyArray;\n }\n\n public fromArray(array: number[]): FlowGraphMatrix2D {\n for (let i = 0; i < 4; i++) {\n this._m[i] = array[i];\n }\n return this;\n }\n\n public multiplyToRef(other: FlowGraphMatrix2D, result: FlowGraphMatrix2D): FlowGraphMatrix2D {\n const otherMatrix = other._m;\n const thisMatrix = this._m;\n const r = result._m;\n // other * this\n r[0] = otherMatrix[0] * thisMatrix[0] + otherMatrix[1] * thisMatrix[2];\n r[1] = otherMatrix[0] * thisMatrix[1] + otherMatrix[1] * thisMatrix[3];\n r[2] = otherMatrix[2] * thisMatrix[0] + otherMatrix[3] * thisMatrix[2];\n r[3] = otherMatrix[2] * thisMatrix[1] + otherMatrix[3] * thisMatrix[3];\n\n return result;\n }\n\n public multiply(other: FlowGraphMatrix2D): FlowGraphMatrix2D {\n return this.multiplyToRef(other, new FlowGraphMatrix2D());\n }\n\n public divideToRef(other: FlowGraphMatrix2D, result: FlowGraphMatrix2D): FlowGraphMatrix2D {\n const m = this._m;\n const o = other._m;\n const r = result._m;\n\n r[0] = m[0] / o[0];\n r[1] = m[1] / o[1];\n r[2] = m[2] / o[2];\n r[3] = m[3] / o[3];\n\n return result;\n }\n\n public divide(other: FlowGraphMatrix2D): FlowGraphMatrix2D {\n return this.divideToRef(other, new FlowGraphMatrix2D());\n }\n\n public addToRef(other: FlowGraphMatrix2D, result: FlowGraphMatrix2D): FlowGraphMatrix2D {\n const m = this._m;\n const o = other.m;\n const r = result.m;\n\n r[0] = m[0] + o[0];\n r[1] = m[1] + o[1];\n r[2] = m[2] + o[2];\n r[3] = m[3] + o[3];\n\n return result;\n }\n\n public add(other: FlowGraphMatrix2D): FlowGraphMatrix2D {\n return this.addToRef(other, new FlowGraphMatrix2D());\n }\n\n public subtractToRef(other: FlowGraphMatrix2D, result: FlowGraphMatrix2D): FlowGraphMatrix2D {\n const m = this._m;\n const o = other.m;\n const r = result.m;\n\n r[0] = m[0] - o[0];\n r[1] = m[1] - o[1];\n r[2] = m[2] - o[2];\n r[3] = m[3] - o[3];\n\n return result;\n }\n\n public subtract(other: FlowGraphMatrix2D): FlowGraphMatrix2D {\n return this.subtractToRef(other, new FlowGraphMatrix2D());\n }\n\n public transpose(): FlowGraphMatrix2D {\n const m = this._m;\n return new FlowGraphMatrix2D([m[0], m[2], m[1], m[3]]);\n }\n\n public determinant(): number {\n const m = this._m;\n return m[0] * m[3] - m[1] * m[2];\n }\n\n public inverse(): FlowGraphMatrix2D {\n const det = this.determinant();\n if (det === 0) {\n throw new Error(\"Matrix is not invertible\");\n }\n const m = this._m;\n const invDet = 1 / det;\n return new FlowGraphMatrix2D([m[3] * invDet, -m[1] * invDet, -m[2] * invDet, m[0] * invDet]);\n }\n\n public equals(other: IFlowGraphMatrix<Vector2>, epsilon: number = 0): boolean {\n const m = this._m;\n const o = other.m;\n if (epsilon === 0) {\n return m[0] === o[0] && m[1] === o[1] && m[2] === o[2] && m[3] === o[3];\n }\n return Math.abs(m[0] - o[0]) < epsilon && Math.abs(m[1] - o[1]) < epsilon && Math.abs(m[2] - o[2]) < epsilon && Math.abs(m[3] - o[3]) < epsilon;\n }\n\n public getClassName(): string {\n return \"FlowGraphMatrix2D\";\n }\n\n public toString(): string {\n return `FlowGraphMatrix2D(${this._m.join(\", \")})`;\n }\n}\n\n/**\n * A 3x3 matrix.\n */\nexport class FlowGraphMatrix3D implements IFlowGraphMatrix<Vector3> {\n /**\n * @internal\n */\n public _m: number[];\n\n constructor(array: number[] = [1, 0, 0, 0, 1, 0, 0, 0, 1]) {\n this._m = array;\n }\n\n public get m(): number[] {\n return this._m;\n }\n\n public transformVector(v: Vector3): Vector3 {\n return this.transformVectorToRef(v, new Vector3());\n }\n\n public transformVectorToRef(v: Vector3, result: Vector3): Vector3 {\n const m = this._m;\n result.x = v.x * m[0] + v.y * m[1] + v.z * m[2];\n result.y = v.x * m[3] + v.y * m[4] + v.z * m[5];\n result.z = v.x * m[6] + v.y * m[7] + v.z * m[8];\n return result;\n }\n\n public multiplyToRef(other: FlowGraphMatrix3D, result: FlowGraphMatrix3D): FlowGraphMatrix3D {\n const otherMatrix = other._m;\n const thisMatrix = this._m;\n const r = result.m;\n\n r[0] = otherMatrix[0] * thisMatrix[0] + otherMatrix[1] * thisMatrix[3] + otherMatrix[2] * thisMatrix[6];\n r[1] = otherMatrix[0] * thisMatrix[1] + otherMatrix[1] * thisMatrix[4] + otherMatrix[2] * thisMatrix[7];\n r[2] = otherMatrix[0] * thisMatrix[2] + otherMatrix[1] * thisMatrix[5] + otherMatrix[2] * thisMatrix[8];\n\n r[3] = otherMatrix[3] * thisMatrix[0] + otherMatrix[4] * thisMatrix[3] + otherMatrix[5] * thisMatrix[6];\n r[4] = otherMatrix[3] * thisMatrix[1] + otherMatrix[4] * thisMatrix[4] + otherMatrix[5] * thisMatrix[7];\n r[5] = otherMatrix[3] * thisMatrix[2] + otherMatrix[4] * thisMatrix[5] + otherMatrix[5] * thisMatrix[8];\n\n r[6] = otherMatrix[6] * thisMatrix[0] + otherMatrix[7] * thisMatrix[3] + otherMatrix[8] * thisMatrix[6];\n r[7] = otherMatrix[6] * thisMatrix[1] + otherMatrix[7] * thisMatrix[4] + otherMatrix[8] * thisMatrix[7];\n r[8] = otherMatrix[6] * thisMatrix[2] + otherMatrix[7] * thisMatrix[5] + otherMatrix[8] * thisMatrix[8];\n\n return result;\n }\n\n public multiply(other: FlowGraphMatrix3D): FlowGraphMatrix3D {\n return this.multiplyToRef(other, new FlowGraphMatrix3D());\n }\n\n public divideToRef(other: FlowGraphMatrix3D, result: FlowGraphMatrix3D): FlowGraphMatrix3D {\n const m = this._m;\n const o = other.m;\n const r = result.m;\n\n r[0] = m[0] / o[0];\n r[1] = m[1] / o[1];\n r[2] = m[2] / o[2];\n r[3] = m[3] / o[3];\n r[4] = m[4] / o[4];\n r[5] = m[5] / o[5];\n r[6] = m[6] / o[6];\n r[7] = m[7] / o[7];\n r[8] = m[8] / o[8];\n\n return result;\n }\n\n public divide(other: FlowGraphMatrix3D): FlowGraphMatrix3D {\n return this.divideToRef(other, new FlowGraphMatrix3D());\n }\n\n public addToRef(other: FlowGraphMatrix3D, result: FlowGraphMatrix3D): FlowGraphMatrix3D {\n const m = this._m;\n const o = other.m;\n const r = result.m;\n\n r[0] = m[0] + o[0];\n r[1] = m[1] + o[1];\n r[2] = m[2] + o[2];\n r[3] = m[3] + o[3];\n r[4] = m[4] + o[4];\n r[5] = m[5] + o[5];\n r[6] = m[6] + o[6];\n r[7] = m[7] + o[7];\n r[8] = m[8] + o[8];\n\n return result;\n }\n\n public add(other: FlowGraphMatrix3D): FlowGraphMatrix3D {\n return this.addToRef(other, new FlowGraphMatrix3D());\n }\n\n public subtractToRef(other: FlowGraphMatrix3D, result: FlowGraphMatrix3D): FlowGraphMatrix3D {\n const m = this._m;\n const o = other.m;\n const r = result.m;\n\n r[0] = m[0] - o[0];\n r[1] = m[1] - o[1];\n r[2] = m[2] - o[2];\n r[3] = m[3] - o[3];\n r[4] = m[4] - o[4];\n r[5] = m[5] - o[5];\n r[6] = m[6] - o[6];\n r[7] = m[7] - o[7];\n r[8] = m[8] - o[8];\n\n return result;\n }\n\n public subtract(other: FlowGraphMatrix3D): FlowGraphMatrix3D {\n return this.subtractToRef(other, new FlowGraphMatrix3D());\n }\n\n public toArray(emptyArray: number[] = []): number[] {\n for (let i = 0; i < 9; i++) {\n emptyArray[i] = this._m[i];\n }\n return emptyArray;\n }\n\n public asArray(): number[] {\n return this.toArray();\n }\n\n public fromArray(array: number[]): FlowGraphMatrix3D {\n for (let i = 0; i < 9; i++) {\n this._m[i] = array[i];\n }\n return this;\n }\n\n public transpose(): FlowGraphMatrix3D {\n const m = this._m;\n return new FlowGraphMatrix3D([m[0], m[3], m[6], m[1], m[4], m[7], m[2], m[5], m[8]]);\n }\n\n public determinant(): number {\n const m = this._m;\n return m[0] * (m[4] * m[8] - m[5] * m[7]) - m[1] * (m[3] * m[8] - m[5] * m[6]) + m[2] * (m[3] * m[7] - m[4] * m[6]);\n }\n\n public inverse(): FlowGraphMatrix3D {\n const det = this.determinant();\n if (det === 0) {\n throw new Error(\"Matrix is not invertible\");\n }\n const m = this._m;\n const invDet = 1 / det;\n return new FlowGraphMatrix3D([\n (m[4] * m[8] - m[5] * m[7]) * invDet,\n (m[2] * m[7] - m[1] * m[8]) * invDet,\n (m[1] * m[5] - m[2] * m[4]) * invDet,\n (m[5] * m[6] - m[3] * m[8]) * invDet,\n (m[0] * m[8] - m[2] * m[6]) * invDet,\n (m[2] * m[3] - m[0] * m[5]) * invDet,\n (m[3] * m[7] - m[4] * m[6]) * invDet,\n (m[1] * m[6] - m[0] * m[7]) * invDet,\n (m[0] * m[4] - m[1] * m[3]) * invDet,\n ]);\n }\n\n public equals(other: IFlowGraphMatrix<Vector3>, epsilon: number = 0): boolean {\n const m = this._m;\n const o = other.m;\n // performance shortcut\n if (epsilon === 0) {\n return m[0] === o[0] && m[1] === o[1] && m[2] === o[2] && m[3] === o[3] && m[4] === o[4] && m[5] === o[5] && m[6] === o[6] && m[7] === o[7] && m[8] === o[8];\n }\n return (\n Math.abs(m[0] - o[0]) < epsilon &&\n Math.abs(m[1] - o[1]) < epsilon &&\n Math.abs(m[2] - o[2]) < epsilon &&\n Math.abs(m[3] - o[3]) < epsilon &&\n Math.abs(m[4] - o[4]) < epsilon &&\n Math.abs(m[5] - o[5]) < epsilon &&\n Math.abs(m[6] - o[6]) < epsilon &&\n Math.abs(m[7] - o[7]) < epsilon &&\n Math.abs(m[8] - o[8]) < epsilon\n );\n }\n\n public getClassName(): string {\n return \"FlowGraphMatrix3D\";\n }\n\n public toString(): string {\n return `FlowGraphMatrix3D(${this._m.join(\", \")})`;\n }\n}\n"]}
|
|
@@ -23,7 +23,12 @@ export declare class FlowGraphDataConnection<T> extends FlowGraphConnection<Flow
|
|
|
23
23
|
* [false] if the connection is optional
|
|
24
24
|
*/
|
|
25
25
|
private _optional;
|
|
26
|
-
private
|
|
26
|
+
private _isDisabled;
|
|
27
|
+
/**
|
|
28
|
+
* This is used for debugging purposes! It is the last value that was set to this connection with ANY context.
|
|
29
|
+
* Do not use this value for anything else, as it might be wrong if used in a different context.
|
|
30
|
+
*/
|
|
31
|
+
private _lastValue;
|
|
27
32
|
/**
|
|
28
33
|
* a data transformer function, if needed.
|
|
29
34
|
* This can be used, for example, to force seconds into milliseconds output, if it makes sense in your case.
|
|
@@ -95,6 +100,10 @@ export declare class FlowGraphDataConnection<T> extends FlowGraphConnection<Flow
|
|
|
95
100
|
* @returns the value of the connection
|
|
96
101
|
*/
|
|
97
102
|
getValue(context: FlowGraphContext): T;
|
|
103
|
+
/**
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
106
|
+
_getLastValue(): Nullable<T>;
|
|
98
107
|
/**
|
|
99
108
|
* @returns class name of the object.
|
|
100
109
|
*/
|