@babylonjs/core 6.40.0 → 6.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/Animations/runtimeAnimation.js +2 -2
  2. package/Animations/runtimeAnimation.js.map +1 -1
  3. package/Debug/physicsViewer.js +2 -2
  4. package/Debug/physicsViewer.js.map +1 -1
  5. package/Engines/thinEngine.js +2 -3
  6. package/Engines/thinEngine.js.map +1 -1
  7. package/Materials/Background/backgroundMaterial.js +8 -7
  8. package/Materials/Background/backgroundMaterial.js.map +1 -1
  9. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +7 -6
  10. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  11. package/Materials/Node/nodeMaterial.js +9 -12
  12. package/Materials/Node/nodeMaterial.js.map +1 -1
  13. package/Materials/PBR/pbrBaseMaterial.js +8 -7
  14. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  15. package/Materials/drawWrapper.d.ts +15 -0
  16. package/Materials/drawWrapper.js +15 -0
  17. package/Materials/drawWrapper.js.map +1 -1
  18. package/Materials/effect.d.ts +0 -16
  19. package/Materials/effect.js +0 -16
  20. package/Materials/effect.js.map +1 -1
  21. package/Materials/effectRenderer.js +0 -1
  22. package/Materials/effectRenderer.js.map +1 -1
  23. package/Materials/material.d.ts +3 -2
  24. package/Materials/material.js +14 -12
  25. package/Materials/material.js.map +1 -1
  26. package/Materials/pushMaterial.d.ts +2 -2
  27. package/Materials/pushMaterial.js +9 -6
  28. package/Materials/pushMaterial.js.map +1 -1
  29. package/Materials/shaderMaterial.js +10 -16
  30. package/Materials/shaderMaterial.js.map +1 -1
  31. package/Materials/standardMaterial.js +8 -7
  32. package/Materials/standardMaterial.js.map +1 -1
  33. package/Meshes/Builders/boxBuilder.d.ts +0 -33
  34. package/Meshes/Builders/boxBuilder.js +0 -33
  35. package/Meshes/Builders/boxBuilder.js.map +1 -1
  36. package/Meshes/Builders/cylinderBuilder.d.ts +0 -31
  37. package/Meshes/Builders/cylinderBuilder.js +0 -31
  38. package/Meshes/Builders/cylinderBuilder.js.map +1 -1
  39. package/Meshes/Builders/decalBuilder.d.ts +0 -7
  40. package/Meshes/Builders/decalBuilder.js +0 -7
  41. package/Meshes/Builders/decalBuilder.js.map +1 -1
  42. package/Meshes/Builders/discBuilder.d.ts +0 -13
  43. package/Meshes/Builders/discBuilder.js +0 -13
  44. package/Meshes/Builders/discBuilder.js.map +1 -1
  45. package/Meshes/Builders/geodesicBuilder.d.ts +0 -13
  46. package/Meshes/Builders/geodesicBuilder.js +0 -13
  47. package/Meshes/Builders/geodesicBuilder.js.map +1 -1
  48. package/Meshes/Builders/hemisphereBuilder.d.ts +0 -3
  49. package/Meshes/Builders/hemisphereBuilder.js +0 -3
  50. package/Meshes/Builders/hemisphereBuilder.js.map +1 -1
  51. package/Meshes/Builders/icoSphereBuilder.d.ts +0 -19
  52. package/Meshes/Builders/icoSphereBuilder.js +0 -19
  53. package/Meshes/Builders/icoSphereBuilder.js.map +1 -1
  54. package/Meshes/Builders/latheBuilder.d.ts +0 -12
  55. package/Meshes/Builders/latheBuilder.js +0 -12
  56. package/Meshes/Builders/latheBuilder.js.map +1 -1
  57. package/Meshes/Builders/linesBuilder.d.ts +0 -26
  58. package/Meshes/Builders/linesBuilder.js +0 -26
  59. package/Meshes/Builders/linesBuilder.js.map +1 -1
  60. package/Meshes/Builders/planeBuilder.d.ts +0 -14
  61. package/Meshes/Builders/planeBuilder.js +0 -14
  62. package/Meshes/Builders/planeBuilder.js.map +1 -1
  63. package/Meshes/Builders/polygonBuilder.d.ts +0 -21
  64. package/Meshes/Builders/polygonBuilder.js +0 -21
  65. package/Meshes/Builders/polygonBuilder.js.map +1 -1
  66. package/Meshes/Builders/polyhedronBuilder.d.ts +0 -25
  67. package/Meshes/Builders/polyhedronBuilder.js +0 -25
  68. package/Meshes/Builders/polyhedronBuilder.js.map +1 -1
  69. package/Meshes/Builders/ribbonBuilder.d.ts +0 -22
  70. package/Meshes/Builders/ribbonBuilder.js +0 -22
  71. package/Meshes/Builders/ribbonBuilder.js.map +1 -1
  72. package/Meshes/Builders/shapeBuilder.d.ts +0 -32
  73. package/Meshes/Builders/shapeBuilder.js +0 -32
  74. package/Meshes/Builders/shapeBuilder.js.map +1 -1
  75. package/Meshes/Builders/sphereBuilder.d.ts +0 -22
  76. package/Meshes/Builders/sphereBuilder.js +0 -22
  77. package/Meshes/Builders/sphereBuilder.js.map +1 -1
  78. package/Meshes/Node/Blocks/geometryDesaturateBlock.d.ts +30 -0
  79. package/Meshes/Node/Blocks/geometryDesaturateBlock.js +62 -0
  80. package/Meshes/Node/Blocks/geometryDesaturateBlock.js.map +1 -0
  81. package/Meshes/Node/index.d.ts +1 -0
  82. package/Meshes/Node/index.js +1 -0
  83. package/Meshes/Node/index.js.map +1 -1
  84. package/Meshes/abstractMesh.js +1 -0
  85. package/Meshes/abstractMesh.js.map +1 -1
  86. package/Meshes/mesh.js +4 -4
  87. package/Meshes/mesh.js.map +1 -1
  88. package/Physics/castingResult.d.ts +66 -0
  89. package/Physics/castingResult.js +61 -0
  90. package/Physics/castingResult.js.map +1 -0
  91. package/Physics/index.d.ts +4 -0
  92. package/Physics/index.js +4 -0
  93. package/Physics/index.js.map +1 -1
  94. package/Physics/physicsPointProximityQuery.d.ts +28 -0
  95. package/Physics/physicsPointProximityQuery.js +2 -0
  96. package/Physics/physicsPointProximityQuery.js.map +1 -0
  97. package/Physics/physicsRaycastResult.d.ts +2 -44
  98. package/Physics/physicsRaycastResult.js +7 -38
  99. package/Physics/physicsRaycastResult.js.map +1 -1
  100. package/Physics/physicsShapeCastQuery.d.ts +32 -0
  101. package/Physics/physicsShapeCastQuery.js +2 -0
  102. package/Physics/physicsShapeCastQuery.js.map +1 -0
  103. package/Physics/physicsShapeProximityCastQuery.d.ts +32 -0
  104. package/Physics/physicsShapeProximityCastQuery.js +2 -0
  105. package/Physics/physicsShapeProximityCastQuery.js.map +1 -0
  106. package/Physics/proximityCastResult.d.ts +20 -0
  107. package/Physics/proximityCastResult.js +31 -0
  108. package/Physics/proximityCastResult.js.map +1 -0
  109. package/Physics/shapeCastResult.d.ts +16 -0
  110. package/Physics/shapeCastResult.js +24 -0
  111. package/Physics/shapeCastResult.js.map +1 -0
  112. package/Physics/v2/Plugins/havokPlugin.d.ts +28 -0
  113. package/Physics/v2/Plugins/havokPlugin.js +80 -11
  114. package/Physics/v2/Plugins/havokPlugin.js.map +1 -1
  115. package/XR/features/WebXRHandTracking.d.ts +2 -2
  116. package/XR/features/WebXRHandTracking.js +4 -5
  117. package/XR/features/WebXRHandTracking.js.map +1 -1
  118. package/XR/features/WebXRNearInteraction.js +25 -15
  119. package/XR/features/WebXRNearInteraction.js.map +1 -1
  120. package/XR/webXRCamera.d.ts +1 -0
  121. package/XR/webXRCamera.js +19 -8
  122. package/XR/webXRCamera.js.map +1 -1
  123. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"icoSphereBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/icoSphereBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAUzC;IACG,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,UAAU,CAAC,WAAW,CAAC;IAC1E,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;IACnC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,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BG;AACH,MAAM,UAAU,eAAe,CAC3B,IAAY,EACZ,UAWI,EAAE,EACN,QAAyB,IAAI;IAE7B,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAErC,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACnF,MAAM,CAAC,+BAA+B,GAAG,OAAO,CAAC,eAAe,CAAC;IAEjE,MAAM,UAAU,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAEtD,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAElD,OAAO,MAAM,CAAC;AAClB,CAAC;AACD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,gEAAgE;IAChE,eAAe;CAClB,CAAC;AAEF,UAAU,CAAC,eAAe,GAAG,yBAAyB,CAAC;AAEvD,IAAI,CAAC,eAAe,GAAG,CAAC,IAAY,EAAE,OAAkH,EAAE,KAAY,EAAQ,EAAE;IAC5K,OAAO,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC,CAAC","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport type { Vector4 } from \"../../Maths/math.vector\";\r\nimport { Vector3, Vector2 } from \"../../Maths/math.vector\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\n\r\n/**\r\n * Creates the VertexData of the IcoSphere\r\n * @param options an object used to set the following optional parameters for the IcoSphere, required but can be empty\r\n * * radius the radius of the IcoSphere, optional default 1\r\n * * radiusX allows stretching in the x direction, optional, default radius\r\n * * radiusY allows stretching in the y direction, optional, default radius\r\n * * radiusZ allows stretching in the z direction, optional, default radius\r\n * * flat when true creates a flat shaded mesh, optional, default true\r\n * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * * 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)\r\n * * 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)\r\n * @param options.radius\r\n * @param options.radiusX\r\n * @param options.radiusY\r\n * @param options.radiusZ\r\n * @param options.flat\r\n * @param options.subdivisions\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @returns the VertexData of the IcoSphere\r\n */\r\nexport function CreateIcoSphereVertexData(options: {\r\n radius?: number;\r\n radiusX?: number;\r\n radiusY?: number;\r\n radiusZ?: number;\r\n flat?: boolean;\r\n subdivisions?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n}): VertexData {\r\n const sideOrientation = options.sideOrientation || VertexData.DEFAULTSIDE;\r\n const radius = options.radius || 1;\r\n const flat = options.flat === undefined ? true : options.flat;\r\n const subdivisions = (options.subdivisions || 4) | 0;\r\n const radiusX = options.radiusX || radius;\r\n const radiusY = options.radiusY || radius;\r\n const radiusZ = options.radiusZ || radius;\r\n\r\n const t = (1 + Math.sqrt(5)) / 2;\r\n\r\n // 12 vertex x,y,z\r\n const icoVertices = [\r\n -1,\r\n t,\r\n -0,\r\n 1,\r\n t,\r\n 0,\r\n -1,\r\n -t,\r\n 0,\r\n 1,\r\n -t,\r\n 0, // v0-3\r\n 0,\r\n -1,\r\n -t,\r\n 0,\r\n 1,\r\n -t,\r\n 0,\r\n -1,\r\n t,\r\n 0,\r\n 1,\r\n t, // v4-7\r\n t,\r\n 0,\r\n 1,\r\n t,\r\n 0,\r\n -1,\r\n -t,\r\n 0,\r\n 1,\r\n -t,\r\n 0,\r\n -1, // v8-11\r\n ];\r\n\r\n // index of 3 vertex makes a face of icopshere\r\n const ico_indices = [\r\n 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 12, 22, 23, 1, 5, 20, 5, 11, 4, 23, 22, 13, 22, 18, 6, 7, 1, 8, 14, 21, 4, 14, 4, 2, 16, 13, 6, 15, 6, 19, 3, 8, 9, 4, 21, 5, 13, 17,\r\n 23, 6, 13, 22, 19, 6, 18, 9, 8, 1,\r\n ];\r\n // vertex for uv have aliased position, not for UV\r\n const vertices_unalias_id = [\r\n 0,\r\n 1,\r\n 2,\r\n 3,\r\n 4,\r\n 5,\r\n 6,\r\n 7,\r\n 8,\r\n 9,\r\n 10,\r\n 11,\r\n // vertex alias\r\n 0, // 12: 0 + 12\r\n 2, // 13: 2 + 11\r\n 3, // 14: 3 + 11\r\n 3, // 15: 3 + 12\r\n 3, // 16: 3 + 13\r\n 4, // 17: 4 + 13\r\n 7, // 18: 7 + 11\r\n 8, // 19: 8 + 11\r\n 9, // 20: 9 + 11\r\n 9, // 21: 9 + 12\r\n 10, // 22: A + 12\r\n 11, // 23: B + 12\r\n ];\r\n\r\n // uv as integer step (not pixels !)\r\n const ico_vertexuv = [\r\n 5,\r\n 1,\r\n 3,\r\n 1,\r\n 6,\r\n 4,\r\n 0,\r\n 0, // v0-3\r\n 5,\r\n 3,\r\n 4,\r\n 2,\r\n 2,\r\n 2,\r\n 4,\r\n 0, // v4-7\r\n 2,\r\n 0,\r\n 1,\r\n 1,\r\n 6,\r\n 0,\r\n 6,\r\n 2, // v8-11\r\n // vertex alias (for same vertex on different faces)\r\n 0,\r\n 4, // 12: 0 + 12\r\n 3,\r\n 3, // 13: 2 + 11\r\n 4,\r\n 4, // 14: 3 + 11\r\n 3,\r\n 1, // 15: 3 + 12\r\n 4,\r\n 2, // 16: 3 + 13\r\n 4,\r\n 4, // 17: 4 + 13\r\n 0,\r\n 2, // 18: 7 + 11\r\n 1,\r\n 1, // 19: 8 + 11\r\n 2,\r\n 2, // 20: 9 + 11\r\n 3,\r\n 3, // 21: 9 + 12\r\n 1,\r\n 3, // 22: A + 12\r\n 2,\r\n 4, // 23: B + 12\r\n ];\r\n\r\n // Vertices[0, 1, ...9, A, B] : position on UV plane\r\n // '+' indicate duplicate position to be fixed (3,9:0,2,3,4,7,8,A,B)\r\n // First island of uv mapping\r\n // v = 4h 3+ 2\r\n // v = 3h 9+ 4\r\n // v = 2h 9+ 5 B\r\n // v = 1h 9 1 0\r\n // v = 0h 3 8 7 A\r\n // u = 0 1 2 3 4 5 6 *a\r\n\r\n // Second island of uv mapping\r\n // v = 4h 0+ B+ 4+\r\n // v = 3h A+ 2+\r\n // v = 2h 7+ 6 3+\r\n // v = 1h 8+ 3+\r\n // v = 0h\r\n // u = 0 1 2 3 4 5 6 *a\r\n\r\n // Face layout on texture UV mapping\r\n // ============\r\n // \\ 4 /\\ 16 / ======\r\n // \\ / \\ / /\\ 11 /\r\n // \\/ 7 \\/ / \\ /\r\n // ======= / 10 \\/\r\n // /\\ 17 /\\ =======\r\n // / \\ / \\ \\ 15 /\\\r\n // / 8 \\/ 12 \\ \\ / \\\r\n // ============ \\/ 6 \\\r\n // \\ 18 /\\ ============\r\n // \\ / \\ \\ 5 /\\ 0 /\r\n // \\/ 13 \\ \\ / \\ /\r\n // ======= \\/ 1 \\/\r\n // =============\r\n // /\\ 19 /\\ 2 /\\\r\n // / \\ / \\ / \\\r\n // / 14 \\/ 9 \\/ 3 \\\r\n // ===================\r\n\r\n // uv step is u:1 or 0.5, v:cos(30)=sqrt(3)/2, ratio approx is 84/97\r\n const ustep = 138 / 1024;\r\n const vstep = 239 / 1024;\r\n const uoffset = 60 / 1024;\r\n const voffset = 26 / 1024;\r\n // Second island should have margin, not to touch the first island\r\n // avoid any borderline artefact in pixel rounding\r\n const island_u_offset = -40 / 1024;\r\n const island_v_offset = +20 / 1024;\r\n // face is either island 0 or 1 :\r\n // second island is for faces : [4, 7, 8, 12, 13, 16, 17, 18]\r\n const island = [\r\n 0,\r\n 0,\r\n 0,\r\n 0,\r\n 1, // 0 - 4\r\n 0,\r\n 0,\r\n 1,\r\n 1,\r\n 0, // 5 - 9\r\n 0,\r\n 0,\r\n 1,\r\n 1,\r\n 0, // 10 - 14\r\n 0,\r\n 1,\r\n 1,\r\n 1,\r\n 0, // 15 - 19\r\n ];\r\n\r\n const indices: number[] = [];\r\n const positions: number[] = [];\r\n const normals: number[] = [];\r\n const uvs: number[] = [];\r\n\r\n let current_indice = 0;\r\n // prepare array of 3 vector (empty) (to be worked in place, shared for each face)\r\n const face_vertex_pos = new Array(3);\r\n const face_vertex_uv = new Array(3);\r\n let v012;\r\n for (v012 = 0; v012 < 3; v012++) {\r\n face_vertex_pos[v012] = Vector3.Zero();\r\n face_vertex_uv[v012] = Vector2.Zero();\r\n }\r\n // create all with normals\r\n for (let face = 0; face < 20; face++) {\r\n // 3 vertex per face\r\n for (v012 = 0; v012 < 3; v012++) {\r\n // look up vertex 0,1,2 to its index in 0 to 11 (or 23 including alias)\r\n const v_id = ico_indices[3 * face + v012];\r\n // vertex have 3D position (x,y,z)\r\n face_vertex_pos[v012].copyFromFloats(\r\n icoVertices[3 * vertices_unalias_id[v_id]],\r\n icoVertices[3 * vertices_unalias_id[v_id] + 1],\r\n icoVertices[3 * vertices_unalias_id[v_id] + 2]\r\n );\r\n // Normalize to get normal\r\n face_vertex_pos[v012].normalize();\r\n\r\n // uv Coordinates from vertex ID\r\n face_vertex_uv[v012].copyFromFloats(\r\n ico_vertexuv[2 * v_id] * ustep + uoffset + island[face] * island_u_offset,\r\n ico_vertexuv[2 * v_id + 1] * vstep + voffset + island[face] * island_v_offset\r\n );\r\n }\r\n\r\n // Subdivide the face (interpolate pos, norm, uv)\r\n // - pos is linear interpolation, then projected to sphere (converge polyhedron to sphere)\r\n // - norm is linear interpolation of vertex corner normal\r\n // (to be checked if better to re-calc from face vertex, or if approximation is OK ??? )\r\n // - uv is linear interpolation\r\n //\r\n // Topology is as below for sub-divide by 2\r\n // vertex shown as v0,v1,v2\r\n // interp index is i1 to progress in range [v0,v1[\r\n // interp index is i2 to progress in range [v0,v2[\r\n // face index as (i1,i2) for /\\ : (i1,i2),(i1+1,i2),(i1,i2+1)\r\n // and (i1,i2)' for \\/ : (i1+1,i2),(i1+1,i2+1),(i1,i2+1)\r\n //\r\n //\r\n // i2 v2\r\n // ^ ^\r\n // / / \\\r\n // / / \\\r\n // / / \\\r\n // / / (0,1) \\\r\n // / #---------\\\r\n // / / \\ (0,0)'/ \\\r\n // / / \\ / \\\r\n // / / \\ / \\\r\n // / / (0,0) \\ / (1,0) \\\r\n // / #---------#---------\\\r\n // v0 v1\r\n //\r\n // --------------------> i1\r\n //\r\n // interp of (i1,i2):\r\n // along i2 : x0=lerp(v0,v2, i2/S) <---> x1=lerp(v1,v2, i2/S)\r\n // along i1 : lerp(x0,x1, i1/(S-i2))\r\n //\r\n // centroid of triangle is needed to get help normal computation\r\n // (c1,c2) are used for centroid location\r\n\r\n const interp_vertex = (i1: number, i2: number, c1: number, c2: number) => {\r\n // vertex is interpolated from\r\n // - face_vertex_pos[0..2]\r\n // - face_vertex_uv[0..2]\r\n const pos_x0 = Vector3.Lerp(face_vertex_pos[0], face_vertex_pos[2], i2 / subdivisions);\r\n const pos_x1 = Vector3.Lerp(face_vertex_pos[1], face_vertex_pos[2], i2 / subdivisions);\r\n const pos_interp = subdivisions === i2 ? face_vertex_pos[2] : Vector3.Lerp(pos_x0, pos_x1, i1 / (subdivisions - i2));\r\n pos_interp.normalize();\r\n\r\n let vertex_normal;\r\n if (flat) {\r\n // in flat mode, recalculate normal as face centroid normal\r\n const centroid_x0 = Vector3.Lerp(face_vertex_pos[0], face_vertex_pos[2], c2 / subdivisions);\r\n const centroid_x1 = Vector3.Lerp(face_vertex_pos[1], face_vertex_pos[2], c2 / subdivisions);\r\n vertex_normal = Vector3.Lerp(centroid_x0, centroid_x1, c1 / (subdivisions - c2));\r\n } else {\r\n // in smooth mode, recalculate normal from each single vertex position\r\n vertex_normal = new Vector3(pos_interp.x, pos_interp.y, pos_interp.z);\r\n }\r\n // Vertex normal need correction due to X,Y,Z radius scaling\r\n vertex_normal.x /= radiusX;\r\n vertex_normal.y /= radiusY;\r\n vertex_normal.z /= radiusZ;\r\n vertex_normal.normalize();\r\n\r\n const uv_x0 = Vector2.Lerp(face_vertex_uv[0], face_vertex_uv[2], i2 / subdivisions);\r\n const uv_x1 = Vector2.Lerp(face_vertex_uv[1], face_vertex_uv[2], i2 / subdivisions);\r\n const uv_interp = subdivisions === i2 ? face_vertex_uv[2] : Vector2.Lerp(uv_x0, uv_x1, i1 / (subdivisions - i2));\r\n positions.push(pos_interp.x * radiusX, pos_interp.y * radiusY, pos_interp.z * radiusZ);\r\n normals.push(vertex_normal.x, vertex_normal.y, vertex_normal.z);\r\n uvs.push(uv_interp.x, CompatibilityOptions.UseOpenGLOrientationForUV ? 1.0 - uv_interp.y : uv_interp.y);\r\n // push each vertex has member of a face\r\n // Same vertex can belong to multiple face, it is pushed multiple time (duplicate vertex are present)\r\n indices.push(current_indice);\r\n current_indice++;\r\n };\r\n\r\n for (let i2 = 0; i2 < subdivisions; i2++) {\r\n for (let i1 = 0; i1 + i2 < subdivisions; i1++) {\r\n // face : (i1,i2) for /\\ :\r\n // interp for : (i1,i2),(i1+1,i2),(i1,i2+1)\r\n interp_vertex(i1, i2, i1 + 1.0 / 3, i2 + 1.0 / 3);\r\n interp_vertex(i1 + 1, i2, i1 + 1.0 / 3, i2 + 1.0 / 3);\r\n interp_vertex(i1, i2 + 1, i1 + 1.0 / 3, i2 + 1.0 / 3);\r\n if (i1 + i2 + 1 < subdivisions) {\r\n // face : (i1,i2)' for \\/ :\r\n // interp for (i1+1,i2),(i1+1,i2+1),(i1,i2+1)\r\n interp_vertex(i1 + 1, i2, i1 + 2.0 / 3, i2 + 2.0 / 3);\r\n interp_vertex(i1 + 1, i2 + 1, i1 + 2.0 / 3, i2 + 2.0 / 3);\r\n interp_vertex(i1, i2 + 1, i1 + 2.0 / 3, i2 + 2.0 / 3);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided\r\n * * The parameter `radius` sets the radius size (float) of the icosphere (default 1)\r\n * * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value of `radius`)\r\n * * The parameter `subdivisions` sets the number of subdivisions (positive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size\r\n * * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface\r\n * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\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.radius\r\n * @param options.radiusX\r\n * @param options.radiusY\r\n * @param options.radiusZ\r\n * @param options.flat\r\n * @param options.subdivisions\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param options.updatable\r\n * @param scene defines the hosting scene\r\n * @returns the icosahedron mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra#icosphere\r\n */\r\nexport function CreateIcoSphere(\r\n name: string,\r\n options: {\r\n radius?: number;\r\n radiusX?: number;\r\n radiusY?: number;\r\n radiusZ?: number;\r\n flat?: boolean;\r\n subdivisions?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n updatable?: boolean;\r\n } = {},\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const sphere = new Mesh(name, scene);\r\n\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n sphere._originalBuilderSideOrientation = options.sideOrientation;\r\n\r\n const vertexData = CreateIcoSphereVertexData(options);\r\n\r\n vertexData.applyToMesh(sphere, options.updatable);\r\n\r\n return sphere;\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the function directly from the module\r\n */\r\nexport const IcoSphereBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateIcoSphere,\r\n};\r\n\r\nVertexData.CreateIcoSphere = CreateIcoSphereVertexData;\r\n\r\nMesh.CreateIcoSphere = (name: string, options: { radius?: number; flat?: boolean; subdivisions?: number; sideOrientation?: number; updatable?: boolean }, scene: Scene): Mesh => {\r\n return CreateIcoSphere(name, options, scene);\r\n};\r\n"]}
