@babylonjs/core 7.29.0 → 7.30.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/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +4 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.d.ts +2 -1
- package/Engines/nullEngine.d.ts +1 -0
- package/Engines/nullEngine.js +1 -0
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +4 -0
- package/Engines/webgpuEngine.js +1 -3
- package/Engines/webgpuEngine.js.map +1 -1
- package/Materials/Textures/rawTexture3D.d.ts +12 -0
- package/Materials/Textures/rawTexture3D.js +18 -0
- package/Materials/Textures/rawTexture3D.js.map +1 -1
- package/Materials/effect.d.ts +11 -0
- package/Materials/effect.js +20 -0
- package/Materials/effect.js.map +1 -1
- package/Materials/materialPluginBase.d.ts +46 -46
- package/Materials/materialPluginBase.js +46 -60
- package/Materials/materialPluginBase.js.map +1 -1
- package/Meshes/Node/Blocks/Set/latticeBlock.d.ts +91 -0
- package/Meshes/Node/Blocks/Set/latticeBlock.js +194 -0
- package/Meshes/Node/Blocks/Set/latticeBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryClampBlock.d.ts +8 -0
- package/Meshes/Node/Blocks/geometryClampBlock.js +22 -6
- package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryInputBlock.js +2 -0
- package/Meshes/Node/Blocks/geometryInputBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryInterceptorBlock.d.ts +5 -0
- package/Meshes/Node/Blocks/geometryInterceptorBlock.js +5 -1
- package/Meshes/Node/Blocks/geometryInterceptorBlock.js.map +1 -1
- package/Meshes/Node/Enums/nodeGeometryContextualSources.d.ts +5 -1
- package/Meshes/Node/Enums/nodeGeometryContextualSources.js +4 -0
- package/Meshes/Node/Enums/nodeGeometryContextualSources.js.map +1 -1
- package/Meshes/Node/index.d.ts +1 -0
- package/Meshes/Node/index.js +1 -0
- package/Meshes/Node/index.js.map +1 -1
- package/Meshes/Node/nodeGeometryBuildState.js +12 -0
- package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
- package/Meshes/index.d.ts +1 -0
- package/Meshes/index.js +1 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/lattice.d.ts +18 -1
- package/Meshes/lattice.js +34 -6
- package/Meshes/lattice.js.map +1 -1
- package/Meshes/lattice.material.d.ts +82 -0
- package/Meshes/lattice.material.js +259 -0
- package/Meshes/lattice.material.js.map +1 -0
- package/Misc/screenshotTools.js +0 -3
- package/Misc/screenshotTools.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +1 -1
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +1 -1
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/Sprites/spriteManager.d.ts +10 -1
- package/Sprites/spriteManager.js +3 -2
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spritePackedManager.d.ts +6 -1
- package/Sprites/spritePackedManager.js +6 -2
- package/Sprites/spritePackedManager.js.map +1 -1
- package/Sprites/spriteRenderer.d.ts +16 -3
- package/Sprites/spriteRenderer.js +5 -3
- package/Sprites/spriteRenderer.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { __decorate } from "../../../../tslib.es6.js";
|
|
2
|
+
import { NodeGeometryBlock } from "../../nodeGeometryBlock.js";
|
|
3
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
|
+
import { NodeGeometryBlockConnectionPointTypes } from "../../Enums/nodeGeometryConnectionPointTypes.js";
|
|
5
|
+
import { Vector3 } from "../../../../Maths/math.vector.js";
|
|
6
|
+
import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
|
|
7
|
+
import { Lattice } from "../../../lattice.js";
|
|
8
|
+
import { extractMinAndMax } from "../../../../Maths/math.functions.js";
|
|
9
|
+
/**
|
|
10
|
+
* Block used to apply Lattice on geometry
|
|
11
|
+
*/
|
|
12
|
+
export class LatticeBlock extends NodeGeometryBlock {
|
|
13
|
+
/**
|
|
14
|
+
* Create a new LatticeBlock
|
|
15
|
+
* @param name defines the block name
|
|
16
|
+
*/
|
|
17
|
+
constructor(name) {
|
|
18
|
+
super(name);
|
|
19
|
+
this._indexVector3 = new Vector3();
|
|
20
|
+
this._currentControl = new Vector3();
|
|
21
|
+
/**
|
|
22
|
+
* Gets or sets a boolean indicating that this block can evaluate context
|
|
23
|
+
* Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
|
|
24
|
+
*/
|
|
25
|
+
this.evaluateContext = true;
|
|
26
|
+
/**
|
|
27
|
+
* Resolution on x axis
|
|
28
|
+
*/
|
|
29
|
+
this.resolutionX = 3;
|
|
30
|
+
/**
|
|
31
|
+
* Resolution on y axis
|
|
32
|
+
*/
|
|
33
|
+
this.resolutionY = 3;
|
|
34
|
+
/**
|
|
35
|
+
* Resolution on z axis
|
|
36
|
+
*/
|
|
37
|
+
this.resolutionZ = 3;
|
|
38
|
+
this.registerInput("geometry", NodeGeometryBlockConnectionPointTypes.Geometry);
|
|
39
|
+
this.registerInput("controls", NodeGeometryBlockConnectionPointTypes.Vector3);
|
|
40
|
+
this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Gets the current index in the current flow
|
|
44
|
+
* @returns the current index
|
|
45
|
+
*/
|
|
46
|
+
getExecutionIndex() {
|
|
47
|
+
return this._currentIndexX + this.resolutionX * (this._currentIndexY + this.resolutionY * this._currentIndexZ);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Gets the current loop index in the current flow
|
|
51
|
+
* @returns the current loop index
|
|
52
|
+
*/
|
|
53
|
+
getExecutionLoopIndex() {
|
|
54
|
+
return this.getExecutionIndex();
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Gets the current face index in the current flow
|
|
58
|
+
* @returns the current face index
|
|
59
|
+
*/
|
|
60
|
+
getExecutionFaceIndex() {
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Gets the current class name
|
|
65
|
+
* @returns the class name
|
|
66
|
+
*/
|
|
67
|
+
getClassName() {
|
|
68
|
+
return "LatticeBlock";
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Gets the geometry input component
|
|
72
|
+
*/
|
|
73
|
+
get geometry() {
|
|
74
|
+
return this._inputs[0];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Gets the controls input component
|
|
78
|
+
*/
|
|
79
|
+
get controls() {
|
|
80
|
+
return this._inputs[1];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Gets the geometry output component
|
|
84
|
+
*/
|
|
85
|
+
get output() {
|
|
86
|
+
return this._outputs[0];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Gets the value associated with a contextual positions
|
|
90
|
+
* In this case it will be the current position in the lattice
|
|
91
|
+
* @returns the current position in the lattice
|
|
92
|
+
*/
|
|
93
|
+
getOverridePositionsContextualValue() {
|
|
94
|
+
return this._indexVector3;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Gets the value associated with a contextual normals
|
|
98
|
+
* In this case it will be the current control point being processed
|
|
99
|
+
* @returns the current control point being processed
|
|
100
|
+
*/
|
|
101
|
+
getOverrideNormalsContextualValue() {
|
|
102
|
+
return this._currentControl;
|
|
103
|
+
}
|
|
104
|
+
_buildBlock(state) {
|
|
105
|
+
const func = (state) => {
|
|
106
|
+
state.pushExecutionContext(this);
|
|
107
|
+
this._vertexData = this.geometry.getConnectedValue(state);
|
|
108
|
+
if (this._vertexData) {
|
|
109
|
+
this._vertexData = this._vertexData.clone(); // Preserve source data
|
|
110
|
+
}
|
|
111
|
+
if (!this._vertexData || !this._vertexData.positions) {
|
|
112
|
+
state.restoreExecutionContext();
|
|
113
|
+
this.output._storedValue = null;
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const positions = this._vertexData.positions;
|
|
117
|
+
const boundingInfo = extractMinAndMax(positions, 0, positions.length / 3);
|
|
118
|
+
// Building the lattice
|
|
119
|
+
this._lattice = new Lattice({
|
|
120
|
+
resolutionX: this.resolutionX,
|
|
121
|
+
resolutionY: this.resolutionY,
|
|
122
|
+
resolutionZ: this.resolutionZ,
|
|
123
|
+
size: boundingInfo.maximum.subtract(boundingInfo.minimum),
|
|
124
|
+
});
|
|
125
|
+
for (this._currentIndexX = 0; this._currentIndexX < this.resolutionX; this._currentIndexX++) {
|
|
126
|
+
for (this._currentIndexY = 0; this._currentIndexY < this.resolutionY; this._currentIndexY++) {
|
|
127
|
+
for (this._currentIndexZ = 0; this._currentIndexZ < this.resolutionZ; this._currentIndexZ++) {
|
|
128
|
+
this._indexVector3.set(this._currentIndexX, this._currentIndexY, this._currentIndexZ);
|
|
129
|
+
const latticeControl = this._lattice.data[this._currentIndexX][this._currentIndexY][this._currentIndexZ];
|
|
130
|
+
this._currentControl.copyFrom(latticeControl);
|
|
131
|
+
const tempVector3 = this.controls.getConnectedValue(state);
|
|
132
|
+
if (tempVector3) {
|
|
133
|
+
latticeControl.set(tempVector3.x, tempVector3.y, tempVector3.z);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
// Apply lattice
|
|
139
|
+
this._lattice.deform(positions);
|
|
140
|
+
// Storage
|
|
141
|
+
state.restoreExecutionContext();
|
|
142
|
+
return this._vertexData;
|
|
143
|
+
};
|
|
144
|
+
if (this.evaluateContext) {
|
|
145
|
+
this.output._storedFunction = func;
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
this.output._storedFunction = null;
|
|
149
|
+
this.output._storedValue = func(state);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
_dumpPropertiesCode() {
|
|
153
|
+
let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
|
|
154
|
+
codeString += `${this._codeVariableName}.resolutionX = ${this.resolutionX};\n`;
|
|
155
|
+
codeString += `${this._codeVariableName}.resolutionY = ${this.resolutionY};\n`;
|
|
156
|
+
codeString += `${this._codeVariableName}.resolutionZ = ${this.resolutionZ};\n`;
|
|
157
|
+
return codeString;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Serializes this block in a JSON representation
|
|
161
|
+
* @returns the serialized block object
|
|
162
|
+
*/
|
|
163
|
+
serialize() {
|
|
164
|
+
const serializationObject = super.serialize();
|
|
165
|
+
serializationObject.evaluateContext = this.evaluateContext;
|
|
166
|
+
serializationObject.resolutionX = this.resolutionX;
|
|
167
|
+
serializationObject.resolutionY = this.resolutionY;
|
|
168
|
+
serializationObject.resolutionZ = this.resolutionZ;
|
|
169
|
+
return serializationObject;
|
|
170
|
+
}
|
|
171
|
+
_deserialize(serializationObject) {
|
|
172
|
+
super._deserialize(serializationObject);
|
|
173
|
+
if (serializationObject.evaluateContext !== undefined) {
|
|
174
|
+
this.evaluateContext = serializationObject.evaluateContext;
|
|
175
|
+
this.resolutionX = serializationObject.resolutionX;
|
|
176
|
+
this.resolutionY = serializationObject.resolutionY;
|
|
177
|
+
this.resolutionZ = serializationObject.resolutionZ;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
__decorate([
|
|
182
|
+
editableInPropertyPage("Evaluate context", 0 /* PropertyTypeForEdition.Boolean */, "ADVANCED", { notifiers: { rebuild: true } })
|
|
183
|
+
], LatticeBlock.prototype, "evaluateContext", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
editableInPropertyPage("resolutionX", 2 /* PropertyTypeForEdition.Int */, "ADVANCED", { notifiers: { rebuild: true }, min: 1, max: 10 })
|
|
186
|
+
], LatticeBlock.prototype, "resolutionX", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
editableInPropertyPage("resolutionY", 2 /* PropertyTypeForEdition.Int */, "ADVANCED", { notifiers: { rebuild: true }, min: 1, max: 10 })
|
|
189
|
+
], LatticeBlock.prototype, "resolutionY", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
editableInPropertyPage("resolutionZ", 2 /* PropertyTypeForEdition.Int */, "ADVANCED", { notifiers: { rebuild: true }, min: 1, max: 10 })
|
|
192
|
+
], LatticeBlock.prototype, "resolutionZ", void 0);
|
|
193
|
+
RegisterClass("BABYLON.LatticeBlock", LatticeBlock);
|
|
194
|
+
//# sourceMappingURL=latticeBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latticeBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Set/latticeBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AAIrG,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAA0B,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,OAAO,EAAE,4BAA4B;AAC9C,OAAO,EAAE,gBAAgB,EAAE,4CAAkC;AAE7D;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,iBAAiB;IAkC/C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAjCR,kBAAa,GAAG,IAAI,OAAO,EAAE,CAAC;QAC9B,oBAAe,GAAG,IAAI,OAAO,EAAE,CAAC;QAExC;;;WAGG;QAEI,oBAAe,GAAG,IAAI,CAAC;QAE9B;;WAEG;QAEI,gBAAW,GAAG,C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EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;iDAC1G;AAMhB;IADN,sBAAsB,CAAC,aAAa,sCAA8B,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;iDAC1G;AAMhB;IADN,sBAAsB,CAAC,aAAa,sCAA8B,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;iDAC1G;AAmL3B,aAAa,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryBuildState } from \"../../nodeGeometryBuildState\";\r\nimport type { INodeGeometryExecutionContext } from \"../../Interfaces/nodeGeometryExecutionContext\";\r\nimport type { VertexData } from \"../../../mesh.vertexData\";\r\nimport { Vector3 } from \"../../../../Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\nimport { Lattice } from \"core/Meshes/lattice\";\r\nimport { extractMinAndMax } from \"core/Maths/math.functions\";\r\n\r\n/**\r\n * Block used to apply Lattice on geometry\r\n */\r\nexport class LatticeBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {\r\n private _vertexData: VertexData;\r\n private _currentIndexX: number;\r\n private _currentIndexY: number;\r\n private _currentIndexZ: number;\r\n private _lattice: Lattice;\r\n private _indexVector3 = new Vector3();\r\n private _currentControl = new Vector3();\r\n\r\n /**\r\n * Gets or sets a boolean indicating that this block can evaluate context\r\n * Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change\r\n */\r\n @editableInPropertyPage(\"Evaluate context\", PropertyTypeForEdition.Boolean, \"ADVANCED\", { notifiers: { rebuild: true } })\r\n public evaluateContext = true;\r\n\r\n /**\r\n * Resolution on x axis\r\n */\r\n @editableInPropertyPage(\"resolutionX\", PropertyTypeForEdition.Int, \"ADVANCED\", { notifiers: { rebuild: true }, min: 1, max: 10 })\r\n public resolutionX = 3;\r\n\r\n /**\r\n * Resolution on y axis\r\n */\r\n @editableInPropertyPage(\"resolutionY\", PropertyTypeForEdition.Int, \"ADVANCED\", { notifiers: { rebuild: true }, min: 1, max: 10 })\r\n public resolutionY = 3;\r\n\r\n /**\r\n * Resolution on z axis\r\n */\r\n @editableInPropertyPage(\"resolutionZ\", PropertyTypeForEdition.Int, \"ADVANCED\", { notifiers: { rebuild: true }, min: 1, max: 10 })\r\n public resolutionZ = 3;\r\n\r\n /**\r\n * Create a new LatticeBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"geometry\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this.registerInput(\"controls\", NodeGeometryBlockConnectionPointTypes.Vector3);\r\n\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\r\n }\r\n\r\n /**\r\n * Gets the current index in the current flow\r\n * @returns the current index\r\n */\r\n public getExecutionIndex(): number {\r\n return this._currentIndexX + this.resolutionX * (this._currentIndexY + this.resolutionY * this._currentIndexZ);\r\n }\r\n\r\n /**\r\n * Gets the current loop index in the current flow\r\n * @returns the current loop index\r\n */\r\n public getExecutionLoopIndex(): number {\r\n return this.getExecutionIndex();\r\n }\r\n\r\n /**\r\n * Gets the current face index in the current flow\r\n * @returns the current face index\r\n */\r\n public getExecutionFaceIndex(): number {\r\n return 0;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"LatticeBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry input component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the controls input component\r\n */\r\n public get controls(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Gets the value associated with a contextual positions\r\n * In this case it will be the current position in the lattice\r\n * @returns the current position in the lattice\r\n */\r\n public getOverridePositionsContextualValue() {\r\n return this._indexVector3;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a contextual normals\r\n * In this case it will be the current control point being processed\r\n * @returns the current control point being processed\r\n */\r\n public getOverrideNormalsContextualValue() {\r\n return this._currentControl;\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n const func = (state: NodeGeometryBuildState) => {\r\n state.pushExecutionContext(this);\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n\r\n if (this._vertexData) {\r\n this._vertexData = this._vertexData.clone(); // Preserve source data\r\n }\r\n\r\n if (!this._vertexData || !this._vertexData.positions) {\r\n state.restoreExecutionContext();\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n const positions = this._vertexData.positions;\r\n const boundingInfo = extractMinAndMax(positions!, 0, positions!.length / 3);\r\n\r\n // Building the lattice\r\n this._lattice = new Lattice({\r\n resolutionX: this.resolutionX,\r\n resolutionY: this.resolutionY,\r\n resolutionZ: this.resolutionZ,\r\n size: boundingInfo.maximum.subtract(boundingInfo.minimum),\r\n });\r\n\r\n for (this._currentIndexX = 0; this._currentIndexX < this.resolutionX; this._currentIndexX++) {\r\n for (this._currentIndexY = 0; this._currentIndexY < this.resolutionY; this._currentIndexY++) {\r\n for (this._currentIndexZ = 0; this._currentIndexZ < this.resolutionZ; this._currentIndexZ++) {\r\n this._indexVector3.set(this._currentIndexX, this._currentIndexY, this._currentIndexZ);\r\n const latticeControl = this._lattice.data[this._currentIndexX][this._currentIndexY][this._currentIndexZ];\r\n this._currentControl.copyFrom(latticeControl);\r\n const tempVector3 = this.controls.getConnectedValue(state) as Vector3;\r\n\r\n if (tempVector3) {\r\n latticeControl.set(tempVector3.x, tempVector3.y, tempVector3.z);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Apply lattice\r\n this._lattice.deform(positions);\r\n\r\n // Storage\r\n state.restoreExecutionContext();\r\n return this._vertexData;\r\n };\r\n\r\n if (this.evaluateContext) {\r\n this.output._storedFunction = func;\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = func(state);\r\n }\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? \"true\" : \"false\"};\\n`;\r\n\r\n codeString += `${this._codeVariableName}.resolutionX = ${this.resolutionX};\\n`;\r\n codeString += `${this._codeVariableName}.resolutionY = ${this.resolutionY};\\n`;\r\n codeString += `${this._codeVariableName}.resolutionZ = ${this.resolutionZ};\\n`;\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @returns the serialized block object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.evaluateContext = this.evaluateContext;\r\n serializationObject.resolutionX = this.resolutionX;\r\n serializationObject.resolutionY = this.resolutionY;\r\n serializationObject.resolutionZ = this.resolutionZ;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n if (serializationObject.evaluateContext !== undefined) {\r\n this.evaluateContext = serializationObject.evaluateContext;\r\n this.resolutionX = serializationObject.resolutionX;\r\n this.resolutionY = serializationObject.resolutionY;\r\n this.resolutionZ = serializationObject.resolutionZ;\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.LatticeBlock\", LatticeBlock);\r\n"]}
|
|
@@ -22,6 +22,14 @@ export declare class GeometryClampBlock extends NodeGeometryBlock {
|
|
|
22
22
|
* Gets the value input component
|
|
23
23
|
*/
|
|
24
24
|
get value(): NodeGeometryConnectionPoint;
|
|
25
|
+
/**
|
|
26
|
+
* Gets the min input component
|
|
27
|
+
*/
|
|
28
|
+
get min(): NodeGeometryConnectionPoint;
|
|
29
|
+
/**
|
|
30
|
+
* Gets the max input component
|
|
31
|
+
*/
|
|
32
|
+
get max(): NodeGeometryConnectionPoint;
|
|
25
33
|
/**
|
|
26
34
|
* Gets the output component
|
|
27
35
|
*/
|
|
@@ -19,6 +19,8 @@ export class GeometryClampBlock extends NodeGeometryBlock {
|
|
|
19
19
|
/** Gets or sets the maximum range */
|
|
20
20
|
this.maximum = 1.0;
|
|
21
21
|
this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
|
|
22
|
+
this.registerInput("min", NodeGeometryBlockConnectionPointTypes.Float, true);
|
|
23
|
+
this.registerInput("max", NodeGeometryBlockConnectionPointTypes.Float, true);
|
|
22
24
|
this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.BasedOnInput);
|
|
23
25
|
this._outputs[0]._typeConnectionSource = this._inputs[0];
|
|
24
26
|
this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
|
|
@@ -38,6 +40,18 @@ export class GeometryClampBlock extends NodeGeometryBlock {
|
|
|
38
40
|
get value() {
|
|
39
41
|
return this._inputs[0];
|
|
40
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Gets the min input component
|
|
45
|
+
*/
|
|
46
|
+
get min() {
|
|
47
|
+
return this._inputs[1];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Gets the max input component
|
|
51
|
+
*/
|
|
52
|
+
get max() {
|
|
53
|
+
return this._inputs[2];
|
|
54
|
+
}
|
|
41
55
|
/**
|
|
42
56
|
* Gets the output component
|
|
43
57
|
*/
|
|
@@ -50,24 +64,26 @@ export class GeometryClampBlock extends NodeGeometryBlock {
|
|
|
50
64
|
this.output._storedValue = null;
|
|
51
65
|
return;
|
|
52
66
|
}
|
|
53
|
-
const func = (value) => {
|
|
54
|
-
return Math.max(
|
|
67
|
+
const func = (value, min, max) => {
|
|
68
|
+
return Math.max(min, Math.min(value, max));
|
|
55
69
|
};
|
|
56
70
|
this.output._storedFunction = (state) => {
|
|
57
71
|
const value = this.value.getConnectedValue(state);
|
|
72
|
+
const min = this.min.isConnected ? this.min.getConnectedValue(state) : this.minimum;
|
|
73
|
+
const max = this.max.isConnected ? this.max.getConnectedValue(state) : this.maximum;
|
|
58
74
|
switch (this.value.type) {
|
|
59
75
|
case NodeGeometryBlockConnectionPointTypes.Int:
|
|
60
76
|
case NodeGeometryBlockConnectionPointTypes.Float: {
|
|
61
|
-
return func(value);
|
|
77
|
+
return func(value, min, max);
|
|
62
78
|
}
|
|
63
79
|
case NodeGeometryBlockConnectionPointTypes.Vector2: {
|
|
64
|
-
return new Vector2(func(value.x), func(value.y));
|
|
80
|
+
return new Vector2(func(value.x, min, max), func(value.y, min, max));
|
|
65
81
|
}
|
|
66
82
|
case NodeGeometryBlockConnectionPointTypes.Vector3: {
|
|
67
|
-
return new Vector3(func(value.x), func(value.y), func(value.z));
|
|
83
|
+
return new Vector3(func(value.x, min, max), func(value.y, min, max), func(value.z, min, max));
|
|
68
84
|
}
|
|
69
85
|
case NodeGeometryBlockConnectionPointTypes.Vector4: {
|
|
70
|
-
return new Vector4(func(value.x), func(value.y), func(value.z), func(value.w));
|
|
86
|
+
return new Vector4(func(value.x, min, max), func(value.y, min, max), func(value.z, min, max), func(value.w, min, max));
|
|
71
87
|
}
|
|
72
88
|
}
|
|
73
89
|
return 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometryClampBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometry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CAAC,SAAS,uCAA+B;mDAC3C;AAGd;IADN,sBAAsB,CAAC,SAAS,uCAA+B;mDAC3C;AAqHzB,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../Decorators/nodeDecorator\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { Vector2, Vector3, Vector4 } from \"core/Maths/math.vector\";\r\n\r\n/**\r\n * Block used to clamp a float\r\n */\r\nexport class GeometryClampBlock extends NodeGeometryBlock {\r\n /** Gets or sets the minimum range */\r\n @editableInPropertyPage(\"Minimum\", PropertyTypeForEdition.Float)\r\n public minimum = 0.0;\r\n /** Gets or sets the maximum range */\r\n @editableInPropertyPage(\"Maximum\", PropertyTypeForEdition.Float)\r\n public maximum = 1.0;\r\n\r\n /**\r\n * Creates a new GeometryClampBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"value\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"min\", NodeGeometryBlockConnectionPointTypes.Float, true);\r\n this.registerInput(\"max\", NodeGeometryBlockConnectionPointTypes.Float, true);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Geometry);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Texture);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometryClampBlock\";\r\n }\r\n\r\n /**\r\n * Gets the value input component\r\n */\r\n public get value(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the min input component\r\n */\r\n public get min(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the max input component\r\n */\r\n public get max(): NodeGeometryConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock() {\r\n if (!this.value.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n const func = (value: number, min: number, max: number) => {\r\n return Math.max(min, Math.min(value, max));\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const value = this.value.getConnectedValue(state);\r\n const min = this.min.isConnected ? this.min.getConnectedValue(state) : this.minimum;\r\n const max = this.max.isConnected ? this.max.getConnectedValue(state) : this.maximum;\r\n\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(value, min, max);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func!(value.x, min, max), func!(value.y, min, max));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func!(value.x, min, max), func!(value.y, min, max), func!(value.z, min, max));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func!(value.x, min, max), func!(value.y, min, max), func!(value.z, min, max), func!(value.w, min, max));\r\n }\r\n }\r\n\r\n return 0;\r\n };\r\n\r\n return this;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.minimum = ${this.minimum};\\n`;\r\n codeString += `${this._codeVariableName}.maximum = ${this.maximum};\\n`;\r\n return codeString;\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.minimum = this.minimum;\r\n serializationObject.maximum = this.maximum;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.minimum = serializationObject.minimum;\r\n this.maximum = serializationObject.maximum;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryClampBlock\", GeometryClampBlock);\r\n"]}
|
|
@@ -53,6 +53,8 @@ export class GeometryInputBlock extends NodeGeometryBlock {
|
|
|
53
53
|
switch (value) {
|
|
54
54
|
case NodeGeometryContextualSources.Positions:
|
|
55
55
|
case NodeGeometryContextualSources.Normals:
|
|
56
|
+
case NodeGeometryContextualSources.LatticeID:
|
|
57
|
+
case NodeGeometryContextualSources.LatticeControl:
|
|
56
58
|
this._type = NodeGeometryBlockConnectionPointTypes.Vector3;
|
|
57
59
|
break;
|
|
58
60
|
case NodeGeometryContextualSources.Colors:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometryInputBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryInputBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAEvF;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IAkBr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mB,CAAC,IAAI,CAAC;QAEtC,IAAI,CAAC,eAAe,GAAG,mBAAmB,CAAC,eAAe,CAAC;QAC3D,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,GAAG,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,GAAG,IAAI,CAAC,CAAC;QACxC,IAAI,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,gBAAgB,IAAI,EAAE,CAAC;QAEnE,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE;YAChC,OAAO;SACV;QAED,IAAI,mBAAmB,CAAC,SAAS,KAAK,QAAQ,EAAE;YAC5C,IAAI,CAAC,YAAY,GAAG,mBAAmB,CAAC,KAAK,CAAC;SACjD;aAAM;YACH,MAAM,SAAS,GAAG,QAAQ,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;YAE1D,IAAI,SAAS,EAAE;gBACX,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;aACtE;SACJ;IACL,CAAC;CACJ;AAED,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { Observable } from \"../../../Misc/observable\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { GetClass, RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { Matrix, Vector2, Vector3, Vector4 } from \"../../../Maths/math.vector\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { NodeGeometryContextualSources } from \"../Enums/nodeGeometryContextualSources\";\r\n\r\n/**\r\n * Block used to expose an input value\r\n */\r\nexport class GeometryInputBlock extends NodeGeometryBlock {\r\n private _storedValue: any;\r\n private _valueCallback: () => any;\r\n private _type: NodeGeometryBlockConnectionPointTypes = NodeGeometryBlockConnectionPointTypes.Undefined;\r\n private _contextualSource = NodeGeometryContextualSources.None;\r\n\r\n /** Gets or set a value used to limit the range of float values */\r\n public min: number = 0;\r\n\r\n /** Gets or set a value used to limit the range of float values */\r\n public max: number = 0;\r\n\r\n /** Gets or sets the group to use to display this block in the Inspector */\r\n public groupInInspector = \"\";\r\n\r\n /** Gets an observable raised when the value is changed */\r\n public onValueChangedObservable = new Observable<GeometryInputBlock>();\r\n\r\n /**\r\n * Gets or sets the connection point type (default is float)\r\n */\r\n public get type(): NodeGeometryBlockConnectionPointTypes {\r\n if (this._type === NodeGeometryBlockConnectionPointTypes.AutoDetect) {\r\n if (this.value != null) {\r\n if (!isNaN(this.value)) {\r\n this._type = NodeGeometryBlockConnectionPointTypes.Float;\r\n return this._type;\r\n }\r\n\r\n switch (this.value.getClassName()) {\r\n case \"Vector2\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector2;\r\n return this._type;\r\n case \"Vector3\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector3;\r\n return this._type;\r\n case \"Vector4\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector4;\r\n return this._type;\r\n case \"Matrix\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Matrix;\r\n return this._type;\r\n }\r\n }\r\n }\r\n\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the current connection point is a contextual value\r\n */\r\n public get isContextual(): boolean {\r\n return this._contextualSource !== NodeGeometryContextualSources.None;\r\n }\r\n\r\n /**\r\n * Gets or sets the current contextual value\r\n */\r\n public get contextualValue(): NodeGeometryContextualSources {\r\n return this._contextualSource;\r\n }\r\n\r\n public set contextualValue(value: NodeGeometryContextualSources) {\r\n this._contextualSource = value;\r\n\r\n switch (value) {\r\n case NodeGeometryContextualSources.Positions:\r\n case NodeGeometryContextualSources.Normals:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector3;\r\n break;\r\n case NodeGeometryContextualSources.Colors:\r\n case NodeGeometryContextualSources.Tangents:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector4;\r\n break;\r\n case NodeGeometryContextualSources.UV:\r\n case NodeGeometryContextualSources.UV2:\r\n case NodeGeometryContextualSources.UV3:\r\n case NodeGeometryContextualSources.UV4:\r\n case NodeGeometryContextualSources.UV5:\r\n case NodeGeometryContextualSources.UV6:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector2;\r\n break;\r\n case NodeGeometryContextualSources.VertexID:\r\n case NodeGeometryContextualSources.GeometryID:\r\n case NodeGeometryContextualSources.CollectionID:\r\n case NodeGeometryContextualSources.FaceID:\r\n case NodeGeometryContextualSources.LoopID:\r\n case NodeGeometryContextualSources.InstanceID:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Int;\r\n break;\r\n }\r\n\r\n if (this.output) {\r\n this.output.type = this._type;\r\n }\r\n }\r\n\r\n /**\r\n * Creates a new InputBlock\r\n * @param name defines the block name\r\n * @param type defines the type of the input (can be set to NodeGeometryBlockConnectionPointTypes.AutoDetect)\r\n */\r\n public constructor(name: string, type: NodeGeometryBlockConnectionPointTypes = NodeGeometryBlockConnectionPointTypes.AutoDetect) {\r\n super(name);\r\n\r\n this._type = type;\r\n this._isInput = true;\r\n\r\n this.setDefaultValue();\r\n\r\n this.registerOutput(\"output\", type);\r\n }\r\n\r\n /**\r\n * Gets or sets the value of that point.\r\n * Please note that this value will be ignored if valueCallback is defined\r\n */\r\n public get value(): any {\r\n return this._storedValue;\r\n }\r\n\r\n public set value(value: any) {\r\n if (this.type === NodeGeometryBlockConnectionPointTypes.Float) {\r\n if (this.min !== this.max) {\r\n value = Math.max(this.min, value);\r\n value = Math.min(this.max, value);\r\n }\r\n }\r\n\r\n this._storedValue = value;\r\n\r\n this.onValueChangedObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Gets or sets a callback used to get the value of that point.\r\n * Please note that setting this value will force the connection point to ignore the value property\r\n */\r\n public get valueCallback(): () => any {\r\n return this._valueCallback;\r\n }\r\n\r\n public set valueCallback(value: () => any) {\r\n this._valueCallback = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometryInputBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Set the input block to its default value (based on its type)\r\n */\r\n public setDefaultValue() {\r\n this.contextualValue = NodeGeometryContextualSources.None;\r\n switch (this.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float:\r\n this.value = 0;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n this.value = Vector2.Zero();\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n this.value = Vector3.Zero();\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n this.value = Vector4.Zero();\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Matrix:\r\n this.value = Matrix.Identity();\r\n break;\r\n }\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n super._buildBlock(state);\r\n\r\n if (this.isContextual) {\r\n this.output._storedValue = null;\r\n this.output._storedFunction = (state) => {\r\n return state.getContextualValue(this._contextualSource);\r\n };\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = this.value;\r\n }\r\n }\r\n\r\n public override dispose() {\r\n this.onValueChangedObservable.clear();\r\n\r\n super.dispose();\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const variableName = this._codeVariableName;\r\n\r\n if (this.isContextual) {\r\n return (\r\n super._dumpPropertiesCode() + `${variableName}.contextualValue = BABYLON.NodeGeometryContextualSources.${NodeGeometryContextualSources[this._contextualSource]};\\n`\r\n );\r\n }\r\n const codes: string[] = [];\r\n\r\n let valueString = \"\";\r\n\r\n switch (this.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Float:\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n valueString = `${this.value}`;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n valueString = `new BABYLON.Vector2(${this.value.x}, ${this.value.y})`;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n valueString = `new BABYLON.Vector3(${this.value.x}, ${this.value.y}, ${this.value.z})`;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n valueString = `new BABYLON.Vector4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;\r\n break;\r\n }\r\n\r\n // Common Property \"Value\"\r\n codes.push(`${variableName}.value = ${valueString}`);\r\n\r\n // Float-Value-Specific Properties\r\n if (this.type === NodeGeometryBlockConnectionPointTypes.Float || this.type === NodeGeometryBlockConnectionPointTypes.Int) {\r\n codes.push(`${variableName}.min = ${this.min}`, `${variableName}.max = ${this.max}`);\r\n }\r\n\r\n codes.push(\"\");\r\n\r\n return super._dumpPropertiesCode() + codes.join(\";\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.type = this.type;\r\n serializationObject.contextualValue = this.contextualValue;\r\n serializationObject.min = this.min;\r\n serializationObject.max = this.max;\r\n serializationObject.groupInInspector = this.groupInInspector;\r\n\r\n if (this._storedValue !== null && !this.isContextual) {\r\n if (this._storedValue.asArray) {\r\n serializationObject.valueType = \"BABYLON.\" + this._storedValue.getClassName();\r\n serializationObject.value = this._storedValue.asArray();\r\n } else {\r\n serializationObject.valueType = \"number\";\r\n serializationObject.value = this._storedValue;\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this._type = serializationObject.type;\r\n\r\n this.contextualValue = serializationObject.contextualValue;\r\n this.min = serializationObject.min || 0;\r\n this.max = serializationObject.max || 0;\r\n this.groupInInspector = serializationObject.groupInInspector || \"\";\r\n\r\n if (!serializationObject.valueType) {\r\n return;\r\n }\r\n\r\n if (serializationObject.valueType === \"number\") {\r\n this._storedValue = serializationObject.value;\r\n } else {\r\n const valueType = GetClass(serializationObject.valueType);\r\n\r\n if (valueType) {\r\n this._storedValue = valueType.FromArray(serializationObject.value);\r\n }\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryInputBlock\", GeometryInputBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"geometryInputBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryInputBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAE/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AAEvF;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IAkBrD;;OAEG;IACH,IAAW,IAAI;QACX,IAAI,IAAI,CAAC,KAAK,KAAK,qCAAqC,CAAC,UAAU,EAAE;YACjE,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE;gBACpB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE;oBACpB,IAAI,CAAC,KAAK,GAAG,qCAAqC,CAAC,KAAK,CAAC;oBACzD,OAAO,IAAI,CAAC,KAAK,CAAC;iBACrB;gBAED,QAAQ,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,EAAE;oBAC/B,KAAK,SAAS;wBACV,IAAI,CAAC,KAAK,GAA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AC,SAAS,EAAE;YAChC,OAAO;SACV;QAED,IAAI,mBAAmB,CAAC,SAAS,KAAK,QAAQ,EAAE;YAC5C,IAAI,CAAC,YAAY,GAAG,mBAAmB,CAAC,KAAK,CAAC;SACjD;aAAM;YACH,MAAM,SAAS,GAAG,QAAQ,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;YAE1D,IAAI,SAAS,EAAE;gBACX,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,SAAS,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;aACtE;SACJ;IACL,CAAC;CACJ;AAED,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { Observable } from \"../../../Misc/observable\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport { GetClass, RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { Matrix, Vector2, Vector3, Vector4 } from \"../../../Maths/math.vector\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\nimport { NodeGeometryContextualSources } from \"../Enums/nodeGeometryContextualSources\";\r\n\r\n/**\r\n * Block used to expose an input value\r\n */\r\nexport class GeometryInputBlock extends NodeGeometryBlock {\r\n private _storedValue: any;\r\n private _valueCallback: () => any;\r\n private _type: NodeGeometryBlockConnectionPointTypes = NodeGeometryBlockConnectionPointTypes.Undefined;\r\n private _contextualSource = NodeGeometryContextualSources.None;\r\n\r\n /** Gets or set a value used to limit the range of float values */\r\n public min: number = 0;\r\n\r\n /** Gets or set a value used to limit the range of float values */\r\n public max: number = 0;\r\n\r\n /** Gets or sets the group to use to display this block in the Inspector */\r\n public groupInInspector = \"\";\r\n\r\n /** Gets an observable raised when the value is changed */\r\n public onValueChangedObservable = new Observable<GeometryInputBlock>();\r\n\r\n /**\r\n * Gets or sets the connection point type (default is float)\r\n */\r\n public get type(): NodeGeometryBlockConnectionPointTypes {\r\n if (this._type === NodeGeometryBlockConnectionPointTypes.AutoDetect) {\r\n if (this.value != null) {\r\n if (!isNaN(this.value)) {\r\n this._type = NodeGeometryBlockConnectionPointTypes.Float;\r\n return this._type;\r\n }\r\n\r\n switch (this.value.getClassName()) {\r\n case \"Vector2\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector2;\r\n return this._type;\r\n case \"Vector3\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector3;\r\n return this._type;\r\n case \"Vector4\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector4;\r\n return this._type;\r\n case \"Matrix\":\r\n this._type = NodeGeometryBlockConnectionPointTypes.Matrix;\r\n return this._type;\r\n }\r\n }\r\n }\r\n\r\n return this._type;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the current connection point is a contextual value\r\n */\r\n public get isContextual(): boolean {\r\n return this._contextualSource !== NodeGeometryContextualSources.None;\r\n }\r\n\r\n /**\r\n * Gets or sets the current contextual value\r\n */\r\n public get contextualValue(): NodeGeometryContextualSources {\r\n return this._contextualSource;\r\n }\r\n\r\n public set contextualValue(value: NodeGeometryContextualSources) {\r\n this._contextualSource = value;\r\n\r\n switch (value) {\r\n case NodeGeometryContextualSources.Positions:\r\n case NodeGeometryContextualSources.Normals:\r\n case NodeGeometryContextualSources.LatticeID:\r\n case NodeGeometryContextualSources.LatticeControl:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector3;\r\n break;\r\n case NodeGeometryContextualSources.Colors:\r\n case NodeGeometryContextualSources.Tangents:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector4;\r\n break;\r\n case NodeGeometryContextualSources.UV:\r\n case NodeGeometryContextualSources.UV2:\r\n case NodeGeometryContextualSources.UV3:\r\n case NodeGeometryContextualSources.UV4:\r\n case NodeGeometryContextualSources.UV5:\r\n case NodeGeometryContextualSources.UV6:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Vector2;\r\n break;\r\n case NodeGeometryContextualSources.VertexID:\r\n case NodeGeometryContextualSources.GeometryID:\r\n case NodeGeometryContextualSources.CollectionID:\r\n case NodeGeometryContextualSources.FaceID:\r\n case NodeGeometryContextualSources.LoopID:\r\n case NodeGeometryContextualSources.InstanceID:\r\n this._type = NodeGeometryBlockConnectionPointTypes.Int;\r\n break;\r\n }\r\n\r\n if (this.output) {\r\n this.output.type = this._type;\r\n }\r\n }\r\n\r\n /**\r\n * Creates a new InputBlock\r\n * @param name defines the block name\r\n * @param type defines the type of the input (can be set to NodeGeometryBlockConnectionPointTypes.AutoDetect)\r\n */\r\n public constructor(name: string, type: NodeGeometryBlockConnectionPointTypes = NodeGeometryBlockConnectionPointTypes.AutoDetect) {\r\n super(name);\r\n\r\n this._type = type;\r\n this._isInput = true;\r\n\r\n this.setDefaultValue();\r\n\r\n this.registerOutput(\"output\", type);\r\n }\r\n\r\n /**\r\n * Gets or sets the value of that point.\r\n * Please note that this value will be ignored if valueCallback is defined\r\n */\r\n public get value(): any {\r\n return this._storedValue;\r\n }\r\n\r\n public set value(value: any) {\r\n if (this.type === NodeGeometryBlockConnectionPointTypes.Float) {\r\n if (this.min !== this.max) {\r\n value = Math.max(this.min, value);\r\n value = Math.min(this.max, value);\r\n }\r\n }\r\n\r\n this._storedValue = value;\r\n\r\n this.onValueChangedObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Gets or sets a callback used to get the value of that point.\r\n * Please note that setting this value will force the connection point to ignore the value property\r\n */\r\n public get valueCallback(): () => any {\r\n return this._valueCallback;\r\n }\r\n\r\n public set valueCallback(value: () => any) {\r\n this._valueCallback = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometryInputBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Set the input block to its default value (based on its type)\r\n */\r\n public setDefaultValue() {\r\n this.contextualValue = NodeGeometryContextualSources.None;\r\n switch (this.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float:\r\n this.value = 0;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n this.value = Vector2.Zero();\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n this.value = Vector3.Zero();\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n this.value = Vector4.Zero();\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Matrix:\r\n this.value = Matrix.Identity();\r\n break;\r\n }\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n super._buildBlock(state);\r\n\r\n if (this.isContextual) {\r\n this.output._storedValue = null;\r\n this.output._storedFunction = (state) => {\r\n return state.getContextualValue(this._contextualSource);\r\n };\r\n } else {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = this.value;\r\n }\r\n }\r\n\r\n public override dispose() {\r\n this.onValueChangedObservable.clear();\r\n\r\n super.dispose();\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const variableName = this._codeVariableName;\r\n\r\n if (this.isContextual) {\r\n return (\r\n super._dumpPropertiesCode() + `${variableName}.contextualValue = BABYLON.NodeGeometryContextualSources.${NodeGeometryContextualSources[this._contextualSource]};\\n`\r\n );\r\n }\r\n const codes: string[] = [];\r\n\r\n let valueString = \"\";\r\n\r\n switch (this.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Float:\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n valueString = `${this.value}`;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n valueString = `new BABYLON.Vector2(${this.value.x}, ${this.value.y})`;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n valueString = `new BABYLON.Vector3(${this.value.x}, ${this.value.y}, ${this.value.z})`;\r\n break;\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n valueString = `new BABYLON.Vector4(${this.value.x}, ${this.value.y}, ${this.value.z}, ${this.value.w})`;\r\n break;\r\n }\r\n\r\n // Common Property \"Value\"\r\n codes.push(`${variableName}.value = ${valueString}`);\r\n\r\n // Float-Value-Specific Properties\r\n if (this.type === NodeGeometryBlockConnectionPointTypes.Float || this.type === NodeGeometryBlockConnectionPointTypes.Int) {\r\n codes.push(`${variableName}.min = ${this.min}`, `${variableName}.max = ${this.max}`);\r\n }\r\n\r\n codes.push(\"\");\r\n\r\n return super._dumpPropertiesCode() + codes.join(\";\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.type = this.type;\r\n serializationObject.contextualValue = this.contextualValue;\r\n serializationObject.min = this.min;\r\n serializationObject.max = this.max;\r\n serializationObject.groupInInspector = this.groupInInspector;\r\n\r\n if (this._storedValue !== null && !this.isContextual) {\r\n if (this._storedValue.asArray) {\r\n serializationObject.valueType = \"BABYLON.\" + this._storedValue.getClassName();\r\n serializationObject.value = this._storedValue.asArray();\r\n } else {\r\n serializationObject.valueType = \"number\";\r\n serializationObject.value = this._storedValue;\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this._type = serializationObject.type;\r\n\r\n this.contextualValue = serializationObject.contextualValue;\r\n this.min = serializationObject.min || 0;\r\n this.max = serializationObject.max || 0;\r\n this.groupInInspector = serializationObject.groupInInspector || \"\";\r\n\r\n if (!serializationObject.valueType) {\r\n return;\r\n }\r\n\r\n if (serializationObject.valueType === \"number\") {\r\n this._storedValue = serializationObject.value;\r\n } else {\r\n const valueType = GetClass(serializationObject.valueType);\r\n\r\n if (valueType) {\r\n this._storedValue = valueType.FromArray(serializationObject.value);\r\n }\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryInputBlock\", GeometryInputBlock);\r\n"]}
|
|
@@ -4,12 +4,17 @@ import type { NodeGeometryConnectionPoint } from "../nodeGeometryBlockConnection
|
|
|
4
4
|
import type { NodeGeometryBuildState } from "../nodeGeometryBuildState";
|
|
5
5
|
/**
|
|
6
6
|
* Block used to trigger an observable when traversed
|
|
7
|
+
* It can also be used to execute a function when traversed
|
|
7
8
|
*/
|
|
8
9
|
export declare class GeometryInterceptorBlock extends NodeGeometryBlock {
|
|
9
10
|
/**
|
|
10
11
|
* Observable triggered when the block is traversed
|
|
11
12
|
*/
|
|
12
13
|
onInterceptionObservable: Observable<any>;
|
|
14
|
+
/**
|
|
15
|
+
* Custom function to execute when traversed
|
|
16
|
+
*/
|
|
17
|
+
customFunction?: (value: any, state: NodeGeometryBuildState) => any;
|
|
13
18
|
/**
|
|
14
19
|
* Creates a new GeometryInterceptorBlock
|
|
15
20
|
* @param name defines the block name
|
|
@@ -4,6 +4,7 @@ import { NodeGeometryBlockConnectionPointTypes } from "../Enums/nodeGeometryConn
|
|
|
4
4
|
import { NodeGeometryBlock } from "../nodeGeometryBlock.js";
|
|
5
5
|
/**
|
|
6
6
|
* Block used to trigger an observable when traversed
|
|
7
|
+
* It can also be used to execute a function when traversed
|
|
7
8
|
*/
|
|
8
9
|
export class GeometryInterceptorBlock extends NodeGeometryBlock {
|
|
9
10
|
/**
|
|
@@ -50,7 +51,10 @@ export class GeometryInterceptorBlock extends NodeGeometryBlock {
|
|
|
50
51
|
const output = this._outputs[0];
|
|
51
52
|
const input = this._inputs[0];
|
|
52
53
|
output._storedFunction = (state) => {
|
|
53
|
-
|
|
54
|
+
let value = input.getConnectedValue(state);
|
|
55
|
+
if (this.customFunction) {
|
|
56
|
+
value = this.customFunction(value, state);
|
|
57
|
+
}
|
|
54
58
|
this.onInterceptionObservable.notifyObservers(value);
|
|
55
59
|
return value;
|
|
56
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometryInterceptorBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryInterceptorBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,oCAA6B;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD
|
|
1
|
+
{"version":3,"file":"geometryInterceptorBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryInterceptorBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,oCAA6B;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD;;;GAGG;AACH,MAAM,OAAO,wBAAyB,SAAQ,iBAAiB;IAW3D;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAfhB;;WAEG;QACI,6BAAwB,GAAG,IAAI,UAAU,CAAM,SAAS,EAAE,IAAI,CAAC,CAAC;QAcnE,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED;;OAEG;IACH,IAAoB,kBAAkB;QAClC,OAAO,CAAC,CAAC,CAAC;IACd,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,0BAA0B,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;IAEkB,WAAW,CAAC,KAA6B;QACxD,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAChC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAE9B,MAAM,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;YAC/B,IAAI,KAAK,GAAG,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAE3C,IAAI,IAAI,CAAC,cAAc,EAAE;gBACrB,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;aAC7C;YAED,IAAI,CAAC,wBAAwB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;YAErD,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC;IACN,CAAC;CACJ;AAED,aAAa,CAAC,kCAAkC,EAAE,wBAAwB,CAAC,CAAC","sourcesContent":["import { Observable } from \"core/Misc/observable\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\nimport type { NodeGeometryBuildState } from \"../nodeGeometryBuildState\";\r\n/**\r\n * Block used to trigger an observable when traversed\r\n * It can also be used to execute a function when traversed\r\n */\r\nexport class GeometryInterceptorBlock extends NodeGeometryBlock {\r\n /**\r\n * Observable triggered when the block is traversed\r\n */\r\n public onInterceptionObservable = new Observable<any>(undefined, true);\r\n\r\n /**\r\n * Custom function to execute when traversed\r\n */\r\n public customFunction?: (value: any, state: NodeGeometryBuildState) => any;\r\n\r\n /**\r\n * Creates a new GeometryInterceptorBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n\r\n this.registerInput(\"input\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the time spent to build this block (in ms)\r\n */\r\n public override get buildExecutionTime() {\r\n return -1;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"GeometryInterceptorBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeGeometryBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n const input = this._inputs[0];\r\n\r\n output._storedFunction = (state) => {\r\n let value = input.getConnectedValue(state);\r\n\r\n if (this.customFunction) {\r\n value = this.customFunction(value, state);\r\n }\r\n\r\n this.onInterceptionObservable.notifyObservers(value);\r\n\r\n return value;\r\n };\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryInterceptorBlock\", GeometryInterceptorBlock);\r\n"]}
|
|
@@ -37,5 +37,9 @@ export var NodeGeometryContextualSources;
|
|
|
37
37
|
NodeGeometryContextualSources[NodeGeometryContextualSources["LoopID"] = 15] = "LoopID";
|
|
38
38
|
/** InstanceID */
|
|
39
39
|
NodeGeometryContextualSources[NodeGeometryContextualSources["InstanceID"] = 16] = "InstanceID";
|
|
40
|
+
/** LatticeID */
|
|
41
|
+
NodeGeometryContextualSources[NodeGeometryContextualSources["LatticeID"] = 17] = "LatticeID";
|
|
42
|
+
/** LatticeControl */
|
|
43
|
+
NodeGeometryContextualSources[NodeGeometryContextualSources["LatticeControl"] = 18] = "LatticeControl";
|
|
40
44
|
})(NodeGeometryContextualSources || (NodeGeometryContextualSources = {}));
|
|
41
45
|
//# sourceMappingURL=nodeGeometryContextualSources.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeGeometryContextualSources.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Enums/nodeGeometryContextualSources.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"nodeGeometryContextualSources.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Enums/nodeGeometryContextualSources.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,6BAuCX;AAvCD,WAAY,6BAA6B;IACrC,WAAW;IACX,iFAAa,CAAA;IACb,gBAAgB;IAChB,2FAAkB,CAAA;IAClB,cAAc;IACd,uFAAgB,CAAA;IAChB,eAAe;IACf,yFAAiB,CAAA;IACjB,SAAS;IACT,6EAAW,CAAA;IACX,UAAU;IACV,+EAAY,CAAA;IACZ,UAAU;IACV,+EAAY,CAAA;IACZ,UAAU;IACV,+EAAY,CAAA;IACZ,UAAU;IACV,+EAAY,CAAA;IACZ,UAAU;IACV,+EAAY,CAAA;IACZ,aAAa;IACb,sFAAe,CAAA;IACf,eAAe;IACf,0FAAiB,CAAA;IACjB,aAAa;IACb,sFAAe,CAAA;IACf,iBAAiB;IACjB,8FAAmB,CAAA;IACnB,mBAAmB;IACnB,kGAAqB,CAAA;IACrB,aAAa;IACb,sFAAe,CAAA;IACf,iBAAiB;IACjB,8FAAmB,CAAA;IACnB,gBAAgB;IAChB,4FAAkB,CAAA;IAClB,qBAAqB;IACrB,sGAAuB,CAAA;AAC3B,CAAC,EAvCW,6BAA6B,KAA7B,6BAA6B,QAuCxC","sourcesContent":["/**\r\n * Defines the kind of contextual sources for node geometry\r\n */\r\nexport enum NodeGeometryContextualSources {\r\n /** None */\r\n None = 0x0000,\r\n /** Positions */\r\n Positions = 0x0001,\r\n /** Normals */\r\n Normals = 0x0002,\r\n /** Tangents */\r\n Tangents = 0x0003,\r\n /** UV */\r\n UV = 0x0004,\r\n /** UV2 */\r\n UV2 = 0x0005,\r\n /** UV3 */\r\n UV3 = 0x0006,\r\n /** UV4 */\r\n UV4 = 0x0007,\r\n /** UV5 */\r\n UV5 = 0x0008,\r\n /** UV6 */\r\n UV6 = 0x0009,\r\n /** Colors */\r\n Colors = 0x000a,\r\n /** VertexID */\r\n VertexID = 0x000b,\r\n /** FaceID */\r\n FaceID = 0x000c,\r\n /** GeometryID */\r\n GeometryID = 0x000d,\r\n /** CollectionID */\r\n CollectionID = 0x000e,\r\n /** LoopID */\r\n LoopID = 0x000f,\r\n /** InstanceID */\r\n InstanceID = 0x0010,\r\n /** LatticeID */\r\n LatticeID = 0x0011,\r\n /** LatticeControl */\r\n LatticeControl = 0x0012,\r\n}\r\n"]}
|
package/Meshes/Node/index.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export * from "./Blocks/computeNormalsBlock";
|
|
|
36
36
|
export * from "./Blocks/vectorConverterBlock";
|
|
37
37
|
export * from "./Blocks/normalizeVectorBlock";
|
|
38
38
|
export * from "./Blocks/Set/setMaterialIDBlock";
|
|
39
|
+
export * from "./Blocks/Set/latticeBlock";
|
|
39
40
|
export * from "./Blocks/geometryTrigonometryBlock";
|
|
40
41
|
export * from "./Blocks/geometryTransformBlock";
|
|
41
42
|
export * from "./Blocks/Matrices/rotationXBlock";
|
package/Meshes/Node/index.js
CHANGED
|
@@ -36,6 +36,7 @@ export * from "./Blocks/computeNormalsBlock.js";
|
|
|
36
36
|
export * from "./Blocks/vectorConverterBlock.js";
|
|
37
37
|
export * from "./Blocks/normalizeVectorBlock.js";
|
|
38
38
|
export * from "./Blocks/Set/setMaterialIDBlock.js";
|
|
39
|
+
export * from "./Blocks/Set/latticeBlock.js";
|
|
39
40
|
export * from "./Blocks/geometryTrigonometryBlock.js";
|
|
40
41
|
export * from "./Blocks/geometryTransformBlock.js";
|
|
41
42
|
export * from "./Blocks/Matrices/rotationXBlock.js";
|
package/Meshes/Node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Node/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD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AA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC","sourcesContent":["export * from \"./nodeGeometry\";\r\nexport * from \"./nodeGeometryBlock\";\r\nexport * from \"./nodeGeometryBlockConnectionPoint\";\r\nexport * from \"./nodeGeometryBuildState\";\r\nexport * from \"./Interfaces/nodeGeometryExecutionContext\";\r\nexport * from \"./Enums/nodeGeometryConnectionPointTypes\";\r\nexport * from \"./Enums/nodeGeometryContextualSources\";\r\nexport * from \"./Blocks/geometryOptimizeBlock\";\r\nexport * from \"./Blocks/geometryOutputBlock\";\r\nexport * from \"./Blocks/geometryInputBlock\";\r\nexport * from \"./Blocks/Sources/planeBlock\";\r\nexport * from \"./Blocks/Sources/boxBlock\";\r\nexport * from \"./Blocks/Sources/meshBlock\";\r\nexport * from \"./Blocks/Sources/icoSphereBlock\";\r\nexport * from \"./Blocks/Sources/sphereBlock\";\r\nexport * from \"./Blocks/Sources/gridBlock\";\r\nexport * from \"./Blocks/Sources/torusBlock\";\r\nexport * from \"./Blocks/Sources/cylinderBlock\";\r\nexport * from \"./Blocks/Sources/capsuleBlock\";\r\nexport * from \"./Blocks/Sources/discBlock\";\r\nexport * from \"./Blocks/Sources/nullBlock\";\r\nexport * from \"./Blocks/Set/setPositionsBlock\";\r\nexport * from \"./Blocks/Set/setNormalsBlock\";\r\nexport * from \"./Blocks/Set/setUVsBlock\";\r\nexport * from \"./Blocks/Set/setColorsBlock\";\r\nexport * from \"./Blocks/Set/setTangentsBlock\";\r\nexport * from \"./Blocks/mathBlock\";\r\nexport * from \"./Blocks/mapRangeBlock\";\r\nexport * from \"./Blocks/conditionBlock\";\r\nexport * from \"./Blocks/randomBlock\";\r\nexport * from \"./Blocks/noiseBlock\";\r\nexport * from \"./Blocks/mergeGeometryBlock\";\r\nexport * from \"./Blocks/geometryCollectionBlock\";\r\nexport * from \"./Blocks/geometryElbowBlock\";\r\nexport * from \"./Blocks/computeNormalsBlock\";\r\nexport * from \"./Blocks/vectorConverterBlock\";\r\nexport * from \"./Blocks/normalizeVectorBlock\";\r\nexport * from \"./Blocks/Set/setMaterialIDBlock\";\r\nexport * from \"./Blocks/geometryTrigonometryBlock\";\r\nexport * from \"./Blocks/geometryTransformBlock\";\r\nexport * from \"./Blocks/Matrices/rotationXBlock\";\r\nexport * from \"./Blocks/Matrices/rotationYBlock\";\r\nexport * from \"./Blocks/Matrices/rotationZBlock\";\r\nexport * from \"./Blocks/Matrices/scalingBlock\";\r\nexport * from \"./Blocks/Matrices/alignBlock\";\r\nexport * from \"./Blocks/Matrices/translationBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVerticesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnFacesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVolumeBlock\";\r\nexport * from \"./Blocks/Instances/instantiateBlock\";\r\nexport * from \"./Blocks/Instances/instantiateLinearBlock\";\r\nexport * from \"./Blocks/Instances/instantiateRadialBlock\";\r\nexport * from \"./Blocks/intFloatConverterBlock\";\r\nexport * from \"./Blocks/debugBlock\";\r\nexport * from \"./Blocks/geometryInfoBlock\";\r\nexport * from \"./Blocks/mappingBlock\";\r\nexport * from \"./Blocks/matrixComposeBlock\";\r\nexport * from \"./Blocks/Teleport/teleportInBlock\";\r\nexport * from \"./Blocks/Teleport/teleportOutBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureFetchBlock\";\r\nexport * from \"./Blocks/boundingBlock\";\r\nexport * from \"./Blocks/booleanGeometryBlock\";\r\nexport * from \"./Blocks/geometryArcTan2Block\";\r\nexport * from \"./Blocks/geometryLerpBlock\";\r\nexport * from \"./Blocks/geometryNLerpBlock\";\r\nexport * from \"./Blocks/geometryStepBlock\";\r\nexport * from \"./Blocks/geometrySmoothStepBlock\";\r\nexport * from \"./Blocks/geometryModBlock\";\r\nexport * from \"./Blocks/geometryPowBlock\";\r\nexport * from \"./Blocks/geometryClampBlock\";\r\nexport * from \"./Blocks/geometryCrossBlock\";\r\nexport * from \"./Blocks/geometryCurveBlock\";\r\nexport * from \"./Blocks/geometryDesaturateBlock\";\r\nexport * from \"./Blocks/geometryPosterizeBlock\";\r\nexport * from \"./Blocks/geometryReplaceColorBlock\";\r\nexport * from \"./Blocks/geometryDistanceBlock\";\r\nexport * from \"./Blocks/geometryDotBlock\";\r\nexport * from \"./Blocks/geometryLengthBlock\";\r\nexport * from \"./Blocks/geometryRotate2dBlock\";\r\nexport * from \"./Blocks/geometryInterceptorBlock\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Node/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,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AkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC","sourcesContent":["export * from \"./nodeGeometry\";\r\nexport * from \"./nodeGeometryBlock\";\r\nexport * from \"./nodeGeometryBlockConnectionPoint\";\r\nexport * from \"./nodeGeometryBuildState\";\r\nexport * from \"./Interfaces/nodeGeometryExecutionContext\";\r\nexport * from \"./Enums/nodeGeometryConnectionPointTypes\";\r\nexport * from \"./Enums/nodeGeometryContextualSources\";\r\nexport * from \"./Blocks/geometryOptimizeBlock\";\r\nexport * from \"./Blocks/geometryOutputBlock\";\r\nexport * from \"./Blocks/geometryInputBlock\";\r\nexport * from \"./Blocks/Sources/planeBlock\";\r\nexport * from \"./Blocks/Sources/boxBlock\";\r\nexport * from \"./Blocks/Sources/meshBlock\";\r\nexport * from \"./Blocks/Sources/icoSphereBlock\";\r\nexport * from \"./Blocks/Sources/sphereBlock\";\r\nexport * from \"./Blocks/Sources/gridBlock\";\r\nexport * from \"./Blocks/Sources/torusBlock\";\r\nexport * from \"./Blocks/Sources/cylinderBlock\";\r\nexport * from \"./Blocks/Sources/capsuleBlock\";\r\nexport * from \"./Blocks/Sources/discBlock\";\r\nexport * from \"./Blocks/Sources/nullBlock\";\r\nexport * from \"./Blocks/Set/setPositionsBlock\";\r\nexport * from \"./Blocks/Set/setNormalsBlock\";\r\nexport * from \"./Blocks/Set/setUVsBlock\";\r\nexport * from \"./Blocks/Set/setColorsBlock\";\r\nexport * from \"./Blocks/Set/setTangentsBlock\";\r\nexport * from \"./Blocks/mathBlock\";\r\nexport * from \"./Blocks/mapRangeBlock\";\r\nexport * from \"./Blocks/conditionBlock\";\r\nexport * from \"./Blocks/randomBlock\";\r\nexport * from \"./Blocks/noiseBlock\";\r\nexport * from \"./Blocks/mergeGeometryBlock\";\r\nexport * from \"./Blocks/geometryCollectionBlock\";\r\nexport * from \"./Blocks/geometryElbowBlock\";\r\nexport * from \"./Blocks/computeNormalsBlock\";\r\nexport * from \"./Blocks/vectorConverterBlock\";\r\nexport * from \"./Blocks/normalizeVectorBlock\";\r\nexport * from \"./Blocks/Set/setMaterialIDBlock\";\r\nexport * from \"./Blocks/Set/latticeBlock\";\r\nexport * from \"./Blocks/geometryTrigonometryBlock\";\r\nexport * from \"./Blocks/geometryTransformBlock\";\r\nexport * from \"./Blocks/Matrices/rotationXBlock\";\r\nexport * from \"./Blocks/Matrices/rotationYBlock\";\r\nexport * from \"./Blocks/Matrices/rotationZBlock\";\r\nexport * from \"./Blocks/Matrices/scalingBlock\";\r\nexport * from \"./Blocks/Matrices/alignBlock\";\r\nexport * from \"./Blocks/Matrices/translationBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVerticesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnFacesBlock\";\r\nexport * from \"./Blocks/Instances/instantiateOnVolumeBlock\";\r\nexport * from \"./Blocks/Instances/instantiateBlock\";\r\nexport * from \"./Blocks/Instances/instantiateLinearBlock\";\r\nexport * from \"./Blocks/Instances/instantiateRadialBlock\";\r\nexport * from \"./Blocks/intFloatConverterBlock\";\r\nexport * from \"./Blocks/debugBlock\";\r\nexport * from \"./Blocks/geometryInfoBlock\";\r\nexport * from \"./Blocks/mappingBlock\";\r\nexport * from \"./Blocks/matrixComposeBlock\";\r\nexport * from \"./Blocks/Teleport/teleportInBlock\";\r\nexport * from \"./Blocks/Teleport/teleportOutBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureBlock\";\r\nexport * from \"./Blocks/Textures/geometryTextureFetchBlock\";\r\nexport * from \"./Blocks/boundingBlock\";\r\nexport * from \"./Blocks/booleanGeometryBlock\";\r\nexport * from \"./Blocks/geometryArcTan2Block\";\r\nexport * from \"./Blocks/geometryLerpBlock\";\r\nexport * from \"./Blocks/geometryNLerpBlock\";\r\nexport * from \"./Blocks/geometryStepBlock\";\r\nexport * from \"./Blocks/geometrySmoothStepBlock\";\r\nexport * from \"./Blocks/geometryModBlock\";\r\nexport * from \"./Blocks/geometryPowBlock\";\r\nexport * from \"./Blocks/geometryClampBlock\";\r\nexport * from \"./Blocks/geometryCrossBlock\";\r\nexport * from \"./Blocks/geometryCurveBlock\";\r\nexport * from \"./Blocks/geometryDesaturateBlock\";\r\nexport * from \"./Blocks/geometryPosterizeBlock\";\r\nexport * from \"./Blocks/geometryReplaceColorBlock\";\r\nexport * from \"./Blocks/geometryDistanceBlock\";\r\nexport * from \"./Blocks/geometryDotBlock\";\r\nexport * from \"./Blocks/geometryLengthBlock\";\r\nexport * from \"./Blocks/geometryRotate2dBlock\";\r\nexport * from \"./Blocks/geometryInterceptorBlock\";\r\n"]}
|