# Cesium3DTilesTerrainData

#### new Cesium.Cesium3DTilesTerrainData(options)
engine/Source/Core/Cesium3DTilesTerrainData.js 55

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

Name | Type | Description
--- | --- | ---
`options` | object | Object with the following properties:
Name | Type | Default | Description
--- | --- | --- | ---
`gltf` | Object.<string, *> |  | The parsed glTF JSON.
`minimumHeight` | number |  | The minimum terrain height within the tile, in meters above the ellipsoid.
`maximumHeight` | number |  | The maximum terrain height within the tile, in meters above the ellipsoid.
`boundingSphere` | BoundingSphere |  | A sphere bounding all of the vertices in the mesh.
`orientedBoundingBox` | OrientedBoundingBox |  | An oriented bounding box containing all of the vertices in the mesh.
`horizonOcclusionPoint` | Cartesian3 |  | 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.
`skirtHeight` | number |  | The height of the skirt to add on the edges of the tile.
`requestVertexNormals` | boolean | `false` | optional Indicates whether normals should be loaded.
`requestWaterMask` | boolean | `false` | optional Indicates whether water mask data should be loaded.
`credits` | Array.<Credit> |  | optional Array of credits for this tile.
`childTileMask` | number | `15` | optional 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:
Bit Position | Bit Value | Child Tile
--- | --- | ---
0 | 1 | Southwest
1 | 2 | Southeast
2 | 4 | Northwest
3 | 8 | Northeast
`waterMask` | Uint8Array |  | optional The buffer containing the water mask.

##### Experimental

This feature is not final and is subject to change without Cesium's standard deprecation policy.

##### See:

- TerrainData
- QuantizedMeshTerrainData
- HeightmapTerrainData
- GoogleEarthEnterpriseTerrainData

### Members

#### credits : Array.<Credit>|undefined
engine/Source/Core/Cesium3DTilesTerrainData.js 111

An array of credits for this tile.

#### waterMask : Uint8Array|HTMLImageElement|HTMLCanvasElement|ImageBitmap|undefined
engine/Source/Core/Cesium3DTilesTerrainData.js 123

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
engine/Source/Core/Cesium3DTilesTerrainData.js 140

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
engine/Source/Core/Cesium3DTilesTerrainData.js 166

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
engine/Source/Core/Cesium3DTilesTerrainData.js 397

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
engine/Source/Core/Cesium3DTilesTerrainData.js 483

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.