English中文

QuantizedMeshTerrainData

new Cesium.QuantizedMeshTerrainData(options)

单个图块的地形数据,其中地形数据表示为量化网格。量化网格由三个顶点属性组成:经度、纬度和高度。所有属性均表示为 0 到 32767 范围内的 16 位值。图块西南角的经度和纬度为零,东北角为 32767。在图块中的最小高度处高度为零,在图块中的最大高度处高度为 32767。 Terrain data for a single tile where the terrain data is represented as a quantized mesh. A quantized mesh consists of three vertex attributes, longitude, latitude, and height. All attributes are expressed as 16-bit values in the range 0 to 32767. Longitude and latitude are zero at the southwest corner of the tile and 32767 at the northeast corner. Height is zero at the minimum height in the tile and 32767 at the maximum height in the tile.
名称 Name 类型 Type 说明 Description
options object 具有以下属性的对象: Object with the following properties:
名称 Name 类型 Type 默认值 Default 说明 Description
quantizedVertices Uint16Array 包含量化网格的缓冲区。 The buffer containing the quantized mesh.
indices Uint16Array | Uint32Array 指定量化顶点如何链接在一起形成三角形的索引。每三个索引指定一个三角形。 The indices specifying how the quantized vertices are linked together into triangles. Each three indices specifies one triangle.
minimumHeight number 瓦片内的最小地形高度(以米为单位)高于椭球体。 The minimum terrain height within the tile, in meters above the ellipsoid.
maximumHeight number 瓦片内的最大地形高度(以米为单位)高于椭球体。 The maximum terrain height within the tile, in meters above the ellipsoid.
boundingSphere BoundingSphere 包围网格中所有顶点的球体。 A sphere bounding all of the vertices in the mesh.
orientedBoundingBox OrientedBoundingBox 可选 optional 一个 OrientedBoundingBox 包围网格中的所有顶点。 An OrientedBoundingBox bounding all of the vertices in the mesh.
horizonOcclusionPoint Cartesian3 网格的地平线遮挡点。如果该点位于地平线以下,则假定整个图块也位于地平线以下。该点以椭球坐标表示。 The horizon occlusion point of the mesh. If this point is below the horizon, the entire tile is assumed to be below the horizon as well. The point is expressed in ellipsoid-scaled coordinates.
westIndices Array.<number> 图块西边的顶点索引。 The indices of the vertices on the western edge of the tile.
southIndices Array.<number> 图块南边缘顶点的索引。 The indices of the vertices on the southern edge of the tile.
eastIndices Array.<number> 图块东边的顶点索引。 The indices of the vertices on the eastern edge of the tile.
northIndices Array.<number> 图块北边缘顶点的索引。 The indices of the vertices on the northern edge of the tile.
westSkirtHeight number 添加到瓷砖西边缘的裙边高度。 The height of the skirt to add on the western edge of the tile.
southSkirtHeight number 添加到图块南边缘的裙边高度。 The height of the skirt to add on the southern edge of the tile.
eastSkirtHeight number 添加到图块东边缘的裙边高度。 The height of the skirt to add on the eastern edge of the tile.
northSkirtHeight number 添加到图块北边缘的裙边高度。 The height of the skirt to add on the northern edge of the tile.
childTileMask number 15 可选 optional 一个位掩码,指示该图块的四个子级中存在哪一个。如果设置了子位,则在需要时也会请求该图块的几何形状。如果该位被清除,则不会请求子图块,而是从父图块对几何图形进行上采样。位值如下: A bit mask indicating which of this tile's four children exist. If a child's bit is set, geometry will be requested for that tile as well when it is needed. If the bit is cleared, the child tile is not requested and geometry is instead upsampled from the parent. The bit values are as follows:
位位置 Bit Position位值 Bit Value儿童瓷砖 Child Tile
01Southwest
12Southeast
24Northwest
38Northeast
createdByUpsampling boolean false 可选 optional 如果此实例是通过对另一个实例进行上采样创建的,则为 True;否则为假。 True if this instance was created by upsampling another instance; otherwise, false.
encodedNormals Uint8Array 可选 optional 包含每个顶点法线的缓冲区,使用“oct”编码进行编码 The buffer containing per vertex normals, encoded using 'oct' encoding
waterMask Uint8Array 可选 optional 含有水掩模的缓冲区。 The buffer containing the watermask.
credits Array.<Credit> 可选 optional 该图块的制作人员名单。 Array of credits for this tile.
示例: Example:
const data = new Cesium.QuantizedMeshTerrainData({
    minimumHeight : -100,
    maximumHeight : 2101,
    quantizedVertices : new Uint16Array([// order is SW NW SE NE
                                         // longitude
                                         0, 0, 32767, 32767,
                                         // latitude
                                         0, 32767, 0, 32767,
                                         // heights
                                         16384, 0, 32767, 16384]),
    indices : new Uint16Array([0, 3, 1,
                               0, 2, 3]),
    boundingSphere : new Cesium.BoundingSphere(new Cesium.Cartesian3(1.0, 2.0, 3.0), 10000),
    orientedBoundingBox : new Cesium.OrientedBoundingBox(new Cesium.Cartesian3(1.0, 2.0, 3.0), Cesium.Matrix3.fromRotationX(Cesium.Math.PI, new Cesium.Matrix3())),
    horizonOcclusionPoint : new Cesium.Cartesian3(3.0, 2.0, 1.0),
    westIndices : [0, 1],
    southIndices : [0, 1],
    eastIndices : [2, 3],
    northIndices : [1, 3],
    westSkirtHeight : 1.0,
    southSkirtHeight : 1.0,
    eastSkirtHeight : 1.0,
    northSkirtHeight : 1.0
});
另见: See:

成员 Members

该图块的一系列制作人员名单。 An array of credits for this tile.

waterMask : Uint8Array|HTMLImageElement|HTMLCanvasElement|undefined

该地形数据中包含的水掩模(如果有)。水蒙版是一个矩形 Uint8Array 或图像,其中值 255 表示水,值 0 表示陆地。 0 到 255 之间的值也允许在陆地和水之间平滑地混合。 The water mask included in this terrain data, if any. A water mask is a rectangular Uint8Array or image where a value of 255 indicates water and a value of 0 indicates land. Values in between 0 and 255 are allowed as well to smoothly blend between land and water.

方法 Methods

interpolateHeight(rectangle, longitude, latitude)number

计算指定经度和纬度处的地形高度。 Computes the terrain height at a specified longitude and latitude.
名称 Name 类型 Type 说明 Description
rectangle Rectangle 该地形数据覆盖的矩形。 The rectangle covered by this terrain data.
longitude number 以弧度表示的经度。 The longitude in radians.
latitude number 以弧度为单位的纬度。 The latitude in radians.
返回: Returns:
指定位置的地形高度。该位置被限制在矩形内,因此对于远离矩形的位置,预计会出现错误的结果。 The terrain height at the specified position. The position is clamped to the rectangle, so expect incorrect results for positions far outside the rectangle.

isChildAvailable(thisX, thisY, childX, childY)boolean

根据以下条件确定给定的子图块是否可用 Determines if a given child tile is available, based on the QuantizedMeshTerrainData.childTileMask。假定给定的子图块坐标是该图块的四个子图块之一。如果给出非子图块坐标,则返回东南子图块的可用性。 . The given child tile coordinates are assumed to be one of the four children of this tile. If non-child tile coordinates are given, the availability of the southeast child tile is returned.
名称 Name 类型 Type 说明 Description
thisX number 此(父)图块的图块 X 坐标。 The tile X coordinate of this (the parent) tile.
thisY number 此(父)图块的图块 Y 坐标。 The tile Y coordinate of this (the parent) tile.
childX number 用于检查可用性的子图块的图块 X 坐标。 The tile X coordinate of the child tile to check for availability.
childY number 用于检查可用性的子图块的图块 Y 坐标。 The tile Y coordinate of the child tile to check for availability.
返回: Returns:
如果子图块可用,则为 True;否则为假。 True if the child tile is available; otherwise, false.

upsample(tilingScheme, thisX, thisY, thisLevel, descendantX, descendantY, descendantLevel)Promise.<QuantizedMeshTerrainData>|undefined

对该地形数据进行上采样以供后代图块使用。生成的实例将包含该实例中顶点的子集,必要时进行插值。 Upsamples this terrain data for use by a descendant tile. The resulting instance will contain a subset of the vertices in this instance, interpolated if necessary.
名称 Name 类型 Type 说明 Description
tilingScheme TilingScheme 该地形数据的切片方案。 The tiling scheme of this terrain data.
thisX number 切片方案中该切片的 X 坐标。 The X coordinate of this tile in the tiling scheme.
thisY number 切片方案中该切片的 Y 坐标。 The Y coordinate of this tile in the tiling scheme.
thisLevel number 该切片在切片方案中的级别。 The level of this tile in the tiling scheme.
descendantX number 我们正在对其进行上采样的后代切片的切片方案中的 X 坐标。 The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
descendantY number 我们要对其进行上采样的后代切片的切片方案中的 Y 坐标。 The Y coordinate within the tiling scheme of the descendant tile for which we are upsampling.
descendantLevel number 我们正在对其进行上采样的后代切片的切片方案中的级别。 The level within the tiling scheme of the descendant tile for which we are upsampling.
返回: Returns:
对后代图块的上采样高度图地形数据的承诺,或者如果正在进行太多异步上采样操作并且请求已被推迟,则未定义。 A promise for upsampled heightmap terrain data for the descendant tile, or undefined if too many asynchronous upsample operations are in progress and the request has been deferred.

wasCreatedByUpsampling()boolean

获取一个值,该值指示此地形数据是否是通过对较低分辨率地形数据进行上采样而创建的。如果该值为 false,则数据是从其他来源获取的,例如从远程服务器下载。对于从调用返回的实例,此方法应返回 true Gets a value indicating whether or not this terrain data was created by upsampling lower resolution terrain data. If this value is false, the data was obtained from some other source, such as by downloading it from a remote server. This method should return true for instances returned from a call to HeightmapTerrainData#upsample.
返回: Returns:
如果此实例是通过上采样创建的,则为 True;否则为假。 True if this instance was created by upsampling; otherwise, false.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.