1 line
84 KiB
Plaintext
1 line
84 KiB
Plaintext
|
{"version":3,"file":"EllipseGeometry-3ffe669c.js","sources":["../../../../Source/Core/EllipseGeometry.js"],"sourcesContent":["import arrayFill from \"./arrayFill.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport Cartographic from \"./Cartographic.js\";\nimport Check from \"./Check.js\";\nimport ComponentDatatype from \"./ComponentDatatype.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport EllipseGeometryLibrary from \"./EllipseGeometryLibrary.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport GeographicProjection from \"./GeographicProjection.js\";\nimport Geometry from \"./Geometry.js\";\nimport GeometryAttribute from \"./GeometryAttribute.js\";\nimport GeometryAttributes from \"./GeometryAttributes.js\";\nimport GeometryInstance from \"./GeometryInstance.js\";\nimport GeometryOffsetAttribute from \"./GeometryOffsetAttribute.js\";\nimport GeometryPipeline from \"./GeometryPipeline.js\";\nimport IndexDatatype from \"./IndexDatatype.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix3 from \"./Matrix3.js\";\nimport PrimitiveType from \"./PrimitiveType.js\";\nimport Quaternion from \"./Quaternion.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport VertexFormat from \"./VertexFormat.js\";\n\nconst scratchCartesian1 = new Cartesian3();\nconst scratchCartesian2 = new Cartesian3();\nconst scratchCartesian3 = new Cartesian3();\nconst scratchCartesian4 = new Cartesian3();\nconst texCoordScratch = new Cartesian2();\nconst textureMatrixScratch = new Matrix3();\nconst tangentMatrixScratch = new Matrix3();\nconst quaternionScratch = new Quaternion();\n\nconst scratchNormal = new Cartesian3();\nconst scratchTangent = new Cartesian3();\nconst scratchBitangent = new Cartesian3();\n\nconst scratchCartographic = new Cartographic();\nconst projectedCenterScratch = new Cartesian3();\n\nconst scratchMinTexCoord = new Cartesian2();\nconst scratchMaxTexCoord = new Cartesian2();\n\nfunction computeTopBottomAttributes(positions, options, extrude) {\n const vertexFormat = options.vertexFormat;\n const center = options.center;\n const semiMajorAxis = options.semiMajorAxis;\n const semiMinorAxis = options.semiMinorAxis;\n const ellipsoid = options.ellipsoid;\n const stRotation = options.stRotation;\n const size = extrude ? (positions.length / 3) * 2 : positions.length / 3;\n const shadowVolume = options.shadowVolume;\n\n const textureCoordinates = vertexFormat.st\n ? new Float32Array(size * 2)\n : undefined;\n const normals = vertexFormat.normal ? new Float32Array(size * 3) : undefined;\n const tangents = vertexFormat.tangent\n ? new Float32Array(size * 3)\n : undefined;\n const bitangents = vertexFormat.bitangent\n ? new Float32Array(size * 3)\n : undefined;\n\n const extrudeNormals = shadowVolume ? new Float32Array(size * 3) : undefined;\n\n let textureCoordIndex = 0;\n\n // Raise positions to a height above the ellipsoid and compute the\n // texture coordinates, normals, tangents, and bitangents.\n let normal = scratchNormal;\n let tangent = scratchTangent;\n let bitangent = scratchBitangent;\n\n const projection = new GeographicProjection(ellipsoid);\n const projectedCenter = projection.project(\n ellipsoid.cartesianToCartographic(center, scratchCartographic),\n projectedCenterScratch\n );\n\n const geodeticNormal = ellipsoid.scaleToGeodeticSurface(\n center,\n scratchCartesian1\n );\n ellipsoid.geodeticSurfaceNormal(geodeticNormal, geodeticNormal);\n\n let textureMatrix = textureMatrixScratch;\n let tangentMatrix = tangentMatrixScratch;\n if (stRotation !== 0) {\n let rotation = Quaternion.fromAxisAngle(\n geodeticNormal,\n stRotation,\n quaternionScratch\n );\n textureMatrix = Matrix3.fromQuaternion(rotation, textureMatrix);\n\n rotation = Quaternion.fromAxisAngle(\n geodeticNormal,\n -stRotation,\n quaternionScratch
|