@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":"decalBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/decalBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACrC,MAAM,MAAM,GAAG,IA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,OAAO,CAAC,CAAC;AAClD,CAAC,CAAC","sourcesContent":["import type { Nullable, IndicesArray, FloatArray } from \"../../types\";\r\nimport { Vector3, Matrix, Vector2, TmpVectors } from \"../../Maths/math.vector\";\r\nimport { Scalar } from \"../../Maths/math.scalar\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexBuffer } from \"../../Buffers/buffer\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport type { AbstractMesh } from \"../abstractMesh\";\r\nimport type { Camera } from \"../../Cameras/camera\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\n\r\nconst xpAxis = new Vector3(1, 0, 0);\r\nconst xnAxis = new Vector3(-1, 0, 0);\r\nconst ypAxis = new Vector3(0, 1, 0);\r\nconst ynAxis = new Vector3(0, -1, 0);\r\nconst zpAxis = new Vector3(0, 0, 1);\r\nconst znAxis = new Vector3(0, 0, -1);\r\n\r\n/** @internal */\r\nclass DecalVertex {\r\n constructor(\r\n public position: Vector3 = Vector3.Zero(),\r\n public normal: Vector3 = Vector3.Up(),\r\n public uv: Vector2 = Vector2.Zero(),\r\n public vertexIdx: number = 0,\r\n public vertexIdxForBones: number = 0,\r\n public localPositionOverride: Nullable<number[]> = null,\r\n public localNormalOverride: Nullable<number[]> = null,\r\n public matrixIndicesOverride: Nullable<number[]> = null,\r\n public matrixWeightsOverride: Nullable<number[]> = null\r\n ) {}\r\n public clone(): DecalVertex {\r\n return new DecalVertex(\r\n this.position.clone(),\r\n this.normal.clone(),\r\n this.uv.clone(),\r\n this.vertexIdx,\r\n this.vertexIdxForBones,\r\n this.localPositionOverride?.slice(),\r\n this.localNormalOverride?.slice(),\r\n this.matrixIndicesOverride?.slice(),\r\n this.matrixWeightsOverride?.slice()\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Creates a decal mesh.\r\n * A decal is a mesh usually applied as a model onto the surface of another mesh. So don't forget the parameter `sourceMesh` depicting the decal\r\n * * The parameter `position` (Vector3, default `(0, 0, 0)`) sets the position of the decal in World coordinates\r\n * * The parameter `normal` (Vector3, default `Vector3.Up`) sets the normal of the mesh where the decal is applied onto in World coordinates\r\n * * The parameter `size` (Vector3, default `(1, 1, 1)`) sets the decal scaling\r\n * * The parameter `angle` (float in radian, default 0) sets the angle to rotate the decal\r\n * * The parameter `captureUVS` defines if we need to capture the uvs or compute them\r\n * * The parameter `cullBackFaces` defines if the back faces should be removed from the decal mesh\r\n * * The parameter `localMode` defines that the computations should be done with the local mesh coordinates instead of the world space coordinates.\r\n * * Use this mode if you want the decal to be parented to the sourceMesh and move/rotate with it.\r\n * Note: Meshes with morph targets are not supported!\r\n * @param name defines the name of the mesh\r\n * @param sourceMesh defines the mesh where the decal must be applied\r\n * @param options defines the options used to create the mesh\r\n * @param options.position\r\n * @param options.normal\r\n * @param options.size\r\n * @param options.angle\r\n * @param options.captureUVS\r\n * @param options.cullBackFaces\r\n * @param options.localMode\r\n * @returns the decal mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/decals\r\n */\r\nexport function CreateDecal(\r\n name: string,\r\n sourceMesh: AbstractMesh,\r\n options: { position?: Vector3; normal?: Vector3; size?: Vector3; angle?: number; captureUVS?: boolean; cullBackFaces?: boolean; localMode?: boolean }\r\n): Mesh {\r\n const hasSkeleton = !!sourceMesh.skeleton;\r\n const useLocalComputation = options.localMode || hasSkeleton;\r\n const meshHasOverridenMaterial = (sourceMesh as Mesh).overrideMaterialSideOrientation !== null && (sourceMesh as Mesh).overrideMaterialSideOrientation !== undefined;\r\n\r\n const indices = <IndicesArray>sourceMesh.getIndices();\r\n const positions = hasSkeleton ? sourceMesh.getPositionData(true, true) : sourceMesh.getVerticesData(VertexBuffer.PositionKind);\r\n const normals = hasSkeleton ? sourceMesh.getNormalsData(true, true) : sourceMesh.getVerticesData(VertexBuffer.NormalKind);\r\n const localPositions = useLocalComputation ? (hasSkeleton ? sourceMesh.getVerticesData(VertexBuffer.PositionKind) : positions) : null;\r\n const localNormals = useLocalComputation ? (hasSkeleton ? sourceMesh.getVerticesData(VertexBuffer.NormalKind) : normals) : null;\r\n const uvs = sourceMesh.getVerticesData(VertexBuffer.UVKind);\r\n const matIndices = hasSkeleton ? sourceMesh.getVerticesData(VertexBuffer.MatricesIndicesKind) : null;\r\n const matWeights = hasSkeleton ? sourceMesh.getVerticesData(VertexBuffer.MatricesWeightsKind) : null;\r\n const matIndicesExtra = hasSkeleton ? sourceMesh.getVerticesData(VertexBuffer.MatricesIndicesExtraKind) : null;\r\n const matWeightsExtra = hasSkeleton ? sourceMesh.getVerticesData(VertexBuffer.MatricesWeightsExtraKind) : null;\r\n\r\n const position = options.position || Vector3.Zero();\r\n let normal = options.normal || Vector3.Up();\r\n const size = options.size || Vector3.One();\r\n const angle = options.angle || 0;\r\n\r\n // Getting correct rotation\r\n if (!normal) {\r\n const target = new Vector3(0, 0, 1);\r\n const camera = <Camera>sourceMesh.getScene().activeCamera;\r\n const cameraWorldTarget = Vector3.TransformCoordinates(target, camera.getWorldMatrix());\r\n\r\n normal = camera.globalPosition.subtract(cameraWorldTarget);\r\n }\r\n\r\n const yaw = -Math.atan2(normal.z, normal.x) - Math.PI / 2;\r\n const len = Math.sqrt(normal.x * normal.x + normal.z * normal.z);\r\n const pitch = Math.atan2(normal.y, len);\r\n\r\n const vertexData = new VertexData();\r\n vertexData.indices = [];\r\n vertexData.positions = [];\r\n vertexData.normals = [];\r\n vertexData.uvs = [];\r\n vertexData.matricesIndices = hasSkeleton ? [] : null;\r\n vertexData.matricesWeights = hasSkeleton ? [] : null;\r\n vertexData.matricesIndicesExtra = matIndicesExtra ? [] : null;\r\n vertexData.matricesWeightsExtra = matWeightsExtra ? [] : null;\r\n\r\n let currentVertexDataIndex = 0;\r\n\r\n const extractDecalVector3 = (indexId: number, transformMatrix: Matrix): DecalVertex => {\r\n const result = new DecalVertex();\r\n if (!indices || !positions || !normals) {\r\n return result;\r\n }\r\n\r\n const vertexId = indices[indexId];\r\n\r\n result.vertexIdx = vertexId * 3;\r\n result.vertexIdxForBones = vertexId * 4;\r\n\r\n // Send vector to decal local world\r\n result.position = new Vector3(positions[vertexId * 3], positions[vertexId * 3 + 1], positions[vertexId * 3 + 2]);\r\n Vector3.TransformCoordinatesToRef(result.position, transformMatrix, result.position);\r\n\r\n // Get normal\r\n result.normal = new Vector3(normals[vertexId * 3], normals[vertexId * 3 + 1], normals[vertexId * 3 + 2]);\r\n Vector3.TransformNormalToRef(result.normal, transformMatrix, result.normal);\r\n\r\n if (options.captureUVS && uvs) {\r\n const v = uvs[vertexId * 2 + 1];\r\n result.uv = new Vector2(uvs[vertexId * 2], CompatibilityOptions.UseOpenGLOrientationForUV ? 1 - v : v);\r\n }\r\n\r\n return result;\r\n };\r\n\r\n const emptyArray = [0, 0, 0, 0];\r\n\r\n // Inspired by https://github.com/mrdoob/three.js/blob/eee231960882f6f3b6113405f524956145148146/examples/js/geometries/DecalGeometry.js\r\n const clip = (vertices: DecalVertex[], axis: Vector3): Nullable<DecalVertex[]> => {\r\n if (vertices.length === 0) {\r\n return vertices;\r\n }\r\n\r\n const clipSize = 0.5 * Math.abs(Vector3.Dot(size, axis));\r\n\r\n const indexOf = (arr: FloatArray | number[], val: number, start: number, num: number) => {\r\n for (let i = 0; i < num; ++i) {\r\n if (arr[start + i] === val) {\r\n return start + i;\r\n }\r\n }\r\n return -1;\r\n };\r\n\r\n const clipVertices = (v0: DecalVertex, v1: DecalVertex): DecalVertex => {\r\n const clipFactor = Vector3.GetClipFactor(v0.position, v1.position, axis, clipSize);\r\n\r\n let indices = emptyArray;\r\n let weights = emptyArray;\r\n\r\n if (matIndices && matWeights) {\r\n const mat0Index = v0.matrixIndicesOverride ? 0 : v0.vertexIdxForBones;\r\n const v0Indices = v0.matrixIndicesOverride ?? matIndices;\r\n const v0Weights = v0.matrixWeightsOverride ?? matWeights;\r\n\r\n const mat1Index = v1.matrixIndicesOverride ? 0 : v1.vertexIdxForBones;\r\n const v1Indices = v1.matrixIndicesOverride ?? matIndices;\r\n const v1Weights = v1.matrixWeightsOverride ?? matWeights;\r\n\r\n indices = [0, 0, 0, 0];\r\n weights = [0, 0, 0, 0];\r\n\r\n let index = 0;\r\n for (let i = 0; i < 4; ++i) {\r\n if (v0Weights[mat0Index + i] > 0) {\r\n const idx = indexOf(v1Indices, v0Indices[mat0Index + i], mat1Index, 4);\r\n indices[index] = v0Indices[mat0Index + i];\r\n weights[index] = Scalar.Lerp(v0Weights[mat0Index + i], idx >= 0 ? v1Weights[idx] : 0, clipFactor);\r\n index++;\r\n }\r\n }\r\n\r\n for (let i = 0; i < 4 && index < 4; ++i) {\r\n const ind = v1Indices[mat1Index + i];\r\n if (indexOf(v0Indices, ind, mat0Index, 4) !== -1) continue;\r\n\r\n indices[index] = ind;\r\n weights[index] = Scalar.Lerp(0, v1Weights[mat1Index + i], clipFactor);\r\n index++;\r\n }\r\n\r\n const sumw = weights[0] + weights[1] + weights[2] + weights[3];\r\n\r\n weights[0] /= sumw;\r\n weights[1] /= sumw;\r\n weights[2] /= sumw;\r\n weights[3] /= sumw;\r\n }\r\n\r\n const v0LocalPositionX = v0.localPositionOverride ? v0.localPositionOverride[0] : localPositions?.[v0.vertexIdx] ?? 0;\r\n const v0LocalPositionY = v0.localPositionOverride ? v0.localPositionOverride[1] : localPositions?.[v0.vertexIdx + 1] ?? 0;\r\n const v0LocalPositionZ = v0.localPositionOverride ? v0.localPositionOverride[2] : localPositions?.[v0.vertexIdx + 2] ?? 0;\r\n\r\n const v1LocalPositionX = v1.localPositionOverride ? v1.localPositionOverride[0] : localPositions?.[v1.vertexIdx] ?? 0;\r\n const v1LocalPositionY = v1.localPositionOverride ? v1.localPositionOverride[1] : localPositions?.[v1.vertexIdx + 1] ?? 0;\r\n const v1LocalPositionZ = v1.localPositionOverride ? v1.localPositionOverride[2] : localPositions?.[v1.vertexIdx + 2] ?? 0;\r\n\r\n const v0LocalNormalX = v0.localNormalOverride ? v0.localNormalOverride[0] : localNormals?.[v0.vertexIdx] ?? 0;\r\n const v0LocalNormalY = v0.localNormalOverride ? v0.localNormalOverride[1] : localNormals?.[v0.vertexIdx + 1] ?? 0;\r\n const v0LocalNormalZ = v0.localNormalOverride ? v0.localNormalOverride[2] : localNormals?.[v0.vertexIdx + 2] ?? 0;\r\n\r\n const v1LocalNormalX = v1.localNormalOverride ? v1.localNormalOverride[0] : localNormals?.[v1.vertexIdx] ?? 0;\r\n const v1LocalNormalY = v1.localNormalOverride ? v1.localNormalOverride[1] : localNormals?.[v1.vertexIdx + 1] ?? 0;\r\n const v1LocalNormalZ = v1.localNormalOverride ? v1.localNormalOverride[2] : localNormals?.[v1.vertexIdx + 2] ?? 0;\r\n\r\n const interpNormalX = v0LocalNormalX + (v1LocalNormalX - v0LocalNormalX) * clipFactor;\r\n const interpNormalY = v0LocalNormalY + (v1LocalNormalY - v0LocalNormalY) * clipFactor;\r\n const interpNormalZ = v0LocalNormalZ + (v1LocalNormalZ - v0LocalNormalZ) * clipFactor;\r\n\r\n const norm = Math.sqrt(interpNormalX * interpNormalX + interpNormalY * interpNormalY + interpNormalZ * interpNormalZ);\r\n\r\n return new DecalVertex(\r\n Vector3.Lerp(v0.position, v1.position, clipFactor),\r\n Vector3.Lerp(v0.normal, v1.normal, clipFactor).normalize(),\r\n Vector2.Lerp(v0.uv, v1.uv, clipFactor),\r\n -1,\r\n -1,\r\n localPositions\r\n ? [\r\n v0LocalPositionX + (v1LocalPositionX - v0LocalPositionX) * clipFactor,\r\n v0LocalPositionY + (v1LocalPositionY - v0LocalPositionY) * clipFactor,\r\n v0LocalPositionZ + (v1LocalPositionZ - v0LocalPositionZ) * clipFactor,\r\n ]\r\n : null,\r\n localNormals ? [interpNormalX / norm, interpNormalY / norm, interpNormalZ / norm] : null,\r\n indices,\r\n weights\r\n );\r\n };\r\n\r\n let clipResult: Nullable<DecalVertex[]> = null;\r\n\r\n if (vertices.length > 3) {\r\n clipResult = [] as DecalVertex[];\r\n }\r\n\r\n for (let index = 0; index < vertices.length; index += 3) {\r\n let total = 0;\r\n let nV1: Nullable<DecalVertex> = null;\r\n let nV2: Nullable<DecalVertex> = null;\r\n let nV3: Nullable<DecalVertex> = null;\r\n let nV4: Nullable<DecalVertex> = null;\r\n\r\n const d1 = Vector3.Dot(vertices[index].position, axis) - clipSize;\r\n const d2 = Vector3.Dot(vertices[index + 1].position, axis) - clipSize;\r\n const d3 = Vector3.Dot(vertices[index + 2].position, axis) - clipSize;\r\n\r\n const v1Out = d1 > 0;\r\n const v2Out = d2 > 0;\r\n const v3Out = d3 > 0;\r\n\r\n total = (v1Out ? 1 : 0) + (v2Out ? 1 : 0) + (v3Out ? 1 : 0);\r\n\r\n switch (total) {\r\n case 0:\r\n if (vertices.length > 3) {\r\n clipResult!.push(vertices[index]);\r\n clipResult!.push(vertices[index + 1]);\r\n clipResult!.push(vertices[index + 2]);\r\n } else {\r\n clipResult = vertices;\r\n }\r\n break;\r\n case 1:\r\n clipResult = clipResult ?? new Array<DecalVertex>();\r\n if (v1Out) {\r\n nV1 = vertices[index + 1];\r\n nV2 = vertices[index + 2];\r\n nV3 = clipVertices(vertices[index], nV1);\r\n nV4 = clipVertices(vertices[index], nV2);\r\n }\r\n\r\n if (v2Out) {\r\n nV1 = vertices[index];\r\n nV2 = vertices[index + 2];\r\n nV3 = clipVertices(vertices[index + 1], nV1);\r\n nV4 = clipVertices(vertices[index + 1], nV2);\r\n\r\n clipResult.push(nV3);\r\n clipResult.push(nV2.clone());\r\n clipResult.push(nV1.clone());\r\n\r\n clipResult.push(nV2.clone());\r\n clipResult.push(nV3.clone());\r\n clipResult.push(nV4);\r\n break;\r\n }\r\n if (v3Out) {\r\n nV1 = vertices[index];\r\n nV2 = vertices[index + 1];\r\n nV3 = clipVertices(vertices[index + 2], nV1);\r\n nV4 = clipVertices(vertices[index + 2], nV2);\r\n }\r\n\r\n if (nV1 && nV2 && nV3 && nV4) {\r\n clipResult.push(nV1.clone());\r\n clipResult.push(nV2.clone());\r\n clipResult.push(nV3);\r\n\r\n clipResult.push(nV4);\r\n clipResult.push(nV3.clone());\r\n clipResult.push(nV2.clone());\r\n }\r\n break;\r\n case 2:\r\n clipResult = clipResult ?? new Array<DecalVertex>();\r\n if (!v1Out) {\r\n nV1 = vertices[index].clone();\r\n nV2 = clipVertices(nV1, vertices[index + 1]);\r\n nV3 = clipVertices(nV1, vertices[index + 2]);\r\n clipResult.push(nV1);\r\n clipResult.push(nV2);\r\n clipResult.push(nV3);\r\n }\r\n if (!v2Out) {\r\n nV1 = vertices[index + 1].clone();\r\n nV2 = clipVertices(nV1, vertices[index + 2]);\r\n nV3 = clipVertices(nV1, vertices[index]);\r\n clipResult.push(nV1);\r\n clipResult.push(nV2);\r\n clipResult.push(nV3);\r\n }\r\n if (!v3Out) {\r\n nV1 = vertices[index + 2].clone();\r\n nV2 = clipVertices(nV1, vertices[index]);\r\n nV3 = clipVertices(nV1, vertices[index + 1]);\r\n clipResult.push(nV1);\r\n clipResult.push(nV2);\r\n clipResult.push(nV3);\r\n }\r\n break;\r\n case 3:\r\n break;\r\n }\r\n }\r\n\r\n return clipResult;\r\n };\r\n\r\n const sourceMeshAsMesh = sourceMesh instanceof Mesh ? sourceMesh : null;\r\n const matrixData = sourceMeshAsMesh?._thinInstanceDataStorage.matrixData;\r\n\r\n const numMatrices = sourceMeshAsMesh?.thinInstanceCount || 1;\r\n const thinInstanceMatrix = TmpVectors.Matrix[0];\r\n\r\n thinInstanceMatrix.copyFrom(Matrix.IdentityReadOnly);\r\n\r\n for (let m = 0; m < numMatrices; ++m) {\r\n if (sourceMeshAsMesh?.hasThinInstances && matrixData) {\r\n const ofst = m * 16;\r\n\r\n thinInstanceMatrix.setRowFromFloats(0, matrixData[ofst + 0], matrixData[ofst + 1], matrixData[ofst + 2], matrixData[ofst + 3]);\r\n thinInstanceMatrix.setRowFromFloats(1, matrixData[ofst + 4], matrixData[ofst + 5], matrixData[ofst + 6], matrixData[ofst + 7]);\r\n thinInstanceMatrix.setRowFromFloats(2, matrixData[ofst + 8], matrixData[ofst + 9], matrixData[ofst + 10], matrixData[ofst + 11]);\r\n thinInstanceMatrix.setRowFromFloats(3, matrixData[ofst + 12], matrixData[ofst + 13], matrixData[ofst + 14], matrixData[ofst + 15]);\r\n }\r\n\r\n // Matrix\r\n const decalWorldMatrix = Matrix.RotationYawPitchRoll(yaw, pitch, angle).multiply(Matrix.Translation(position.x, position.y, position.z));\r\n const inverseDecalWorldMatrix = Matrix.Invert(decalWorldMatrix);\r\n const meshWorldMatrix = sourceMesh.getWorldMatrix();\r\n const transformMatrix = thinInstanceMatrix.multiply(meshWorldMatrix).multiply(inverseDecalWorldMatrix);\r\n\r\n const oneFaceVertices = new Array<DecalVertex>(3);\r\n\r\n for (let index = 0; index < indices.length; index += 3) {\r\n let faceVertices: Nullable<DecalVertex[]> = oneFaceVertices;\r\n\r\n faceVertices[0] = extractDecalVector3(index, transformMatrix);\r\n if (meshHasOverridenMaterial && useLocalComputation) {\r\n faceVertices[1] = extractDecalVector3(index + 2, transformMatrix);\r\n faceVertices[2] = extractDecalVector3(index + 1, transformMatrix);\r\n } else {\r\n faceVertices[1] = extractDecalVector3(index + 1, transformMatrix);\r\n faceVertices[2] = extractDecalVector3(index + 2, transformMatrix);\r\n }\r\n\r\n if (options.cullBackFaces) {\r\n // If all the normals of the vertices of the face are pointing away from the view direction we discard the face.\r\n // As computations are done in the decal coordinate space, the viewDirection is (0,0,1), so when dot(vertexNormal, -viewDirection) <= 0 the vertex is culled\r\n if (-faceVertices[0].normal.z <= 0 && -faceVertices[1].normal.z <= 0 && -faceVertices[2].normal.z <= 0) {\r\n continue;\r\n }\r\n }\r\n\r\n // Clip\r\n faceVertices = clip(faceVertices, xpAxis);\r\n if (!faceVertices) continue;\r\n faceVertices = clip(faceVertices, xnAxis);\r\n if (!faceVertices) continue;\r\n faceVertices = clip(faceVertices, ypAxis);\r\n if (!faceVertices) continue;\r\n faceVertices = clip(faceVertices, ynAxis);\r\n if (!faceVertices) continue;\r\n faceVertices = clip(faceVertices, zpAxis);\r\n if (!faceVertices) continue;\r\n faceVertices = clip(faceVertices, znAxis);\r\n if (!faceVertices) continue;\r\n\r\n // Add UVs and get back to world\r\n for (let vIndex = 0; vIndex < faceVertices.length; vIndex++) {\r\n const vertex = faceVertices[vIndex];\r\n\r\n //TODO check for Int32Array | Uint32Array | Uint16Array\r\n (<number[]>vertexData.indices).push(currentVertexDataIndex);\r\n if (useLocalComputation) {\r\n if (vertex.localPositionOverride) {\r\n vertexData.positions[currentVertexDataIndex * 3] = vertex.localPositionOverride[0];\r\n vertexData.positions[currentVertexDataIndex * 3 + 1] = vertex.localPositionOverride[1];\r\n vertexData.positions[currentVertexDataIndex * 3 + 2] = vertex.localPositionOverride[2];\r\n } else if (localPositions) {\r\n vertexData.positions[currentVertexDataIndex * 3] = localPositions[vertex.vertexIdx];\r\n vertexData.positions[currentVertexDataIndex * 3 + 1] = localPositions[vertex.vertexIdx + 1];\r\n vertexData.positions[currentVertexDataIndex * 3 + 2] = localPositions[vertex.vertexIdx + 2];\r\n }\r\n if (vertex.localNormalOverride) {\r\n vertexData.normals[currentVertexDataIndex * 3] = vertex.localNormalOverride[0];\r\n vertexData.normals[currentVertexDataIndex * 3 + 1] = vertex.localNormalOverride[1];\r\n vertexData.normals[currentVertexDataIndex * 3 + 2] = vertex.localNormalOverride[2];\r\n } else if (localNormals) {\r\n vertexData.normals[currentVertexDataIndex * 3] = localNormals[vertex.vertexIdx];\r\n vertexData.normals[currentVertexDataIndex * 3 + 1] = localNormals[vertex.vertexIdx + 1];\r\n vertexData.normals[currentVertexDataIndex * 3 + 2] = localNormals[vertex.vertexIdx + 2];\r\n }\r\n } else {\r\n vertex.position.toArray(vertexData.positions, currentVertexDataIndex * 3);\r\n vertex.normal.toArray(vertexData.normals, currentVertexDataIndex * 3);\r\n }\r\n if (vertexData.matricesIndices && vertexData.matricesWeights) {\r\n if (vertex.matrixIndicesOverride) {\r\n vertexData.matricesIndices[currentVertexDataIndex * 4] = vertex.matrixIndicesOverride[0];\r\n vertexData.matricesIndices[currentVertexDataIndex * 4 + 1] = vertex.matrixIndicesOverride[1];\r\n vertexData.matricesIndices[currentVertexDataIndex * 4 + 2] = vertex.matrixIndicesOverride[2];\r\n vertexData.matricesIndices[currentVertexDataIndex * 4 + 3] = vertex.matrixIndicesOverride[3];\r\n } else {\r\n if (matIndices) {\r\n vertexData.matricesIndices[currentVertexDataIndex * 4] = matIndices[vertex.vertexIdxForBones];\r\n vertexData.matricesIndices[currentVertexDataIndex * 4 + 1] = matIndices[vertex.vertexIdxForBones + 1];\r\n vertexData.matricesIndices[currentVertexDataIndex * 4 + 2] = matIndices[vertex.vertexIdxForBones + 2];\r\n vertexData.matricesIndices[currentVertexDataIndex * 4 + 3] = matIndices[vertex.vertexIdxForBones + 3];\r\n }\r\n if (matIndicesExtra && vertexData.matricesIndicesExtra) {\r\n vertexData.matricesIndicesExtra[currentVertexDataIndex * 4] = matIndicesExtra[vertex.vertexIdxForBones];\r\n vertexData.matricesIndicesExtra[currentVertexDataIndex * 4 + 1] = matIndicesExtra[vertex.vertexIdxForBones + 1];\r\n vertexData.matricesIndicesExtra[currentVertexDataIndex * 4 + 2] = matIndicesExtra[vertex.vertexIdxForBones + 2];\r\n vertexData.matricesIndicesExtra[currentVertexDataIndex * 4 + 3] = matIndicesExtra[vertex.vertexIdxForBones + 3];\r\n }\r\n }\r\n if (vertex.matrixWeightsOverride) {\r\n vertexData.matricesWeights[currentVertexDataIndex * 4] = vertex.matrixWeightsOverride[0];\r\n vertexData.matricesWeights[currentVertexDataIndex * 4 + 1] = vertex.matrixWeightsOverride[1];\r\n vertexData.matricesWeights[currentVertexDataIndex * 4 + 2] = vertex.matrixWeightsOverride[2];\r\n vertexData.matricesWeights[currentVertexDataIndex * 4 + 3] = vertex.matrixWeightsOverride[3];\r\n } else {\r\n if (matWeights) {\r\n vertexData.matricesWeights[currentVertexDataIndex * 4] = matWeights[vertex.vertexIdxForBones];\r\n vertexData.matricesWeights[currentVertexDataIndex * 4 + 1] = matWeights[vertex.vertexIdxForBones + 1];\r\n vertexData.matricesWeights[currentVertexDataIndex * 4 + 2] = matWeights[vertex.vertexIdxForBones + 2];\r\n vertexData.matricesWeights[currentVertexDataIndex * 4 + 3] = matWeights[vertex.vertexIdxForBones + 3];\r\n }\r\n if (matWeightsExtra && vertexData.matricesWeightsExtra) {\r\n vertexData.matricesWeightsExtra[currentVertexDataIndex * 4] = matWeightsExtra[vertex.vertexIdxForBones];\r\n vertexData.matricesWeightsExtra[currentVertexDataIndex * 4 + 1] = matWeightsExtra[vertex.vertexIdxForBones + 1];\r\n vertexData.matricesWeightsExtra[currentVertexDataIndex * 4 + 2] = matWeightsExtra[vertex.vertexIdxForBones + 2];\r\n vertexData.matricesWeightsExtra[currentVertexDataIndex * 4 + 3] = matWeightsExtra[vertex.vertexIdxForBones + 3];\r\n }\r\n }\r\n }\r\n\r\n if (!options.captureUVS) {\r\n (<number[]>vertexData.uvs).push(0.5 + vertex.position.x / size.x);\r\n const v = 0.5 + vertex.position.y / size.y;\r\n (<number[]>vertexData.uvs).push(CompatibilityOptions.UseOpenGLOrientationForUV ? 1 - v : v);\r\n } else {\r\n vertex.uv.toArray(vertexData.uvs, currentVertexDataIndex * 2);\r\n }\r\n currentVertexDataIndex++;\r\n }\r\n }\r\n }\r\n\r\n // Avoid the \"Setting vertex data kind 'XXX' with an empty array\" warning when calling vertexData.applyToMesh\r\n if (vertexData.indices.length === 0) vertexData.indices = null;\r\n if (vertexData.positions.length === 0) vertexData.positions = null;\r\n if (vertexData.normals.length === 0) vertexData.normals = null;\r\n if (vertexData.uvs.length === 0) vertexData.uvs = null;\r\n if (vertexData.matricesIndices?.length === 0) vertexData.matricesIndices = null;\r\n if (vertexData.matricesWeights?.length === 0) vertexData.matricesWeights = null;\r\n if (vertexData.matricesIndicesExtra?.length === 0) vertexData.matricesIndicesExtra = null;\r\n if (vertexData.matricesWeightsExtra?.length === 0) vertexData.matricesWeightsExtra = null;\r\n\r\n // Return mesh\r\n const decal = new Mesh(name, sourceMesh.getScene());\r\n vertexData.applyToMesh(decal);\r\n\r\n if (useLocalComputation) {\r\n decal.skeleton = sourceMesh.skeleton;\r\n decal.parent = sourceMesh;\r\n } else {\r\n decal.position = position.clone();\r\n decal.rotation = new Vector3(pitch, yaw, angle);\r\n }\r\n\r\n decal.computeWorldMatrix(true);\r\n decal.refreshBoundingInfo(true, true);\r\n\r\n return decal;\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 DecalBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateDecal,\r\n};\r\n\r\nMesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, normal: Vector3, size: Vector3, angle: number): Mesh => {\r\n const options = {\r\n position,\r\n normal,\r\n size,\r\n angle,\r\n };\r\n\r\n return CreateDecal(name, sourceMesh, options);\r\n};\r\n"]}
1
+ {"version":3,"file":"decalBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/decalBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACpC,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACrC,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,CAAC,EAAE,CAAC,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Content":["import type { Nullable, IndicesArray, FloatArray } from \"../../types\";\r\nimport { Vector3, Matrix, Vector2, TmpVectors } from \"../../Maths/math.vector\";\r\nimport { Scalar } from \"../../Maths/math.scalar\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexBuffer } from \"../../Buffers/buffer\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport type { AbstractMesh } from \"../abstractMesh\";\r\nimport type { Camera } from \"../../Cameras/camera\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\n\r\nconst xpAxis = new Vector3(1, 0, 0);\r\nconst xnAxis = new Vector3(-1, 0, 0);\r\nconst ypAxis = new Vector3(0, 1, 0);\r\nconst ynAxis = new Vector3(0, -1, 0);\r\nconst zpAxis = new Vector3(0, 0, 1);\r\nconst znAxis = new Vector3(0, 0, -1);\r\n\r\n/** @internal */\r\nclass DecalVertex {\r\n constructor(\r\n public position: Vector3 = Vector3.Zero(),\r\n public normal: Vector3 = Vector3.Up(),\r\n public uv: Vector2 = Vector2.Zero(),\r\n public vertexIdx: number = 0,\r\n public vertexIdxForBones: number = 0,\r\n public localPositionOverride: Nullable<number[]> = null,\r\n public localNormalOverride: Nullable<number[]> = null,\r\n public matrixIndicesOverride: Nullable<number[]> = null,\r\n public matrixWeightsOverride: Nullable<number[]> = null\r\n ) {}\r\n public clone(): DecalVertex {\r\n return new DecalVertex(\r\n this.position.clone(),\r\n this.normal.clone(),\r\n this.uv.clone(),\r\n this.vertexIdx,\r\n this.vertexIdxForBones,\r\n this.localPositionOverride?.slice(),\r\n this.localNormalOverride?.slice(),\r\n this.matrixIndicesOverride?.slice(),\r\n this.matrixWeightsOverride?.slice()\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Creates a decal mesh.\r\n * A decal is a mesh usually applied as a model onto the surface of another mesh. So don't forget the parameter `sourceMesh` depicting the decal\r\n * * The parameter `position` (Vector3, default `(0, 0, 0)`) sets the position of the decal in World coordinates\r\n * * The parameter `normal` (Vector3, default `Vector3.Up`) sets the normal of the mesh where the decal is applied onto in World coordinates\r\n * * The parameter `size` (Vector3, default `(1, 1, 1)`) sets the decal scaling\r\n * * The parameter `angle` (float in radian, default 0) sets the angle to rotate the decal\r\n * * The parameter `captureUVS` defines if we need to capture the uvs or compute them\r\n * * The parameter `cullBackFaces` defines if the back faces should be removed from the decal mesh\r\n * * The parameter `localMode` defines that the computations should be done with the local mesh coordinates instead of the world space coordinates.\r\n * * Use this mode if you want the decal to be parented to the sourceMesh and move/rotate with it.\r\n * Note: Meshes with morph targets are not supported!\r\n * @param name defines the name of the mesh\r\n * @param sourceMesh defines the mesh where the decal must be applied\r\n * @param options defines the options used to create the mesh\r\n * @returns the decal mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/decals\r\n */\r\nexport function CreateDecal(\r\n name: string,\r\n sourceMesh: AbstractMesh,\r\n options: { position?: Vector3; normal?: Vector3; size?: Vector3; angle?: number; captureUVS?: boolean; cullBackFaces?: boolean; localMode?: boolean }\r\n): Mesh {\r\n const hasSkeleton = !!sourceMesh.skeleton;\r\n const useLocalComputation = options.localMode || hasSkeleton;\r\n const meshHasOverridenMaterial = (sourceMesh as Mesh).overrideMaterialSideOrientation !== null && (sourceMesh as Mesh).overrideMaterialSideOrientation !== undefined;\r\n\r\n const indices = <IndicesArray>sourceMesh.getIndices();\r\n const positions = hasSkeleton ? sourceMesh.getPositionData(true, true) : sourceMesh.getVerticesData(VertexBuffer.PositionKind);\r\n const normals = hasSkeleton ? sourceMesh.getNormalsData(true, true) : sourceMesh.getVerticesData(VertexBuffer.NormalKind);\r\n const localPositions = useLocalComputation ? (hasSkeleton ? sourceMesh.getVerticesData(VertexBuffer.PositionKind) : positions) : null;\r\n const localNormals = useLocalComputation ? (hasSkeleton ? sourceMesh.getVerticesData(VertexBuffer.NormalKind) : normals) : null;\r\n const uvs = sourceMesh.getVerticesData(VertexBuffer.UVKind);\r\n const matIndices = hasSkeleton ? sourceMesh.getVerticesData(VertexBuffer.MatricesIndicesKind) : null;\r\n const matWeights = hasSkeleton ? sourceMesh.getVerticesData(VertexBuffer.MatricesWeightsKind) : null;\r\n const matIndicesExtra = hasSkeleton ? sourceMesh.getVerticesData(VertexBuffer.MatricesIndicesExtraKind) : null;\r\n const matWeightsExtra = hasSkeleton ? sourceMesh.getVerticesData(VertexBuffer.MatricesWeightsExtraKind) : null;\r\n\r\n const position = options.position || Vector3.Zero();\r\n let normal = options.normal || Vector3.Up();\r\n const size = options.size || Vector3.One();\r\n const angle = options.angle || 0;\r\n\r\n // Getting correct rotation\r\n if (!normal) {\r\n const target = new Vector3(0, 0, 1);\r\n const camera = <Camera>sourceMesh.getScene().activeCamera;\r\n const cameraWorldTarget = Vector3.TransformCoordinates(target, camera.getWorldMatrix());\r\n\r\n normal = camera.globalPosition.subtract(cameraWorldTarget);\r\n }\r\n\r\n const yaw = -Math.atan2(normal.z, normal.x) - Math.PI / 2;\r\n const len = Math.sqrt(normal.x * normal.x + normal.z * normal.z);\r\n const pitch = Math.atan2(normal.y, len);\r\n\r\n const vertexData = new VertexData();\r\n vertexData.indices = [];\r\n vertexData.positions = [];\r\n vertexData.normals = [];\r\n vertexData.uvs = [];\r\n vertexData.matricesIndices = hasSkeleton ? [] : null;\r\n vertexData.matricesWeights = hasSkeleton ? [] : null;\r\n vertexData.matricesIndicesExtra = matIndicesExtra ? [] : null;\r\n vertexData.matricesWeightsExtra = matWeightsExtra ? [] : null;\r\n\r\n let currentVertexDataIndex = 0;\r\n\r\n const extractDecalVector3 = (indexId: number, transformMatrix: Matrix): DecalVertex => {\r\n const result = new DecalVertex();\r\n if (!indices || !positions || !normals) {\r\n return result;\r\n }\r\n\r\n const vertexId = indices[indexId];\r\n\r\n result.vertexIdx = vertexId * 3;\r\n result.vertexIdxForBones = vertexId * 4;\r\n\r\n // Send vector to decal local world\r\n result.position = new Vector3(positions[vertexId * 3], positions[vertexId * 3 + 1], positions[vertexId * 3 + 2]);\r\n Vector3.TransformCoordinatesToRef(result.position, transformMatrix, result.position);\r\n\r\n // Get normal\r\n result.normal = new Vector3(normals[vertexId * 3], normals[vertexId * 3 + 1], normals[vertexId * 3 + 2]);\r\n Vector3.TransformNormalToRef(result.normal, transformMatrix, result.normal);\r\n\r\n if (options.captureUVS && uvs) {\r\n const v = uvs[vertexId * 2 + 1];\r\n result.uv = new Vector2(uvs[vertexId * 2], CompatibilityOptions.UseOpenGLOrientationForUV ? 1 - v : v);\r\n }\r\n\r\n return result;\r\n };\r\n\r\n const emptyArray = [0, 0, 0, 0];\r\n\r\n // Inspired by https://github.com/mrdoob/three.js/blob/eee231960882f6f3b6113405f524956145148146/examples/js/geometries/DecalGeometry.js\r\n const clip = (vertices: DecalVertex[], axis: Vector3): Nullable<DecalVertex[]> => {\r\n if (vertices.length === 0) {\r\n return vertices;\r\n }\r\n\r\n const clipSize = 0.5 * Math.abs(Vector3.Dot(size, axis));\r\n\r\n const indexOf = (arr: FloatArray | number[], val: number, start: number, num: number) => {\r\n for (let i = 0; i < num; ++i) {\r\n if (arr[start + i] === val) {\r\n return start + i;\r\n }\r\n }\r\n return -1;\r\n };\r\n\r\n const clipVertices = (v0: DecalVertex, v1: DecalVertex): DecalVertex => {\r\n const clipFactor = Vector3.GetClipFactor(v0.position, v1.position, axis, clipSize);\r\n\r\n let indices = emptyArray;\r\n let weights = emptyArray;\r\n\r\n if (matIndices && matWeights) {\r\n const mat0Index = v0.matrixIndicesOverride ? 0 : v0.vertexIdxForBones;\r\n const v0Indices = v0.matrixIndicesOverride ?? matIndices;\r\n const v0Weights = v0.matrixWeightsOverride ?? matWeights;\r\n\r\n const mat1Index = v1.matrixIndicesOverride ? 0 : v1.vertexIdxForBones;\r\n const v1Indices = v1.matrixIndicesOverride ?? matIndices;\r\n const v1Weights = v1.matrixWeightsOverride ?? matWeights;\r\n\r\n indices = [0, 0, 0, 0];\r\n weights = [0, 0, 0, 0];\r\n\r\n let index = 0;\r\n for (let i = 0; i < 4; ++i) {\r\n if (v0Weights[mat0Index + i] > 0) {\r\n const idx = indexOf(v1Indices, v0Indices[mat0Index + i], mat1Index, 4);\r\n indices[index] = v0Indices[mat0Index + i];\r\n weights[index] = Scalar.Lerp(v0Weights[mat0Index + i], idx >= 0 ? v1Weights[idx] : 0, clipFactor);\r\n index++;\r\n }\r\n }\r\n\r\n for (let i = 0; i < 4 && index < 4; ++i) {\r\n const ind = v1Indices[mat1Index + i];\r\n if (indexOf(v0Indices, ind, mat0Index, 4) !== -1) continue;\r\n\r\n indices[index] = ind;\r\n weights[index] = Scalar.Lerp(0, v1Weights[mat1Index + i], clipFactor);\r\n index++;\r\n }\r\n\r\n const sumw = weights[0] + weights[1] + weights[2] + weights[3];\r\n\r\n weights[0] /= sumw;\r\n weights[1] /= sumw;\r\n weights[2] /= sumw;\r\n weights[3] /= sumw;\r\n }\r\n\r\n const v0LocalPositionX = v0.localPositionOverride ? v0.localPositionOverride[0] : localPositions?.[v0.vertexIdx] ?? 0;\r\n const v0LocalPositionY = v0.localPositionOverride ? v0.localPositionOverride[1] : localPositions?.[v0.vertexIdx + 1] ?? 0;\r\n const v0LocalPositionZ = v0.localPositionOverride ? v0.localPositionOverride[2] : localPositions?.[v0.vertexIdx + 2] ?? 0;\r\n\r\n const v1LocalPositionX = v1.localPositionOverride ? v1.localPositionOverride[0] : localPositions?.[v1.vertexIdx] ?? 0;\r\n const v1LocalPositionY = v1.localPositionOverride ? v1.localPositionOverride[1] : localPositions?.[v1.vertexIdx + 1] ?? 0;\r\n const v1LocalPositionZ = v1.localPositionOverride ? v1.localPositionOverride[2] : localPositions?.[v1.vertexIdx + 2] ?? 0;\r\n\r\n const v0LocalNormalX = v0.localNormalOverride ? v0.localNormalOverride[0] : localNormals?.[v0.vertexIdx] ?? 0;\r\n const v0LocalNormalY = v0.localNormalOverride ? v0.localNormalOverride[1] : localNormals?.[v0.vertexIdx + 1] ?? 0;\r\n const v0LocalNormalZ = v0.localNormalOverride ? v0.localNormalOverride[2] : localNormals?.[v0.vertexIdx + 2] ?? 0;\r\n\r\n const v1LocalNormalX = v1.localNormalOverride ? v1.localNormalOverride[0] : localNormals?.[v1.vertexIdx] ?? 0;\r\n const v1LocalNormalY = v1.localNormalOverride ? v1.localNormalOverride[1] : localNormals?.[v1.vertexIdx + 1] ?? 0;\r\n const v1LocalNormalZ = v1.localNormalOverride ? v1.localNormalOverride[2] : localNormals?.[v1.vertexIdx + 2] ?? 0;\r\n\r\n const interpNormalX = v0LocalNormalX + (v1LocalNormalX - v0LocalNormalX) * clipFactor;\r\n const interpNormalY = v0LocalNormalY + (v1LocalNormalY - v0LocalNormalY) * clipFactor;\r\n const interpNormalZ = v0LocalNormalZ + (v1LocalNormalZ - v0LocalNormalZ) * clipFactor;\r\n\r\n const norm = Math.sqrt(interpNormalX * interpNormalX + interpNormalY * interpNormalY + interpNormalZ * interpNormalZ);\r\n\r\n return new DecalVertex(\r\n Vector3.Lerp(v0.position, v1.position, clipFactor),\r\n Vector3.Lerp(v0.normal, v1.normal, clipFactor).normalize(),\r\n Vector2.Lerp(v0.uv, v1.uv, clipFactor),\r\n -1,\r\n -1,\r\n localPositions\r\n ? [\r\n v0LocalPositionX + (v1LocalPositionX - v0LocalPositionX) * clipFactor,\r\n v0LocalPositionY + (v1LocalPositionY - v0LocalPositionY) * clipFactor,\r\n v0LocalPositionZ + (v1LocalPositionZ - v0LocalPositionZ) * clipFactor,\r\n ]\r\n : null,\r\n localNormals ? [interpNormalX / norm, interpNormalY / norm, interpNormalZ / norm] : null,\r\n indices,\r\n weights\r\n );\r\n };\r\n\r\n let clipResult: Nullable<DecalVertex[]> = null;\r\n\r\n if (vertices.length > 3) {\r\n clipResult = [] as DecalVertex[];\r\n }\r\n\r\n for (let index = 0; index < vertices.length; index += 3) {\r\n let total = 0;\r\n let nV1: Nullable<DecalVertex> = null;\r\n let nV2: Nullable<DecalVertex> = null;\r\n let nV3: Nullable<DecalVertex> = null;\r\n let nV4: Nullable<DecalVertex> = null;\r\n\r\n const d1 = Vector3.Dot(vertices[index].position, axis) - clipSize;\r\n const d2 = Vector3.Dot(vertices[index + 1].position, axis) - clipSize;\r\n const d3 = Vector3.Dot(vertices[index + 2].position, axis) - clipSize;\r\n\r\n const v1Out = d1 > 0;\r\n const v2Out = d2 > 0;\r\n const v3Out = d3 > 0;\r\n\r\n total = (v1Out ? 1 : 0) + (v2Out ? 1 : 0) + (v3Out ? 1 : 0);\r\n\r\n switch (total) {\r\n case 0:\r\n if (vertices.length > 3) {\r\n clipResult!.push(vertices[index]);\r\n clipResult!.push(vertices[index + 1]);\r\n clipResult!.push(vertices[index + 2]);\r\n } else {\r\n clipResult = vertices;\r\n }\r\n break;\r\n case 1:\r\n clipResult = clipResult ?? new Array<DecalVertex>();\r\n if (v1Out) {\r\n nV1 = vertices[index + 1];\r\n nV2 = vertices[index + 2];\r\n nV3 = clipVertices(vertices[index], nV1);\r\n nV4 = clipVertices(vertices[index], nV2);\r\n }\r\n\r\n if (v2Out) {\r\n nV1 = vertices[index];\r\n nV2 = vertices[index + 2];\r\n nV3 = clipVertices(vertices[index + 1], nV1);\r\n nV4 = clipVertices(vertices[index + 1], nV2);\r\n\r\n clipResult.push(nV3);\r\n clipResult.push(nV2.clone());\r\n clipResult.push(nV1.clone());\r\n\r\n clipResult.push(nV2.clone());\r\n clipResult.push(nV3.clone());\r\n clipResult.push(nV4);\r\n break;\r\n }\r\n if (v3Out) {\r\n nV1 = vertices[index];\r\n nV2 = vertices[index + 1];\r\n nV3 = clipVertices(vertices[index + 2], nV1);\r\n nV4 = clipVertices(vertices[index + 2], nV2);\r\n }\r\n\r\n if (nV1 && nV2 && nV3 && nV4) {\r\n clipResult.push(nV1.clone());\r\n clipResult.push(nV2.clone());\r\n clipResult.push(nV3);\r\n\r\n clipResult.push(nV4);\r\n clipResult.push(nV3.clone());\r\n clipResult.push(nV2.clone());\r\n }\r\n break;\r\n case 2:\r\n clipResult = clipResult ?? new Array<DecalVertex>();\r\n if (!v1Out) {\r\n nV1 = vertices[index].clone();\r\n nV2 = clipVertices(nV1, vertices[index + 1]);\r\n nV3 = clipVertices(nV1, vertices[index + 2]);\r\n clipResult.push(nV1);\r\n clipResult.push(nV2);\r\n clipResult.push(nV3);\r\n }\r\n if (!v2Out) {\r\n nV1 = vertices[index + 1].clone();\r\n nV2 = clipVertices(nV1, vertices[index + 2]);\r\n nV3 = clipVertices(nV1, vertices[index]);\r\n clipResult.push(nV1);\r\n clipResult.push(nV2);\r\n clipResult.push(nV3);\r\n }\r\n if (!v3Out) {\r\n nV1 = vertices[index + 2].clone();\r\n nV2 = clipVertices(nV1, vertices[index]);\r\n nV3 = clipVertices(nV1, vertices[index + 1]);\r\n clipResult.push(nV1);\r\n clipResult.push(nV2);\r\n clipResult.push(nV3);\r\n }\r\n break;\r\n case 3:\r\n break;\r\n }\r\n }\r\n\r\n return clipResult;\r\n };\r\n\r\n const sourceMeshAsMesh = sourceMesh instanceof Mesh ? sourceMesh : null;\r\n const matrixData = sourceMeshAsMesh?._thinInstanceDataStorage.matrixData;\r\n\r\n const numMatrices = sourceMeshAsMesh?.thinInstanceCount || 1;\r\n const thinInstanceMatrix = TmpVectors.Matrix[0];\r\n\r\n thinInstanceMatrix.copyFrom(Matrix.IdentityReadOnly);\r\n\r\n for (let m = 0; m < numMatrices; ++m) {\r\n if (sourceMeshAsMesh?.hasThinInstances && matrixData) {\r\n const ofst = m * 16;\r\n\r\n thinInstanceMatrix.setRowFromFloats(0, matrixData[ofst + 0], matrixData[ofst + 1], matrixData[ofst + 2], matrixData[ofst + 3]);\r\n thinInstanceMatrix.setRowFromFloats(1, matrixData[ofst + 4], matrixData[ofst + 5], matrixData[ofst + 6], matrixData[ofst + 7]);\r\n thinInstanceMatrix.setRowFromFloats(2, matrixData[ofst + 8], matrixData[ofst + 9], matrixData[ofst + 10], matrixData[ofst + 11]);\r\n thinInstanceMatrix.setRowFromFloats(3, matrixData[ofst + 12], matrixData[ofst + 13], matrixData[ofst + 14], matrixData[ofst + 15]);\r\n }\r\n\r\n // Matrix\r\n const decalWorldMatrix = Matrix.RotationYawPitchRoll(yaw, pitch, angle).multiply(Matrix.Translation(position.x, position.y, position.z));\r\n const inverseDecalWorldMatrix = Matrix.Invert(decalWorldMatrix);\r\n const meshWorldMatrix = sourceMesh.getWorldMatrix();\r\n const transformMatrix = thinInstanceMatrix.multiply(meshWorldMatrix).multiply(inverseDecalWorldMatrix);\r\n\r\n const oneFaceVertices = new Array<DecalVertex>(3);\r\n\r\n for (let index = 0; index < indices.length; index += 3) {\r\n let faceVertices: Nullable<DecalVertex[]> = oneFaceVertices;\r\n\r\n faceVertices[0] = extractDecalVector3(index, transformMatrix);\r\n if (meshHasOverridenMaterial && useLocalComputation) {\r\n faceVertices[1] = extractDecalVector3(index + 2, transformMatrix);\r\n faceVertices[2] = extractDecalVector3(index + 1, transformMatrix);\r\n } else {\r\n faceVertices[1] = extractDecalVector3(index + 1, transformMatrix);\r\n faceVertices[2] = extractDecalVector3(index + 2, transformMatrix);\r\n }\r\n\r\n if (options.cullBackFaces) {\r\n // If all the normals of the vertices of the face are pointing away from the view direction we discard the face.\r\n // As computations are done in the decal coordinate space, the viewDirection is (0,0,1), so when dot(vertexNormal, -viewDirection) <= 0 the vertex is culled\r\n if (-faceVertices[0].normal.z <= 0 && -faceVertices[1].normal.z <= 0 && -faceVertices[2].normal.z <= 0) {\r\n continue;\r\n }\r\n }\r\n\r\n // Clip\r\n faceVertices = clip(faceVertices, xpAxis);\r\n if (!faceVertices) continue;\r\n faceVertices = clip(faceVertices, xnAxis);\r\n if (!faceVertices) continue;\r\n faceVertices = clip(faceVertices, ypAxis);\r\n if (!faceVertices) continue;\r\n faceVertices = clip(faceVertices, ynAxis);\r\n if (!faceVertices) continue;\r\n faceVertices = clip(faceVertices, zpAxis);\r\n if (!faceVertices) continue;\r\n faceVertices = clip(faceVertices, znAxis);\r\n if (!faceVertices) continue;\r\n\r\n // Add UVs and get back to world\r\n for (let vIndex = 0; vIndex < faceVertices.length; vIndex++) {\r\n const vertex = faceVertices[vIndex];\r\n\r\n //TODO check for Int32Array | Uint32Array | Uint16Array\r\n (<number[]>vertexData.indices).push(currentVertexDataIndex);\r\n if (useLocalComputation) {\r\n if (vertex.localPositionOverride) {\r\n vertexData.positions[currentVertexDataIndex * 3] = vertex.localPositionOverride[0];\r\n vertexData.positions[currentVertexDataIndex * 3 + 1] = vertex.localPositionOverride[1];\r\n vertexData.positions[currentVertexDataIndex * 3 + 2] = vertex.localPositionOverride[2];\r\n } else if (localPositions) {\r\n vertexData.positions[currentVertexDataIndex * 3] = localPositions[vertex.vertexIdx];\r\n vertexData.positions[currentVertexDataIndex * 3 + 1] = localPositions[vertex.vertexIdx + 1];\r\n vertexData.positions[currentVertexDataIndex * 3 + 2] = localPositions[vertex.vertexIdx + 2];\r\n }\r\n if (vertex.localNormalOverride) {\r\n vertexData.normals[currentVertexDataIndex * 3] = vertex.localNormalOverride[0];\r\n vertexData.normals[currentVertexDataIndex * 3 + 1] = vertex.localNormalOverride[1];\r\n vertexData.normals[currentVertexDataIndex * 3 + 2] = vertex.localNormalOverride[2];\r\n } else if (localNormals) {\r\n vertexData.normals[currentVertexDataIndex * 3] = localNormals[vertex.vertexIdx];\r\n vertexData.normals[currentVertexDataIndex * 3 + 1] = localNormals[vertex.vertexIdx + 1];\r\n vertexData.normals[currentVertexDataIndex * 3 + 2] = localNormals[vertex.vertexIdx + 2];\r\n }\r\n } else {\r\n vertex.position.toArray(vertexData.positions, currentVertexDataIndex * 3);\r\n vertex.normal.toArray(vertexData.normals, currentVertexDataIndex * 3);\r\n }\r\n if (vertexData.matricesIndices && vertexData.matricesWeights) {\r\n if (vertex.matrixIndicesOverride) {\r\n vertexData.matricesIndices[currentVertexDataIndex * 4] = vertex.matrixIndicesOverride[0];\r\n vertexData.matricesIndices[currentVertexDataIndex * 4 + 1] = vertex.matrixIndicesOverride[1];\r\n vertexData.matricesIndices[currentVertexDataIndex * 4 + 2] = vertex.matrixIndicesOverride[2];\r\n vertexData.matricesIndices[currentVertexDataIndex * 4 + 3] = vertex.matrixIndicesOverride[3];\r\n } else {\r\n if (matIndices) {\r\n vertexData.matricesIndices[currentVertexDataIndex * 4] = matIndices[vertex.vertexIdxForBones];\r\n vertexData.matricesIndices[currentVertexDataIndex * 4 + 1] = matIndices[vertex.vertexIdxForBones + 1];\r\n vertexData.matricesIndices[currentVertexDataIndex * 4 + 2] = matIndices[vertex.vertexIdxForBones + 2];\r\n vertexData.matricesIndices[currentVertexDataIndex * 4 + 3] = matIndices[vertex.vertexIdxForBones + 3];\r\n }\r\n if (matIndicesExtra && vertexData.matricesIndicesExtra) {\r\n vertexData.matricesIndicesExtra[currentVertexDataIndex * 4] = matIndicesExtra[vertex.vertexIdxForBones];\r\n vertexData.matricesIndicesExtra[currentVertexDataIndex * 4 + 1] = matIndicesExtra[vertex.vertexIdxForBones + 1];\r\n vertexData.matricesIndicesExtra[currentVertexDataIndex * 4 + 2] = matIndicesExtra[vertex.vertexIdxForBones + 2];\r\n vertexData.matricesIndicesExtra[currentVertexDataIndex * 4 + 3] = matIndicesExtra[vertex.vertexIdxForBones + 3];\r\n }\r\n }\r\n if (vertex.matrixWeightsOverride) {\r\n vertexData.matricesWeights[currentVertexDataIndex * 4] = vertex.matrixWeightsOverride[0];\r\n vertexData.matricesWeights[currentVertexDataIndex * 4 + 1] = vertex.matrixWeightsOverride[1];\r\n vertexData.matricesWeights[currentVertexDataIndex * 4 + 2] = vertex.matrixWeightsOverride[2];\r\n vertexData.matricesWeights[currentVertexDataIndex * 4 + 3] = vertex.matrixWeightsOverride[3];\r\n } else {\r\n if (matWeights) {\r\n vertexData.matricesWeights[currentVertexDataIndex * 4] = matWeights[vertex.vertexIdxForBones];\r\n vertexData.matricesWeights[currentVertexDataIndex * 4 + 1] = matWeights[vertex.vertexIdxForBones + 1];\r\n vertexData.matricesWeights[currentVertexDataIndex * 4 + 2] = matWeights[vertex.vertexIdxForBones + 2];\r\n vertexData.matricesWeights[currentVertexDataIndex * 4 + 3] = matWeights[vertex.vertexIdxForBones + 3];\r\n }\r\n if (matWeightsExtra && vertexData.matricesWeightsExtra) {\r\n vertexData.matricesWeightsExtra[currentVertexDataIndex * 4] = matWeightsExtra[vertex.vertexIdxForBones];\r\n vertexData.matricesWeightsExtra[currentVertexDataIndex * 4 + 1] = matWeightsExtra[vertex.vertexIdxForBones + 1];\r\n vertexData.matricesWeightsExtra[currentVertexDataIndex * 4 + 2] = matWeightsExtra[vertex.vertexIdxForBones + 2];\r\n vertexData.matricesWeightsExtra[currentVertexDataIndex * 4 + 3] = matWeightsExtra[vertex.vertexIdxForBones + 3];\r\n }\r\n }\r\n }\r\n\r\n if (!options.captureUVS) {\r\n (<number[]>vertexData.uvs).push(0.5 + vertex.position.x / size.x);\r\n const v = 0.5 + vertex.position.y / size.y;\r\n (<number[]>vertexData.uvs).push(CompatibilityOptions.UseOpenGLOrientationForUV ? 1 - v : v);\r\n } else {\r\n vertex.uv.toArray(vertexData.uvs, currentVertexDataIndex * 2);\r\n }\r\n currentVertexDataIndex++;\r\n }\r\n }\r\n }\r\n\r\n // Avoid the \"Setting vertex data kind 'XXX' with an empty array\" warning when calling vertexData.applyToMesh\r\n if (vertexData.indices.length === 0) vertexData.indices = null;\r\n if (vertexData.positions.length === 0) vertexData.positions = null;\r\n if (vertexData.normals.length === 0) vertexData.normals = null;\r\n if (vertexData.uvs.length === 0) vertexData.uvs = null;\r\n if (vertexData.matricesIndices?.length === 0) vertexData.matricesIndices = null;\r\n if (vertexData.matricesWeights?.length === 0) vertexData.matricesWeights = null;\r\n if (vertexData.matricesIndicesExtra?.length === 0) vertexData.matricesIndicesExtra = null;\r\n if (vertexData.matricesWeightsExtra?.length === 0) vertexData.matricesWeightsExtra = null;\r\n\r\n // Return mesh\r\n const decal = new Mesh(name, sourceMesh.getScene());\r\n vertexData.applyToMesh(decal);\r\n\r\n if (useLocalComputation) {\r\n decal.skeleton = sourceMesh.skeleton;\r\n decal.parent = sourceMesh;\r\n } else {\r\n decal.position = position.clone();\r\n decal.rotation = new Vector3(pitch, yaw, angle);\r\n }\r\n\r\n decal.computeWorldMatrix(true);\r\n decal.refreshBoundingInfo(true, true);\r\n\r\n return decal;\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 DecalBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateDecal,\r\n};\r\n\r\nMesh.CreateDecal = (name: string, sourceMesh: AbstractMesh, position: Vector3, normal: Vector3, size: Vector3, angle: number): Mesh => {\r\n const options = {\r\n position,\r\n normal,\r\n size,\r\n angle,\r\n };\r\n\r\n return CreateDecal(name, sourceMesh, options);\r\n};\r\n"]}
@@ -12,12 +12,6 @@ import { VertexData } from "../mesh.vertexData";
12
12
  * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
