单个瓦片的地形数据,其中地形数据以量化网格表示。量化
网格由三个顶点属性组成:经度、纬度和高度。所有属性都表示为
0到32767范围内的16位值。经度和纬度在瓦片的西南角
为零,在东北角为32767。高度在瓦片的最小高度处
为零,在瓦片的最大高度处为32767。
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
具有以下属性的对象:
|
Example:
const data = new Cesium.QuantizedMeshTerrainData({
minimumHeight : -100,
maximumHeight : 2101,
quantizedVertices : new Uint16Array([// 顺序为西南、西北、东南、东北
// 经度
0, 0, 32767, 32767,
// 纬度
0, 32767, 0, 32767,
// 高度
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。
