Cesium3DTilesTerrainData

new Cesium.Cesium3DTilesTerrainData(options)

单个瓦片的地形数据,其中地形数据以 glb(二进制 glTF)表示。
Name Type Description
options object 具有以下属性的对象:
Name Type Default Description
gltf Object.<string, *> 已解析的 glTF JSON。
minimumHeight number 瓦片内的最小地形高度,以椭球体上方的米为单位。
maximumHeight number 瓦片内的最大地形高度,以椭球体上方的米为单位。
boundingSphere BoundingSphere 包围网格中所有顶点的球体。
orientedBoundingBox OrientedBoundingBox 包含网格中所有顶点的定向包围盒。
horizonOcclusionPoint Cartesian3 网格的地平线遮挡点。如果该点 低于地平线,则假定整个瓦片也低于地平线。 该点以椭球体缩放坐标表示。
skirtHeight number 要在瓦片边缘添加的裙边高度。
requestVertexNormals boolean false optional 指示是否应加载法线。
requestWaterMask boolean false optional 指示是否应加载水掩码数据。
credits Array.<Credit> optional 此瓦片的署名信息数组。
childTileMask number 15 optional 指示此瓦片四个子瓦片中哪些存在的位掩码。 如果设置了某个子瓦片的位,则在需要时也会请求该瓦片的几何数据。 如果位被清除,则不会请求子瓦片,而是从父瓦片向上采样几何数据。位值如下:
位位置位值子瓦片
01西南
12东南
24西北
38东北
waterMask Uint8Array optional 包含水掩码的缓冲区。
Experimental

此功能尚未最终确定,可能会在不遵循 Cesium 标准弃用政策的情况下更改。

See:

Members

An array of credits for this tile.

waterMask : Uint8Array|HTMLImageElement|HTMLCanvasElement|ImageBitmap|undefined

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|undefined

Returns the terrain height at a specified longitude and latitude, or undefined if the mesh is undefined.
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, or undefined if the mesh is undefined. If the position is outside the rectangle, this method will extrapolate the height, which is likely to be wildly incorrect for positions far outside the rectangle.

isChildAvailable(thisX, thisY, childX, childY)boolean

Determines if a given child tile is available, based on the TerrainData#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 The tile X coordinate of this (the parent) tile.
thisY number The tile Y coordinate of this (the parent) tile.
childX number The tile X coordinate of the child tile to check for availability.
childY number The tile Y coordinate of the child tile to check for availability.
Returns:
True if the child tile is available; otherwise, false.

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

Upsamples this terrain data for use by a descendant tile.
Name Type Description
tilingScheme TilingScheme The tiling scheme of this terrain data.
thisX number The X coordinate of this tile in the tiling scheme.
thisY number The Y coordinate of this tile in the tiling scheme.
thisLevel number The level of this tile in the tiling scheme.
descendantX number The X coordinate within the tiling scheme of the descendant tile for which we are upsampling.
descendantY number 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 terrain data for the descendant tile, or undefined if createMesh has not been called yet or too many asynchronous upsample operations are in progress and the request has been deferred.

wasCreatedByUpsampling()boolean

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 Cesium3DTilesTerrainData#upsample.
Returns:
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.