13
13
  * * 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)
14
14
  * * 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)
15
- * @param options.radius
16
- * @param options.tessellation
17
- * @param options.arc
18
- * @param options.sideOrientation
19
- * @param options.frontUVs
20
- * @param options.backUVs
21
15
  * @returns the VertexData of the box
22
16
  */
23
17
  export declare function CreateDiscVertexData(options: {
@@ -38,13 +32,6 @@ export declare function CreateDiscVertexData(options: {
38
32
  * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
39
33
  * @param name defines the name of the mesh
40
34
  * @param options defines the options used to create the mesh
41
- * @param options.radius
42
- * @param options.tessellation
43
- * @param options.arc
44
- * @param options.updatable
45
- * @param options.sideOrientation
46
- * @param options.frontUVs
47
- * @param options.backUVs
48
35
  * @param scene defines the hosting scene
49
36
  * @returns the plane polygonal mesh
50
37
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#disc-or-regular-polygon
@@ -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.radius
14
- * @param options.tessellation
15
- * @param options.arc
16
- * @param options.sideOrientation
17
- * @param options.frontUVs
18
- * @param options.backUVs
19
13
  * @returns the VertexData of the box
20
14
  */
21
15
  // eslint-disable-next-line @typescript-eslint/naming-convention
@@ -72,13 +66,6 @@ export function CreateDiscVertexData(options) {
72
66
  * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
73
67
  * @param name defines the name of the mesh
74
68
  * @param options defines the options used to create the mesh
75
- * @param options.radius
76
- * @param options.tessellation
77
- * @param options.arc
78
- * @param options.updatable
79
- * @param options.sideOrientation
80
- * @param options.frontUVs
81
- * @param options.backUVs
82
69
  * @param scene defines the hosting scene
83
70
  * @returns the plane polygonal mesh
84
71
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#disc-or-regular-polygon
@@ -1 +1 @@
1
- {"version":3,"file":"discBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/discBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;;;;;;;;;;;;;;GAgBG;AACH,gEAAgE;AAChE,MAAM,UAAU,oBAAoB,CAAC,OAOpC;IACG,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,MAAM,OAAO,GAAa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scene\";\r\nimport type { Vector4 } from \"../../Maths/math.vector\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\n\r\n/**\r\n * Creates the VertexData of the Disc or regular Polygon\r\n * @param options an object used to set the following optional parameters for the disc, required but can be empty\r\n * * radius the radius of the disc, optional default 0.5\r\n * * tessellation the number of polygon sides, optional, default 64\r\n * * arc a number from 0 to 1, to create an unclosed polygon based on the fraction of the circumference given by the arc value, optional, default 1\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.tessellation\r\n * @param options.arc\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\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function CreateDiscVertexData(options: {\r\n radius?: number;\r\n tessellation?: number;\r\n arc?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n}): VertexData {\r\n const positions: number[] = [];\r\n const indices: number[] = [];\r\n const normals: number[] = [];\r\n const uvs: number[] = [];\r\n\r\n const radius = options.radius || 0.5;\r\n const tessellation = options.tessellation || 64;\r\n const arc: number = options.arc && (options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc || 1.0;\r\n const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || VertexData.DEFAULTSIDE;\r\n\r\n // positions and uvs\r\n positions.push(0, 0, 0); // disc center first\r\n uvs.push(0.5, 0.5);\r\n\r\n const theta = Math.PI * 2 * arc;\r\n const step = arc === 1 ? theta / tessellation : theta / (tessellation - 1);\r\n let a = 0;\r\n for (let t = 0; t < tessellation; t++) {\r\n const x = Math.cos(a);\r\n const y = Math.sin(a);\r\n const u = (x + 1) / 2;\r\n const v = (1 - y) / 2;\r\n positions.push(radius * x, radius * y, 0);\r\n uvs.push(u, CompatibilityOptions.UseOpenGLOrientationForUV ? 1 - v : v);\r\n a += step;\r\n }\r\n if (arc === 1) {\r\n positions.push(positions[3], positions[4], positions[5]); // close the circle\r\n uvs.push(uvs[2], CompatibilityOptions.UseOpenGLOrientationForUV ? 1 - uvs[3] : uvs[3]);\r\n }\r\n\r\n //indices\r\n const vertexNb = positions.length / 3;\r\n for (let i = 1; i < vertexNb - 1; i++) {\r\n indices.push(i + 1, 0, i);\r\n }\r\n\r\n // result\r\n VertexData.ComputeNormals(positions, indices, normals);\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);\r\n\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 polygonal mesh. By default, this is a disc\r\n * * The parameter `radius` sets the radius size (float) of the polygon (default 0.5)\r\n * * The parameter `tessellation` sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc\r\n * * You can create an unclosed polygon with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference : 2 x PI x ratio\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.tessellation\r\n * @param options.arc\r\n * @param options.updatable\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param scene defines the hosting scene\r\n * @returns the plane polygonal mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#disc-or-regular-polygon\r\n */\r\nexport function CreateDisc(\r\n name: string,\r\n options: { radius?: number; tessellation?: number; arc?: number; updatable?: boolean; sideOrientation?: number; frontUVs?: Vector4; backUVs?: Vector4 } = {},\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const disc = new Mesh(name, scene);\r\n\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n disc._originalBuilderSideOrientation = options.sideOrientation;\r\n\r\n const vertexData = CreateDiscVertexData(options);\r\n\r\n vertexData.applyToMesh(disc, options.updatable);\r\n\r\n return disc;\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated please use CreateDisc directly\r\n */\r\nexport const DiscBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateDisc,\r\n};\r\n\r\nVertexData.CreateDisc = CreateDiscVertexData;\r\n\r\nMesh.CreateDisc = (name: string, radius: number, tessellation: number, scene: Nullable<Scene> = null, updatable?: boolean, sideOrientation?: number): Mesh => {\r\n const options = {\r\n radius,\r\n tessellation,\r\n sideOrientation,\r\n updatable,\r\n };\r\n\r\n return CreateDisc(name, options, scene);\r\n};\r\n"]}
1
+ {"version":3,"file":"discBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/discBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;;;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AC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"../../types\";\r\nimport 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 { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\n\r\n/**\r\n * Creates the VertexData of the Disc or regular Polygon\r\n * @param options an object used to set the following optional parameters for the disc, required but can be empty\r\n * * radius the radius of the disc, optional default 0.5\r\n * * tessellation the number of polygon sides, optional, default 64\r\n * * arc a number from 0 to 1, to create an unclosed polygon based on the fraction of the circumference given by the arc value, optional, default 1\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\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport function CreateDiscVertexData(options: {\r\n radius?: number;\r\n tessellation?: number;\r\n arc?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n}): VertexData {\r\n const positions: number[] = [];\r\n const indices: number[] = [];\r\n const normals: number[] = [];\r\n const uvs: number[] = [];\r\n\r\n const radius = options.radius || 0.5;\r\n const tessellation = options.tessellation || 64;\r\n const arc: number = options.arc && (options.arc <= 0 || options.arc > 1) ? 1.0 : options.arc || 1.0;\r\n const sideOrientation = options.sideOrientation === 0 ? 0 : options.sideOrientation || VertexData.DEFAULTSIDE;\r\n\r\n // positions and uvs\r\n positions.push(0, 0, 0); // disc center first\r\n uvs.push(0.5, 0.5);\r\n\r\n const theta = Math.PI * 2 * arc;\r\n const step = arc === 1 ? theta / tessellation : theta / (tessellation - 1);\r\n let a = 0;\r\n for (let t = 0; t < tessellation; t++) {\r\n const x = Math.cos(a);\r\n const y = Math.sin(a);\r\n const u = (x + 1) / 2;\r\n const v = (1 - y) / 2;\r\n positions.push(radius * x, radius * y, 0);\r\n uvs.push(u, CompatibilityOptions.UseOpenGLOrientationForUV ? 1 - v : v);\r\n a += step;\r\n }\r\n if (arc === 1) {\r\n positions.push(positions[3], positions[4], positions[5]); // close the circle\r\n uvs.push(uvs[2], CompatibilityOptions.UseOpenGLOrientationForUV ? 1 - uvs[3] : uvs[3]);\r\n }\r\n\r\n //indices\r\n const vertexNb = positions.length / 3;\r\n for (let i = 1; i < vertexNb - 1; i++) {\r\n indices.push(i + 1, 0, i);\r\n }\r\n\r\n // result\r\n VertexData.ComputeNormals(positions, indices, normals);\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);\r\n\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 polygonal mesh. By default, this is a disc\r\n * * The parameter `radius` sets the radius size (float) of the polygon (default 0.5)\r\n * * The parameter `tessellation` sets the number of polygon sides (positive integer, default 64). So a tessellation valued to 3 will build a triangle, to 4 a square, etc\r\n * * You can create an unclosed polygon with the parameter `arc` (positive float, default 1), valued between 0 and 1, what is the ratio of the circumference : 2 x PI x ratio\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 polygonal mesh\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/set#disc-or-regular-polygon\r\n */\r\nexport function CreateDisc(\r\n name: string,\r\n options: { radius?: number; tessellation?: number; arc?: number; updatable?: boolean; sideOrientation?: number; frontUVs?: Vector4; backUVs?: Vector4 } = {},\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const disc = new Mesh(name, scene);\r\n\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n disc._originalBuilderSideOrientation = options.sideOrientation;\r\n\r\n const vertexData = CreateDiscVertexData(options);\r\n\r\n vertexData.applyToMesh(disc, options.updatable);\r\n\r\n return disc;\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated please use CreateDisc directly\r\n */\r\nexport const DiscBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateDisc,\r\n};\r\n\r\nVertexData.CreateDisc = CreateDiscVertexData;\r\n\r\nMesh.CreateDisc = (name: string, radius: number, tessellation: number, scene: Nullable<Scene> = null, updatable?: boolean, sideOrientation?: number): Mesh => {\r\n const options = {\r\n radius,\r\n tessellation,\r\n sideOrientation,\r\n updatable,\r\n };\r\n\r\n return CreateDisc(name, options, scene);\r\n};\r\n"]}
@@ -22,19 +22,6 @@ import type { Nullable } from "../../types";
22
22
  * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
23
23
  * * 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)
24
24
  * * 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)
25
- * @param options.n
26
- * @param options.size
27
- * @param options.sizeX
28
- * @param options.sizeY
29
- * @param options.sizeZ
30
- * @param options.faceUV
31
- * @param options.faceColors
32
- * @param options.flat
33
- * @param options.updatable
34
- * @param options.sideOrientation
35
- * @param options.frontUVs
36
- * @param options.backUVs
37
- * @param options.m
38
25
  * @param scene defines the hosting scene
39
26
  * @returns Geodesic mesh
40
27
  */
@@ -20,19 +20,6 @@ import { _PrimaryIsoTriangle, GeodesicData } from "../geodesicMesh.js";
20
20
  * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
21
21
  * * 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)
