@babylonjs/core 8.50.4 → 8.50.5

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 (232) hide show
  1. package/Cameras/geospatialCamera.js +1 -1
  2. package/Cameras/geospatialCamera.js.map +1 -1
  3. package/Engines/abstractEngine.js +2 -2
  4. package/Engines/abstractEngine.js.map +1 -1
  5. package/Meshes/Builders/capsuleBuilder.js +0 -3
  6. package/Meshes/Builders/capsuleBuilder.js.map +1 -1
  7. package/Meshes/Builders/cylinderBuilder.d.ts +1 -1
  8. package/Meshes/Builders/cylinderBuilder.js +1 -2
  9. package/Meshes/Builders/cylinderBuilder.js.map +1 -1
  10. package/Meshes/Builders/decalBuilder.js +2 -0
  11. package/Meshes/Builders/decalBuilder.js.map +1 -1
  12. package/Meshes/Builders/discBuilder.js +0 -1
  13. package/Meshes/Builders/discBuilder.js.map +1 -1
  14. package/Meshes/Builders/groundBuilder.d.ts +50 -54
  15. package/Meshes/Builders/groundBuilder.js +50 -54
  16. package/Meshes/Builders/groundBuilder.js.map +1 -1
  17. package/Meshes/Builders/tiledBoxBuilder.d.ts +0 -26
  18. package/Meshes/Builders/tiledBoxBuilder.js +0 -26
  19. package/Meshes/Builders/tiledBoxBuilder.js.map +1 -1
  20. package/Meshes/Builders/tiledPlaneBuilder.d.ts +0 -25
  21. package/Meshes/Builders/tiledPlaneBuilder.js +0 -25
  22. package/Meshes/Builders/tiledPlaneBuilder.js.map +1 -1
  23. package/Meshes/Builders/torusBuilder.d.ts +0 -13
  24. package/Meshes/Builders/torusBuilder.js +0 -13
  25. package/Meshes/Builders/torusBuilder.js.map +1 -1
  26. package/Meshes/Builders/torusKnotBuilder.d.ts +0 -19
  27. package/Meshes/Builders/torusKnotBuilder.js +0 -19
  28. package/Meshes/Builders/torusKnotBuilder.js.map +1 -1
  29. package/Meshes/Builders/tubeBuilder.d.ts +0 -12
  30. package/Meshes/Builders/tubeBuilder.js +0 -12
  31. package/Meshes/Builders/tubeBuilder.js.map +1 -1
  32. package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
  33. package/Meshes/Compression/dracoDecoder.js.map +1 -1
  34. package/Meshes/Compression/dracoDecoder.types.d.ts +11 -0
  35. package/Meshes/Compression/dracoDecoder.types.js.map +1 -1
  36. package/Meshes/Compression/dracoEncoder.js.map +1 -1
  37. package/Meshes/Compression/meshoptCompression.js +0 -2
  38. package/Meshes/Compression/meshoptCompression.js.map +1 -1
  39. package/Meshes/GreasedLine/greasedLineRibbonMesh.js +0 -8
  40. package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
  41. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.d.ts +1 -0
  42. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js +1 -0
  43. package/Meshes/Node/Blocks/Instances/instantiateBaseBlock.js.map +1 -1
  44. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.d.ts +1 -0
  45. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js +1 -0
  46. package/Meshes/Node/Blocks/Instances/instantiateOnFacesBlock.js.map +1 -1
  47. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.d.ts +1 -0
  48. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js +1 -0
  49. package/Meshes/Node/Blocks/Instances/instantiateOnVerticesBlock.js.map +1 -1
  50. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.d.ts +1 -0
  51. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js +1 -0
  52. package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.js.map +1 -1
  53. package/Meshes/Node/Blocks/Matrices/scalingBlock.d.ts +1 -0
  54. package/Meshes/Node/Blocks/Matrices/scalingBlock.js +1 -0
  55. package/Meshes/Node/Blocks/Matrices/scalingBlock.js.map +1 -1
  56. package/Meshes/Node/Blocks/Matrices/translationBlock.d.ts +1 -0
  57. package/Meshes/Node/Blocks/Matrices/translationBlock.js +1 -0
  58. package/Meshes/Node/Blocks/Matrices/translationBlock.js.map +1 -1
  59. package/Meshes/Node/Blocks/Set/aggregatorBlock.d.ts +1 -0
  60. package/Meshes/Node/Blocks/Set/aggregatorBlock.js +1 -0
  61. package/Meshes/Node/Blocks/Set/aggregatorBlock.js.map +1 -1
  62. package/Meshes/Node/Blocks/Set/latticeBlock.d.ts +1 -0
  63. package/Meshes/Node/Blocks/Set/latticeBlock.js +1 -0
  64. package/Meshes/Node/Blocks/Set/latticeBlock.js.map +1 -1
  65. package/Meshes/Node/Blocks/Set/setColorsBlock.d.ts +1 -0
  66. package/Meshes/Node/Blocks/Set/setColorsBlock.js +1 -0
  67. package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
  68. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.d.ts +1 -0
  69. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js +1 -0
  70. package/Meshes/Node/Blocks/Set/setMaterialIDBlock.js.map +1 -1
  71. package/Meshes/Node/Blocks/Set/setNormalsBlock.d.ts +1 -0
  72. package/Meshes/Node/Blocks/Set/setNormalsBlock.js +1 -0
  73. package/Meshes/Node/Blocks/Set/setNormalsBlock.js.map +1 -1
  74. package/Meshes/Node/Blocks/Set/setPositionsBlock.d.ts +1 -0
  75. package/Meshes/Node/Blocks/Set/setPositionsBlock.js +1 -0
  76. package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
  77. package/Meshes/Node/Blocks/Set/setTangentsBlock.d.ts +1 -0
  78. package/Meshes/Node/Blocks/Set/setTangentsBlock.js +1 -0
  79. package/Meshes/Node/Blocks/Set/setTangentsBlock.js.map +1 -1
  80. package/Meshes/Node/Blocks/Set/setUVsBlock.d.ts +1 -0
  81. package/Meshes/Node/Blocks/Set/setUVsBlock.js +1 -0
  82. package/Meshes/Node/Blocks/Set/setUVsBlock.js.map +1 -1
  83. package/Meshes/Node/Blocks/Sources/boxBlock.d.ts +2 -0
  84. package/Meshes/Node/Blocks/Sources/boxBlock.js +2 -0
  85. package/Meshes/Node/Blocks/Sources/boxBlock.js.map +1 -1
  86. package/Meshes/Node/Blocks/Sources/capsuleBlock.d.ts +2 -0
  87. package/Meshes/Node/Blocks/Sources/capsuleBlock.js +2 -0
  88. package/Meshes/Node/Blocks/Sources/capsuleBlock.js.map +1 -1
  89. package/Meshes/Node/Blocks/Sources/cylinderBlock.d.ts +2 -0
  90. package/Meshes/Node/Blocks/Sources/cylinderBlock.js +2 -0
  91. package/Meshes/Node/Blocks/Sources/cylinderBlock.js.map +1 -1
  92. package/Meshes/Node/Blocks/Sources/discBlock.d.ts +2 -0
  93. package/Meshes/Node/Blocks/Sources/discBlock.js +2 -0
  94. package/Meshes/Node/Blocks/Sources/discBlock.js.map +1 -1
  95. package/Meshes/Node/Blocks/Sources/gridBlock.d.ts +2 -0
  96. package/Meshes/Node/Blocks/Sources/gridBlock.js +2 -0
  97. package/Meshes/Node/Blocks/Sources/gridBlock.js.map +1 -1
  98. package/Meshes/Node/Blocks/Sources/icoSphereBlock.d.ts +2 -0
  99. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js +2 -0
  100. package/Meshes/Node/Blocks/Sources/icoSphereBlock.js.map +1 -1
  101. package/Meshes/Node/Blocks/Sources/meshBlock.d.ts +1 -0
  102. package/Meshes/Node/Blocks/Sources/meshBlock.js +1 -0
  103. package/Meshes/Node/Blocks/Sources/meshBlock.js.map +1 -1
  104. package/Meshes/Node/Blocks/Sources/planeBlock.d.ts +2 -0
  105. package/Meshes/Node/Blocks/Sources/planeBlock.js +2 -0
  106. package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
  107. package/Meshes/Node/Blocks/Sources/pointListBlock.d.ts +2 -1
  108. package/Meshes/Node/Blocks/Sources/pointListBlock.js +2 -1
  109. package/Meshes/Node/Blocks/Sources/pointListBlock.js.map +1 -1
  110. package/Meshes/Node/Blocks/Sources/sphereBlock.d.ts +2 -0
  111. package/Meshes/Node/Blocks/Sources/sphereBlock.js +2 -0
  112. package/Meshes/Node/Blocks/Sources/sphereBlock.js.map +1 -1
  113. package/Meshes/Node/Blocks/Sources/torusBlock.d.ts +2 -0
  114. package/Meshes/Node/Blocks/Sources/torusBlock.js +2 -0
  115. package/Meshes/Node/Blocks/Sources/torusBlock.js.map +1 -1
  116. package/Meshes/Node/Blocks/Teleport/teleportInBlock.d.ts +1 -0
  117. package/Meshes/Node/Blocks/Teleport/teleportInBlock.js +1 -0
  118. package/Meshes/Node/Blocks/Teleport/teleportInBlock.js.map +1 -1
  119. package/Meshes/Node/Blocks/Teleport/teleportOutBlock.d.ts +3 -0
  120. package/Meshes/Node/Blocks/Teleport/teleportOutBlock.js +3 -0
  121. package/Meshes/Node/Blocks/Teleport/teleportOutBlock.js.map +1 -1
  122. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.d.ts +1 -0
  123. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js +1 -1
  124. package/Meshes/Node/Blocks/Textures/geometryTextureBlock.js.map +1 -1
  125. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.d.ts +1 -0
  126. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js +1 -0
  127. package/Meshes/Node/Blocks/Textures/geometryTextureFetchBlock.js.map +1 -1
  128. package/Meshes/Node/Blocks/booleanGeometryBlock.d.ts +1 -0
  129. package/Meshes/Node/Blocks/booleanGeometryBlock.js +1 -1
  130. package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
  131. package/Meshes/Node/Blocks/cleanGeometryBlock.d.ts +1 -0
  132. package/Meshes/Node/Blocks/cleanGeometryBlock.js +1 -0
  133. package/Meshes/Node/Blocks/cleanGeometryBlock.js.map +1 -1
  134. package/Meshes/Node/Blocks/conditionBlock.d.ts +2 -0
  135. package/Meshes/Node/Blocks/conditionBlock.js +2 -0
  136. package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
  137. package/Meshes/Node/Blocks/geometryClampBlock.d.ts +1 -0
  138. package/Meshes/Node/Blocks/geometryClampBlock.js +1 -0
  139. package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
  140. package/Meshes/Node/Blocks/geometryCollectionBlock.d.ts +1 -0
  141. package/Meshes/Node/Blocks/geometryCollectionBlock.js +1 -0
  142. package/Meshes/Node/Blocks/geometryCollectionBlock.js.map +1 -1
  143. package/Meshes/Node/Blocks/geometryCurveBlock.d.ts +2 -0
  144. package/Meshes/Node/Blocks/geometryCurveBlock.js +2 -0
  145. package/Meshes/Node/Blocks/geometryCurveBlock.js.map +1 -1
  146. package/Meshes/Node/Blocks/geometryEaseBlock.d.ts +2 -0
  147. package/Meshes/Node/Blocks/geometryEaseBlock.js +2 -0
  148. package/Meshes/Node/Blocks/geometryEaseBlock.js.map +1 -1
  149. package/Meshes/Node/Blocks/geometryInputBlock.d.ts +3 -0
  150. package/Meshes/Node/Blocks/geometryInputBlock.js +3 -0
  151. package/Meshes/Node/Blocks/geometryInputBlock.js.map +1 -1
  152. package/Meshes/Node/Blocks/geometryOptimizeBlock.d.ts +1 -0
  153. package/Meshes/Node/Blocks/geometryOptimizeBlock.js +1 -0
  154. package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
  155. package/Meshes/Node/Blocks/geometryTransformBlock.d.ts +1 -0
  156. package/Meshes/Node/Blocks/geometryTransformBlock.js +1 -0
  157. package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
  158. package/Meshes/Node/Blocks/geometryTrigonometryBlock.d.ts +2 -0
  159. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js +2 -0
  160. package/Meshes/Node/Blocks/geometryTrigonometryBlock.js.map +1 -1
  161. package/Meshes/Node/Blocks/mappingBlock.d.ts +1 -0
  162. package/Meshes/Node/Blocks/mappingBlock.js +1 -0
  163. package/Meshes/Node/Blocks/mappingBlock.js.map +1 -1
  164. package/Meshes/Node/Blocks/mathBlock.d.ts +1 -0
  165. package/Meshes/Node/Blocks/mathBlock.js +1 -0
  166. package/Meshes/Node/Blocks/mathBlock.js.map +1 -1
  167. package/Meshes/Node/Blocks/mergeGeometryBlock.d.ts +1 -0
  168. package/Meshes/Node/Blocks/mergeGeometryBlock.js +1 -0
  169. package/Meshes/Node/Blocks/mergeGeometryBlock.js.map +1 -1
  170. package/Meshes/Node/Blocks/randomBlock.d.ts +2 -0
  171. package/Meshes/Node/Blocks/randomBlock.js +2 -0
  172. package/Meshes/Node/Blocks/randomBlock.js.map +1 -1
  173. package/Meshes/Node/Blocks/subdivideBlock.d.ts +1 -0
  174. package/Meshes/Node/Blocks/subdivideBlock.js +1 -0
  175. package/Meshes/Node/Blocks/subdivideBlock.js.map +1 -1
  176. package/Meshes/Node/Interfaces/nodeGeometryTextureData.d.ts +3 -0
  177. package/Meshes/Node/Interfaces/nodeGeometryTextureData.js.map +1 -1
  178. package/Meshes/Node/nodeGeometry.js +0 -2
  179. package/Meshes/Node/nodeGeometry.js.map +1 -1
  180. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +0 -1
  181. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
  182. package/Meshes/Node/nodeGeometryBuildState.js +0 -1
  183. package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
  184. package/Meshes/WebGL/webGLDataBuffer.d.ts +2 -0
  185. package/Meshes/WebGL/webGLDataBuffer.js +2 -0
  186. package/Meshes/WebGL/webGLDataBuffer.js.map +1 -1
  187. package/Meshes/WebGPU/webgpuDataBuffer.d.ts +4 -0
  188. package/Meshes/WebGPU/webgpuDataBuffer.js +4 -0
  189. package/Meshes/WebGPU/webgpuDataBuffer.js.map +1 -1
  190. package/Meshes/abstractMesh.d.ts +1 -0
  191. package/Meshes/abstractMesh.decalMap.d.ts +1 -0
  192. package/Meshes/abstractMesh.decalMap.js.map +1 -1
  193. package/Meshes/abstractMesh.js +1 -6
  194. package/Meshes/abstractMesh.js.map +1 -1
  195. package/Meshes/csg.js +0 -6
  196. package/Meshes/csg.js.map +1 -1
  197. package/Meshes/csg2.js +1 -2
  198. package/Meshes/csg2.js.map +1 -1
  199. package/Meshes/geodesicMesh.d.ts +26 -0
  200. package/Meshes/geodesicMesh.js +18 -3
  201. package/Meshes/geodesicMesh.js.map +1 -1
  202. package/Meshes/groundMesh.d.ts +1 -0
  203. package/Meshes/groundMesh.js +1 -0
  204. package/Meshes/groundMesh.js.map +1 -1
  205. package/Meshes/index.js +0 -2
  206. package/Meshes/index.js.map +1 -1
  207. package/Meshes/instancedMesh.d.ts +18 -3
  208. package/Meshes/instancedMesh.js +10 -3
  209. package/Meshes/instancedMesh.js.map +1 -1
  210. package/Meshes/mesh.d.ts +286 -204
  211. package/Meshes/mesh.js +251 -197
  212. package/Meshes/mesh.js.map +1 -1
  213. package/Meshes/mesh.vertexData.d.ts +15 -19
  214. package/Meshes/mesh.vertexData.js +15 -19
  215. package/Meshes/mesh.vertexData.js.map +1 -1
  216. package/Meshes/meshSimplification.d.ts +0 -1
  217. package/Meshes/meshSimplification.js +6 -1
  218. package/Meshes/meshSimplification.js.map +1 -1
  219. package/Meshes/meshSimplificationSceneComponent.d.ts +2 -0
  220. package/Meshes/meshSimplificationSceneComponent.js.map +1 -1
  221. package/Meshes/meshUVSpaceRenderer.d.ts +1 -0
  222. package/Meshes/meshUVSpaceRenderer.js.map +1 -1
  223. package/Meshes/polygonMesh.js +4 -0
  224. package/Meshes/polygonMesh.js.map +1 -1
  225. package/Meshes/subMesh.project.d.ts +1 -0
  226. package/Meshes/subMesh.project.js.map +1 -1
  227. package/Meshes/thinInstanceMesh.d.ts +5 -0
  228. package/Meshes/thinInstanceMesh.js.map +1 -1
  229. package/Meshes/transformNode.d.ts +1 -1
  230. package/Meshes/transformNode.js +1 -1
  231. package/Meshes/transformNode.js.map +1 -1
  232. package/package.json +1 -1
