单个瓦片的地形数据,其地形数据以量化网格(quantized mesh)的形式表示。量化
网格由三个顶点属性组成:经度、纬度和高度。所有属性均以 0 到 32767 范围内的
16 位值表示。经度和纬度在瓦片的西南角为 0,在东北角为 32767。高度在瓦片的最小高度处为 0,
在最大高度处为 32767。
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Object with the following properties:
|
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
credits : Array.<Credit>
此瓦片的版权声明数组。
此地形数据中包含的水掩码(如果有)。水掩码是一个矩形
Uint8Array 或图像,其中值 255 表示水域,值 0 表示陆地。
也允许 0 到 255 之间的值,以在陆地和水域之间平滑混合。
Methods
计算指定经度和纬度处的地形高度。
| Name | Type | Description |
|---|---|---|
rectangle |
Rectangle | 此地形数据所覆盖的矩形范围。 |
longitude |
number | 以弧度表示的经度。 |
latitude |
number | 以弧度表示的纬度。 |
Returns:
指定位置处的地形高度。该位置会被限制在
矩形范围内,因此对于远离矩形的位置,结果可能不正确。
根据给定的
QuantizedMeshTerrainData.childTileMask 确定某个子瓦片是否可用。给定的子瓦片坐标被假定为
此瓦片四个子瓦片之一。如果给出的是非子瓦片坐标,
则返回东南子瓦片的可用性。
| 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:
为后代瓦片提供上采样高度图地形数据的 promise,
如果过多的异步上采样操作正在进行且请求已被
推迟,则为 undefined。
获取一个指示此地形数据是否通过对较低分辨率
地形数据上采样而创建的标记。如果此值为 false,则数据来自其他来源,例如
从远程服务器下载。对于通过调用
HeightmapTerrainData#upsample 返回的实例,此方法应返回 true。
Returns:
如果此实例是通过上采样创建的则为 true;否则为 false。