22
22
  * * 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)
23
- * @param options.n
24
- * @param options.size
25
- * @param options.sizeX
26
- * @param options.sizeY
27
- * @param options.sizeZ
28
- * @param options.faceUV
29
- * @param options.faceColors
30
- * @param options.flat
31
- * @param options.updatable
32
- * @param options.sideOrientation
33
- * @param options.frontUVs
34
- * @param options.backUVs
35
- * @param options.m
36
23
  * @param scene defines the hosting scene
37
24
  * @returns Geodesic mesh
38
25
  */
@@ -1 +1 @@
1
- {"version":3,"file":"geodesicBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/geodesicBuilder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,cAAc,CAC1B,IAAY,EACZ,OAcC,EACD,QAAyB,IAAI;IAE7B,IAAI,CAAC,GAAW,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC;IAC/B,IAAI,CAAC,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AAC;IACF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IAE3D,OAAO,QAAQ,CAAC;AACpB,CAAC","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport type { Vector4 } from \"../../Maths/math.vector\";\r\nimport type { Color4 } from \"../../Maths/math.color\";\r\nimport type { Mesh } from \"../../Meshes/mesh\";\r\nimport { CreatePolyhedron } from \"./polyhedronBuilder\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { Logger } from \"../../Misc/logger\";\r\nimport { _PrimaryIsoTriangle, GeodesicData } from \"../geodesicMesh\";\r\n\r\n/**\r\n * Creates the Mesh for a Geodesic Polyhedron\r\n * @see https://en.wikipedia.org/wiki/Geodesic_polyhedron\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra/geodesic_poly\r\n * @param name defines the name of the mesh\r\n * @param options an object used to set the following optional parameters for the polyhedron, required but can be empty\r\n * * m number of horizontal steps along an isogrid\r\n * * n number of angled steps along an isogrid\r\n * * size the size of the Geodesic, optional default 1\r\n * * sizeX allows stretching in the x direction, optional, default size\r\n * * sizeY allows stretching in the y direction, optional, default size\r\n * * sizeZ allows stretching in the z direction, optional, default size\r\n * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively\r\n * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively\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.n\r\n * @param options.size\r\n * @param options.sizeX\r\n * @param options.sizeY\r\n * @param options.sizeZ\r\n * @param options.faceUV\r\n * @param options.faceColors\r\n * @param options.flat\r\n * @param options.updatable\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param options.m\r\n * @param scene defines the hosting scene\r\n * @returns Geodesic mesh\r\n */\r\nexport function CreateGeodesic(\r\n name: string,\r\n options: {\r\n m?: number;\r\n n?: number;\r\n size?: number;\r\n sizeX?: number;\r\n sizeY?: number;\r\n sizeZ?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n flat?: boolean;\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n },\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n let m: number = options.m || 1;\r\n if (m !== Math.floor(m)) {\r\n m === Math.floor(m);\r\n Logger.Warn(\"m not an integer only floor(m) used\");\r\n }\r\n let n: number = options.n || 0;\r\n if (n !== Math.floor(n)) {\r\n n === Math.floor(n);\r\n Logger.Warn(\"n not an integer only floor(n) used\");\r\n }\r\n if (n > m) {\r\n const temp = n;\r\n n = m;\r\n m = temp;\r\n Logger.Warn(\"n > m therefore m and n swapped\");\r\n }\r\n const primTri: _PrimaryIsoTriangle = new _PrimaryIsoTriangle();\r\n primTri.build(m, n);\r\n const geodesicData = GeodesicData.BuildGeodesicData(primTri);\r\n\r\n const geoOptions: object = {\r\n custom: geodesicData,\r\n size: options.size,\r\n sizeX: options.sizeX,\r\n sizeY: options.sizeY,\r\n sizeZ: options.sizeZ,\r\n faceUV: options.faceUV,\r\n faceColors: options.faceColors,\r\n flat: options.flat,\r\n updatable: options.updatable,\r\n sideOrientation: options.sideOrientation,\r\n frontUVs: options.frontUVs,\r\n backUVs: options.backUVs,\r\n };\r\n const geodesic = CreatePolyhedron(name, geoOptions, scene);\r\n\r\n return geodesic;\r\n}\r\n"]}
1
+ {"version":3,"file":"geodesicBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/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,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;KAC3B,CAAC;IACF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IAE3D,OAAO,QAAQ,CAAC;AACpB,CAAC","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport type { Vector4 } from \"../../Maths/math.vector\";\r\nimport type { Color4 } from \"../../Maths/math.color\";\r\nimport type { Mesh } from \"../../Meshes/mesh\";\r\nimport { CreatePolyhedron } from \"./polyhedronBuilder\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { Logger } from \"../../Misc/logger\";\r\nimport { _PrimaryIsoTriangle, GeodesicData } from \"../geodesicMesh\";\r\n\r\n/**\r\n * Creates the Mesh for a Geodesic Polyhedron\r\n * @see https://en.wikipedia.org/wiki/Geodesic_polyhedron\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra/geodesic_poly\r\n * @param name defines the name of the mesh\r\n * @param options an object used to set the following optional parameters for the polyhedron, required but can be empty\r\n * * m number of horizontal steps along an isogrid\r\n * * n number of angled steps along an isogrid\r\n * * size the size of the Geodesic, optional default 1\r\n * * sizeX allows stretching in the x direction, optional, default size\r\n * * sizeY allows stretching in the y direction, optional, default size\r\n * * sizeZ allows stretching in the z direction, optional, default size\r\n * * faceUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively\r\n * * faceColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively\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 scene defines the hosting scene\r\n * @returns Geodesic mesh\r\n */\r\nexport function CreateGeodesic(\r\n name: string,\r\n options: {\r\n m?: number;\r\n n?: number;\r\n size?: number;\r\n sizeX?: number;\r\n sizeY?: number;\r\n sizeZ?: number;\r\n faceUV?: Vector4[];\r\n faceColors?: Color4[];\r\n flat?: boolean;\r\n updatable?: boolean;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n },\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n let m: number = options.m || 1;\r\n if (m !== Math.floor(m)) {\r\n m === Math.floor(m);\r\n Logger.Warn(\"m not an integer only floor(m) used\");\r\n }\r\n let n: number = options.n || 0;\r\n if (n !== Math.floor(n)) {\r\n n === Math.floor(n);\r\n Logger.Warn(\"n not an integer only floor(n) used\");\r\n }\r\n if (n > m) {\r\n const temp = n;\r\n n = m;\r\n m = temp;\r\n Logger.Warn(\"n > m therefore m and n swapped\");\r\n }\r\n const primTri: _PrimaryIsoTriangle = new _PrimaryIsoTriangle();\r\n primTri.build(m, n);\r\n const geodesicData = GeodesicData.BuildGeodesicData(primTri);\r\n\r\n const geoOptions: object = {\r\n custom: geodesicData,\r\n size: options.size,\r\n sizeX: options.sizeX,\r\n sizeY: options.sizeY,\r\n sizeZ: options.sizeZ,\r\n faceUV: options.faceUV,\r\n faceColors: options.faceColors,\r\n flat: options.flat,\r\n updatable: options.updatable,\r\n sideOrientation: options.sideOrientation,\r\n frontUVs: options.frontUVs,\r\n backUVs: options.backUVs,\r\n };\r\n const geodesic = CreatePolyhedron(name, geoOptions, scene);\r\n\r\n return geodesic;\r\n}\r\n"]}
@@ -4,9 +4,6 @@ import type { Scene } from "../../scene";
4
4
  * Creates a hemisphere mesh
