@babylonjs/core 6.17.0 → 6.18.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/Audio/audioEngine.d.ts +1 -1
- package/Audio/audioEngine.js +24 -13
- package/Audio/audioEngine.js.map +1 -1
- package/Bones/skeleton.d.ts +3 -1
- package/Bones/skeleton.js +11 -2
- package/Bones/skeleton.js.map +1 -1
- package/DeviceInput/webDeviceInputSystem.js +26 -1
- package/DeviceInput/webDeviceInputSystem.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Materials/Node/Blocks/Teleport/teleportInBlock.js +1 -0
- package/Materials/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
- package/Materials/greasedLinePluginMaterial.d.ts +7 -2
- package/Materials/greasedLinePluginMaterial.js +46 -21
- package/Materials/greasedLinePluginMaterial.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateBlock.d.ts +77 -0
- package/Meshes/Node/Blocks/Instances/instantiateBlock.js +169 -0
- package/Meshes/Node/Blocks/Instances/instantiateBlock.js.map +1 -0
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.d.ts +6 -0
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +74 -68
- package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.d.ts +11 -0
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js +94 -66
- package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.d.ts +6 -0
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +68 -62
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setColorsBlock.d.ts +5 -0
- package/Meshes/Node/Blocks/Set/setColorsBlock.js +7 -0
- package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setNormalsBlock.d.ts +5 -0
- package/Meshes/Node/Blocks/Set/setNormalsBlock.js +7 -0
- package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setPositionsBlock.d.ts +5 -0
- package/Meshes/Node/Blocks/Set/setPositionsBlock.js +7 -0
- package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setTangentsBlock.d.ts +5 -0
- package/Meshes/Node/Blocks/Set/setTangentsBlock.js +7 -0
- package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setUVsBlock.d.ts +5 -0
- package/Meshes/Node/Blocks/Set/setUVsBlock.js +7 -0
- package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/meshBlock.d.ts +4 -0
- package/Meshes/Node/Blocks/Sources/meshBlock.js +6 -0
- package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Teleport/teleportInBlock.js +1 -0
- package/Meshes/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
- package/Meshes/Node/Blocks/computeNormalsBlock.js +3 -0
- package/Meshes/Node/Blocks/computeNormalsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryCollectionBlock.d.ts +76 -0
- package/Meshes/Node/Blocks/geometryCollectionBlock.js +163 -0
- package/Meshes/Node/Blocks/geometryCollectionBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryInfoBlock.d.ts +43 -0
- package/Meshes/Node/Blocks/geometryInfoBlock.js +100 -0
- package/Meshes/Node/Blocks/geometryInfoBlock.js.map +1 -0
- package/Meshes/Node/Blocks/geometryInputBlock.js +2 -0
- package/Meshes/Node/Blocks/geometryInputBlock.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/Interfaces/nodeGeometryExecutionContext.d.ts +5 -0
- package/Meshes/Node/Interfaces/nodeGeometryExecutionContext.js.map +1 -1
- package/Meshes/Node/index.d.ts +3 -0
- package/Meshes/Node/index.js +3 -0
- package/Meshes/Node/index.js.map +1 -1
- package/Meshes/Node/nodeGeometry.d.ts +7 -0
- package/Meshes/Node/nodeGeometry.js +17 -0
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.d.ts +8 -3
- package/Meshes/Node/nodeGeometryBlock.js +24 -5
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometryBuildState.d.ts +3 -1
- package/Meshes/Node/nodeGeometryBuildState.js +34 -12
- package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
- package/Meshes/mesh.vertexData.d.ts +4 -0
- package/Meshes/mesh.vertexData.js +4 -0
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/transformNode.js +7 -3
- package/Meshes/transformNode.js.map +1 -1
- package/Shaders/gpuRenderParticles.vertex.js +5 -5
- package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
- package/Shaders/particles.vertex.js +5 -5
- package/Shaders/particles.vertex.js.map +1 -1
- package/Sprites/sprite.js +4 -4
- package/Sprites/sprite.js.map +1 -1
- package/package.json +1 -1
|
@@ -18,6 +18,11 @@ export declare class SetNormalsBlock extends NodeGeometryBlock implements INodeG
|
|
|
18
18
|
* @returns the current index
|
|
19
19
|
*/
|
|
20
20
|
getExecutionIndex(): number;
|
|
21
|
+
/**
|
|
22
|
+
* Gets the current loop index in the current flow
|
|
23
|
+
* @returns the current loop index
|
|
24
|
+
*/
|
|
25
|
+
getExecutionLoopIndex(): number;
|
|
21
26
|
/**
|
|
22
27
|
* Gets the current face index in the current flow
|
|
23
28
|
* @returns the current face index
|
|
@@ -22,6 +22,13 @@ export class SetNormalsBlock extends NodeGeometryBlock {
|
|
|
22
22
|
getExecutionIndex() {
|
|
23
23
|
return this._currentIndex;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Gets the current loop index in the current flow
|
|
27
|
+
* @returns the current loop index
|
|
28
|
+
*/
|
|
29
|
+
getExecutionLoopIndex() {
|
|
30
|
+
return this._currentIndex;
|
|
31
|
+
}
|
|
25
32
|
/**
|
|
26
33
|
* Gets the current face index in the current flow
|
|
27
34
|
* @returns the current face index
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setNormalsBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Set/setNormalsBlock.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;AAMrG;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,iBAAiB;IAIlD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAE7E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACI,iBAAiB;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACI,qBAAqB;QACxB,OAAO,CAAC,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,iBAAiB,CAAC;IAC7B,C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AAE,IAAI,CAAC,aAAa,GAAG,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE;YACjF,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAY,CAAC;YACrE,IAAI,WAAW,EAAE;gBACb,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;aACzE;SACJ;QAED,UAAU;QACV,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QAC5C,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC9B,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;IACjC,CAAC;CACJ;AAED,aAAa,CAAC,yBAAyB,EAAE,eAAe,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 type { Vector3 } from \"../../../../Maths/math.vector\";\r\n\r\n/**\r\n * Block used to set normals for a geometry\r\n */\r\nexport class SetNormalsBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {\r\n private _vertexData: VertexData;\r\n private _currentIndex: number;\r\n\r\n /**\r\n * Create a new SetNormalsBlock\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(\"normals\", 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._currentIndex;\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 getClassName() {\r\n return \"SetNormalsBlock\";\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 normals input component\r\n */\r\n public get normals(): 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 protected _buildBlock(state: NodeGeometryBuildState) {\r\n state.executionContext = this;\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.geometryContext = this._vertexData;\r\n\r\n if (!this._vertexData || !this._vertexData.positions) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n if (!this.normals.isConnected) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = this._vertexData;\r\n return;\r\n }\r\n\r\n if (!this._vertexData.normals) {\r\n this._vertexData.normals = [];\r\n }\r\n\r\n // Processing\r\n const vertexCount = this._vertexData.positions.length / 3;\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const tempVector3 = this.normals.getConnectedValue(state) as Vector3;\r\n if (tempVector3) {\r\n tempVector3.toArray(this._vertexData.normals, this._currentIndex * 3);\r\n }\r\n }\r\n\r\n // Storage\r\n this.output._storedValue = this._vertexData;\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SetNormalsBlock\", SetNormalsBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"setNormalsBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Set/setNormalsBlock.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;AAMrG;;GAEG;AACH,MAAM,OAAO,eAAgB,SAAQ,iBAAiB;IAIlD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAE7E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACI,iBAAiB;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACI,qBAAqB;QACxB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACI,qBAAqB;QACxB,OAAO,CAAC,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,iBAAiB,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,QAA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C,aAAa,GAAG,CAAC,CAAC,CAAC;aACzE;SACJ;QAED,UAAU;QACV,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QAC5C,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC9B,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;IACjC,CAAC;CACJ;AAED,aAAa,CAAC,yBAAyB,EAAE,eAAe,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 type { Vector3 } from \"../../../../Maths/math.vector\";\r\n\r\n/**\r\n * Block used to set normals for a geometry\r\n */\r\nexport class SetNormalsBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {\r\n private _vertexData: VertexData;\r\n private _currentIndex: number;\r\n\r\n /**\r\n * Create a new SetNormalsBlock\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(\"normals\", 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._currentIndex;\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._currentIndex;\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 getClassName() {\r\n return \"SetNormalsBlock\";\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 normals input component\r\n */\r\n public get normals(): 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 protected _buildBlock(state: NodeGeometryBuildState) {\r\n state.executionContext = this;\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.geometryContext = this._vertexData;\r\n\r\n if (!this._vertexData || !this._vertexData.positions) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n if (!this.normals.isConnected) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = this._vertexData;\r\n return;\r\n }\r\n\r\n if (!this._vertexData.normals) {\r\n this._vertexData.normals = [];\r\n }\r\n\r\n // Processing\r\n const vertexCount = this._vertexData.positions.length / 3;\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const tempVector3 = this.normals.getConnectedValue(state) as Vector3;\r\n if (tempVector3) {\r\n tempVector3.toArray(this._vertexData.normals, this._currentIndex * 3);\r\n }\r\n }\r\n\r\n // Storage\r\n this.output._storedValue = this._vertexData;\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SetNormalsBlock\", SetNormalsBlock);\r\n"]}
|
|
@@ -18,6 +18,11 @@ export declare class SetPositionsBlock extends NodeGeometryBlock implements INod
|
|
|
18
18
|
* @returns the current index
|
|
19
19
|
*/
|
|
20
20
|
getExecutionIndex(): number;
|
|
21
|
+
/**
|
|
22
|
+
* Gets the current loop index in the current flow
|
|
23
|
+
* @returns the current loop index
|
|
24
|
+
*/
|
|
25
|
+
getExecutionLoopIndex(): number;
|
|
21
26
|
/**
|
|
22
27
|
* Gets the current face index in the current flow
|
|
23
28
|
* @returns the current face index
|
|
@@ -22,6 +22,13 @@ export class SetPositionsBlock extends NodeGeometryBlock {
|
|
|
22
22
|
getExecutionIndex() {
|
|
23
23
|
return this._currentIndex;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Gets the current loop index in the current flow
|
|
27
|
+
* @returns the current loop index
|
|
28
|
+
*/
|
|
29
|
+
getExecutionLoopIndex() {
|
|
30
|
+
return this._currentIndex;
|
|
31
|
+
}
|
|
25
32
|
/**
|
|
26
33
|
* Gets the current face index in the current flow
|
|
27
34
|
* @returns the current face index
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setPositionsBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Set/setPositionsBlock.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;AAMrG;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,iBAAiB;IAIpD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,WAAW,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAE/E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;IAClF,CAA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CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAY,CAAC;YACvE,IAAI,WAAW,EAAE;gBACb,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;aAC3E;SACJ;QAED,UAAU;QACV,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QAC5C,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC9B,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;IACjC,CAAC;CACJ;AAED,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,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 \"../../../../Meshes/mesh.vertexData\";\r\nimport type { Vector3 } from \"../../../../Maths/math.vector\";\r\n\r\n/**\r\n * Block used to set positions for a geometry\r\n */\r\nexport class SetPositionsBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {\r\n private _vertexData: VertexData;\r\n private _currentIndex: number;\r\n\r\n /**\r\n * Create a new SetPositionsBlock\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(\"positions\", 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._currentIndex;\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 getClassName() {\r\n return \"SetPositionsBlock\";\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 positions input component\r\n */\r\n public get positions(): 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 protected _buildBlock(state: NodeGeometryBuildState) {\r\n state.executionContext = this;\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.geometryContext = this._vertexData;\r\n\r\n if (!this._vertexData || !this._vertexData.positions || !this.positions.isConnected) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n // Processing\r\n const vertexCount = this._vertexData.positions.length / 3;\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const tempVector3 = this.positions.getConnectedValue(state) as Vector3;\r\n if (tempVector3) {\r\n tempVector3.toArray(this._vertexData.positions, this._currentIndex * 3);\r\n }\r\n }\r\n\r\n // Storage\r\n this.output._storedValue = this._vertexData;\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SetPositionsBlock\", SetPositionsBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"setPositionsBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Set/setPositionsBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBA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e,GAAG,IAAI,CAAC,WAAW,CAAC;QAEzC,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE;YACjF,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC9B,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;YAChC,OAAO;SACV;QAED,aAAa;QACb,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QAC1D,KAAK,IAAI,CAAC,aAAa,GAAG,CAAC,EAAE,IAAI,CAAC,aAAa,GAAG,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE;YACjF,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAY,CAAC;YACvE,IAAI,WAAW,EAAE;gBACb,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;aAC3E;SACJ;QAED,UAAU;QACV,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QAC5C,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC9B,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;IACjC,CAAC;CACJ;AAED,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,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 \"../../../../Meshes/mesh.vertexData\";\r\nimport type { Vector3 } from \"../../../../Maths/math.vector\";\r\n\r\n/**\r\n * Block used to set positions for a geometry\r\n */\r\nexport class SetPositionsBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {\r\n private _vertexData: VertexData;\r\n private _currentIndex: number;\r\n\r\n /**\r\n * Create a new SetPositionsBlock\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(\"positions\", 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._currentIndex;\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._currentIndex;\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 getClassName() {\r\n return \"SetPositionsBlock\";\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 positions input component\r\n */\r\n public get positions(): 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 protected _buildBlock(state: NodeGeometryBuildState) {\r\n state.executionContext = this;\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.geometryContext = this._vertexData;\r\n\r\n if (!this._vertexData || !this._vertexData.positions || !this.positions.isConnected) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n // Processing\r\n const vertexCount = this._vertexData.positions.length / 3;\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const tempVector3 = this.positions.getConnectedValue(state) as Vector3;\r\n if (tempVector3) {\r\n tempVector3.toArray(this._vertexData.positions, this._currentIndex * 3);\r\n }\r\n }\r\n\r\n // Storage\r\n this.output._storedValue = this._vertexData;\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SetPositionsBlock\", SetPositionsBlock);\r\n"]}
|
|
@@ -18,6 +18,11 @@ export declare class SetTangentsBlock extends NodeGeometryBlock implements INode
|
|
|
18
18
|
* @returns the current index
|
|
19
19
|
*/
|
|
20
20
|
getExecutionIndex(): number;
|
|
21
|
+
/**
|
|
22
|
+
* Gets the current loop index in the current flow
|
|
23
|
+
* @returns the current loop index
|
|
24
|
+
*/
|
|
25
|
+
getExecutionLoopIndex(): number;
|
|
21
26
|
/**
|
|
22
27
|
* Gets the current face index in the current flow
|
|
23
28
|
* @returns the current face index
|
|
@@ -22,6 +22,13 @@ export class SetTangentsBlock extends NodeGeometryBlock {
|
|
|
22
22
|
getExecutionIndex() {
|
|
23
23
|
return this._currentIndex;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Gets the current loop index in the current flow
|
|
27
|
+
* @returns the current loop index
|
|
28
|
+
*/
|
|
29
|
+
getExecutionLoopIndex() {
|
|
30
|
+
return this._currentIndex;
|
|
31
|
+
}
|
|
25
32
|
/**
|
|
26
33
|
* Gets the current face index in the current flow
|
|
27
34
|
* @returns the current face index
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setTangentsBlock.js","sourceRoot":"","sources":["../../../../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,GAAG,IAAI,CAAC;IACjC,CAAC;CACJ;AAED,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,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 type { Vector4 } from \"../../../../Maths/math.vector\";\r\n\r\n/**\r\n * Block used to set tangents for a geometry\r\n */\r\nexport class SetTangentsBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {\r\n private _vertexData: VertexData;\r\n private _currentIndex: number;\r\n\r\n /**\r\n * Create a new SetTangentsBlock\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(\"tangents\", NodeGeometryBlockConnectionPointTypes.Vector4);\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._currentIndex;\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 getClassName() {\r\n return \"SetTangentsBlock\";\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 tangents input component\r\n */\r\n public get tangents(): 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 protected _buildBlock(state: NodeGeometryBuildState) {\r\n state.executionContext = this;\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.geometryContext = this._vertexData;\r\n\r\n if (!this._vertexData || !this._vertexData.positions) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n if (!this.tangents.isConnected) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = this._vertexData;\r\n return;\r\n }\r\n\r\n if (!this._vertexData.tangents) {\r\n this._vertexData.tangents = [];\r\n }\r\n\r\n // Processing\r\n const vertexCount = this._vertexData.positions.length / 3;\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const tempVector4 = this.tangents.getConnectedValue(state) as Vector4;\r\n if (tempVector4) {\r\n tempVector4.toArray(this._vertexData.tangents, this._currentIndex * 4);\r\n }\r\n }\r\n\r\n // Storage\r\n this.output._storedValue = this._vertexData;\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SetTangentsBlock\", SetTangentsBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"setTangentsBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Set/setTangentsBlock.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;AAMrG;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,iBAAiB;IAInD;;;OAGG;IACH,YAAmB,IAAY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;YAC7B,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;YAChC,OAAO;SACV;QAED,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;YAC5B,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;YAC9B,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;YAC5C,OAAO;SACV;QAED,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE;YAC5B,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,EAAE,CAAC;SAClC;QAED,aAAa;QACb,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;QAC1D,KAAK,IAAI,CAAC,aAAa,GAAG,CAAC,EAAE,IAAI,CAAC,aAAa,GAAG,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE;YACjF,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAY,CAAC;YACtE,IAAI,WAAW,EAAE;gBACb,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;aAC1E;SACJ;QAED,UAAU;QACV,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,WAAW,CAAC;QAC5C,KAAK,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC9B,KAAK,CAAC,eAAe,GAAG,IAAI,CAAC;IACjC,CAAC;CACJ;AAED,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,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 type { Vector4 } from \"../../../../Maths/math.vector\";\r\n\r\n/**\r\n * Block used to set tangents for a geometry\r\n */\r\nexport class SetTangentsBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {\r\n private _vertexData: VertexData;\r\n private _currentIndex: number;\r\n\r\n /**\r\n * Create a new SetTangentsBlock\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(\"tangents\", NodeGeometryBlockConnectionPointTypes.Vector4);\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._currentIndex;\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._currentIndex;\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 getClassName() {\r\n return \"SetTangentsBlock\";\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 tangents input component\r\n */\r\n public get tangents(): 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 protected _buildBlock(state: NodeGeometryBuildState) {\r\n state.executionContext = this;\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.geometryContext = this._vertexData;\r\n\r\n if (!this._vertexData || !this._vertexData.positions) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n if (!this.tangents.isConnected) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = this._vertexData;\r\n return;\r\n }\r\n\r\n if (!this._vertexData.tangents) {\r\n this._vertexData.tangents = [];\r\n }\r\n\r\n // Processing\r\n const vertexCount = this._vertexData.positions.length / 3;\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const tempVector4 = this.tangents.getConnectedValue(state) as Vector4;\r\n if (tempVector4) {\r\n tempVector4.toArray(this._vertexData.tangents, this._currentIndex * 4);\r\n }\r\n }\r\n\r\n // Storage\r\n this.output._storedValue = this._vertexData;\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SetTangentsBlock\", SetTangentsBlock);\r\n"]}
|
|
@@ -22,6 +22,11 @@ export declare class SetUVsBlock extends NodeGeometryBlock implements INodeGeome
|
|
|
22
22
|
* @returns the current index
|
|
23
23
|
*/
|
|
24
24
|
getExecutionIndex(): number;
|
|
25
|
+
/**
|
|
26
|
+
* Gets the current loop index in the current flow
|
|
27
|
+
* @returns the current loop index
|
|
28
|
+
*/
|
|
29
|
+
getExecutionLoopIndex(): number;
|
|
25
30
|
/**
|
|
26
31
|
* Gets the current face index in the current flow
|
|
27
32
|
* @returns the current face index
|
|
@@ -28,6 +28,13 @@ export class SetUVsBlock extends NodeGeometryBlock {
|
|
|
28
28
|
getExecutionIndex() {
|
|
29
29
|
return this._currentIndex;
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Gets the current loop index in the current flow
|
|
33
|
+
* @returns the current loop index
|
|
34
|
+
*/
|
|
35
|
+
getExecutionLoopIndex() {
|
|
36
|
+
return this._currentIndex;
|
|
37
|
+
}
|
|
31
38
|
/**
|
|
32
39
|
* Gets the current face index in the current flow
|
|
33
40
|
* @returns the current face index
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setUVsBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Set/setUVsBlock.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;AAKrG,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEtG;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,iBAAiB;IAoB9C;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QArBhB;;WAEG;QAYI,2BAAsB,GAAG,CAAC,CAAC;QAS9B,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAEzE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACI,iBAAiB;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACI,qBAAqB;QACxB,OAAO,CAAC,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,aAAa,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,CAA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,sBAAsB,GAAG,mBAAmB,CAAC,sBAAsB,CAAC;IAC7E,CAAC;CACJ;AApJU;IAXN,sBAAsB,CAAC,2BAA2B,EAAE,sBAAsB,CAAC,IAAI,EAAE,UAAU,EAAE;QAC1F,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;QAC3B,OAAO,EAAE;YACL,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;YAC1B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE;SAC7B;KACJ,CAAC;2DACgC;AAsJtC,aAAa,CAAC,qBAAqB,EAAE,WAAW,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 type { Vector2 } from \"../../../../Maths/math.vector\";\r\nimport { PropertyTypeForEdition, editableInPropertyPage } from \"../../../../Decorators/nodeDecorator\";\r\n\r\n/**\r\n * Block used to set texture coordinates for a geometry\r\n */\r\nexport class SetUVsBlock extends NodeGeometryBlock implements INodeGeometryExecutionContext {\r\n private _vertexData: VertexData;\r\n private _currentIndex: number;\r\n\r\n /**\r\n * Gets or sets a value indicating which UV to set\r\n */\r\n @editableInPropertyPage(\"Texture coordinates index\", PropertyTypeForEdition.List, \"ADVANCED\", {\r\n notifiers: { update: true },\r\n options: [\r\n { label: \"UV1\", value: 0 },\r\n { label: \"UV2\", value: 1 },\r\n { label: \"UV3\", value: 2 },\r\n { label: \"UV4\", value: 3 },\r\n { label: \"UV5\", value: 4 },\r\n { label: \"UV6\", value: 5 },\r\n ],\r\n })\r\n public textureCoordinateIndex = 0;\r\n\r\n /**\r\n * Create a new SetUVsBlock\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(\"uvs\", NodeGeometryBlockConnectionPointTypes.Vector2);\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._currentIndex;\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._currentIndex;\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 getClassName() {\r\n return \"SetUVsBlock\";\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 uvs input component\r\n */\r\n public get uvs(): 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 protected _buildBlock(state: NodeGeometryBuildState) {\r\n state.executionContext = this;\r\n\r\n this._vertexData = this.geometry.getConnectedValue(state);\r\n state.geometryContext = this._vertexData;\r\n\r\n if (!this._vertexData || !this._vertexData.positions) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n if (!this.uvs.isConnected) {\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n this.output._storedValue = this._vertexData;\r\n return;\r\n }\r\n\r\n const uvs: number[] = [];\r\n\r\n // Processing\r\n const vertexCount = this._vertexData.positions.length / 3;\r\n for (this._currentIndex = 0; this._currentIndex < vertexCount; this._currentIndex++) {\r\n const tempVector2 = this.uvs.getConnectedValue(state) as Vector2;\r\n if (tempVector2) {\r\n tempVector2.toArray(uvs, this._currentIndex * 2);\r\n }\r\n }\r\n\r\n switch (this.textureCoordinateIndex) {\r\n case 0:\r\n this._vertexData.uvs = uvs;\r\n break;\r\n case 1:\r\n this._vertexData.uvs2 = uvs;\r\n break;\r\n case 2:\r\n this._vertexData.uvs3 = uvs;\r\n break;\r\n case 3:\r\n this._vertexData.uvs4 = uvs;\r\n break;\r\n case 4:\r\n this._vertexData.uvs5 = uvs;\r\n break;\r\n case 5:\r\n this._vertexData.uvs6 = uvs;\r\n break;\r\n }\r\n\r\n // Storage\r\n this.output._storedValue = this._vertexData;\r\n state.executionContext = null;\r\n state.geometryContext = null;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.textureCoordinateIndex};\\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 serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.textureCoordinateIndex = this.textureCoordinateIndex;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n this.textureCoordinateIndex = serializationObject.textureCoordinateIndex;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.SetUVsBlock\", SetUVsBlock);\r\n"]}
|
|
@@ -23,6 +23,10 @@ export declare class MeshBlock extends NodeGeometryBlock {
|
|
|
23
23
|
* @returns the class name
|
|
24
24
|
*/
|
|
25
25
|
getClassName(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Gets a boolean indicating if the block is using cached data
|
|
28
|
+
*/
|
|
29
|
+
get isUsingCachedData(): boolean;
|
|
26
30
|
/**
|
|
27
31
|
* Gets the geometry output component
|
|
28
32
|
*/
|
|
@@ -31,6 +31,12 @@ export class MeshBlock extends NodeGeometryBlock {
|
|
|
31
31
|
getClassName() {
|
|
32
32
|
return "MeshBlock";
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Gets a boolean indicating if the block is using cached data
|
|
36
|
+
*/
|
|
37
|
+
get isUsingCachedData() {
|
|
38
|
+
return !this.mesh && !!this._cachedVertexData;
|
|
39
|
+
}
|
|
34
40
|
/**
|
|
35
41
|
* Gets the geometry output component
|
|
36
42
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meshBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/meshBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAGhE;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,iBAAiB;IAI5C;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAW,IAAI,CAAC,KAAqB;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED;;;OAGG;IACH,YAAmB,IAAY;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C;IAEM,YAAY,CAAC,mBAAwB;QACxC,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,mBAAmB,CAAC,gBAAgB,EAAE;YACtC,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;SACnF;IACL,CAAC;CACJ;AAED,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { Mesh } from \"../../../../Meshes/mesh\";\r\nimport { VertexData } from \"../../../../Meshes/mesh.vertexData\";\r\nimport type { Nullable } from \"../../../../types\";\r\n\r\n/**\r\n * Defines a block used to generate a user defined mesh geometry data\r\n */\r\nexport class MeshBlock extends NodeGeometryBlock {\r\n private _mesh: Nullable<Mesh>;\r\n private _cachedVertexData: Nullable<VertexData> = null;\r\n\r\n /**\r\n * Gets or sets the mesh to use to get vertex data\r\n */\r\n public get mesh() {\r\n return this._mesh;\r\n }\r\n\r\n public set mesh(value: Nullable<Mesh>) {\r\n this._mesh = value;\r\n }\r\n\r\n /**\r\n * Create a new MeshBlock\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.registerOutput(\"geometry\", NodeGeometryBlockConnectionPointTypes.Geometry);\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 \"MeshBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this._mesh) {\r\n if (this._cachedVertexData) {\r\n this.geometry._storedValue = this._cachedVertexData.clone();\r\n } else {\r\n this.geometry._storedValue = null;\r\n }\r\n return;\r\n }\r\n\r\n this.geometry._storedValue = VertexData.ExtractFromMesh(this._mesh, false, true);\r\n this._cachedVertexData = null;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @param saveMeshData defines a boolean indicating that mesh data must be saved as well\r\n * @returns the serialized block object\r\n */\r\n public serialize(saveMeshData?: boolean): any {\r\n const serializationObject = super.serialize();\r\n\r\n if (saveMeshData) {\r\n if (this._mesh) {\r\n serializationObject.cachedVertexData = VertexData.ExtractFromMesh(this._mesh, false, true).serialize();\r\n } else if (this._cachedVertexData) {\r\n serializationObject.cachedVertexData = this._cachedVertexData.serialize();\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n if (serializationObject.cachedVertexData) {\r\n this._cachedVertexData = VertexData.Parse(serializationObject.cachedVertexData);\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MeshBlock\", MeshBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"meshBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/Meshes/Node/Blocks/Sources/meshBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,MAAM,8CAA8C,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAGhE;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,iBAAiB;IAI5C;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAW,IAAI,CAAC,KAAqB;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;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AI,CAAC,iBAAiB,EAAE;gBAC/B,mBAAmB,CAAC,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,CAAC;aAC7E;SACJ;QAED,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,YAAY,CAAC,mBAAwB;QACxC,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,mBAAmB,CAAC,gBAAgB,EAAE;YACtC,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;SACnF;IACL,CAAC;CACJ;AAED,aAAa,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport type { Mesh } from \"../../../../Meshes/mesh\";\r\nimport { VertexData } from \"../../../../Meshes/mesh.vertexData\";\r\nimport type { Nullable } from \"../../../../types\";\r\n\r\n/**\r\n * Defines a block used to generate a user defined mesh geometry data\r\n */\r\nexport class MeshBlock extends NodeGeometryBlock {\r\n private _mesh: Nullable<Mesh>;\r\n private _cachedVertexData: Nullable<VertexData> = null;\r\n\r\n /**\r\n * Gets or sets the mesh to use to get vertex data\r\n */\r\n public get mesh() {\r\n return this._mesh;\r\n }\r\n\r\n public set mesh(value: Nullable<Mesh>) {\r\n this._mesh = value;\r\n }\r\n\r\n /**\r\n * Create a new MeshBlock\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.registerOutput(\"geometry\", NodeGeometryBlockConnectionPointTypes.Geometry);\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 \"MeshBlock\";\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the block is using cached data\r\n */\r\n public get isUsingCachedData() {\r\n return !this.mesh && !!this._cachedVertexData;\r\n }\r\n\r\n /**\r\n * Gets the geometry output component\r\n */\r\n public get geometry(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this._mesh) {\r\n if (this._cachedVertexData) {\r\n this.geometry._storedValue = this._cachedVertexData.clone();\r\n } else {\r\n this.geometry._storedValue = null;\r\n }\r\n return;\r\n }\r\n\r\n this.geometry._storedValue = VertexData.ExtractFromMesh(this._mesh, false, true);\r\n this._cachedVertexData = null;\r\n }\r\n\r\n /**\r\n * Serializes this block in a JSON representation\r\n * @param saveMeshData defines a boolean indicating that mesh data must be saved as well\r\n * @returns the serialized block object\r\n */\r\n public serialize(saveMeshData?: boolean): any {\r\n const serializationObject = super.serialize();\r\n\r\n if (saveMeshData) {\r\n if (this._mesh) {\r\n serializationObject.cachedVertexData = VertexData.ExtractFromMesh(this._mesh, false, true).serialize();\r\n } else if (this._cachedVertexData) {\r\n serializationObject.cachedVertexData = this._cachedVertexData.serialize();\r\n }\r\n }\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n\r\n if (serializationObject.cachedVertexData) {\r\n this._cachedVertexData = VertexData.Parse(serializationObject.cachedVertexData);\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.MeshBlock\", MeshBlock);\r\n"]}
|
|
@@ -50,6 +50,7 @@ export class TeleportInBlock extends NodeGeometryBlock {
|
|
|
50
50
|
endpoint._entryPoint = this;
|
|
51
51
|
endpoint._outputs[0]._typeConnectionSource = this._inputs[0];
|
|
52
52
|
endpoint._tempEntryPointUniqueId = null;
|
|
53
|
+
endpoint.name = "> " + this.name;
|
|
53
54
|
}
|
|
54
55
|
/**
|
|
55
56
|
* Remove enpoint from this block
|
|
@@ -1 +1 @@
|
|
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Class } from \"../../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../../nodeGeometryBlockConnectionPoint\";\r\nimport type { TeleportOutBlock } from \"./teleportOutBlock\";\r\n\r\n/**\r\n * Defines a block used to teleport a value to an endpoint\r\n */\r\nexport class TeleportInBlock extends NodeGeometryBlock {\r\n private _endpoints: TeleportOutBlock[] = [];\r\n\r\n /** Gets the list of attached endpoints */\r\n public get endpoints() {\r\n return this._endpoints;\r\n }\r\n\r\n /**\r\n * Create a new TeleportInBlock\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 }\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 \"TeleportInBlock\";\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 public _dumpCode(uniqueNames: string[], alreadyDumped: NodeGeometryBlock[]) {\r\n let codeString = super._dumpCode(uniqueNames, alreadyDumped);\r\n\r\n for (const endpoint of this.endpoints) {\r\n if (alreadyDumped.indexOf(endpoint) === -1) {\r\n codeString += endpoint._dumpCode(uniqueNames, alreadyDumped);\r\n }\r\n }\r\n\r\n return codeString;\r\n }\r\n\r\n /**\r\n * Add an enpoint to this block\r\n * @param endpoint define the endpoint to attach to\r\n */\r\n public attachToEndpoint(endpoint: TeleportOutBlock) {\r\n endpoint.detach();\r\n\r\n this._endpoints.push(endpoint);\r\n endpoint._entryPoint = this;\r\n endpoint._outputs[0]._typeConnectionSource = this._inputs[0];\r\n endpoint._tempEntryPointUniqueId = null;\r\n endpoint.name = \"> \" + this.name;\r\n }\r\n\r\n /**\r\n * Remove enpoint from this block\r\n * @param endpoint define the endpoint to remove\r\n */\r\n public detachFromEndpoint(endpoint: TeleportOutBlock) {\r\n const index = this._endpoints.indexOf(endpoint);\r\n\r\n if (index !== -1) {\r\n this._endpoints.splice(index, 1);\r\n endpoint._outputs[0]._typeConnectionSource = null;\r\n endpoint._entryPoint = null;\r\n }\r\n }\r\n\r\n protected _buildBlock() {\r\n for (const endpoint of this._endpoints) {\r\n endpoint.output._storedFunction = (state) => {\r\n return this.input.getConnectedValue(state);\r\n };\r\n }\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.TeleportInBlock\", TeleportInBlock);\r\n"]}
|
|
@@ -40,6 +40,9 @@ export class ComputeNormalsBlock extends NodeGeometryBlock {
|
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
42
42
|
const vertexData = this.geometry.getConnectedValue(state);
|
|
43
|
+
if (!vertexData.normals) {
|
|
44
|
+
vertexData.normals = [];
|
|
45
|
+
}
|
|
43
46
|
VertexData.ComputeNormals(vertexData.positions, vertexData.indices, vertexData.normals);
|
|
44
47
|
return vertexData;
|
|
45
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeNormalsBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/computeNormalsBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,iCAAoC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD;;GAEG;AACH,MAAM,OAAO,mBAAoB,SAAQ,iBAAiB;IACtD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,qCAAqC,CAAC,QAAQ,CAAC,CAAC;QAC/E,IAAI,CAAC,cAAc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ED;;OAEG;IACH,IAAW,QAAQ;QACf,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;IAES,WAAW;QACjB,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;YACpC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;gBAC5B,OAAO,IAAI,CAAC;aACf;YAED,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAC1D,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE;gBACrB,UAAU,CAAC,OAAO,GAAG,EAAE,CAAC;aAC3B;YAED,UAAU,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;YAExF,OAAO,UAAU,CAAC;QACtB,CAAC,CAAC;IACN,CAAC;CACJ;AAED,aAAa,CAAC,6BAA6B,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import { VertexData } from \"core/Meshes/mesh.vertexData\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n/**\r\n * Block used to recompute normals for a geometry\r\n */\r\nexport class ComputeNormalsBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new ComputeNormalsBlock\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.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Geometry);\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 \"ComputeNormalsBlock\";\r\n }\r\n\r\n /**\r\n * Gets the geometry 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 output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n this.output._storedFunction = (state) => {\r\n if (!this.geometry.isConnected) {\r\n return null;\r\n }\r\n\r\n const vertexData = this.geometry.getConnectedValue(state);\r\n if (!vertexData.normals) {\r\n vertexData.normals = [];\r\n }\r\n\r\n VertexData.ComputeNormals(vertexData.positions, vertexData.indices, vertexData.normals);\r\n\r\n return vertexData;\r\n };\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ComputeNormalsBlock\", ComputeNormalsBlock);\r\n"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { NodeGeometryBlock } from "../nodeGeometryBlock";
|
|
2
|
+
import type { NodeGeometryConnectionPoint } from "../nodeGeometryBlockConnectionPoint";
|
|
3
|
+
import type { NodeGeometryBuildState } from "../nodeGeometryBuildState";
|
|
4
|
+
/**
|
|
5
|
+
* Block used to randomly pick a geometry from a collection
|
|
6
|
+
*/
|
|
7
|
+
export declare class GeometryCollectionBlock extends NodeGeometryBlock {
|
|
8
|
+
/**
|
|
9
|
+
* Gets or sets a boolean indicating that this block can evaluate context
|
|
10
|
+
* Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
|
|
11
|
+
*/
|
|
12
|
+
evaluateContext: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new GeometryCollectionBlock
|
|
15
|
+
* @param name defines the block name
|
|
16
|
+
*/
|
|
17
|
+
constructor(name: string);
|
|
18
|
+
/**
|
|
19
|
+
* Gets the current class name
|
|
20
|
+
* @returns the class name
|
|
21
|
+
*/
|
|
22
|
+
getClassName(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Gets the geometry0 input component
|
|
25
|
+
*/
|
|
26
|
+
get geometry0(): NodeGeometryConnectionPoint;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the geometry1 input component
|
|
29
|
+
*/
|
|
30
|
+
get geometry1(): NodeGeometryConnectionPoint;
|
|
31
|
+
/**
|
|
32
|
+
* Gets the geometry2 input component
|
|
33
|
+
*/
|
|
34
|
+
get geometry2(): NodeGeometryConnectionPoint;
|
|
35
|
+
/**
|
|
36
|
+
* Gets the geometry3 input component
|
|
37
|
+
*/
|
|
38
|
+
get geometry3(): NodeGeometryConnectionPoint;
|
|
39
|
+
/**
|
|
40
|
+
* Gets the geometry4 input component
|
|
41
|
+
*/
|
|
42
|
+
get geometry4(): NodeGeometryConnectionPoint;
|
|
43
|
+
/**
|
|
44
|
+
* Gets the geometry5 input component
|
|
45
|
+
*/
|
|
46
|
+
get geometry5(): NodeGeometryConnectionPoint;
|
|
47
|
+
/**
|
|
48
|
+
* Gets the geometry6 input component
|
|
49
|
+
*/
|
|
50
|
+
get geometry6(): NodeGeometryConnectionPoint;
|
|
51
|
+
/**
|
|
52
|
+
* Gets the geometry7 input component
|
|
53
|
+
*/
|
|
54
|
+
get geometry7(): NodeGeometryConnectionPoint;
|
|
55
|
+
/**
|
|
56
|
+
* Gets the geometry8 input component
|
|
57
|
+
*/
|
|
58
|
+
get geometry8(): NodeGeometryConnectionPoint;
|
|
59
|
+
/**
|
|
60
|
+
* Gets the geometry9 input component
|
|
61
|
+
*/
|
|
62
|
+
get geometry9(): NodeGeometryConnectionPoint;
|
|
63
|
+
/**
|
|
64
|
+
* Gets the geometry output component
|
|
65
|
+
*/
|
|
66
|
+
get output(): NodeGeometryConnectionPoint;
|
|
67
|
+
private _storeGeometry;
|
|
68
|
+
protected _buildBlock(state: NodeGeometryBuildState): void;
|
|
69
|
+
protected _dumpPropertiesCode(): string;
|
|
70
|
+
/**
|
|
71
|
+
* Serializes this block in a JSON representation
|
|
72
|
+
* @returns the serialized block object
|
|
73
|
+
*/
|
|
74
|
+
serialize(): any;
|
|
75
|
+
_deserialize(serializationObject: any): void;
|
|
76
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
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 { PropertyTypeForEdition, editableInPropertyPage } from "../../../Decorators/nodeDecorator.js";
|
|
6
|
+
/**
|
|
7
|
+
* Block used to randomly pick a geometry from a collection
|
|
8
|
+
*/
|
|
9
|
+
export class GeometryCollectionBlock extends NodeGeometryBlock {
|
|
10
|
+
/**
|
|
11
|
+
* Create a new GeometryCollectionBlock
|
|
12
|
+
* @param name defines the block name
|
|
13
|
+
*/
|
|
14
|
+
constructor(name) {
|
|
15
|
+
super(name);
|
|
16
|
+
/**
|
|
17
|
+
* Gets or sets a boolean indicating that this block can evaluate context
|
|
18
|
+
* Build performance is improved when this value is set to false as the system will cache values instead of reevaluating everything per context change
|
|
19
|
+
*/
|
|
20
|
+
this.evaluateContext = true;
|
|
21
|
+
this.registerInput("geometry0", NodeGeometryBlockConnectionPointTypes.Geometry, true);
|
|
22
|
+
this.registerInput("geometry1", NodeGeometryBlockConnectionPointTypes.Geometry, true);
|
|
23
|
+
this.registerInput("geometry2", NodeGeometryBlockConnectionPointTypes.Geometry, true);
|
|
24
|
+
this.registerInput("geometry3", NodeGeometryBlockConnectionPointTypes.Geometry, true);
|
|
25
|
+
this.registerInput("geometry4", NodeGeometryBlockConnectionPointTypes.Geometry, true);
|
|
26
|
+
this.registerInput("geometry5", NodeGeometryBlockConnectionPointTypes.Geometry, true);
|
|
27
|
+
this.registerInput("geometry6", NodeGeometryBlockConnectionPointTypes.Geometry, true);
|
|
28
|
+
this.registerInput("geometry7", NodeGeometryBlockConnectionPointTypes.Geometry, true);
|
|
29
|
+
this.registerInput("geometry8", NodeGeometryBlockConnectionPointTypes.Geometry, true);
|
|
30
|
+
this.registerInput("geometry9", NodeGeometryBlockConnectionPointTypes.Geometry, true);
|
|
31
|
+
this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Geometry);
|
|
32
|
+
this._outputs[0]._typeConnectionSource = this._inputs[0];
|
|
33
|
+
this._linkConnectionTypes(0, 1);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Gets the current class name
|
|
37
|
+
* @returns the class name
|
|
38
|
+
*/
|
|
39
|
+
getClassName() {
|
|
40
|
+
return "GeometryCollectionBlock";
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Gets the geometry0 input component
|
|
44
|
+
*/
|
|
45
|
+
get geometry0() {
|
|
46
|
+
return this._inputs[0];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Gets the geometry1 input component
|
|
50
|
+
*/
|
|
51
|
+
get geometry1() {
|
|
52
|
+
return this._inputs[1];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Gets the geometry2 input component
|
|
56
|
+
*/
|
|
57
|
+
get geometry2() {
|
|
58
|
+
return this._inputs[2];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Gets the geometry3 input component
|
|
62
|
+
*/
|
|
63
|
+
get geometry3() {
|
|
64
|
+
return this._inputs[3];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Gets the geometry4 input component
|
|
68
|
+
*/
|
|
69
|
+
get geometry4() {
|
|
70
|
+
return this._inputs[4];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Gets the geometry5 input component
|
|
74
|
+
*/
|
|
75
|
+
get geometry5() {
|
|
76
|
+
return this._inputs[5];
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Gets the geometry6 input component
|
|
80
|
+
*/
|
|
81
|
+
get geometry6() {
|
|
82
|
+
return this._inputs[6];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Gets the geometry7 input component
|
|
86
|
+
*/
|
|
87
|
+
get geometry7() {
|
|
88
|
+
return this._inputs[7];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Gets the geometry8 input component
|
|
92
|
+
*/
|
|
93
|
+
get geometry8() {
|
|
94
|
+
return this._inputs[8];
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Gets the geometry9 input component
|
|
98
|
+
*/
|
|
99
|
+
get geometry9() {
|
|
100
|
+
return this._inputs[9];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Gets the geometry output component
|
|
104
|
+
*/
|
|
105
|
+
get output() {
|
|
106
|
+
return this._outputs[0];
|
|
107
|
+
}
|
|
108
|
+
_storeGeometry(input, state, index, availables) {
|
|
109
|
+
if (input.isConnected) {
|
|
110
|
+
const vertexData = input.getConnectedValue(state);
|
|
111
|
+
vertexData.metadata = vertexData.metadata || {};
|
|
112
|
+
vertexData.metadata.collectionId = index;
|
|
113
|
+
availables.push(vertexData);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
_buildBlock(state) {
|
|
117
|
+
const func = (state) => {
|
|
118
|
+
const availables = [];
|
|
119
|
+
this._storeGeometry(this.geometry0, state, 0, availables);
|
|
120
|
+
this._storeGeometry(this.geometry1, state, 1, availables);
|
|
121
|
+
this._storeGeometry(this.geometry2, state, 2, availables);
|
|
122
|
+
this._storeGeometry(this.geometry3, state, 3, availables);
|
|
123
|
+
this._storeGeometry(this.geometry4, state, 4, availables);
|
|
124
|
+
this._storeGeometry(this.geometry5, state, 5, availables);
|
|
125
|
+
this._storeGeometry(this.geometry6, state, 6, availables);
|
|
126
|
+
this._storeGeometry(this.geometry7, state, 7, availables);
|
|
127
|
+
this._storeGeometry(this.geometry8, state, 8, availables);
|
|
128
|
+
this._storeGeometry(this.geometry9, state, 9, availables);
|
|
129
|
+
if (!availables.length) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
return availables[Math.round(Math.random() * (availables.length - 1))];
|
|
133
|
+
};
|
|
134
|
+
if (this.evaluateContext) {
|
|
135
|
+
this.output._storedFunction = func;
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
this.output._storedValue = func(state);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
_dumpPropertiesCode() {
|
|
142
|
+
const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.evaluateContext = ${this.evaluateContext ? "true" : "false"};\n`;
|
|
143
|
+
return codeString;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Serializes this block in a JSON representation
|
|
147
|
+
* @returns the serialized block object
|
|
148
|
+
*/
|
|
149
|
+
serialize() {
|
|
150
|
+
const serializationObject = super.serialize();
|
|
151
|
+
serializationObject.evaluateContext = this.evaluateContext;
|
|
152
|
+
return serializationObject;
|
|
153
|
+
}
|
|
154
|
+
_deserialize(serializationObject) {
|
|
155
|
+
super._deserialize(serializationObject);
|
|
156
|
+
this.evaluateContext = serializationObject.evaluateContext;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
__decorate([
|
|
160
|
+
editableInPropertyPage("Evaluate context", PropertyTypeForEdition.Boolean, "ADVANCED", { notifiers: { rebuild: true } })
|
|
161
|
+
], GeometryCollectionBlock.prototype, "evaluateContext", void 0);
|
|
162
|
+
RegisterClass("BABYLON.GeometryCollectionBlock", GeometryCollectionBlock);
|
|
163
|
+
//# sourceMappingURL=geometryCollectionBlock.js.map
|