1cc31b15861859fa7c1e19b3fb5741b18677089c95f158e44aaab278c424561d.json 28 KB

1
  1. {"ast":null,"code":"import { Vector2, Vector4 } from \"../../Maths/math.vector.js\";\nimport { Color4 } from \"../../Maths/math.color.js\";\nimport { Mesh } from \"../mesh.js\";\nimport { VertexData } from \"../mesh.vertexData.js\";\nimport { PolygonMeshBuilder } from \"../polygonMesh.js\";\nimport { VertexBuffer } from \"../../Buffers/buffer.js\";\nimport { EngineStore } from \"../../Engines/engineStore.js\";\nimport { useOpenGLOrientationForUV } from \"../../Compat/compatibilityOptions.js\";\n/**\n * Creates the VertexData for an irregular Polygon in the XoZ plane using a mesh built by polygonTriangulation.build()\n * All parameters are provided by CreatePolygon as needed\n * @param polygon a mesh built from polygonTriangulation.build()\n * @param sideOrientation takes the values Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\n * @param fUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively\n * @param fColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively\n * @param 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)\n * @param 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)\n * @param wrp a boolean, default false, when true and fUVs used texture is wrapped around all sides, when false texture is applied side\n * @returns the VertexData of the Polygon\n */\nexport function CreatePolygonVertexData(polygon, sideOrientation, fUV, fColors, frontUVs, backUVs, wrp) {\n const faceUV = fUV || new Array(3);\n const faceColors = fColors;\n const colors = [];\n const wrap = wrp || false;\n // default face colors and UV if undefined\n for (let f = 0; f < 3; f++) {\n if (faceUV[f] === undefined) {\n faceUV[f] = new Vector4(0, 0, 1, 1);\n }\n if (faceColors && faceColors[f] === undefined) {\n faceColors[f] = new Color4(1, 1, 1, 1);\n }\n }\n const positions = polygon.getVerticesData(VertexBuffer.PositionKind);\n const normals = polygon.getVerticesData(VertexBuffer.NormalKind);\n const uvs = polygon.getVerticesData(VertexBuffer.UVKind);\n const indices = polygon.getIndices();\n const startIndex = positions.length / 9;\n let disp = 0;\n let distX = 0;\n let distZ = 0;\n let dist = 0;\n let totalLen = 0;\n const cumulate = [0];\n if (wrap) {\n for (let idx = startIndex; idx < positions.length / 3; idx += 4) {\n distX = positions[3 * (idx + 2)] - positions[3 * idx];\n distZ = positions[3 * (idx + 2) + 2] - positions[3 * idx + 2];\n dist = Math.sqrt(distX * distX + distZ * distZ);\n totalLen += dist;\n cumulate.push(totalLen);\n }\n }\n // set face colours and textures\n let idx = 0;\n let face = 0;\n for (let index = 0; index < normals.length; index += 3) {\n //Edge Face no. 1\n if (Math.abs(normals[index + 1]) < 0.001) {\n face = 1;\n }\n //Top Face no. 0\n if (Math.abs(normals[index + 1] - 1) < 0.001) {\n face = 0;\n }\n //Bottom Face no. 2\n if (Math.abs(normals[index + 1] + 1) < 0.001) {\n face = 2;\n }\n idx = index / 3;\n if (face === 1) {\n disp = idx - startIndex;\n if (disp % 4 < 1.5) {\n if (wrap) {\n uvs[2 * idx] = faceUV[face].x + (faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4)] / totalLen;\n } else {\n uvs[2 * idx] = faceUV[face].x;\n }\n } else {\n if (wrap) {\n uvs[2 * idx] = faceUV[face].x + (faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4) + 1] / totalLen;\n } else {\n uvs[2 * idx] = faceUV[face].z;\n }\n }\n if (disp % 2 === 0) {\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].w : faceUV[face].w;\n } else {\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].y : faceUV[face].y;\n }\n } else {\n uvs[2 * idx] = (1 - uvs[2 * idx]) * faceUV[face].x + uvs[2 * idx] * faceUV[face].z;\n uvs[2 * idx + 1] = (1 - uvs[2 * idx + 1]) * faceUV[face].y + uvs[2 * idx + 1] * faceUV[face].w;\n if (useOpenGLOrientationForUV) {\n uvs[2 * idx + 1] = 1.0 - uvs[2 * idx + 1];\n }\n }\n if (faceColors) {\n colors.push(faceColors[face].r, faceColors[face].g, faceColors[face].b, faceColors[face].a);\n }\n }\n // sides\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, frontUVs, backUVs);\n // Result\n const vertexData = new VertexData();\n vertexData.indices = indices;\n vertexData.positions = positions;\n vertexData.normals = normals;\n vertexData.uvs = uvs;\n if (faceColors) {\n const totalColors = sideOrientation === VertexData.DOUBLESIDE ? colors.concat(colors) : colors;\n vertexData.colors = totalColors;\n }\n return vertexData;\n}\n/**\n * Creates a polygon mesh\n * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh\n * * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors\n * * You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\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\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)\n * * Remember you can only change the shape positions, not their number when updating a polygon\n * @param name defines the name of the mesh\n * @param options defines the options used to create the mesh\n * @param scene defines the hosting scene\n * @param earcutInjection can be used to inject your own earcut reference\n * @returns the polygon mesh\n */\nexport function CreatePolygon(name, options, scene = null, earcutInjection = earcut) {\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\n const shape = options.shape;\n const holes = options.holes || [];\n const depth = options.depth || 0;\n const smoothingThreshold = options.smoothingThreshold || 2;\n const contours = [];\n let hole = [];\n for (let i = 0; i < shape.length; i++) {\n contours[i] = new Vector2(shape[i].x, shape[i].z);\n }\n const epsilon = 0.00000001;\n if (contours[0].equalsWithEpsilon(contours[contours.length - 1], epsilon)) {\n contours.pop();\n }\n const polygonTriangulation = new PolygonMeshBuilder(name, contours, scene || EngineStore.LastCreatedScene, earcutInjection);\n for (let hNb = 0; hNb < holes.length; hNb++) {\n hole = [];\n for (let hPoint = 0; hPoint < holes[hNb].length; hPoint++) {\n hole.push(new Vector2(holes[hNb][hPoint].x, holes[hNb][hPoint].z));\n }\n polygonTriangulation.addHole(hole);\n }\n //updatability is set during applyToMesh; setting to true in triangulation build produces errors\n const polygon = polygonTriangulation.build(false, depth, smoothingThreshold);\n polygon._originalBuilderSideOrientation = options.sideOrientation;\n const vertexData = CreatePolygonVertexData(polygon, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);\n vertexData.applyToMesh(polygon, options.updatable);\n return polygon;\n}\n/**\n * Creates an extruded polygon mesh, with depth in the Y direction.\n * * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace\n * @param name defines the name of the mesh\n * @param options defines the options used to create the mesh\n * @param scene defines the hosting scene\n * @param earcutInjection can be used to inject your own earcut reference\n * @returns the polygon mesh\n */\nexport function ExtrudePolygon(name, options, scene = null, earcutInjection = earcut) {\n return CreatePolygon(name, options, scene, earcutInjection);\n}\n/**\n * Class containing static functions to help procedurally build meshes\n * @deprecated use the functions directly from the module\n */\nexport const PolygonBuilder = {\n ExtrudePolygon,\n CreatePolygon\n};\nVertexData.CreatePolygon = CreatePolygonVertexData;\nMesh.CreatePolygon = (name, shape, scene, holes, updatable, sideOrientation, earcutInjection = earcut) => {\n const options = {\n shape: shape,\n holes: holes,\n updatable: updatable,\n sideOrientation: sideOrientation\n };\n return CreatePolygon(name, options, scene, earcutInjection);\n};\nMesh.ExtrudePolygon = (name, shape, depth, scene, holes, updatable, sideOrientation, earcutInjection = earcut) => {\n const options = {\n shape: shape,\n holes: holes,\n depth: depth,\n updatable: updatable,\n sideOrientation: sideOrientation\n };\n return ExtrudePolygon(name, options, scene, earcutInjection);\n};","map":{"version":3,"names":["Vector2","Vector4","Color4","Mesh","VertexData","PolygonMeshBuilder","VertexBuffer","EngineStore","useOpenGLOrientationForUV","CreatePolygonVertexData","polygon","sideOrientation","fUV","fColors","frontUVs","backUVs","wrp","faceUV","Array","faceColors","colors","wrap","f","undefined","positions","getVerticesData","PositionKind","normals","NormalKind","uvs","UVKind","indices","getIndices","startIndex","length","disp","distX","distZ","dist","totalLen","cumulate","idx","Math","sqrt","push","face","index","abs","x","z","floor","w","y","r","g","b","a","_ComputeSides","vertexData","totalColors","DOUBLESIDE","concat","CreatePolygon","name","options","scene","earcutInjection","earcut","_GetDefaultSideOrientation","shape","holes","depth","smoothingThreshold","contours","hole","i","epsilon","equalsWithEpsilon","pop","polygonTriangulation","LastCreatedScene","hNb","hPoint","addHole","build","_originalBuilderSideOrientation","applyToMesh","updatable","ExtrudePolygon","PolygonBuilder"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/Builders/polygonBuilder.js"],"sourcesContent":["import { Vector2, Vector4 } from \"../../Maths/math.vector.js\";\nimport { Color4 } from \"../../Maths/math.color.js\";\nimport { Mesh } from \"../mesh.js\";\nimport { VertexData } from \"../mesh.vertexData.js\";\nimport { PolygonMeshBuilder } from \"../polygonMesh.js\";\nimport { VertexBuffer } from \"../../Buffers/buffer.js\";\nimport { EngineStore } from \"../../Engines/engineStore.js\";\nimport { useOpenGLOrientationForUV } from \"../../Compat/compatibilityOptions.js\";\n/**\n * Creates the VertexData for an irregular Polygon in the XoZ plane using a mesh built by polygonTriangulation.build()\n * All parameters are provided by CreatePolygon as needed\n * @param polygon a mesh built from polygonTriangulation.build()\n * @param sideOrientation takes the values Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\n * @param fUV an array of Vector4 elements used to set different images to the top, rings and bottom respectively\n * @param fColors an array of Color3 elements used to set different colors to the top, rings and bottom respectively\n * @param 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)\n * @param 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)\n * @param wrp a boolean, default false, when true and fUVs used texture is wrapped around all sides, when false texture is applied side\n * @returns the VertexData of the Polygon\n */\nexport function CreatePolygonVertexData(polygon, sideOrientation, fUV, fColors, frontUVs, backUVs, wrp) {\n const faceUV = fUV || new Array(3);\n const faceColors = fColors;\n const colors = [];\n const wrap = wrp || false;\n // default face colors and UV if undefined\n for (let f = 0; f < 3; f++) {\n if (faceUV[f] === undefined) {\n faceUV[f] = new Vector4(0, 0, 1, 1);\n }\n if (faceColors && faceColors[f] === undefined) {\n faceColors[f] = new Color4(1, 1, 1, 1);\n }\n }\n const positions = polygon.getVerticesData(VertexBuffer.PositionKind);\n const normals = polygon.getVerticesData(VertexBuffer.NormalKind);\n const uvs = polygon.getVerticesData(VertexBuffer.UVKind);\n const indices = polygon.getIndices();\n const startIndex = positions.length / 9;\n let disp = 0;\n let distX = 0;\n let distZ = 0;\n let dist = 0;\n let totalLen = 0;\n const cumulate = [0];\n if (wrap) {\n for (let idx = startIndex; idx < positions.length / 3; idx += 4) {\n distX = positions[3 * (idx + 2)] - positions[3 * idx];\n distZ = positions[3 * (idx + 2) + 2] - positions[3 * idx + 2];\n dist = Math.sqrt(distX * distX + distZ * distZ);\n totalLen += dist;\n cumulate.push(totalLen);\n }\n }\n // set face colours and textures\n let idx = 0;\n let face = 0;\n for (let index = 0; index < normals.length; index += 3) {\n //Edge Face no. 1\n if (Math.abs(normals[index + 1]) < 0.001) {\n face = 1;\n }\n //Top Face no. 0\n if (Math.abs(normals[index + 1] - 1) < 0.001) {\n face = 0;\n }\n //Bottom Face no. 2\n if (Math.abs(normals[index + 1] + 1) < 0.001) {\n face = 2;\n }\n idx = index / 3;\n if (face === 1) {\n disp = idx - startIndex;\n if (disp % 4 < 1.5) {\n if (wrap) {\n uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4)]) / totalLen;\n }\n else {\n uvs[2 * idx] = faceUV[face].x;\n }\n }\n else {\n if (wrap) {\n uvs[2 * idx] = faceUV[face].x + ((faceUV[face].z - faceUV[face].x) * cumulate[Math.floor(disp / 4) + 1]) / totalLen;\n }\n else {\n uvs[2 * idx] = faceUV[face].z;\n }\n }\n if (disp % 2 === 0) {\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].w : faceUV[face].w;\n }\n else {\n uvs[2 * idx + 1] = useOpenGLOrientationForUV ? 1.0 - faceUV[face].y : faceUV[face].y;\n }\n }\n else {\n uvs[2 * idx] = (1 - uvs[2 * idx]) * faceUV[face].x + uvs[2 * idx] * faceUV[face].z;\n uvs[2 * idx + 1] = (1 - uvs[2 * idx + 1]) * faceUV[face].y + uvs[2 * idx + 1] * faceUV[face].w;\n if (useOpenGLOrientationForUV) {\n uvs[2 * idx + 1] = 1.0 - uvs[2 * idx + 1];\n }\n }\n if (faceColors) {\n colors.push(faceColors[face].r, faceColors[face].g, faceColors[face].b, faceColors[face].a);\n }\n }\n // sides\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, frontUVs, backUVs);\n // Result\n const vertexData = new VertexData();\n vertexData.indices = indices;\n vertexData.positions = positions;\n vertexData.normals = normals;\n vertexData.uvs = uvs;\n if (faceColors) {\n const totalColors = sideOrientation === VertexData.DOUBLESIDE ? colors.concat(colors) : colors;\n vertexData.colors = totalColors;\n }\n return vertexData;\n}\n/**\n * Creates a polygon mesh\n * The polygon's shape will depend on the input parameters and is constructed parallel to a ground mesh\n * * The parameter `shape` is a required array of successive Vector3 representing the corners of the polygon in th XoZ plane, that is y = 0 for all vectors\n * * You can set the mesh side orientation with the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\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\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)\n * * Remember you can only change the shape positions, not their number when updating a polygon\n * @param name defines the name of the mesh\n * @param options defines the options used to create the mesh\n * @param scene defines the hosting scene\n * @param earcutInjection can be used to inject your own earcut reference\n * @returns the polygon mesh\n */\nexport function CreatePolygon(name, options, scene = null, earcutInjection = earcut) {\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\n const shape = options.shape;\n const holes = options.holes || [];\n const depth = options.depth || 0;\n const smoothingThreshold = options.smoothingThreshold || 2;\n const contours = [];\n let hole = [];\n for (let i = 0; i < shape.length; i++) {\n contours[i] = new Vector2(shape[i].x, shape[i].z);\n }\n const epsilon = 0.00000001;\n if (contours[0].equalsWithEpsilon(contours[contours.length - 1], epsilon)) {\n contours.pop();\n }\n const polygonTriangulation = new PolygonMeshBuilder(name, contours, scene || EngineStore.LastCreatedScene, earcutInjection);\n for (let hNb = 0; hNb < holes.length; hNb++) {\n hole = [];\n for (let hPoint = 0; hPoint < holes[hNb].length; hPoint++) {\n hole.push(new Vector2(holes[hNb][hPoint].x, holes[hNb][hPoint].z));\n }\n polygonTriangulation.addHole(hole);\n }\n //updatability is set during applyToMesh; setting to true in triangulation build produces errors\n const polygon = polygonTriangulation.build(false, depth, smoothingThreshold);\n polygon._originalBuilderSideOrientation = options.sideOrientation;\n const vertexData = CreatePolygonVertexData(polygon, options.sideOrientation, options.faceUV, options.faceColors, options.frontUVs, options.backUVs, options.wrap);\n vertexData.applyToMesh(polygon, options.updatable);\n return polygon;\n}\n/**\n * Creates an extruded polygon mesh, with depth in the Y direction.\n * * You can set different colors and different images to the top, bottom and extruded side by using the parameters `faceColors` (an array of 3 Color3 elements) and `faceUV` (an array of 3 Vector4 elements)\n * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/texturePerBoxFace\n * @param name defines the name of the mesh\n * @param options defines the options used to create the mesh\n * @param scene defines the hosting scene\n * @param earcutInjection can be used to inject your own earcut reference\n * @returns the polygon mesh\n */\nexport function ExtrudePolygon(name, options, scene = null, earcutInjection = earcut) {\n return CreatePolygon(name, options, scene, earcutInjection);\n}\n/**\n * Class containing static functions to help procedurally build meshes\n * @deprecated use the functions directly from the module\n */\nexport const PolygonBuilder = {\n ExtrudePolygon,\n CreatePolygon,\n};\nVertexData.CreatePolygon = CreatePolygonVertexData;\nMesh.CreatePolygon = (name, shape, scene, holes, updatable, sideOrientation, earcutInjection = earcut) => {\n const options = {\n shape: shape,\n holes: holes,\n updatable: updatable,\n sideOrientation: sideOrientation,\n };\n return CreatePolygon(name, options, scene, earcutInjection);\n};\nMesh.ExtrudePolygon = (name, shape, depth, scene, holes, updatable, sideOrientation, earcutInjection = earcut) => {\n const options = {\n shape: shape,\n holes: holes,\n depth: depth,\n updatable: updatable,\n sideOrientation: sideOrientation,\n };\n return ExtrudePolygon(name, options, scene, earcutInjection);\n};\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,OAAO,QAAQ,4BAA4B;AAC7D,SAASC,MAAM,QAAQ,2BAA2B;AAClD,SAASC,IAAI,QAAQ,YAAY;AACjC,SAASC,UAAU,QAAQ,uBAAuB;AAClD,SAASC,kBAAkB,QAAQ,mBAAmB;AACtD,SAASC,YAAY,QAAQ,yBAAyB;AACtD,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,yBAAyB,QAAQ,sCAAsC;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CAACC,OAAO,EAAEC,eAAe,EAAEC,GAAG,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,GAAG,EAAE;EACpG,MAAMC,MAAM,GAAGL,GAAG,IAAI,IAAIM,KAAK,CAAC,CAAC,CAAC;EAClC,MAAMC,UAAU,GAAGN,OAAO;EAC1B,MAAMO,MAAM,GAAG,EAAE;EACjB,MAAMC,IAAI,GAAGL,GAAG,IAAI,KAAK;EACzB;EACA,KAAK,I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