@babylonjs/core 7.41.1 → 7.43.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 (170) hide show
  1. package/Animations/animation.js +1 -1
  2. package/Animations/animation.js.map +1 -1
  3. package/Culling/Helper/computeShaderBoundingHelper.js +3 -4
  4. package/Culling/Helper/computeShaderBoundingHelper.js.map +1 -1
  5. package/Culling/Helper/transformFeedbackBoundingHelper.js +27 -64
  6. package/Culling/Helper/transformFeedbackBoundingHelper.js.map +1 -1
  7. package/Engines/Extensions/engine.multiRender.js +3 -2
  8. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  9. package/Engines/WebGPU/webgpuCacheRenderPipeline.d.ts +1 -0
  10. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +5 -0
  11. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  12. package/Engines/WebGPU/webgpuTextureManager.js +6 -1
  13. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  14. package/Engines/abstractEngine.js +2 -2
  15. package/Engines/abstractEngine.js.map +1 -1
  16. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.d.ts +64 -0
  17. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +147 -0
  18. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -0
  19. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +0 -15
  20. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  21. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.d.ts +4 -0
  22. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js +9 -0
  23. package/FrameGraph/Node/Blocks/Rendering/baseShadowGeneratorBlock.js.map +1 -1
  24. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.d.ts +1 -6
  25. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js +0 -13
  26. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js.map +1 -1
  27. package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js +0 -1
  28. package/FrameGraph/Node/Blocks/Rendering/shadowGeneratorBlock.js.map +1 -1
  29. package/FrameGraph/Node/Blocks/index.d.ts +1 -0
  30. package/FrameGraph/Node/Blocks/index.js +1 -0
  31. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  32. package/FrameGraph/Node/nodeRenderGraphBlock.js +17 -0
  33. package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
  34. package/FrameGraph/Passes/renderPass.d.ts +0 -8
  35. package/FrameGraph/Passes/renderPass.js +0 -10
  36. package/FrameGraph/Passes/renderPass.js.map +1 -1
  37. package/FrameGraph/Tasks/Layers/glowLayerTask.d.ts +57 -0
  38. package/FrameGraph/Tasks/Layers/glowLayerTask.js +173 -0
  39. package/FrameGraph/Tasks/Layers/glowLayerTask.js.map +1 -0
  40. package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +1 -1
  41. package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -1
  42. package/FrameGraph/Tasks/PostProcesses/bloomTask.js +7 -0
  43. package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
  44. package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +1 -1
  45. package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -1
  46. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +1 -1
  47. package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -1
  48. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +5 -5
  49. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
  50. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +12 -4
  51. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
  52. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +1 -1
  53. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  54. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +0 -8
  55. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +1 -17
  56. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -1
  57. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +3 -0
  58. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  59. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +4 -6
  60. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +20 -22
  61. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  62. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.d.ts +7 -1
  63. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js +21 -5
  64. package/FrameGraph/Tasks/Rendering/shadowGeneratorTask.js.map +1 -1
  65. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +4 -6
  66. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
  67. package/FrameGraph/Tasks/Texture/copyToTextureTask.js +1 -1
  68. package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
  69. package/FrameGraph/frameGraph.js +22 -11
  70. package/FrameGraph/frameGraph.js.map +1 -1
  71. package/FrameGraph/frameGraphRenderContext.d.ts +2 -1
  72. package/FrameGraph/frameGraphRenderContext.js +2 -1
  73. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  74. package/FrameGraph/frameGraphTask.d.ts +11 -1
  75. package/FrameGraph/frameGraphTask.js +8 -0
  76. package/FrameGraph/frameGraphTask.js.map +1 -1
  77. package/FrameGraph/frameGraphTextureManager.d.ts +8 -2
  78. package/FrameGraph/frameGraphTextureManager.js +10 -4
  79. package/FrameGraph/frameGraphTextureManager.js.map +1 -1
  80. package/FrameGraph/index.d.ts +1 -0
  81. package/FrameGraph/index.js +1 -0
  82. package/FrameGraph/index.js.map +1 -1
  83. package/Layers/effectLayer.d.ts +32 -33
  84. package/Layers/effectLayer.js +144 -530
  85. package/Layers/effectLayer.js.map +1 -1
  86. package/Layers/glowLayer.d.ts +14 -41
  87. package/Layers/glowLayer.js +92 -178
  88. package/Layers/glowLayer.js.map +1 -1
  89. package/Layers/highlightLayer.d.ts +0 -1
  90. package/Layers/highlightLayer.js +0 -1
  91. package/Layers/highlightLayer.js.map +1 -1
  92. package/Layers/index.d.ts +2 -0
  93. package/Layers/index.js +2 -0
  94. package/Layers/index.js.map +1 -1
  95. package/Layers/thinEffectLayer.d.ts +230 -0
  96. package/Layers/thinEffectLayer.js +734 -0
  97. package/Layers/thinEffectLayer.js.map +1 -0
  98. package/Layers/thinGlowLayer.d.ts +141 -0
  99. package/Layers/thinGlowLayer.js +292 -0
  100. package/Layers/thinGlowLayer.js.map +1 -0
  101. package/Lights/Shadows/shadowGenerator.js +40 -19
  102. package/Lights/Shadows/shadowGenerator.js.map +1 -1
  103. package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js +17 -11
  104. package/Materials/GreasedLine/greasedLinePluginMaterialShadersGLSL.js.map +1 -1
  105. package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js +18 -12
  106. package/Materials/GreasedLine/greasedLinePluginMaterialShadersWGSL.js.map +1 -1
  107. package/Materials/Node/Blocks/Input/inputBlock.js +34 -2
  108. package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
  109. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +34 -24
  110. package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
  111. package/Materials/Node/nodeMaterial.d.ts +10 -0
  112. package/Materials/Node/nodeMaterial.js +12 -0
  113. package/Materials/Node/nodeMaterial.js.map +1 -1
  114. package/Materials/PBR/pbrBaseMaterial.d.ts +5 -0
  115. package/Materials/PBR/pbrBaseMaterial.js +5 -0
  116. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  117. package/Materials/Textures/renderTargetTexture.d.ts +12 -0
  118. package/Materials/Textures/renderTargetTexture.js +29 -8
  119. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  120. package/Materials/materialHelper.functions.d.ts +17 -1
  121. package/Materials/materialHelper.functions.js +76 -4
  122. package/Materials/materialHelper.functions.js.map +1 -1
  123. package/Materials/shaderMaterial.d.ts +5 -4
  124. package/Materials/shaderMaterial.js +28 -51
  125. package/Materials/shaderMaterial.js.map +1 -1
  126. package/Materials/standardMaterial.d.ts +5 -0
  127. package/Materials/standardMaterial.js +5 -0
  128. package/Materials/standardMaterial.js.map +1 -1
  129. package/Meshes/Builders/greasedLineBuilder.d.ts +1 -1
  130. package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +5 -0
  131. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +30 -22
  132. package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
  133. package/Meshes/GreasedLine/greasedLineBaseMesh.js +1 -0
  134. package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
  135. package/Meshes/abstractMesh.d.ts +1 -2
  136. package/Meshes/abstractMesh.js +1 -2
  137. package/Meshes/abstractMesh.js.map +1 -1
  138. package/Meshes/linesMesh.js +2 -2
  139. package/Meshes/linesMesh.js.map +1 -1
  140. package/Meshes/mesh.d.ts +30 -3
  141. package/Meshes/mesh.js +56 -29
  142. package/Meshes/mesh.js.map +1 -1
  143. package/Meshes/subMesh.js +16 -3
  144. package/Meshes/subMesh.js.map +1 -1
  145. package/Misc/fileTools.js +14 -7
  146. package/Misc/fileTools.js.map +1 -1
  147. package/Morph/morphTargetManager.d.ts +20 -0
  148. package/Morph/morphTargetManager.js +31 -1
  149. package/Morph/morphTargetManager.js.map +1 -1
  150. package/PostProcesses/volumetricLightScatteringPostProcess.js +15 -16
  151. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  152. package/Rendering/depthRenderer.js +13 -15
  153. package/Rendering/depthRenderer.js.map +1 -1
  154. package/Rendering/geometryBufferRenderer.js +13 -15
  155. package/Rendering/geometryBufferRenderer.js.map +1 -1
  156. package/Rendering/objectRenderer.d.ts +9 -2
  157. package/Rendering/objectRenderer.js +44 -7
  158. package/Rendering/objectRenderer.js.map +1 -1
  159. package/Rendering/outlineRenderer.js +13 -15
  160. package/Rendering/outlineRenderer.js.map +1 -1
  161. package/Shaders/ShadersInclude/morphTargetsVertex.js +16 -4
  162. package/Shaders/ShadersInclude/morphTargetsVertex.js.map +1 -1
  163. package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js +17 -5
  164. package/ShadersWGSL/ShadersInclude/morphTargetsVertex.js.map +1 -1
  165. package/assetContainer.d.ts +43 -0
  166. package/assetContainer.js +67 -0
  167. package/assetContainer.js.map +1 -1
  168. package/package.json +1 -1
  169. package/scene.js +10 -3
  170. package/scene.js.map +1 -1
