QuantizedMeshTerrainData

new Cesium.QuantizedMeshTerrainData(options)

单个瓦片的地形数据,其中地形数据表示为量化网格。 量化的 网格由三个顶点属性组成,即 Longitude、latitude 和 Height。 所有属性都表示 作为 0 到 32767 范围内的 16 位值。 经度和纬度在西南角为零 的瓦片和 32767 在东北角。 在磁贴的最小高度处,Height 为零 和 32767 位于瓦片中的最大高度。
Name Type Description
options object 对象,具有以下属性:
Name Type Default Description
quantizedVertices Uint16Array 包含量化网格的缓冲区。
indices Uint16Array | Uint32Array 指定量化顶点如何链接的索引 一起组成三角形。 每三个索引指定一个三角形。
minimumHeight number 瓦片内的最小地形高度,以椭球体上方的米为单位。
maximumHeight number 瓦片内的最大地形高度,以米为单位,位于椭球体上方。
boundingSphere BoundingSphere 一个包围网格中所有顶点的球体。
orientedBoundingBox OrientedBoundingBox optional 一个 OrientedBoundingBox,用于边界网格中的所有顶点。
horizonOcclusionPoint Cartesian3 网格的水平线遮挡点。 如果此时 低于地平线,则假定整个图块也低于地平线。 该点以椭球标度坐标表示。
westIndices Array.<number> 瓦片西边顶点的索引。
southIndices Array.<number> 瓦片南边上顶点的索引。
eastIndices Array.<number> 瓦片东边顶点的索引。
northIndices Array.<number> 瓦片北边上顶点的索引。
westSkirtHeight number 要在图块西边添加的裙子的高度。
southSkirtHeight number 要在瓦片南边添加的裙子的高度。
eastSkirtHeight number 要在瓦片东边添加的裙子的高度。
northSkirtHeight number 要在瓦片北边添加的裙子的高度。
childTileMask number 15 optional 一个位掩码,指示此图块的四个子图块中存在哪一个。 如果设置了子位,则当该图块 是必需的。 如果清除该位,则不会请求子平铺,并且 geometry 为 而是从父级进行上采样。 位值如下所示:
Bit Position位值子平铺
01西南
12东南
24西北
38东北
createdByUpsampling boolean false optional 如果此实例是通过对另一个实例进行上采样创建的,则为 True; 否则为 false。
encodedNormals Uint8Array optional 包含每个顶点法线的缓冲区,使用 'oct' 编码编码
waterMask Uint8Array optional 包含水掩码的缓冲区。
credits Array.<Credit> optional 此图块的积分数组。
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

此磁贴的制作人员名单数组。

waterMask : Uint8Array|HTMLImageElement|HTMLCanvasElement

此地形数据中包含的水面罩(如果有)。 水面罩是矩形的 Uint8Array 或图像,其中值 255 表示水,值 0 表示陆地。 允许介于 0 和 255 之间的值,以便在陆地和水之间平滑混合。

Methods

interpolateHeight(rectangle, longitude, latitude)number

计算指定经纬度处的地形高度。
Name Type Description
rectangle Rectangle 此地形数据覆盖的矩形。
longitude number 以弧度为单位的经度。
latitude number 以弧度为单位的纬度。
Returns:
指定位置的地形高度。 位置被钳制到 矩形,因此对于远在矩形之外的位置,预期结果会不正确。

isChildAvailable(thisX, thisY, childX, childY)boolean

根据 HeightmapTerrainData.childTileMask 中。 假定给定的子图块坐标 成为此牌的四个子牌之一。 如果非子图块坐标为 给定,则返回 southeast child tile 的可用性。
Name Type Description
thisX number 此(父)瓦片的瓦片 X 坐标。
thisY number 此(父)瓦片的瓦片 Y 坐标。
childX number 用于检查可用性的子磁贴的磁贴 X 坐标。
childY number 要检查可用性的子磁贴的磁贴 Y 坐标。
Returns:
如果子磁贴可用,则为 True;否则为 false。

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

对此地形数据进行上采样,以供后代瓦片使用。 生成的实例将包含 顶点,必要时进行插值。
Name Type Description
tilingScheme TilingScheme 此地形数据的平铺方案。
thisX number 平铺方案中此瓦片的 X 坐标。
thisY number 此瓦片在切片方案中的 Y 坐标。
thisLevel number 此瓦片在平铺方案中的级别。
descendantX number 我们正在上采样的后代瓦片的平铺方案中的 X 坐标。
descendantY number 我们正在进行上采样的后代瓦片的平铺方案中的 Y 坐标。
descendantLevel number 我们正在上采样的后代瓦片的平铺方案中的级别。
Returns:
为后代瓦片的上采样高度贴图地形数据的承诺, 或 undefined 如果正在进行的异步 Upsample 操作过多,并且请求已被 递 延。

wasCreatedByUpsampling()boolean

获取一个值,该值指示此地形数据是否是通过对较低分辨率的上采样创建的 地形数据。 如果此值为 false,则数据是从其他来源获取的,例如 从远程服务器下载。 对于实例,此方法应返回 true 从调用 HeightmapTerrainData#upsample 返回。
Returns:
如果此实例是通过上采样创建的,则为 True;否则为 false。
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.