1
+ {"version":3,"file":"icoSphereBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/icoSphereBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAUzC;IACG,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,UAAU,CAAC,WAAW,CAAC;IAC1E,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;IACnC,MAAM,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GAAG,GAAG,GAAG,CAAC;IACrB,OAAO,UAAU,CAAC;AACtB,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAC3B,IAAY,EACZ,UAWI,EAAE,EACN,QAAyB,IAAI;IAE7B,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAErC,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACnF,MAAM,CAAC,+BAA+B,GAAG,OAAO,CAAC,eAAe,CAAC;IAEjE,MAAM,UAAU,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAEtD,UAAU,CAAC,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAElD,OAAO,MAAM,CAAC;AAClB,CAAC;AACD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B,gEAAgE;IAChE,eAAe;CAClB,CAAC;AAEF,UAAU,CAAC,eAAe,GAAG,yBAAyB,CAAC;AAEvD,IAAI,CAAC,eAAe,GAAG,CAAC,IAAY,EAAE,OAAkH,EAAE,KAAY,EAAQ,EAAE;IAC5K,OAAO,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC,CAAC","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport type { Vector4 } from \"../../Maths/math.vector\";\r\nimport { Vector3, Vector2 } from \"../../Maths/math.vector\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\n\r\n/**\r\n * Creates the VertexData of the IcoSphere\r\n * @param options an object used to set the following optional parameters for the IcoSphere, required but can be empty\r\n * * radius the radius of the IcoSphere, optional default 1\r\n * * radiusX allows stretching in the x direction, optional, default radius\r\n * * radiusY allows stretching in the y direction, optional, default radius\r\n * * radiusZ allows stretching in the z direction, optional, default radius\r\n * * flat when true creates a flat shaded mesh, optional, default true\r\n * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * * 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)\r\n * * 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)\r\n * @returns the VertexData of the IcoSphere\r\n */\r\nexport function CreateIcoSphereVertexData(options: {\r\n radius?: number;\r\n radiusX?: number;\r\n radiusY?: number;\r\n radiusZ?: number;\r\n flat?: boolean;\r\n subdivisions?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n}): VertexData {\r\n const sideOrientation = options.sideOrientation || VertexData.DEFAULTSIDE;\r\n const radius = options.radius || 1;\r\n const flat = options.flat === undefined ? true : options.flat;\r\n const subdivisions = (options.subdivisions || 4) | 0;\r\n const radiusX = options.radiusX || radius;\r\n const radiusY = options.radiusY || radius;\r\n const radiusZ = options.radiusZ || radius;\r\n\r\n const t = (1 + Math.sqrt(5)) / 2;\r\n\r\n // 12 vertex x,y,z\r\n const icoVertices = [\r\n -1,\r\n t,\r\n -0,\r\n 1,\r\n t,\r\n 0,\r\n -1,\r\n -t,\r\n 0,\r\n 1,\r\n -t,\r\n 0, // v0-3\r\n 0,\r\n -1,\r\n -t,\r\n 0,\r\n 1,\r\n -t,\r\n 0,\r\n -1,\r\n t,\r\n 0,\r\n 1,\r\n t, // v4-7\r\n t,\r\n 0,\r\n 1,\r\n t,\r\n 0,\r\n -1,\r\n -t,\r\n 0,\r\n 1,\r\n -t,\r\n 0,\r\n -1, // v8-11\r\n ];\r\n\r\n // index of 3 vertex makes a face of icopshere\r\n const ico_indices = [\r\n 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 12, 22, 23, 1, 5, 20, 5, 11, 4, 23, 22, 13, 22, 18, 6, 7, 1, 8, 14, 21, 4, 14, 4, 2, 16, 13, 6, 15, 6, 19, 3, 8, 9, 4, 21, 5, 13, 17,\r\n 23, 6, 13, 22, 19, 6, 18, 9, 8, 1,\r\n ];\r\n // vertex for uv have aliased position, not for UV\r\n const vertices_unalias_id = [\r\n 0,\r\n 1,\r\n 2,\r\n 3,\r\n 4,\r\n 5,\r\n 6,\r\n 7,\r\n 8,\r\n 9,\r\n 10,\r\n 11,\r\n // vertex alias\r\n 0, // 12: 0 + 12\r\n 2, // 13: 2 + 11\r\n 3, // 14: 3 + 11\r\n 3, // 15: 3 + 12\r\n 3, // 16: 3 + 13\r\n 4, // 17: 4 + 13\r\n 7, // 18: 7 + 11\r\n 8, // 19: 8 + 11\r\n 9, // 20: 9 + 11\r\n 9, // 21: 9 + 12\r\n 10, // 22: A + 12\r\n 11, // 23: B + 12\r\n ];\r\n\r\n // uv as integer step (not pixels !)\r\n const ico_vertexuv = [\r\n 5,\r\n 1,\r\n 3,\r\n 1,\r\n 6,\r\n 4,\r\n 0,\r\n 0, // v0-3\r\n 5,\r\n 3,\r\n 4,\r\n 2,\r\n 2,\r\n 2,\r\n 4,\r\n 0, // v4-7\r\n 2,\r\n 0,\r\n 1,\r\n 1,\r\n 6,\r\n 0,\r\n 6,\r\n 2, // v8-11\r\n // vertex alias (for same vertex on different faces)\r\n 0,\r\n 4, // 12: 0 + 12\r\n 3,\r\n 3, // 13: 2 + 11\r\n 4,\r\n 4, // 14: 3 + 11\r\n 3,\r\n 1, // 15: 3 + 12\r\n 4,\r\n 2, // 16: 3 + 13\r\n 4,\r\n 4, // 17: 4 + 13\r\n 0,\r\n 2, // 18: 7 + 11\r\n 1,\r\n 1, // 19: 8 + 11\r\n 2,\r\n 2, // 20: 9 + 11\r\n 3,\r\n 3, // 21: 9 + 12\r\n 1,\r\n 3, // 22: A + 12\r\n 2,\r\n 4, // 23: B + 12\r\n ];\r\n\r\n // Vertices[0, 1, ...9, A, B] : position on UV plane\r\n // '+' indicate duplicate position to be fixed (3,9:0,2,3,4,7,8,A,B)\r\n // First island of uv mapping\r\n // v = 4h 3+ 2\r\n // v = 3h 9+ 4\r\n // v = 2h 9+ 5 B\r\n // v = 1h 9 1 0\r\n // v = 0h 3 8 7 A\r\n // u = 0 1 2 3 4 5 6 *a\r\n\r\n // Second island of uv mapping\r\n // v = 4h 0+ B+ 4+\r\n // v = 3h A+ 2+\r\n // v = 2h 7+ 6 3+\r\n // v = 1h 8+ 3+\r\n // v = 0h\r\n // u = 0 1 2 3 4 5 6 *a\r\n\r\n // Face layout on texture UV mapping\r\n // ============\r\n // \\ 4 /\\ 16 / ======\r\n // \\ / \\ / /\\ 11 /\r\n // \\/ 7 \\/ / \\ /\r\n // ======= / 10 \\/\r\n // /\\ 17 /\\ =======\r\n // / \\ / \\ \\ 15 /\\\r\n // / 8 \\/ 12 \\ \\ / \\\r\n // ============ \\/ 6 \\\r\n // \\ 18 /\\ ============\r\n // \\ / \\ \\ 5 /\\ 0 /\r\n // \\/ 13 \\ \\ / \\ /\r\n // ======= \\/ 1 \\/\r\n // =============\r\n // /\\ 19 /\\ 2 /\\\r\n // / \\ / \\ / \\\r\n // / 14 \\/ 9 \\/ 3 \\\r\n // ===================\r\n\r\n // uv step is u:1 or 0.5, v:cos(30)=sqrt(3)/2, ratio approx is 84/97\r\n const ustep = 138 / 1024;\r\n const vstep = 239 / 1024;\r\n const uoffset = 60 / 1024;\r\n const voffset = 26 / 1024;\r\n // Second island should have margin, not to touch the first island\r\n // avoid any borderline artefact in pixel rounding\r\n const island_u_offset = -40 / 1024;\r\n const island_v_offset = +20 / 1024;\r\n // face is either island 0 or 1 :\r\n // second island is for faces : [4, 7, 8, 12, 13, 16, 17, 18]\r\n const island = [\r\n 0,\r\n 0,\r\n 0,\r\n 0,\r\n 1, // 0 - 4\r\n 0,\r\n 0,\r\n 1,\r\n 1,\r\n 0, // 5 - 9\r\n 0,\r\n 0,\r\n 1,\r\n 1,\r\n 0, // 10 - 14\r\n 0,\r\n 1,\r\n 1,\r\n 1,\r\n 0, // 15 - 19\r\n ];\r\n\r\n const indices: number[] = [];\r\n const positions: number[] = [];\r\n const normals: number[] = [];\r\n const uvs: number[] = [];\r\n\r\n let current_indice = 0;\r\n // prepare array of 3 vector (empty) (to be worked in place, shared for each face)\r\n const face_vertex_pos = new Array(3);\r\n const face_vertex_uv = new Array(3);\r\n let v012;\r\n for (v012 = 0; v012 < 3; v012++) {\r\n face_vertex_pos[v012] = Vector3.Zero();\r\n face_vertex_uv[v012] = Vector2.Zero();\r\n }\r\n // create all with normals\r\n for (let face = 0; face < 20; face++) {\r\n // 3 vertex per face\r\n for (v012 = 0; v012 < 3; v012++) {\r\n // look up vertex 0,1,2 to its index in 0 to 11 (or 23 including alias)\r\n const v_id = ico_indices[3 * face + v012];\r\n // vertex have 3D position (x,y,z)\r\n face_vertex_pos[v012].copyFromFloats(\r\n icoVertices[3 * vertices_unalias_id[v_id]],\r\n icoVertices[3 * vertices_unalias_id[v_id] + 1],\r\n icoVertices[3 * vertices_unalias_id[v_id] + 2]\r\n );\r\n // Normalize to get normal\r\n face_vertex_pos[v012].normalize();\r\n\r\n // uv Coordinates from vertex ID\r\n face_vertex_uv[v012].copyFromFloats(\r\n ico_vertexuv[2 * v_id] * ustep + uoffset + island[face] * island_u_offset,\r\n ico_vertexuv[2 * v_id + 1] * vstep + voffset + island[face] * island_v_offset\r\n );\r\n }\r\n\r\n // Subdivide the face (interpolate pos, norm, uv)\r\n // - pos is linear interpolation, then projected to sphere (converge polyhedron to sphere)\r\n // - norm is linear interpolation of vertex corner normal\r\n // (to be checked if better to re-calc from face vertex, or if approximation is OK ??? )\r\n // - uv is linear interpolation\r\n //\r\n // Topology is as below for sub-divide by 2\r\n // vertex shown as v0,v1,v2\r\n // interp index is i1 to progress in range [v0,v1[\r\n // interp index is i2 to progress in range [v0,v2[\r\n // face index as (i1,i2) for /\\ : (i1,i2),(i1+1,i2),(i1,i2+1)\r\n // and (i1,i2)' for \\/ : (i1+1,i2),(i1+1,i2+1),(i1,i2+1)\r\n //\r\n //\r\n // i2 v2\r\n // ^ ^\r\n // / / \\\r\n // / / \\\r\n // / / \\\r\n // / / (0,1) \\\r\n // / #---------\\\r\n // / / \\ (0,0)'/ \\\r\n // / / \\ / \\\r\n // / / \\ / \\\r\n // / / (0,0) \\ / (1,0) \\\r\n // / #---------#---------\\\r\n // v0 v1\r\n //\r\n // --------------------> i1\r\n //\r\n // interp of (i1,i2):\r\n // along i2 : x0=lerp(v0,v2, i2/S) <---> x1=lerp(v1,v2, i2/S)\r\n // along i1 : lerp(x0,x1, i1/(S-i2))\r\n //\r\n // centroid of triangle is needed to get help normal computation\r\n // (c1,c2) are used for centroid location\r\n\r\n const interp_vertex = (i1: number, i2: number, c1: number, c2: number) => {\r\n // vertex is interpolated from\r\n // - face_vertex_pos[0..2]\r\n // - face_vertex_uv[0..2]\r\n const pos_x0 = Vector3.Lerp(face_vertex_pos[0], face_vertex_pos[2], i2 / subdivisions);\r\n const pos_x1 = Vector3.Lerp(face_vertex_pos[1], face_vertex_pos[2], i2 / subdivisions);\r\n const pos_interp = subdivisions === i2 ? face_vertex_pos[2] : Vector3.Lerp(pos_x0, pos_x1, i1 / (subdivisions - i2));\r\n pos_interp.normalize();\r\n\r\n let vertex_normal;\r\n if (flat) {\r\n // in flat mode, recalculate normal as face centroid normal\r\n const centroid_x0 = Vector3.Lerp(face_vertex_pos[0], face_vertex_pos[2], c2 / subdivisions);\r\n const centroid_x1 = Vector3.Lerp(face_vertex_pos[1], face_vertex_pos[2], c2 / subdivisions);\r\n vertex_normal = Vector3.Lerp(centroid_x0, centroid_x1, c1 / (subdivisions - c2));\r\n } else {\r\n // in smooth mode, recalculate normal from each single vertex position\r\n vertex_normal = new Vector3(pos_interp.x, pos_interp.y, pos_interp.z);\r\n }\r\n // Vertex normal need correction due to X,Y,Z radius scaling\r\n vertex_normal.x /= radiusX;\r\n vertex_normal.y /= radiusY;\r\n vertex_normal.z /= radiusZ;\r\n vertex_normal.normalize();\r\n\r\n const uv_x0 = Vector2.Lerp(face_vertex_uv[0], face_vertex_uv[2], i2 / subdivisions);\r\n const uv_x1 = Vector2.Lerp(face_vertex_uv[1], face_vertex_uv[2], i2 / subdivisions);\r\n const uv_interp = subdivisions === i2 ? face_vertex_uv[2] : Vector2.Lerp(uv_x0, uv_x1, i1 / (subdivisions - i2));\r\n positions.push(pos_interp.x * radiusX, pos_interp.y * radiusY, pos_interp.z * radiusZ);\r\n normals.push(vertex_normal.x, vertex_normal.y, vertex_normal.z);\r\n uvs.push(uv_interp.x, CompatibilityOptions.UseOpenGLOrientationForUV ? 1.0 - uv_interp.y : uv_interp.y);\r\n // push each vertex has member of a face\r\n // Same vertex can belong to multiple face, it is pushed multiple time (duplicate vertex are present)\r\n indices.push(current_indice);\r\n current_indice++;\r\n };\r\n\r\n for (let i2 = 0; i2 < subdivisions; i2++) {\r\n for (let i1 = 0; i1 + i2 < subdivisions; i1++) {\r\n // face : (i1,i2) for /\\ :\r\n // interp for : (i1,i2),(i1+1,i2),(i1,i2+1)\r\n interp_vertex(i1, i2, i1 + 1.0 / 3, i2 + 1.0 / 3);\r\n interp_vertex(i1 + 1, i2, i1 + 1.0 / 3, i2 + 1.0 / 3);\r\n interp_vertex(i1, i2 + 1, i1 + 1.0 / 3, i2 + 1.0 / 3);\r\n if (i1 + i2 + 1 < subdivisions) {\r\n // face : (i1,i2)' for \\/ :\r\n // interp for (i1+1,i2),(i1+1,i2+1),(i1,i2+1)\r\n interp_vertex(i1 + 1, i2, i1 + 2.0 / 3, i2 + 2.0 / 3);\r\n interp_vertex(i1 + 1, i2 + 1, i1 + 2.0 / 3, i2 + 2.0 / 3);\r\n interp_vertex(i1, i2 + 1, i1 + 2.0 / 3, i2 + 2.0 / 3);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided\r\n * * The parameter `radius` sets the radius size (float) of the icosphere (default 1)\r\n * * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value of `radius`)\r\n * * The parameter `subdivisions` sets the number of subdivisions (positive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size\r\n * * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface\r\n * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\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 scene defines the hosting scene\r\n * @returns the icosahedron mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra#icosphere\r\n */\r\nexport function CreateIcoSphere(\r\n name: string,\r\n options: {\r\n radius?: number;\r\n radiusX?: number;\r\n radiusY?: number;\r\n radiusZ?: number;\r\n flat?: boolean;\r\n subdivisions?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n updatable?: boolean;\r\n } = {},\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const sphere = new Mesh(name, scene);\r\n\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n sphere._originalBuilderSideOrientation = options.sideOrientation;\r\n\r\n const vertexData = CreateIcoSphereVertexData(options);\r\n\r\n vertexData.applyToMesh(sphere, options.updatable);\r\n\r\n return sphere;\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the function directly from the module\r\n */\r\nexport const IcoSphereBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateIcoSphere,\r\n};\r\n\r\nVertexData.CreateIcoSphere = CreateIcoSphereVertexData;\r\n\r\nMesh.CreateIcoSphere = (name: string, options: { radius?: number; flat?: boolean; subdivisions?: number; sideOrientation?: number; updatable?: boolean }, scene: Scene): Mesh => {\r\n return CreateIcoSphere(name, options, scene);\r\n};\r\n"]}
@@ -19,18 +19,6 @@ import type { Nullable } from "../../types";
19
19
  * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
