@babylonjs/core 7.0.0 → 7.2.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.d.ts +1 -1
- package/Animations/animationGroup.js +1 -1
- package/Animations/animationGroup.js.map +1 -1
- package/Animations/runtimeAnimation.js +10 -3
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Compute/computeEffect.d.ts +3 -4
- package/Compute/computeEffect.js +40 -33
- package/Compute/computeEffect.js.map +1 -1
- package/Compute/computeShader.d.ts +2 -2
- package/Compute/computeShader.js.map +1 -1
- package/Engines/Extensions/engine.computeShader.d.ts +27 -3
- package/Engines/Extensions/engine.computeShader.js +1 -1
- package/Engines/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.js +1 -1
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +12 -2
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.d.ts +1 -2
- package/Engines/WebGL/webGLRenderTargetWrapper.js +2 -3
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.computeShader.js +22 -0
- package/Engines/WebGPU/Extensions/engine.computeShader.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +3 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/webgpuClearQuad.d.ts +2 -2
- package/Engines/WebGPU/webgpuClearQuad.js +8 -3
- package/Engines/WebGPU/webgpuClearQuad.js.map +1 -1
- package/Engines/WebGPU/webgpuComputePipelineContext.js +4 -2
- package/Engines/WebGPU/webgpuComputePipelineContext.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +1 -0
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessor.js +15 -0
- package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.d.ts +1 -0
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +10 -2
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +7 -7
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/nativeEngine.d.ts +1 -0
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.d.ts +1 -0
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +14 -2
- package/Engines/renderTargetWrapper.js +23 -3
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.d.ts +3 -7
- package/Engines/thinEngine.js +23 -9
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +2 -2
- package/Engines/webgpuEngine.js +19 -9
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gizmos/axisScaleGizmo.js +6 -1
- package/Gizmos/axisScaleGizmo.js.map +1 -1
- package/Gizmos/boundingBoxGizmo.d.ts +2 -2
- package/Gizmos/boundingBoxGizmo.js +27 -17
- package/Gizmos/boundingBoxGizmo.js.map +1 -1
- package/Gizmos/scaleGizmo.d.ts +6 -0
- package/Gizmos/scaleGizmo.js +10 -2
- package/Gizmos/scaleGizmo.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +17 -2
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +5 -0
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +2 -0
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/addBlock.d.ts +2 -15
- package/Materials/Node/Blocks/addBlock.js +4 -32
- package/Materials/Node/Blocks/addBlock.js.map +1 -1
- package/Materials/Node/Blocks/baseMathBlock.d.ts +26 -0
- package/Materials/Node/Blocks/baseMathBlock.js +84 -0
- package/Materials/Node/Blocks/baseMathBlock.js.map +1 -0
- package/Materials/Node/Blocks/divideBlock.d.ts +2 -15
- package/Materials/Node/Blocks/divideBlock.js +4 -32
- package/Materials/Node/Blocks/divideBlock.js.map +1 -1
- package/Materials/Node/Blocks/multiplyBlock.d.ts +2 -15
- package/Materials/Node/Blocks/multiplyBlock.js +4 -32
- package/Materials/Node/Blocks/multiplyBlock.js.map +1 -1
- package/Materials/Node/Blocks/subtractBlock.d.ts +2 -15
- package/Materials/Node/Blocks/subtractBlock.js +4 -32
- package/Materials/Node/Blocks/subtractBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.d.ts +4 -0
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js +7 -0
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +1 -5
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrClearCoatConfiguration.d.ts +0 -1
- package/Materials/PBR/pbrClearCoatConfiguration.js +3 -12
- package/Materials/PBR/pbrClearCoatConfiguration.js.map +1 -1
- package/Materials/PBR/pbrIridescenceConfiguration.d.ts +1 -4
- package/Materials/PBR/pbrIridescenceConfiguration.js +5 -15
- package/Materials/PBR/pbrIridescenceConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSheenConfiguration.d.ts +0 -1
- package/Materials/PBR/pbrSheenConfiguration.js +3 -12
- package/Materials/PBR/pbrSheenConfiguration.js.map +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.js +5 -17
- package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +0 -6
- package/Materials/Textures/baseTexture.js +0 -8
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +8 -24
- package/Materials/Textures/renderTargetTexture.js +13 -8
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +5 -8
- package/Materials/Textures/texture.js +10 -20
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +1 -0
- package/Materials/Textures/textureCreationOptions.js.map +1 -1
- package/Materials/Textures/thinTexture.js +1 -1
- package/Materials/Textures/thinTexture.js.map +1 -1
- package/Materials/effect.d.ts +3 -3
- package/Materials/effect.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +3 -3
- package/Materials/shaderMaterial.js.map +1 -1
- package/Maths/math.vector.d.ts +12 -0
- package/Maths/math.vector.js +17 -2
- package/Maths/math.vector.js.map +1 -1
- package/Maths/tensor.d.ts +13 -11
- package/Maths/tensor.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.js +14 -0
- package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
- package/Meshes/Builders/ribbonBuilder.js +32 -28
- package/Meshes/Builders/ribbonBuilder.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +18 -6
- package/Meshes/GreasedLine/greasedLineBaseMesh.js +17 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineMesh.d.ts +0 -2
- package/Meshes/GreasedLine/greasedLineMesh.js +84 -77
- package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +19 -4
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/mathBlock.d.ts +6 -0
- package/Meshes/Node/Blocks/mathBlock.js +95 -23
- package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.d.ts +4 -0
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +7 -0
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
- package/Misc/greasedLineTools.d.ts +6 -0
- package/Misc/greasedLineTools.js +21 -0
- package/Misc/greasedLineTools.js.map +1 -1
- package/Rendering/depthPeelingRenderer.js +1 -1
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
- package/Rendering/reflectiveShadowMap.js +1 -1
- package/Rendering/reflectiveShadowMap.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockClearcoat.js +0 -4
- package/Shaders/ShadersInclude/pbrBlockClearcoat.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockIridescence.js +0 -3
- package/Shaders/ShadersInclude/pbrBlockIridescence.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockSheen.js +1 -5
- package/Shaders/ShadersInclude/pbrBlockSheen.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDebug.js +2 -0
- package/Shaders/ShadersInclude/pbrDebug.js.map +1 -1
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js +2 -2
- package/Shaders/ShadersInclude/pbrFragmentSamplersDeclaration.js.map +1 -1
- package/Shaders/greasedLine.vertex.js +3 -3
- package/Shaders/greasedLine.vertex.js.map +1 -1
- package/Shaders/pbr.fragment.js +4 -4
- package/Shaders/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/clearQuad.fragment.js +11 -0
- package/ShadersWGSL/clearQuad.fragment.js.map +1 -0
- package/ShadersWGSL/clearQuad.vertex.js +22 -0
- package/ShadersWGSL/clearQuad.vertex.js.map +1 -0
- package/XR/features/WebXRHandTracking.d.ts +5 -0
- package/XR/features/WebXRHandTracking.js +6 -0
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/node.js +1 -6
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/Shaders/clearQuad.fragment.js +0 -10
- package/Shaders/clearQuad.fragment.js.map +0 -1
- package/Shaders/clearQuad.vertex.js +0 -19
- package/Shaders/clearQuad.vertex.js.map +0 -1
- /package/{Shaders → ShadersWGSL}/clearQuad.fragment.d.ts +0 -0
- /package/{Shaders → ShadersWGSL}/clearQuad.vertex.d.ts +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { NodeMaterialBlock } from "../nodeMaterialBlock";
|
|
2
1
|
import type { NodeMaterialBuildState } from "../nodeMaterialBuildState";
|
|
3
|
-
import
|
|
2
|
+
import { BaseMathBlock } from "./baseMathBlock";
|
|
4
3
|
/**
|
|
5
4
|
* Block used to add 2 vectors
|
|
6
5
|
*/
|
|
7
|
-
export declare class AddBlock extends
|
|
6
|
+
export declare class AddBlock extends BaseMathBlock {
|
|
8
7
|
/**
|
|
9
8
|
* Creates a new AddBlock
|
|
10
9
|
* @param name defines the block name
|
|
@@ -15,17 +14,5 @@ export declare class AddBlock extends NodeMaterialBlock {
|
|
|
15
14
|
* @returns the class name
|
|
16
15
|
*/
|
|
17
16
|
getClassName(): string;
|
|
18
|
-
/**
|
|
19
|
-
* Gets the left operand input component
|
|
20
|
-
*/
|
|
21
|
-
get left(): NodeMaterialConnectionPoint;
|
|
22
|
-
/**
|
|
23
|
-
* Gets the right operand input component
|
|
24
|
-
*/
|
|
25
|
-
get right(): NodeMaterialConnectionPoint;
|
|
26
|
-
/**
|
|
27
|
-
* Gets the output component
|
|
28
|
-
*/
|
|
29
|
-
get output(): NodeMaterialConnectionPoint;
|
|
30
17
|
protected _buildBlock(state: NodeMaterialBuildState): this;
|
|
31
18
|
}
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { NodeMaterialBlock } from "../nodeMaterialBlock.js";
|
|
2
|
-
import { NodeMaterialBlockConnectionPointTypes } from "../Enums/nodeMaterialBlockConnectionPointTypes.js";
|
|
3
|
-
import { NodeMaterialBlockTargets } from "../Enums/nodeMaterialBlockTargets.js";
|
|
4
1
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
2
|
+
import { BaseMathBlock } from "./baseMathBlock.js";
|
|
5
3
|
/**
|
|
6
4
|
* Block used to add 2 vectors
|
|
7
5
|
*/
|
|
8
|
-
export class AddBlock extends
|
|
6
|
+
export class AddBlock extends BaseMathBlock {
|
|
9
7
|
/**
|
|
10
8
|
* Creates a new AddBlock
|
|
11
9
|
* @param name defines the block name
|
|
12
10
|
*/
|
|
13
11
|
constructor(name) {
|
|
14
|
-
super(name
|
|
15
|
-
this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
|
|
16
|
-
this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
|
|
17
|
-
this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
|
|
18
|
-
this._outputs[0]._typeConnectionSource = this._inputs[0];
|
|
19
|
-
this._linkConnectionTypes(0, 1, true);
|
|
20
|
-
this._inputs[0].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
|
|
21
|
-
this._inputs[1].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
|
|
12
|
+
super(name);
|
|
22
13
|
}
|
|
23
14
|
/**
|
|
24
15
|
* Gets the current class name
|
|
@@ -27,28 +18,9 @@ export class AddBlock extends NodeMaterialBlock {
|
|
|
27
18
|
getClassName() {
|
|
28
19
|
return "AddBlock";
|
|
29
20
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Gets the left operand input component
|
|
32
|
-
*/
|
|
33
|
-
get left() {
|
|
34
|
-
return this._inputs[0];
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Gets the right operand input component
|
|
38
|
-
*/
|
|
39
|
-
get right() {
|
|
40
|
-
return this._inputs[1];
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Gets the output component
|
|
44
|
-
*/
|
|
45
|
-
get output() {
|
|
46
|
-
return this._outputs[0];
|
|
47
|
-
}
|
|
48
21
|
_buildBlock(state) {
|
|
49
22
|
super._buildBlock(state);
|
|
50
|
-
|
|
51
|
-
state.compilationString += this._declareOutput(output, state) + ` = ${this.left.associatedVariableName} + ${this.right.associatedVariableName};\n`;
|
|
23
|
+
state.compilationString += this._declareOutput(this.output, state) + ` = ${this.left.associatedVariableName} + ${this.right.associatedVariableName};\n`;
|
|
52
24
|
return this;
|
|
53
25
|
}
|
|
54
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/addBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"addBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/addBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,aAAa;IACvC;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,UAAU,CAAC;IACtB,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,sBAAsB,MAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,KAAK,CAAC;QAExJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["import type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { BaseMathBlock } from \"./baseMathBlock\";\r\n\r\n/**\r\n * Block used to add 2 vectors\r\n */\r\nexport class AddBlock extends BaseMathBlock {\r\n /**\r\n * Creates a new AddBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"AddBlock\";\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n state.compilationString += this._declareOutput(this.output, state) + ` = ${this.left.associatedVariableName} + ${this.right.associatedVariableName};\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.AddBlock\", AddBlock);\r\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { NodeMaterialBlock } from "../nodeMaterialBlock";
|
|
2
|
+
import type { NodeMaterialConnectionPoint } from "../nodeMaterialBlockConnectionPoint";
|
|
3
|
+
/**
|
|
4
|
+
* Block used to perform a mathematical operation on 2 values
|
|
5
|
+
*/
|
|
6
|
+
export declare class BaseMathBlock extends NodeMaterialBlock {
|
|
7
|
+
private readonly _connectionObservers;
|
|
8
|
+
protected constructor(name: string);
|
|
9
|
+
/**
|
|
10
|
+
* Gets the left operand input component
|
|
11
|
+
*/
|
|
12
|
+
get left(): NodeMaterialConnectionPoint;
|
|
13
|
+
/**
|
|
14
|
+
* Gets the right operand input component
|
|
15
|
+
*/
|
|
16
|
+
get right(): NodeMaterialConnectionPoint;
|
|
17
|
+
/**
|
|
18
|
+
* Gets the output component
|
|
19
|
+
*/
|
|
20
|
+
get output(): NodeMaterialConnectionPoint;
|
|
21
|
+
private _updateInputOutputTypes;
|
|
22
|
+
/**
|
|
23
|
+
* Release resources
|
|
24
|
+
*/
|
|
25
|
+
dispose(): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { NodeMaterialBlockTargets } from "../Enums/nodeMaterialBlockTargets.js";
|
|
2
|
+
import { NodeMaterialBlock } from "../nodeMaterialBlock.js";
|
|
3
|
+
import { NodeMaterialBlockConnectionPointTypes } from "../Enums/nodeMaterialBlockConnectionPointTypes.js";
|
|
4
|
+
/**
|
|
5
|
+
* Block used to perform a mathematical operation on 2 values
|
|
6
|
+
*/
|
|
7
|
+
export class BaseMathBlock extends NodeMaterialBlock {
|
|
8
|
+
constructor(name) {
|
|
9
|
+
super(name, NodeMaterialBlockTargets.Neutral);
|
|
10
|
+
this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
|
|
11
|
+
this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
|
|
12
|
+
this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
|
|
13
|
+
this.output._typeConnectionSource = this.left;
|
|
14
|
+
this._linkConnectionTypes(0, 1, true);
|
|
15
|
+
this.left.acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
|
|
16
|
+
this.right.acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
|
|
17
|
+
this._connectionObservers = [
|
|
18
|
+
this.left.onConnectionObservable.add(() => this._updateInputOutputTypes()),
|
|
19
|
+
this.left.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),
|
|
20
|
+
this.right.onConnectionObservable.add(() => this._updateInputOutputTypes()),
|
|
21
|
+
this.right.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Gets the left operand input component
|
|
26
|
+
*/
|
|
27
|
+
get left() {
|
|
28
|
+
return this._inputs[0];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Gets the right operand input component
|
|
32
|
+
*/
|
|
33
|
+
get right() {
|
|
34
|
+
return this._inputs[1];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Gets the output component
|
|
38
|
+
*/
|
|
39
|
+
get output() {
|
|
40
|
+
return this._outputs[0];
|
|
41
|
+
}
|
|
42
|
+
_updateInputOutputTypes() {
|
|
43
|
+
// First update the output type with the initial assumption that we'll base it on the left input.
|
|
44
|
+
this.output._typeConnectionSource = this.left;
|
|
45
|
+
if (this.left.isConnected && this.right.isConnected) {
|
|
46
|
+
// Both inputs are connected, so we need to determine the output type based on the input types.
|
|
47
|
+
if (this.left.type === NodeMaterialBlockConnectionPointTypes.Int ||
|
|
48
|
+
(this.left.type === NodeMaterialBlockConnectionPointTypes.Float && this.right.type !== NodeMaterialBlockConnectionPointTypes.Int)) {
|
|
49
|
+
this.output._typeConnectionSource = this.right;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else if (this.left.isConnected !== this.right.isConnected) {
|
|
53
|
+
// Only one input is connected, so we need to determine the output type based on the connected input.
|
|
54
|
+
this.output._typeConnectionSource = this.left.isConnected ? this.left : this.right;
|
|
55
|
+
}
|
|
56
|
+
// Next update the accepted connection point types for the inputs based on the current input connection state.
|
|
57
|
+
if (this.left.isConnected || this.right.isConnected) {
|
|
58
|
+
for (const [first, second] of [
|
|
59
|
+
[this.left, this.right],
|
|
60
|
+
[this.right, this.left],
|
|
61
|
+
]) {
|
|
62
|
+
// Always allow Ints and Floats.
|
|
63
|
+
first.acceptedConnectionPointTypes = [NodeMaterialBlockConnectionPointTypes.Int, NodeMaterialBlockConnectionPointTypes.Float];
|
|
64
|
+
if (second.isConnected) {
|
|
65
|
+
// The same types as the connected input are always allowed.
|
|
66
|
+
first.acceptedConnectionPointTypes.push(second.type);
|
|
67
|
+
// If the other input is a scalar, then we also allow Vector/Color/Matrix types.
|
|
68
|
+
if (second.type === NodeMaterialBlockConnectionPointTypes.Int || second.type === NodeMaterialBlockConnectionPointTypes.Float) {
|
|
69
|
+
first.acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector2, NodeMaterialBlockConnectionPointTypes.Vector3, NodeMaterialBlockConnectionPointTypes.Vector4, NodeMaterialBlockConnectionPointTypes.Color3, NodeMaterialBlockConnectionPointTypes.Color4, NodeMaterialBlockConnectionPointTypes.Matrix);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Release resources
|
|
77
|
+
*/
|
|
78
|
+
dispose() {
|
|
79
|
+
super.dispose();
|
|
80
|
+
this._connectionObservers.forEach((observer) => observer.remove());
|
|
81
|
+
this._connectionObservers.length = 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=baseMathBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseMathBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/baseMathBlock.ts"],"names":[],"mappings":"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","sourcesContent":["import type { Observer } from \"core/Misc/observable\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\n\r\n/**\r\n * Block used to perform a mathematical operation on 2 values\r\n */\r\nexport class BaseMathBlock extends NodeMaterialBlock {\r\n private readonly _connectionObservers: Observer<NodeMaterialConnectionPoint>[];\r\n\r\n protected constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"left\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.output._typeConnectionSource = this.left;\r\n this._linkConnectionTypes(0, 1, true);\r\n\r\n this.left.acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n this.right.acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n\r\n this._connectionObservers = [\r\n this.left.onConnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.left.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.right.onConnectionObservable.add(() => this._updateInputOutputTypes()),\r\n this.right.onDisconnectionObservable.add(() => this._updateInputOutputTypes()),\r\n ];\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n private _updateInputOutputTypes() {\r\n // First update the output type with the initial assumption that we'll base it on the left input.\r\n this.output._typeConnectionSource = this.left;\r\n\r\n if (this.left.isConnected && this.right.isConnected) {\r\n // Both inputs are connected, so we need to determine the output type based on the input types.\r\n if (\r\n this.left.type === NodeMaterialBlockConnectionPointTypes.Int ||\r\n (this.left.type === NodeMaterialBlockConnectionPointTypes.Float && this.right.type !== NodeMaterialBlockConnectionPointTypes.Int)\r\n ) {\r\n this.output._typeConnectionSource = this.right;\r\n }\r\n } else if (this.left.isConnected !== this.right.isConnected) {\r\n // Only one input is connected, so we need to determine the output type based on the connected input.\r\n this.output._typeConnectionSource = this.left.isConnected ? this.left : this.right;\r\n }\r\n\r\n // Next update the accepted connection point types for the inputs based on the current input connection state.\r\n if (this.left.isConnected || this.right.isConnected) {\r\n for (const [first, second] of [\r\n [this.left, this.right],\r\n [this.right, this.left],\r\n ]) {\r\n // Always allow Ints and Floats.\r\n first.acceptedConnectionPointTypes = [NodeMaterialBlockConnectionPointTypes.Int, NodeMaterialBlockConnectionPointTypes.Float];\r\n\r\n if (second.isConnected) {\r\n // The same types as the connected input are always allowed.\r\n first.acceptedConnectionPointTypes.push(second.type);\r\n\r\n // If the other input is a scalar, then we also allow Vector/Color/Matrix types.\r\n if (second.type === NodeMaterialBlockConnectionPointTypes.Int || second.type === NodeMaterialBlockConnectionPointTypes.Float) {\r\n first.acceptedConnectionPointTypes.push(\r\n NodeMaterialBlockConnectionPointTypes.Vector2,\r\n NodeMaterialBlockConnectionPointTypes.Vector3,\r\n NodeMaterialBlockConnectionPointTypes.Vector4,\r\n NodeMaterialBlockConnectionPointTypes.Color3,\r\n NodeMaterialBlockConnectionPointTypes.Color4,\r\n NodeMaterialBlockConnectionPointTypes.Matrix\r\n );\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Release resources\r\n */\r\n public override dispose(): void {\r\n super.dispose();\r\n this._connectionObservers.forEach((observer) => observer.remove());\r\n this._connectionObservers.length = 0;\r\n }\r\n}\r\n"]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { NodeMaterialBlock } from "../nodeMaterialBlock";
|
|
2
1
|
import type { NodeMaterialBuildState } from "../nodeMaterialBuildState";
|
|
3
|
-
import
|
|
2
|
+
import { BaseMathBlock } from "./baseMathBlock";
|
|
4
3
|
/**
|
|
5
4
|
* Block used to divide 2 vectors
|
|
6
5
|
*/
|
|
7
|
-
export declare class DivideBlock extends
|
|
6
|
+
export declare class DivideBlock extends BaseMathBlock {
|
|
8
7
|
/**
|
|
9
8
|
* Creates a new DivideBlock
|
|
10
9
|
* @param name defines the block name
|
|
@@ -15,17 +14,5 @@ export declare class DivideBlock extends NodeMaterialBlock {
|
|
|
15
14
|
* @returns the class name
|
|
16
15
|
*/
|
|
17
16
|
getClassName(): string;
|
|
18
|
-
/**
|
|
19
|
-
* Gets the left operand input component
|
|
20
|
-
*/
|
|
21
|
-
get left(): NodeMaterialConnectionPoint;
|
|
22
|
-
/**
|
|
23
|
-
* Gets the right operand input component
|
|
24
|
-
*/
|
|
25
|
-
get right(): NodeMaterialConnectionPoint;
|
|
26
|
-
/**
|
|
27
|
-
* Gets the output component
|
|
28
|
-
*/
|
|
29
|
-
get output(): NodeMaterialConnectionPoint;
|
|
30
17
|
protected _buildBlock(state: NodeMaterialBuildState): this;
|
|
31
18
|
}
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { NodeMaterialBlock } from "../nodeMaterialBlock.js";
|
|
2
|
-
import { NodeMaterialBlockConnectionPointTypes } from "../Enums/nodeMaterialBlockConnectionPointTypes.js";
|
|
3
|
-
import { NodeMaterialBlockTargets } from "../Enums/nodeMaterialBlockTargets.js";
|
|
4
1
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
2
|
+
import { BaseMathBlock } from "./baseMathBlock.js";
|
|
5
3
|
/**
|
|
6
4
|
* Block used to divide 2 vectors
|
|
7
5
|
*/
|
|
8
|
-
export class DivideBlock extends
|
|
6
|
+
export class DivideBlock extends BaseMathBlock {
|
|
9
7
|
/**
|
|
10
8
|
* Creates a new DivideBlock
|
|
11
9
|
* @param name defines the block name
|
|
12
10
|
*/
|
|
13
11
|
constructor(name) {
|
|
14
|
-
super(name
|
|
15
|
-
this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
|
|
16
|
-
this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
|
|
17
|
-
this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
|
|
18
|
-
this._outputs[0]._typeConnectionSource = this._inputs[0];
|
|
19
|
-
this._linkConnectionTypes(0, 1, true);
|
|
20
|
-
this._inputs[0].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
|
|
21
|
-
this._inputs[1].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
|
|
12
|
+
super(name);
|
|
22
13
|
}
|
|
23
14
|
/**
|
|
24
15
|
* Gets the current class name
|
|
@@ -27,28 +18,9 @@ export class DivideBlock extends NodeMaterialBlock {
|
|
|
27
18
|
getClassName() {
|
|
28
19
|
return "DivideBlock";
|
|
29
20
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Gets the left operand input component
|
|
32
|
-
*/
|
|
33
|
-
get left() {
|
|
34
|
-
return this._inputs[0];
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Gets the right operand input component
|
|
38
|
-
*/
|
|
39
|
-
get right() {
|
|
40
|
-
return this._inputs[1];
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Gets the output component
|
|
44
|
-
*/
|
|
45
|
-
get output() {
|
|
46
|
-
return this._outputs[0];
|
|
47
|
-
}
|
|
48
21
|
_buildBlock(state) {
|
|
49
22
|
super._buildBlock(state);
|
|
50
|
-
|
|
51
|
-
state.compilationString += this._declareOutput(output, state) + ` = ${this.left.associatedVariableName} / ${this.right.associatedVariableName};\n`;
|
|
23
|
+
state.compilationString += this._declareOutput(this.output, state) + ` = ${this.left.associatedVariableName} / ${this.right.associatedVariableName};\n`;
|
|
52
24
|
return this;
|
|
53
25
|
}
|
|
54
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divideBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/divideBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"divideBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/divideBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,aAAa;IAC1C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,aAAa,CAAC;IACzB,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,sBAAsB,MAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,KAAK,CAAC;QAExJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { BaseMathBlock } from \"./baseMathBlock\";\r\n\r\n/**\r\n * Block used to divide 2 vectors\r\n */\r\nexport class DivideBlock extends BaseMathBlock {\r\n /**\r\n * Creates a new DivideBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"DivideBlock\";\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n state.compilationString += this._declareOutput(this.output, state) + ` = ${this.left.associatedVariableName} / ${this.right.associatedVariableName};\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.DivideBlock\", DivideBlock);\r\n"]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { NodeMaterialBlock } from "../nodeMaterialBlock";
|
|
2
1
|
import type { NodeMaterialBuildState } from "../nodeMaterialBuildState";
|
|
3
|
-
import
|
|
2
|
+
import { BaseMathBlock } from "./baseMathBlock";
|
|
4
3
|
/**
|
|
5
4
|
* Block used to multiply 2 values
|
|
6
5
|
*/
|
|
7
|
-
export declare class MultiplyBlock extends
|
|
6
|
+
export declare class MultiplyBlock extends BaseMathBlock {
|
|
8
7
|
/**
|
|
9
8
|
* Creates a new MultiplyBlock
|
|
10
9
|
* @param name defines the block name
|
|
@@ -15,17 +14,5 @@ export declare class MultiplyBlock extends NodeMaterialBlock {
|
|
|
15
14
|
* @returns the class name
|
|
16
15
|
*/
|
|
17
16
|
getClassName(): string;
|
|
18
|
-
/**
|
|
19
|
-
* Gets the left operand input component
|
|
20
|
-
*/
|
|
21
|
-
get left(): NodeMaterialConnectionPoint;
|
|
22
|
-
/**
|
|
23
|
-
* Gets the right operand input component
|
|
24
|
-
*/
|
|
25
|
-
get right(): NodeMaterialConnectionPoint;
|
|
26
|
-
/**
|
|
27
|
-
* Gets the output component
|
|
28
|
-
*/
|
|
29
|
-
get output(): NodeMaterialConnectionPoint;
|
|
30
17
|
protected _buildBlock(state: NodeMaterialBuildState): this;
|
|
31
18
|
}
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { NodeMaterialBlock } from "../nodeMaterialBlock.js";
|
|
2
|
-
import { NodeMaterialBlockConnectionPointTypes } from "../Enums/nodeMaterialBlockConnectionPointTypes.js";
|
|
3
|
-
import { NodeMaterialBlockTargets } from "../Enums/nodeMaterialBlockTargets.js";
|
|
4
1
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
2
|
+
import { BaseMathBlock } from "./baseMathBlock.js";
|
|
5
3
|
/**
|
|
6
4
|
* Block used to multiply 2 values
|
|
7
5
|
*/
|
|
8
|
-
export class MultiplyBlock extends
|
|
6
|
+
export class MultiplyBlock extends BaseMathBlock {
|
|
9
7
|
/**
|
|
10
8
|
* Creates a new MultiplyBlock
|
|
11
9
|
* @param name defines the block name
|
|
12
10
|
*/
|
|
13
11
|
constructor(name) {
|
|
14
|
-
super(name
|
|
15
|
-
this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
|
|
16
|
-
this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
|
|
17
|
-
this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
|
|
18
|
-
this._outputs[0]._typeConnectionSource = this._inputs[0];
|
|
19
|
-
this._linkConnectionTypes(0, 1, true);
|
|
20
|
-
this._inputs[0].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
|
|
21
|
-
this._inputs[1].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
|
|
12
|
+
super(name);
|
|
22
13
|
}
|
|
23
14
|
/**
|
|
24
15
|
* Gets the current class name
|
|
@@ -27,28 +18,9 @@ export class MultiplyBlock extends NodeMaterialBlock {
|
|
|
27
18
|
getClassName() {
|
|
28
19
|
return "MultiplyBlock";
|
|
29
20
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Gets the left operand input component
|
|
32
|
-
*/
|
|
33
|
-
get left() {
|
|
34
|
-
return this._inputs[0];
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Gets the right operand input component
|
|
38
|
-
*/
|
|
39
|
-
get right() {
|
|
40
|
-
return this._inputs[1];
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Gets the output component
|
|
44
|
-
*/
|
|
45
|
-
get output() {
|
|
46
|
-
return this._outputs[0];
|
|
47
|
-
}
|
|
48
21
|
_buildBlock(state) {
|
|
49
22
|
super._buildBlock(state);
|
|
50
|
-
|
|
51
|
-
state.compilationString += this._declareOutput(output, state) + ` = ${this.left.associatedVariableName} * ${this.right.associatedVariableName};\n`;
|
|
23
|
+
state.compilationString += this._declareOutput(this.output, state) + ` = ${this.left.associatedVariableName} * ${this.right.associatedVariableName};\n`;
|
|
52
24
|
return this;
|
|
53
25
|
}
|
|
54
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiplyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/multiplyBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"multiplyBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/multiplyBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAC5C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,eAAe,CAAC;IAC3B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,sBAAsB,MAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,KAAK,CAAC;QAExJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { BaseMathBlock } from \"./baseMathBlock\";\r\n\r\n/**\r\n * Block used to multiply 2 values\r\n */\r\nexport class MultiplyBlock extends BaseMathBlock {\r\n /**\r\n * Creates a new MultiplyBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"MultiplyBlock\";\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n state.compilationString += this._declareOutput(this.output, state) + ` = ${this.left.associatedVariableName} * ${this.right.associatedVariableName};\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MultiplyBlock\", MultiplyBlock);\r\n"]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { NodeMaterialBlock } from "../nodeMaterialBlock";
|
|
2
1
|
import type { NodeMaterialBuildState } from "../nodeMaterialBuildState";
|
|
3
|
-
import
|
|
2
|
+
import { BaseMathBlock } from "./baseMathBlock";
|
|
4
3
|
/**
|
|
5
4
|
* Block used to subtract 2 vectors
|
|
6
5
|
*/
|
|
7
|
-
export declare class SubtractBlock extends
|
|
6
|
+
export declare class SubtractBlock extends BaseMathBlock {
|
|
8
7
|
/**
|
|
9
8
|
* Creates a new SubtractBlock
|
|
10
9
|
* @param name defines the block name
|
|
@@ -15,17 +14,5 @@ export declare class SubtractBlock extends NodeMaterialBlock {
|
|
|
15
14
|
* @returns the class name
|
|
16
15
|
*/
|
|
17
16
|
getClassName(): string;
|
|
18
|
-
/**
|
|
19
|
-
* Gets the left operand input component
|
|
20
|
-
*/
|
|
21
|
-
get left(): NodeMaterialConnectionPoint;
|
|
22
|
-
/**
|
|
23
|
-
* Gets the right operand input component
|
|
24
|
-
*/
|
|
25
|
-
get right(): NodeMaterialConnectionPoint;
|
|
26
|
-
/**
|
|
27
|
-
* Gets the output component
|
|
28
|
-
*/
|
|
29
|
-
get output(): NodeMaterialConnectionPoint;
|
|
30
17
|
protected _buildBlock(state: NodeMaterialBuildState): this;
|
|
31
18
|
}
|
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
import { NodeMaterialBlock } from "../nodeMaterialBlock.js";
|
|
2
|
-
import { NodeMaterialBlockConnectionPointTypes } from "../Enums/nodeMaterialBlockConnectionPointTypes.js";
|
|
3
|
-
import { NodeMaterialBlockTargets } from "../Enums/nodeMaterialBlockTargets.js";
|
|
4
1
|
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
2
|
+
import { BaseMathBlock } from "./baseMathBlock.js";
|
|
5
3
|
/**
|
|
6
4
|
* Block used to subtract 2 vectors
|
|
7
5
|
*/
|
|
8
|
-
export class SubtractBlock extends
|
|
6
|
+
export class SubtractBlock extends BaseMathBlock {
|
|
9
7
|
/**
|
|
10
8
|
* Creates a new SubtractBlock
|
|
11
9
|
* @param name defines the block name
|
|
12
10
|
*/
|
|
13
11
|
constructor(name) {
|
|
14
|
-
super(name
|
|
15
|
-
this.registerInput("left", NodeMaterialBlockConnectionPointTypes.AutoDetect);
|
|
16
|
-
this.registerInput("right", NodeMaterialBlockConnectionPointTypes.AutoDetect);
|
|
17
|
-
this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
|
|
18
|
-
this._outputs[0]._typeConnectionSource = this._inputs[0];
|
|
19
|
-
this._linkConnectionTypes(0, 1, true);
|
|
20
|
-
this._inputs[0].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
|
|
21
|
-
this._inputs[1].acceptedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);
|
|
12
|
+
super(name);
|
|
22
13
|
}
|
|
23
14
|
/**
|
|
24
15
|
* Gets the current class name
|
|
@@ -27,28 +18,9 @@ export class SubtractBlock extends NodeMaterialBlock {
|
|
|
27
18
|
getClassName() {
|
|
28
19
|
return "SubtractBlock";
|
|
29
20
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Gets the left operand input component
|
|
32
|
-
*/
|
|
33
|
-
get left() {
|
|
34
|
-
return this._inputs[0];
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Gets the right operand input component
|
|
38
|
-
*/
|
|
39
|
-
get right() {
|
|
40
|
-
return this._inputs[1];
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Gets the output component
|
|
44
|
-
*/
|
|
45
|
-
get output() {
|
|
46
|
-
return this._outputs[0];
|
|
47
|
-
}
|
|
48
21
|
_buildBlock(state) {
|
|
49
22
|
super._buildBlock(state);
|
|
50
|
-
|
|
51
|
-
state.compilationString += this._declareOutput(output, state) + ` = ${this.left.associatedVariableName} - ${this.right.associatedVariableName};\n`;
|
|
23
|
+
state.compilationString += this._declareOutput(this.output, state) + ` = ${this.left.associatedVariableName} - ${this.right.associatedVariableName};\n`;
|
|
52
24
|
return this;
|
|
53
25
|
}
|
|
54
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subtractBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/subtractBlock.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subtractBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/subtractBlock.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,aAAa;IAC5C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,eAAe,CAAC;IAC3B,CAAC;IAES,WAAW,CAAC,KAA6B;QAC/C,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,sBAAsB,MAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,KAAK,CAAC;QAExJ,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { BaseMathBlock } from \"./baseMathBlock\";\r\n\r\n/**\r\n * Block used to subtract 2 vectors\r\n */\r\nexport class SubtractBlock extends BaseMathBlock {\r\n /**\r\n * Creates a new SubtractBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"SubtractBlock\";\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n state.compilationString += this._declareOutput(this.output, state) + ` = ${this.left.associatedVariableName} - ${this.right.associatedVariableName};\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SubtractBlock\", SubtractBlock);\r\n"]}
|
|
@@ -71,6 +71,10 @@ export declare class NodeMaterialConnectionPoint {
|
|
|
71
71
|
* Observable triggered when this point is connected
|
|
72
72
|
*/
|
|
73
73
|
onConnectionObservable: Observable<NodeMaterialConnectionPoint>;
|
|
74
|
+
/**
|
|
75
|
+
* Observable triggered when this point is disconnected
|
|
76
|
+
*/
|
|
77
|
+
onDisconnectionObservable: Observable<NodeMaterialConnectionPoint>;
|
|
74
78
|
/**
|
|
75
79
|
* Gets or sets the associated variable name in the shader
|
|
76
80
|
*/
|
|
@@ -291,6 +291,10 @@ export class NodeMaterialConnectionPoint {
|
|
|
291
291
|
* Observable triggered when this point is connected
|
|
292
292
|
*/
|
|
293
293
|
this.onConnectionObservable = new Observable();
|
|
294
|
+
/**
|
|
295
|
+
* Observable triggered when this point is disconnected
|
|
296
|
+
*/
|
|
297
|
+
this.onDisconnectionObservable = new Observable();
|
|
294
298
|
/**
|
|
295
299
|
* Gets or sets a boolean indicating that this connection point is exposed on a frame
|
|
296
300
|
*/
|
|
@@ -402,6 +406,8 @@ export class NodeMaterialConnectionPoint {
|
|
|
402
406
|
endpoint._connectedPoint = null;
|
|
403
407
|
this._enforceAssociatedVariableName = false;
|
|
404
408
|
endpoint._enforceAssociatedVariableName = false;
|
|
409
|
+
this.onDisconnectionObservable.notifyObservers(endpoint);
|
|
410
|
+
endpoint.onDisconnectionObservable.notifyObservers(this);
|
|
405
411
|
return this;
|
|
406
412
|
}
|
|
407
413
|
/**
|
|
@@ -444,6 +450,7 @@ export class NodeMaterialConnectionPoint {
|
|
|
444
450
|
*/
|
|
445
451
|
dispose() {
|
|
446
452
|
this.onConnectionObservable.clear();
|
|
453
|
+
this.onDisconnectionObservable.clear();
|
|
447
454
|
}
|
|
448
455
|
}
|
|
449
456
|
//# sourceMappingURL=nodeMaterialBlockConnectionPoint.js.map
|