@babylonjs/core 6.33.1 → 6.34.0
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/Animations/animationGroup.js +2 -2
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/animationGroupMask.d.ts +4 -0
- package/Animations/animationGroupMask.js +4 -0
- package/Animations/animationGroupMask.js.map +1 -1
- package/Compute/computeShader.d.ts +5 -0
- package/Compute/computeShader.js +42 -32
- package/Compute/computeShader.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js +4 -2
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/engine.d.ts +16 -10
- package/Engines/thinEngine.js +3 -2
- package/Engines/thinEngine.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.d.ts +296 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js +758 -0
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.js.map +1 -0
- package/FlowGraph/Blocks/Data/Math/index.d.ts +1 -5
- package/FlowGraph/Blocks/Data/Math/index.js +1 -5
- package/FlowGraph/Blocks/Data/Math/index.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js +3 -3
- package/FlowGraph/Blocks/Data/flowGraphBinaryOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.d.ts +1 -1
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js +3 -3
- package/FlowGraph/Blocks/Data/flowGraphCachedOperationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js +5 -0
- package/FlowGraph/Blocks/Data/flowGraphConstantBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.d.ts +25 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js +22 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.d.ts +11 -5
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js +12 -6
- package/FlowGraph/Blocks/Data/flowGraphGetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.d.ts +19 -0
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js +22 -0
- package/FlowGraph/Blocks/Data/flowGraphTernaryOperationBlock.js.map +1 -0
- package/FlowGraph/Blocks/Data/index.d.ts +1 -0
- package/FlowGraph/Blocks/Data/index.js +1 -0
- package/FlowGraph/Blocks/Data/index.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.d.ts +10 -5
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js +15 -5
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js +2 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.d.ts +1 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js +3 -2
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPauseAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.d.ts +0 -5
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js +2 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/Audio/flowGraphPlayAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js +2 -2
- package/FlowGraph/Blocks/Execution/Audio/flowGraphStopAudioBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCounterBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDebounceBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.d.ts +13 -5
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js +14 -12
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphDoNBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.d.ts +2 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js +3 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.d.ts +16 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js +26 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSequenceBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js +3 -3
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.d.ts +1 -6
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js +4 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphTimerBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.d.ts +2 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js +4 -4
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWaitAllBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.d.ts +3 -2
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js +6 -5
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphWhileLoopBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/index.d.ts +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/index.js +1 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/index.js.map +1 -1
- package/FlowGraph/Blocks/Execution/{flowGraphLogBlock.d.ts → flowGraphConsoleLogBlock.d.ts} +3 -2
- package/FlowGraph/Blocks/Execution/{flowGraphLogBlock.js → flowGraphConsoleLogBlock.js} +7 -6
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.js.map +1 -0
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.d.ts +16 -8
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js +17 -10
- package/FlowGraph/Blocks/Execution/flowGraphSendCustomEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.d.ts +4 -3
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js +7 -6
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.d.ts +12 -7
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js +10 -9
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.js.map +1 -1
- package/FlowGraph/Blocks/Execution/index.d.ts +1 -2
- package/FlowGraph/Blocks/Execution/index.js +1 -3
- package/FlowGraph/Blocks/Execution/index.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +3 -1
- package/FlowGraph/flowGraph.js +6 -2
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphAsyncExecutionBlock.d.ts +6 -2
- package/FlowGraph/flowGraphAsyncExecutionBlock.js +2 -1
- package/FlowGraph/flowGraphAsyncExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphBlock.d.ts +7 -2
- package/FlowGraph/flowGraphBlock.js +36 -14
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +9 -5
- package/FlowGraph/flowGraphContext.js +7 -2
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +4 -5
- package/FlowGraph/flowGraphCoordinator.js +12 -7
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.js +1 -1
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FlowGraph/flowGraphExecutionBlock.d.ts +3 -2
- package/FlowGraph/flowGraphExecutionBlock.js +7 -11
- package/FlowGraph/flowGraphExecutionBlock.js.map +1 -1
- package/FlowGraph/flowGraphPath.d.ts +20 -2
- package/FlowGraph/flowGraphPath.js +27 -7
- package/FlowGraph/flowGraphPath.js.map +1 -1
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.d.ts +3 -3
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js +3 -3
- package/FlowGraph/flowGraphWithOnDoneExecutionBlock.js.map +1 -1
- package/FlowGraph/index.d.ts +3 -0
- package/FlowGraph/index.js +3 -0
- package/FlowGraph/index.js.map +1 -1
- package/FlowGraph/serialization.js +20 -6
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +33 -0
- package/FlowGraph/typeDefinitions.js +2 -0
- package/FlowGraph/typeDefinitions.js.map +1 -0
- package/Lights/light.d.ts +15 -0
- package/Lights/light.js +18 -0
- package/Lights/light.js.map +1 -1
- package/Lights/shadowLight.d.ts +18 -1
- package/Lights/shadowLight.js +34 -1
- package/Lights/shadowLight.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.js +9 -1
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/abstractMesh.js +3 -1
- package/Meshes/abstractMesh.js.map +1 -1
- package/XR/features/WebXRMeshDetector.d.ts +14 -2
- package/XR/features/WebXRMeshDetector.js +43 -8
- package/XR/features/WebXRMeshDetector.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +1 -2
- package/scene.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.d.ts +0 -172
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js +0 -235
- package/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.d.ts +0 -269
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js +0 -429
- package/FlowGraph/Blocks/Data/Math/flowGraphNumberMathBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.d.ts +0 -115
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js +0 -146
- package/FlowGraph/Blocks/Data/Math/flowGraphVector2MathBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.d.ts +0 -155
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js +0 -190
- package/FlowGraph/Blocks/Data/Math/flowGraphVector3MathBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.d.ts +0 -116
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js +0 -144
- package/FlowGraph/Blocks/Data/Math/flowGraphVector4MathBlocks.js.map +0 -1
- package/FlowGraph/Blocks/Execution/flowGraphLogBlock.js.map +0 -1
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import { Matrix, Quaternion, Vector3 } from "../../../../Maths/math.vector";
|
|
2
|
-
import { FlowGraphBinaryOperationBlock } from "../flowGraphBinaryOperationBlock";
|
|
3
|
-
import { FlowGraphUnaryOperationBlock } from "../flowGraphUnaryOperationBlock";
|
|
4
|
-
import type { IFlowGraphBlockConfiguration } from "../../../flowGraphBlock";
|
|
5
|
-
import { FlowGraphBlock } from "../../../flowGraphBlock";
|
|
6
|
-
import type { FlowGraphDataConnection } from "../../../flowGraphDataConnection";
|
|
7
|
-
import type { FlowGraphContext } from "../../../flowGraphContext";
|
|
8
|
-
import type { TransformNode } from "../../../../Meshes/transformNode";
|
|
9
|
-
/**
|
|
10
|
-
* Adds two matrices together.
|
|
11
|
-
* @experimental
|
|
12
|
-
*/
|
|
13
|
-
export declare class FlowGraphAddMatrixBlock extends FlowGraphBinaryOperationBlock<Matrix, Matrix, Matrix> {
|
|
14
|
-
private _cachedMatrix;
|
|
15
|
-
constructor(config?: IFlowGraphBlockConfiguration);
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Adds a matrix and a number together.
|
|
19
|
-
* @experimental
|
|
20
|
-
*/
|
|
21
|
-
export declare class FlowGraphAddMatrixAndNumberBlock extends FlowGraphBinaryOperationBlock<Matrix, number, Matrix> {
|
|
22
|
-
private _cachedArray;
|
|
23
|
-
private _cachedMatrix;
|
|
24
|
-
constructor(config?: IFlowGraphBlockConfiguration);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Subtracts two matrices.
|
|
28
|
-
* @experimental
|
|
29
|
-
*/
|
|
30
|
-
export declare class FlowGraphSubtractMatrixBlock extends FlowGraphBinaryOperationBlock<Matrix, Matrix, Matrix> {
|
|
31
|
-
private _cachedMatrix;
|
|
32
|
-
constructor(config?: IFlowGraphBlockConfiguration);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Subtracts a matrix and a number together.
|
|
36
|
-
* @experimental
|
|
37
|
-
*/
|
|
38
|
-
export declare class FlowGraphSubtractMatrixAndNumberBlock extends FlowGraphBinaryOperationBlock<Matrix, number, Matrix> {
|
|
39
|
-
private _cachedArray;
|
|
40
|
-
private _cachedMatrix;
|
|
41
|
-
constructor(config?: IFlowGraphBlockConfiguration);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Multiplies two matrices together.
|
|
45
|
-
* @experimental
|
|
46
|
-
*/
|
|
47
|
-
export declare class FlowGraphMultiplyMatrixBlock extends FlowGraphBinaryOperationBlock<Matrix, Matrix, Matrix> {
|
|
48
|
-
private _cachedMatrix;
|
|
49
|
-
constructor(config?: IFlowGraphBlockConfiguration);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Divides two matrices.
|
|
53
|
-
* @experimental
|
|
54
|
-
*/
|
|
55
|
-
export declare class FlowGraphDivideMatrixBlock extends FlowGraphBinaryOperationBlock<Matrix, Matrix, Matrix> {
|
|
56
|
-
private _cachedResultMatrix;
|
|
57
|
-
constructor(config?: IFlowGraphBlockConfiguration);
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Divides a matrix and a number together.
|
|
61
|
-
* @experimental
|
|
62
|
-
*/
|
|
63
|
-
export declare class FlowGraphDivideMatrixAndNumberBlock extends FlowGraphBinaryOperationBlock<Matrix, number, Matrix> {
|
|
64
|
-
private _cachedArray;
|
|
65
|
-
private _cachedMatrix;
|
|
66
|
-
constructor(config?: IFlowGraphBlockConfiguration);
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Scales a matrix by a number.
|
|
70
|
-
* @experimental
|
|
71
|
-
*/
|
|
72
|
-
export declare class FlowGraphScaleMatrixBlock extends FlowGraphBinaryOperationBlock<Matrix, number, Matrix> {
|
|
73
|
-
private _cachedMatrix;
|
|
74
|
-
constructor(config?: IFlowGraphBlockConfiguration);
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Clamps each value in a matrix between a minimum and maximum value.
|
|
78
|
-
* @experimental
|
|
79
|
-
*/
|
|
80
|
-
export declare class FlowGraphClampMatrixBlock extends FlowGraphBlock {
|
|
81
|
-
/**
|
|
82
|
-
* Input connection: The matrix to clamp.
|
|
83
|
-
*/
|
|
84
|
-
readonly input: FlowGraphDataConnection<Matrix>;
|
|
85
|
-
/**
|
|
86
|
-
* Output connection: The clamped matrix.
|
|
87
|
-
*/
|
|
88
|
-
readonly output: FlowGraphDataConnection<Matrix>;
|
|
89
|
-
/**
|
|
90
|
-
* Input connection: The minimum value.
|
|
91
|
-
*/
|
|
92
|
-
readonly min: FlowGraphDataConnection<number>;
|
|
93
|
-
/**
|
|
94
|
-
* Input connection: The maximum value.
|
|
95
|
-
*/
|
|
96
|
-
readonly max: FlowGraphDataConnection<number>;
|
|
97
|
-
private _cachedArray;
|
|
98
|
-
private _cachedMatrix;
|
|
99
|
-
constructor(config?: IFlowGraphBlockConfiguration);
|
|
100
|
-
_updateOutputs(_context: FlowGraphContext): void;
|
|
101
|
-
getClassName(): string;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Decomposes a matrix into its translation, rotation and scale components.
|
|
105
|
-
* @experimental
|
|
106
|
-
*/
|
|
107
|
-
export declare class FlowGraphDecomposeMatrixBlock extends FlowGraphBlock {
|
|
108
|
-
/**
|
|
109
|
-
* Input connection: The matrix to decompose.
|
|
110
|
-
*/
|
|
111
|
-
readonly input: FlowGraphDataConnection<Matrix>;
|
|
112
|
-
/**
|
|
113
|
-
* Output connection: The translation component of the matrix.
|
|
114
|
-
*/
|
|
115
|
-
readonly translation: FlowGraphDataConnection<Vector3>;
|
|
116
|
-
/**
|
|
117
|
-
* Output connection: The rotation component of the matrix.
|
|
118
|
-
*/
|
|
119
|
-
readonly rotation: FlowGraphDataConnection<Quaternion>;
|
|
120
|
-
/**
|
|
121
|
-
* Output connection: The scale component of the matrix.
|
|
122
|
-
*/
|
|
123
|
-
readonly scale: FlowGraphDataConnection<Vector3>;
|
|
124
|
-
private _cachedTranslation;
|
|
125
|
-
private _cachedRotation;
|
|
126
|
-
private _cachedScale;
|
|
127
|
-
constructor(config?: IFlowGraphBlockConfiguration);
|
|
128
|
-
_updateOutputs(_context: FlowGraphContext): void;
|
|
129
|
-
getClassName(): string;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Composes a matrix from its translation, rotation and scale components.
|
|
133
|
-
* @experimental
|
|
134
|
-
*/
|
|
135
|
-
export declare class FlowGraphComposeMatrixBlock extends FlowGraphBlock {
|
|
136
|
-
/**
|
|
137
|
-
* Output connection: The matrix to compose.
|
|
138
|
-
*/
|
|
139
|
-
readonly output: FlowGraphDataConnection<Matrix>;
|
|
140
|
-
/**
|
|
141
|
-
* Input connection: The translation component of the matrix.
|
|
142
|
-
*/
|
|
143
|
-
readonly translation: FlowGraphDataConnection<Vector3>;
|
|
144
|
-
/**
|
|
145
|
-
* Input connection: The rotation component of the matrix.
|
|
146
|
-
*/
|
|
147
|
-
readonly rotation: FlowGraphDataConnection<Quaternion>;
|
|
148
|
-
/**
|
|
149
|
-
* Input connection: The scale component of the matrix.
|
|
150
|
-
*/
|
|
151
|
-
readonly scale: FlowGraphDataConnection<Vector3>;
|
|
152
|
-
private _cachedMatrix;
|
|
153
|
-
constructor(config?: IFlowGraphBlockConfiguration);
|
|
154
|
-
_updateOutputs(_context: FlowGraphContext): void;
|
|
155
|
-
getClassName(): string;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Converts a quaternion to a rotation matrix.
|
|
159
|
-
* @experimental
|
|
160
|
-
*/
|
|
161
|
-
export declare class FlowGraphQuaternionToRotationMatrixBlock extends FlowGraphUnaryOperationBlock<Quaternion, Matrix> {
|
|
162
|
-
private _cachedMatrix;
|
|
163
|
-
constructor(config?: IFlowGraphBlockConfiguration);
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Given the Transform Nodes A and B, gives the matrix required
|
|
167
|
-
* to transform coordinates from A's local space to B's local space.
|
|
168
|
-
*/
|
|
169
|
-
export declare class FlowGraphGetTransformationMatrixBlock extends FlowGraphBinaryOperationBlock<TransformNode, TransformNode, Matrix> {
|
|
170
|
-
private _cachedResult;
|
|
171
|
-
constructor(config?: IFlowGraphBlockConfiguration);
|
|
172
|
-
}
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
import { Matrix, Quaternion, TmpVectors, Vector3 } from "../../../../Maths/math.vector.js";
|
|
2
|
-
import { FlowGraphBinaryOperationBlock } from "../flowGraphBinaryOperationBlock.js";
|
|
3
|
-
import { RichTypeAny, RichTypeMatrix, RichTypeNumber, RichTypeQuaternion, RichTypeVector3 } from "../../../flowGraphRichTypes.js";
|
|
4
|
-
import { FlowGraphUnaryOperationBlock } from "../flowGraphUnaryOperationBlock.js";
|
|
5
|
-
import { FlowGraphBlock } from "../../../flowGraphBlock.js";
|
|
6
|
-
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
7
|
-
const ADDNAME = "FGAddMatrixBlock";
|
|
8
|
-
/**
|
|
9
|
-
* Adds two matrices together.
|
|
10
|
-
* @experimental
|
|
11
|
-
*/
|
|
12
|
-
export class FlowGraphAddMatrixBlock extends FlowGraphBinaryOperationBlock {
|
|
13
|
-
constructor(config) {
|
|
14
|
-
super(RichTypeMatrix, RichTypeMatrix, RichTypeMatrix, (left, right) => left.addToRef(right, this._cachedMatrix), ADDNAME, config);
|
|
15
|
-
this._cachedMatrix = Matrix.Zero();
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
RegisterClass(ADDNAME, FlowGraphAddMatrixBlock);
|
|
19
|
-
const ADDNUMBERNAME = "FGAddMatrixAndNumberBlock";
|
|
20
|
-
/**
|
|
21
|
-
* Adds a matrix and a number together.
|
|
22
|
-
* @experimental
|
|
23
|
-
*/
|
|
24
|
-
export class FlowGraphAddMatrixAndNumberBlock extends FlowGraphBinaryOperationBlock {
|
|
25
|
-
constructor(config) {
|
|
26
|
-
super(RichTypeMatrix, RichTypeNumber, RichTypeMatrix, (left, right) => {
|
|
27
|
-
for (let i = 0; i < left.m.length; i++) {
|
|
28
|
-
this._cachedArray[i] = left.m[i] + right;
|
|
29
|
-
}
|
|
30
|
-
return Matrix.FromArrayToRef(this._cachedArray, 0, this._cachedMatrix);
|
|
31
|
-
}, ADDNUMBERNAME, config);
|
|
32
|
-
this._cachedArray = new Float32Array(16);
|
|
33
|
-
this._cachedMatrix = Matrix.Zero();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
RegisterClass(ADDNUMBERNAME, FlowGraphAddMatrixAndNumberBlock);
|
|
37
|
-
const SUBNAME = "FGSubtractMatrixBlock";
|
|
38
|
-
/**
|
|
39
|
-
* Subtracts two matrices.
|
|
40
|
-
* @experimental
|
|
41
|
-
*/
|
|
42
|
-
export class FlowGraphSubtractMatrixBlock extends FlowGraphBinaryOperationBlock {
|
|
43
|
-
constructor(config) {
|
|
44
|
-
super(RichTypeMatrix, RichTypeMatrix, RichTypeMatrix, (left, right) => left.addToRef(right.scaleToRef(-1, TmpVectors.Matrix[0]), this._cachedMatrix), SUBNAME, config);
|
|
45
|
-
this._cachedMatrix = Matrix.Zero();
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
RegisterClass(SUBNAME, FlowGraphSubtractMatrixBlock);
|
|
49
|
-
const SUBNUMBERNAME = "FGSubtractMatrixAndNumberBlock";
|
|
50
|
-
/**
|
|
51
|
-
* Subtracts a matrix and a number together.
|
|
52
|
-
* @experimental
|
|
53
|
-
*/
|
|
54
|
-
export class FlowGraphSubtractMatrixAndNumberBlock extends FlowGraphBinaryOperationBlock {
|
|
55
|
-
constructor(config) {
|
|
56
|
-
super(RichTypeMatrix, RichTypeNumber, RichTypeMatrix, (left, right) => {
|
|
57
|
-
for (let i = 0; i < left.m.length; i++) {
|
|
58
|
-
this._cachedArray[i] = left.m[i] - right;
|
|
59
|
-
}
|
|
60
|
-
return Matrix.FromArrayToRef(this._cachedArray, 0, this._cachedMatrix);
|
|
61
|
-
}, SUBNUMBERNAME, config);
|
|
62
|
-
this._cachedArray = new Float32Array(16);
|
|
63
|
-
this._cachedMatrix = Matrix.Zero();
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
RegisterClass(SUBNUMBERNAME, FlowGraphSubtractMatrixAndNumberBlock);
|
|
67
|
-
const MULNAME = "FGMultiplyMatrixBlock";
|
|
68
|
-
/**
|
|
69
|
-
* Multiplies two matrices together.
|
|
70
|
-
* @experimental
|
|
71
|
-
*/
|
|
72
|
-
export class FlowGraphMultiplyMatrixBlock extends FlowGraphBinaryOperationBlock {
|
|
73
|
-
constructor(config) {
|
|
74
|
-
super(RichTypeMatrix, RichTypeMatrix, RichTypeMatrix, (left, right) => left.multiplyToRef(right, this._cachedMatrix), MULNAME, config);
|
|
75
|
-
this._cachedMatrix = Matrix.Zero();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
RegisterClass(MULNAME, FlowGraphMultiplyMatrixBlock);
|
|
79
|
-
const DIVIDENAME = "FGDivideMatrixBlock";
|
|
80
|
-
/**
|
|
81
|
-
* Divides two matrices.
|
|
82
|
-
* @experimental
|
|
83
|
-
*/
|
|
84
|
-
export class FlowGraphDivideMatrixBlock extends FlowGraphBinaryOperationBlock {
|
|
85
|
-
constructor(config) {
|
|
86
|
-
super(RichTypeMatrix, RichTypeMatrix, RichTypeMatrix, (left, right) => left.multiplyToRef(right.invertToRef(TmpVectors.Matrix[0]), this._cachedResultMatrix), DIVIDENAME, config);
|
|
87
|
-
this._cachedResultMatrix = Matrix.Zero();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
RegisterClass(DIVIDENAME, FlowGraphDivideMatrixBlock);
|
|
91
|
-
const DIVIDENUMBERNAME = "FGDivideMatrixAndNumberBlock";
|
|
92
|
-
/**
|
|
93
|
-
* Divides a matrix and a number together.
|
|
94
|
-
* @experimental
|
|
95
|
-
*/
|
|
96
|
-
export class FlowGraphDivideMatrixAndNumberBlock extends FlowGraphBinaryOperationBlock {
|
|
97
|
-
constructor(config) {
|
|
98
|
-
super(RichTypeMatrix, RichTypeNumber, RichTypeMatrix, (left, right) => {
|
|
99
|
-
for (let i = 0; i < left.m.length; i++) {
|
|
100
|
-
this._cachedArray[i] = left.m[i] / right;
|
|
101
|
-
}
|
|
102
|
-
return Matrix.FromArrayToRef(this._cachedArray, 0, this._cachedMatrix);
|
|
103
|
-
}, DIVIDENUMBERNAME, config);
|
|
104
|
-
this._cachedArray = new Float32Array(16);
|
|
105
|
-
this._cachedMatrix = Matrix.Zero();
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
RegisterClass(DIVIDENUMBERNAME, FlowGraphDivideMatrixAndNumberBlock);
|
|
109
|
-
const SCALENAME = "FGScaleMatrixBlock";
|
|
110
|
-
/**
|
|
111
|
-
* Scales a matrix by a number.
|
|
112
|
-
* @experimental
|
|
113
|
-
*/
|
|
114
|
-
export class FlowGraphScaleMatrixBlock extends FlowGraphBinaryOperationBlock {
|
|
115
|
-
constructor(config) {
|
|
116
|
-
super(RichTypeMatrix, RichTypeNumber, RichTypeMatrix, (left, right) => left.scaleToRef(right, this._cachedMatrix), SCALENAME, config);
|
|
117
|
-
this._cachedMatrix = Matrix.Zero();
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
RegisterClass(SCALENAME, FlowGraphScaleMatrixBlock);
|
|
121
|
-
const CLAMPNAME = "FGClampMatrixBlock";
|
|
122
|
-
/**
|
|
123
|
-
* Clamps each value in a matrix between a minimum and maximum value.
|
|
124
|
-
* @experimental
|
|
125
|
-
*/
|
|
126
|
-
export class FlowGraphClampMatrixBlock extends FlowGraphBlock {
|
|
127
|
-
constructor(config) {
|
|
128
|
-
super(config);
|
|
129
|
-
this._cachedArray = new Float32Array(16);
|
|
130
|
-
this._cachedMatrix = Matrix.Identity();
|
|
131
|
-
this.input = this.registerDataInput("input", RichTypeMatrix);
|
|
132
|
-
this.min = this.registerDataInput("min", RichTypeNumber);
|
|
133
|
-
this.max = this.registerDataInput("max", RichTypeNumber);
|
|
134
|
-
this.output = this.registerDataOutput("output", RichTypeMatrix);
|
|
135
|
-
}
|
|
136
|
-
_updateOutputs(_context) {
|
|
137
|
-
const input = this.input.getValue(_context);
|
|
138
|
-
const min = this.min.getValue(_context);
|
|
139
|
-
const max = this.max.getValue(_context);
|
|
140
|
-
for (let i = 0; i < input.m.length; i++) {
|
|
141
|
-
this._cachedArray[i] = Math.min(Math.max(input.m[i], min), max);
|
|
142
|
-
}
|
|
143
|
-
Matrix.FromArrayToRef(this._cachedArray, 0, this._cachedMatrix);
|
|
144
|
-
this.output.setValue(this._cachedMatrix, _context);
|
|
145
|
-
}
|
|
146
|
-
getClassName() {
|
|
147
|
-
return CLAMPNAME;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
RegisterClass(CLAMPNAME, FlowGraphClampMatrixBlock);
|
|
151
|
-
const DECOMPOSENAME = "FGDecomposeMatrixBlock";
|
|
152
|
-
/**
|
|
153
|
-
* Decomposes a matrix into its translation, rotation and scale components.
|
|
154
|
-
* @experimental
|
|
155
|
-
*/
|
|
156
|
-
export class FlowGraphDecomposeMatrixBlock extends FlowGraphBlock {
|
|
157
|
-
constructor(config) {
|
|
158
|
-
super(config);
|
|
159
|
-
this._cachedTranslation = new Vector3();
|
|
160
|
-
this._cachedRotation = new Quaternion();
|
|
161
|
-
this._cachedScale = new Vector3();
|
|
162
|
-
this.input = this.registerDataInput("input", RichTypeMatrix);
|
|
163
|
-
this.translation = this.registerDataOutput("translation", RichTypeVector3);
|
|
164
|
-
this.rotation = this.registerDataOutput("rotation", RichTypeQuaternion);
|
|
165
|
-
this.scale = this.registerDataOutput("scale", RichTypeVector3);
|
|
166
|
-
}
|
|
167
|
-
_updateOutputs(_context) {
|
|
168
|
-
const input = this.input.getValue(_context);
|
|
169
|
-
input.decompose(this._cachedScale, this._cachedRotation, this._cachedTranslation);
|
|
170
|
-
this.translation.setValue(this._cachedTranslation, _context);
|
|
171
|
-
this.rotation.setValue(this._cachedRotation, _context);
|
|
172
|
-
this.scale.setValue(this._cachedScale, _context);
|
|
173
|
-
}
|
|
174
|
-
getClassName() {
|
|
175
|
-
return DECOMPOSENAME;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
RegisterClass(DECOMPOSENAME, FlowGraphDecomposeMatrixBlock);
|
|
179
|
-
const COMPOSENAME = "FGComposeMatrixBlock";
|
|
180
|
-
/**
|
|
181
|
-
* Composes a matrix from its translation, rotation and scale components.
|
|
182
|
-
* @experimental
|
|
183
|
-
*/
|
|
184
|
-
export class FlowGraphComposeMatrixBlock extends FlowGraphBlock {
|
|
185
|
-
constructor(config) {
|
|
186
|
-
super(config);
|
|
187
|
-
this._cachedMatrix = new Matrix();
|
|
188
|
-
this.output = this.registerDataOutput("input", RichTypeMatrix);
|
|
189
|
-
this.translation = this.registerDataInput("translation", RichTypeVector3);
|
|
190
|
-
this.rotation = this.registerDataInput("rotation", RichTypeQuaternion);
|
|
191
|
-
this.scale = this.registerDataInput("scale", RichTypeVector3);
|
|
192
|
-
}
|
|
193
|
-
_updateOutputs(_context) {
|
|
194
|
-
const translation = this.translation.getValue(_context);
|
|
195
|
-
const rotation = this.rotation.getValue(_context);
|
|
196
|
-
const scale = this.scale.getValue(_context);
|
|
197
|
-
Matrix.ComposeToRef(scale, rotation, translation, this._cachedMatrix);
|
|
198
|
-
this.output.setValue(this._cachedMatrix, _context);
|
|
199
|
-
}
|
|
200
|
-
getClassName() {
|
|
201
|
-
return COMPOSENAME;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
RegisterClass(COMPOSENAME, FlowGraphComposeMatrixBlock);
|
|
205
|
-
const QUATERNIONTOROTNAME = "FGQuaternionToRotationMatrixBlock";
|
|
206
|
-
/**
|
|
207
|
-
* Converts a quaternion to a rotation matrix.
|
|
208
|
-
* @experimental
|
|
209
|
-
*/
|
|
210
|
-
export class FlowGraphQuaternionToRotationMatrixBlock extends FlowGraphUnaryOperationBlock {
|
|
211
|
-
constructor(config) {
|
|
212
|
-
super(RichTypeQuaternion, RichTypeMatrix, (value) => Matrix.FromQuaternionToRef(value, this._cachedMatrix), QUATERNIONTOROTNAME, config);
|
|
213
|
-
this._cachedMatrix = new Matrix();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
RegisterClass(QUATERNIONTOROTNAME, FlowGraphQuaternionToRotationMatrixBlock);
|
|
217
|
-
const GETTRANSFORMNAME = "FGGetTransformationMatrixBlock";
|
|
218
|
-
/**
|
|
219
|
-
* Given the Transform Nodes A and B, gives the matrix required
|
|
220
|
-
* to transform coordinates from A's local space to B's local space.
|
|
221
|
-
*/
|
|
222
|
-
export class FlowGraphGetTransformationMatrixBlock extends FlowGraphBinaryOperationBlock {
|
|
223
|
-
constructor(config) {
|
|
224
|
-
super(RichTypeAny, RichTypeAny, RichTypeMatrix, (left, right) => {
|
|
225
|
-
const aMatrix = left.getWorldMatrix();
|
|
226
|
-
const bMatrix = right.getWorldMatrix();
|
|
227
|
-
const inverseB = bMatrix.invertToRef(TmpVectors.Matrix[0]);
|
|
228
|
-
const result = inverseB.multiplyToRef(aMatrix, this._cachedResult);
|
|
229
|
-
return result;
|
|
230
|
-
}, GETTRANSFORMNAME, config);
|
|
231
|
-
this._cachedResult = Matrix.Zero();
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
RegisterClass(GETTRANSFORMNAME, FlowGraphGetTransformationMatrixBlock);
|
|
235
|
-
//# sourceMappingURL=flowGraphMatrixBlocks.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flowGraphMatrixBlocks.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FlowGraph/Blocks/Data/Math/flowGraphMatrixBlocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC/H,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAIzD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,OAAO,GAAG,kBAAkB,CAAC;AACnC;;;GAGG;AACH,MAAM,OAAO,uBAAwB,SAAQ,6BAAqD;IAE9F,YAAY,MAAqC;QAC7C,KAAK,CAAC,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAF9H,kBAAa,GAAW,MAAM,CAAC,IAAI,EAAE,CAAC;IAG9C,CAAC;CACJ;AACD,aAAa,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAC;AAEh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,KAAK,CAAC,cAAc,EAAE,CAAC;YAEvC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3D,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YACnE,OAAO,MAAM,CAAC;QAClB,CAAC,EACD,gBAAgB,EAChB,MAAM,CACT,CAAC;QAhBE,kBAAa,GAAW,MAAM,CAAC,IAAI,EAAE,CAAC;IAiB9C,CAAC;CACJ;AACD,aAAa,CAAC,gBAAgB,EAAE,qCAAqC,CAAC,CAAC","sourcesContent":["import { Matrix, Quaternion, TmpVectors, Vector3 } from \"../../../../Maths/math.vector\";\r\nimport { FlowGraphBinaryOperationBlock } from \"../flowGraphBinaryOperationBlock\";\r\nimport { RichTypeAny, RichTypeMatrix, RichTypeNumber, RichTypeQuaternion, RichTypeVector3 } from \"../../../flowGraphRichTypes\";\r\nimport { FlowGraphUnaryOperationBlock } from \"../flowGraphUnaryOperationBlock\";\r\nimport type { IFlowGraphBlockConfiguration } from \"../../../flowGraphBlock\";\r\nimport { FlowGraphBlock } from \"../../../flowGraphBlock\";\r\nimport type { FlowGraphDataConnection } from \"../../../flowGraphDataConnection\";\r\nimport type { FlowGraphContext } from \"../../../flowGraphContext\";\r\nimport type { TransformNode } from \"../../../../Meshes/transformNode\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\n\r\nconst ADDNAME = \"FGAddMatrixBlock\";\r\n/**\r\n * Adds two matrices together.\r\n * @experimental\r\n */\r\nexport class FlowGraphAddMatrixBlock extends FlowGraphBinaryOperationBlock<Matrix, Matrix, Matrix> {\r\n private _cachedMatrix: Matrix = Matrix.Zero();\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeMatrix, RichTypeMatrix, RichTypeMatrix, (left, right) => left.addToRef(right, this._cachedMatrix), ADDNAME, config);\r\n }\r\n}\r\nRegisterClass(ADDNAME, FlowGraphAddMatrixBlock);\r\n\r\nconst ADDNUMBERNAME = \"FGAddMatrixAndNumberBlock\";\r\n/**\r\n * Adds a matrix and a number together.\r\n * @experimental\r\n */\r\nexport class FlowGraphAddMatrixAndNumberBlock extends FlowGraphBinaryOperationBlock<Matrix, number, Matrix> {\r\n private _cachedArray: Float32Array = new Float32Array(16);\r\n private _cachedMatrix: Matrix = Matrix.Zero();\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(\r\n RichTypeMatrix,\r\n RichTypeNumber,\r\n RichTypeMatrix,\r\n (left, right) => {\r\n for (let i = 0; i < left.m.length; i++) {\r\n this._cachedArray[i] = left.m[i] + right;\r\n }\r\n return Matrix.FromArrayToRef(this._cachedArray, 0, this._cachedMatrix);\r\n },\r\n ADDNUMBERNAME,\r\n config\r\n );\r\n }\r\n}\r\nRegisterClass(ADDNUMBERNAME, FlowGraphAddMatrixAndNumberBlock);\r\n\r\nconst SUBNAME = \"FGSubtractMatrixBlock\";\r\n/**\r\n * Subtracts two matrices.\r\n * @experimental\r\n */\r\nexport class FlowGraphSubtractMatrixBlock extends FlowGraphBinaryOperationBlock<Matrix, Matrix, Matrix> {\r\n private _cachedMatrix: Matrix = Matrix.Zero();\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeMatrix, RichTypeMatrix, RichTypeMatrix, (left, right) => left.addToRef(right.scaleToRef(-1, TmpVectors.Matrix[0]), this._cachedMatrix), SUBNAME, config);\r\n }\r\n}\r\nRegisterClass(SUBNAME, FlowGraphSubtractMatrixBlock);\r\n\r\nconst SUBNUMBERNAME = \"FGSubtractMatrixAndNumberBlock\";\r\n/**\r\n * Subtracts a matrix and a number together.\r\n * @experimental\r\n */\r\nexport class FlowGraphSubtractMatrixAndNumberBlock extends FlowGraphBinaryOperationBlock<Matrix, number, Matrix> {\r\n private _cachedArray: Float32Array = new Float32Array(16);\r\n private _cachedMatrix: Matrix = Matrix.Zero();\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(\r\n RichTypeMatrix,\r\n RichTypeNumber,\r\n RichTypeMatrix,\r\n (left, right) => {\r\n for (let i = 0; i < left.m.length; i++) {\r\n this._cachedArray[i] = left.m[i] - right;\r\n }\r\n return Matrix.FromArrayToRef(this._cachedArray, 0, this._cachedMatrix);\r\n },\r\n SUBNUMBERNAME,\r\n config\r\n );\r\n }\r\n}\r\nRegisterClass(SUBNUMBERNAME, FlowGraphSubtractMatrixAndNumberBlock);\r\n\r\nconst MULNAME = \"FGMultiplyMatrixBlock\";\r\n/**\r\n * Multiplies two matrices together.\r\n * @experimental\r\n */\r\nexport class FlowGraphMultiplyMatrixBlock extends FlowGraphBinaryOperationBlock<Matrix, Matrix, Matrix> {\r\n private _cachedMatrix: Matrix = Matrix.Zero();\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeMatrix, RichTypeMatrix, RichTypeMatrix, (left, right) => left.multiplyToRef(right, this._cachedMatrix), MULNAME, config);\r\n }\r\n}\r\nRegisterClass(MULNAME, FlowGraphMultiplyMatrixBlock);\r\n\r\nconst DIVIDENAME = \"FGDivideMatrixBlock\";\r\n/**\r\n * Divides two matrices.\r\n * @experimental\r\n */\r\nexport class FlowGraphDivideMatrixBlock extends FlowGraphBinaryOperationBlock<Matrix, Matrix, Matrix> {\r\n private _cachedResultMatrix: Matrix = Matrix.Zero();\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(\r\n RichTypeMatrix,\r\n RichTypeMatrix,\r\n RichTypeMatrix,\r\n (left, right) => left.multiplyToRef(right.invertToRef(TmpVectors.Matrix[0]), this._cachedResultMatrix),\r\n DIVIDENAME,\r\n config\r\n );\r\n }\r\n}\r\nRegisterClass(DIVIDENAME, FlowGraphDivideMatrixBlock);\r\n\r\nconst DIVIDENUMBERNAME = \"FGDivideMatrixAndNumberBlock\";\r\n/**\r\n * Divides a matrix and a number together.\r\n * @experimental\r\n */\r\nexport class FlowGraphDivideMatrixAndNumberBlock extends FlowGraphBinaryOperationBlock<Matrix, number, Matrix> {\r\n private _cachedArray: Float32Array = new Float32Array(16);\r\n private _cachedMatrix: Matrix = Matrix.Zero();\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(\r\n RichTypeMatrix,\r\n RichTypeNumber,\r\n RichTypeMatrix,\r\n (left, right) => {\r\n for (let i = 0; i < left.m.length; i++) {\r\n this._cachedArray[i] = left.m[i] / right;\r\n }\r\n return Matrix.FromArrayToRef(this._cachedArray, 0, this._cachedMatrix);\r\n },\r\n DIVIDENUMBERNAME,\r\n config\r\n );\r\n }\r\n}\r\nRegisterClass(DIVIDENUMBERNAME, FlowGraphDivideMatrixAndNumberBlock);\r\n\r\nconst SCALENAME = \"FGScaleMatrixBlock\";\r\n/**\r\n * Scales a matrix by a number.\r\n * @experimental\r\n */\r\nexport class FlowGraphScaleMatrixBlock extends FlowGraphBinaryOperationBlock<Matrix, number, Matrix> {\r\n private _cachedMatrix = Matrix.Zero();\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeMatrix, RichTypeNumber, RichTypeMatrix, (left, right) => left.scaleToRef(right, this._cachedMatrix), SCALENAME, config);\r\n }\r\n}\r\nRegisterClass(SCALENAME, FlowGraphScaleMatrixBlock);\r\n\r\nconst CLAMPNAME = \"FGClampMatrixBlock\";\r\n/**\r\n * Clamps each value in a matrix between a minimum and maximum value.\r\n * @experimental\r\n */\r\nexport class FlowGraphClampMatrixBlock extends FlowGraphBlock {\r\n /**\r\n * Input connection: The matrix to clamp.\r\n */\r\n public readonly input: FlowGraphDataConnection<Matrix>;\r\n /**\r\n * Output connection: The clamped matrix.\r\n */\r\n public readonly output: FlowGraphDataConnection<Matrix>;\r\n /**\r\n * Input connection: The minimum value.\r\n */\r\n public readonly min: FlowGraphDataConnection<number>;\r\n /**\r\n * Input connection: The maximum value.\r\n */\r\n public readonly max: FlowGraphDataConnection<number>;\r\n private _cachedArray: Float32Array = new Float32Array(16);\r\n private _cachedMatrix: Matrix = Matrix.Identity();\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.input = this.registerDataInput(\"input\", RichTypeMatrix);\r\n this.min = this.registerDataInput(\"min\", RichTypeNumber);\r\n this.max = this.registerDataInput(\"max\", RichTypeNumber);\r\n this.output = this.registerDataOutput(\"output\", RichTypeMatrix);\r\n }\r\n\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n const input = this.input.getValue(_context);\r\n const min = this.min.getValue(_context);\r\n const max = this.max.getValue(_context);\r\n\r\n for (let i = 0; i < input.m.length; i++) {\r\n this._cachedArray[i] = Math.min(Math.max(input.m[i], min), max);\r\n }\r\n\r\n Matrix.FromArrayToRef(this._cachedArray, 0, this._cachedMatrix);\r\n this.output.setValue(this._cachedMatrix, _context);\r\n }\r\n\r\n public getClassName(): string {\r\n return CLAMPNAME;\r\n }\r\n}\r\nRegisterClass(CLAMPNAME, FlowGraphClampMatrixBlock);\r\n\r\nconst DECOMPOSENAME = \"FGDecomposeMatrixBlock\";\r\n/**\r\n * Decomposes a matrix into its translation, rotation and scale components.\r\n * @experimental\r\n */\r\nexport class FlowGraphDecomposeMatrixBlock extends FlowGraphBlock {\r\n /**\r\n * Input connection: The matrix to decompose.\r\n */\r\n public readonly input: FlowGraphDataConnection<Matrix>;\r\n /**\r\n * Output connection: The translation component of the matrix.\r\n */\r\n public readonly translation: FlowGraphDataConnection<Vector3>;\r\n /**\r\n * Output connection: The rotation component of the matrix.\r\n */\r\n public readonly rotation: FlowGraphDataConnection<Quaternion>;\r\n /**\r\n * Output connection: The scale component of the matrix.\r\n */\r\n public readonly scale: FlowGraphDataConnection<Vector3>;\r\n\r\n private _cachedTranslation = new Vector3();\r\n private _cachedRotation = new Quaternion();\r\n private _cachedScale = new Vector3();\r\n\r\n public constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.input = this.registerDataInput(\"input\", RichTypeMatrix);\r\n this.translation = this.registerDataOutput(\"translation\", RichTypeVector3);\r\n this.rotation = this.registerDataOutput(\"rotation\", RichTypeQuaternion);\r\n this.scale = this.registerDataOutput(\"scale\", RichTypeVector3);\r\n }\r\n\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n const input = this.input.getValue(_context);\r\n\r\n input.decompose(this._cachedScale, this._cachedRotation, this._cachedTranslation);\r\n\r\n this.translation.setValue(this._cachedTranslation, _context);\r\n this.rotation.setValue(this._cachedRotation, _context);\r\n this.scale.setValue(this._cachedScale, _context);\r\n }\r\n\r\n public getClassName(): string {\r\n return DECOMPOSENAME;\r\n }\r\n}\r\nRegisterClass(DECOMPOSENAME, FlowGraphDecomposeMatrixBlock);\r\n\r\nconst COMPOSENAME = \"FGComposeMatrixBlock\";\r\n/**\r\n * Composes a matrix from its translation, rotation and scale components.\r\n * @experimental\r\n */\r\nexport class FlowGraphComposeMatrixBlock extends FlowGraphBlock {\r\n /**\r\n * Output connection: The matrix to compose.\r\n */\r\n public readonly output: FlowGraphDataConnection<Matrix>;\r\n /**\r\n * Input connection: The translation component of the matrix.\r\n */\r\n public readonly translation: FlowGraphDataConnection<Vector3>;\r\n /**\r\n * Input connection: The rotation component of the matrix.\r\n */\r\n public readonly rotation: FlowGraphDataConnection<Quaternion>;\r\n /**\r\n * Input connection: The scale component of the matrix.\r\n */\r\n public readonly scale: FlowGraphDataConnection<Vector3>;\r\n\r\n private _cachedMatrix = new Matrix();\r\n\r\n public constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(config);\r\n\r\n this.output = this.registerDataOutput(\"input\", RichTypeMatrix);\r\n this.translation = this.registerDataInput(\"translation\", RichTypeVector3);\r\n this.rotation = this.registerDataInput(\"rotation\", RichTypeQuaternion);\r\n this.scale = this.registerDataInput(\"scale\", RichTypeVector3);\r\n }\r\n\r\n public _updateOutputs(_context: FlowGraphContext): void {\r\n const translation = this.translation.getValue(_context);\r\n const rotation = this.rotation.getValue(_context);\r\n const scale = this.scale.getValue(_context);\r\n\r\n Matrix.ComposeToRef(scale, rotation, translation, this._cachedMatrix);\r\n\r\n this.output.setValue(this._cachedMatrix, _context);\r\n }\r\n\r\n public getClassName(): string {\r\n return COMPOSENAME;\r\n }\r\n}\r\nRegisterClass(COMPOSENAME, FlowGraphComposeMatrixBlock);\r\n\r\nconst QUATERNIONTOROTNAME = \"FGQuaternionToRotationMatrixBlock\";\r\n/**\r\n * Converts a quaternion to a rotation matrix.\r\n * @experimental\r\n */\r\nexport class FlowGraphQuaternionToRotationMatrixBlock extends FlowGraphUnaryOperationBlock<Quaternion, Matrix> {\r\n private _cachedMatrix = new Matrix();\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(RichTypeQuaternion, RichTypeMatrix, (value) => Matrix.FromQuaternionToRef(value, this._cachedMatrix), QUATERNIONTOROTNAME, config);\r\n }\r\n}\r\nRegisterClass(QUATERNIONTOROTNAME, FlowGraphQuaternionToRotationMatrixBlock);\r\n\r\nconst GETTRANSFORMNAME = \"FGGetTransformationMatrixBlock\";\r\n/**\r\n * Given the Transform Nodes A and B, gives the matrix required\r\n * to transform coordinates from A's local space to B's local space.\r\n */\r\nexport class FlowGraphGetTransformationMatrixBlock extends FlowGraphBinaryOperationBlock<TransformNode, TransformNode, Matrix> {\r\n private _cachedResult: Matrix = Matrix.Zero();\r\n constructor(config?: IFlowGraphBlockConfiguration) {\r\n super(\r\n RichTypeAny,\r\n RichTypeAny,\r\n RichTypeMatrix,\r\n (left: TransformNode, right: TransformNode) => {\r\n const aMatrix = left.getWorldMatrix();\r\n const bMatrix = right.getWorldMatrix();\r\n\r\n const inverseB = bMatrix.invertToRef(TmpVectors.Matrix[0]);\r\n const result = inverseB.multiplyToRef(aMatrix, this._cachedResult);\r\n return result;\r\n },\r\n GETTRANSFORMNAME,\r\n config\r\n );\r\n }\r\n}\r\nRegisterClass(GETTRANSFORMNAME, FlowGraphGetTransformationMatrixBlock);\r\n"]}
|