5
5
  * @param name defines the name of the mesh
6
6
  * @param options defines the options used to create the mesh
7
- * @param options.segments
8
- * @param options.diameter
9
- * @param options.sideOrientation
10
7
  * @param scene defines the hosting scene
11
8
  * @returns the hemisphere mesh
12
9
  */
@@ -5,9 +5,6 @@ import { CreateDisc } from "./discBuilder.js";
5
5
  * Creates a hemisphere mesh
6
6
  * @param name defines the name of the mesh
7
7
  * @param options defines the options used to create the mesh
8
- * @param options.segments
9
- * @param options.diameter
10
- * @param options.sideOrientation
11
8
  * @param scene defines the hosting scene
12
9
  * @returns the hemisphere mesh
13
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"hemisphereBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/hemisphereBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,UAA8E,EAAE,EAAE,KAAa;IAC1I,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;QACnB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;KACxB;IACD,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;QACnB,OAAO,CAAC,QAAQ,GAAG,EAAE,CAAC;KACzB;IAED,MAAM,UAAU,GAAG,YAAY,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;IACnH,MAAM,IAAI,GAAG,UAAU,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAClI,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;IAEzB,MAAM,MAAM,GAAS,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,CAAC;IAChE,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;IAEnB,OAAO,MAAM,CAAC;AAClB,CAAC;AACD;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,gEAAgE;IAChE,gBAAgB;CACnB,CAAC;AAEF;;;;;;;GAOG;AACH,IAAI,CAAC,gBAAgB,GAAG,CAAC,IAAY,EAAE,QAAgB,EAAE,QAAgB,EAAE,KAAa,EAAQ,EAAE;IAC9F,MAAM,OAAO,GAAG;QACZ,QAAQ,EAAE,QAAQ;QAClB,QAAQ,EAAE,QAAQ;KACrB,CAAC;IAEF,OAAO,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC,CAAC","sourcesContent":["import { Mesh } from \"../mesh\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { CreateSphere } from \"../Builders/sphereBuilder\";\r\nimport { CreateDisc } from \"./discBuilder\";\r\n\r\n/**\r\n * Creates a hemisphere mesh\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param options.segments\r\n * @param options.diameter\r\n * @param options.sideOrientation\r\n * @param scene defines the hosting scene\r\n * @returns the hemisphere mesh\r\n */\r\nexport function CreateHemisphere(name: string, options: { segments?: number; diameter?: number; sideOrientation?: number } = {}, scene?: Scene): Mesh {\r\n if (!options.diameter) {\r\n options.diameter = 1;\r\n }\r\n if (!options.segments) {\r\n options.segments = 16;\r\n }\r\n\r\n const halfSphere = CreateSphere(\"\", { slice: 0.5, diameter: options.diameter, segments: options.segments }, scene);\r\n const disc = CreateDisc(\"\", { radius: options.diameter / 2, tessellation: options.segments * 3 + (4 - options.segments) }, scene);\r\n disc.rotation.x = -Math.PI / 2;\r\n disc.parent = halfSphere;\r\n\r\n const merged = <Mesh>Mesh.MergeMeshes([disc, halfSphere], true);\r\n merged.name = name;\r\n\r\n return merged;\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 HemisphereBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateHemisphere,\r\n};\r\n\r\n/**\r\n * Creates a hemispheric light\r\n * @param name\r\n * @param segments\r\n * @param diameter\r\n * @param scene\r\n * @returns the mesh\r\n */\r\nMesh.CreateHemisphere = (name: string, segments: number, diameter: number, scene?: Scene): Mesh => {\r\n const options = {\r\n segments: segments,\r\n diameter: diameter,\r\n };\r\n\r\n return CreateHemisphere(name, options, scene);\r\n};\r\n"]}
1
+ {"version":3,"file":"hemisphereBuilder.js","sourceRoot":"","sources":["../../../../../dev/core/src/Meshes/Builders/hemisphereBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,UAA8E,EAAE,EAAE,KAAa;IAC1I,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;QACnB,OAAO,CAAC,QAAQ,GAAG,CA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h\";\r\nimport type { Scene } from \"../../scene\";\r\nimport { CreateSphere } from \"../Builders/sphereBuilder\";\r\nimport { CreateDisc } from \"./discBuilder\";\r\n\r\n/**\r\n * Creates a hemisphere mesh\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param scene defines the hosting scene\r\n * @returns the hemisphere mesh\r\n */\r\nexport function CreateHemisphere(name: string, options: { segments?: number; diameter?: number; sideOrientation?: number } = {}, scene?: Scene): Mesh {\r\n if (!options.diameter) {\r\n options.diameter = 1;\r\n }\r\n if (!options.segments) {\r\n options.segments = 16;\r\n }\r\n\r\n const halfSphere = CreateSphere(\"\", { slice: 0.5, diameter: options.diameter, segments: options.segments }, scene);\r\n const disc = CreateDisc(\"\", { radius: options.diameter / 2, tessellation: options.segments * 3 + (4 - options.segments) }, scene);\r\n disc.rotation.x = -Math.PI / 2;\r\n disc.parent = halfSphere;\r\n\r\n const merged = <Mesh>Mesh.MergeMeshes([disc, halfSphere], true);\r\n merged.name = name;\r\n\r\n return merged;\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 HemisphereBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateHemisphere,\r\n};\r\n\r\n/**\r\n * Creates a hemispheric light\r\n * @param name\r\n * @param segments\r\n * @param diameter\r\n * @param scene\r\n * @returns the mesh\r\n */\r\nMesh.CreateHemisphere = (name: string, segments: number, diameter: number, scene?: Scene): Mesh => {\r\n const options = {\r\n segments: segments,\r\n diameter: diameter,\r\n };\r\n\r\n return CreateHemisphere(name, options, scene);\r\n};\r\n"]}
@@ -15,15 +15,6 @@ import type { Nullable } from "../../types";
15
15
  * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
