Class: TerrainTile

TerrainTile(sector, level, row, column)

Represents a portion of a globe's terrain. Applications typically do not interact directly with this class.

Constructor

new TerrainTile(sector, level, row, column)

Constructs a terrain tile.
Parameters:
Name Type Description
sector Sector The sector this tile covers.
level Level The level this tile is associated with.
row Number This tile's row in the associated level.
column Number This tile's column in the associated level.
Source:
Throws:
If the specified sector or level is null or undefined or the row or column arguments are less than zero.
Type
ArgumentError

Extends

Members

(readonly) column :Number

The column in this tile's level in which this tile lies in a tile pyramid.
Type:
  • Number
Inherited From:
Source:

extent :BoundingBox

The Cartesian bounding box of this tile.
Type:
Inherited From:
Source:

(readonly) level :Number

The level at which this tile lies in a tile pyramid.
Type:
  • Number
Inherited From:
Source:

opacity :Number

This tile's opacity.
Type:
  • Number
Inherited From:
Default Value:
  • 1
Source:

points :Float32Array

The tile's model coordinate points.
Type:
  • Float32Array
Source:

pointsStateKey :String

Indicates the state of this tile when the model coordinate points were last updated. This is used to invalidate the points when this tile's state changes.
Type:
  • String
Source:

pointsVboStateKey :String

Indicates the state of this tile when the model coordinate VBO was last uploaded to GL. This is used to invalidate the VBO when the tile's state changes.
Type:
  • String
Source:

referencePoint :Vec3

The tile's local origin in model coordinates. Any model coordinate points associates with the tile should be relative to this point.
Type:
Inherited From:
Source:

(readonly) row :Number

The row in this tile's level in which this tile lies in a tile pyramid.
Type:
  • Number
Inherited From:
Source:

(readonly) sector :Sector

The sector represented by this tile.
Type:
Inherited From:
Source:

(readonly) stateKey :String

A string identifying the state of this tile as a function of the elevation model's timestamp and this tile's neighbors. Used to compare states during rendering to determine whether cached values must be updated. Applications typically do not interact with this property.
Type:
  • String
Source:

texelSize :Number

The size in radians of pixels or cells of this tile's associated resource.
Type:
  • Number
Inherited From:
Source:

tileHeight :Number

The height in pixels or cells of this tile's associated resource.
Type:
  • Number
Inherited From:
Source:

(readonly) tileKey :String

A key that uniquely identifies this tile within a level set.
Type:
  • String
Inherited From:
Source:

tileWidth :Number

The width in pixels or cells of this tile's associated resource.
Type:
  • Number
Inherited From:
Source:

transformationMatrix :Matrix

The transformation matrix that maps tile local coordinates to model coordinates.
Type:
Source:

Methods

distanceTo(vector) → {number}

Computes an approximate distance from this tile to a specified vector.
Parameters:
Name Type Description
vector Vec3 The vector to compute the distance to.
Inherited From:
Source:
Throws:
If the specified vector is null or undefined.
Type
ArgumentError
Returns:
The distance between this tile and the vector.
Type
number

(protected) doUpdate(dc)

Updates this tile's frame-dependent properties according to the specified draw context.
Parameters:
Name Type Description
dc DrawContext The current draw context.
Inherited From:
Source:

isEqual(that) → {boolean}

Indicates whether this tile is equivalent to a specified tile.
Parameters:
Name Type Description
that Tile The tile to check equivalence with.
Inherited From:
Source:
Returns:
true if this tile is equivalent to the specified one, false if they are not equivalent or the specified tile is null or undefined.
Type
boolean

mustSubdivide(dc, detailFactor) → {boolean}

Indicates whether this tile should be subdivided based on the current navigation state and a specified detail factor.
Parameters:
Name Type Description
dc DrawContext The current draw context.
detailFactor Number The detail factor to consider.
Inherited From:
Source:
Returns:
true If the tile should be subdivided, otherwise false.
Type
boolean

neighborLevel(direction) → {Level}

Indicates the level of the tile adjacent to this tile in a specified direction. This returns null when this tile has no neighbor in that direction.
Parameters:
Name Type Description
direction String The cardinal direction. Must be one of WorldWind.NORTH, WorldWind.SOUTH, WorldWind.EAST or WorldWind.WEST.
Source:
Returns:
The neighbor tile's level in the specified direction, or null if there is no neighbor.
Type
Level

setNeighborLevel(direction, level)

Specifies the level of the tile adjacent to this tile in a specified direction.
Parameters:
Name Type Description
direction String The cardinal direction. Must be one of WorldWind.NORTH, WorldWind.SOUTH, WorldWind.EAST or WorldWind.WEST.
level Level The neighbor tile's level in the specified direction, or null to indicate that there is no neighbor in that direction.
Source:

size() → {Number}

Returns the size of this tile in bytes.
Inherited From:
Source:
Returns:
The size of this tile in bytes.
Type
Number

subdivide(level, tileFactory) → {Array.<Tile>}

Returns the four children formed by subdividing this tile.
Parameters:
Name Type Description
level Level The level of the children.
tileFactory TileFactory The tile factory to use to create the children.
Inherited From:
Source:
Throws:
If the specified tile factory or level is null or undefined.
Type
ArgumentError
Returns:
An array containing the four child tiles.
Type
Array.<Tile>

subdivideToCache(level, tileFactory, cache) → {Array.<Tile>}

Returns the four children formed by subdividing this tile, drawing those children from a specified cache if they exist there.
Parameters:
Name Type Description
level Level The level of the children.
tileFactory TileFactory The tile factory to use to create the children.
cache MemoryCache A memory cache that may contain pre-existing child tiles. If non-null, the cache is checked for a child collection prior to creating that tile. If one exists in the cache it is returned rather than creating a new collection of children. If a new collection is created, it is added to the cache.
Inherited From:
Source:
Throws:
If the specified tile factory or level is null or undefined.
Type
ArgumentError
Returns:
An array containing the four tiles.
Type
Array.<Tile>

surfacePoint(latitude, longitude, result) → {Vec3}

Computes a point on the terrain at a specified location.
Parameters:
Name Type Description
latitude Number The location's latitude.
longitude Number The location's longitude.
result Vec3 A pre-allocated Vec3 in which to return the computed point.
Source:
Throws:
If the specified result argument is null or undefined.
Type
ArgumentError
Returns:
The result argument set to the computed point.
Type
Vec3

update(dc)

Updates this tile's frame-dependent properties as necessary, according to the specified draw context.

The tile's frame-dependent properties, include the extent (bounding volume). These properties are dependent on the tile's sector and the elevation values currently in memory, and change when those dependencies change. Therefore update must be called once per frame before the extent and any other frame-dependent properties are used. update intelligently determines when it is necessary to recompute these properties, and does nothing if the state of all dependencies has not changed since the last call.

Parameters:
Name Type Description
dc DrawContext The current draw context.
Overrides:
Source: