@babylonjs/core 6.42.0 → 6.44.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 (107) hide show
  1. package/Animations/animatable.js +2 -2
  2. package/Animations/animatable.js.map +1 -1
  3. package/Animations/animationGroup.d.ts +4 -2
  4. package/Animations/animationGroup.js +22 -2
  5. package/Animations/animationGroup.js.map +1 -1
  6. package/Cameras/arcRotateCamera.js +7 -1
  7. package/Cameras/arcRotateCamera.js.map +1 -1
  8. package/Culling/ray.d.ts +12 -1
  9. package/Culling/ray.js +20 -3
  10. package/Culling/ray.js.map +1 -1
  11. package/Debug/skeletonViewer.d.ts +2 -0
  12. package/Debug/skeletonViewer.js +111 -50
  13. package/Debug/skeletonViewer.js.map +1 -1
  14. package/Engines/engine.d.ts +14 -3
  15. package/Engines/engine.js +11 -0
  16. package/Engines/engine.js.map +1 -1
  17. package/Engines/nullEngine.d.ts +2 -0
  18. package/Engines/nullEngine.js +3 -0
  19. package/Engines/nullEngine.js.map +1 -1
  20. package/Engines/thinEngine.d.ts +4 -1
  21. package/Engines/thinEngine.js +2 -2
  22. package/Engines/thinEngine.js.map +1 -1
  23. package/Inputs/scene.inputManager.js +2 -2
  24. package/Inputs/scene.inputManager.js.map +1 -1
  25. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +1 -1
  26. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
  27. package/Materials/Node/nodeMaterial.d.ts +50 -0
  28. package/Materials/Node/nodeMaterial.js +50 -0
  29. package/Materials/Node/nodeMaterial.js.map +1 -1
  30. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +1 -1
  31. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  32. package/Meshes/GreasedLine/greasedLineBaseMesh.d.ts +3 -1
  33. package/Meshes/GreasedLine/greasedLineBaseMesh.js +4 -2
  34. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  35. package/Meshes/Node/Blocks/geometryDistanceBlock.d.ts +30 -0
  36. package/Meshes/Node/Blocks/geometryDistanceBlock.js +63 -0
  37. package/Meshes/Node/Blocks/geometryDistanceBlock.js.map +1 -0
  38. package/Meshes/Node/Blocks/geometryDotBlock.d.ts +30 -0
  39. package/Meshes/Node/Blocks/geometryDotBlock.js +63 -0
  40. package/Meshes/Node/Blocks/geometryDotBlock.js.map +1 -0
  41. package/Meshes/Node/Blocks/geometryLengthBlock.d.ts +26 -0
  42. package/Meshes/Node/Blocks/geometryLengthBlock.js +52 -0
  43. package/Meshes/Node/Blocks/geometryLengthBlock.js.map +1 -0
  44. package/Meshes/Node/Blocks/geometryPosterizeBlock.d.ts +31 -0
  45. package/Meshes/Node/Blocks/geometryPosterizeBlock.js +63 -0
  46. package/Meshes/Node/Blocks/geometryPosterizeBlock.js.map +1 -0
  47. package/Meshes/Node/Blocks/geometryReplaceColorBlock.d.ts +38 -0
  48. package/Meshes/Node/Blocks/geometryReplaceColorBlock.js +88 -0
  49. package/Meshes/Node/Blocks/geometryReplaceColorBlock.js.map +1 -0
  50. package/Meshes/Node/Blocks/geometryRotate2dBlock.d.ts +30 -0
  51. package/Meshes/Node/Blocks/geometryRotate2dBlock.js +59 -0
  52. package/Meshes/Node/Blocks/geometryRotate2dBlock.js.map +1 -0
  53. package/Meshes/Node/index.d.ts +6 -0
  54. package/Meshes/Node/index.js +6 -0
  55. package/Meshes/Node/index.js.map +1 -1
  56. package/Meshes/mesh.js +10 -0
  57. package/Meshes/mesh.js.map +1 -1
  58. package/Meshes/trailMesh.js +24 -19
  59. package/Meshes/trailMesh.js.map +1 -1
  60. package/Physics/v2/Plugins/havokPlugin.d.ts +0 -1
  61. package/Physics/v2/Plugins/havokPlugin.js +3 -2
  62. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  63. package/Physics/v2/physicsEngine.d.ts +1 -0
  64. package/Physics/v2/physicsEngine.js +1 -0
  65. package/Physics/v2/physicsEngine.js.map +1 -1
  66. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.d.ts +1 -1
  67. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js +10 -2
  68. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js.map +1 -1
  69. package/XR/features/Layers/WebXRCompositionLayer.d.ts +48 -0
  70. package/XR/features/Layers/WebXRCompositionLayer.js +94 -0
  71. package/XR/features/Layers/WebXRCompositionLayer.js.map +1 -0
  72. package/XR/features/Layers/WebXRProjectionLayer.d.ts +10 -0
  73. package/XR/features/Layers/WebXRProjectionLayer.js +51 -0
  74. package/XR/features/Layers/WebXRProjectionLayer.js.map +1 -0
  75. package/XR/features/WebXRControllerPointerSelection.js +4 -1
  76. package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
  77. package/XR/features/WebXRControllerTeleportation.js +11 -10
  78. package/XR/features/WebXRControllerTeleportation.js.map +1 -1
  79. package/XR/features/WebXRHandTracking.d.ts +7 -1
  80. package/XR/features/WebXRHandTracking.js +28 -26
  81. package/XR/features/WebXRHandTracking.js.map +1 -1
  82. package/XR/features/WebXRLayers.d.ts +44 -26
  83. package/XR/features/WebXRLayers.js +204 -153
  84. package/XR/features/WebXRLayers.js.map +1 -1
  85. package/XR/features/WebXRNearInteraction.js +16 -1
  86. package/XR/features/WebXRNearInteraction.js.map +1 -1
  87. package/XR/webXRCamera.js +10 -0
  88. package/XR/webXRCamera.js.map +1 -1
  89. package/XR/webXRDefaultExperience.d.ts +9 -0
  90. package/XR/webXRDefaultExperience.js +8 -0
  91. package/XR/webXRDefaultExperience.js.map +1 -1
  92. package/XR/webXRExperienceHelper.js +1 -1
  93. package/XR/webXRExperienceHelper.js.map +1 -1
  94. package/XR/webXRFeaturesManager.js +8 -2
  95. package/XR/webXRFeaturesManager.js.map +1 -1
  96. package/XR/webXRLayerWrapper.d.ts +12 -3
  97. package/XR/webXRLayerWrapper.js +18 -2
  98. package/XR/webXRLayerWrapper.js.map +1 -1
  99. package/XR/webXRRenderTargetTextureProvider.js +0 -5
  100. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  101. package/XR/webXRSessionManager.d.ts +9 -1
  102. package/XR/webXRSessionManager.js +24 -5
  103. package/XR/webXRSessionManager.js.map +1 -1
  104. package/package.json +1 -1
  105. package/scene.d.ts +9 -1
  106. package/scene.js +4 -4
  107. package/scene.js.map +1 -1