@@ -10,11 +10,11 @@ import { useOpenGLOrientationForUV } from "../../Compat/compatibilityOptions.js"
10
10
  /**
11
11
  * Creates the VertexData for a Ground
12
12
  * @param options an object used to set the following optional parameters for the Ground, required but can be empty
13
- * @param options.width the width (x direction) of the ground, optional, default 1
14
- * @param options.height the height (z direction) of the ground, optional, default 1
15
- * @param options.subdivisions the number of subdivisions per side, optional, default 1
16
- * @param options.subdivisionsX the number of subdivisions in the x direction, overrides options.subdivisions, optional, default undefined
17
- * @param options.subdivisionsY the number of subdivisions in the y direction, overrides options.subdivisions, optional, default undefined
13
+ * - `width` the width (x direction) of the ground, optional, default 1
14
+ * - `height` the height (z direction) of the ground, optional, default 1
15
+ * - `subdivisions` the number of subdivisions per side, optional, default 1
16
+ * - `subdivisionsX` the number of subdivisions in the x direction, overrides options.subdivisions, optional, default undefined
17
+ * - `subdivisionsY` the number of subdivisions in the y direction, overrides options.subdivisions, optional, default undefined
18
18
  * @returns the VertexData of the Ground
19
19
  */
20
20
  export function CreateGroundVertexData(options) {
@@ -57,16 +57,12 @@ export function CreateGroundVertexData(options) {
57
57
  /**
58
58
  * Creates the VertexData for a TiledGround by subdividing the ground into tiles
59
59
  * @param options an object used to set the following optional parameters for the Ground
60
- * @param options.xmin ground minimum X coordinate, default -1
61
- * @param options.zmin ground minimum Z coordinate, default -1
62
- * @param options.xmax ground maximum X coordinate, default 1
63
- * @param options.zmax ground maximum Z coordinate, default 1
64
- * @param options.subdivisions a javascript object {w: positive integer, h: positive integer}, `w` and `h` are the numbers of subdivisions on the ground width and height creating 'tiles', default {w: 6, h: 6}
65
- * @param options.subdivisions.w positive integer, default 6
66
- * @param options.subdivisions.h positive integer, default 6
67
- * @param options.precision a javascript object {w: positive integer, h: positive integer}, `w` and `h` are the numbers of subdivisions on the tile width and height, default {w: 2, h: 2}
68
- * @param options.precision.w positive integer, default 2
69
- * @param options.precision.h positive integer, default 2
60
+ * - `xmin` ground minimum X coordinate, default -1
61
+ * - `zmin` ground minimum Z coordinate, default -1
62
+ * - `xmax` ground maximum X coordinate, default 1
63
+ * - `zmax` ground maximum Z coordinate, default 1
64
+ * - `subdivisions` a javascript object `\{w: positive integer, h: positive integer\}`, `w` and `h` are the numbers of subdivisions on the ground width and height creating 'tiles', default `\{w: 6, h: 6\}`
65
+ * - `precision` a javascript object `\{w: positive integer, h: positive integer\}`, `w` and `h` are the numbers of subdivisions on the tile width and height, default `\{w: 2, h: 2\}`
70
66
  * @returns the VertexData of the TiledGround
71
67
  */
72
68
  export function CreateTiledGroundVertexData(options) {
@@ -134,17 +130,17 @@ export function CreateTiledGroundVertexData(options) {
134
130
  /**
135
131
  * Creates the VertexData of the Ground designed from a heightmap
136
132
  * @param options an object used to set the following parameters for the Ground, required and provided by CreateGroundFromHeightMap
137
- * @param options.width the width (x direction) of the ground
138
- * @param options.height the height (z direction) of the ground
139
- * @param options.subdivisions the number of subdivisions per side
140
- * @param options.minHeight the minimum altitude on the ground, optional, default 0
141
- * @param options.maxHeight the maximum altitude on the ground, optional default 1
142
- * @param options.colorFilter the filter to apply to the image pixel colors to compute the height, optional Color3, default (0.3, 0.59, 0.11)
143
- * @param options.buffer the array holding the image color data
144
- * @param options.bufferWidth the width of image
145
- * @param options.bufferHeight the height of image
146
- * @param options.alphaFilter Remove any data where the alpha channel is below this value, defaults 0 (all data visible)
147
- * @param options.heightBuffer a array of floats where the height data can be saved, if its length is greater than zero.
133
+ * - `width` the width (x direction) of the ground
134
+ * - `height` the height (z direction) of the ground
135
+ * - `subdivisions` the number of subdivisions per side
136
+ * - `minHeight` the minimum altitude on the ground, optional, default 0
137
+ * - `maxHeight` the maximum altitude on the ground, optional default 1
138
+ * - `colorFilter` the filter to apply to the image pixel colors to compute the height, optional Color3, default (0.3, 0.59, 0.11)
139
+ * - `buffer` the array holding the image color data
140
+ * - `bufferWidth` the width of image
141
+ * - `bufferHeight` the height of image
142
+ * - `alphaFilter` Remove any data where the alpha channel is below this value, defaults 0 (all data visible)
143
+ * - `heightBuffer` a array of floats where the height data can be saved, if its length is greater than zero.
148
144
  * @returns the VertexData of the Ground designed from a heightmap
149
145
  */
150
146
  export function CreateGroundFromHeightMapVertexData(options) {
@@ -239,12 +235,12 @@ export function CreateGroundFromHeightMapVertexData(options) {
239
235
  * Creates a ground mesh
240
236
  * @param name defines the name of the mesh
241
237
  * @param options defines the options used to create the mesh
242
- * @param options.width set the width size (float, default 1)
243
- * @param options.height set the height size (float, default 1)
244
- * @param options.subdivisions sets the number of subdivision per side (default 1)
245
- * @param options.subdivisionsX sets the number of subdivision on the X axis (overrides subdivisions)
246
- * @param options.subdivisionsY sets the number of subdivision on the Y axis (overrides subdivisions)
247
- * @param options.updatable defines if the mesh must be flagged as updatable (default false)
238
+ * - `width` set the width size (float, default 1)
239
+ * - `height` set the height size (float, default 1)
240
+ * - `subdivisions` sets the number of subdivision per side (default 1)
241
+ * - `subdivisionsX` sets the number of subdivision on the X axis (overrides subdivisions)
242
+ * - `subdivisionsY` sets the number of subdivision on the Y axis (overrides subdivisions)
243
+ * - `updatable` defines if the mesh must be flagged as updatable (default false)
248
244
  * @param scene defines the hosting scene
249
245
  * @returns the ground mesh
250
246
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#ground
@@ -269,17 +265,17 @@ export function CreateGround(name, options = {}, scene) {
269
265
  * Creates a tiled ground mesh
270
266
  * @param name defines the name of the mesh
271
267
  * @param options defines the options used to create the mesh
272
- * @param options.xmin ground minimum X coordinate (float, default -1)
273
- * @param options.zmin ground minimum Z coordinate (float, default -1)
274
- * @param options.xmax ground maximum X coordinate (float, default 1)
275
- * @param options.zmax ground maximum Z coordinate (float, default 1)
276
- * @param options.subdivisions a javascript object `{w: positive integer, h: positive integer}` (default `{w: 6, h: 6}`). `w` and `h` are the numbers of subdivisions on the ground width and height. Each subdivision is called a tile
277
- * @param options.subdivisions.w positive integer, default 6
278
- * @param options.subdivisions.h positive integer, default 6
279
- * @param options.precision a javascript object `{w: positive integer, h: positive integer}` (default `{w: 2, h: 2}`). `w` and `h` are the numbers of subdivisions on the ground width and height of each tile
280
- * @param options.precision.w positive integer, default 2
281
- * @param options.precision.h positive integer, default 2
282
- * @param options.updatable boolean, default false, true if the mesh must be flagged as updatable
268
+ * - `xmin` ground minimum X coordinate (float, default -1)
269
+ * - `zmin` ground minimum Z coordinate (float, default -1)
270
+ * - `xmax` ground maximum X coordinate (float, default 1)
271
+ * - `zmax` ground maximum Z coordinate (float, default 1)
272
+ * - `subdivisions` a javascript object `{w: positive integer, h: positive integer}` (default `{w: 6, h: 6}`). `w` and `h` are the numbers of subdivisions on the ground width and height. Each subdivision is called a tile
273
+ * - `subdivisions.w` positive integer, default 6
274
+ * - `subdivisions.h` positive integer, default 6
275
+ * - `precision` a javascript object `{w: positive integer, h: positive integer}` (default `{w: 2, h: 2}`). `w` and `h` are the numbers of subdivisions on the ground width and height of each tile
276
+ * - `precision.w` positive integer, default 2
277
+ * - `precision.h` positive integer, default 2
278
+ * - `updatable` boolean, default false, true if the mesh must be flagged as updatable
283
279
  * @param scene defines the hosting scene
284
280
  * @returns the tiled ground mesh
285
281
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#tiled-ground
@@ -297,17 +293,17 @@ export function CreateTiledGround(name, options, scene = null) {
297
293
  * @param name defines the name of the mesh
298
294
  * @param url sets the URL of the height map image resource.
299
295
  * @param options defines the options used to create the mesh
300
- * @param options.width sets the ground width size (positive float, default 10)
301
- * @param options.height sets the ground height size (positive float, default 10)
302
- * @param options.subdivisions sets the number of subdivision per side (positive integer, default 1)
303
- * @param options.minHeight is the minimum altitude on the ground (float, default 0)
304
- * @param options.maxHeight is the maximum altitude on the ground (float, default 1)
305
- * @param options.colorFilter is the filter to apply to the image pixel colors to compute the height (optional Color3, default (0.3, 0.59, 0.11) )
306
- * @param options.alphaFilter will filter any data where the alpha channel is below this value, defaults 0 (all data visible)
307
- * @param options.updatable defines if the mesh must be flagged as updatable
308
- * @param options.onReady is a javascript callback function that will be called once the mesh is just built (the height map download can last some time)
309
- * @param options.onError is a javascript callback function that will be called if there is an error
310
- * @param options.passHeightBufferInCallback a boolean that indicates if the calculated height data will be passed in the onReady callback. Useful if you need the height data for physics, for example.
296
+ * - `width` sets the ground width size (positive float, default 10)
297
+ * - `height` sets the ground height size (positive float, default 10)
298
+ * - `subdivisions` sets the number of subdivision per side (positive integer, default 1)
299
+ * - `minHeight` is the minimum altitude on the ground (float, default 0)
300
+ * - `maxHeight` is the maximum altitude on the ground (float, default 1)
301
+ * - `colorFilter` is the filter to apply to the image pixel colors to compute the height (optional Color3, default (0.3, 0.59, 0.11) )
302
+ * - `alphaFilter` will filter any data where the alpha channel is below this value, defaults 0 (all data visible)
303
+ * - `updatable` defines if the mesh must be flagged as updatable
304
+ * - `onReady` is a javascript callback function that will be called once the mesh is just built (the height map download can last some time)
305
+ * - `onError` is a javascript callback function that will be called if there is an error
306
+ * - `passHeightBufferInCallback` a boolean that indicates if the calculated height data will be passed in the onReady callback. Useful if you need the height data for physics, for example.
311
307
  * @param scene defines the hosting scene
312
308
  * @returns the ground mesh
313
309
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/height_map
@@ -1 +1 @@
1
- {"version":3,"file":"groundBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/groundBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E;;;;;;;;;GASG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAOtC;IACG,MAAM,OAAO,GAAG,EAAE,CAAC;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,SAAS;KACZ,CAAC;IAEF,OAAO,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF,IAAI,CAAC,iBAAiB,GAAG,CACrB,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,YAAsC,EACtC,SAAmC,EACnC,KAAY,EACZ,SAAmB,EACf,EAAE;IACN,MAAM,OAAO,GAAG;QACZ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,YAAY;QACZ,SAAS;QACT,SAAS;KACZ,CAAC;IAEF,OAAO,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACnD,CAAC,CAAC;AAEF,IAAI,CAAC,yBAAyB,GAAG,CAC7B,IAAY,EACZ,GAAW,EACX,KAAa,EACb,MAAc,EACd,YAAoB,EACpB,SAAiB,EACjB,SAAiB,EACjB,KAAY,EACZ,SAAmB,EACnB,OAAoC,EACpC,WAAoB,EACV,EAAE;IACZ,MAAM,OAAO,GAAG;QACZ,KAAK;QACL,MAAM;QACN,YAAY;QACZ,SAAS;QACT,SAAS;QACT,SAAS;QACT,OAAO;QACP,WAAW;KACd,CAAC;IAEF,OAAO,yBAAyB,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAChE,CAAC,CAAC","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport { Color3 } from \"../../Maths/math.color\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { GroundMesh } from \"../groundMesh\";\r\nimport { Tools } from \"../../Misc/tools\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\nimport { Epsilon } from \"../../Maths/math.constants\";\r\nimport { useOpenGLOrientationForUV } from \"../../Compat/compatibilityOptions\";\r\n\r\n/**\r\n * Creates the VertexData for a Ground\r\n * @param options an object used to set the following optional parameters for the Ground, required but can be empty\r\n * @param options.width the width (x direction) of the ground, optional, default 1\r\n * @param options.height the height (z direction) of the ground, optional, default 1\r\n * @param options.subdivisions the number of subdivisions per side, optional, default 1\r\n * @param options.subdivisionsX the number of subdivisions in the x direction, overrides options.subdivisions, optional, default undefined\r\n * @param options.subdivisionsY the number of subdivisions in the y direction, overrides options.subdivisions, optional, default undefined\r\n * @returns the VertexData of the Ground\r\n */\r\nexport function CreateGroundVertexData(options: {\r\n size?: number;\r\n width?: number;\r\n height?: number;\r\n subdivisions?: number;\r\n subdivisionsX?: number;\r\n subdivisionsY?: number;\r\n}): VertexData {\r\n const indices = [];\r\n const positions = [];\r\n const normals = [];\r\n const uvs = [];\r\n let row: number, col: number;\r\n\r\n const width: number = options.width || options.size || 1;\r\n const height: number = options.height || options.size || 1;\r\n const subdivisionsX: number = (options.subdivisionsX || options.subdivisions || 1) | 0;\r\n const subdivisionsY: number = (options.subdivisionsY || options.subdivisions || 1) | 0;\r\n\r\n for (row = 0; row <= subdivisionsY; row++) {\r\n for (col = 0; col <= subdivisionsX; col++) {\r\n const position = new Vector3((col * width) / subdivisionsX - width / 2.0, 0, ((subdivisionsY - row) * height) / subdivisionsY - height / 2.0);\r\n const normal = new Vector3(0, 1.0, 0);\r\n\r\n positions.push(position.x, position.y, position.z);\r\n normals.push(normal.x, normal.y, normal.z);\r\n uvs.push(col / subdivisionsX, useOpenGLOrientationForUV ? row / subdivisionsY : 1.0 - row / subdivisionsY);\r\n }\r\n }\r\n\r\n for (row = 0; row < subdivisionsY; row++) {\r\n for (col = 0; col < subdivisionsX; col++) {\r\n indices.push(col + 1 + (row + 1) * (subdivisionsX + 1));\r\n indices.push(col + 1 + row * (subdivisionsX + 1));\r\n indices.push(col + row * (subdivisionsX + 1));\r\n\r\n indices.push(col + (row + 1) * (subdivisionsX + 1));\r\n indices.push(col + 1 + (row + 1) * (subdivisionsX + 1));\r\n indices.push(col + row * (subdivisionsX + 1));\r\n }\r\n }\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates the VertexData for a TiledGround by subdividing the ground into tiles\r\n * @param options an object used to set the following optional parameters for the Ground\r\n * @param options.xmin ground minimum X coordinate, default -1\r\n * @param options.zmin ground minimum Z coordinate, default -1\r\n * @param options.xmax ground maximum X coordinate, default 1\r\n * @param options.zmax ground maximum Z coordinate, default 1\r\n * @param options.subdivisions a javascript object {w: positive integer, h: positive integer}, `w` and `h` are the numbers of subdivisions on the ground width and height creating 'tiles', default {w: 6, h: 6}\r\n * @param options.subdivisions.w positive integer, default 6\r\n * @param options.subdivisions.h positive integer, default 6\r\n * @param options.precision a javascript object {w: positive integer, h: positive integer}, `w` and `h` are the numbers of subdivisions on the tile width and height, default {w: 2, h: 2}\r\n * @param options.precision.w positive integer, default 2\r\n * @param options.precision.h positive integer, default 2\r\n * @returns the VertexData of the TiledGround\r\n */\r\nexport function CreateTiledGroundVertexData(options: {\r\n xmin: number;\r\n zmin: number;\r\n xmax: number;\r\n zmax: number;\r\n subdivisions?: { w: number; h: number };\r\n precision?: { w: number; h: number };\r\n}): VertexData {\r\n const xmin = options.xmin !== undefined && options.xmin !== null ? options.xmin : -1.0;\r\n const zmin = options.zmin !== undefined && options.zmin !== null ? options.zmin : -1.0;\r\n const xmax = options.xmax !== undefined && options.xmax !== null ? options.xmax : 1.0;\r\n const zmax = options.zmax !== undefined && options.zmax !== null ? options.zmax : 1.0;\r\n const subdivisions = options.subdivisions || { w: 1, h: 1 };\r\n const precision = options.precision || { w: 1, h: 1 };\r\n\r\n const indices: number[] = [];\r\n const positions: number[] = [];\r\n const normals: number[] = [];\r\n const uvs: number[] = [];\r\n let row: number, col: number, tileRow: number, tileCol: number;\r\n\r\n subdivisions.h = subdivisions.h < 1 ? 1 : subdivisions.h;\r\n subdivisions.w = subdivisions.w < 1 ? 1 : subdivisions.w;\r\n precision.w = precision.w < 1 ? 1 : precision.w;\r\n precision.h = precision.h < 1 ? 1 : precision.h;\r\n\r\n const tileSize = {\r\n w: (xmax - xmin) / subdivisions.w,\r\n h: (zmax - zmin) / subdivisions.h,\r\n };\r\n\r\n function applyTile(xTileMin: number, zTileMin: number, xTileMax: number, zTileMax: number) {\r\n // Indices\r\n const base = positions.length / 3;\r\n const rowLength = precision.w + 1;\r\n for (row = 0; row < precision.h; row++) {\r\n for (col = 0; col < precision.w; col++) {\r\n const square = [base + col + row * rowLength, base + (col + 1) + row * rowLength, base + (col + 1) + (row + 1) * rowLength, base + col + (row + 1) * rowLength];\r\n\r\n indices.push(square[1]);\r\n indices.push(square[2]);\r\n indices.push(square[3]);\r\n indices.push(square[0]);\r\n indices.push(square[1]);\r\n indices.push(square[3]);\r\n }\r\n }\r\n\r\n // Position, normals and uvs\r\n const position = Vector3.Zero();\r\n const normal = new Vector3(0, 1.0, 0);\r\n for (row = 0; row <= precision.h; row++) {\r\n position.z = (row * (zTileMax - zTileMin)) / precision.h + zTileMin;\r\n for (col = 0; col <= precision.w; col++) {\r\n position.x = (col * (xTileMax - xTileMin)) / precision.w + xTileMin;\r\n position.y = 0;\r\n\r\n positions.push(position.x, position.y, position.z);\r\n normals.push(normal.x, normal.y, normal.z);\r\n uvs.push(col / precision.w, row / precision.h);\r\n }\r\n }\r\n }\r\n\r\n for (tileRow = 0; tileRow < subdivisions.h; tileRow++) {\r\n for (tileCol = 0; tileCol < subdivisions.w; tileCol++) {\r\n applyTile(xmin + tileCol * tileSize.w, zmin + tileRow * tileSize.h, xmin + (tileCol + 1) * tileSize.w, zmin + (tileRow + 1) * tileSize.h);\r\n }\r\n }\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates the VertexData of the Ground designed from a heightmap\r\n * @param options an object used to set the following parameters for the Ground, required and provided by CreateGroundFromHeightMap\r\n * @param options.width the width (x direction) of the ground\r\n * @param options.height the height (z direction) of the ground\r\n * @param options.subdivisions the number of subdivisions per side\r\n * @param options.minHeight the minimum altitude on the ground, optional, default 0\r\n * @param options.maxHeight the maximum altitude on the ground, optional default 1\r\n * @param options.colorFilter the filter to apply to the image pixel colors to compute the height, optional Color3, default (0.3, 0.59, 0.11)\r\n * @param options.buffer the array holding the image color data\r\n * @param options.bufferWidth the width of image\r\n * @param options.bufferHeight the height of image\r\n * @param options.alphaFilter Remove any data where the alpha channel is below this value, defaults 0 (all data visible)\r\n * @param options.heightBuffer a array of floats where the height data can be saved, if its length is greater than zero.\r\n * @returns the VertexData of the Ground designed from a heightmap\r\n */\r\nexport function CreateGroundFromHeightMapVertexData(options: {\r\n width: number;\r\n height: number;\r\n subdivisions: number;\r\n minHeight: number;\r\n maxHeight: number;\r\n colorFilter: Color3;\r\n buffer: Uint8Array;\r\n bufferWidth: number;\r\n bufferHeight: number;\r\n alphaFilter: number;\r\n heightBuffer?: Float32Array;\r\n}): VertexData {\r\n const indices = [];\r\n const positions = [];\r\n const normals = [];\r\n const uvs = [];\r\n let row, col;\r\n const filter = options.colorFilter || new Color3(0.3, 0.59, 0.11);\r\n const alphaFilter = options.alphaFilter || 0.0;\r\n let invert = false;\r\n\r\n if (options.minHeight > options.maxHeight) {\r\n invert = true;\r\n const temp = options.maxHeight;\r\n options.maxHeight = options.minHeight;\r\n options.minHeight = temp;\r\n }\r\n\r\n // Vertices\r\n for (row = 0; row <= options.subdivisions; row++) {\r\n for (col = 0; col <= options.subdivisions; col++) {\r\n const position = new Vector3(\r\n (col * options.width) / options.subdivisions - options.width / 2.0,\r\n 0,\r\n ((options.subdivisions - row) * options.height) / options.subdivisions - options.height / 2.0\r\n );\r\n\r\n // Compute height\r\n const heightMapX = (((position.x + options.width / 2) / options.width) * (options.bufferWidth - 1)) | 0;\r\n const heightMapY = ((1.0 - (position.z + options.height / 2) / options.height) * (options.bufferHeight - 1)) | 0;\r\n const pos = (heightMapX + heightMapY * options.bufferWidth) * 4;\r\n let r = options.buffer[pos] / 255.0;\r\n let g = options.buffer[pos + 1] / 255.0;\r\n let b = options.buffer[pos + 2] / 255.0;\r\n const a = options.buffer[pos + 3] / 255.0;\r\n\r\n if (invert) {\r\n r = 1.0 - r;\r\n g = 1.0 - g;\r\n b = 1.0 - b;\r\n }\r\n\r\n const gradient = r * filter.r + g * filter.g + b * filter.b;\r\n\r\n // If our alpha channel is not within our filter then we will assign a 'special' height\r\n // Then when building the indices, we will ignore any vertex that is using the special height\r\n if (a >= alphaFilter) {\r\n position.y = options.minHeight + (options.maxHeight - options.minHeight) * gradient;\r\n } else {\r\n position.y = options.minHeight - Epsilon; // We can't have a height below minHeight, normally.\r\n }\r\n if (options.heightBuffer) {\r\n // set the height buffer information in row major order.\r\n options.heightBuffer[row * (options.subdivisions + 1) + col] = position.y;\r\n }\r\n\r\n // Add vertex\r\n positions.push(position.x, position.y, position.z);\r\n normals.push(0, 0, 0);\r\n uvs.push(col / options.subdivisions, 1.0 - row / options.subdivisions);\r\n }\r\n }\r\n\r\n // Indices\r\n for (row = 0; row < options.subdivisions; row++) {\r\n for (col = 0; col < options.subdivisions; col++) {\r\n // Calculate Indices\r\n const idx1 = col + 1 + (row + 1) * (options.subdivisions + 1);\r\n const idx2 = col + 1 + row * (options.subdivisions + 1);\r\n const idx3 = col + row * (options.subdivisions + 1);\r\n const idx4 = col + (row + 1) * (options.subdivisions + 1);\r\n\r\n // Check that all indices are visible (based on our special height)\r\n // Only display the vertex if all Indices are visible\r\n // Positions are stored x,y,z for each vertex, hence the * 3 and + 1 for height\r\n const isVisibleIdx1 = positions[idx1 * 3 + 1] >= options.minHeight;\r\n const isVisibleIdx2 = positions[idx2 * 3 + 1] >= options.minHeight;\r\n const isVisibleIdx3 = positions[idx3 * 3 + 1] >= options.minHeight;\r\n if (isVisibleIdx1 && isVisibleIdx2 && isVisibleIdx3) {\r\n indices.push(idx1);\r\n indices.push(idx2);\r\n indices.push(idx3);\r\n }\r\n\r\n const isVisibleIdx4 = positions[idx4 * 3 + 1] >= options.minHeight;\r\n if (isVisibleIdx4 && isVisibleIdx1 && isVisibleIdx3) {\r\n indices.push(idx4);\r\n indices.push(idx1);\r\n indices.push(idx3);\r\n }\r\n }\r\n }\r\n\r\n // Normals\r\n VertexData.ComputeNormals(positions, indices, normals);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a ground mesh\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param options.width set the width size (float, default 1)\r\n * @param options.height set the height size (float, default 1)\r\n * @param options.subdivisions sets the number of subdivision per side (default 1)\r\n * @param options.subdivisionsX sets the number of subdivision on the X axis (overrides subdivisions)\r\n * @param options.subdivisionsY sets the number of subdivision on the Y axis (overrides subdivisions)\r\n * @param options.updatable defines if the mesh must be flagged as updatable (default false)\r\n * @param scene defines the hosting scene\r\n * @returns the ground mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#ground\r\n */\r\nexport function CreateGround(\r\n name: string,\r\n options: { width?: number; height?: number; subdivisions?: number; subdivisionsX?: number; subdivisionsY?: number; updatable?: boolean } = {},\r\n scene?: Scene\r\n): GroundMesh {\r\n const ground = new GroundMesh(name, scene);\r\n ground._setReady(false);\r\n ground._subdivisionsX = options.subdivisionsX || options.subdivisions || 1;\r\n ground._subdivisionsY = options.subdivisionsY || options.subdivisions || 1;\r\n ground._width = options.width || 1;\r\n ground._height = options.height || 1;\r\n ground._maxX = ground._width / 2;\r\n ground._maxZ = ground._height / 2;\r\n ground._minX = -ground._maxX;\r\n ground._minZ = -ground._maxZ;\r\n\r\n const vertexData = CreateGroundVertexData(options);\r\n\r\n vertexData.applyToMesh(ground, options.updatable);\r\n\r\n ground._setReady(true);\r\n\r\n return ground;\r\n}\r\n\r\n/**\r\n * Creates a tiled ground mesh\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param options.xmin ground minimum X coordinate (float, default -1)\r\n * @param options.zmin ground minimum Z coordinate (float, default -1)\r\n * @param options.xmax ground maximum X coordinate (float, default 1)\r\n * @param options.zmax ground maximum Z coordinate (float, default 1)\r\n * @param options.subdivisions a javascript object `{w: positive integer, h: positive integer}` (default `{w: 6, h: 6}`). `w` and `h` are the numbers of subdivisions on the ground width and height. Each subdivision is called a tile\r\n * @param options.subdivisions.w positive integer, default 6\r\n * @param options.subdivisions.h positive integer, default 6\r\n * @param options.precision a javascript object `{w: positive integer, h: positive integer}` (default `{w: 2, h: 2}`). `w` and `h` are the numbers of subdivisions on the ground width and height of each tile\r\n * @param options.precision.w positive integer, default 2\r\n * @param options.precision.h positive integer, default 2\r\n * @param options.updatable boolean, default false, true if the mesh must be flagged as updatable\r\n * @param scene defines the hosting scene\r\n * @returns the tiled ground mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#tiled-ground\r\n */\r\nexport function CreateTiledGround(\r\n name: string,\r\n options: { xmin: number; zmin: number; xmax: number; zmax: number; subdivisions?: { w: number; h: number }; precision?: { w: number; h: number }; updatable?: boolean },\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const tiledGround = new Mesh(name, scene);\r\n\r\n const vertexData = CreateTiledGroundVertexData(options);\r\n\r\n vertexData.applyToMesh(tiledGround, options.updatable);\r\n\r\n return tiledGround;\r\n}\r\n\r\n/**\r\n * Creates a ground mesh from a height map. The height map download can take some frames,\r\n * so the mesh is not immediately ready. To wait for the mesh to be completely built,\r\n * you should use the `onReady` callback option.\r\n * @param name defines the name of the mesh\r\n * @param url sets the URL of the height map image resource.\r\n * @param options defines the options used to create the mesh\r\n * @param options.width sets the ground width size (positive float, default 10)\r\n * @param options.height sets the ground height size (positive float, default 10)\r\n * @param options.subdivisions sets the number of subdivision per side (positive integer, default 1)\r\n * @param options.minHeight is the minimum altitude on the ground (float, default 0)\r\n * @param options.maxHeight is the maximum altitude on the ground (float, default 1)\r\n * @param options.colorFilter is the filter to apply to the image pixel colors to compute the height (optional Color3, default (0.3, 0.59, 0.11) )\r\n * @param options.alphaFilter will filter any data where the alpha channel is below this value, defaults 0 (all data visible)\r\n * @param options.updatable defines if the mesh must be flagged as updatable\r\n * @param options.onReady is a javascript callback function that will be called once the mesh is just built (the height map download can last some time)\r\n * @param options.onError is a javascript callback function that will be called if there is an error\r\n * @param options.passHeightBufferInCallback a boolean that indicates if the calculated height data will be passed in the onReady callback. Useful if you need the height data for physics, for example.\r\n * @param scene defines the hosting scene\r\n * @returns the ground mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/height_map\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#ground-from-a-height-map\r\n */\r\nexport function CreateGroundFromHeightMap(\r\n name: string,\r\n url: string | { data: Uint8Array; width: number; height: number },\r\n options: {\r\n width?: number;\r\n height?: number;\r\n subdivisions?: number;\r\n minHeight?: number;\r\n maxHeight?: number;\r\n colorFilter?: Color3;\r\n alphaFilter?: number;\r\n updatable?: boolean;\r\n onReady?: (mesh: GroundMesh, heightBuffer?: Float32Array) => void;\r\n onError?: (message?: string, exception?: any) => void;\r\n passHeightBufferInCallback?: boolean;\r\n } = {},\r\n scene: Nullable<Scene> = null\r\n): GroundMesh {\r\n const width = options.width || 10.0;\r\n const height = options.height || 10.0;\r\n const subdivisions = options.subdivisions || 1 | 0;\r\n const minHeight = options.minHeight || 0.0;\r\n const maxHeight = options.maxHeight || 1.0;\r\n const filter = options.colorFilter || new Color3(0.3, 0.59, 0.11);\r\n const alphaFilter = options.alphaFilter || 0.0;\r\n const updatable = options.updatable;\r\n const onReady = options.onReady;\r\n\r\n scene = scene || EngineStore.LastCreatedScene!;\r\n\r\n const ground = new GroundMesh(name, scene);\r\n ground._subdivisionsX = subdivisions;\r\n ground._subdivisionsY = subdivisions;\r\n ground._width = width;\r\n ground._height = height;\r\n ground._maxX = ground._width / 2.0;\r\n ground._maxZ = ground._height / 2.0;\r\n ground._minX = -ground._maxX;\r\n ground._minZ = -ground._maxZ;\r\n\r\n ground._setReady(false);\r\n\r\n let heightBuffer: Float32Array;\r\n if (options.passHeightBufferInCallback) {\r\n heightBuffer = new Float32Array((subdivisions + 1) * (subdivisions + 1));\r\n }\r\n\r\n const onBufferLoaded = (buffer: Uint8Array, bufferWidth: number, bufferHeight: number) => {\r\n const vertexData = CreateGroundFromHeightMapVertexData({\r\n width: width,\r\n height: height,\r\n subdivisions: subdivisions,\r\n minHeight: minHeight,\r\n maxHeight: maxHeight,\r\n colorFilter: filter,\r\n buffer: buffer,\r\n bufferWidth: bufferWidth,\r\n bufferHeight: bufferHeight,\r\n alphaFilter: alphaFilter,\r\n heightBuffer,\r\n });\r\n\r\n vertexData.applyToMesh(ground, updatable);\r\n\r\n //execute ready callback, if set\r\n if (onReady) {\r\n onReady(ground, heightBuffer);\r\n }\r\n\r\n ground._setReady(true);\r\n };\r\n\r\n if (typeof url === \"string\") {\r\n const onload = (img: HTMLImageElement | ImageBitmap) => {\r\n const bufferWidth = img.width;\r\n const bufferHeight = img.height;\r\n\r\n if (scene.isDisposed) {\r\n return;\r\n }\r\n\r\n const buffer = scene?.getEngine().resizeImageBitmap(img, bufferWidth, bufferHeight);\r\n\r\n onBufferLoaded(buffer, bufferWidth, bufferHeight);\r\n };\r\n\r\n Tools.LoadImage(url, onload, options.onError ? options.onError : () => {}, scene.offlineProvider);\r\n } else {\r\n onBufferLoaded(url.data, url.width, url.height);\r\n }\r\n\r\n return ground;\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the functions directly from the module\r\n */\r\nexport const GroundBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateGround,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateGroundFromHeightMap,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateTiledGround,\r\n};\r\n\r\nVertexData.CreateGround = CreateGroundVertexData;\r\nVertexData.CreateTiledGround = CreateTiledGroundVertexData;\r\nVertexData.CreateGroundFromHeightMap = CreateGroundFromHeightMapVertexData;\r\n\r\nMesh.CreateGround = (name: string, width: number, height: number, subdivisions: number, scene?: Scene, updatable?: boolean): Mesh => {\r\n const options = {\r\n width,\r\n height,\r\n subdivisions,\r\n updatable,\r\n };\r\n\r\n return CreateGround(name, options, scene);\r\n};\r\n\r\nMesh.CreateTiledGround = (\r\n name: string,\r\n xmin: number,\r\n zmin: number,\r\n xmax: number,\r\n zmax: number,\r\n subdivisions: { w: number; h: number },\r\n precision: { w: number; h: number },\r\n scene: Scene,\r\n updatable?: boolean\r\n): Mesh => {\r\n const options = {\r\n xmin,\r\n zmin,\r\n xmax,\r\n zmax,\r\n subdivisions,\r\n precision,\r\n updatable,\r\n };\r\n\r\n return CreateTiledGround(name, options, scene);\r\n};\r\n\r\nMesh.CreateGroundFromHeightMap = (\r\n name: string,\r\n url: string,\r\n width: number,\r\n height: number,\r\n subdivisions: number,\r\n minHeight: number,\r\n maxHeight: number,\r\n scene: Scene,\r\n updatable?: boolean,\r\n onReady?: (mesh: GroundMesh) => void,\r\n alphaFilter?: number\r\n): GroundMesh => {\r\n const options = {\r\n width,\r\n height,\r\n subdivisions,\r\n minHeight,\r\n maxHeight,\r\n updatable,\r\n onReady,\r\n alphaFilter,\r\n };\r\n\r\n return CreateGroundFromHeightMap(name, url, options, scene);\r\n};\r\n"]}
1
+ {"version":3,"file":"groundBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/groundBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,w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,OAAO,yBAAyB,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAChE,CAAC,CAAC","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport { Color3 } from \"../../Maths/math.color\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { GroundMesh } from \"../groundMesh\";\r\nimport { Tools } from \"../../Misc/tools\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { EngineStore } from \"../../Engines/engineStore\";\r\nimport { Epsilon } from \"../../Maths/math.constants\";\r\nimport { useOpenGLOrientationForUV } from \"../../Compat/compatibilityOptions\";\r\n\r\n/**\r\n * Creates the VertexData for a Ground\r\n * @param options an object used to set the following optional parameters for the Ground, required but can be empty\r\n * - `width` the width (x direction) of the ground, optional, default 1\r\n * - `height` the height (z direction) of the ground, optional, default 1\r\n * - `subdivisions` the number of subdivisions per side, optional, default 1\r\n * - `subdivisionsX` the number of subdivisions in the x direction, overrides options.subdivisions, optional, default undefined\r\n * - `subdivisionsY` the number of subdivisions in the y direction, overrides options.subdivisions, optional, default undefined\r\n * @returns the VertexData of the Ground\r\n */\r\nexport function CreateGroundVertexData(options: {\r\n size?: number;\r\n width?: number;\r\n height?: number;\r\n subdivisions?: number;\r\n subdivisionsX?: number;\r\n subdivisionsY?: number;\r\n}): VertexData {\r\n const indices = [];\r\n const positions = [];\r\n const normals = [];\r\n const uvs = [];\r\n let row: number, col: number;\r\n\r\n const width: number = options.width || options.size || 1;\r\n const height: number = options.height || options.size || 1;\r\n const subdivisionsX: number = (options.subdivisionsX || options.subdivisions || 1) | 0;\r\n const subdivisionsY: number = (options.subdivisionsY || options.subdivisions || 1) | 0;\r\n\r\n for (row = 0; row <= subdivisionsY; row++) {\r\n for (col = 0; col <= subdivisionsX; col++) {\r\n const position = new Vector3((col * width) / subdivisionsX - width / 2.0, 0, ((subdivisionsY - row) * height) / subdivisionsY - height / 2.0);\r\n const normal = new Vector3(0, 1.0, 0);\r\n\r\n positions.push(position.x, position.y, position.z);\r\n normals.push(normal.x, normal.y, normal.z);\r\n uvs.push(col / subdivisionsX, useOpenGLOrientationForUV ? row / subdivisionsY : 1.0 - row / subdivisionsY);\r\n }\r\n }\r\n\r\n for (row = 0; row < subdivisionsY; row++) {\r\n for (col = 0; col < subdivisionsX; col++) {\r\n indices.push(col + 1 + (row + 1) * (subdivisionsX + 1));\r\n indices.push(col + 1 + row * (subdivisionsX + 1));\r\n indices.push(col + row * (subdivisionsX + 1));\r\n\r\n indices.push(col + (row + 1) * (subdivisionsX + 1));\r\n indices.push(col + 1 + (row + 1) * (subdivisionsX + 1));\r\n indices.push(col + row * (subdivisionsX + 1));\r\n }\r\n }\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates the VertexData for a TiledGround by subdividing the ground into tiles\r\n * @param options an object used to set the following optional parameters for the Ground\r\n * - `xmin` ground minimum X coordinate, default -1\r\n * - `zmin` ground minimum Z coordinate, default -1\r\n * - `xmax` ground maximum X coordinate, default 1\r\n * - `zmax` ground maximum Z coordinate, default 1\r\n * - `subdivisions` a javascript object `\\{w: positive integer, h: positive integer\\}`, `w` and `h` are the numbers of subdivisions on the ground width and height creating 'tiles', default `\\{w: 6, h: 6\\}`\r\n * - `precision` a javascript object `\\{w: positive integer, h: positive integer\\}`, `w` and `h` are the numbers of subdivisions on the tile width and height, default `\\{w: 2, h: 2\\}`\r\n * @returns the VertexData of the TiledGround\r\n */\r\nexport function CreateTiledGroundVertexData(options: {\r\n xmin: number;\r\n zmin: number;\r\n xmax: number;\r\n zmax: number;\r\n subdivisions?: { w: number; h: number };\r\n precision?: { w: number; h: number };\r\n}): VertexData {\r\n const xmin = options.xmin !== undefined && options.xmin !== null ? options.xmin : -1.0;\r\n const zmin = options.zmin !== undefined && options.zmin !== null ? options.zmin : -1.0;\r\n const xmax = options.xmax !== undefined && options.xmax !== null ? options.xmax : 1.0;\r\n const zmax = options.zmax !== undefined && options.zmax !== null ? options.zmax : 1.0;\r\n const subdivisions = options.subdivisions || { w: 1, h: 1 };\r\n const precision = options.precision || { w: 1, h: 1 };\r\n\r\n const indices: number[] = [];\r\n const positions: number[] = [];\r\n const normals: number[] = [];\r\n const uvs: number[] = [];\r\n let row: number, col: number, tileRow: number, tileCol: number;\r\n\r\n subdivisions.h = subdivisions.h < 1 ? 1 : subdivisions.h;\r\n subdivisions.w = subdivisions.w < 1 ? 1 : subdivisions.w;\r\n precision.w = precision.w < 1 ? 1 : precision.w;\r\n precision.h = precision.h < 1 ? 1 : precision.h;\r\n\r\n const tileSize = {\r\n w: (xmax - xmin) / subdivisions.w,\r\n h: (zmax - zmin) / subdivisions.h,\r\n };\r\n\r\n function applyTile(xTileMin: number, zTileMin: number, xTileMax: number, zTileMax: number) {\r\n // Indices\r\n const base = positions.length / 3;\r\n const rowLength = precision.w + 1;\r\n for (row = 0; row < precision.h; row++) {\r\n for (col = 0; col < precision.w; col++) {\r\n const square = [base + col + row * rowLength, base + (col + 1) + row * rowLength, base + (col + 1) + (row + 1) * rowLength, base + col + (row + 1) * rowLength];\r\n\r\n indices.push(square[1]);\r\n indices.push(square[2]);\r\n indices.push(square[3]);\r\n indices.push(square[0]);\r\n indices.push(square[1]);\r\n indices.push(square[3]);\r\n }\r\n }\r\n\r\n // Position, normals and uvs\r\n const position = Vector3.Zero();\r\n const normal = new Vector3(0, 1.0, 0);\r\n for (row = 0; row <= precision.h; row++) {\r\n position.z = (row * (zTileMax - zTileMin)) / precision.h + zTileMin;\r\n for (col = 0; col <= precision.w; col++) {\r\n position.x = (col * (xTileMax - xTileMin)) / precision.w + xTileMin;\r\n position.y = 0;\r\n\r\n positions.push(position.x, position.y, position.z);\r\n normals.push(normal.x, normal.y, normal.z);\r\n uvs.push(col / precision.w, row / precision.h);\r\n }\r\n }\r\n }\r\n\r\n for (tileRow = 0; tileRow < subdivisions.h; tileRow++) {\r\n for (tileCol = 0; tileCol < subdivisions.w; tileCol++) {\r\n applyTile(xmin + tileCol * tileSize.w, zmin + tileRow * tileSize.h, xmin + (tileCol + 1) * tileSize.w, zmin + (tileRow + 1) * tileSize.h);\r\n }\r\n }\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates the VertexData of the Ground designed from a heightmap\r\n * @param options an object used to set the following parameters for the Ground, required and provided by CreateGroundFromHeightMap\r\n * - `width` the width (x direction) of the ground\r\n * - `height` the height (z direction) of the ground\r\n * - `subdivisions` the number of subdivisions per side\r\n * - `minHeight` the minimum altitude on the ground, optional, default 0\r\n * - `maxHeight` the maximum altitude on the ground, optional default 1\r\n * - `colorFilter` the filter to apply to the image pixel colors to compute the height, optional Color3, default (0.3, 0.59, 0.11)\r\n * - `buffer` the array holding the image color data\r\n * - `bufferWidth` the width of image\r\n * - `bufferHeight` the height of image\r\n * - `alphaFilter` Remove any data where the alpha channel is below this value, defaults 0 (all data visible)\r\n * - `heightBuffer` a array of floats where the height data can be saved, if its length is greater than zero.\r\n * @returns the VertexData of the Ground designed from a heightmap\r\n */\r\nexport function CreateGroundFromHeightMapVertexData(options: {\r\n width: number;\r\n height: number;\r\n subdivisions: number;\r\n minHeight: number;\r\n maxHeight: number;\r\n colorFilter: Color3;\r\n buffer: Uint8Array;\r\n bufferWidth: number;\r\n bufferHeight: number;\r\n alphaFilter: number;\r\n heightBuffer?: Float32Array;\r\n}): VertexData {\r\n const indices = [];\r\n const positions = [];\r\n const normals = [];\r\n const uvs = [];\r\n let row, col;\r\n const filter = options.colorFilter || new Color3(0.3, 0.59, 0.11);\r\n const alphaFilter = options.alphaFilter || 0.0;\r\n let invert = false;\r\n\r\n if (options.minHeight > options.maxHeight) {\r\n invert = true;\r\n const temp = options.maxHeight;\r\n options.maxHeight = options.minHeight;\r\n options.minHeight = temp;\r\n }\r\n\r\n // Vertices\r\n for (row = 0; row <= options.subdivisions; row++) {\r\n for (col = 0; col <= options.subdivisions; col++) {\r\n const position = new Vector3(\r\n (col * options.width) / options.subdivisions - options.width / 2.0,\r\n 0,\r\n ((options.subdivisions - row) * options.height) / options.subdivisions - options.height / 2.0\r\n );\r\n\r\n // Compute height\r\n const heightMapX = (((position.x + options.width / 2) / options.width) * (options.bufferWidth - 1)) | 0;\r\n const heightMapY = ((1.0 - (position.z + options.height / 2) / options.height) * (options.bufferHeight - 1)) | 0;\r\n const pos = (heightMapX + heightMapY * options.bufferWidth) * 4;\r\n let r = options.buffer[pos] / 255.0;\r\n let g = options.buffer[pos + 1] / 255.0;\r\n let b = options.buffer[pos + 2] / 255.0;\r\n const a = options.buffer[pos + 3] / 255.0;\r\n\r\n if (invert) {\r\n r = 1.0 - r;\r\n g = 1.0 - g;\r\n b = 1.0 - b;\r\n }\r\n\r\n const gradient = r * filter.r + g * filter.g + b * filter.b;\r\n\r\n // If our alpha channel is not within our filter then we will assign a 'special' height\r\n // Then when building the indices, we will ignore any vertex that is using the special height\r\n if (a >= alphaFilter) {\r\n position.y = options.minHeight + (options.maxHeight - options.minHeight) * gradient;\r\n } else {\r\n position.y = options.minHeight - Epsilon; // We can't have a height below minHeight, normally.\r\n }\r\n if (options.heightBuffer) {\r\n // set the height buffer information in row major order.\r\n options.heightBuffer[row * (options.subdivisions + 1) + col] = position.y;\r\n }\r\n\r\n // Add vertex\r\n positions.push(position.x, position.y, position.z);\r\n normals.push(0, 0, 0);\r\n uvs.push(col / options.subdivisions, 1.0 - row / options.subdivisions);\r\n }\r\n }\r\n\r\n // Indices\r\n for (row = 0; row < options.subdivisions; row++) {\r\n for (col = 0; col < options.subdivisions; col++) {\r\n // Calculate Indices\r\n const idx1 = col + 1 + (row + 1) * (options.subdivisions + 1);\r\n const idx2 = col + 1 + row * (options.subdivisions + 1);\r\n const idx3 = col + row * (options.subdivisions + 1);\r\n const idx4 = col + (row + 1) * (options.subdivisions + 1);\r\n\r\n // Check that all indices are visible (based on our special height)\r\n // Only display the vertex if all Indices are visible\r\n // Positions are stored x,y,z for each vertex, hence the * 3 and + 1 for height\r\n const isVisibleIdx1 = positions[idx1 * 3 + 1] >= options.minHeight;\r\n const isVisibleIdx2 = positions[idx2 * 3 + 1] >= options.minHeight;\r\n const isVisibleIdx3 = positions[idx3 * 3 + 1] >= options.minHeight;\r\n if (isVisibleIdx1 && isVisibleIdx2 && isVisibleIdx3) {\r\n indices.push(idx1);\r\n indices.push(idx2);\r\n indices.push(idx3);\r\n }\r\n\r\n const isVisibleIdx4 = positions[idx4 * 3 + 1] >= options.minHeight;\r\n if (isVisibleIdx4 && isVisibleIdx1 && isVisibleIdx3) {\r\n indices.push(idx4);\r\n indices.push(idx1);\r\n indices.push(idx3);\r\n }\r\n }\r\n }\r\n\r\n // Normals\r\n VertexData.ComputeNormals(positions, indices, normals);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a ground mesh\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * - `width` set the width size (float, default 1)\r\n * - `height` set the height size (float, default 1)\r\n * - `subdivisions` sets the number of subdivision per side (default 1)\r\n * - `subdivisionsX` sets the number of subdivision on the X axis (overrides subdivisions)\r\n * - `subdivisionsY` sets the number of subdivision on the Y axis (overrides subdivisions)\r\n * - `updatable` defines if the mesh must be flagged as updatable (default false)\r\n * @param scene defines the hosting scene\r\n * @returns the ground mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#ground\r\n */\r\nexport function CreateGround(\r\n name: string,\r\n options: { width?: number; height?: number; subdivisions?: number; subdivisionsX?: number; subdivisionsY?: number; updatable?: boolean } = {},\r\n scene?: Scene\r\n): GroundMesh {\r\n const ground = new GroundMesh(name, scene);\r\n ground._setReady(false);\r\n ground._subdivisionsX = options.subdivisionsX || options.subdivisions || 1;\r\n ground._subdivisionsY = options.subdivisionsY || options.subdivisions || 1;\r\n ground._width = options.width || 1;\r\n ground._height = options.height || 1;\r\n ground._maxX = ground._width / 2;\r\n ground._maxZ = ground._height / 2;\r\n ground._minX = -ground._maxX;\r\n ground._minZ = -ground._maxZ;\r\n\r\n const vertexData = CreateGroundVertexData(options);\r\n\r\n vertexData.applyToMesh(ground, options.updatable);\r\n\r\n ground._setReady(true);\r\n\r\n return ground;\r\n}\r\n\r\n/**\r\n * Creates a tiled ground mesh\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * - `xmin` ground minimum X coordinate (float, default -1)\r\n * - `zmin` ground minimum Z coordinate (float, default -1)\r\n * - `xmax` ground maximum X coordinate (float, default 1)\r\n * - `zmax` ground maximum Z coordinate (float, default 1)\r\n * - `subdivisions` a javascript object `{w: positive integer, h: positive integer}` (default `{w: 6, h: 6}`). `w` and `h` are the numbers of subdivisions on the ground width and height. Each subdivision is called a tile\r\n * - `subdivisions.w` positive integer, default 6\r\n * - `subdivisions.h` positive integer, default 6\r\n * - `precision` a javascript object `{w: positive integer, h: positive integer}` (default `{w: 2, h: 2}`). `w` and `h` are the numbers of subdivisions on the ground width and height of each tile\r\n * - `precision.w` positive integer, default 2\r\n * - `precision.h` positive integer, default 2\r\n * - `updatable` boolean, default false, true if the mesh must be flagged as updatable\r\n * @param scene defines the hosting scene\r\n * @returns the tiled ground mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#tiled-ground\r\n */\r\nexport function CreateTiledGround(\r\n name: string,\r\n options: { xmin: number; zmin: number; xmax: number; zmax: number; subdivisions?: { w: number; h: number }; precision?: { w: number; h: number }; updatable?: boolean },\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const tiledGround = new Mesh(name, scene);\r\n\r\n const vertexData = CreateTiledGroundVertexData(options);\r\n\r\n vertexData.applyToMesh(tiledGround, options.updatable);\r\n\r\n return tiledGround;\r\n}\r\n\r\n/**\r\n * Creates a ground mesh from a height map. The height map download can take some frames,\r\n * so the mesh is not immediately ready. To wait for the mesh to be completely built,\r\n * you should use the `onReady` callback option.\r\n * @param name defines the name of the mesh\r\n * @param url sets the URL of the height map image resource.\r\n * @param options defines the options used to create the mesh\r\n * - `width` sets the ground width size (positive float, default 10)\r\n * - `height` sets the ground height size (positive float, default 10)\r\n * - `subdivisions` sets the number of subdivision per side (positive integer, default 1)\r\n * - `minHeight` is the minimum altitude on the ground (float, default 0)\r\n * - `maxHeight` is the maximum altitude on the ground (float, default 1)\r\n * - `colorFilter` is the filter to apply to the image pixel colors to compute the height (optional Color3, default (0.3, 0.59, 0.11) )\r\n * - `alphaFilter` will filter any data where the alpha channel is below this value, defaults 0 (all data visible)\r\n * - `updatable` defines if the mesh must be flagged as updatable\r\n * - `onReady` is a javascript callback function that will be called once the mesh is just built (the height map download can last some time)\r\n * - `onError` is a javascript callback function that will be called if there is an error\r\n * - `passHeightBufferInCallback` a boolean that indicates if the calculated height data will be passed in the onReady callback. Useful if you need the height data for physics, for example.\r\n * @param scene defines the hosting scene\r\n * @returns the ground mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/height_map\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#ground-from-a-height-map\r\n */\r\nexport function CreateGroundFromHeightMap(\r\n name: string,\r\n url: string | { data: Uint8Array; width: number; height: number },\r\n options: {\r\n width?: number;\r\n height?: number;\r\n subdivisions?: number;\r\n minHeight?: number;\r\n maxHeight?: number;\r\n colorFilter?: Color3;\r\n alphaFilter?: number;\r\n updatable?: boolean;\r\n onReady?: (mesh: GroundMesh, heightBuffer?: Float32Array) => void;\r\n onError?: (message?: string, exception?: any) => void;\r\n passHeightBufferInCallback?: boolean;\r\n } = {},\r\n scene: Nullable<Scene> = null\r\n): GroundMesh {\r\n const width = options.width || 10.0;\r\n const height = options.height || 10.0;\r\n const subdivisions = options.subdivisions || 1 | 0;\r\n const minHeight = options.minHeight || 0.0;\r\n const maxHeight = options.maxHeight || 1.0;\r\n const filter = options.colorFilter || new Color3(0.3, 0.59, 0.11);\r\n const alphaFilter = options.alphaFilter || 0.0;\r\n const updatable = options.updatable;\r\n const onReady = options.onReady;\r\n\r\n scene = scene || EngineStore.LastCreatedScene!;\r\n\r\n const ground = new GroundMesh(name, scene);\r\n ground._subdivisionsX = subdivisions;\r\n ground._subdivisionsY = subdivisions;\r\n ground._width = width;\r\n ground._height = height;\r\n ground._maxX = ground._width / 2.0;\r\n ground._maxZ = ground._height / 2.0;\r\n ground._minX = -ground._maxX;\r\n ground._minZ = -ground._maxZ;\r\n\r\n ground._setReady(false);\r\n\r\n let heightBuffer: Float32Array;\r\n if (options.passHeightBufferInCallback) {\r\n heightBuffer = new Float32Array((subdivisions + 1) * (subdivisions + 1));\r\n }\r\n\r\n const onBufferLoaded = (buffer: Uint8Array, bufferWidth: number, bufferHeight: number) => {\r\n const vertexData = CreateGroundFromHeightMapVertexData({\r\n width: width,\r\n height: height,\r\n subdivisions: subdivisions,\r\n minHeight: minHeight,\r\n maxHeight: maxHeight,\r\n colorFilter: filter,\r\n buffer: buffer,\r\n bufferWidth: bufferWidth,\r\n bufferHeight: bufferHeight,\r\n alphaFilter: alphaFilter,\r\n heightBuffer,\r\n });\r\n\r\n vertexData.applyToMesh(ground, updatable);\r\n\r\n //execute ready callback, if set\r\n if (onReady) {\r\n onReady(ground, heightBuffer);\r\n }\r\n\r\n ground._setReady(true);\r\n };\r\n\r\n if (typeof url === \"string\") {\r\n const onload = (img: HTMLImageElement | ImageBitmap) => {\r\n const bufferWidth = img.width;\r\n const bufferHeight = img.height;\r\n\r\n if (scene.isDisposed) {\r\n return;\r\n }\r\n\r\n const buffer = scene?.getEngine().resizeImageBitmap(img, bufferWidth, bufferHeight);\r\n\r\n onBufferLoaded(buffer, bufferWidth, bufferHeight);\r\n };\r\n\r\n Tools.LoadImage(url, onload, options.onError ? options.onError : () => {}, scene.offlineProvider);\r\n } else {\r\n onBufferLoaded(url.data, url.width, url.height);\r\n }\r\n\r\n return ground;\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the functions directly from the module\r\n */\r\nexport const GroundBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateGround,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateGroundFromHeightMap,\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateTiledGround,\r\n};\r\n\r\nVertexData.CreateGround = CreateGroundVertexData;\r\nVertexData.CreateTiledGround = CreateTiledGroundVertexData;\r\nVertexData.CreateGroundFromHeightMap = CreateGroundFromHeightMapVertexData;\r\n\r\nMesh.CreateGround = (name: string, width: number, height: number, subdivisions: number, scene?: Scene, updatable?: boolean): Mesh => {\r\n const options = {\r\n width,\r\n height,\r\n subdivisions,\r\n updatable,\r\n };\r\n\r\n return CreateGround(name, options, scene);\r\n};\r\n\r\nMesh.CreateTiledGround = (\r\n name: string,\r\n xmin: number,\r\n zmin: number,\r\n xmax: number,\r\n zmax: number,\r\n subdivisions: { w: number; h: number },\r\n precision: { w: number; h: number },\r\n scene: Scene,\r\n updatable?: boolean\r\n): Mesh => {\r\n const options = {\r\n xmin,\r\n zmin,\r\n xmax,\r\n zmax,\r\n subdivisions,\r\n precision,\r\n updatable,\r\n };\r\n\r\n return CreateTiledGround(name, options, scene);\r\n};\r\n\r\nMesh.CreateGroundFromHeightMap = (\r\n name: string,\r\n url: string,\r\n width: number,\r\n height: number,\r\n subdivisions: number,\r\n minHeight: number,\r\n maxHeight: number,\r\n scene: Scene,\r\n updatable?: boolean,\r\n onReady?: (mesh: GroundMesh) => void,\r\n alphaFilter?: number\r\n): GroundMesh => {\r\n const options = {\r\n width,\r\n height,\r\n subdivisions,\r\n minHeight,\r\n maxHeight,\r\n updatable,\r\n onReady,\r\n alphaFilter,\r\n };\r\n\r\n return CreateGroundFromHeightMap(name, url, options, scene);\r\n};\r\n"]}
@@ -20,19 +20,6 @@ import { VertexData } from "../mesh.vertexData.js";
20
20
  * * faceColors an array of 6 Color4 elements used to set different colors to each box side
21
21
  * * alignHorizontal places whole tiles aligned to the center, left or right of a row
22
22
  * * alignVertical places whole tiles aligned to the center, left or right of a column
23
- * @param options.pattern
24
- * @param options.size
25
- * @param options.width
26
- * @param options.height
27
- * @param options.depth
28
- * @param options.tileSize
29
- * @param options.tileWidth
30
- * @param options.tileHeight
31
- * @param options.faceUV
32
- * @param options.faceColors
33
- * @param options.alignHorizontal
34
- * @param options.alignVertical
35
- * @param options.sideOrientation
36
23
  * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
37
24
  * @returns the VertexData of the TiledBox
38
25
  */
@@ -69,19 +56,6 @@ export declare function CreateTiledBoxVertexData(options: {
69
56
  * * alignHorizontal places whole tiles aligned to the center, left or right of a row
70
57
  * * alignVertical places whole tiles aligned to the center, left or right of a column
71
58
  * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
72
- * @param options.pattern
73
- * @param options.width
74
- * @param options.height
75
- * @param options.depth
76
- * @param options.tileSize
77
- * @param options.tileWidth
78
- * @param options.tileHeight
79
- * @param options.alignHorizontal
80
- * @param options.alignVertical
81
- * @param options.faceUV
82
- * @param options.faceColors
83
- * @param options.sideOrientation
84
- * @param options.updatable
85
59
  * @param scene defines the hosting scene
86
60
  * @returns the box mesh
87
61
  */
@@ -22,19 +22,6 @@ const OP_SUB = -1;
22
22
  * * faceColors an array of 6 Color4 elements used to set different colors to each box side
23
23
  * * alignHorizontal places whole tiles aligned to the center, left or right of a row
24
24
  * * alignVertical places whole tiles aligned to the center, left or right of a column
25
- * @param options.pattern
26
- * @param options.size
27
- * @param options.width
28
- * @param options.height
29
- * @param options.depth
30
- * @param options.tileSize
31
- * @param options.tileWidth
32
- * @param options.tileHeight
33
- * @param options.faceUV
34
- * @param options.faceColors
35
- * @param options.alignHorizontal
36
- * @param options.alignVertical
37
- * @param options.sideOrientation
38
25
  * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
39
26
  * @returns the VertexData of the TiledBox
40
27
  */
@@ -206,19 +193,6 @@ export function CreateTiledBoxVertexData(options) {
206
193
  * * alignHorizontal places whole tiles aligned to the center, left or right of a row
207
194
  * * alignVertical places whole tiles aligned to the center, left or right of a column
208
195
  * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
209
- * @param options.pattern
210
- * @param options.width
211
- * @param options.height
212
- * @param options.depth
213
- * @param options.tileSize
214
- * @param options.tileWidth
215
- * @param options.tileHeight
216
- * @param options.alignHorizontal
217
- * @param options.alignVertical
218
- * @param options.faceUV
219
- * @param options.faceColors
220
- * @param options.sideOrientation
221
- * @param options.updatable
222
196
  * @param scene defines the hosting scene
223
197
  * @returns the box mesh
224
198
  */
@@ -1 +1 @@
1
- {"version":3,"file":"tiledBoxBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/tiledBoxBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,MAAM,MAAM,GAAG,CAAC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C,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC/F,UAAU,CAAC,MAAM,GAAG,WAAW,CAAC;IACpC,CAAC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,cAAc,CAC1B,IAAY,EACZ,OAcC,EACD,QAAyB,IAAI;IAE7B,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAElC,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACnF,GAAG,CAAC,+BAA+B,GAAG,OAAO,CAAC,eAAe,CAAC;IAE9D,MAAM,UAAU,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAErD,UAAU,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAE/C,OAAO,GAAG,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,gEAAgE;IAChE,cAAc;CACjB,CAAC;AAEF,UAAU,CAAC,cAAc,GAAG,wBAAwB,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Matrix, Vector3, Vector4 } from \"../../Maths/math.vector\";\r\nimport { Color4 } from \"../../Maths/math.color\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { CreateTiledPlaneVertexData } from \"./tiledPlaneBuilder\";\r\nimport { useOpenGLOrientationForUV } from \"../../Compat/compatibilityOptions\";\r\n\r\nconst OP_ADD = 1;\r\nconst OP_SUB = -1;\r\n\r\n/**\r\n * Creates the VertexData for a tiled box\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_box\r\n * @param options an object used to set the following optional parameters for the tiled box, required but can be empty\r\n * * pattern sets the rotation or reflection pattern for the tiles,\r\n * * size of the box\r\n * * width of the box, overwrites size\r\n * * height of the box, overwrites size\r\n * * depth of the box, overwrites size\r\n * * tileSize sets the size of a tile\r\n * * tileWidth sets the tile width and overwrites tileSize\r\n * * tileHeight sets the tile width and overwrites tileSize\r\n * * faceUV an array of 6 Vector4 elements used to set different images to each box side\r\n * * faceColors an array of 6 Color4 elements used to set different colors to each box side\r\n * * alignHorizontal places whole tiles aligned to the center, left or right of a row\r\n * * alignVertical places whole tiles aligned to the center, left or right of a column\r\n * @param options.pattern\r\n * @param options.size\r\n * @param options.width\r\n * @param options.height\r\n * @param options.depth\r\n * @param options.tileSize\r\n * @param options.tileWidth\r\n * @param options.tileHeight\r\n * @param options.faceUV\r\n * @param options.faceColors\r\n * @param options.alignHorizontal\r\n * @param options.alignVertical\r\n * @param options.sideOrientation\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * @returns the VertexData of the TiledBox\r\n */\r\nexport function CreateTiledBoxVertexData(options: {\r\n pattern?: number;\r\n size?: number;\r\n width?: number;\r\n height?: number;\r\n depth?: number;\r\n tileSize?: number;\r\n tileWidth?: number;\r\n tileHeight?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n alignHorizontal?: number;\r\n alignVertical?: number;\r\n sideOrientation?: number;\r\n}): VertexData {\r\n const nbFaces = 6;\r\n\r\n const faceUV: Vector4[] = options.faceUV || new Array<Vector4>(6);\r\n const faceColors = options.faceColors;\r\n\r\n const flipTile = options.pattern || Mesh.NO_FLIP;\r\n\r\n const width = options.width || options.size || 1;\r\n const height = options.height || options.size || 1;\r\n const depth = options.depth || options.size || 1;\r\n const tileWidth = options.tileWidth || options.tileSize || 1;\r\n const tileHeight = options.tileHeight || options.tileSize || 1;\r\n const alignH = options.alignHorizontal || 0;\r\n const alignV = options.alignVertical || 0;\r\n\r\n const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || VertexData.DEFAULTSIDE;\r\n\r\n // default face colors and UV if undefined\r\n for (let f = 0; f < nbFaces; f++) {\r\n if (faceUV[f] === undefined) {\r\n faceUV[f] = new Vector4(0, 0, 1, 1);\r\n }\r\n if (faceColors && faceColors[f] === undefined) {\r\n faceColors[f] = new Color4(1, 1, 1, 1);\r\n }\r\n }\r\n\r\n const halfWidth = width / 2;\r\n const halfHeight = height / 2;\r\n const halfDepth = depth / 2;\r\n\r\n const faceVertexData: Array<VertexData> = [];\r\n\r\n for (let f = 0; f < 2; f++) {\r\n //front and back\r\n faceVertexData[f] = CreateTiledPlaneVertexData({\r\n pattern: flipTile,\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n width: width,\r\n height: height,\r\n alignVertical: alignV,\r\n alignHorizontal: alignH,\r\n sideOrientation: sideOrientation,\r\n });\r\n }\r\n\r\n for (let f = 2; f < 4; f++) {\r\n //sides\r\n faceVertexData[f] = CreateTiledPlaneVertexData({\r\n pattern: flipTile,\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n width: depth,\r\n height: height,\r\n alignVertical: alignV,\r\n alignHorizontal: alignH,\r\n sideOrientation: sideOrientation,\r\n });\r\n }\r\n\r\n let baseAlignV = alignV;\r\n if (alignV === Mesh.BOTTOM) {\r\n baseAlignV = Mesh.TOP;\r\n } else if (alignV === Mesh.TOP) {\r\n baseAlignV = Mesh.BOTTOM;\r\n }\r\n\r\n for (let f = 4; f < 6; f++) {\r\n //top and bottom\r\n faceVertexData[f] = CreateTiledPlaneVertexData({\r\n pattern: flipTile,\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n width: width,\r\n height: depth,\r\n alignVertical: baseAlignV,\r\n alignHorizontal: alignH,\r\n sideOrientation: sideOrientation,\r\n });\r\n }\r\n\r\n const positions: Array<number> = [];\r\n const normals: Array<number> = [];\r\n let uvs: Array<number> = [];\r\n let indices: Array<number> = [];\r\n const colors: Array<number> = [];\r\n const facePositions: Array<Array<Vector3>> = [];\r\n const faceNormals: Array<Array<Vector3>> = [];\r\n\r\n const newFaceUV: Array<Array<number>> = [];\r\n let lu: number = 0;\r\n\r\n let li: number = 0;\r\n\r\n for (let f = 0; f < nbFaces; f++) {\r\n const len = faceVertexData[f].positions!.length;\r\n facePositions[f] = [];\r\n faceNormals[f] = [];\r\n for (let p = 0; p < len / 3; p++) {\r\n facePositions[f].push(new Vector3(faceVertexData[f].positions![3 * p], faceVertexData[f].positions![3 * p + 1], faceVertexData[f].positions![3 * p + 2]));\r\n faceNormals[f].push(new Vector3(faceVertexData[f].normals![3 * p], faceVertexData[f].normals![3 * p + 1], faceVertexData[f].normals![3 * p + 2]));\r\n }\r\n // uvs\r\n lu = faceVertexData[f].uvs!.length;\r\n newFaceUV[f] = [];\r\n for (let i = 0; i < lu; i += 2) {\r\n newFaceUV[f][i] = faceUV[f].x + (faceUV[f].z - faceUV[f].x) * faceVertexData[f].uvs![i];\r\n newFaceUV[f][i + 1] = faceUV[f].y + (faceUV[f].w - faceUV[f].y) * faceVertexData[f].uvs![i + 1];\r\n\r\n if (useOpenGLOrientationForUV) {\r\n newFaceUV[f][i + 1] = 1.0 - newFaceUV[f][i + 1];\r\n }\r\n }\r\n uvs = uvs.concat(newFaceUV[f]);\r\n\r\n indices = indices.concat(<Array<number>>faceVertexData[f].indices!.map((x: number) => x + li));\r\n li += facePositions[f].length;\r\n if (faceColors) {\r\n const color = faceColors[f];\r\n for (let p = 0; p < facePositions[f].length; p++) {\r\n colors.push(color.r, color.g, color.b, color.a);\r\n }\r\n }\r\n }\r\n\r\n // Define transforms for each face\r\n const faceTransforms = [\r\n // FRONT\r\n { m: Matrix.RotationY(Math.PI), t: new Vector3(0, 0, halfDepth), op: OP_ADD },\r\n // BACK\r\n { m: Matrix.Identity(), t: new Vector3(0, 0, halfDepth), op: OP_SUB },\r\n // RIGHT\r\n { m: Matrix.RotationY(-Math.PI / 2), t: new Vector3(halfWidth, 0, 0), op: OP_ADD },\r\n // LEFT\r\n { m: Matrix.RotationY(Math.PI / 2), t: new Vector3(halfWidth, 0, 0), op: OP_SUB },\r\n // TOP\r\n { m: Matrix.RotationX(Math.PI / 2), t: new Vector3(0, halfHeight, 0), op: OP_ADD },\r\n // BOTTOM\r\n { m: Matrix.RotationX(-Math.PI / 2), t: new Vector3(0, halfHeight, 0), op: OP_SUB },\r\n ];\r\n\r\n // Assemble positions and normals\r\n for (let f = 0; f < nbFaces; f++) {\r\n const { m, t, op } = faceTransforms[f];\r\n\r\n for (const v of facePositions[f]) {\r\n const p = Vector3.TransformCoordinates(v, m);\r\n const final = op === OP_ADD ? p.add(t) : p.subtract(t);\r\n positions.push(final.x, final.y, final.z);\r\n }\r\n\r\n for (const n of faceNormals[f]) {\r\n const nn = Vector3.TransformNormal(n, m);\r\n normals.push(nn.x, nn.y, nn.z);\r\n }\r\n }\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n if (faceColors) {\r\n const totalColors = sideOrientation === VertexData.DOUBLESIDE ? colors.concat(colors) : colors;\r\n vertexData.colors = totalColors;\r\n }\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a tiled box mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_box\r\n * @param name defines the name of the mesh\r\n * @param options an object used to set the following optional parameters for the tiled box, required but can be empty\r\n * * pattern sets the rotation or reflection pattern for the tiles,\r\n * * size of the box\r\n * * width of the box, overwrites size\r\n * * height of the box, overwrites size\r\n * * depth of the box, overwrites size\r\n * * tileSize sets the size of a tile\r\n * * tileWidth sets the tile width and overwrites tileSize\r\n * * tileHeight sets the tile width and overwrites tileSize\r\n * * faceUV an array of 6 Vector4 elements used to set different images to each box side\r\n * * faceColors an array of 6 Color3 elements used to set different colors to each box side\r\n * * alignHorizontal places whole tiles aligned to the center, left or right of a row\r\n * * alignVertical places whole tiles aligned to the center, left or right of a column\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * @param options.pattern\r\n * @param options.width\r\n * @param options.height\r\n * @param options.depth\r\n * @param options.tileSize\r\n * @param options.tileWidth\r\n * @param options.tileHeight\r\n * @param options.alignHorizontal\r\n * @param options.alignVertical\r\n * @param options.faceUV\r\n * @param options.faceColors\r\n * @param options.sideOrientation\r\n * @param options.updatable\r\n * @param scene defines the hosting scene\r\n * @returns the box mesh\r\n */\r\nexport function CreateTiledBox(\r\n name: string,\r\n options: {\r\n pattern?: number;\r\n width?: number;\r\n height?: number;\r\n depth?: number;\r\n tileSize?: number;\r\n tileWidth?: number;\r\n tileHeight?: number;\r\n alignHorizontal?: number;\r\n alignVertical?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n sideOrientation?: number;\r\n updatable?: boolean;\r\n },\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const box = new Mesh(name, scene);\r\n\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n box._originalBuilderSideOrientation = options.sideOrientation;\r\n\r\n const vertexData = CreateTiledBoxVertexData(options);\r\n\r\n vertexData.applyToMesh(box, options.updatable);\r\n\r\n return box;\r\n}\r\n\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use CreateTiledBox instead\r\n */\r\nexport const TiledBoxBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateTiledBox,\r\n};\r\n\r\nVertexData.CreateTiledBox = CreateTiledBoxVertexData;\r\n"]}
1
+ {"version":3,"file":"tiledBoxBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/tiledBoxBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CA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AG,SAAS,CAAC;IACjC,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;IAC7B,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC;IAErB,IAAI,UAAU,EAAE,CAAC;QACb,MAAM,WAAW,GAAG,eAAe,KAAK,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC/F,UAAU,CAAC,MAAM,GAAG,WAAW,CAAC;IACpC,CAAC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,cAAc,CAC1B,IAAY,EACZ,OAcC,EACD,QAAyB,IAAI;IAE7B,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAElC,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACnF,GAAG,CAAC,+BAA+B,GAAG,OAAO,CAAC,eAAe,CAAC;IAE9D,MAAM,UAAU,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;IAErD,UAAU,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAE/C,OAAO,GAAG,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B,gEAAgE;IAChE,cAAc;CACjB,CAAC;AAEF,UAAU,CAAC,cAAc,GAAG,wBAAwB,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { Matrix, Vector3, Vector4 } from \"../../Maths/math.vector\";\r\nimport { Color4 } from \"../../Maths/math.color\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { CreateTiledPlaneVertexData } from \"./tiledPlaneBuilder\";\r\nimport { useOpenGLOrientationForUV } from \"../../Compat/compatibilityOptions\";\r\n\r\nconst OP_ADD = 1;\r\nconst OP_SUB = -1;\r\n\r\n/**\r\n * Creates the VertexData for a tiled box\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_box\r\n * @param options an object used to set the following optional parameters for the tiled box, required but can be empty\r\n * * pattern sets the rotation or reflection pattern for the tiles,\r\n * * size of the box\r\n * * width of the box, overwrites size\r\n * * height of the box, overwrites size\r\n * * depth of the box, overwrites size\r\n * * tileSize sets the size of a tile\r\n * * tileWidth sets the tile width and overwrites tileSize\r\n * * tileHeight sets the tile width and overwrites tileSize\r\n * * faceUV an array of 6 Vector4 elements used to set different images to each box side\r\n * * faceColors an array of 6 Color4 elements used to set different colors to each box side\r\n * * alignHorizontal places whole tiles aligned to the center, left or right of a row\r\n * * alignVertical places whole tiles aligned to the center, left or right of a column\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * @returns the VertexData of the TiledBox\r\n */\r\nexport function CreateTiledBoxVertexData(options: {\r\n pattern?: number;\r\n size?: number;\r\n width?: number;\r\n height?: number;\r\n depth?: number;\r\n tileSize?: number;\r\n tileWidth?: number;\r\n tileHeight?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n alignHorizontal?: number;\r\n alignVertical?: number;\r\n sideOrientation?: number;\r\n}): VertexData {\r\n const nbFaces = 6;\r\n\r\n const faceUV: Vector4[] = options.faceUV || new Array<Vector4>(6);\r\n const faceColors = options.faceColors;\r\n\r\n const flipTile = options.pattern || Mesh.NO_FLIP;\r\n\r\n const width = options.width || options.size || 1;\r\n const height = options.height || options.size || 1;\r\n const depth = options.depth || options.size || 1;\r\n const tileWidth = options.tileWidth || options.tileSize || 1;\r\n const tileHeight = options.tileHeight || options.tileSize || 1;\r\n const alignH = options.alignHorizontal || 0;\r\n const alignV = options.alignVertical || 0;\r\n\r\n const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || VertexData.DEFAULTSIDE;\r\n\r\n // default face colors and UV if undefined\r\n for (let f = 0; f < nbFaces; f++) {\r\n if (faceUV[f] === undefined) {\r\n faceUV[f] = new Vector4(0, 0, 1, 1);\r\n }\r\n if (faceColors && faceColors[f] === undefined) {\r\n faceColors[f] = new Color4(1, 1, 1, 1);\r\n }\r\n }\r\n\r\n const halfWidth = width / 2;\r\n const halfHeight = height / 2;\r\n const halfDepth = depth / 2;\r\n\r\n const faceVertexData: Array<VertexData> = [];\r\n\r\n for (let f = 0; f < 2; f++) {\r\n //front and back\r\n faceVertexData[f] = CreateTiledPlaneVertexData({\r\n pattern: flipTile,\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n width: width,\r\n height: height,\r\n alignVertical: alignV,\r\n alignHorizontal: alignH,\r\n sideOrientation: sideOrientation,\r\n });\r\n }\r\n\r\n for (let f = 2; f < 4; f++) {\r\n //sides\r\n faceVertexData[f] = CreateTiledPlaneVertexData({\r\n pattern: flipTile,\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n width: depth,\r\n height: height,\r\n alignVertical: alignV,\r\n alignHorizontal: alignH,\r\n sideOrientation: sideOrientation,\r\n });\r\n }\r\n\r\n let baseAlignV = alignV;\r\n if (alignV === Mesh.BOTTOM) {\r\n baseAlignV = Mesh.TOP;\r\n } else if (alignV === Mesh.TOP) {\r\n baseAlignV = Mesh.BOTTOM;\r\n }\r\n\r\n for (let f = 4; f < 6; f++) {\r\n //top and bottom\r\n faceVertexData[f] = CreateTiledPlaneVertexData({\r\n pattern: flipTile,\r\n tileWidth: tileWidth,\r\n tileHeight: tileHeight,\r\n width: width,\r\n height: depth,\r\n alignVertical: baseAlignV,\r\n alignHorizontal: alignH,\r\n sideOrientation: sideOrientation,\r\n });\r\n }\r\n\r\n const positions: Array<number> = [];\r\n const normals: Array<number> = [];\r\n let uvs: Array<number> = [];\r\n let indices: Array<number> = [];\r\n const colors: Array<number> = [];\r\n const facePositions: Array<Array<Vector3>> = [];\r\n const faceNormals: Array<Array<Vector3>> = [];\r\n\r\n const newFaceUV: Array<Array<number>> = [];\r\n let lu: number = 0;\r\n\r\n let li: number = 0;\r\n\r\n for (let f = 0; f < nbFaces; f++) {\r\n const len = faceVertexData[f].positions!.length;\r\n facePositions[f] = [];\r\n faceNormals[f] = [];\r\n for (let p = 0; p < len / 3; p++) {\r\n facePositions[f].push(new Vector3(faceVertexData[f].positions![3 * p], faceVertexData[f].positions![3 * p + 1], faceVertexData[f].positions![3 * p + 2]));\r\n faceNormals[f].push(new Vector3(faceVertexData[f].normals![3 * p], faceVertexData[f].normals![3 * p + 1], faceVertexData[f].normals![3 * p + 2]));\r\n }\r\n // uvs\r\n lu = faceVertexData[f].uvs!.length;\r\n newFaceUV[f] = [];\r\n for (let i = 0; i < lu; i += 2) {\r\n newFaceUV[f][i] = faceUV[f].x + (faceUV[f].z - faceUV[f].x) * faceVertexData[f].uvs![i];\r\n newFaceUV[f][i + 1] = faceUV[f].y + (faceUV[f].w - faceUV[f].y) * faceVertexData[f].uvs![i + 1];\r\n\r\n if (useOpenGLOrientationForUV) {\r\n newFaceUV[f][i + 1] = 1.0 - newFaceUV[f][i + 1];\r\n }\r\n }\r\n uvs = uvs.concat(newFaceUV[f]);\r\n\r\n indices = indices.concat(<Array<number>>faceVertexData[f].indices!.map((x: number) => x + li));\r\n li += facePositions[f].length;\r\n if (faceColors) {\r\n const color = faceColors[f];\r\n for (let p = 0; p < facePositions[f].length; p++) {\r\n colors.push(color.r, color.g, color.b, color.a);\r\n }\r\n }\r\n }\r\n\r\n // Define transforms for each face\r\n const faceTransforms = [\r\n // FRONT\r\n { m: Matrix.RotationY(Math.PI), t: new Vector3(0, 0, halfDepth), op: OP_ADD },\r\n // BACK\r\n { m: Matrix.Identity(), t: new Vector3(0, 0, halfDepth), op: OP_SUB },\r\n // RIGHT\r\n { m: Matrix.RotationY(-Math.PI / 2), t: new Vector3(halfWidth, 0, 0), op: OP_ADD },\r\n // LEFT\r\n { m: Matrix.RotationY(Math.PI / 2), t: new Vector3(halfWidth, 0, 0), op: OP_SUB },\r\n // TOP\r\n { m: Matrix.RotationX(Math.PI / 2), t: new Vector3(0, halfHeight, 0), op: OP_ADD },\r\n // BOTTOM\r\n { m: Matrix.RotationX(-Math.PI / 2), t: new Vector3(0, halfHeight, 0), op: OP_SUB },\r\n ];\r\n\r\n // Assemble positions and normals\r\n for (let f = 0; f < nbFaces; f++) {\r\n const { m, t, op } = faceTransforms[f];\r\n\r\n for (const v of facePositions[f]) {\r\n const p = Vector3.TransformCoordinates(v, m);\r\n const final = op === OP_ADD ? p.add(t) : p.subtract(t);\r\n positions.push(final.x, final.y, final.z);\r\n }\r\n\r\n for (const n of faceNormals[f]) {\r\n const nn = Vector3.TransformNormal(n, m);\r\n normals.push(nn.x, nn.y, nn.z);\r\n }\r\n }\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n\r\n if (faceColors) {\r\n const totalColors = sideOrientation === VertexData.DOUBLESIDE ? colors.concat(colors) : colors;\r\n vertexData.colors = totalColors;\r\n }\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a tiled box mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set/tiled_box\r\n * @param name defines the name of the mesh\r\n * @param options an object used to set the following optional parameters for the tiled box, required but can be empty\r\n * * pattern sets the rotation or reflection pattern for the tiles,\r\n * * size of the box\r\n * * width of the box, overwrites size\r\n * * height of the box, overwrites size\r\n * * depth of the box, overwrites size\r\n * * tileSize sets the size of a tile\r\n * * tileWidth sets the tile width and overwrites tileSize\r\n * * tileHeight sets the tile width and overwrites tileSize\r\n * * faceUV an array of 6 Vector4 elements used to set different images to each box side\r\n * * faceColors an array of 6 Color3 elements used to set different colors to each box side\r\n * * alignHorizontal places whole tiles aligned to the center, left or right of a row\r\n * * alignVertical places whole tiles aligned to the center, left or right of a column\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * @param scene defines the hosting scene\r\n * @returns the box mesh\r\n */\r\nexport function CreateTiledBox(\r\n name: string,\r\n options: {\r\n pattern?: number;\r\n width?: number;\r\n height?: number;\r\n depth?: number;\r\n tileSize?: number;\r\n tileWidth?: number;\r\n tileHeight?: number;\r\n alignHorizontal?: number;\r\n alignVertical?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n sideOrientation?: number;\r\n updatable?: boolean;\r\n },\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const box = new Mesh(name, scene);\r\n\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n box._originalBuilderSideOrientation = options.sideOrientation;\r\n\r\n const vertexData = CreateTiledBoxVertexData(options);\r\n\r\n vertexData.applyToMesh(box, options.updatable);\r\n\r\n return box;\r\n}\r\n\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use CreateTiledBox instead\r\n */\r\nexport const TiledBoxBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateTiledBox,\r\n};\r\n\r\nVertexData.CreateTiledBox = CreateTiledBoxVertexData;\r\n"]}
@@ -18,18 +18,6 @@ import { VertexData } from "../mesh.vertexData.js";
18
18
  * * alignHorizontal places whole tiles aligned to the center, left or right of a row
19
19
  * * alignVertical places whole tiles aligned to the center, left or right of a column
20
20
  * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
21
- * @param options.pattern
22
- * @param options.tileSize
23
- * @param options.tileWidth
24
- * @param options.tileHeight
25
- * @param options.size
26
- * @param options.width
27
- * @param options.height
28
- * @param options.alignHorizontal
29
- * @param options.alignVertical
30
- * @param options.sideOrientation
31
- * @param options.frontUVs
32
- * @param options.backUVs
33
21
  * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
34
22
  * @returns the VertexData of the tiled plane
35
23
  */
@@ -64,19 +52,6 @@ export declare function CreateTiledPlaneVertexData(options: {
64
52
  * * alignVertical places whole tiles aligned to the center, left or right of a column
65
53
  * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
66
54
  * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
67
- * @param options.pattern
68
- * @param options.tileSize
69
- * @param options.tileWidth
70
- * @param options.tileHeight
71
- * @param options.size
72
- * @param options.width
73
- * @param options.height
74
- * @param options.alignHorizontal
75
- * @param options.alignVertical
76
- * @param options.sideOrientation
77
- * @param options.frontUVs
78
- * @param options.backUVs
79
- * @param options.updatable
80
55
  * @param scene defines the hosting scene
81
56
  * @returns the box mesh
82
57
  */
@@ -15,18 +15,6 @@ import { VertexData } from "../mesh.vertexData.js";
15
15
  * * alignHorizontal places whole tiles aligned to the center, left or right of a row
16
16
  * * alignVertical places whole tiles aligned to the center, left or right of a column
17
17
  * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
18
- * @param options.pattern
19
- * @param options.tileSize
20
- * @param options.tileWidth
21
- * @param options.tileHeight
22
- * @param options.size
23
- * @param options.width
24
- * @param options.height
25
- * @param options.alignHorizontal
26
- * @param options.alignVertical
27
- * @param options.sideOrientation
28
- * @param options.frontUVs
29
- * @param options.backUVs
30
18
  * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
31
19
  * @returns the VertexData of the tiled plane
32
20
  */
@@ -419,19 +407,6 @@ export function CreateTiledPlaneVertexData(options) {
419
407
  * * alignVertical places whole tiles aligned to the center, left or right of a column
420
408
  * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)
421
409
  * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)
422
- * @param options.pattern
423
- * @param options.tileSize
424
- * @param options.tileWidth
425
- * @param options.tileHeight
426
- * @param options.size
427
- * @param options.width
428
- * @param options.height
429
- * @param options.alignHorizontal
430
- * @param options.alignVertical
431
- * @param options.sideOrientation
432
- * @param options.frontUVs
433
- * @param options.backUVs
434
- * @param options.updatable
435
410
  * @param scene defines the hosting scene
436
411
  * @returns the box mesh
437
412
  */