20
20
  * @param name defines the name of the mesh
21
21
  * @param options defines the options used to create the mesh
22
- * @param options.shape
23
- * @param options.radius
24
- * @param options.tessellation
25
- * @param options.clip
26
- * @param options.arc
27
- * @param options.closed
28
- * @param options.updatable
29
- * @param options.sideOrientation
30
- * @param options.frontUVs
31
- * @param options.backUVs
32
- * @param options.cap
33
- * @param options.invertUV
34
22
  * @param scene defines the hosting scene
35
23
  * @returns the lathe mesh
36
24
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#lathe
@@ -17,18 +17,6 @@ import { CreateRibbon } from "./ribbonBuilder.js";
17
17
  * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
18
18
  * @param name defines the name of the mesh
19
19
  * @param options defines the options used to create the mesh
20
- * @param options.shape
21
- * @param options.radius
22
- * @param options.tessellation
23
- * @param options.clip
24
- * @param options.arc
25
- * @param options.closed
26
- * @param options.updatable
27
- * @param options.sideOrientation
28
- * @param options.frontUVs
29
- * @param options.backUVs
30
- * @param options.cap
31
- * @param options.invertUV
32
20
  * @param scene defines the hosting scene
33
21
  * @returns the lathe mesh
34
22
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#lathe
@@ -1 +1 @@
1
- {"version":3,"file":"latheBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/latheBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,WAAW,CACvB,IAAY,EACZ,OAaC,EACD,QAAyB,IAAI;IAE7B,MAAM,GAAG,GAAW,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAClG,MAAM,MAAM,GAAY,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IAC7E,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAAC;IACnC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC;IAChD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC;IAC/B,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;IACpC,MAAM,eAAe,GAAG,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACjF,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG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O,KAAK,CAAC;AACjB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,gEAAgE;IAChE,WAAW;CACd,CAAC;AAEF,IAAI,CAAC,WAAW,GAAG,CAAC,IAAY,EAAE,KAAgB,EAAE,MAAc,EAAE,YAAoB,EAAE,KAAY,EAAE,SAAmB,EAAE,eAAwB,EAAQ,EAAE;IAC3J,MAAM,OAAO,GAAG;QACZ,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,MAAM;QACd,YAAY,EAAE,YAAY;QAC1B,eAAe,EAAE,eAAe;QAChC,SAAS,EAAE,SAAS;KACvB,CAAC;IAEF,OAAO,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC,CAAC","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport type { Vector4 } from \"../../Maths/math.vector\";\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { CreateRibbon } from \"./ribbonBuilder\";\r\nimport type { Nullable } from \"../../types\";\r\n\r\n/**\r\n * Creates lathe mesh.\r\n * The lathe is a shape with a symmetry axis : a 2D model shape is rotated around this axis to design the lathe\r\n * * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero\r\n * * The parameter `radius` (positive float, default 1) is the radius value of the lathe\r\n * * The parameter `tessellation` (positive integer, default 64) is the side number of the lathe\r\n * * The parameter `clip` (positive integer, default 0) is the number of sides to not create without effecting the general shape of the sides\r\n * * The parameter `arc` (positive float, default 1) is the ratio of the lathe. 0.5 builds for instance half a lathe, so an opened shape\r\n * * The parameter `closed` (boolean, default true) opens/closes the lathe circumference. This should be set to false when used with the parameter \"arc\"\r\n * * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL\r\n * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation\r\n * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\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.shape\r\n * @param options.radius\r\n * @param options.tessellation\r\n * @param options.clip\r\n * @param options.arc\r\n * @param options.closed\r\n * @param options.updatable\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param options.cap\r\n * @param options.invertUV\r\n * @param scene defines the hosting scene\r\n * @returns the lathe mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#lathe\r\n */\r\nexport function CreateLathe(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n radius?: number;\r\n tessellation?: number;\r\n clip?: number;\r\n arc?: number;\r\n closed?: boolean;\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n cap?: number;\r\n invertUV?: boolean;\r\n },\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const arc: number = options.arc ? (options.arc <= 0 || options.arc > 1 ? 1.0 : options.arc) : 1.0;\r\n const closed: boolean = options.closed === undefined ? true : options.closed;\r\n const shape = options.shape;\r\n const radius = options.radius || 1;\r\n const tessellation = options.tessellation || 64;\r\n const clip = options.clip || 0;\r\n const updatable = options.updatable;\r\n const sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n const cap = options.cap || Mesh.NO_CAP;\r\n const pi2 = Math.PI * 2;\r\n const paths = [];\r\n const invertUV = options.invertUV || false;\r\n\r\n let i = 0;\r\n let p = 0;\r\n const step = (pi2 / tessellation) * arc;\r\n let rotated;\r\n let path: Array<Vector3>;\r\n for (i = 0; i <= tessellation - clip; i++) {\r\n path = [];\r\n if (cap == Mesh.CAP_START || cap == Mesh.CAP_ALL) {\r\n path.push(new Vector3(0, shape[0].y, 0));\r\n path.push(new Vector3(Math.cos(i * step) * shape[0].x * radius, shape[0].y, Math.sin(i * step) * shape[0].x * radius));\r\n }\r\n for (p = 0; p < shape.length; p++) {\r\n rotated = new Vector3(Math.cos(i * step) * shape[p].x * radius, shape[p].y, Math.sin(i * step) * shape[p].x * radius);\r\n path.push(rotated);\r\n }\r\n if (cap == Mesh.CAP_END || cap == Mesh.CAP_ALL) {\r\n path.push(new Vector3(Math.cos(i * step) * shape[shape.length - 1].x * radius, shape[shape.length - 1].y, Math.sin(i * step) * shape[shape.length - 1].x * radius));\r\n path.push(new Vector3(0, shape[shape.length - 1].y, 0));\r\n }\r\n paths.push(path);\r\n }\r\n\r\n // lathe ribbon\r\n const lathe = CreateRibbon(\r\n name,\r\n { pathArray: paths, closeArray: closed, sideOrientation: sideOrientation, updatable: updatable, invertUV: invertUV, frontUVs: options.frontUVs, backUVs: options.backUVs },\r\n scene\r\n );\r\n return lathe;\r\n}\r\n\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the function direction from the module\r\n */\r\nexport const LatheBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateLathe,\r\n};\r\n\r\nMesh.CreateLathe = (name: string, shape: Vector3[], radius: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh => {\r\n const options = {\r\n shape: shape,\r\n radius: radius,\r\n tessellation: tessellation,\r\n sideOrientation: sideOrientation,\r\n updatable: updatable,\r\n };\r\n\r\n return CreateLathe(name, options, scene);\r\n};\r\n"]}
1
+ {"version":3,"file":"latheBu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AAE,KAAgB,EAAE,MAAc,EAAE,YAAoB,EAAE,KAAY,EAAE,SAAmB,EAAE,eAAwB,EAAQ,EAAE;IAC3J,MAAM,OAAO,GAAG;QACZ,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,MAAM;QACd,YAAY,EAAE,YAAY;QAC1B,eAAe,EAAE,eAAe;QAChC,SAAS,EAAE,SAAS;KACvB,CAAC;IAEF,OAAO,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC,CAAC","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport type { Vector4 } from \"../../Maths/math.vector\";\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { CreateRibbon } from \"./ribbonBuilder\";\r\nimport type { Nullable } from \"../../types\";\r\n\r\n/**\r\n * Creates lathe mesh.\r\n * The lathe is a shape with a symmetry axis : a 2D model shape is rotated around this axis to design the lathe\r\n * * The parameter `shape` is a required array of successive Vector3. This array depicts the shape to be rotated in its local space : the shape must be designed in the xOy plane and will be rotated around the Y axis. It's usually a 2D shape, so the Vector3 z coordinates are often set to zero\r\n * * The parameter `radius` (positive float, default 1) is the radius value of the lathe\r\n * * The parameter `tessellation` (positive integer, default 64) is the side number of the lathe\r\n * * The parameter `clip` (positive integer, default 0) is the number of sides to not create without effecting the general shape of the sides\r\n * * The parameter `arc` (positive float, default 1) is the ratio of the lathe. 0.5 builds for instance half a lathe, so an opened shape\r\n * * The parameter `closed` (boolean, default true) opens/closes the lathe circumference. This should be set to false when used with the parameter \"arc\"\r\n * * The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL\r\n * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation\r\n * * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\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 scene defines the hosting scene\r\n * @returns the lathe mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#lathe\r\n */\r\nexport function CreateLathe(\r\n name: string,\r\n options: {\r\n shape: Vector3[];\r\n radius?: number;\r\n tessellation?: number;\r\n clip?: number;\r\n arc?: number;\r\n closed?: boolean;\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n cap?: number;\r\n invertUV?: boolean;\r\n },\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const arc: number = options.arc ? (options.arc <= 0 || options.arc > 1 ? 1.0 : options.arc) : 1.0;\r\n const closed: boolean = options.closed === undefined ? true : options.closed;\r\n const shape = options.shape;\r\n const radius = options.radius || 1;\r\n const tessellation = options.tessellation || 64;\r\n const clip = options.clip || 0;\r\n const updatable = options.updatable;\r\n const sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n const cap = options.cap || Mesh.NO_CAP;\r\n const pi2 = Math.PI * 2;\r\n const paths = [];\r\n const invertUV = options.invertUV || false;\r\n\r\n let i = 0;\r\n let p = 0;\r\n const step = (pi2 / tessellation) * arc;\r\n let rotated;\r\n let path: Array<Vector3>;\r\n for (i = 0; i <= tessellation - clip; i++) {\r\n path = [];\r\n if (cap == Mesh.CAP_START || cap == Mesh.CAP_ALL) {\r\n path.push(new Vector3(0, shape[0].y, 0));\r\n path.push(new Vector3(Math.cos(i * step) * shape[0].x * radius, shape[0].y, Math.sin(i * step) * shape[0].x * radius));\r\n }\r\n for (p = 0; p < shape.length; p++) {\r\n rotated = new Vector3(Math.cos(i * step) * shape[p].x * radius, shape[p].y, Math.sin(i * step) * shape[p].x * radius);\r\n path.push(rotated);\r\n }\r\n if (cap == Mesh.CAP_END || cap == Mesh.CAP_ALL) {\r\n path.push(new Vector3(Math.cos(i * step) * shape[shape.length - 1].x * radius, shape[shape.length - 1].y, Math.sin(i * step) * shape[shape.length - 1].x * radius));\r\n path.push(new Vector3(0, shape[shape.length - 1].y, 0));\r\n }\r\n paths.push(path);\r\n }\r\n\r\n // lathe ribbon\r\n const lathe = CreateRibbon(\r\n name,\r\n { pathArray: paths, closeArray: closed, sideOrientation: sideOrientation, updatable: updatable, invertUV: invertUV, frontUVs: options.frontUVs, backUVs: options.backUVs },\r\n scene\r\n );\r\n return lathe;\r\n}\r\n\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the function direction from the module\r\n */\r\nexport const LatheBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateLathe,\r\n};\r\n\r\nMesh.CreateLathe = (name: string, shape: Vector3[], radius: number, tessellation: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh => {\r\n const options = {\r\n shape: shape,\r\n radius: radius,\r\n tessellation: tessellation,\r\n sideOrientation: sideOrientation,\r\n updatable: updatable,\r\n };\r\n\r\n return CreateLathe(name, options, scene);\r\n};\r\n"]}
@@ -10,8 +10,6 @@ import type { Material } from "../../Materials/material";
10
10
  * @param options an object used to set the following optional parameters for the LineSystem, required but can be empty