16
16
  * * 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)
17
17
  * * 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)
18
- * @param options.radius
19
- * @param options.radiusX
20
- * @param options.radiusY
21
- * @param options.radiusZ
22
- * @param options.flat
23
- * @param options.subdivisions
24
- * @param options.sideOrientation
25
- * @param options.frontUVs
26
- * @param options.backUVs
27
18
  * @returns the VertexData of the IcoSphere
28
19
  */
29
20
  export declare function CreateIcoSphereVertexData(options: {
@@ -48,16 +39,6 @@ export declare function CreateIcoSphereVertexData(options: {
48
39
  * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
49
40
  * @param name defines the name of the mesh
50
41
  * @param options defines the options used to create the mesh
51
- * @param options.radius
52
- * @param options.radiusX
53
- * @param options.radiusY
54
- * @param options.radiusZ
55
- * @param options.flat
56
- * @param options.subdivisions
57
- * @param options.sideOrientation
58
- * @param options.frontUVs
59
- * @param options.backUVs
60
- * @param options.updatable
61
42
  * @param scene defines the hosting scene
62
43
  * @returns the icosahedron mesh
63
44
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra#icosphere
@@ -14,15 +14,6 @@ import { CompatibilityOptions } from "../../Compat/compatibilityOptions.js";
14
14
  * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE
15
15
  * * 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)
16
16
  * * 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)
17
- * @param options.radius
18
- * @param options.radiusX
19
- * @param options.radiusY
20
- * @param options.radiusZ
21
- * @param options.flat
22
- * @param options.subdivisions
23
- * @param options.sideOrientation
24
- * @param options.frontUVs
25
- * @param options.backUVs
26
17
  * @returns the VertexData of the IcoSphere
27
18
  */
28
19
  export function CreateIcoSphereVertexData(options) {
@@ -361,16 +352,6 @@ export function CreateIcoSphereVertexData(options) {
361
352
  * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created
362
353
  * @param name defines the name of the mesh
363
354
  * @param options defines the options used to create the mesh
364
- * @param options.radius
365
- * @param options.radiusX
366
- * @param options.radiusY
367
- * @param options.radiusZ
368
- * @param options.flat
369
- * @param options.subdivisions
370
- * @param options.sideOrientation
371
- * @param options.frontUVs
372
- * @param options.backUVs
373
- * @param options.updatable
374
355
  * @param scene defines the hosting scene
375
356
  * @returns the icosahedron mesh
376
357
  * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/creation/polyhedra#icosphere