Skip to content

KBE3D / KBCore / Cesium / Cesium3DTilesTerrainData

类: Cesium3DTilesTerrainData

Terrain data for a single tile where the terrain data is represented as a glb (binary glTF).

参数

Object with the following properties:

参数

The parsed glTF JSON.

参数

The minimum terrain height within the tile, in meters above the ellipsoid.

参数

The maximum terrain height within the tile, in meters above the ellipsoid.

参数

A sphere bounding all of the vertices in the mesh.

参数

An oriented bounding box containing all of the vertices in the mesh.

参数

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.

参数

The height of the skirt to add on the edges of the tile.

参数

Indicates whether normals should be loaded.

参数

Indicates whether water mask data should be loaded.

参数

Array of credits for this tile.

参数

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: <table> <tr><th>Bit Position</th><th>Bit Value</th><th>Child Tile</th></tr> <tr><td>0</td><td>1</td><td>Southwest</td></tr> <tr><td>1</td><td>2</td><td>Southeast</td></tr> <tr><td>2</td><td>4</td><td>Northwest</td></tr> <tr><td>3</td><td>8</td><td>Northeast</td></tr> </table>

参数

The buffer containing the water mask.

属性

credits

credits: Credit[] | undefined

An array of credits for this tile.


waterMask

waterMask: HTMLCanvasElement | HTMLImageElement | ImageBitmap | Uint8Array<ArrayBufferLike> | 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.

方法

interpolateHeight()

interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number | undefined

Returns the terrain height at a specified longitude and latitude, or undefined if the mesh is undefined.

参数

rectangle

Rectangle

The rectangle covered by this terrain data.

longitude

number

The longitude in radians.

latitude

number

The latitude in radians.

返回

number | undefined

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()

isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): 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.

参数

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.

返回

boolean

True if the child tile is available; otherwise, false.


upsample()

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

Upsamples this terrain data for use by a descendant tile.

参数

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.

返回

Promise<TerrainData> | undefined

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()

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.

返回

boolean

True if this instance was created by upsampling; otherwise, false.

构造函数

构造函数

new Cesium3DTilesTerrainData(options: { gltf: {[key: string]: any; }; minimumHeight: number; maximumHeight: number; boundingSphere: BoundingSphere; orientedBoundingBox: OrientedBoundingBox; horizonOcclusionPoint: Cartesian3; skirtHeight: number; requestVertexNormals?: boolean; requestWaterMask?: boolean; credits?: Credit[]; childTileMask?: number; waterMask?: Uint8Array<ArrayBufferLike>; }): Cesium3DTilesTerrainData

参数

options
gltf

{[key: string]: any; }

minimumHeight

number

maximumHeight

number

boundingSphere

BoundingSphere

orientedBoundingBox

OrientedBoundingBox

horizonOcclusionPoint

Cartesian3

skirtHeight

number

requestVertexNormals?

boolean

requestWaterMask?

boolean

credits?

Credit[]

childTileMask?

number

waterMask?

Uint8Array<ArrayBufferLike>

返回

Cesium3DTilesTerrainData

KBE3D @3.0.0 Copyright © 2024-present KBE3D