1 line
192 KiB
Plaintext
1 line
192 KiB
Plaintext
|
{"version":3,"file":"createVerticesFromHeightmap.js","sources":["../../../../Source/Core/HeightmapEncoding.js","../../../../Source/Core/HeightmapTessellator.js","../../../../Source/ThirdParty/lerc.js","../../../../Source/WorkersES6/createVerticesFromHeightmap.js"],"sourcesContent":["/**\n * The encoding that is used for a heightmap\n *\n * @enum {Number}\n */\nconst HeightmapEncoding = {\n /**\n * No encoding\n *\n * @type {Number}\n * @constant\n */\n NONE: 0,\n\n /**\n * LERC encoding\n *\n * @type {Number}\n * @constant\n *\n * @see {@link https://github.com/Esri/lerc|The LERC specification}\n */\n LERC: 1,\n};\nexport default Object.freeze(HeightmapEncoding);\n","import AxisAlignedBoundingBox from \"./AxisAlignedBoundingBox.js\";\nimport BoundingSphere from \"./BoundingSphere.js\";\nimport Cartesian2 from \"./Cartesian2.js\";\nimport Cartesian3 from \"./Cartesian3.js\";\nimport defaultValue from \"./defaultValue.js\";\nimport defined from \"./defined.js\";\nimport DeveloperError from \"./DeveloperError.js\";\nimport Ellipsoid from \"./Ellipsoid.js\";\nimport EllipsoidalOccluder from \"./EllipsoidalOccluder.js\";\nimport CesiumMath from \"./Math.js\";\nimport Matrix4 from \"./Matrix4.js\";\nimport OrientedBoundingBox from \"./OrientedBoundingBox.js\";\nimport Rectangle from \"./Rectangle.js\";\nimport TerrainEncoding from \"./TerrainEncoding.js\";\nimport Transforms from \"./Transforms.js\";\nimport WebMercatorProjection from \"./WebMercatorProjection.js\";\n\n/**\n * Contains functions to create a mesh from a heightmap image.\n *\n * @namespace HeightmapTessellator\n *\n * @private\n */\nconst HeightmapTessellator = {};\n\n/**\n * The default structure of a heightmap, as given to {@link HeightmapTessellator.computeVertices}.\n *\n * @constant\n */\nHeightmapTessellator.DEFAULT_STRUCTURE = Object.freeze({\n heightScale: 1.0,\n heightOffset: 0.0,\n elementsPerHeight: 1,\n stride: 1,\n elementMultiplier: 256.0,\n isBigEndian: false,\n});\n\nconst cartesian3Scratch = new Cartesian3();\nconst matrix4Scratch = new Matrix4();\nconst minimumScratch = new Cartesian3();\nconst maximumScratch = new Cartesian3();\n\n/**\n * Fills an array of vertices from a heightmap image.\n *\n * @param {Object} options Object with the following properties:\n * @param {Int8Array|Uint8Array|Int16Array|Uint16Array|Int32Array|Uint32Array|Float32Array|Float64Array} options.heightmap The heightmap to tessellate.\n * @param {Number} options.width The width of the heightmap, in height samples.\n * @param {Number} options.height The height of the heightmap, in height samples.\n * @param {Number} options.skirtHeight The height of skirts to drape at the edges of the heightmap.\n * @param {Rectangle} options.nativeRectangle A rectangle in the native coordinates of the heightmap's projection. For\n * a heightmap with a geographic projection, this is degrees. For the web mercator\n * projection, this is meters.\n * @param {Number} [options.exaggeration=1.0] The scale used to exaggerate the terrain.\n * @param {Number} [options.exaggerationRelativeHeight=0.0] The height from which terrain is exaggerated.\n * @param {Rectangle} [options.rectangle] The rectangle covered by the heightmap, in geodetic coordinates with north, south, east and\n * west properties in radians. Either rectangle or nativeRectangle must be provided. If both\n * are provided, they're assumed to be consistent.\n * @param {Boolean} [options.isGeographic=true] True if the heightmap uses a {@link GeographicProjection}, or false if it uses\n * a {@link WebMercatorProjection}.\n * @param {Cartesian3} [options.relativeToCenter=Cartesian3.ZERO] The positions will be computed as <code>Cartesian3.subtract(worldPosition, relativeToCenter)</code>.\n * @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to which the heightmap applies.\n * @param {Object} [options.structure] An object describing the structure of the height data.\n * @param {Number} [options.structur
|