@@ -89,7 +89,7 @@ export class GaussianSplattingMesh extends Mesh {
89
89
  */
90
90
  render(subMesh, enableAlphaMode, effectiveMeshReplacement) {
91
91
  if (!this.material) {
92
- this._material = new GaussianSplattingMaterial(name + "_material", this._scene);
92
+ this._material = new GaussianSplattingMaterial(this.name + "_material", this._scene);
93
93
  this.material = this._material;
94
94
  }
95
95
  const frameId = this.getScene().getFrameId();
@@ -1 +1 @@
1
- {"version":3,"file":"gaussianSplattingMesh.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GaussianSplatting/gaussianSplattingMesh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,4BAAwB;AACxC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,mCAA+B;AAC1F,OAAO,EAAE,MAAM,EAAE,6BAAyB;AAC1C,OAAO,EAAE,yBAAyB,EAAE,uEAAmE;AACvG,OAAO,EAAE,UAAU,EAAE,+CAA2C;AAChE,OAAO,EAAE,SAAS,EAAE,mCAA+B;AAEnD;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,IAAI;IAc3C;;OAEG;IACH,IAAW,mBAAmB;QAC1B,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,IAAW,mBAAmB;QAC1B,OAAO,IAAI,CA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QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;aACjJ;YAED,QAAQ,CAAC,IAAI,EAAE,CAAC;YAEhB,IAAI,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;SACrD;IACL,CAAC,CAAC;AACN,CAAC,AAvC2B,CAuC1B","sourcesContent":["import type { Scene } from \"core/scene\";\r\nimport type { DeepImmutable, Nullable } from \"core/types\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport { SubMesh } from \"../subMesh\";\r\nimport type { AbstractMesh } from \"../abstractMesh\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { Matrix, TmpVectors, Vector2, Vector3, Quaternion } from \"core/Maths/math.vector\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { GaussianSplattingMaterial } from \"core/Materials/GaussianSplatting/gaussianSplattingMaterial\";\r\nimport { RawTexture } from \"core/Materials/Textures/rawTexture\";\r\nimport { Constants } from \"core/Engines/constants\";\r\n\r\n/**\r\n * Class used to render a gaussian splatting mesh\r\n */\r\nexport class GaussianSplattingMesh extends Mesh {\r\n private _vertexCount = 0;\r\n private _worker: Nullable<Worker> = null;\r\n private _frameIdLastUpdate = -1;\r\n private _modelViewMatrix = Matrix.Identity();\r\n private _material: Nullable<GaussianSplattingMaterial> = null;\r\n private _depthMix: BigInt64Array;\r\n private _canPostToWorker = true;\r\n private _lastProj: DeepImmutable<Float32Array | number[]>;\r\n private _covariancesATexture: Nullable<BaseTexture> = null;\r\n private _covariancesBTexture: Nullable<BaseTexture> = null;\r\n private _centersTexture: Nullable<BaseTexture> = null;\r\n private _colorsTexture: Nullable<BaseTexture> = null;\r\n\r\n /**\r\n * Gets the covariancesA texture\r\n */\r\n public get covariancesATexture() {\r\n return this._covariancesATexture;\r\n }\r\n\r\n /**\r\n * Gets the covariancesB texture\r\n */\r\n public get covariancesBTexture() {\r\n return this._covariancesBTexture;\r\n }\r\n\r\n /**\r\n * Gets the centers texture\r\n */\r\n public get centersTexture() {\r\n return this._centersTexture;\r\n }\r\n\r\n /**\r\n * Gets the colors texture\r\n */\r\n public get colorsTexture() {\r\n return this._colorsTexture;\r\n }\r\n\r\n /**\r\n * Creates a new gaussian splatting mesh\r\n * @param name defines the name of the mesh\r\n * @param url defines the url to load from (optional)\r\n * @param scene defines the hosting scene (optional)\r\n */\r\n constructor(name: string, url: Nullable<string> = null, scene: Nullable<Scene> = null) {\r\n super(name, scene);\r\n\r\n const vertexData = new VertexData();\r\n\r\n vertexData.positions = [-2, -2, 0, 2, -2, 0, 2, 2, 0, -2, 2, 0];\r\n vertexData.indices = [0, 1, 2, 0, 2, 3];\r\n vertexData.applyToMesh(this);\r\n\r\n this.subMeshes = [];\r\n new SubMesh(0, 0, 4, 0, 6, this);\r\n\r\n this.doNotSyncBoundingInfo = true;\r\n this.setEnabled(false);\r\n\r\n this._lastProj = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\r\n\r\n if (url) {\r\n this.loadFileAsync(url);\r\n }\r\n }\r\n\r\n /**\r\n * Returns the class name\r\n * @returns \"GaussianSplattingMesh\"\r\n */\r\n public getClassName(): string {\r\n return \"GaussianSplattingMesh\";\r\n }\r\n\r\n /**\r\n * Returns the total number of vertices (splats) within the mesh\r\n * @returns the total number of vertices\r\n */\r\n public getTotalVertices(): number {\r\n return this._vertexCount;\r\n }\r\n\r\n /**\r\n * Triggers the draw call for the mesh. Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager\r\n * @param subMesh defines the subMesh to render\r\n * @param enableAlphaMode defines if alpha mode can be changed\r\n * @param effectiveMeshReplacement defines an optional mesh used to provide info for the rendering\r\n * @returns the current mesh\r\n */\r\n public render(subMesh: SubMesh, enableAlphaMode: boolean, effectiveMeshReplacement?: AbstractMesh): Mesh {\r\n if (!this.material) {\r\n this._material = new GaussianSplattingMaterial(name + \"_material\", this._scene);\r\n this.material = this._material;\r\n }\r\n\r\n const frameId = this.getScene().getFrameId();\r\n if (frameId !== this._frameIdLastUpdate && this._worker && this._scene.activeCamera && this._canPostToWorker) {\r\n this.getWorldMatrix().multiplyToRef(this._scene.activeCamera.getViewMatrix(), this._modelViewMatrix);\r\n\r\n const dot = this._lastProj[2] * this._modelViewMatrix.m[2] + this._lastProj[6] * this._modelViewMatrix.m[6] + this._lastProj[10] * this._modelViewMatrix.m[10];\r\n if (Math.abs(dot - 1) >= 0.01) {\r\n this._frameIdLastUpdate = frameId;\r\n this._canPostToWorker = false;\r\n this._lastProj = this._modelViewMatrix.m.slice(0);\r\n this._worker.postMessage({ view: this._modelViewMatrix.m, depthMix: this._depthMix }, [this._depthMix.buffer]);\r\n }\r\n }\r\n\r\n return super.render(subMesh, enableAlphaMode, effectiveMeshReplacement);\r\n }\r\n\r\n /**\r\n * Code from https://github.com/dylanebert/gsplat.js/blob/main/src/loaders/PLYLoader.ts Under MIT license\r\n * Converts a .ply data array buffer to splat\r\n * if data array buffer is not ply, returns the original buffer\r\n * @param data the .ply data to load\r\n * @returns the loaded splat buffer\r\n */\r\n public static ConvertPLYToSplat(data: ArrayBuffer): ArrayBuffer {\r\n const ubuf = new Uint8Array(data);\r\n const header = new TextDecoder().decode(ubuf.slice(0, 1024 * 10));\r\n const headerEnd = \"end_header\\n\";\r\n const headerEndIndex = header.indexOf(headerEnd);\r\n if (headerEndIndex < 0 || !header) {\r\n return data;\r\n }\r\n const vertexCount = parseInt(/element vertex (\\d+)\\n/.exec(header)![1]);\r\n\r\n let rowOffset = 0;\r\n const offsets: Record<string, number> = {\r\n double: 8,\r\n int: 4,\r\n uint: 4,\r\n float: 4,\r\n short: 2,\r\n ushort: 2,\r\n uchar: 1,\r\n };\r\n\r\n type PlyProperty = {\r\n name: string;\r\n type: string;\r\n offset: number;\r\n };\r\n const properties: PlyProperty[] = [];\r\n const filtered = header\r\n .slice(0, headerEndIndex)\r\n .split(\"\\n\")\r\n .filter((k) => k.startsWith(\"property \"));\r\n for (const prop of filtered) {\r\n const [, type, name] = prop.split(\" \");\r\n properties.push({ name, type, offset: rowOffset });\r\n if (!offsets[type]) throw new Error(`Unsupported property type: ${type}`);\r\n rowOffset += offsets[type];\r\n }\r\n\r\n const rowLength = 3 * 4 + 3 * 4 + 4 + 4;\r\n const SH_C0 = 0.28209479177387814;\r\n\r\n const dataView = new DataView(data, headerEndIndex + headerEnd.length);\r\n const buffer = new ArrayBuffer(rowLength * vertexCount);\r\n const q = new Quaternion();\r\n\r\n for (let i = 0; i < vertexCount; i++) {\r\n const position = new Float32Array(buffer, i * rowLength, 3);\r\n const scale = new Float32Array(buffer, i * rowLength + 12, 3);\r\n const rgba = new Uint8ClampedArray(buffer, i * rowLength + 24, 4);\r\n const rot = new Uint8ClampedArray(buffer, i * rowLength + 28, 4);\r\n\r\n let r0: number = 255;\r\n let r1: number = 0;\r\n let r2: number = 0;\r\n let r3: number = 0;\r\n\r\n for (let propertyIndex = 0; propertyIndex < properties.length; propertyIndex++) {\r\n const property = properties[propertyIndex];\r\n let value;\r\n switch (property.type) {\r\n case \"float\":\r\n value = dataView.getFloat32(property.offset + i * rowOffset, true);\r\n break;\r\n case \"int\":\r\n value = dataView.getInt32(property.offset + i * rowOffset, true);\r\n break;\r\n default:\r\n throw new Error(`Unsupported property type: ${property.type}`);\r\n }\r\n\r\n switch (property.name) {\r\n case \"x\":\r\n position[0] = value;\r\n break;\r\n case \"y\":\r\n position[1] = value;\r\n break;\r\n case \"z\":\r\n position[2] = value;\r\n break;\r\n case \"scale_0\":\r\n scale[0] = Math.exp(value);\r\n break;\r\n case \"scale_1\":\r\n scale[1] = Math.exp(value);\r\n break;\r\n case \"scale_2\":\r\n scale[2] = Math.exp(value);\r\n break;\r\n case \"red\":\r\n rgba[0] = value;\r\n break;\r\n case \"green\":\r\n rgba[1] = value;\r\n break;\r\n case \"blue\":\r\n rgba[2] = value;\r\n break;\r\n case \"f_dc_0\":\r\n rgba[0] = (0.5 + SH_C0 * value) * 255;\r\n break;\r\n case \"f_dc_1\":\r\n rgba[1] = (0.5 + SH_C0 * value) * 255;\r\n break;\r\n case \"f_dc_2\":\r\n rgba[2] = (0.5 + SH_C0 * value) * 255;\r\n break;\r\n case \"f_dc_3\":\r\n rgba[3] = (0.5 + SH_C0 * value) * 255;\r\n break;\r\n case \"opacity\":\r\n rgba[3] = (1 / (1 + Math.exp(-value))) * 255;\r\n break;\r\n case \"rot_0\":\r\n r0 = value;\r\n break;\r\n case \"rot_1\":\r\n r1 = value;\r\n break;\r\n case \"rot_2\":\r\n r2 = value;\r\n break;\r\n case \"rot_3\":\r\n r3 = value;\r\n break;\r\n }\r\n }\r\n\r\n q.set(r1, r2, r3, r0);\r\n q.normalize();\r\n rot[0] = q.w * 128 + 128;\r\n rot[1] = q.x * 128 + 128;\r\n rot[2] = q.y * 128 + 128;\r\n rot[3] = q.z * 128 + 128;\r\n }\r\n\r\n return buffer;\r\n }\r\n\r\n /**\r\n * Loads a .splat Gaussian Splatting array buffer asynchronously\r\n * @param data arraybuffer containing splat file\r\n * @returns a promise that resolves when the operation is complete\r\n */\r\n\r\n public loadDataAsync(data: ArrayBuffer): Promise<void> {\r\n return Promise.resolve(this._loadData(data));\r\n }\r\n\r\n /**\r\n * Loads a .splat Gaussian or .ply Splatting file asynchronously\r\n * @param url path to the splat file to load\r\n * @returns a promise that resolves when the operation is complete\r\n */\r\n public loadFileAsync(url: string): Promise<void> {\r\n return Tools.LoadFileAsync(url, true).then((data) => {\r\n this._loadData(GaussianSplattingMesh.ConvertPLYToSplat(data));\r\n });\r\n }\r\n\r\n /**\r\n * Releases resources associated with this mesh.\r\n * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)\r\n */\r\n public dispose(doNotRecurse?: boolean): void {\r\n this._covariancesATexture?.dispose();\r\n this._covariancesBTexture?.dispose();\r\n this._centersTexture?.dispose();\r\n this._colorsTexture?.dispose();\r\n\r\n this._covariancesATexture = null;\r\n this._covariancesBTexture = null;\r\n this._centersTexture = null;\r\n this._colorsTexture = null;\r\n\r\n this._material?.dispose(false, true);\r\n this._material = null;\r\n\r\n this._worker?.terminate();\r\n this._worker = null;\r\n\r\n super.dispose(doNotRecurse);\r\n }\r\n\r\n private static _CreateWorker = function (self: Worker) {\r\n let vertexCount = 0;\r\n let positions: Float32Array;\r\n let depthMix: BigInt64Array;\r\n let indices: Uint32Array;\r\n let floatMix: Float32Array;\r\n\r\n self.onmessage = (e: any) => {\r\n // updated on init\r\n if (e.data.positions) {\r\n positions = e.data.positions;\r\n vertexCount = e.data.vertexCount;\r\n }\r\n // udpate on view changed\r\n else {\r\n const viewProj = e.data.view;\r\n if (!positions || !viewProj) {\r\n // Sanity check, it shouldn't happen!\r\n throw new Error(\"positions or view is not defined!\");\r\n }\r\n\r\n depthMix = e.data.depthMix;\r\n indices = new Uint32Array(depthMix.buffer);\r\n floatMix = new Float32Array(depthMix.buffer);\r\n\r\n // Sort\r\n for (let j = 0; j < vertexCount; j++) {\r\n indices[2 * j] = j;\r\n }\r\n\r\n for (let j = 0; j < vertexCount; j++) {\r\n floatMix[2 * j + 1] = 10000 - (viewProj[2] * positions[3 * j + 0] + viewProj[6] * positions[3 * j + 1] + viewProj[10] * positions[3 * j + 2]);\r\n }\r\n\r\n depthMix.sort();\r\n\r\n self.postMessage({ depthMix }, [depthMix.buffer]);\r\n }\r\n };\r\n };\r\n\r\n private _loadData(data: ArrayBuffer): void {\r\n // Parse the data\r\n const uBuffer = new Uint8Array(data);\r\n const fBuffer = new Float32Array(uBuffer.buffer);\r\n\r\n const rowLength = 3 * 4 + 3 * 4 + 4 + 4;\r\n const vertexCount = uBuffer.length / rowLength;\r\n\r\n this._vertexCount = vertexCount;\r\n\r\n const textureSize = this._getTextureSize(vertexCount);\r\n const textureLength = textureSize.x * textureSize.y;\r\n\r\n const positions = new Float32Array(3 * textureLength);\r\n const covA = new Float32Array(3 * textureLength);\r\n const covB = new Float32Array(3 * textureLength);\r\n\r\n const matrixRotation = TmpVectors.Matrix[0];\r\n const matrixScale = TmpVectors.Matrix[1];\r\n const quaternion = TmpVectors.Quaternion[0];\r\n\r\n const minimum = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n const maximum = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\r\n\r\n for (let i = 0; i < vertexCount; i++) {\r\n const x = fBuffer[8 * i + 0];\r\n const y = -fBuffer[8 * i + 1];\r\n const z = fBuffer[8 * i + 2];\r\n\r\n positions[3 * i + 0] = x;\r\n positions[3 * i + 1] = y;\r\n positions[3 * i + 2] = z;\r\n\r\n minimum.minimizeInPlaceFromFloats(x, y, z);\r\n maximum.maximizeInPlaceFromFloats(x, y, z);\r\n\r\n quaternion.set(\r\n (uBuffer[32 * i + 28 + 1] - 128) / 128,\r\n (uBuffer[32 * i + 28 + 2] - 128) / 128,\r\n (uBuffer[32 * i + 28 + 3] - 128) / 128,\r\n -(uBuffer[32 * i + 28 + 0] - 128) / 128\r\n );\r\n quaternion.toRotationMatrix(matrixRotation);\r\n\r\n Matrix.ScalingToRef(fBuffer[8 * i + 3 + 0] * 2, fBuffer[8 * i + 3 + 1] * 2, fBuffer[8 * i + 3 + 2] * 2, matrixScale);\r\n\r\n const M = matrixRotation.multiplyToRef(matrixScale, TmpVectors.Matrix[0]).m;\r\n\r\n covA[i * 3 + 0] = M[0] * M[0] + M[1] * M[1] + M[2] * M[2];\r\n covA[i * 3 + 1] = M[0] * M[4] + M[1] * M[5] + M[2] * M[6];\r\n covA[i * 3 + 2] = M[0] * M[8] + M[1] * M[9] + M[2] * M[10];\r\n covB[i * 3 + 0] = M[4] * M[4] + M[5] * M[5] + M[6] * M[6];\r\n covB[i * 3 + 1] = M[4] * M[8] + M[5] * M[9] + M[6] * M[10];\r\n covB[i * 3 + 2] = M[8] * M[8] + M[9] * M[9] + M[10] * M[10];\r\n }\r\n\r\n // Update the mesh\r\n const binfo = this.getBoundingInfo();\r\n binfo.reConstruct(minimum, maximum, this.getWorldMatrix());\r\n binfo.isLocked = true;\r\n\r\n this.forcedInstanceCount = this._vertexCount;\r\n this.setEnabled(true);\r\n\r\n const splatIndex = new Float32Array(this._vertexCount * 1);\r\n\r\n this.thinInstanceSetBuffer(\"splatIndex\", splatIndex, 1, false);\r\n\r\n // Update the material\r\n const createTextureFromData = (data: Float32Array, width: number, height: number, format: number) => {\r\n return new RawTexture(data, width, height, format, this._scene, false, false, Constants.TEXTURE_BILINEAR_SAMPLINGMODE, Constants.TEXTURETYPE_FLOAT);\r\n };\r\n\r\n const convertRgbToRgba = (rgb: Float32Array) => {\r\n const count = rgb.length / 3;\r\n const rgba = new Float32Array(count * 4);\r\n for (let i = 0; i < count; ++i) {\r\n rgba[i * 4 + 0] = rgb[i * 3 + 0];\r\n rgba[i * 4 + 1] = rgb[i * 3 + 1];\r\n rgba[i * 4 + 2] = rgb[i * 3 + 2];\r\n rgba[i * 4 + 3] = 1.0;\r\n }\r\n return rgba;\r\n };\r\n\r\n const colorArray = new Float32Array(textureSize.x * textureSize.y * 4);\r\n for (let i = 0; i < this._vertexCount; ++i) {\r\n colorArray[i * 4 + 0] = uBuffer[32 * i + 24 + 0] / 255;\r\n colorArray[i * 4 + 1] = uBuffer[32 * i + 24 + 1] / 255;\r\n colorArray[i * 4 + 2] = uBuffer[32 * i + 24 + 2] / 255;\r\n colorArray[i * 4 + 3] = uBuffer[32 * i + 24 + 3] / 255;\r\n }\r\n\r\n this._covariancesATexture = createTextureFromData(convertRgbToRgba(covA), textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\r\n this._covariancesBTexture = createTextureFromData(convertRgbToRgba(covB), textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\r\n this._centersTexture = createTextureFromData(convertRgbToRgba(positions), textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\r\n this._colorsTexture = createTextureFromData(colorArray, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\r\n\r\n // Start the worker thread\r\n this._worker?.terminate();\r\n this._worker = new Worker(\r\n URL.createObjectURL(\r\n new Blob([\"(\", GaussianSplattingMesh._CreateWorker.toString(), \")(self)\"], {\r\n type: \"application/javascript\",\r\n })\r\n )\r\n );\r\n\r\n this._depthMix = new BigInt64Array(vertexCount);\r\n\r\n this._worker.postMessage({ positions, vertexCount }, [positions.buffer]);\r\n\r\n this._worker.onmessage = (e) => {\r\n this._depthMix = e.data.depthMix;\r\n const indexMix = new Uint32Array(e.data.depthMix.buffer);\r\n for (let j = 0; j < this._vertexCount; j++) {\r\n splatIndex[j] = indexMix[2 * j];\r\n }\r\n this.thinInstanceBufferUpdated(\"splatIndex\");\r\n this._canPostToWorker = true;\r\n };\r\n }\r\n\r\n private _getTextureSize(length: number): Vector2 {\r\n const engine = this._scene.getEngine();\r\n const width = engine.getCaps().maxTextureSize;\r\n\r\n let height = 1;\r\n\r\n if (engine.webGLVersion === 1 && !engine.isWebGPU) {\r\n while (width * height < length) {\r\n height *= 2;\r\n }\r\n } else {\r\n height = Math.ceil(length / width);\r\n }\r\n\r\n if (height > width) {\r\n Logger.Error(\"GaussianSplatting texture size: (\" + width + \", \" + height + \"), maxTextureSize: \" + width);\r\n height = width;\r\n }\r\n\r\n return new Vector2(width, height);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"gaussianSplattingMesh.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GaussianSplatting/gaussianSplattingMesh.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,YAA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;gBACzB,qCAAqC;gBACrC,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;aACxD;YAED,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;YAC3B,OAAO,GAAG,IAAI,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC3C,QAAQ,GAAG,IAAI,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAE7C,OAAO;YACP,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,EAAE;gBAClC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;aACtB;YAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,EAAE;gBAClC,QAAQ,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;aACjJ;YAED,QAAQ,CAAC,IAAI,EAAE,CAAC;YAEhB,IAAI,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;SACrD;IACL,CAAC,CAAC;AACN,CAAC,AAvC2B,CAuC1B","sourcesContent":["import type { Scene } from \"core/scene\";\r\nimport type { DeepImmutable, Nullable } from \"core/types\";\r\nimport type { BaseTexture } from \"core/Materials/Textures/baseTexture\";\r\nimport { SubMesh } from \"../subMesh\";\r\nimport type { AbstractMesh } from \"../abstractMesh\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { Matrix, TmpVectors, Vector2, Vector3, Quaternion } from \"core/Maths/math.vector\";\r\nimport { Logger } from \"core/Misc/logger\";\r\nimport { GaussianSplattingMaterial } from \"core/Materials/GaussianSplatting/gaussianSplattingMaterial\";\r\nimport { RawTexture } from \"core/Materials/Textures/rawTexture\";\r\nimport { Constants } from \"core/Engines/constants\";\r\n\r\n/**\r\n * Class used to render a gaussian splatting mesh\r\n */\r\nexport class GaussianSplattingMesh extends Mesh {\r\n private _vertexCount = 0;\r\n private _worker: Nullable<Worker> = null;\r\n private _frameIdLastUpdate = -1;\r\n private _modelViewMatrix = Matrix.Identity();\r\n private _material: Nullable<GaussianSplattingMaterial> = null;\r\n private _depthMix: BigInt64Array;\r\n private _canPostToWorker = true;\r\n private _lastProj: DeepImmutable<Float32Array | number[]>;\r\n private _covariancesATexture: Nullable<BaseTexture> = null;\r\n private _covariancesBTexture: Nullable<BaseTexture> = null;\r\n private _centersTexture: Nullable<BaseTexture> = null;\r\n private _colorsTexture: Nullable<BaseTexture> = null;\r\n\r\n /**\r\n * Gets the covariancesA texture\r\n */\r\n public get covariancesATexture() {\r\n return this._covariancesATexture;\r\n }\r\n\r\n /**\r\n * Gets the covariancesB texture\r\n */\r\n public get covariancesBTexture() {\r\n return this._covariancesBTexture;\r\n }\r\n\r\n /**\r\n * Gets the centers texture\r\n */\r\n public get centersTexture() {\r\n return this._centersTexture;\r\n }\r\n\r\n /**\r\n * Gets the colors texture\r\n */\r\n public get colorsTexture() {\r\n return this._colorsTexture;\r\n }\r\n\r\n /**\r\n * Creates a new gaussian splatting mesh\r\n * @param name defines the name of the mesh\r\n * @param url defines the url to load from (optional)\r\n * @param scene defines the hosting scene (optional)\r\n */\r\n constructor(name: string, url: Nullable<string> = null, scene: Nullable<Scene> = null) {\r\n super(name, scene);\r\n\r\n const vertexData = new VertexData();\r\n\r\n vertexData.positions = [-2, -2, 0, 2, -2, 0, 2, 2, 0, -2, 2, 0];\r\n vertexData.indices = [0, 1, 2, 0, 2, 3];\r\n vertexData.applyToMesh(this);\r\n\r\n this.subMeshes = [];\r\n new SubMesh(0, 0, 4, 0, 6, this);\r\n\r\n this.doNotSyncBoundingInfo = true;\r\n this.setEnabled(false);\r\n\r\n this._lastProj = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\r\n\r\n if (url) {\r\n this.loadFileAsync(url);\r\n }\r\n }\r\n\r\n /**\r\n * Returns the class name\r\n * @returns \"GaussianSplattingMesh\"\r\n */\r\n public getClassName(): string {\r\n return \"GaussianSplattingMesh\";\r\n }\r\n\r\n /**\r\n * Returns the total number of vertices (splats) within the mesh\r\n * @returns the total number of vertices\r\n */\r\n public getTotalVertices(): number {\r\n return this._vertexCount;\r\n }\r\n\r\n /**\r\n * Triggers the draw call for the mesh. Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager\r\n * @param subMesh defines the subMesh to render\r\n * @param enableAlphaMode defines if alpha mode can be changed\r\n * @param effectiveMeshReplacement defines an optional mesh used to provide info for the rendering\r\n * @returns the current mesh\r\n */\r\n public render(subMesh: SubMesh, enableAlphaMode: boolean, effectiveMeshReplacement?: AbstractMesh): Mesh {\r\n if (!this.material) {\r\n this._material = new GaussianSplattingMaterial(this.name + \"_material\", this._scene);\r\n this.material = this._material;\r\n }\r\n\r\n const frameId = this.getScene().getFrameId();\r\n if (frameId !== this._frameIdLastUpdate && this._worker && this._scene.activeCamera && this._canPostToWorker) {\r\n this.getWorldMatrix().multiplyToRef(this._scene.activeCamera.getViewMatrix(), this._modelViewMatrix);\r\n\r\n const dot = this._lastProj[2] * this._modelViewMatrix.m[2] + this._lastProj[6] * this._modelViewMatrix.m[6] + this._lastProj[10] * this._modelViewMatrix.m[10];\r\n if (Math.abs(dot - 1) >= 0.01) {\r\n this._frameIdLastUpdate = frameId;\r\n this._canPostToWorker = false;\r\n this._lastProj = this._modelViewMatrix.m.slice(0);\r\n this._worker.postMessage({ view: this._modelViewMatrix.m, depthMix: this._depthMix }, [this._depthMix.buffer]);\r\n }\r\n }\r\n\r\n return super.render(subMesh, enableAlphaMode, effectiveMeshReplacement);\r\n }\r\n\r\n /**\r\n * Code from https://github.com/dylanebert/gsplat.js/blob/main/src/loaders/PLYLoader.ts Under MIT license\r\n * Converts a .ply data array buffer to splat\r\n * if data array buffer is not ply, returns the original buffer\r\n * @param data the .ply data to load\r\n * @returns the loaded splat buffer\r\n */\r\n public static ConvertPLYToSplat(data: ArrayBuffer): ArrayBuffer {\r\n const ubuf = new Uint8Array(data);\r\n const header = new TextDecoder().decode(ubuf.slice(0, 1024 * 10));\r\n const headerEnd = \"end_header\\n\";\r\n const headerEndIndex = header.indexOf(headerEnd);\r\n if (headerEndIndex < 0 || !header) {\r\n return data;\r\n }\r\n const vertexCount = parseInt(/element vertex (\\d+)\\n/.exec(header)![1]);\r\n\r\n let rowOffset = 0;\r\n const offsets: Record<string, number> = {\r\n double: 8,\r\n int: 4,\r\n uint: 4,\r\n float: 4,\r\n short: 2,\r\n ushort: 2,\r\n uchar: 1,\r\n };\r\n\r\n type PlyProperty = {\r\n name: string;\r\n type: string;\r\n offset: number;\r\n };\r\n const properties: PlyProperty[] = [];\r\n const filtered = header\r\n .slice(0, headerEndIndex)\r\n .split(\"\\n\")\r\n .filter((k) => k.startsWith(\"property \"));\r\n for (const prop of filtered) {\r\n const [, type, name] = prop.split(\" \");\r\n properties.push({ name, type, offset: rowOffset });\r\n if (!offsets[type]) throw new Error(`Unsupported property type: ${type}`);\r\n rowOffset += offsets[type];\r\n }\r\n\r\n const rowLength = 3 * 4 + 3 * 4 + 4 + 4;\r\n const SH_C0 = 0.28209479177387814;\r\n\r\n const dataView = new DataView(data, headerEndIndex + headerEnd.length);\r\n const buffer = new ArrayBuffer(rowLength * vertexCount);\r\n const q = new Quaternion();\r\n\r\n for (let i = 0; i < vertexCount; i++) {\r\n const position = new Float32Array(buffer, i * rowLength, 3);\r\n const scale = new Float32Array(buffer, i * rowLength + 12, 3);\r\n const rgba = new Uint8ClampedArray(buffer, i * rowLength + 24, 4);\r\n const rot = new Uint8ClampedArray(buffer, i * rowLength + 28, 4);\r\n\r\n let r0: number = 255;\r\n let r1: number = 0;\r\n let r2: number = 0;\r\n let r3: number = 0;\r\n\r\n for (let propertyIndex = 0; propertyIndex < properties.length; propertyIndex++) {\r\n const property = properties[propertyIndex];\r\n let value;\r\n switch (property.type) {\r\n case \"float\":\r\n value = dataView.getFloat32(property.offset + i * rowOffset, true);\r\n break;\r\n case \"int\":\r\n value = dataView.getInt32(property.offset + i * rowOffset, true);\r\n break;\r\n default:\r\n throw new Error(`Unsupported property type: ${property.type}`);\r\n }\r\n\r\n switch (property.name) {\r\n case \"x\":\r\n position[0] = value;\r\n break;\r\n case \"y\":\r\n position[1] = value;\r\n break;\r\n case \"z\":\r\n position[2] = value;\r\n break;\r\n case \"scale_0\":\r\n scale[0] = Math.exp(value);\r\n break;\r\n case \"scale_1\":\r\n scale[1] = Math.exp(value);\r\n break;\r\n case \"scale_2\":\r\n scale[2] = Math.exp(value);\r\n break;\r\n case \"red\":\r\n rgba[0] = value;\r\n break;\r\n case \"green\":\r\n rgba[1] = value;\r\n break;\r\n case \"blue\":\r\n rgba[2] = value;\r\n break;\r\n case \"f_dc_0\":\r\n rgba[0] = (0.5 + SH_C0 * value) * 255;\r\n break;\r\n case \"f_dc_1\":\r\n rgba[1] = (0.5 + SH_C0 * value) * 255;\r\n break;\r\n case \"f_dc_2\":\r\n rgba[2] = (0.5 + SH_C0 * value) * 255;\r\n break;\r\n case \"f_dc_3\":\r\n rgba[3] = (0.5 + SH_C0 * value) * 255;\r\n break;\r\n case \"opacity\":\r\n rgba[3] = (1 / (1 + Math.exp(-value))) * 255;\r\n break;\r\n case \"rot_0\":\r\n r0 = value;\r\n break;\r\n case \"rot_1\":\r\n r1 = value;\r\n break;\r\n case \"rot_2\":\r\n r2 = value;\r\n break;\r\n case \"rot_3\":\r\n r3 = value;\r\n break;\r\n }\r\n }\r\n\r\n q.set(r1, r2, r3, r0);\r\n q.normalize();\r\n rot[0] = q.w * 128 + 128;\r\n rot[1] = q.x * 128 + 128;\r\n rot[2] = q.y * 128 + 128;\r\n rot[3] = q.z * 128 + 128;\r\n }\r\n\r\n return buffer;\r\n }\r\n\r\n /**\r\n * Loads a .splat Gaussian Splatting array buffer asynchronously\r\n * @param data arraybuffer containing splat file\r\n * @returns a promise that resolves when the operation is complete\r\n */\r\n\r\n public loadDataAsync(data: ArrayBuffer): Promise<void> {\r\n return Promise.resolve(this._loadData(data));\r\n }\r\n\r\n /**\r\n * Loads a .splat Gaussian or .ply Splatting file asynchronously\r\n * @param url path to the splat file to load\r\n * @returns a promise that resolves when the operation is complete\r\n */\r\n public loadFileAsync(url: string): Promise<void> {\r\n return Tools.LoadFileAsync(url, true).then((data) => {\r\n this._loadData(GaussianSplattingMesh.ConvertPLYToSplat(data));\r\n });\r\n }\r\n\r\n /**\r\n * Releases resources associated with this mesh.\r\n * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)\r\n */\r\n public dispose(doNotRecurse?: boolean): void {\r\n this._covariancesATexture?.dispose();\r\n this._covariancesBTexture?.dispose();\r\n this._centersTexture?.dispose();\r\n this._colorsTexture?.dispose();\r\n\r\n this._covariancesATexture = null;\r\n this._covariancesBTexture = null;\r\n this._centersTexture = null;\r\n this._colorsTexture = null;\r\n\r\n this._material?.dispose(false, true);\r\n this._material = null;\r\n\r\n this._worker?.terminate();\r\n this._worker = null;\r\n\r\n super.dispose(doNotRecurse);\r\n }\r\n\r\n private static _CreateWorker = function (self: Worker) {\r\n let vertexCount = 0;\r\n let positions: Float32Array;\r\n let depthMix: BigInt64Array;\r\n let indices: Uint32Array;\r\n let floatMix: Float32Array;\r\n\r\n self.onmessage = (e: any) => {\r\n // updated on init\r\n if (e.data.positions) {\r\n positions = e.data.positions;\r\n vertexCount = e.data.vertexCount;\r\n }\r\n // udpate on view changed\r\n else {\r\n const viewProj = e.data.view;\r\n if (!positions || !viewProj) {\r\n // Sanity check, it shouldn't happen!\r\n throw new Error(\"positions or view is not defined!\");\r\n }\r\n\r\n depthMix = e.data.depthMix;\r\n indices = new Uint32Array(depthMix.buffer);\r\n floatMix = new Float32Array(depthMix.buffer);\r\n\r\n // Sort\r\n for (let j = 0; j < vertexCount; j++) {\r\n indices[2 * j] = j;\r\n }\r\n\r\n for (let j = 0; j < vertexCount; j++) {\r\n floatMix[2 * j + 1] = 10000 - (viewProj[2] * positions[3 * j + 0] + viewProj[6] * positions[3 * j + 1] + viewProj[10] * positions[3 * j + 2]);\r\n }\r\n\r\n depthMix.sort();\r\n\r\n self.postMessage({ depthMix }, [depthMix.buffer]);\r\n }\r\n };\r\n };\r\n\r\n private _loadData(data: ArrayBuffer): void {\r\n // Parse the data\r\n const uBuffer = new Uint8Array(data);\r\n const fBuffer = new Float32Array(uBuffer.buffer);\r\n\r\n const rowLength = 3 * 4 + 3 * 4 + 4 + 4;\r\n const vertexCount = uBuffer.length / rowLength;\r\n\r\n this._vertexCount = vertexCount;\r\n\r\n const textureSize = this._getTextureSize(vertexCount);\r\n const textureLength = textureSize.x * textureSize.y;\r\n\r\n const positions = new Float32Array(3 * textureLength);\r\n const covA = new Float32Array(3 * textureLength);\r\n const covB = new Float32Array(3 * textureLength);\r\n\r\n const matrixRotation = TmpVectors.Matrix[0];\r\n const matrixScale = TmpVectors.Matrix[1];\r\n const quaternion = TmpVectors.Quaternion[0];\r\n\r\n const minimum = new Vector3(Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\r\n const maximum = new Vector3(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\r\n\r\n for (let i = 0; i < vertexCount; i++) {\r\n const x = fBuffer[8 * i + 0];\r\n const y = -fBuffer[8 * i + 1];\r\n const z = fBuffer[8 * i + 2];\r\n\r\n positions[3 * i + 0] = x;\r\n positions[3 * i + 1] = y;\r\n positions[3 * i + 2] = z;\r\n\r\n minimum.minimizeInPlaceFromFloats(x, y, z);\r\n maximum.maximizeInPlaceFromFloats(x, y, z);\r\n\r\n quaternion.set(\r\n (uBuffer[32 * i + 28 + 1] - 128) / 128,\r\n (uBuffer[32 * i + 28 + 2] - 128) / 128,\r\n (uBuffer[32 * i + 28 + 3] - 128) / 128,\r\n -(uBuffer[32 * i + 28 + 0] - 128) / 128\r\n );\r\n quaternion.toRotationMatrix(matrixRotation);\r\n\r\n Matrix.ScalingToRef(fBuffer[8 * i + 3 + 0] * 2, fBuffer[8 * i + 3 + 1] * 2, fBuffer[8 * i + 3 + 2] * 2, matrixScale);\r\n\r\n const M = matrixRotation.multiplyToRef(matrixScale, TmpVectors.Matrix[0]).m;\r\n\r\n covA[i * 3 + 0] = M[0] * M[0] + M[1] * M[1] + M[2] * M[2];\r\n covA[i * 3 + 1] = M[0] * M[4] + M[1] * M[5] + M[2] * M[6];\r\n covA[i * 3 + 2] = M[0] * M[8] + M[1] * M[9] + M[2] * M[10];\r\n covB[i * 3 + 0] = M[4] * M[4] + M[5] * M[5] + M[6] * M[6];\r\n covB[i * 3 + 1] = M[4] * M[8] + M[5] * M[9] + M[6] * M[10];\r\n covB[i * 3 + 2] = M[8] * M[8] + M[9] * M[9] + M[10] * M[10];\r\n }\r\n\r\n // Update the mesh\r\n const binfo = this.getBoundingInfo();\r\n binfo.reConstruct(minimum, maximum, this.getWorldMatrix());\r\n binfo.isLocked = true;\r\n\r\n this.forcedInstanceCount = this._vertexCount;\r\n this.setEnabled(true);\r\n\r\n const splatIndex = new Float32Array(this._vertexCount * 1);\r\n\r\n this.thinInstanceSetBuffer(\"splatIndex\", splatIndex, 1, false);\r\n\r\n // Update the material\r\n const createTextureFromData = (data: Float32Array, width: number, height: number, format: number) => {\r\n return new RawTexture(data, width, height, format, this._scene, false, false, Constants.TEXTURE_BILINEAR_SAMPLINGMODE, Constants.TEXTURETYPE_FLOAT);\r\n };\r\n\r\n const convertRgbToRgba = (rgb: Float32Array) => {\r\n const count = rgb.length / 3;\r\n const rgba = new Float32Array(count * 4);\r\n for (let i = 0; i < count; ++i) {\r\n rgba[i * 4 + 0] = rgb[i * 3 + 0];\r\n rgba[i * 4 + 1] = rgb[i * 3 + 1];\r\n rgba[i * 4 + 2] = rgb[i * 3 + 2];\r\n rgba[i * 4 + 3] = 1.0;\r\n }\r\n return rgba;\r\n };\r\n\r\n const colorArray = new Float32Array(textureSize.x * textureSize.y * 4);\r\n for (let i = 0; i < this._vertexCount; ++i) {\r\n colorArray[i * 4 + 0] = uBuffer[32 * i + 24 + 0] / 255;\r\n colorArray[i * 4 + 1] = uBuffer[32 * i + 24 + 1] / 255;\r\n colorArray[i * 4 + 2] = uBuffer[32 * i + 24 + 2] / 255;\r\n colorArray[i * 4 + 3] = uBuffer[32 * i + 24 + 3] / 255;\r\n }\r\n\r\n this._covariancesATexture = createTextureFromData(convertRgbToRgba(covA), textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\r\n this._covariancesBTexture = createTextureFromData(convertRgbToRgba(covB), textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\r\n this._centersTexture = createTextureFromData(convertRgbToRgba(positions), textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\r\n this._colorsTexture = createTextureFromData(colorArray, textureSize.x, textureSize.y, Constants.TEXTUREFORMAT_RGBA);\r\n\r\n // Start the worker thread\r\n this._worker?.terminate();\r\n this._worker = new Worker(\r\n URL.createObjectURL(\r\n new Blob([\"(\", GaussianSplattingMesh._CreateWorker.toString(), \")(self)\"], {\r\n type: \"application/javascript\",\r\n })\r\n )\r\n );\r\n\r\n this._depthMix = new BigInt64Array(vertexCount);\r\n\r\n this._worker.postMessage({ positions, vertexCount }, [positions.buffer]);\r\n\r\n this._worker.onmessage = (e) => {\r\n this._depthMix = e.data.depthMix;\r\n const indexMix = new Uint32Array(e.data.depthMix.buffer);\r\n for (let j = 0; j < this._vertexCount; j++) {\r\n splatIndex[j] = indexMix[2 * j];\r\n }\r\n this.thinInstanceBufferUpdated(\"splatIndex\");\r\n this._canPostToWorker = true;\r\n };\r\n }\r\n\r\n private _getTextureSize(length: number): Vector2 {\r\n const engine = this._scene.getEngine();\r\n const width = engine.getCaps().maxTextureSize;\r\n\r\n let height = 1;\r\n\r\n if (engine.webGLVersion === 1 && !engine.isWebGPU) {\r\n while (width * height < length) {\r\n height *= 2;\r\n }\r\n } else {\r\n height = Math.ceil(length / width);\r\n }\r\n\r\n if (height > width) {\r\n Logger.Error(\"GaussianSplatting texture size: (\" + width + \", \" + height + \"), maxTextureSize: \" + width);\r\n height = width;\r\n }\r\n\r\n return new Vector2(width, height);\r\n }\r\n}\r\n"]}
@@ -158,8 +158,10 @@ export declare abstract class GreasedLineBaseMesh extends Mesh {
158
158
  addPoints(points: number[][], options?: GreasedLineMeshOptions): void;
159
159
  /**
160
160
  * Dispose the line and it's resources
161
+ * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
162
+ * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
161
163
  */
162
- dispose(): void;
164
+ dispose(doNotRecurse?: boolean, disposeMaterialAndTextures?: boolean): void;
163
165
  /**
164
166
  *
165
167
  * @returns true if the mesh was created in lazy mode
@@ -102,9 +102,11 @@ export class GreasedLineBaseMesh extends Mesh {
102
102
  }
103
103
  /**
104
104
  * Dispose the line and it's resources
105
+ * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
106
+ * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
105
107
  */
106
- dispose() {
107
- super.dispose();
108
+ dispose(doNotRecurse, disposeMaterialAndTextures = false) {
109
+ super.dispose(doNotRecurse, disposeMaterialAndTextures);
108
110
  }
109
111
  /**
110
112
  *
@@ -1 +1 @@
1
- {"version":3,"file":"greasedLineBaseMesh.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GreasedLine/greasedLineBaseMesh.ts"],"names":[],"mappings":"AAEA,O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M,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QAEvC,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACrE,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7E,IAAI,CAAC,cAAc,GAAG,YAAY,CAAC;IACvC,CAAC;CACJ","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport type { IGreasedLineMaterial } from \"../../Materials/GreasedLine/greasedLineMaterialInterfaces\";\r\nimport { GreasedLinePluginMaterial } from \"../../Materials/GreasedLine/greasedLinePluginMaterial\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { Buffer } from \"../../Buffers/buffer\";\r\nimport type { Vector3 } from \"../../Maths/math.vector\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { DeepCopier } from \"../../Misc/deepCopier\";\r\nimport { GreasedLineSimpleMaterial } from \"../../Materials/GreasedLine/greasedLineSimpleMaterial\";\r\nimport type { Engine } from \"../../Engines/engine\";\r\n\r\n/**\r\n * In POINTS_MODE_POINTS every array of points will become the center (backbone) of the ribbon. The ribbon will be expanded by `width / 2` to `+direction` and `-direction` as well.\r\n * In POINTS_MODE_PATHS every array of points specifies an edge. These will be used to build one ribbon.\r\n */\r\nexport enum GreasedLineRibbonPointsMode {\r\n POINTS_MODE_POINTS = 0,\r\n POINTS_MODE_PATHS = 1,\r\n}\r\n\r\n/**\r\n * FACES_MODE_SINGLE_SIDED single sided with back face culling. Default value.\r\n * FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING single sided without back face culling. Sets backFaceCulling = false on the material so it affects all line ribbons added to the line ribbon instance.\r\n * FACES_MODE_DOUBLE_SIDED extra back faces are created. This doubles the amount of faces of the mesh.\r\n */\r\nexport enum GreasedLineRibbonFacesMode {\r\n FACES_MODE_SINGLE_SIDED = 0,\r\n FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING = 1,\r\n FACES_MODE_DOUBLE_SIDED = 2,\r\n}\r\n\r\n/**\r\n * Only with POINTS_MODE_PATHS.\r\n * AUTO_DIRECTIONS_FROM_FIRST_SEGMENT sets the direction (slope) of the ribbon from the direction of the first line segment. Recommended.\r\n * AUTO_DIRECTIONS_FROM_ALL_SEGMENTS in this mode the direction (slope) will be calculated for each line segment according to the direction vector between each point of the line segments. Slow method.\r\n * AUTO_DIRECTIONS_ENHANCED in this mode the direction (slope) will be calculated for each line segment according to the direction vector between each point of the line segments using a more sophisitcaed algorithm. Slowest method.\r\n * AUTO_DIRECTIONS_NONE you have to set the direction (slope) manually. Recommended.\r\n */\r\nexport enum GreasedLineRibbonAutoDirectionMode {\r\n AUTO_DIRECTIONS_FROM_FIRST_SEGMENT = 0,\r\n AUTO_DIRECTIONS_FROM_ALL_SEGMENTS = 1,\r\n AUTO_DIRECTIONS_ENHANCED = 2,\r\n AUTO_DIRECTIONS_NONE = 99,\r\n}\r\n\r\nexport type GreasedLineRibbonOptions = {\r\n /**\r\n * Defines how the points are processed.\r\n * In GreasedLineRibbonPointsMode.POINTS_MODE_POINTS every array of points will become the center of the ribbon. The ribbon will be expanded by width/2 to +direction and -direction as well.\r\n * In GreasedLineRibbonPointsMode.POINTS_MODE_PATHS every array of points is one path. These will be used to buuid one ribbon.\r\n */\r\n pointsMode?: GreasedLineRibbonPointsMode;\r\n /**\r\n * Normalized directions of the slopes of the non camera facing lines.\r\n */\r\n directions?: Vector3[] | Vector3;\r\n /**\r\n * Defines the calculation mode of the directions which the line will be thickened to.\r\n */\r\n directionsAutoMode?: GreasedLineRibbonAutoDirectionMode;\r\n /**\r\n * Width of the ribbon.\r\n */\r\n width?: number;\r\n /**\r\n * Controls how the faces are created.\r\n * GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED = single sided with back face culling. Default value.\r\n * GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING = single sided without back face culling\r\n * GreasedLineRibbonFacesMode.FACES_MODE_DOUBLE_SIDED = extra back faces are created. This doubles the amount of faces of the mesh.\r\n */\r\n facesMode?: GreasedLineRibbonFacesMode;\r\n /**\r\n * If true, the path will be closed.\r\n */\r\n closePath?: boolean;\r\n /**\r\n * If true, normals will be computed when creating the vertex buffers.\r\n * This results to smooth shading of the mesh.\r\n */\r\n smoothShading?: boolean;\r\n};\r\n\r\nexport type GreasedLinePoints = Vector3[] | Vector3[][] | Float32Array | Float32Array[] | number[][] | number[];\r\n\r\n/**\r\n * Options for creating a GreasedLineMesh\r\n */\r\nexport interface GreasedLineMeshOptions {\r\n /**\r\n * Points of the line.\r\n */\r\n points: GreasedLinePoints;\r\n /**\r\n * Each line segmment (from point to point) can have it's width multiplier. Final width = widths[segmentIdx] * width.\r\n * Defaults to empty array.\r\n */\r\n widths?: number[];\r\n /**\r\n * If instance is specified, lines are added to the specified instance.\r\n * Defaults to undefined.\r\n */\r\n instance?: GreasedLineBaseMesh;\r\n /**\r\n * You can manually set the color pointers so you can control which segment/part\r\n * will use which color from the colors material option\r\n */\r\n colorPointers?: number[];\r\n /**\r\n * UVs for the mesh\r\n */\r\n uvs?: number[];\r\n /**\r\n * If true, offsets and widths are updatable.\r\n * Defaults to false.\r\n */\r\n updatable?: boolean;\r\n /**\r\n * Use when @see instance is specified.\r\n * If true, the line will be rendered only after calling instance.updateLazy(). If false, line will be rerendered after every call to @see CreateGreasedLine\r\n * Defaults to false.\r\n */\r\n lazy?: boolean;\r\n /**\r\n * The options for the ribbon which will be used as a line.\r\n * If this option is set the line switches automatically to a non camera facing mode.\r\n */\r\n ribbonOptions?: GreasedLineRibbonOptions;\r\n}\r\n\r\n/**\r\n * GreasedLineBaseMesh\r\n */\r\nexport abstract class GreasedLineBaseMesh extends Mesh {\r\n protected _vertexPositions: number[];\r\n protected _indices: number[];\r\n protected _uvs: number[];\r\n protected _points: number[][];\r\n protected _offsets: number[];\r\n protected _colorPointers: number[];\r\n protected _widths: number[];\r\n\r\n protected _offsetsBuffer?: Buffer;\r\n protected _widthsBuffer?: Buffer;\r\n protected _colorPointersBuffer?: Buffer;\r\n\r\n protected _lazy = false;\r\n protected _updatable = false;\r\n\r\n protected _engine: Engine;\r\n\r\n constructor(\r\n public readonly name: string,\r\n scene: Scene,\r\n protected _options: GreasedLineMeshOptions\r\n ) {\r\n super(name, scene, null, null, false, false);\r\n\r\n this._engine = scene.getEngine();\r\n\r\n this._lazy = _options.lazy ?? false;\r\n this._updatable = _options.updatable ?? false;\r\n\r\n this._vertexPositions = [];\r\n this._indices = [];\r\n this._uvs = [];\r\n this._points = [];\r\n this._colorPointers = _options.colorPointers ?? [];\r\n this._widths = _options.widths ?? new Array(_options.points.length).fill(1);\r\n }\r\n\r\n /**\r\n * \"GreasedLineMesh\"\r\n * @returns \"GreasedLineMesh\"\r\n */\r\n public getClassName(): string {\r\n return \"GreasedLineMesh\";\r\n }\r\n\r\n protected abstract _setPoints(points: number[][], options?: GreasedLineMeshOptions): void;\r\n protected abstract _updateColorPointers(): void;\r\n protected abstract _updateWidths(): void;\r\n\r\n protected _updateWidthsWithValue(defaulValue: number) {\r\n let pointCount = 0;\r\n for (const points of this._points) {\r\n pointCount += points.length;\r\n }\r\n const countDiff = (pointCount / 3) * 2 - this._widths.length;\r\n for (let i = 0; i < countDiff; i++) {\r\n this._widths.push(defaulValue);\r\n }\r\n }\r\n\r\n /**\r\n * Updated a lazy line. Rerenders the line and updates boundinfo as well.\r\n */\r\n public updateLazy() {\r\n this._setPoints(this._points);\r\n if (!this._options.colorPointers) {\r\n this._updateColorPointers();\r\n }\r\n this._createVertexBuffers(this._options.ribbonOptions?.smoothShading);\r\n this.refreshBoundingInfo();\r\n\r\n this.greasedLineMaterial?.updateLazy();\r\n }\r\n\r\n /**\r\n * Adds new points to the line. It doesn't rerenders the line if in lazy mode.\r\n * @param points points table\r\n * @param options optional options\r\n */\r\n public addPoints(points: number[][], options?: GreasedLineMeshOptions) {\r\n for (const p of points) {\r\n this._points.push(p);\r\n }\r\n\r\n if (!this._lazy) {\r\n this.setPoints(this._points, options);\r\n }\r\n }\r\n\r\n /**\r\n * Dispose the line and it's resources\r\n */\r\n public dispose() {\r\n super.dispose();\r\n }\r\n\r\n /**\r\n *\r\n * @returns true if the mesh was created in lazy mode\r\n */\r\n public isLazy(): boolean {\r\n return this._lazy;\r\n }\r\n\r\n /**\r\n * Return the points offsets\r\n */\r\n get offsets() {\r\n return this._offsets;\r\n }\r\n\r\n /**\r\n * Sets point offests\r\n * @param offsets offset table [x,y,z, x,y,z, ....]\r\n */\r\n set offsets(offsets: number[]) {\r\n this._offsets = offsets;\r\n if (!this._offsetsBuffer) {\r\n this._createOffsetsBuffer(offsets);\r\n } else {\r\n this._offsetsBuffer.update(offsets);\r\n }\r\n }\r\n\r\n /**\r\n * Gets widths at each line point like [widthLower, widthUpper, widthLower, widthUpper, ...]\r\n */\r\n get widths() {\r\n return this._widths;\r\n }\r\n\r\n /**\r\n * Sets widths at each line point\r\n * @param widths width table [widthLower, widthUpper, widthLower, widthUpper ...]\r\n */\r\n set widths(widths: number[]) {\r\n this._widths = widths;\r\n if (!this._lazy) {\r\n this._widthsBuffer && this._widthsBuffer.update(widths);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the color pointer. Each vertex need a color pointer. These color pointers points to the colors in the color table @see colors\r\n */\r\n get colorPointers() {\r\n return this._colorPointers;\r\n }\r\n\r\n /**\r\n * Sets the color pointer\r\n * @param colorPointers array of color pointer in the colors array. One pointer for every vertex is needed.\r\n */\r\n set colorPointers(colorPointers: number[]) {\r\n this._colorPointers = colorPointers;\r\n if (!this._lazy) {\r\n this._colorPointersBuffer && this._colorPointersBuffer.update(colorPointers);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the pluginMaterial associated with line\r\n */\r\n get greasedLineMaterial(): IGreasedLineMaterial | undefined {\r\n if (this.material && this.material instanceof GreasedLineSimpleMaterial) {\r\n return this.material;\r\n }\r\n const materialPlugin = this.material?.pluginManager?.getPlugin(GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME);\r\n if (materialPlugin) {\r\n return <GreasedLinePluginMaterial>materialPlugin;\r\n }\r\n return;\r\n }\r\n\r\n /**\r\n * Return copy the points.\r\n */\r\n get points() {\r\n const pointsCopy: number[][] = [];\r\n DeepCopier.DeepCopy(this._points, pointsCopy);\r\n return pointsCopy;\r\n }\r\n\r\n /**\r\n * Sets line points and rerenders the line.\r\n * @param points points table\r\n * @param options optional options\r\n */\r\n public setPoints(points: number[][], options?: GreasedLineMeshOptions) {\r\n this._points = points;\r\n this._updateWidths();\r\n if (!options?.colorPointers) {\r\n this._updateColorPointers();\r\n }\r\n this._setPoints(points, options);\r\n }\r\n\r\n protected _initGreasedLine() {\r\n this._vertexPositions = [];\r\n this._indices = [];\r\n this._uvs = [];\r\n }\r\n\r\n protected _createLineOptions() {\r\n const lineOptions: GreasedLineMeshOptions = {\r\n points: this._points,\r\n colorPointers: this._colorPointers,\r\n lazy: this._lazy,\r\n updatable: this._updatable,\r\n uvs: this._uvs,\r\n widths: this._widths,\r\n ribbonOptions: this._options.ribbonOptions,\r\n };\r\n return lineOptions;\r\n }\r\n\r\n /**\r\n * Serializes this GreasedLineMesh\r\n * @param serializationObject object to write serialization to\r\n */\r\n public serialize(serializationObject: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.type = this.getClassName();\r\n\r\n serializationObject.lineOptions = this._createLineOptions();\r\n }\r\n\r\n protected _createVertexBuffers(computeNormals = false) {\r\n const vertexData = new VertexData();\r\n vertexData.positions = this._vertexPositions;\r\n vertexData.indices = this._indices;\r\n vertexData.uvs = this._uvs;\r\n if (computeNormals) {\r\n vertexData.normals = [];\r\n VertexData.ComputeNormals(this._vertexPositions, this._indices, vertexData.normals);\r\n }\r\n vertexData.applyToMesh(this, this._options.updatable);\r\n return vertexData;\r\n }\r\n\r\n protected _createOffsetsBuffer(offsets: number[]) {\r\n const engine = this._scene.getEngine();\r\n\r\n const offsetBuffer = new Buffer(engine, offsets, this._updatable, 3);\r\n this.setVerticesBuffer(offsetBuffer.createVertexBuffer(\"grl_offsets\", 0, 3));\r\n this._offsetsBuffer = offsetBuffer;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"greasedLineBaseMesh.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/GreasedLine/greasedLineBaseMesh.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAGlG;;;GAGG;AACH,MAAM,CAAN,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACnC,yGAAsB,CAAA;IACtB,uGAAqB,CAAA;AACzB,CAAC,EAHW,2BAA2B,KAA3B,2BAA2B,QAGtC;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IAClC,iHAA2B,CAAA;IAC3B,yJAA+C,CAAA;IAC/C,iHAA2B,CAAA;AAC/B,CAAC,EAJW,0BAA0B,KAA1B,0BAA0B,QAIrC;AAED;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,kCAKX;AALD,WAAY,kCAAkC;IAC1C,uJAAsC,CAAA;IACtC,qJAAqC,CAAA;IACrC,mIAA4B,CAAA;IAC5B,4HAAyB,CAAA;AAC7B,CAAC,EALW,kCAAkC,KAAlC,kCAAkC,QAK7C;AAsFD;;GAEG;AACH,MAAM,OAAgB,mBAAoB,SAAQ,IAAI;IAkBlD,YACoB,IAAY,EAC5B,KAAY,EACF,QAAgC;QAE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C,IAAI,CAAC;QAC3B,IAAI,cAAc,EAAE;YAChB,UAAU,CAAC,OAAO,GAAG,EAAE,CAAC;YACxB,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;SACvF;QACD,UAAU,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACtD,OAAO,UAAU,CAAC;IACtB,CAAC;IAES,oBAAoB,CAAC,OAAiB;QAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QAEvC,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACrE,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,kBAAkB,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC7E,IAAI,CAAC,cAAc,GAAG,YAAY,CAAC;IACvC,CAAC;CACJ","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport type { IGreasedLineMaterial } from \"../../Materials/GreasedLine/greasedLineMaterialInterfaces\";\r\nimport { GreasedLinePluginMaterial } from \"../../Materials/GreasedLine/greasedLinePluginMaterial\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { Buffer } from \"../../Buffers/buffer\";\r\nimport type { Vector3 } from \"../../Maths/math.vector\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { DeepCopier } from \"../../Misc/deepCopier\";\r\nimport { GreasedLineSimpleMaterial } from \"../../Materials/GreasedLine/greasedLineSimpleMaterial\";\r\nimport type { Engine } from \"../../Engines/engine\";\r\n\r\n/**\r\n * In POINTS_MODE_POINTS every array of points will become the center (backbone) of the ribbon. The ribbon will be expanded by `width / 2` to `+direction` and `-direction` as well.\r\n * In POINTS_MODE_PATHS every array of points specifies an edge. These will be used to build one ribbon.\r\n */\r\nexport enum GreasedLineRibbonPointsMode {\r\n POINTS_MODE_POINTS = 0,\r\n POINTS_MODE_PATHS = 1,\r\n}\r\n\r\n/**\r\n * FACES_MODE_SINGLE_SIDED single sided with back face culling. Default value.\r\n * FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING single sided without back face culling. Sets backFaceCulling = false on the material so it affects all line ribbons added to the line ribbon instance.\r\n * FACES_MODE_DOUBLE_SIDED extra back faces are created. This doubles the amount of faces of the mesh.\r\n */\r\nexport enum GreasedLineRibbonFacesMode {\r\n FACES_MODE_SINGLE_SIDED = 0,\r\n FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING = 1,\r\n FACES_MODE_DOUBLE_SIDED = 2,\r\n}\r\n\r\n/**\r\n * Only with POINTS_MODE_PATHS.\r\n * AUTO_DIRECTIONS_FROM_FIRST_SEGMENT sets the direction (slope) of the ribbon from the direction of the first line segment. Recommended.\r\n * AUTO_DIRECTIONS_FROM_ALL_SEGMENTS in this mode the direction (slope) will be calculated for each line segment according to the direction vector between each point of the line segments. Slow method.\r\n * AUTO_DIRECTIONS_ENHANCED in this mode the direction (slope) will be calculated for each line segment according to the direction vector between each point of the line segments using a more sophisitcaed algorithm. Slowest method.\r\n * AUTO_DIRECTIONS_NONE you have to set the direction (slope) manually. Recommended.\r\n */\r\nexport enum GreasedLineRibbonAutoDirectionMode {\r\n AUTO_DIRECTIONS_FROM_FIRST_SEGMENT = 0,\r\n AUTO_DIRECTIONS_FROM_ALL_SEGMENTS = 1,\r\n AUTO_DIRECTIONS_ENHANCED = 2,\r\n AUTO_DIRECTIONS_NONE = 99,\r\n}\r\n\r\nexport type GreasedLineRibbonOptions = {\r\n /**\r\n * Defines how the points are processed.\r\n * In GreasedLineRibbonPointsMode.POINTS_MODE_POINTS every array of points will become the center of the ribbon. The ribbon will be expanded by width/2 to +direction and -direction as well.\r\n * In GreasedLineRibbonPointsMode.POINTS_MODE_PATHS every array of points is one path. These will be used to buuid one ribbon.\r\n */\r\n pointsMode?: GreasedLineRibbonPointsMode;\r\n /**\r\n * Normalized directions of the slopes of the non camera facing lines.\r\n */\r\n directions?: Vector3[] | Vector3;\r\n /**\r\n * Defines the calculation mode of the directions which the line will be thickened to.\r\n */\r\n directionsAutoMode?: GreasedLineRibbonAutoDirectionMode;\r\n /**\r\n * Width of the ribbon.\r\n */\r\n width?: number;\r\n /**\r\n * Controls how the faces are created.\r\n * GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED = single sided with back face culling. Default value.\r\n * GreasedLineRibbonFacesMode.FACES_MODE_SINGLE_SIDED_NO_BACKFACE_CULLING = single sided without back face culling\r\n * GreasedLineRibbonFacesMode.FACES_MODE_DOUBLE_SIDED = extra back faces are created. This doubles the amount of faces of the mesh.\r\n */\r\n facesMode?: GreasedLineRibbonFacesMode;\r\n /**\r\n * If true, the path will be closed.\r\n */\r\n closePath?: boolean;\r\n /**\r\n * If true, normals will be computed when creating the vertex buffers.\r\n * This results to smooth shading of the mesh.\r\n */\r\n smoothShading?: boolean;\r\n};\r\n\r\nexport type GreasedLinePoints = Vector3[] | Vector3[][] | Float32Array | Float32Array[] | number[][] | number[];\r\n\r\n/**\r\n * Options for creating a GreasedLineMesh\r\n */\r\nexport interface GreasedLineMeshOptions {\r\n /**\r\n * Points of the line.\r\n */\r\n points: GreasedLinePoints;\r\n /**\r\n * Each line segmment (from point to point) can have it's width multiplier. Final width = widths[segmentIdx] * width.\r\n * Defaults to empty array.\r\n */\r\n widths?: number[];\r\n /**\r\n * If instance is specified, lines are added to the specified instance.\r\n * Defaults to undefined.\r\n */\r\n instance?: GreasedLineBaseMesh;\r\n /**\r\n * You can manually set the color pointers so you can control which segment/part\r\n * will use which color from the colors material option\r\n */\r\n colorPointers?: number[];\r\n /**\r\n * UVs for the mesh\r\n */\r\n uvs?: number[];\r\n /**\r\n * If true, offsets and widths are updatable.\r\n * Defaults to false.\r\n */\r\n updatable?: boolean;\r\n /**\r\n * Use when @see instance is specified.\r\n * If true, the line will be rendered only after calling instance.updateLazy(). If false, line will be rerendered after every call to @see CreateGreasedLine\r\n * Defaults to false.\r\n */\r\n lazy?: boolean;\r\n /**\r\n * The options for the ribbon which will be used as a line.\r\n * If this option is set the line switches automatically to a non camera facing mode.\r\n */\r\n ribbonOptions?: GreasedLineRibbonOptions;\r\n}\r\n\r\n/**\r\n * GreasedLineBaseMesh\r\n */\r\nexport abstract class GreasedLineBaseMesh extends Mesh {\r\n protected _vertexPositions: number[];\r\n protected _indices: number[];\r\n protected _uvs: number[];\r\n protected _points: number[][];\r\n protected _offsets: number[];\r\n protected _colorPointers: number[];\r\n protected _widths: number[];\r\n\r\n protected _offsetsBuffer?: Buffer;\r\n protected _widthsBuffer?: Buffer;\r\n protected _colorPointersBuffer?: Buffer;\r\n\r\n protected _lazy = false;\r\n protected _updatable = false;\r\n\r\n protected _engine: Engine;\r\n\r\n constructor(\r\n public readonly name: string,\r\n scene: Scene,\r\n protected _options: GreasedLineMeshOptions\r\n ) {\r\n super(name, scene, null, null, false, false);\r\n\r\n this._engine = scene.getEngine();\r\n\r\n this._lazy = _options.lazy ?? false;\r\n this._updatable = _options.updatable ?? false;\r\n\r\n this._vertexPositions = [];\r\n this._indices = [];\r\n this._uvs = [];\r\n this._points = [];\r\n this._colorPointers = _options.colorPointers ?? [];\r\n this._widths = _options.widths ?? new Array(_options.points.length).fill(1);\r\n }\r\n\r\n /**\r\n * \"GreasedLineMesh\"\r\n * @returns \"GreasedLineMesh\"\r\n */\r\n public getClassName(): string {\r\n return \"GreasedLineMesh\";\r\n }\r\n\r\n protected abstract _setPoints(points: number[][], options?: GreasedLineMeshOptions): void;\r\n protected abstract _updateColorPointers(): void;\r\n protected abstract _updateWidths(): void;\r\n\r\n protected _updateWidthsWithValue(defaulValue: number) {\r\n let pointCount = 0;\r\n for (const points of this._points) {\r\n pointCount += points.length;\r\n }\r\n const countDiff = (pointCount / 3) * 2 - this._widths.length;\r\n for (let i = 0; i < countDiff; i++) {\r\n this._widths.push(defaulValue);\r\n }\r\n }\r\n\r\n /**\r\n * Updated a lazy line. Rerenders the line and updates boundinfo as well.\r\n */\r\n public updateLazy() {\r\n this._setPoints(this._points);\r\n if (!this._options.colorPointers) {\r\n this._updateColorPointers();\r\n }\r\n this._createVertexBuffers(this._options.ribbonOptions?.smoothShading);\r\n this.refreshBoundingInfo();\r\n\r\n this.greasedLineMaterial?.updateLazy();\r\n }\r\n\r\n /**\r\n * Adds new points to the line. It doesn't rerenders the line if in lazy mode.\r\n * @param points points table\r\n * @param options optional options\r\n */\r\n public addPoints(points: number[][], options?: GreasedLineMeshOptions) {\r\n for (const p of points) {\r\n this._points.push(p);\r\n }\r\n\r\n if (!this._lazy) {\r\n this.setPoints(this._points, options);\r\n }\r\n }\r\n\r\n /**\r\n * Dispose the line and it's resources\r\n * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)\r\n * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)\r\n */\r\n public dispose(doNotRecurse?: boolean, disposeMaterialAndTextures = false) {\r\n super.dispose(doNotRecurse, disposeMaterialAndTextures);\r\n }\r\n\r\n /**\r\n *\r\n * @returns true if the mesh was created in lazy mode\r\n */\r\n public isLazy(): boolean {\r\n return this._lazy;\r\n }\r\n\r\n /**\r\n * Return the points offsets\r\n */\r\n get offsets() {\r\n return this._offsets;\r\n }\r\n\r\n /**\r\n * Sets point offests\r\n * @param offsets offset table [x,y,z, x,y,z, ....]\r\n */\r\n set offsets(offsets: number[]) {\r\n this._offsets = offsets;\r\n if (!this._offsetsBuffer) {\r\n this._createOffsetsBuffer(offsets);\r\n } else {\r\n this._offsetsBuffer.update(offsets);\r\n }\r\n }\r\n\r\n /**\r\n * Gets widths at each line point like [widthLower, widthUpper, widthLower, widthUpper, ...]\r\n */\r\n get widths() {\r\n return this._widths;\r\n }\r\n\r\n /**\r\n * Sets widths at each line point\r\n * @param widths width table [widthLower, widthUpper, widthLower, widthUpper ...]\r\n */\r\n set widths(widths: number[]) {\r\n this._widths = widths;\r\n if (!this._lazy) {\r\n this._widthsBuffer && this._widthsBuffer.update(widths);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the color pointer. Each vertex need a color pointer. These color pointers points to the colors in the color table @see colors\r\n */\r\n get colorPointers() {\r\n return this._colorPointers;\r\n }\r\n\r\n /**\r\n * Sets the color pointer\r\n * @param colorPointers array of color pointer in the colors array. One pointer for every vertex is needed.\r\n */\r\n set colorPointers(colorPointers: number[]) {\r\n this._colorPointers = colorPointers;\r\n if (!this._lazy) {\r\n this._colorPointersBuffer && this._colorPointersBuffer.update(colorPointers);\r\n }\r\n }\r\n\r\n /**\r\n * Gets the pluginMaterial associated with line\r\n */\r\n get greasedLineMaterial(): IGreasedLineMaterial | undefined {\r\n if (this.material && this.material instanceof GreasedLineSimpleMaterial) {\r\n return this.material;\r\n }\r\n const materialPlugin = this.material?.pluginManager?.getPlugin(GreasedLinePluginMaterial.GREASED_LINE_MATERIAL_NAME);\r\n if (materialPlugin) {\r\n return <GreasedLinePluginMaterial>materialPlugin;\r\n }\r\n return;\r\n }\r\n\r\n /**\r\n * Return copy the points.\r\n */\r\n get points() {\r\n const pointsCopy: number[][] = [];\r\n DeepCopier.DeepCopy(this._points, pointsCopy);\r\n return pointsCopy;\r\n }\r\n\r\n /**\r\n * Sets line points and rerenders the line.\r\n * @param points points table\r\n * @param options optional options\r\n */\r\n public setPoints(points: number[][], options?: GreasedLineMeshOptions) {\r\n this._points = points;\r\n this._updateWidths();\r\n if (!options?.colorPointers) {\r\n this._updateColorPointers();\r\n }\r\n this._setPoints(points, options);\r\n }\r\n\r\n protected _initGreasedLine() {\r\n this._vertexPositions = [];\r\n this._indices = [];\r\n this._uvs = [];\r\n }\r\n\r\n protected _createLineOptions() {\r\n const lineOptions: GreasedLineMeshOptions = {\r\n points: this._points,\r\n colorPointers: this._colorPointers,\r\n lazy: this._lazy,\r\n updatable: this._updatable,\r\n uvs: this._uvs,\r\n widths: this._widths,\r\n ribbonOptions: this._options.ribbonOptions,\r\n };\r\n return lineOptions;\r\n }\r\n\r\n /**\r\n * Serializes this GreasedLineMesh\r\n * @param serializationObject object to write serialization to\r\n */\r\n public serialize(serializationObject: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.type = this.getClassName();\r\n\r\n serializationObject.lineOptions = this._createLineOptions();\r\n }\r\n\r\n protected _createVertexBuffers(computeNormals = false) {\r\n const vertexData = new VertexData();\r\n vertexData.positions = this._vertexPositions;\r\n vertexData.indices = this._indices;\r\n vertexData.uvs = this._uvs;\r\n if (computeNormals) {\r\n vertexData.normals = [];\r\n VertexData.ComputeNormals(this._vertexPositions, this._indices, vertexData.normals);\r\n }\r\n vertexData.applyToMesh(this, this._options.updatable);\r\n return vertexData;\r\n }\r\n\r\n protected _createOffsetsBuffer(offsets: number[]) {\r\n const engine = this._scene.getEngine();\r\n\r\n const offsetBuffer = new Buffer(engine, offsets, this._updatable, 3);\r\n this.setVerticesBuffer(offsetBuffer.createVertexBuffer(\"grl_offsets\", 0, 3));\r\n this._offsetsBuffer = offsetBuffer;\r\n }\r\n}\r\n"]}
@@ -0,0 +1,30 @@
1
+ import { NodeGeometryBlock } from "../nodeGeometryBlock";
2
+ import type { NodeGeometryConnectionPoint } from "../nodeGeometryBlockConnectionPoint";
3
+ /**
4
+ * Block used to get the distance between 2 values
5
+ */
6
+ export declare class GeometryDistanceBlock extends NodeGeometryBlock {
7
+ /**
8
+ * Creates a new GeometryDistanceBlock
9
+ * @param name defines the block name
10
+ */
11
+ constructor(name: string);
12
+ /**
13
+ * Gets the current class name
14
+ * @returns the class name
15
+ */
16
+ getClassName(): string;
17
+ /**
18
+ * Gets the left operand input component
19
+ */
20
+ get left(): NodeGeometryConnectionPoint;
21
+ /**
22
+ * Gets the right operand input component
23
+ */
24
+ get right(): NodeGeometryConnectionPoint;
25
+ /**
26
+ * Gets the output component
27
+ */
28
+ get output(): NodeGeometryConnectionPoint;
29
+ protected _buildBlock(): this | undefined;
30
+ }
@@ -0,0 +1,63 @@
1
+ import { RegisterClass } from "../../../Misc/typeStore.js";
2
+ import { NodeGeometryBlockConnectionPointTypes } from "../Enums/nodeGeometryConnectionPointTypes.js";
3
+ import { NodeGeometryBlock } from "../nodeGeometryBlock.js";
4
+ /**
5
+ * Block used to get the distance between 2 values
6
+ */
7
+ export class GeometryDistanceBlock extends NodeGeometryBlock {
8
+ /**
9
+ * Creates a new GeometryDistanceBlock
10
+ * @param name defines the block name
11
+ */
12
+ constructor(name) {
13
+ super(name);
14
+ this.registerInput("left", NodeGeometryBlockConnectionPointTypes.AutoDetect);
15
+ this.registerInput("right", NodeGeometryBlockConnectionPointTypes.AutoDetect);
16
+ this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Float);
17
+ this._linkConnectionTypes(0, 1);
18
+ this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
19
+ this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
20
+ this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
21
+ this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
22
+ }
23
+ /**
24
+ * Gets the current class name
25
+ * @returns the class name
26
+ */
27
+ getClassName() {
28
+ return "GeometryDistanceBlock";
29
+ }
30
+ /**
31
+ * Gets the left operand input component
32
+ */
33
+ get left() {
34
+ return this._inputs[0];
35
+ }
36
+ /**
37
+ * Gets the right operand input component
38
+ */
39
+ get right() {
40
+ return this._inputs[1];
41
+ }
42
+ /**
43
+ * Gets the output component
44
+ */
45
+ get output() {
46
+ return this._outputs[0];
47
+ }
48
+ _buildBlock() {
49
+ if (!this.left.isConnected || !this.right.isConnected) {
50
+ this.output._storedFunction = null;
51
+ this.output._storedValue = null;
52
+ return;
53
+ }
54
+ this.output._storedFunction = (state) => {
55
+ const left = this.left.getConnectedValue(state);
56
+ const right = this.right.getConnectedValue(state);
57
+ return left.subtract(right).length();
58
+ };
59
+ return this;
60
+ }
61
+ }
62
+ RegisterClass("BABYLON.GeometryDistanceBlock", GeometryDistanceBlock);
63
+ //# sourceMappingURL=geometryDistanceBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometryDistanceBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryDistanceBlock.ts"],"names":[],"mappings":"AAAA,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,OAAO,qBAAsB,SAAQ,iBAAiB;IACxD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC7E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QAE3E,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAEhC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,KAAK,CAAC,CAAC;QAC/F,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,MAAM,CAAC,CAAC;QAChG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,KAAK,CAAC,CAAC;QAC/F,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,MAAM,CAAC,CAAC;IACpG,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,uBAAuB,CAAC;IACnC,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC3B,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;IAES,WAAW;QACjB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;YACnD,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,IAAI,CAAC;YACnC,IAAI,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC;YAChC,OAAO;SACV;QAED,IAAI,CAAC,MAAM,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,EAAE;YACpC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAChD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAElD,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;QACzC,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,+BAA+B,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Block used to get the distance between 2 values\r\n */\r\nexport class GeometryDistanceBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryDistanceBlock\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(\"left\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Float);\r\n\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"GeometryDistanceBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this.left.isConnected || !this.right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n const left = this.left.getConnectedValue(state);\r\n const right = this.right.getConnectedValue(state);\r\n\r\n return left.subtract(right).length();\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryDistanceBlock\", GeometryDistanceBlock);\r\n"]}
@@ -0,0 +1,30 @@
1
+ import { NodeGeometryBlock } from "../nodeGeometryBlock";
2
+ import type { NodeGeometryConnectionPoint } from "../nodeGeometryBlockConnectionPoint";
3
+ /**
4
+ * Block used to apply a dot product between 2 vectors
5
+ */
6
+ export declare class GeometryDotBlock extends NodeGeometryBlock {
7
+ /**
8
+ * Creates a new GeometryDotBlock
9
+ * @param name defines the block name
10
+ */
11
+ constructor(name: string);
12
+ /**
13
+ * Gets the current class name
14
+ * @returns the class name
15
+ */
16
+ getClassName(): string;
17
+ /**
18
+ * Gets the left operand input component
19
+ */
20
+ get left(): NodeGeometryConnectionPoint;
21
+ /**
22
+ * Gets the right operand input component
23
+ */
24
+ get right(): NodeGeometryConnectionPoint;
25
+ /**
26
+ * Gets the output component
27
+ */
28
+ get output(): NodeGeometryConnectionPoint;
29
+ protected _buildBlock(): this | undefined;
30
+ }
@@ -0,0 +1,63 @@
1
+ import { RegisterClass } from "../../../Misc/typeStore.js";
2
+ import { NodeGeometryBlockConnectionPointTypes } from "../Enums/nodeGeometryConnectionPointTypes.js";
3
+ import { NodeGeometryBlock } from "../nodeGeometryBlock.js";
4
+ /**
5
+ * Block used to apply a dot product between 2 vectors
6
+ */
7
+ export class GeometryDotBlock extends NodeGeometryBlock {
8
+ /**
9
+ * Creates a new GeometryDotBlock
10
+ * @param name defines the block name
11
+ */
12
+ constructor(name) {
13
+ super(name);
14
+ this.registerInput("left", NodeGeometryBlockConnectionPointTypes.AutoDetect);
15
+ this.registerInput("right", NodeGeometryBlockConnectionPointTypes.AutoDetect);
16
+ this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Float);
17
+ this._linkConnectionTypes(0, 1);
18
+ this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
19
+ this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
20
+ this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
21
+ this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
22
+ }
23
+ /**
24
+ * Gets the current class name
25
+ * @returns the class name
26
+ */
27
+ getClassName() {
28
+ return "GeometryDotBlock";
29
+ }
30
+ /**
31
+ * Gets the left operand input component
32
+ */
33
+ get left() {
34
+ return this._inputs[0];
35
+ }
36
+ /**
37
+ * Gets the right operand input component
38
+ */
39
+ get right() {
40
+ return this._inputs[1];
41
+ }
42
+ /**
43
+ * Gets the output component
44
+ */
45
+ get output() {
46
+ return this._outputs[0];
47
+ }
48
+ _buildBlock() {
49
+ if (!this.left.isConnected || !this.right.isConnected) {
50
+ this.output._storedFunction = null;
51
+ this.output._storedValue = null;
52
+ return;
53
+ }
54
+ this.output._storedFunction = (state) => {
55
+ const left = this.left.getConnectedValue(state);
56
+ const right = this.right.getConnectedValue(state);
57
+ return left.dot(right);
58
+ };
59
+ return this;
60
+ }
61
+ }
62
+ RegisterClass("BABYLON.GeometryDotBlock", GeometryDotBlock);
63
+ //# sourceMappingURL=geometryDotBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometryDotBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Meshes/Node/Blocks/geometryDotBlock.ts"],"names":[],"mappings":"AAAA,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,OAAO,gBAAiB,SAAQ,iBAAiB;IACnD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC7E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,I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M,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAChD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;YAElD,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAED,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { NodeGeometryBlockConnectionPointTypes } from \"../Enums/nodeGeometryConnectionPointTypes\";\r\nimport { NodeGeometryBlock } from \"../nodeGeometryBlock\";\r\nimport type { NodeGeometryConnectionPoint } from \"../nodeGeometryBlockConnectionPoint\";\r\n\r\n/**\r\n * Block used to apply a dot product between 2 vectors\r\n */\r\nexport class GeometryDotBlock extends NodeGeometryBlock {\r\n /**\r\n * Creates a new GeometryDotBlock\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(\"left\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeGeometryBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeGeometryBlockConnectionPointTypes.Float);\r\n\r\n this._linkConnectionTypes(0, 1);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"GeometryDotBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeGeometryConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeGeometryConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeGeometryConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock() {\r\n if (!this.left.isConnected || !this.right.isConnected) {\r\n this.output._storedFunction = null;\r\n this.output._storedValue = null;\r\n return;\r\n }\r\n\r\n this.output._storedFunction = (state) => {\r\n const left = this.left.getConnectedValue(state);\r\n const right = this.right.getConnectedValue(state);\r\n\r\n return left.dot(right);\r\n };\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.GeometryDotBlock\", GeometryDotBlock);\r\n"]}
@@ -0,0 +1,26 @@
1
+ import { NodeGeometryBlock } from "../nodeGeometryBlock";
2
+ import type { NodeGeometryConnectionPoint } from "../nodeGeometryBlockConnectionPoint";
3
+ /**
4
+ * Block used to get the length of a vector
5
+ */
6
+ export declare class GeometryLengthBlock extends NodeGeometryBlock {
7
+ /**
8
+ * Creates a new GeometryLengthBlock
9
+ * @param name defines the block name
10
+ */
11
+ constructor(name: string);
12
+ /**
13
+ * Gets the current class name
14
+ * @returns the class name
15
+ */
16
+ getClassName(): string;
17
+ /**
18
+ * Gets the value input component
19
+ */
20
+ get value(): NodeGeometryConnectionPoint;
21
+ /**
22
+ * Gets the output component
23
+ */
24
+ get output(): NodeGeometryConnectionPoint;
25
+ protected _buildBlock(): this | undefined;
26
+ }
@@ -0,0 +1,52 @@
1
+ import { RegisterClass } from "../../../Misc/typeStore.js";
2
+ import { NodeGeometryBlockConnectionPointTypes } from "../Enums/nodeGeometryConnectionPointTypes.js";
3
+ import { NodeGeometryBlock } from "../nodeGeometryBlock.js";
4
+ /**
5
+ * Block used to get the length of a vector
6
+ */
7
+ export class GeometryLengthBlock extends NodeGeometryBlock {
8
+ /**
9
+ * Creates a new GeometryLengthBlock
10
+ * @param name defines the block name
11
+ */
12
+ constructor(name) {
13
+ super(name);
14
+ this.registerInput("value", NodeGeometryBlockConnectionPointTypes.AutoDetect);
15
+ this.registerOutput("output", NodeGeometryBlockConnectionPointTypes.Float);
16
+ this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Float);
17
+ this._inputs[0].excludedConnectionPointTypes.push(NodeGeometryBlockConnectionPointTypes.Matrix);
18
+ }
19
+ /**
20
+ * Gets the current class name
21
+ * @returns the class name
22
+ */
23
+ getClassName() {
24
+ return "GeometryLengthBlock";
25
+ }
26
+ /**
27
+ * Gets the value input component
28
+ */
29
+ get value() {
30
+ return this._inputs[0];
31
+ }
32
+ /**
33
+ * Gets the output component
34
+ */
35
+ get output() {
36
+ return this._outputs[0];
37
+ }
38
+ _buildBlock() {
39
+ if (!this.value.isConnected) {
40
+ this.output._storedFunction = null;
41
+ this.output._storedValue = null;
42
+ return;
43
+ }
44
+ this.output._storedFunction = (state) => {
45
+ const value = this.value.getConnectedValue(state);
46
+ return value.length();
47
+ };
48
+ return this;
49
+ }
50
+ }
51
+ RegisterClass("BABYLON.GeometryLengthBlock", GeometryLengthBlock);
52
+ //# sourceMappingURL=geometryLengthBlock.js.map