@babylonjs/core 7.28.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.
Files changed (120) hide show
  1. package/Culling/ray.core.d.ts +13 -0
  2. package/Culling/ray.core.js +14 -6
  3. package/Culling/ray.core.js.map +1 -1
  4. package/Engines/WebGPU/Extensions/engine.debugging.js +24 -0
  5. package/Engines/WebGPU/Extensions/engine.debugging.js.map +1 -1
  6. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +4 -1
  7. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  8. package/Engines/abstractEngine.js +2 -2
  9. package/Engines/abstractEngine.js.map +1 -1
  10. package/Engines/engine.d.ts +2 -1
  11. package/Engines/index.d.ts +1 -0
  12. package/Engines/index.js +1 -0
  13. package/Engines/index.js.map +1 -1
  14. package/Engines/nullEngine.d.ts +1 -0
  15. package/Engines/nullEngine.js +1 -0
  16. package/Engines/nullEngine.js.map +1 -1
  17. package/Engines/webgpuEngine.d.ts +4 -0
  18. package/Engines/webgpuEngine.js +2 -4
  19. package/Engines/webgpuEngine.js.map +1 -1
  20. package/Lights/Shadows/shadowGenerator.js +1 -1
  21. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  22. package/Loading/Plugins/babylonFileLoader.js +34 -18
  23. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  24. package/Materials/Textures/rawTexture3D.d.ts +12 -0
  25. package/Materials/Textures/rawTexture3D.js +18 -0
  26. package/Materials/Textures/rawTexture3D.js.map +1 -1
  27. package/Materials/Textures/renderTargetTexture.js +1 -2
  28. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  29. package/Materials/effect.d.ts +11 -0
  30. package/Materials/effect.js +20 -0
  31. package/Materials/effect.js.map +1 -1
  32. package/Materials/materialPluginBase.d.ts +46 -46
  33. package/Materials/materialPluginBase.js +46 -60
  34. package/Materials/materialPluginBase.js.map +1 -1
  35. package/Meshes/Builders/greasedLineBuilder.d.ts +0 -16
  36. package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
  37. package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +17 -1
  38. package/Meshes/GreasedLine/greasedLineBaseMesh.js +3 -2
  39. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  40. package/Meshes/Node/Blocks/Set/latticeBlock.d.ts +91 -0
  41. package/Meshes/Node/Blocks/Set/latticeBlock.js +194 -0
  42. package/Meshes/Node/Blocks/Set/latticeBlock.js.map +1 -0
  43. package/Meshes/Node/Blocks/Set/setPositionsBlock.js +11 -4
  44. package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
  45. package/Meshes/Node/Blocks/geometryClampBlock.d.ts +8 -0
  46. package/Meshes/Node/Blocks/geometryClampBlock.js +22 -6
  47. package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
  48. package/Meshes/Node/Blocks/geometryInputBlock.js +2 -0
  49. package/Meshes/Node/Blocks/geometryInputBlock.js.map +1 -1
  50. package/Meshes/Node/Blocks/geometryInterceptorBlock.d.ts +5 -0
  51. package/Meshes/Node/Blocks/geometryInterceptorBlock.js +5 -1
  52. package/Meshes/Node/Blocks/geometryInterceptorBlock.js.map +1 -1
  53. package/Meshes/Node/Enums/nodeGeometryContextualSources.d.ts +5 -1
  54. package/Meshes/Node/Enums/nodeGeometryContextualSources.js +4 -0
  55. package/Meshes/Node/Enums/nodeGeometryContextualSources.js.map +1 -1
  56. package/Meshes/Node/index.d.ts +1 -0
  57. package/Meshes/Node/index.js +1 -0
  58. package/Meshes/Node/index.js.map +1 -1
  59. package/Meshes/Node/nodeGeometryBuildState.js +12 -0
  60. package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
  61. package/Meshes/abstractMesh.d.ts +2 -0
  62. package/Meshes/abstractMesh.hotSpot.d.ts +30 -0
  63. package/Meshes/abstractMesh.hotSpot.js +84 -0
  64. package/Meshes/abstractMesh.hotSpot.js.map +1 -0
  65. package/Meshes/abstractMesh.js +2 -0
  66. package/Meshes/abstractMesh.js.map +1 -1
  67. package/Meshes/index.d.ts +3 -0
  68. package/Meshes/index.js +3 -0
  69. package/Meshes/index.js.map +1 -1
  70. package/Meshes/lattice.d.ts +110 -0
  71. package/Meshes/lattice.js +224 -0
  72. package/Meshes/lattice.js.map +1 -0
  73. package/Meshes/lattice.material.d.ts +82 -0
  74. package/Meshes/lattice.material.js +259 -0
  75. package/Meshes/lattice.material.js.map +1 -0
  76. package/Meshes/mesh.js +1 -1
  77. package/Meshes/mesh.js.map +1 -1
  78. package/Misc/greasedLineTools.d.ts +1 -2
  79. package/Misc/greasedLineTools.js.map +1 -1
  80. package/Misc/index.d.ts +1 -0
  81. package/Misc/index.js +1 -0
  82. package/Misc/index.js.map +1 -1
  83. package/Misc/screenshotTools.js +0 -3
  84. package/Misc/screenshotTools.js.map +1 -1
  85. package/Misc/snapshotRenderingHelper.d.ts +63 -0
  86. package/Misc/snapshotRenderingHelper.js +182 -0
  87. package/Misc/snapshotRenderingHelper.js.map +1 -0
  88. package/Morph/morphTargetManager.js +0 -1
  89. package/Morph/morphTargetManager.js.map +1 -1
  90. package/Shaders/spriteMap.fragment.d.ts +4 -0
  91. package/Shaders/spriteMap.fragment.js +16 -3
  92. package/Shaders/spriteMap.fragment.js.map +1 -1
  93. package/Shaders/spriteMap.vertex.d.ts +3 -0
  94. package/Shaders/spriteMap.vertex.js +14 -2
  95. package/Shaders/spriteMap.vertex.js.map +1 -1
  96. package/ShadersWGSL/bilateralBlurQuality.fragment.js +1 -1
  97. package/ShadersWGSL/bilateralBlurQuality.fragment.js.map +1 -1
  98. package/ShadersWGSL/default.fragment.js +1 -1
  99. package/ShadersWGSL/default.fragment.js.map +1 -1
  100. package/ShadersWGSL/geometry.fragment.js +2 -2
  101. package/ShadersWGSL/geometry.fragment.js.map +1 -1
  102. package/ShadersWGSL/geometry.vertex.js +2 -2
  103. package/ShadersWGSL/geometry.vertex.js.map +1 -1
  104. package/ShadersWGSL/pbr.fragment.js +1 -1
  105. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  106. package/ShadersWGSL/rsmFullGlobalIllumination.fragment.js +1 -1
  107. package/ShadersWGSL/rsmFullGlobalIllumination.fragment.js.map +1 -1
  108. package/Sprites/spriteManager.d.ts +10 -1
  109. package/Sprites/spriteManager.js +3 -2
  110. package/Sprites/spriteManager.js.map +1 -1
  111. package/Sprites/spriteMap.d.ts +7 -0
  112. package/Sprites/spriteMap.js +29 -1
  113. package/Sprites/spriteMap.js.map +1 -1
  114. package/Sprites/spritePackedManager.d.ts +6 -1
  115. package/Sprites/spritePackedManager.js +6 -2
  116. package/Sprites/spritePackedManager.js.map +1 -1
  117. package/Sprites/spriteRenderer.d.ts +16 -3
  118. package/Sprites/spriteRenderer.js +5 -3
  119. package/Sprites/spriteRenderer.js.map +1 -1
  120. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"geometryClampBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryClampBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAA0B,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAElG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AAEnE;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IAQrD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB,qCAAqC;QAE9B,YAAO,GAAG,GAAG,CAAC;QACrB,qCAAqC;QAE9B,YAAO,GAAG,GAAG,CAAC;QASjB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC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ACtB,CAAC;IAEe,SAAS;QACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC3C,mBAAmB,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAE3C,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEe,YAAY,CAAC,mBAAwB;QACjD,KAAK,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QAExC,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC;QAC3C,IAAI,CAAC,OAAO,GAAG,mBAAmB,CAAC,OAAO,CAAC;IAC/C,CAAC;CACJ;AAnGU;IADN,sBAAsB,CAAC,SAAS,uCAA+B;mDAC3C;AAGd;IADN,sBAAsB,CAAC,SAAS,uCAA+B;mDAC3C;AAkGzB,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.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 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) => {\r\n return Math.max(this.minimum, Math.min(value, this.maximum));\r\n };\r\n\r\n this.output._storedFunction = (state) => {\r\n const value = this.value.getConnectedValue(state);\r\n switch (this.value.type) {\r\n case NodeGeometryBlockConnectionPointTypes.Int:\r\n case NodeGeometryBlockConnectionPointTypes.Float: {\r\n return func!(value);\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector2: {\r\n return new Vector2(func!(value.x), func!(value.y));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector3: {\r\n return new Vector3(func!(value.x), func!(value.y), func!(value.z));\r\n }\r\n case NodeGeometryBlockConnectionPointTypes.Vector4: {\r\n return new Vector4(func!(value.x), func!(value.y), func!(value.z), func!(value.w));\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"]}
1
+ {"version":3,"file":"geometryClampBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryClampBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAA0B,MAAM,mCAAmC,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,2CAA2C,CAAC;AAElG,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,sCAA+B;AAEnE;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,iBAAiB;IAQrD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAZhB,qCAAqC;QAE9B,YAAO,GAAG,GAAG,CAAC;QACrB,qCAAqC;QAE9B,YAAO,GAAG,GAAG,CAAC;QASjB,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,qCAAqC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC7E,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,qCAAqC,CAAC,KAA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C;CACJ;AAtHU;IADN,sBAAsB,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;IAkBrD;;OAEG;IACH,IAAW,IAAI;QACX,IAAI,IAAI,C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e,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,GAAG,qCAAqC,CAAC,OAAO,CAAC;wBAC3D,OAAO,IAAI,CA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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
- const value = input.getConnectedValue(state);
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;;GAEG;AACH,MAAM,OAA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J;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 */\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 * 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 const value = input.getConnectedValue(state);\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"]}
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"]}
@@ -35,5 +35,9 @@ export declare enum NodeGeometryContextualSources {
35
35
  /** LoopID */
36
36
  LoopID = 15,
37
37
  /** InstanceID */
38
- InstanceID = 16
38
+ InstanceID = 16,
39
+ /** LatticeID */
40
+ LatticeID = 17,
41
+ /** LatticeControl */
42
+ LatticeControl = 18
39
43
  }
@@ -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,6BAmCX;AAnCD,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;AACvB,CAAC,EAnCW,6BAA6B,KAA7B,6BAA6B,QAmCxC","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}\r\n"]}
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"]}
@@ -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";
@@ -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";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../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C;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,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/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,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACn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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"]}
@@ -172,6 +172,18 @@ export class NodeGeometryBuildState {
172
172
  }
173
173
  return this.geometryContext.metadata.collectionId || 0;
174
174
  }
175
+ case NodeGeometryContextualSources.LatticeID: {
176
+ if (this.executionContext.getOverridePositionsContextualValue) {
177
+ return this.executionContext.getOverridePositionsContextualValue();
178
+ }
179
+ return Vector3.Zero();
180
+ }
181
+ case NodeGeometryContextualSources.LatticeControl: {
182
+ if (this.executionContext.getOverrideNormalsContextualValue) {
183
+ return this.executionContext.getOverrideNormalsContextualValue();
184
+ }
185
+ return Vector3.Zero();
186
+ }
175
187
  }
176
188
  return null;
177
189
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nodeGeometryBuildState.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Node/nodeGeometryBuildState.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,EAAE,qCAAqC,EAAE,MAAM,0CAA0C,CAAC;AAGjG;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAAnC;QACY,oBAAe,GAAG,IAAI,MAAM,EAAE,CAAC;QAC/B,mBAAc,GAAG,IAAI,MAAM,EAAE,CAAC;QAC9B,oBAAe,GAAG,IAAI,MAAM,EAAE,CAAC;QAC/B,2BAAsB,GAAG,IAAI,MAAM,EAAE,CAAC;QACtC,qBAAgB,GAAG,IAAI,MAAM,EAAE,CAAC;QAChC,iBAAY,GAAG,IAAI,OAAO,EAAE,CAAC;QAErC,8DAA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C,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,SAAU,EAAE,kBAAkB,CAAC,CAAC;YAEhE,IAAI,KAAK,CAAC,OAAO,EAAE;gBACf,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;gBAC/D,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;gBAC1F,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;aAChE;SACJ;QAED,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport type { VertexData } from \"../mesh.vertexData\";\r\nimport type { NodeGeometryConnectionPoint } from \"./nodeGeometryBlockConnectionPoint\";\r\nimport { NodeGeometryContextualSources } from \"./Enums/nodeGeometryContextualSources\";\r\nimport { Matrix, Vector2, Vector3, Vector4 } from \"../../Maths/math.vector\";\r\nimport type { INodeGeometryExecutionContext } from \"./Interfaces/nodeGeometryExecutionContext\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"./Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { INodeGeometryInstancingContext } from \"./Interfaces/nodeGeometryInstancingContext\";\r\n\r\n/**\r\n * Class used to store node based geometry build state\r\n */\r\nexport class NodeGeometryBuildState {\r\n private _rotationMatrix = new Matrix();\r\n private _scalingMatrix = new Matrix();\r\n private _positionMatrix = new Matrix();\r\n private _scalingRotationMatrix = new Matrix();\r\n private _transformMatrix = new Matrix();\r\n private _tempVector3 = new Vector3();\r\n\r\n /** Gets or sets the list of non connected mandatory inputs */\r\n public notConnectedNonOptionalInputs: NodeGeometryConnectionPoint[] = [];\r\n /** Gets or sets the list of non contextual inputs having no contextudal data */\r\n public noContextualData: NodeGeometryContextualSources[] = [];\r\n /** Gets or sets the build identifier */\r\n public buildId: number;\r\n /** Gets or sets a boolean indicating that verbose mode is on */\r\n public verbose: boolean;\r\n /** Gets or sets the vertex data */\r\n public vertexData: Nullable<VertexData> = null;\r\n\r\n private _geometryContext: Nullable<VertexData> = null;\r\n private _executionContext: Nullable<INodeGeometryExecutionContext> = null;\r\n private _instancingContext: Nullable<INodeGeometryInstancingContext> = null;\r\n\r\n private _geometryContextStack: Array<Nullable<VertexData>> = [];\r\n private _executionContextStack: Array<Nullable<INodeGeometryExecutionContext>> = [];\r\n private _instancingContextStack: Array<Nullable<INodeGeometryInstancingContext>> = [];\r\n\r\n /** Gets or sets the geometry context */\r\n public get geometryContext() {\r\n return this._geometryContext;\r\n }\r\n\r\n /** Gets or sets the execution context */\r\n public get executionContext() {\r\n return this._executionContext;\r\n }\r\n\r\n /** Gets or sets the instancing context */\r\n public get instancingContext() {\r\n return this._instancingContext;\r\n }\r\n\r\n /**\r\n * Push the new active geometry context\r\n * @param geometryContext defines the geometry context\r\n */\r\n public pushGeometryContext(geometryContext: VertexData) {\r\n this._geometryContext = geometryContext;\r\n this._geometryContextStack.push(this._geometryContext);\r\n }\r\n\r\n /**\r\n * Push the new active execution context\r\n * @param executionContext defines the execution context\r\n */\r\n public pushExecutionContext(executionContext: INodeGeometryExecutionContext) {\r\n this._executionContext = executionContext;\r\n this._executionContextStack.push(this._executionContext);\r\n }\r\n\r\n /**\r\n * Push the new active instancing context\r\n * @param instancingContext defines the instancing context\r\n */\r\n public pushInstancingContext(instancingContext: INodeGeometryInstancingContext) {\r\n this._instancingContext = instancingContext;\r\n this._instancingContextStack.push(this._instancingContext);\r\n }\r\n\r\n /**\r\n * Remove current geometry context and restore the previous one\r\n */\r\n public restoreGeometryContext() {\r\n this._geometryContextStack.pop();\r\n this._geometryContext = this._geometryContextStack.length > 0 ? this._geometryContextStack[this._geometryContextStack.length - 1] : null;\r\n }\r\n\r\n /**\r\n * Remove current execution context and restore the previous one\r\n */\r\n public restoreExecutionContext() {\r\n this._executionContextStack.pop();\r\n this._executionContext = this._executionContextStack.length > 0 ? this._executionContextStack[this._executionContextStack.length - 1] : null;\r\n }\r\n\r\n /**\r\n * Remove current isntancing context and restore the previous one\r\n */\r\n public restoreInstancingContext() {\r\n this._instancingContextStack.pop();\r\n this._instancingContext = this._instancingContextStack.length > 0 ? this._instancingContextStack[this._instancingContextStack.length - 1] : null;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a contextual source\r\n * @param source Source of the contextual value\r\n * @param skipWarning Do not store the warning for reporting if true\r\n * @returns the value associated with the source\r\n */\r\n public getContextualValue(source: NodeGeometryContextualSources, skipWarning = false) {\r\n if (!this.executionContext) {\r\n if (!skipWarning) {\r\n this.noContextualData.push(source);\r\n }\r\n return null;\r\n }\r\n\r\n const index = this.executionContext.getExecutionIndex();\r\n\r\n switch (source) {\r\n case NodeGeometryContextualSources.Positions:\r\n if (this.executionContext.getOverridePositionsContextualValue) {\r\n return this.executionContext.getOverridePositionsContextualValue();\r\n }\r\n if (!this.geometryContext || !this.geometryContext.positions) {\r\n return Vector3.Zero();\r\n }\r\n return Vector3.FromArray(this.geometryContext.positions as ArrayLike<number>, index * 3);\r\n case NodeGeometryContextualSources.Normals:\r\n if (this.executionContext.getOverrideNormalsContextualValue) {\r\n return this.executionContext.getOverrideNormalsContextualValue();\r\n }\r\n if (!this.geometryContext || !this.geometryContext.normals) {\r\n return Vector3.Zero();\r\n }\r\n return Vector3.FromArray(this.geometryContext.normals as ArrayLike<number>, index * 3);\r\n case NodeGeometryContextualSources.Colors:\r\n if (!this.geometryContext || !this.geometryContext.colors) {\r\n return Vector4.Zero();\r\n }\r\n return Vector4.FromArray(this.geometryContext.colors as ArrayLike<number>, index * 4);\r\n case NodeGeometryContextualSources.Tangents:\r\n if (!this.geometryContext || !this.geometryContext.tangents) {\r\n return Vector4.Zero();\r\n }\r\n return Vector4.FromArray(this.geometryContext.tangents as ArrayLike<number>, index * 4);\r\n case NodeGeometryContextualSources.UV:\r\n if (this.executionContext.getOverrideUVs1ContextualValue) {\r\n return this.executionContext.getOverrideUVs1ContextualValue();\r\n }\r\n if (!this.geometryContext || !this.geometryContext.uvs) {\r\n return Vector2.Zero();\r\n }\r\n return Vector2.FromArray(this.geometryContext.uvs as ArrayLike<number>, index * 2);\r\n case NodeGeometryContextualSources.UV2:\r\n if (!this.geometryContext || !this.geometryContext.uvs2) {\r\n return Vector2.Zero();\r\n }\r\n return Vector2.FromArray(this.geometryContext.uvs2 as ArrayLike<number>, index * 2);\r\n case NodeGeometryContextualSources.UV3:\r\n if (!this.geometryContext || !this.geometryContext.uvs3) {\r\n return Vector2.Zero();\r\n }\r\n return Vector2.FromArray(this.geometryContext.uvs3 as ArrayLike<number>, index * 2);\r\n case NodeGeometryContextualSources.UV4:\r\n if (!this.geometryContext || !this.geometryContext.uvs4) {\r\n return Vector2.Zero();\r\n }\r\n return Vector2.FromArray(this.geometryContext.uvs4 as ArrayLike<number>, index * 2);\r\n case NodeGeometryContextualSources.UV5:\r\n if (!this.geometryContext || !this.geometryContext.uvs5) {\r\n return Vector2.Zero();\r\n }\r\n return Vector2.FromArray(this.geometryContext.uvs5 as ArrayLike<number>, index * 2);\r\n case NodeGeometryContextualSources.UV6:\r\n if (!this.geometryContext || !this.geometryContext.uvs6) {\r\n return Vector2.Zero();\r\n }\r\n return Vector2.FromArray(this.geometryContext.uvs6 as ArrayLike<number>, index * 2);\r\n case NodeGeometryContextualSources.VertexID:\r\n return index;\r\n case NodeGeometryContextualSources.FaceID:\r\n return this.executionContext.getExecutionFaceIndex();\r\n case NodeGeometryContextualSources.LoopID:\r\n return this.executionContext.getExecutionLoopIndex();\r\n case NodeGeometryContextualSources.InstanceID:\r\n return this.instancingContext ? this.instancingContext.getInstanceIndex() : 0;\r\n case NodeGeometryContextualSources.GeometryID:\r\n return !this.geometryContext ? 0 : this.geometryContext.uniqueId;\r\n case NodeGeometryContextualSources.CollectionID: {\r\n if (!this.geometryContext || !this.geometryContext.metadata) {\r\n return 0;\r\n }\r\n return this.geometryContext.metadata.collectionId || 0;\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Adapt a value to a target type\r\n * @param source defines the value to adapt\r\n * @param targetType defines the target type\r\n * @returns the adapted value\r\n */\r\n adapt(source: NodeGeometryConnectionPoint, targetType: NodeGeometryBlockConnectionPointTypes) {\r\n const value = source.getConnectedValue(this) || 0;\r\n\r\n if (source.type === targetType) {\r\n return value;\r\n }\r\n\r\n switch (targetType) {\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n return new Vector2(value, value);\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n return new Vector3(value, value, value);\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n return new Vector4(value, value, value, value);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Adapt an input value to a target type\r\n * @param source defines the value to adapt\r\n * @param targetType defines the target type\r\n * @param defaultValue defines the default value to use if not connected\r\n * @returns the adapted value\r\n */\r\n adaptInput(source: NodeGeometryConnectionPoint, targetType: NodeGeometryBlockConnectionPointTypes, defaultValue: any) {\r\n if (!source.isConnected) {\r\n return source.value || defaultValue;\r\n }\r\n\r\n const value = source.getConnectedValue(this);\r\n\r\n if (source._connectedPoint?.type === targetType) {\r\n return value;\r\n }\r\n\r\n switch (targetType) {\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n return new Vector2(value, value);\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n return new Vector3(value, value, value);\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n return new Vector4(value, value, value, value);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Emits console errors and exceptions if there is a failing check\r\n */\r\n public emitErrors() {\r\n let errorMessage = \"\";\r\n\r\n for (const notConnectedInput of this.notConnectedNonOptionalInputs) {\r\n errorMessage += `input ${notConnectedInput.name} from block ${\r\n notConnectedInput.ownerBlock.name\r\n }[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\\n`;\r\n }\r\n\r\n for (const source of this.noContextualData) {\r\n errorMessage += `Contextual input ${NodeGeometryContextualSources[source]} has no context to pull data from (must be connected to a setXXX block or a instantiateXXX block).\\n`;\r\n }\r\n\r\n if (errorMessage) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"Build of NodeGeometry failed:\\n\" + errorMessage;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _instantiate(clone: VertexData, currentPosition: Vector3, rotation: Vector3, scaling: Vector3, additionalVertexData: VertexData[]) {\r\n // Transform\r\n Matrix.ScalingToRef(scaling.x, scaling.y, scaling.z, this._scalingMatrix);\r\n Matrix.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, this._rotationMatrix);\r\n Matrix.TranslationToRef(currentPosition.x, currentPosition.y, currentPosition.z, this._positionMatrix);\r\n\r\n this._scalingMatrix.multiplyToRef(this._rotationMatrix, this._scalingRotationMatrix);\r\n this._scalingRotationMatrix.multiplyToRef(this._positionMatrix, this._transformMatrix);\r\n for (let clonePositionIndex = 0; clonePositionIndex < clone.positions!.length; clonePositionIndex += 3) {\r\n this._tempVector3.fromArray(clone.positions!, clonePositionIndex);\r\n Vector3.TransformCoordinatesToRef(this._tempVector3, this._transformMatrix, this._tempVector3);\r\n this._tempVector3.toArray(clone.positions!, clonePositionIndex);\r\n\r\n if (clone.normals) {\r\n this._tempVector3.fromArray(clone.normals, clonePositionIndex);\r\n Vector3.TransformNormalToRef(this._tempVector3, this._scalingRotationMatrix, this._tempVector3);\r\n this._tempVector3.toArray(clone.normals, clonePositionIndex);\r\n }\r\n }\r\n\r\n additionalVertexData.push(clone);\r\n }\r\n\r\n /** @internal */\r\n public _instantiateWithMatrix(clone: VertexData, transform: Matrix, additionalVertexData: VertexData[]) {\r\n for (let clonePositionIndex = 0; clonePositionIndex < clone.positions!.length; clonePositionIndex += 3) {\r\n this._tempVector3.fromArray(clone.positions!, clonePositionIndex);\r\n Vector3.TransformCoordinatesToRef(this._tempVector3, transform, this._tempVector3);\r\n this._tempVector3.toArray(clone.positions!, clonePositionIndex);\r\n\r\n if (clone.normals) {\r\n this._tempVector3.fromArray(clone.normals, clonePositionIndex);\r\n Vector3.TransformNormalToRef(this._tempVector3, transform, this._tempVector3);\r\n this._tempVector3.toArray(clone.normals, clonePositionIndex);\r\n }\r\n }\r\n\r\n additionalVertexData.push(clone);\r\n }\r\n\r\n /** @internal */\r\n public _instantiateWithPositionAndMatrix(clone: VertexData, currentPosition: Vector3, transform: Matrix, additionalVertexData: VertexData[]) {\r\n Matrix.TranslationToRef(currentPosition.x, currentPosition.y, currentPosition.z, this._positionMatrix);\r\n transform.multiplyToRef(this._positionMatrix, this._transformMatrix);\r\n\r\n for (let clonePositionIndex = 0; clonePositionIndex < clone.positions!.length; clonePositionIndex += 3) {\r\n this._tempVector3.fromArray(clone.positions!, clonePositionIndex);\r\n Vector3.TransformCoordinatesToRef(this._tempVector3, this._transformMatrix, this._tempVector3);\r\n this._tempVector3.toArray(clone.positions!, clonePositionIndex);\r\n\r\n if (clone.normals) {\r\n this._tempVector3.fromArray(clone.normals, clonePositionIndex);\r\n Vector3.TransformNormalToRef(this._tempVector3, this._transformMatrix, this._tempVector3);\r\n this._tempVector3.toArray(clone.normals, clonePositionIndex);\r\n }\r\n }\r\n\r\n additionalVertexData.push(clone);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"nodeGeometryBuildState.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Node/nodeGeometryBuildState.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAE5E,OAAO,EAAE,qCAAqC,EAAE,MAAM,0CAA0C,CAAC;AAGjG;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAAnC;QACY,oBAAe,GAAG,IAAI,MAAM,EAAE,C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AK,CAAC,CAAC;IACrC,CAAC;IAED,iBAAiB;IACV,iCAAiC,CAAC,KAAiB,EAAE,eAAwB,EAAE,SAAiB,EAAE,oBAAkC;QACvI,MAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACvG,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAErE,KAAK,IAAI,kBAAkB,GAAG,CAAC,EAAE,kBAAkB,GAAG,KAAK,CAAC,SAAU,CAAC,MAAM,EAAE,kBAAkB,IAAI,CAAC,EAAE;YACpG,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,SAAU,EAAE,kBAAkB,CAAC,CAAC;YAClE,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;YAC/F,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,SAAU,EAAE,kBAAkB,CAAC,CAAC;YAEhE,IAAI,KAAK,CAAC,OAAO,EAAE;gBACf,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;gBAC/D,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;gBAC1F,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;aAChE;SACJ;QAED,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;CACJ","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport type { VertexData } from \"../mesh.vertexData\";\r\nimport type { NodeGeometryConnectionPoint } from \"./nodeGeometryBlockConnectionPoint\";\r\nimport { NodeGeometryContextualSources } from \"./Enums/nodeGeometryContextualSources\";\r\nimport { Matrix, Vector2, Vector3, Vector4 } from \"../../Maths/math.vector\";\r\nimport type { INodeGeometryExecutionContext } from \"./Interfaces/nodeGeometryExecutionContext\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"./Enums/nodeGeometryConnectionPointTypes\";\r\nimport type { INodeGeometryInstancingContext } from \"./Interfaces/nodeGeometryInstancingContext\";\r\n\r\n/**\r\n * Class used to store node based geometry build state\r\n */\r\nexport class NodeGeometryBuildState {\r\n private _rotationMatrix = new Matrix();\r\n private _scalingMatrix = new Matrix();\r\n private _positionMatrix = new Matrix();\r\n private _scalingRotationMatrix = new Matrix();\r\n private _transformMatrix = new Matrix();\r\n private _tempVector3 = new Vector3();\r\n\r\n /** Gets or sets the list of non connected mandatory inputs */\r\n public notConnectedNonOptionalInputs: NodeGeometryConnectionPoint[] = [];\r\n /** Gets or sets the list of non contextual inputs having no contextudal data */\r\n public noContextualData: NodeGeometryContextualSources[] = [];\r\n /** Gets or sets the build identifier */\r\n public buildId: number;\r\n /** Gets or sets a boolean indicating that verbose mode is on */\r\n public verbose: boolean;\r\n /** Gets or sets the vertex data */\r\n public vertexData: Nullable<VertexData> = null;\r\n\r\n private _geometryContext: Nullable<VertexData> = null;\r\n private _executionContext: Nullable<INodeGeometryExecutionContext> = null;\r\n private _instancingContext: Nullable<INodeGeometryInstancingContext> = null;\r\n\r\n private _geometryContextStack: Array<Nullable<VertexData>> = [];\r\n private _executionContextStack: Array<Nullable<INodeGeometryExecutionContext>> = [];\r\n private _instancingContextStack: Array<Nullable<INodeGeometryInstancingContext>> = [];\r\n\r\n /** Gets or sets the geometry context */\r\n public get geometryContext() {\r\n return this._geometryContext;\r\n }\r\n\r\n /** Gets or sets the execution context */\r\n public get executionContext() {\r\n return this._executionContext;\r\n }\r\n\r\n /** Gets or sets the instancing context */\r\n public get instancingContext() {\r\n return this._instancingContext;\r\n }\r\n\r\n /**\r\n * Push the new active geometry context\r\n * @param geometryContext defines the geometry context\r\n */\r\n public pushGeometryContext(geometryContext: VertexData) {\r\n this._geometryContext = geometryContext;\r\n this._geometryContextStack.push(this._geometryContext);\r\n }\r\n\r\n /**\r\n * Push the new active execution context\r\n * @param executionContext defines the execution context\r\n */\r\n public pushExecutionContext(executionContext: INodeGeometryExecutionContext) {\r\n this._executionContext = executionContext;\r\n this._executionContextStack.push(this._executionContext);\r\n }\r\n\r\n /**\r\n * Push the new active instancing context\r\n * @param instancingContext defines the instancing context\r\n */\r\n public pushInstancingContext(instancingContext: INodeGeometryInstancingContext) {\r\n this._instancingContext = instancingContext;\r\n this._instancingContextStack.push(this._instancingContext);\r\n }\r\n\r\n /**\r\n * Remove current geometry context and restore the previous one\r\n */\r\n public restoreGeometryContext() {\r\n this._geometryContextStack.pop();\r\n this._geometryContext = this._geometryContextStack.length > 0 ? this._geometryContextStack[this._geometryContextStack.length - 1] : null;\r\n }\r\n\r\n /**\r\n * Remove current execution context and restore the previous one\r\n */\r\n public restoreExecutionContext() {\r\n this._executionContextStack.pop();\r\n this._executionContext = this._executionContextStack.length > 0 ? this._executionContextStack[this._executionContextStack.length - 1] : null;\r\n }\r\n\r\n /**\r\n * Remove current isntancing context and restore the previous one\r\n */\r\n public restoreInstancingContext() {\r\n this._instancingContextStack.pop();\r\n this._instancingContext = this._instancingContextStack.length > 0 ? this._instancingContextStack[this._instancingContextStack.length - 1] : null;\r\n }\r\n\r\n /**\r\n * Gets the value associated with a contextual source\r\n * @param source Source of the contextual value\r\n * @param skipWarning Do not store the warning for reporting if true\r\n * @returns the value associated with the source\r\n */\r\n public getContextualValue(source: NodeGeometryContextualSources, skipWarning = false) {\r\n if (!this.executionContext) {\r\n if (!skipWarning) {\r\n this.noContextualData.push(source);\r\n }\r\n return null;\r\n }\r\n\r\n const index = this.executionContext.getExecutionIndex();\r\n\r\n switch (source) {\r\n case NodeGeometryContextualSources.Positions:\r\n if (this.executionContext.getOverridePositionsContextualValue) {\r\n return this.executionContext.getOverridePositionsContextualValue();\r\n }\r\n if (!this.geometryContext || !this.geometryContext.positions) {\r\n return Vector3.Zero();\r\n }\r\n return Vector3.FromArray(this.geometryContext.positions as ArrayLike<number>, index * 3);\r\n case NodeGeometryContextualSources.Normals:\r\n if (this.executionContext.getOverrideNormalsContextualValue) {\r\n return this.executionContext.getOverrideNormalsContextualValue();\r\n }\r\n if (!this.geometryContext || !this.geometryContext.normals) {\r\n return Vector3.Zero();\r\n }\r\n return Vector3.FromArray(this.geometryContext.normals as ArrayLike<number>, index * 3);\r\n case NodeGeometryContextualSources.Colors:\r\n if (!this.geometryContext || !this.geometryContext.colors) {\r\n return Vector4.Zero();\r\n }\r\n return Vector4.FromArray(this.geometryContext.colors as ArrayLike<number>, index * 4);\r\n case NodeGeometryContextualSources.Tangents:\r\n if (!this.geometryContext || !this.geometryContext.tangents) {\r\n return Vector4.Zero();\r\n }\r\n return Vector4.FromArray(this.geometryContext.tangents as ArrayLike<number>, index * 4);\r\n case NodeGeometryContextualSources.UV:\r\n if (this.executionContext.getOverrideUVs1ContextualValue) {\r\n return this.executionContext.getOverrideUVs1ContextualValue();\r\n }\r\n if (!this.geometryContext || !this.geometryContext.uvs) {\r\n return Vector2.Zero();\r\n }\r\n return Vector2.FromArray(this.geometryContext.uvs as ArrayLike<number>, index * 2);\r\n case NodeGeometryContextualSources.UV2:\r\n if (!this.geometryContext || !this.geometryContext.uvs2) {\r\n return Vector2.Zero();\r\n }\r\n return Vector2.FromArray(this.geometryContext.uvs2 as ArrayLike<number>, index * 2);\r\n case NodeGeometryContextualSources.UV3:\r\n if (!this.geometryContext || !this.geometryContext.uvs3) {\r\n return Vector2.Zero();\r\n }\r\n return Vector2.FromArray(this.geometryContext.uvs3 as ArrayLike<number>, index * 2);\r\n case NodeGeometryContextualSources.UV4:\r\n if (!this.geometryContext || !this.geometryContext.uvs4) {\r\n return Vector2.Zero();\r\n }\r\n return Vector2.FromArray(this.geometryContext.uvs4 as ArrayLike<number>, index * 2);\r\n case NodeGeometryContextualSources.UV5:\r\n if (!this.geometryContext || !this.geometryContext.uvs5) {\r\n return Vector2.Zero();\r\n }\r\n return Vector2.FromArray(this.geometryContext.uvs5 as ArrayLike<number>, index * 2);\r\n case NodeGeometryContextualSources.UV6:\r\n if (!this.geometryContext || !this.geometryContext.uvs6) {\r\n return Vector2.Zero();\r\n }\r\n return Vector2.FromArray(this.geometryContext.uvs6 as ArrayLike<number>, index * 2);\r\n case NodeGeometryContextualSources.VertexID:\r\n return index;\r\n case NodeGeometryContextualSources.FaceID:\r\n return this.executionContext.getExecutionFaceIndex();\r\n case NodeGeometryContextualSources.LoopID:\r\n return this.executionContext.getExecutionLoopIndex();\r\n case NodeGeometryContextualSources.InstanceID:\r\n return this.instancingContext ? this.instancingContext.getInstanceIndex() : 0;\r\n case NodeGeometryContextualSources.GeometryID:\r\n return !this.geometryContext ? 0 : this.geometryContext.uniqueId;\r\n case NodeGeometryContextualSources.CollectionID: {\r\n if (!this.geometryContext || !this.geometryContext.metadata) {\r\n return 0;\r\n }\r\n return this.geometryContext.metadata.collectionId || 0;\r\n }\r\n case NodeGeometryContextualSources.LatticeID: {\r\n if (this.executionContext.getOverridePositionsContextualValue) {\r\n return this.executionContext.getOverridePositionsContextualValue();\r\n }\r\n return Vector3.Zero();\r\n }\r\n case NodeGeometryContextualSources.LatticeControl: {\r\n if (this.executionContext.getOverrideNormalsContextualValue) {\r\n return this.executionContext.getOverrideNormalsContextualValue();\r\n }\r\n return Vector3.Zero();\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Adapt a value to a target type\r\n * @param source defines the value to adapt\r\n * @param targetType defines the target type\r\n * @returns the adapted value\r\n */\r\n adapt(source: NodeGeometryConnectionPoint, targetType: NodeGeometryBlockConnectionPointTypes) {\r\n const value = source.getConnectedValue(this) || 0;\r\n\r\n if (source.type === targetType) {\r\n return value;\r\n }\r\n\r\n switch (targetType) {\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n return new Vector2(value, value);\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n return new Vector3(value, value, value);\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n return new Vector4(value, value, value, value);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Adapt an input value to a target type\r\n * @param source defines the value to adapt\r\n * @param targetType defines the target type\r\n * @param defaultValue defines the default value to use if not connected\r\n * @returns the adapted value\r\n */\r\n adaptInput(source: NodeGeometryConnectionPoint, targetType: NodeGeometryBlockConnectionPointTypes, defaultValue: any) {\r\n if (!source.isConnected) {\r\n return source.value || defaultValue;\r\n }\r\n\r\n const value = source.getConnectedValue(this);\r\n\r\n if (source._connectedPoint?.type === targetType) {\r\n return value;\r\n }\r\n\r\n switch (targetType) {\r\n case NodeGeometryBlockConnectionPointTypes.Vector2:\r\n return new Vector2(value, value);\r\n case NodeGeometryBlockConnectionPointTypes.Vector3:\r\n return new Vector3(value, value, value);\r\n case NodeGeometryBlockConnectionPointTypes.Vector4:\r\n return new Vector4(value, value, value, value);\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Emits console errors and exceptions if there is a failing check\r\n */\r\n public emitErrors() {\r\n let errorMessage = \"\";\r\n\r\n for (const notConnectedInput of this.notConnectedNonOptionalInputs) {\r\n errorMessage += `input ${notConnectedInput.name} from block ${\r\n notConnectedInput.ownerBlock.name\r\n }[${notConnectedInput.ownerBlock.getClassName()}] is not connected and is not optional.\\n`;\r\n }\r\n\r\n for (const source of this.noContextualData) {\r\n errorMessage += `Contextual input ${NodeGeometryContextualSources[source]} has no context to pull data from (must be connected to a setXXX block or a instantiateXXX block).\\n`;\r\n }\r\n\r\n if (errorMessage) {\r\n // eslint-disable-next-line no-throw-literal\r\n throw \"Build of NodeGeometry failed:\\n\" + errorMessage;\r\n }\r\n }\r\n\r\n /** @internal */\r\n public _instantiate(clone: VertexData, currentPosition: Vector3, rotation: Vector3, scaling: Vector3, additionalVertexData: VertexData[]) {\r\n // Transform\r\n Matrix.ScalingToRef(scaling.x, scaling.y, scaling.z, this._scalingMatrix);\r\n Matrix.RotationYawPitchRollToRef(rotation.y, rotation.x, rotation.z, this._rotationMatrix);\r\n Matrix.TranslationToRef(currentPosition.x, currentPosition.y, currentPosition.z, this._positionMatrix);\r\n\r\n this._scalingMatrix.multiplyToRef(this._rotationMatrix, this._scalingRotationMatrix);\r\n this._scalingRotationMatrix.multiplyToRef(this._positionMatrix, this._transformMatrix);\r\n for (let clonePositionIndex = 0; clonePositionIndex < clone.positions!.length; clonePositionIndex += 3) {\r\n this._tempVector3.fromArray(clone.positions!, clonePositionIndex);\r\n Vector3.TransformCoordinatesToRef(this._tempVector3, this._transformMatrix, this._tempVector3);\r\n this._tempVector3.toArray(clone.positions!, clonePositionIndex);\r\n\r\n if (clone.normals) {\r\n this._tempVector3.fromArray(clone.normals, clonePositionIndex);\r\n Vector3.TransformNormalToRef(this._tempVector3, this._scalingRotationMatrix, this._tempVector3);\r\n this._tempVector3.toArray(clone.normals, clonePositionIndex);\r\n }\r\n }\r\n\r\n additionalVertexData.push(clone);\r\n }\r\n\r\n /** @internal */\r\n public _instantiateWithMatrix(clone: VertexData, transform: Matrix, additionalVertexData: VertexData[]) {\r\n for (let clonePositionIndex = 0; clonePositionIndex < clone.positions!.length; clonePositionIndex += 3) {\r\n this._tempVector3.fromArray(clone.positions!, clonePositionIndex);\r\n Vector3.TransformCoordinatesToRef(this._tempVector3, transform, this._tempVector3);\r\n this._tempVector3.toArray(clone.positions!, clonePositionIndex);\r\n\r\n if (clone.normals) {\r\n this._tempVector3.fromArray(clone.normals, clonePositionIndex);\r\n Vector3.TransformNormalToRef(this._tempVector3, transform, this._tempVector3);\r\n this._tempVector3.toArray(clone.normals, clonePositionIndex);\r\n }\r\n }\r\n\r\n additionalVertexData.push(clone);\r\n }\r\n\r\n /** @internal */\r\n public _instantiateWithPositionAndMatrix(clone: VertexData, currentPosition: Vector3, transform: Matrix, additionalVertexData: VertexData[]) {\r\n Matrix.TranslationToRef(currentPosition.x, currentPosition.y, currentPosition.z, this._positionMatrix);\r\n transform.multiplyToRef(this._positionMatrix, this._transformMatrix);\r\n\r\n for (let clonePositionIndex = 0; clonePositionIndex < clone.positions!.length; clonePositionIndex += 3) {\r\n this._tempVector3.fromArray(clone.positions!, clonePositionIndex);\r\n Vector3.TransformCoordinatesToRef(this._tempVector3, this._transformMatrix, this._tempVector3);\r\n this._tempVector3.toArray(clone.positions!, clonePositionIndex);\r\n\r\n if (clone.normals) {\r\n this._tempVector3.fromArray(clone.normals, clonePositionIndex);\r\n Vector3.TransformNormalToRef(this._tempVector3, this._transformMatrix, this._tempVector3);\r\n this._tempVector3.toArray(clone.normals, clonePositionIndex);\r\n }\r\n }\r\n\r\n additionalVertexData.push(clone);\r\n }\r\n}\r\n"]}
@@ -204,6 +204,8 @@ export declare abstract class AbstractMesh extends TransformNode implements IDis
204
204
  _internalAbstractMeshDataInfo: _InternalAbstractMeshDataInfo;
205
205
  /** @internal */
206
206
  _waitingMaterialId: Nullable<string>;
207
+ /** @internal */
208
+ _waitingMorphTargetManagerId: Nullable<number>;
207
209
  /**
208
210
  * The culling strategy to use to check whether the mesh must be rendered or not.
209
211
  * This value can be changed at any time and will be used on the next render mesh selection.
@@ -0,0 +1,30 @@
1
+ import { Vector3 } from "../Maths/math.vector";
2
+ import type { AbstractMesh } from "./abstractMesh";
3
+ /**
4
+ * Data for mesh hotspot computation
5
+ */
6
+ export type HotSpotQuery = {
7
+ /**
8
+ * 3 point indices
9
+ */
10
+ pointIndex: [number, number, number];
11
+ /**
12
+ * 3 barycentric coordinates
13
+ */
14
+ barycentric: [number, number, number];
15
+ };
16
+ /**
17
+ * Return a transformed local position from a mesh and vertex index
18
+ * @param mesh mesh used to get vertex array from
19
+ * @param index vertex index
20
+ * @param res resulting local position
21
+ * @returns false if it was not possible to compute the position for that vertex
22
+ */
23
+ export declare function GetTransformedPosition(mesh: AbstractMesh, index: number, res: Vector3): boolean;
24
+ /**
25
+ * Compute a world space hotspot position
26
+ * @param mesh mesh used to get hotspot from
27
+ * @param hotSpotQuery point indices and barycentric
28
+ * @param res output world position
29
+ */
30
+ export declare function GetHotSpotToRef(mesh: AbstractMesh, hotSpotQuery: HotSpotQuery, res: Vector3): void;
@@ -0,0 +1,84 @@
1
+ import { Vector3, TmpVectors, Matrix } from "../Maths/math.vector.js";
2
+ import { VertexBuffer } from "../Buffers/buffer.js";
3
+ /**
4
+ * Return a transformed local position from a mesh and vertex index
5
+ * @param mesh mesh used to get vertex array from
6
+ * @param index vertex index
7
+ * @param res resulting local position
8
+ * @returns false if it was not possible to compute the position for that vertex
9
+ */
10
+ export function GetTransformedPosition(mesh, index, res) {
11
+ const data = mesh.getVerticesData(VertexBuffer.PositionKind);
12
+ if (!data) {
13
+ return false;
14
+ }
15
+ const base = index * 3;
16
+ const values = [data[base + 0], data[base + 1], data[base + 2]];
17
+ if (mesh.morphTargetManager) {
18
+ for (let component = 0; component < 3; component++) {
19
+ let value = values[component];
20
+ for (let targetCount = 0; targetCount < mesh.morphTargetManager.numTargets; targetCount++) {
21
+ const target = mesh.morphTargetManager.getTarget(targetCount);
22
+ const influence = target.influence;
23
+ if (influence !== 0) {
24
+ const targetData = target.getPositions();
25
+ if (targetData) {
26
+ value += (targetData[base + component] - data[base + component]) * influence;
27
+ }
28
+ }
29
+ }
30
+ values[component] = value;
31
+ }
32
+ }
33
+ res.fromArray(values);
34
+ if (mesh.skeleton) {
35
+ const matricesIndicesData = mesh.getVerticesData(VertexBuffer.MatricesIndicesKind);
36
+ const matricesWeightsData = mesh.getVerticesData(VertexBuffer.MatricesWeightsKind);
37
+ if (matricesWeightsData && matricesIndicesData) {
38
+ const needExtras = mesh.numBoneInfluencers > 4;
39
+ const matricesIndicesExtraData = needExtras ? mesh.getVerticesData(VertexBuffer.MatricesIndicesExtraKind) : null;
40
+ const matricesWeightsExtraData = needExtras ? mesh.getVerticesData(VertexBuffer.MatricesWeightsExtraKind) : null;
41
+ const skeletonMatrices = mesh.skeleton.getTransformMatrices(mesh);
42
+ const finalMatrix = TmpVectors.Matrix[0];
43
+ const tempMatrix = TmpVectors.Matrix[1];
44
+ finalMatrix.reset();
45
+ const matWeightIdx = index * 4;
46
+ let inf;
47
+ let weight;
48
+ for (inf = 0; inf < 4; inf++) {
49
+ weight = matricesWeightsData[matWeightIdx + inf];
50
+ if (weight > 0) {
51
+ Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesData[matWeightIdx + inf] * 16), weight, tempMatrix);
52
+ finalMatrix.addToSelf(tempMatrix);
53
+ }
54
+ }
55
+ if (matricesIndicesExtraData && matricesWeightsExtraData) {
56
+ for (inf = 0; inf < 4; inf++) {
57
+ weight = matricesWeightsExtraData[matWeightIdx + inf];
58
+ if (weight > 0) {
59
+ Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesExtraData[matWeightIdx + inf] * 16), weight, tempMatrix);
60
+ finalMatrix.addToSelf(tempMatrix);
61
+ }
62
+ }
63
+ }
64
+ Vector3.TransformCoordinatesFromFloatsToRef(values[0], values[1], values[2], finalMatrix, res);
65
+ }
66
+ }
67
+ return true;
68
+ }
69
+ /**
70
+ * Compute a world space hotspot position
71
+ * @param mesh mesh used to get hotspot from
72
+ * @param hotSpotQuery point indices and barycentric
73
+ * @param res output world position
74
+ */
75
+ export function GetHotSpotToRef(mesh, hotSpotQuery, res) {
76
+ res.set(0, 0, 0);
77
+ for (let i = 0; i < 3; i++) {
78
+ const index = hotSpotQuery.pointIndex[i];
79
+ GetTransformedPosition(mesh, index, TmpVectors.Vector3[0]);
80
+ TmpVectors.Vector3[0].scaleInPlace(hotSpotQuery.barycentric[i]);
81
+ res.addInPlace(TmpVectors.Vector3[0]);
82
+ }
83
+ }
84
+ //# sourceMappingURL=abstractMesh.hotSpot.js.map