932223a16c368a5dd9f0eb3a0206ce35d3d4f08c8a483958f857ca83deba17a6.json 4.9 KB

1
  1. {"ast":null,"code":"import { Mesh } from \"../mesh.js\";\nimport { CreateSphere } from \"../Builders/sphereBuilder.js\";\nimport { CreateDisc } from \"./discBuilder.js\";\n/**\n * Creates a hemisphere mesh\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 * @returns the hemisphere mesh\n */\nexport function CreateHemisphere(name, options = {}, scene) {\n if (!options.diameter) {\n options.diameter = 1;\n }\n if (!options.segments) {\n options.segments = 16;\n }\n const halfSphere = CreateSphere(\"\", {\n slice: 0.5,\n diameter: options.diameter,\n segments: options.segments\n }, scene);\n const disc = CreateDisc(\"\", {\n radius: options.diameter / 2,\n tessellation: options.segments * 3 + (4 - options.segments)\n }, scene);\n disc.rotation.x = -Math.PI / 2;\n disc.parent = halfSphere;\n const merged = Mesh.MergeMeshes([disc, halfSphere], true);\n merged.name = name;\n return merged;\n}\n/**\n * Class containing static functions to help procedurally build meshes\n * @deprecated use the function directly from the module\n */\nexport const HemisphereBuilder = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n CreateHemisphere\n};\n/**\n * Creates a hemispheric light\n * @param name\n * @param segments\n * @param diameter\n * @param scene\n * @returns the mesh\n */\nMesh.CreateHemisphere = (name, segments, diameter, scene) => {\n const options = {\n segments: segments,\n diameter: diameter\n };\n return CreateHemisphere(name, options, scene);\n};","map":{"version":3,"names":["Mesh","CreateSphere","CreateDisc","CreateHemisphere","name","options","scene","diameter","segments","halfSphere","slice","disc","radius","tessellation","rotation","x","Math","PI","parent","merged","MergeMeshes","HemisphereBuilder"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/Builders/hemisphereBuilder.js"],"sourcesContent":["import { Mesh } from \"../mesh.js\";\nimport { CreateSphere } from \"../Builders/sphereBuilder.js\";\nimport { CreateDisc } from \"./discBuilder.js\";\n/**\n * Creates a hemisphere mesh\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 * @returns the hemisphere mesh\n */\nexport function CreateHemisphere(name, options = {}, scene) {\n if (!options.diameter) {\n options.diameter = 1;\n }\n if (!options.segments) {\n options.segments = 16;\n }\n const halfSphere = CreateSphere(\"\", { slice: 0.5, diameter: options.diameter, segments: options.segments }, scene);\n const disc = CreateDisc(\"\", { radius: options.diameter / 2, tessellation: options.segments * 3 + (4 - options.segments) }, scene);\n disc.rotation.x = -Math.PI / 2;\n disc.parent = halfSphere;\n const merged = Mesh.MergeMeshes([disc, halfSphere], true);\n merged.name = name;\n return merged;\n}\n/**\n * Class containing static functions to help procedurally build meshes\n * @deprecated use the function directly from the module\n */\nexport const HemisphereBuilder = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n CreateHemisphere,\n};\n/**\n * Creates a hemispheric light\n * @param name\n * @param segments\n * @param diameter\n * @param scene\n * @returns the mesh\n */\nMesh.CreateHemisphere = (name, segments, diameter, scene) => {\n const options = {\n segments: segments,\n diameter: diameter,\n };\n return CreateHemisphere(name, options, scene);\n};\n"],"mappings":"AAAA,SAASA,IAAI,QAAQ,YAAY;AACjC,SAASC,YAAY,QAAQ,8BAA8B;AAC3D,SAASC,UAAU,QAAQ,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAACC,IAAI,EAAEC,OAAO,GAAG,CAAC,CAAC,EAAEC,KAAK,EAAE;EACxD,IAAI,CAACD,OAAO,CAACE,QAAQ,EAAE;IACnBF,OAAO,CAACE,QAAQ,GAAG,CAAC;EACxB;EACA,IAAI,CAACF,OAAO,CAACG,QAAQ,EAAE;IACnBH,OAAO,CAACG,QAAQ,GAAG,EAAE;EACzB;EACA,MAAMC,UAAU,GAAGR,YAAY,CAAC,EAAE,EAAE;IAAES,KAAK,EAAE,GAAG;IAAEH,QAAQ,EAAEF,OAAO,CAACE,QAAQ;IAAEC,QAAQ,EAAEH,OAAO,C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