@@ -1 +1 @@
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,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D;;;GAGG;AACH,MAAM,CAAN,IAAkB,2BAGjB;AAHD,WAAkB,2BAA2B;IACzC,yGAAsB,CAAA;IACtB,uGAAqB,CAAA;AACzB,CAAC,EAHiB,2BAA2B,KAA3B,2BAA2B,QAG5C;AAED;;;;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IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;QACxF,CAAC;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 { AbstractEngine } from \"../../Engines/abstractEngine\";\r\nimport type { FloatArray, IndicesArray } from \"../../types\";\r\nimport { GreasedLineTools } from \"../../Misc/greasedLineTools\";\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 const 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 const 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_FACE_TO 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 and a direction (face-to) vector specified in direction. The resulting line will face to the direction of this face-to vector.\r\n * AUTO_DIRECTIONS_NONE you have to set the direction (slope) manually. Recommended.\r\n */\r\nexport const 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_FACE_TO = 3,\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 converting the points to the internal number[][] format used by GreasedLine\r\n */\r\nexport interface GreasedLinePointsOptions {\r\n /**\r\n * If defined and a Float32Array is used for the points parameter,\r\n * it will create multiple disconnected lines.\r\n * This parameter defines how many entries from the array to use for one line.\r\n * One entry = 3 float values.\r\n */\r\n floatArrayStride?: number;\r\n}\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 segment (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?: FloatArray;\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 * Options for converting the points.\r\n */\r\n pointsOptions?: GreasedLinePointsOptions;\r\n}\r\n\r\n/**\r\n * GreasedLineBaseMesh\r\n */\r\nexport abstract class GreasedLineBaseMesh extends Mesh {\r\n protected _vertexPositions: FloatArray;\r\n protected _indices: IndicesArray;\r\n protected _uvs: FloatArray;\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: AbstractEngine;\r\n\r\n constructor(\r\n public override 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 override 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.doNotSyncBoundingInfo && 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 override dispose(doNotRecurse?: boolean, disposeMaterialAndTextures = false) {\r\n super.dispose(doNotRecurse, disposeMaterialAndTextures);\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 * Returns the UVs\r\n */\r\n get uvs() {\r\n return this._uvs;\r\n }\r\n\r\n /**\r\n * Sets the UVs\r\n * @param uvs the UVs\r\n */\r\n set uvs(uvs: FloatArray) {\r\n this._uvs = uvs instanceof Float32Array ? uvs : new Float32Array(uvs);\r\n this._createVertexBuffers();\r\n }\r\n\r\n /**\r\n * Returns the points offsets\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: GreasedLinePoints, options?: GreasedLineMeshOptions) {\r\n this._points = GreasedLineTools.ConvertPoints(points, options?.pointsOptions ?? this._options.pointsOptions);\r\n this._updateWidths();\r\n if (!options?.colorPointers) {\r\n this._updateColorPointers();\r\n }\r\n this._setPoints(this._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 override 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,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D;;;GAGG;AACH,MAAM,CAAN,IAAkB,2BAGjB;AAHD,WAAkB,2BAA2B;IACzC,yGAAsB,CAAA;IACtB,uGAAqB,CAAA;AACzB,CAAC,EAHiB,2BAA2B,KAA3B,2BAA2B,QAG5C;AAED;;;;GAIG;AACH,MAAM,CAAN,IAAkB,0BAIjB;AAJD,WAAkB,0BAA0B;IACxC,iHAA2B,CAAA;IAC3B,yJAA+C,CAAA;IAC/C,iHAA2B,CAAA;AAC/B,CAAC,EAJiB,0BAA0B,KAA1B,0BAA0B,QAI3C;AAED;;;;;;;GAOG;AACH,MAAM,CAAN,IAAkB,kCAMjB;AAND,WAAkB,kCAAkC;IAChD,uJAAsC,CAAA;IACtC,qJAAqC,CAAA;IACrC,mIAA4B,CAAA;IAC5B,iIAA2B,CAAA;IAC3B,4HAAyB,CAAA;AAC7B,CAAC,EANiB,kCAAkC,KAAlC,kCAAkC,QAMnD;AAuGD;;GAEG;AACH,MAAM,OAAgB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AAC,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 { AbstractEngine } from \"../../Engines/abstractEngine\";\r\nimport type { FloatArray, IndicesArray } from \"../../types\";\r\nimport { GreasedLineTools } from \"../../Misc/greasedLineTools\";\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 const 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 const 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_FACE_TO 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 and a direction (face-to) vector specified in direction. The resulting line will face to the direction of this face-to vector.\r\n * AUTO_DIRECTIONS_NONE you have to set the direction (slope) manually. Recommended.\r\n */\r\nexport const 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_FACE_TO = 3,\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 converting the points to the internal number[][] format used by GreasedLine\r\n */\r\nexport interface GreasedLinePointsOptions {\r\n /**\r\n * If defined and a Float32Array is used for the points parameter,\r\n * it will create multiple disconnected lines.\r\n * This parameter defines how many entries from the array to use for one line.\r\n * One entry = 3 float values.\r\n */\r\n floatArrayStride?: number;\r\n}\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 segment (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?: FloatArray;\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 * Options for converting the points.\r\n */\r\n pointsOptions?: GreasedLinePointsOptions;\r\n}\r\n\r\n/**\r\n * GreasedLineBaseMesh\r\n */\r\nexport abstract class GreasedLineBaseMesh extends Mesh {\r\n protected _vertexPositions: FloatArray;\r\n protected _indices: IndicesArray;\r\n protected _uvs: FloatArray;\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: AbstractEngine;\r\n\r\n constructor(\r\n public override 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 override 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._createOffsetsBuffer(this._offsets || []);\r\n !this.doNotSyncBoundingInfo && 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 override dispose(doNotRecurse?: boolean, disposeMaterialAndTextures = false) {\r\n super.dispose(doNotRecurse, disposeMaterialAndTextures);\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 * Returns the UVs\r\n */\r\n get uvs() {\r\n return this._uvs;\r\n }\r\n\r\n /**\r\n * Sets the UVs\r\n * @param uvs the UVs\r\n */\r\n set uvs(uvs: FloatArray) {\r\n this._uvs = uvs instanceof Float32Array ? uvs : new Float32Array(uvs);\r\n this._createVertexBuffers();\r\n }\r\n\r\n /**\r\n * Returns the points offsets\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: GreasedLinePoints, options?: GreasedLineMeshOptions) {\r\n this._points = GreasedLineTools.ConvertPoints(points, options?.pointsOptions ?? this._options.pointsOptions);\r\n this._updateWidths();\r\n if (!options?.colorPointers) {\r\n this._updateColorPointers();\r\n }\r\n this._setPoints(this._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 override 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"]}
@@ -111,8 +111,7 @@ declare class _InternalAbstractMeshDataInfo {
111
111
  _isActiveIntermediate: boolean;
112
112
  _onlyForInstancesIntermediate: boolean;
113
113
  _actAsRegularMesh: boolean;
114
- _currentLOD: Nullable<AbstractMesh>;
115
- _currentLODIsUpToDate: boolean;
114
+ _currentLOD: Map<Camera, [Nullable<AbstractMesh>, number]>;
116
115
  _collisionRetryCount: number;
117
116
  _morphTargetManager: Nullable<MorphTargetManager>;
118
117
  _renderingGroupId: number;
@@ -124,8 +124,7 @@ class _InternalAbstractMeshDataInfo {
124
124
  this._isActiveIntermediate = false;
125
125
  this._onlyForInstancesIntermediate = false;
126
126
  this._actAsRegularMesh = false;
127
- this._currentLOD = null;
128
- this._currentLODIsUpToDate = false;
127
+ this._currentLOD = new Map();
129
128
  this._collisionRetryCount = 3;
130
129
  this._morphTargetManager = null;
131
130
  this._renderingGroupId = 0;