11
11
  * - lines an array of lines, each line being an array of successive Vector3
12
12
  * - colors an array of line colors, each of the line colors being an array of successive Color4, one per line point
13
- * @param options.lines
14
- * @param options.colors
15
13
  * @returns the VertexData of the LineSystem
16
14
  */
17
15
  export declare function CreateLineSystemVertexData(options: {
@@ -25,10 +23,6 @@ export declare function CreateLineSystemVertexData(options: {
25
23
  * - dashSize the size of the dashes relative to the dash number, optional, default 3
26
24
  * - gapSize the size of the gap between two successive dashes relative to the dash number, optional, default 1
27
25
  * - dashNb the intended total number of dashes, optional, default 200
28
- * @param options.points
29
- * @param options.dashSize
30
- * @param options.gapSize
31
- * @param options.dashNb
32
26
  * @returns the VertexData for the DashedLines
33
27
  */
34
28
  export declare function CreateDashedLinesVertexData(options: {
@@ -52,12 +46,6 @@ export declare function CreateDashedLinesVertexData(options: {
52
46
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#line-system
53
47
  * @param name defines the name of the new line system
54
48
  * @param options defines the options used to create the line system
55
- * @param options.lines
56
- * @param options.updatable
57
- * @param options.instance
58
- * @param options.colors
59
- * @param options.useVertexAlpha
60
- * @param options.material
61
49
  * @param scene defines the hosting scene
62
50
  * @returns a new line system mesh
63
51
  */
@@ -83,12 +71,6 @@ export declare function CreateLineSystem(name: string, options: {
83
71
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#lines
84
72
  * @param name defines the name of the new line system
85
73
  * @param options defines the options used to create the line system
86
- * @param options.points
87
- * @param options.updatable
88
- * @param options.instance
89
- * @param options.colors
90
- * @param options.useVertexAlpha
91
- * @param options.material
92
74
  * @param scene defines the hosting scene
93
75
  * @returns a new line mesh
94
76
  */
@@ -115,14 +97,6 @@ export declare function CreateLines(name: string, options: {
115
97
  * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
116
98
  * @param name defines the name of the mesh
117
99
  * @param options defines the options used to create the mesh
118
- * @param options.points
119
- * @param options.dashSize
120
- * @param options.gapSize
121
- * @param options.dashNb
122
- * @param options.updatable
123
- * @param options.instance
124
- * @param options.useVertexAlpha
125
- * @param options.material
126
100
  * @param scene defines the hosting scene
127
101
  * @returns the dashed line mesh
128
102
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#dashed-lines
@@ -10,8 +10,6 @@ import { Logger } from "../../Misc/logger.js";
10
10
  * @param options an object used to set the following optional parameters for the LineSystem, required but can be empty
11
11
  * - lines an array of lines, each line being an array of successive Vector3
12
12
  * - colors an array of line colors, each of the line colors being an array of successive Color4, one per line point
13
- * @param options.lines
14
- * @param options.colors
15
13
  * @returns the VertexData of the LineSystem
16
14
  */
17
15
  export function CreateLineSystemVertexData(options) {
@@ -53,10 +51,6 @@ export function CreateLineSystemVertexData(options) {
53
51
  * - dashSize the size of the dashes relative to the dash number, optional, default 3
54
52
  * - gapSize the size of the gap between two successive dashes relative to the dash number, optional, default 1
55
53
  * - dashNb the intended total number of dashes, optional, default 200
56
- * @param options.points
57
- * @param options.dashSize
58
- * @param options.gapSize
59
- * @param options.dashNb
60
54
  * @returns the VertexData for the DashedLines
61
55
  */
62
56
  export function CreateDashedLinesVertexData(options) {
@@ -113,12 +107,6 @@ export function CreateDashedLinesVertexData(options) {
113
107
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#line-system
114
108
  * @param name defines the name of the new line system
115
109
  * @param options defines the options used to create the line system
116
- * @param options.lines
117
- * @param options.updatable
118
- * @param options.instance
119
- * @param options.colors
120
- * @param options.useVertexAlpha
121
- * @param options.material
122
110
  * @param scene defines the hosting scene
123
111
  * @returns a new line system mesh
124
112
  */
@@ -180,12 +168,6 @@ export function CreateLineSystem(name, options, scene = null) {
180
168
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#lines
181
169
  * @param name defines the name of the new line system
182
170
  * @param options defines the options used to create the line system
183
- * @param options.points
184
- * @param options.updatable
185
- * @param options.instance
186
- * @param options.colors
187
- * @param options.useVertexAlpha
188
- * @param options.material
189
171
  * @param scene defines the hosting scene
190
172
  * @returns a new line mesh
191
173
  */
@@ -209,14 +191,6 @@ export function CreateLines(name, options, scene = null) {
209
191
  * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
210
192
  * @param name defines the name of the mesh
211
193
  * @param options defines the options used to create the mesh
212
- * @param options.points
213
- * @param options.dashSize
214
- * @param options.gapSize
215
- * @param options.dashNb
216
- * @param options.updatable
217
- * @param options.instance
218
- * @param options.useVertexAlpha
219
- * @param options.material
220
194
  * @param scene defines the hosting scene
221
195
  * @returns the dashed line mesh
222
196
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#dashed-lines
@@ -1 +1 @@
1
- {"version":3,"file":"linesBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/linesBuilder.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAI3C;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAA8D;IACrG,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAC9B,MAAM,YAAY,GAAG,EAAE,CAAC;IACxB,IAAI,GAAG,GAAG,CAAC,CAAC;IAEZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACxB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAChD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;YAClC,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BAAoB,EAAE,CAAC;IAC9D,WAAW,CAAC,oBAAoB,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACrD,WAAW,CAAC,oBAAoB,CAAC,OAAO,GAAG,OAAO,CAAC;IACnD,OAAO,WAAW,CAAC;AACvB,CAAC;AACD;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IACxB,iBAAiB;IACjB,gBAAgB;IAChB,WAAW;CACd,CAAC;AAEF,UAAU,CAAC,gBAAgB,GAAG,0BAA0B,CAAC;AACzD,UAAU,CAAC,iBAAiB,GAAG,2BAA2B,CAAC;AAE3D,IAAI,CAAC,WAAW,GAAG,CAAC,IAAY,EAAE,MAAiB,EAAE,QAAyB,IAAI,EAAE,YAAqB,KAAK,EAAE,WAAgC,IAAI,EAAa,EAAE;IAC/J,MAAM,OAAO,GAAG;QACZ,MAAM;QACN,SAAS;QACT,QAAQ;KACX,CAAC;IACF,OAAO,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF,IAAI,CAAC,iBAAiB,GAAG,CACrB,IAAY,EACZ,MAAiB,EACjB,QAAgB,EAChB,OAAe,EACf,MAAc,EACd,QAAyB,IAAI,EAC7B,SAAmB,EACnB,QAAoB,EACX,EAAE;IACX,MAAM,OAAO,GAAG;QACZ,MAAM;QACN,QAAQ;QACR,OAAO;QACP,MAAM;QACN,SAAS;QACT,QAAQ;KACX,CAAC;IACF,OAAO,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACnD,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport type { Color4 } from \"../../Maths/math.color\";\r\nimport { _CreationDataStorage, Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport type { FloatArray, Nullable } from \"../../types\";\r\nimport { LinesMesh } from \"../../Meshes/linesMesh\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { VertexBuffer } from \"../../Buffers/buffer\";\r\nimport { Logger } from \"../../Misc/logger\";\r\n\r\nimport type { Material } from \"../../Materials/material\";\r\n\r\n/**\r\n * Creates the VertexData of the LineSystem\r\n * @param options an object used to set the following optional parameters for the LineSystem, required but can be empty\r\n * - lines an array of lines, each line being an array of successive Vector3\r\n * - colors an array of line colors, each of the line colors being an array of successive Color4, one per line point\r\n * @param options.lines\r\n * @param options.colors\r\n * @returns the VertexData of the LineSystem\r\n */\r\nexport function CreateLineSystemVertexData(options: { lines: Vector3[][]; colors?: Nullable<Color4[][]> }): VertexData {\r\n const indices = [];\r\n const positions = [];\r\n const lines = options.lines;\r\n const colors = options.colors;\r\n const vertexColors = [];\r\n let idx = 0;\r\n\r\n for (let l = 0; l < lines.length; l++) {\r\n const points = lines[l];\r\n for (let index = 0; index < points.length; index++) {\r\n const { x, y, z } = points[index];\r\n positions.push(x, y, z);\r\n if (colors) {\r\n const color = colors[l];\r\n const { r, g, b, a } = color[index];\r\n vertexColors.push(r, g, b, a);\r\n }\r\n if (index > 0) {\r\n indices.push(idx - 1);\r\n indices.push(idx);\r\n }\r\n idx++;\r\n }\r\n }\r\n const vertexData = new VertexData();\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n if (colors) {\r\n vertexData.colors = vertexColors;\r\n }\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Create the VertexData for a DashedLines\r\n * @param options an object used to set the following optional parameters for the DashedLines, required but can be empty\r\n * - points an array successive Vector3\r\n * - dashSize the size of the dashes relative to the dash number, optional, default 3\r\n * - gapSize the size of the gap between two successive dashes relative to the dash number, optional, default 1\r\n * - dashNb the intended total number of dashes, optional, default 200\r\n * @param options.points\r\n * @param options.dashSize\r\n * @param options.gapSize\r\n * @param options.dashNb\r\n * @returns the VertexData for the DashedLines\r\n */\r\nexport function CreateDashedLinesVertexData(options: { points: Vector3[]; dashSize?: number; gapSize?: number; dashNb?: number }): VertexData {\r\n const dashSize = options.dashSize || 3;\r\n const gapSize = options.gapSize || 1;\r\n const dashNb = options.dashNb || 200;\r\n const points = options.points;\r\n\r\n const positions: number[] = [];\r\n const indices: number[] = [];\r\n\r\n const curvect = Vector3.Zero();\r\n let lg = 0;\r\n let nb = 0;\r\n let shft = 0;\r\n let dashshft = 0;\r\n let curshft = 0;\r\n let idx = 0;\r\n let i = 0;\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n lg += curvect.length();\r\n }\r\n shft = lg / dashNb;\r\n dashshft = (dashSize * shft) / (dashSize + gapSize);\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n nb = Math.floor(curvect.length() / shft);\r\n curvect.normalize();\r\n for (let j = 0; j < nb; j++) {\r\n curshft = shft * j;\r\n positions.push(points[i].x + curshft * curvect.x, points[i].y + curshft * curvect.y, points[i].z + curshft * curvect.z);\r\n positions.push(points[i].x + (curshft + dashshft) * curvect.x, points[i].y + (curshft + dashshft) * curvect.y, points[i].z + (curshft + dashshft) * curvect.z);\r\n indices.push(idx, idx + 1);\r\n idx += 2;\r\n }\r\n }\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n vertexData.positions = positions;\r\n vertexData.indices = indices;\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a line system mesh. A line system is a pool of many lines gathered in a single mesh\r\n * * A line system mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of lines as an input parameter\r\n * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineSystem to this static function\r\n * * The parameter `lines` is an array of lines, each line being an array of successive Vector3\r\n * * The optional parameter `instance` is an instance of an existing LineSystem object to be updated with the passed `lines` parameter\r\n * * The optional parameter `colors` is an array of line colors, each line colors being an array of successive Color4, one per line point\r\n * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need the alpha blending (faster)\r\n * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created\r\n * * Updating a simple Line mesh, you just need to update every line in the `lines` array : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines\r\n * * When updating an instance, remember that only line point positions can change, not the number of points, neither the number of lines\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#line-system\r\n * @param name defines the name of the new line system\r\n * @param options defines the options used to create the line system\r\n * @param options.lines\r\n * @param options.updatable\r\n * @param options.instance\r\n * @param options.colors\r\n * @param options.useVertexAlpha\r\n * @param options.material\r\n * @param scene defines the hosting scene\r\n * @returns a new line system mesh\r\n */\r\nexport function CreateLineSystem(\r\n name: string,\r\n options: { lines: Vector3[][]; updatable?: boolean; instance?: Nullable<LinesMesh>; colors?: Nullable<Color4[][]>; useVertexAlpha?: boolean; material?: Material },\r\n scene: Nullable<Scene> = null\r\n): LinesMesh {\r\n const instance = options.instance;\r\n const lines = options.lines;\r\n const colors = options.colors;\r\n\r\n if (instance) {\r\n // lines update\r\n const positions = instance.getVerticesData(VertexBuffer.PositionKind)!;\r\n let vertexColor;\r\n let lineColors;\r\n if (colors) {\r\n vertexColor = instance.getVerticesData(VertexBuffer.ColorKind)!;\r\n }\r\n let i = 0;\r\n let c = 0;\r\n for (let l = 0; l < lines.length; l++) {\r\n const points = lines[l];\r\n for (let p = 0; p < points.length; p++) {\r\n positions[i] = points[p].x;\r\n positions[i + 1] = points[p].y;\r\n positions[i + 2] = points[p].z;\r\n if (colors && vertexColor) {\r\n lineColors = colors[l];\r\n vertexColor[c] = lineColors[p].r;\r\n vertexColor[c + 1] = lineColors[p].g;\r\n vertexColor[c + 2] = lineColors[p].b;\r\n vertexColor[c + 3] = lineColors[p].a;\r\n c += 4;\r\n }\r\n i += 3;\r\n }\r\n }\r\n instance.updateVerticesData(VertexBuffer.PositionKind, positions, false, false);\r\n if (colors && vertexColor) {\r\n instance.updateVerticesData(VertexBuffer.ColorKind, vertexColor, false, false);\r\n }\r\n return instance;\r\n }\r\n\r\n // line system creation\r\n const useVertexColor = colors ? true : false;\r\n const lineSystem = new LinesMesh(name, scene, null, undefined, undefined, useVertexColor, options.useVertexAlpha, options.material);\r\n const vertexData = CreateLineSystemVertexData(options);\r\n vertexData.applyToMesh(lineSystem, options.updatable);\r\n return lineSystem;\r\n}\r\n\r\n/**\r\n * Creates a line mesh\r\n * A line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter\r\n * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function\r\n * * The parameter `points` is an array successive Vector3\r\n * * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines\r\n * * The optional parameter `colors` is an array of successive Color4, one per line point\r\n * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need alpha blending (faster)\r\n * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created\r\n * * When updating an instance, remember that only point positions can change, not the number of points\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#lines\r\n * @param name defines the name of the new line system\r\n * @param options defines the options used to create the line system\r\n * @param options.points\r\n * @param options.updatable\r\n * @param options.instance\r\n * @param options.colors\r\n * @param options.useVertexAlpha\r\n * @param options.material\r\n * @param scene defines the hosting scene\r\n * @returns a new line mesh\r\n */\r\nexport function CreateLines(\r\n name: string,\r\n options: { points: Vector3[]; updatable?: boolean; instance?: Nullable<LinesMesh>; colors?: Color4[]; useVertexAlpha?: boolean; material?: Material },\r\n scene: Nullable<Scene> = null\r\n): LinesMesh {\r\n const colors = options.colors ? [options.colors] : null;\r\n const lines = CreateLineSystem(\r\n name,\r\n { lines: [options.points], updatable: options.updatable, instance: options.instance, colors: colors, useVertexAlpha: options.useVertexAlpha, material: options.material },\r\n scene\r\n );\r\n return lines;\r\n}\r\n\r\n/**\r\n * Creates a dashed line mesh\r\n * * A dashed line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter\r\n * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function\r\n * * The parameter `points` is an array successive Vector3\r\n * * The parameter `dashNb` is the intended total number of dashes (positive integer, default 200)\r\n * * The parameter `dashSize` is the size of the dashes relatively the dash number (positive float, default 3)\r\n * * The parameter `gapSize` is the size of the gap between two successive dashes relatively the dash number (positive float, default 1)\r\n * * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines\r\n * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need the alpha blending (faster)\r\n * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created\r\n * * When updating an instance, remember that only point positions can change, not the number of points\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\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.points\r\n * @param options.dashSize\r\n * @param options.gapSize\r\n * @param options.dashNb\r\n * @param options.updatable\r\n * @param options.instance\r\n * @param options.useVertexAlpha\r\n * @param options.material\r\n * @param scene defines the hosting scene\r\n * @returns the dashed line mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#dashed-lines\r\n */\r\nexport function CreateDashedLines(\r\n name: string,\r\n options: { points: Vector3[]; dashSize?: number; gapSize?: number; dashNb?: number; updatable?: boolean; instance?: LinesMesh; useVertexAlpha?: boolean; material?: Material },\r\n scene: Nullable<Scene> = null\r\n): LinesMesh {\r\n const points = options.points;\r\n const instance = options.instance;\r\n const gapSize = options.gapSize || 1;\r\n const dashSize = options.dashSize || 3;\r\n\r\n if (instance) {\r\n // dashed lines update\r\n const positionFunction = (positions: FloatArray): void => {\r\n const curvect = Vector3.Zero();\r\n const nbSeg = positions.length / 6;\r\n let lg = 0;\r\n let nb = 0;\r\n let shft = 0;\r\n let dashshft = 0;\r\n let curshft = 0;\r\n let p = 0;\r\n let i = 0;\r\n let j = 0;\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n lg += curvect.length();\r\n }\r\n shft = lg / nbSeg;\r\n const dashSize = instance!._creationDataStorage!.dashSize;\r\n const gapSize = instance!._creationDataStorage!.gapSize;\r\n dashshft = (dashSize * shft) / (dashSize + gapSize);\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n nb = Math.floor(curvect.length() / shft);\r\n curvect.normalize();\r\n j = 0;\r\n while (j < nb && p < positions.length) {\r\n curshft = shft * j;\r\n positions[p] = points[i].x + curshft * curvect.x;\r\n positions[p + 1] = points[i].y + curshft * curvect.y;\r\n positions[p + 2] = points[i].z + curshft * curvect.z;\r\n positions[p + 3] = points[i].x + (curshft + dashshft) * curvect.x;\r\n positions[p + 4] = points[i].y + (curshft + dashshft) * curvect.y;\r\n positions[p + 5] = points[i].z + (curshft + dashshft) * curvect.z;\r\n p += 6;\r\n j++;\r\n }\r\n }\r\n while (p < positions.length) {\r\n positions[p] = points[i].x;\r\n positions[p + 1] = points[i].y;\r\n positions[p + 2] = points[i].z;\r\n p += 3;\r\n }\r\n };\r\n if (options.dashNb || options.dashSize || options.gapSize || options.useVertexAlpha || options.material) {\r\n Logger.Warn(\"You have used an option other than points with the instance option. Please be aware that these other options will be ignored.\");\r\n }\r\n instance.updateMeshPositions(positionFunction, false);\r\n return instance;\r\n }\r\n // dashed lines creation\r\n const dashedLines = new LinesMesh(name, scene, null, undefined, undefined, undefined, options.useVertexAlpha, options.material);\r\n const vertexData = CreateDashedLinesVertexData(options);\r\n vertexData.applyToMesh(dashedLines, options.updatable);\r\n\r\n dashedLines._creationDataStorage = new _CreationDataStorage();\r\n dashedLines._creationDataStorage.dashSize = dashSize;\r\n dashedLines._creationDataStorage.gapSize = gapSize;\r\n return dashedLines;\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 LinesBuilder = {\r\n CreateDashedLines,\r\n CreateLineSystem,\r\n CreateLines,\r\n};\r\n\r\nVertexData.CreateLineSystem = CreateLineSystemVertexData;\r\nVertexData.CreateDashedLines = CreateDashedLinesVertexData;\r\n\r\nMesh.CreateLines = (name: string, points: Vector3[], scene: Nullable<Scene> = null, updatable: boolean = false, instance: Nullable<LinesMesh> = null): LinesMesh => {\r\n const options = {\r\n points,\r\n updatable,\r\n instance,\r\n };\r\n return CreateLines(name, options, scene);\r\n};\r\n\r\nMesh.CreateDashedLines = (\r\n name: string,\r\n points: Vector3[],\r\n dashSize: number,\r\n gapSize: number,\r\n dashNb: number,\r\n scene: Nullable<Scene> = null,\r\n updatable?: boolean,\r\n instance?: LinesMesh\r\n): LinesMesh => {\r\n const options = {\r\n points,\r\n dashSize,\r\n gapSize,\r\n dashNb,\r\n updatable,\r\n instance,\r\n };\r\n return CreateDashedLines(name, options, scene);\r\n};\r\n"]}
1
+ {"version":3,"file":"linesBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/linesBuilder.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAI3C;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAA8D;IACrG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,CACrB,IAAY,EACZ,MAAiB,EACjB,QAAgB,EAChB,OAAe,EACf,MAAc,EACd,QAAyB,IAAI,EAC7B,SAAmB,EACnB,QAAoB,EACX,EAAE;IACX,MAAM,OAAO,GAAG;QACZ,MAAM;QACN,QAAQ;QACR,OAAO;QACP,MAAM;QACN,SAAS;QACT,QAAQ;KACX,CAAC;IACF,OAAO,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACnD,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport type { Color4 } from \"../../Maths/math.color\";\r\nimport { _CreationDataStorage, Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport type { FloatArray, Nullable } from \"../../types\";\r\nimport { LinesMesh } from \"../../Meshes/linesMesh\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { VertexBuffer } from \"../../Buffers/buffer\";\r\nimport { Logger } from \"../../Misc/logger\";\r\n\r\nimport type { Material } from \"../../Materials/material\";\r\n\r\n/**\r\n * Creates the VertexData of the LineSystem\r\n * @param options an object used to set the following optional parameters for the LineSystem, required but can be empty\r\n * - lines an array of lines, each line being an array of successive Vector3\r\n * - colors an array of line colors, each of the line colors being an array of successive Color4, one per line point\r\n * @returns the VertexData of the LineSystem\r\n */\r\nexport function CreateLineSystemVertexData(options: { lines: Vector3[][]; colors?: Nullable<Color4[][]> }): VertexData {\r\n const indices = [];\r\n const positions = [];\r\n const lines = options.lines;\r\n const colors = options.colors;\r\n const vertexColors = [];\r\n let idx = 0;\r\n\r\n for (let l = 0; l < lines.length; l++) {\r\n const points = lines[l];\r\n for (let index = 0; index < points.length; index++) {\r\n const { x, y, z } = points[index];\r\n positions.push(x, y, z);\r\n if (colors) {\r\n const color = colors[l];\r\n const { r, g, b, a } = color[index];\r\n vertexColors.push(r, g, b, a);\r\n }\r\n if (index > 0) {\r\n indices.push(idx - 1);\r\n indices.push(idx);\r\n }\r\n idx++;\r\n }\r\n }\r\n const vertexData = new VertexData();\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n if (colors) {\r\n vertexData.colors = vertexColors;\r\n }\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Create the VertexData for a DashedLines\r\n * @param options an object used to set the following optional parameters for the DashedLines, required but can be empty\r\n * - points an array successive Vector3\r\n * - dashSize the size of the dashes relative to the dash number, optional, default 3\r\n * - gapSize the size of the gap between two successive dashes relative to the dash number, optional, default 1\r\n * - dashNb the intended total number of dashes, optional, default 200\r\n * @returns the VertexData for the DashedLines\r\n */\r\nexport function CreateDashedLinesVertexData(options: { points: Vector3[]; dashSize?: number; gapSize?: number; dashNb?: number }): VertexData {\r\n const dashSize = options.dashSize || 3;\r\n const gapSize = options.gapSize || 1;\r\n const dashNb = options.dashNb || 200;\r\n const points = options.points;\r\n\r\n const positions: number[] = [];\r\n const indices: number[] = [];\r\n\r\n const curvect = Vector3.Zero();\r\n let lg = 0;\r\n let nb = 0;\r\n let shft = 0;\r\n let dashshft = 0;\r\n let curshft = 0;\r\n let idx = 0;\r\n let i = 0;\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n lg += curvect.length();\r\n }\r\n shft = lg / dashNb;\r\n dashshft = (dashSize * shft) / (dashSize + gapSize);\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n nb = Math.floor(curvect.length() / shft);\r\n curvect.normalize();\r\n for (let j = 0; j < nb; j++) {\r\n curshft = shft * j;\r\n positions.push(points[i].x + curshft * curvect.x, points[i].y + curshft * curvect.y, points[i].z + curshft * curvect.z);\r\n positions.push(points[i].x + (curshft + dashshft) * curvect.x, points[i].y + (curshft + dashshft) * curvect.y, points[i].z + (curshft + dashshft) * curvect.z);\r\n indices.push(idx, idx + 1);\r\n idx += 2;\r\n }\r\n }\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n vertexData.positions = positions;\r\n vertexData.indices = indices;\r\n\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a line system mesh. A line system is a pool of many lines gathered in a single mesh\r\n * * A line system mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of lines as an input parameter\r\n * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineSystem to this static function\r\n * * The parameter `lines` is an array of lines, each line being an array of successive Vector3\r\n * * The optional parameter `instance` is an instance of an existing LineSystem object to be updated with the passed `lines` parameter\r\n * * The optional parameter `colors` is an array of line colors, each line colors being an array of successive Color4, one per line point\r\n * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need the alpha blending (faster)\r\n * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created\r\n * * Updating a simple Line mesh, you just need to update every line in the `lines` array : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines\r\n * * When updating an instance, remember that only line point positions can change, not the number of points, neither the number of lines\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#line-system\r\n * @param name defines the name of the new line system\r\n * @param options defines the options used to create the line system\r\n * @param scene defines the hosting scene\r\n * @returns a new line system mesh\r\n */\r\nexport function CreateLineSystem(\r\n name: string,\r\n options: { lines: Vector3[][]; updatable?: boolean; instance?: Nullable<LinesMesh>; colors?: Nullable<Color4[][]>; useVertexAlpha?: boolean; material?: Material },\r\n scene: Nullable<Scene> = null\r\n): LinesMesh {\r\n const instance = options.instance;\r\n const lines = options.lines;\r\n const colors = options.colors;\r\n\r\n if (instance) {\r\n // lines update\r\n const positions = instance.getVerticesData(VertexBuffer.PositionKind)!;\r\n let vertexColor;\r\n let lineColors;\r\n if (colors) {\r\n vertexColor = instance.getVerticesData(VertexBuffer.ColorKind)!;\r\n }\r\n let i = 0;\r\n let c = 0;\r\n for (let l = 0; l < lines.length; l++) {\r\n const points = lines[l];\r\n for (let p = 0; p < points.length; p++) {\r\n positions[i] = points[p].x;\r\n positions[i + 1] = points[p].y;\r\n positions[i + 2] = points[p].z;\r\n if (colors && vertexColor) {\r\n lineColors = colors[l];\r\n vertexColor[c] = lineColors[p].r;\r\n vertexColor[c + 1] = lineColors[p].g;\r\n vertexColor[c + 2] = lineColors[p].b;\r\n vertexColor[c + 3] = lineColors[p].a;\r\n c += 4;\r\n }\r\n i += 3;\r\n }\r\n }\r\n instance.updateVerticesData(VertexBuffer.PositionKind, positions, false, false);\r\n if (colors && vertexColor) {\r\n instance.updateVerticesData(VertexBuffer.ColorKind, vertexColor, false, false);\r\n }\r\n return instance;\r\n }\r\n\r\n // line system creation\r\n const useVertexColor = colors ? true : false;\r\n const lineSystem = new LinesMesh(name, scene, null, undefined, undefined, useVertexColor, options.useVertexAlpha, options.material);\r\n const vertexData = CreateLineSystemVertexData(options);\r\n vertexData.applyToMesh(lineSystem, options.updatable);\r\n return lineSystem;\r\n}\r\n\r\n/**\r\n * Creates a line mesh\r\n * A line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter\r\n * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function\r\n * * The parameter `points` is an array successive Vector3\r\n * * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines\r\n * * The optional parameter `colors` is an array of successive Color4, one per line point\r\n * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need alpha blending (faster)\r\n * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created\r\n * * When updating an instance, remember that only point positions can change, not the number of points\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#lines\r\n * @param name defines the name of the new line system\r\n * @param options defines the options used to create the line system\r\n * @param scene defines the hosting scene\r\n * @returns a new line mesh\r\n */\r\nexport function CreateLines(\r\n name: string,\r\n options: { points: Vector3[]; updatable?: boolean; instance?: Nullable<LinesMesh>; colors?: Color4[]; useVertexAlpha?: boolean; material?: Material },\r\n scene: Nullable<Scene> = null\r\n): LinesMesh {\r\n const colors = options.colors ? [options.colors] : null;\r\n const lines = CreateLineSystem(\r\n name,\r\n { lines: [options.points], updatable: options.updatable, instance: options.instance, colors: colors, useVertexAlpha: options.useVertexAlpha, material: options.material },\r\n scene\r\n );\r\n return lines;\r\n}\r\n\r\n/**\r\n * Creates a dashed line mesh\r\n * * A dashed line mesh is considered as a parametric shape since it has no predefined original shape. Its shape is determined by the passed array of points as an input parameter\r\n * * Like every other parametric shape, it is dynamically updatable by passing an existing instance of LineMesh to this static function\r\n * * The parameter `points` is an array successive Vector3\r\n * * The parameter `dashNb` is the intended total number of dashes (positive integer, default 200)\r\n * * The parameter `dashSize` is the size of the dashes relatively the dash number (positive float, default 3)\r\n * * The parameter `gapSize` is the size of the gap between two successive dashes relatively the dash number (positive float, default 1)\r\n * * The optional parameter `instance` is an instance of an existing LineMesh object to be updated with the passed `points` parameter : https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph#lines-and-dashedlines\r\n * * The optional parameter `useVertexAlpha` is to be set to `false` (default `true`) when you don't need the alpha blending (faster)\r\n * * The optional parameter `material` is the material to use to draw the lines if provided. If not, a default material will be created\r\n * * When updating an instance, remember that only point positions can change, not the number of points\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\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 scene defines the hosting scene\r\n * @returns the dashed line mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/param#dashed-lines\r\n */\r\nexport function CreateDashedLines(\r\n name: string,\r\n options: { points: Vector3[]; dashSize?: number; gapSize?: number; dashNb?: number; updatable?: boolean; instance?: LinesMesh; useVertexAlpha?: boolean; material?: Material },\r\n scene: Nullable<Scene> = null\r\n): LinesMesh {\r\n const points = options.points;\r\n const instance = options.instance;\r\n const gapSize = options.gapSize || 1;\r\n const dashSize = options.dashSize || 3;\r\n\r\n if (instance) {\r\n // dashed lines update\r\n const positionFunction = (positions: FloatArray): void => {\r\n const curvect = Vector3.Zero();\r\n const nbSeg = positions.length / 6;\r\n let lg = 0;\r\n let nb = 0;\r\n let shft = 0;\r\n let dashshft = 0;\r\n let curshft = 0;\r\n let p = 0;\r\n let i = 0;\r\n let j = 0;\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n lg += curvect.length();\r\n }\r\n shft = lg / nbSeg;\r\n const dashSize = instance!._creationDataStorage!.dashSize;\r\n const gapSize = instance!._creationDataStorage!.gapSize;\r\n dashshft = (dashSize * shft) / (dashSize + gapSize);\r\n for (i = 0; i < points.length - 1; i++) {\r\n points[i + 1].subtractToRef(points[i], curvect);\r\n nb = Math.floor(curvect.length() / shft);\r\n curvect.normalize();\r\n j = 0;\r\n while (j < nb && p < positions.length) {\r\n curshft = shft * j;\r\n positions[p] = points[i].x + curshft * curvect.x;\r\n positions[p + 1] = points[i].y + curshft * curvect.y;\r\n positions[p + 2] = points[i].z + curshft * curvect.z;\r\n positions[p + 3] = points[i].x + (curshft + dashshft) * curvect.x;\r\n positions[p + 4] = points[i].y + (curshft + dashshft) * curvect.y;\r\n positions[p + 5] = points[i].z + (curshft + dashshft) * curvect.z;\r\n p += 6;\r\n j++;\r\n }\r\n }\r\n while (p < positions.length) {\r\n positions[p] = points[i].x;\r\n positions[p + 1] = points[i].y;\r\n positions[p + 2] = points[i].z;\r\n p += 3;\r\n }\r\n };\r\n if (options.dashNb || options.dashSize || options.gapSize || options.useVertexAlpha || options.material) {\r\n Logger.Warn(\"You have used an option other than points with the instance option. Please be aware that these other options will be ignored.\");\r\n }\r\n instance.updateMeshPositions(positionFunction, false);\r\n return instance;\r\n }\r\n // dashed lines creation\r\n const dashedLines = new LinesMesh(name, scene, null, undefined, undefined, undefined, options.useVertexAlpha, options.material);\r\n const vertexData = CreateDashedLinesVertexData(options);\r\n vertexData.applyToMesh(dashedLines, options.updatable);\r\n\r\n dashedLines._creationDataStorage = new _CreationDataStorage();\r\n dashedLines._creationDataStorage.dashSize = dashSize;\r\n dashedLines._creationDataStorage.gapSize = gapSize;\r\n return dashedLines;\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 LinesBuilder = {\r\n CreateDashedLines,\r\n CreateLineSystem,\r\n CreateLines,\r\n};\r\n\r\nVertexData.CreateLineSystem = CreateLineSystemVertexData;\r\nVertexData.CreateDashedLines = CreateDashedLinesVertexData;\r\n\r\nMesh.CreateLines = (name: string, points: Vector3[], scene: Nullable<Scene> = null, updatable: boolean = false, instance: Nullable<LinesMesh> = null): LinesMesh => {\r\n const options = {\r\n points,\r\n updatable,\r\n instance,\r\n };\r\n return CreateLines(name, options, scene);\r\n};\r\n\r\nMesh.CreateDashedLines = (\r\n name: string,\r\n points: Vector3[],\r\n dashSize: number,\r\n gapSize: number,\r\n dashNb: number,\r\n scene: Nullable<Scene> = null,\r\n updatable?: boolean,\r\n instance?: LinesMesh\r\n): LinesMesh => {\r\n const options = {\r\n points,\r\n dashSize,\r\n gapSize,\r\n dashNb,\r\n updatable,\r\n instance,\r\n };\r\n return CreateDashedLines(name, options, scene);\r\n};\r\n"]}
@@ -13,12 +13,6 @@ import type { Plane } from "../../Maths/math.plane";
13
13
  * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
14
14
  * * 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)
15
15
  * * 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)
16
- * @param options.size
17
- * @param options.width
18
- * @param options.height
19
- * @param options.sideOrientation
20
- * @param options.frontUVs
21
- * @param options.backUVs
22
16
  * @returns the VertexData of the box
23
17
  */
24
18
  export declare function CreatePlaneVertexData(options: {
@@ -39,14 +33,6 @@ export declare function CreatePlaneVertexData(options: {
39
33
  * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
40
34
  * @param name defines the name of the mesh
41
35
  * @param options defines the options used to create the mesh
42
- * @param options.size
43
- * @param options.width
44
- * @param options.height
45
- * @param options.sideOrientation
46
- * @param options.frontUVs
47
- * @param options.backUVs
48
- * @param options.updatable
49
- * @param options.sourcePlane
50
36
  * @param scene defines the hosting scene
51
37
  * @returns the plane mesh
52
38
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#plane
@@ -10,12 +10,6 @@ import { CompatibilityOptions } from "../../Compat/compatibilityOptions.js";
10
10
  * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
11
11
  * * 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)
12
12
  * * 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)
13
- * @param options.size
14
- * @param options.width
15
- * @param options.height
16
- * @param options.sideOrientation
17
- * @param options.frontUVs
18
- * @param options.backUVs
19
13
  * @returns the VertexData of the box
20
14
  */
21
15
  export function CreatePlaneVertexData(options) {
@@ -68,14 +62,6 @@ export function CreatePlaneVertexData(options) {
68
62
  * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
69
63
  * @param name defines the name of the mesh
70
64
  * @param options defines the options used to create the mesh
71
- * @param options.size
72
- * @param options.width
73
- * @param options.height
74
- * @param options.sideOrientation
75
- * @param options.frontUVs
76
- * @param options.backUVs
77
- * @param options.updatable
78
- * @param options.sourcePlane
79
65
  * @param scene defines the hosting scene
80
66
  * @returns the plane mesh
81
67
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#plane
@@ -1 +1 @@
1
- {"version":3,"file":"planeBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/planeBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAA4H;IAC9J,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,MAAM,GAAG,GAAG,EAAE,CAAC;IAEf,MAAM,KAAK,GAAW,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC;IACzD,MAAM,MAAM,GAAW,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC;IAC3D,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,IAAI,UAAU,CAAC,WAAW,CAAC;IAE9G,WAAW;IACX,MAAM,SAAS,GAAG,KAAK,GAAG,GAAG,CAAC;IAC9B,MAAM,UAAU,GAAG,MAAM,GAAG,GAAG,CAAC;IAEhC,SAAS,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACzB,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,oBAAoB,CAAC,yBAAyB,CAAC,CAAC,CAAC,GAAG,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AU,CAAC,WAAW,GAAG,qBAAqB,CAAC;AAC/C,IAAI,CAAC,WAAW,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,KAAY,EAAE,SAAmB,EAAE,eAAwB,EAAQ,EAAE;IACjH,MAAM,OAAO,GAAG;QACZ,IAAI;QACJ,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,eAAe;QACf,SAAS;KACZ,CAAC;IAEF,OAAO,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC,CAAC","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport type { Vector4 } from \"../../Maths/math.vector\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Plane } from \"../../Maths/math.plane\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\n\r\n/**\r\n * Creates the VertexData for a Plane\r\n * @param options an object used to set the following optional parameters for the plane, required but can be empty\r\n * * size sets the width and height of the plane to the value of size, optional default 1\r\n * * width sets the width (x direction) of the plane, overwrites the width set by size, optional, default size\r\n * * height sets the height (y direction) of the plane, overwrites the height set by size, optional, default size\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * * 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)\r\n * * 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)\r\n * @param options.size\r\n * @param options.width\r\n * @param options.height\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @returns the VertexData of the box\r\n */\r\nexport function CreatePlaneVertexData(options: { size?: number; width?: number; height?: number; sideOrientation?: number; frontUVs?: Vector4; backUVs?: Vector4 }): VertexData {\r\n const indices = [];\r\n const positions = [];\r\n const normals = [];\r\n const uvs = [];\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 sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || VertexData.DEFAULTSIDE;\r\n\r\n // Vertices\r\n const halfWidth = width / 2.0;\r\n const halfHeight = height / 2.0;\r\n\r\n positions.push(-halfWidth, -halfHeight, 0);\r\n normals.push(0, 0, -1.0);\r\n uvs.push(0.0, CompatibilityOptions.UseOpenGLOrientationForUV ? 1.0 : 0.0);\r\n\r\n positions.push(halfWidth, -halfHeight, 0);\r\n normals.push(0, 0, -1.0);\r\n uvs.push(1.0, CompatibilityOptions.UseOpenGLOrientationForUV ? 1.0 : 0.0);\r\n\r\n positions.push(halfWidth, halfHeight, 0);\r\n normals.push(0, 0, -1.0);\r\n uvs.push(1.0, CompatibilityOptions.UseOpenGLOrientationForUV ? 0.0 : 1.0);\r\n\r\n positions.push(-halfWidth, halfHeight, 0);\r\n normals.push(0, 0, -1.0);\r\n uvs.push(0.0, CompatibilityOptions.UseOpenGLOrientationForUV ? 0.0 : 1.0);\r\n\r\n // Indices\r\n indices.push(0);\r\n indices.push(1);\r\n indices.push(2);\r\n\r\n indices.push(0);\r\n indices.push(2);\r\n indices.push(3);\r\n\r\n // Sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);\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 plane mesh\r\n * * The parameter `size` sets the size (float) of both sides of the plane at once (default 1)\r\n * * You can set some different plane dimensions by using the parameters `width` and `height` (both by default have the same value of `size`)\r\n * * The parameter `sourcePlane` is a Plane instance. It builds a mesh plane from a Math plane\r\n * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\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.size\r\n * @param options.width\r\n * @param options.height\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param options.updatable\r\n * @param options.sourcePlane\r\n * @param scene defines the hosting scene\r\n * @returns the plane mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#plane\r\n */\r\nexport function CreatePlane(\r\n name: string,\r\n options: { size?: number; width?: number; height?: number; sideOrientation?: number; frontUVs?: Vector4; backUVs?: Vector4; updatable?: boolean; sourcePlane?: Plane } = {},\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const plane = new Mesh(name, scene);\r\n\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n plane._originalBuilderSideOrientation = options.sideOrientation;\r\n\r\n const vertexData = CreatePlaneVertexData(options);\r\n\r\n vertexData.applyToMesh(plane, options.updatable);\r\n\r\n if (options.sourcePlane) {\r\n plane.translate(options.sourcePlane.normal, -options.sourcePlane.d);\r\n plane.setDirection(options.sourcePlane.normal.scale(-1));\r\n }\r\n\r\n return plane;\r\n}\r\n\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the function directly from the module\r\n */\r\nexport const PlaneBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreatePlane,\r\n};\r\n\r\nVertexData.CreatePlane = CreatePlaneVertexData;\r\nMesh.CreatePlane = (name: string, size: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh => {\r\n const options = {\r\n size,\r\n width: size,\r\n height: size,\r\n sideOrientation,\r\n updatable,\r\n };\r\n\r\n return CreatePlane(name, options, scene);\r\n};\r\n"]}
1
+ {"version":3,"file":"planeBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/planeBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAA4H;IAC9J,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,MAAM,GAAG,GAAG,EAAE,CAAC;IAEf,MAAM,KAAK,GAAW,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC;IACzD,MAAM,MAAM,GAAW,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC;IAC3D,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,IAAI,UAAU,CAAC,WAAW,CAAC;IAE9G,WAAW;IACX,MAAM,SAAS,GAAG,KAAK,GAAG,GAAG,CAAC;IAC9B,MAAM,UAAU,GAAG,MAAM,GAAG,GAAG,CAAC;IAEhC,SAAS,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACzB,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,oBAAoB,CAAC,yBAAyB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAA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AAI,CAAC,WAAW,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,KAAY,EAAE,SAAmB,EAAE,eAAwB,EAAQ,EAAE;IACjH,MAAM,OAAO,GAAG;QACZ,IAAI;QACJ,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,eAAe;QACf,SAAS;KACZ,CAAC;IAEF,OAAO,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC7C,CAAC,CAAC","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport type { Vector4 } from \"../../Maths/math.vector\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport type { Nullable } from \"../../types\";\r\nimport type { Plane } from \"../../Maths/math.plane\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\n\r\n/**\r\n * Creates the VertexData for a Plane\r\n * @param options an object used to set the following optional parameters for the plane, required but can be empty\r\n * * size sets the width and height of the plane to the value of size, optional default 1\r\n * * width sets the width (x direction) of the plane, overwrites the width set by size, optional, default size\r\n * * height sets the height (y direction) of the plane, overwrites the height set by size, optional, default size\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * * 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)\r\n * * 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)\r\n * @returns the VertexData of the box\r\n */\r\nexport function CreatePlaneVertexData(options: { size?: number; width?: number; height?: number; sideOrientation?: number; frontUVs?: Vector4; backUVs?: Vector4 }): VertexData {\r\n const indices = [];\r\n const positions = [];\r\n const normals = [];\r\n const uvs = [];\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 sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || VertexData.DEFAULTSIDE;\r\n\r\n // Vertices\r\n const halfWidth = width / 2.0;\r\n const halfHeight = height / 2.0;\r\n\r\n positions.push(-halfWidth, -halfHeight, 0);\r\n normals.push(0, 0, -1.0);\r\n uvs.push(0.0, CompatibilityOptions.UseOpenGLOrientationForUV ? 1.0 : 0.0);\r\n\r\n positions.push(halfWidth, -halfHeight, 0);\r\n normals.push(0, 0, -1.0);\r\n uvs.push(1.0, CompatibilityOptions.UseOpenGLOrientationForUV ? 1.0 : 0.0);\r\n\r\n positions.push(halfWidth, halfHeight, 0);\r\n normals.push(0, 0, -1.0);\r\n uvs.push(1.0, CompatibilityOptions.UseOpenGLOrientationForUV ? 0.0 : 1.0);\r\n\r\n positions.push(-halfWidth, halfHeight, 0);\r\n normals.push(0, 0, -1.0);\r\n uvs.push(0.0, CompatibilityOptions.UseOpenGLOrientationForUV ? 0.0 : 1.0);\r\n\r\n // Indices\r\n indices.push(0);\r\n indices.push(1);\r\n indices.push(2);\r\n\r\n indices.push(0);\r\n indices.push(2);\r\n indices.push(3);\r\n\r\n // Sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);\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 plane mesh\r\n * * The parameter `size` sets the size (float) of both sides of the plane at once (default 1)\r\n * * You can set some different plane dimensions by using the parameters `width` and `height` (both by default have the same value of `size`)\r\n * * The parameter `sourcePlane` is a Plane instance. It builds a mesh plane from a Math plane\r\n * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#side-orientation\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\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 scene defines the hosting scene\r\n * @returns the plane mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#plane\r\n */\r\nexport function CreatePlane(\r\n name: string,\r\n options: { size?: number; width?: number; height?: number; sideOrientation?: number; frontUVs?: Vector4; backUVs?: Vector4; updatable?: boolean; sourcePlane?: Plane } = {},\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const plane = new Mesh(name, scene);\r\n\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n plane._originalBuilderSideOrientation = options.sideOrientation;\r\n\r\n const vertexData = CreatePlaneVertexData(options);\r\n\r\n vertexData.applyToMesh(plane, options.updatable);\r\n\r\n if (options.sourcePlane) {\r\n plane.translate(options.sourcePlane.normal, -options.sourcePlane.d);\r\n plane.setDirection(options.sourcePlane.normal.scale(-1));\r\n }\r\n\r\n return plane;\r\n}\r\n\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the function directly from the module\r\n */\r\nexport const PlaneBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreatePlane,\r\n};\r\n\r\nVertexData.CreatePlane = CreatePlaneVertexData;\r\nMesh.CreatePlane = (name: string, size: number, scene: Scene, updatable?: boolean, sideOrientation?: number): Mesh => {\r\n const options = {\r\n size,\r\n width: size,\r\n height: size,\r\n sideOrientation,\r\n updatable,\r\n };\r\n\r\n return CreatePlane(name, options, scene);\r\n};\r\n"]}