SegmentLonLat

Extends: Segment

Source: SegmentLonLat.ts:21

Planet segment Web Mercator tile class that stored and rendered with quad tree.


Constructor

new SegmentLonLat( node, quadTreeStrategy, tileZoom, extent, ): SegmentLonLat

Instance Methods

layerOverlap(layer)

Parameters

  • layer
  • TODO:
    • simplify layer._extentMerc in layer.getNativeExtent(this)

acceptForRendering(camera: Camera): boolean

Inherited from Segment#acceptForRendering

Overrides: Segment#acceptForRendering

Returns that segment good for rendering with camera by current lod ratio.

Parameters

  • camera (Camera) — Camera object.

Returns

  • boolean

getEntityTerrainPoint( entity: Entity, res: Vec3, normal?: Vec3, ): Vec3

Inherited from Segment#getEntityTerrainPoint

Overrides: Segment#getEntityTerrainPoint

Returns entity terrain point.

Parameters

  • entity (Entity) — Entity.
  • res (Vec3) — Point coordinates.
  • normal (Vec3, optional) — Terrain point normal.

Returns

getTerrainPoint( xyz: Vec3, insideSegmentPosition: LonLat, res?: Vec3, normal?: Vec3, ): number

Inherited from Segment#getTerrainPoint

Overrides: Segment#getTerrainPoint

Returns distance from object to terrain coordinates and terrain point that calculates out in the res parameter.

Parameters

  • xyz (Vec3) — Cartesian object position.
  • insideSegmentPosition (LonLat) — Geodetic object position.
  • res (Vec3, optional) — Result cartesian coordinates on the terrain.
  • normal (Vec3, optional) — Terrain point normal.

Returns

  • number

projectNative(lonlat: LonLat): LonLat

Inherited from Segment#projectNative

Overrides: Segment#projectNative

Project wgs86 to segment native projection.

Parameters

  • lonlat (LonLat) — Coordinates to project.

Returns

loadTerrain(forceLoading: boolean)

Inherited from Segment#loadTerrain

Overrides: Segment#loadTerrain

Parameters

  • forceLoading (boolean)

elevationsExists(elevations: Float32Array)

Inherited from Segment#elevationsExists

Overrides: Segment#elevationsExists

Terrain obtained from server.

Parameters

  • elevations (Float32Array) — Elevation data.

elevationsNotExists()

Inherited from Segment#elevationsNotExists

Overrides: Segment#elevationsNotExists

Terrain is not obtained or not exists on the server.

deleteBuffers()

Inherited from Segment#deleteBuffers

Overrides: Segment#deleteBuffers

Delete segment gl buffers.

deleteMaterials()

Inherited from Segment#deleteMaterials

Overrides: Segment#deleteMaterials

Delete materials.

deleteElevations()

Inherited from Segment#deleteElevations

Overrides: Segment#deleteElevations

Delete elevation data.

clearSegment()

Inherited from Segment#clearSegment

Overrides: Segment#clearSegment

Clear but not destroy segment data.

_freeCache()

Inherited from Segment#_freeCache

Overrides: Segment#_freeCache

Removes cache records.

destroySegment()

Inherited from Segment#destroySegment

Overrides: Segment#destroySegment

Clear and destroy all segment data.

createBoundsByExtent()

Inherited from Segment#createBoundsByExtent

Overrides: Segment#createBoundsByExtent

Creates bound volumes by segment geographical extent.

getMaterialByLayer(layer: Layer): planetSegment.Material

Inherited from Segment#getMaterialByLayer

Overrides: Segment#getMaterialByLayer

Gets specific layer material.

Parameters

  • layer (Layer) — Layer object.

Returns

  • planetSegment.Material

isLonLatInside(lonLat: LonLat): boolean

Inherited from Segment#isLonLatInside

Overrides: Segment#isLonLatInside

Returns true when the segment covers the point.

Parameters

  • lonLat (LonLat) — Geodetic coordinates.

Returns

  • boolean

_hitCellTriangle()

Inherited from Segment#_hitCellTriangle

Overrides: Segment#_hitCellTriangle

Ray test of the cell triangle at tri[i]: 1 when the point is above it, -1 when below it, 0 when missed.

_equalizeCorner(corner: number)

Inherited from Segment#_equalizeCorner

Overrides: Segment#_equalizeCorner

Takes the corner vertex from the owner of the point: the segment of the lowest zoom among the ones that have a corner there. The owner keeps its vertex, so the result doesn't depend on the order the segments go, and the comparison makes the vertex follow the owner without any labels.

Parameters

  • corner (number) — Corner index, NW, NE, SW or SE.

_equalizeCornerOnSide()

Inherited from Segment#_equalizeCornerOnSide

Overrides: Segment#_equalizeCornerOnSide

Puts the corner on the side of a neighbor of a lower zoom, when the point lies inside that side.

_getNormalMapSource()

Inherited from Segment#_getNormalMapSource

Overrides: Segment#_getNormalMapSource

The segment the normal map of this one comes from: itself, or the parent whose normal map.

_normalMapDrawn()

Inherited from Segment#_normalMapDrawn

Overrides: Segment#_normalMapDrawn

Called when the normal map is drawn. New normals change all the sides for the finer normal maps that took them.

_setExtentLonLat()

Inherited from Segment#_setExtentLonLat

Overrides: Segment#_setExtentLonLat

_getExtentCorners()

Inherited from Segment#_getExtentCorners

Overrides: Segment#_getExtentCorners

Returns the SW, NW, NE and SE corners of the segment on the ellipsoid.

setTerrainBoundingVolume(bounds: NumberArray6)

Inherited from Segment#setTerrainBoundingVolume

Overrides: Segment#setTerrainBoundingVolume

Sets the bounding volume of the terrain vertices, the plain segment volume when there are no finite vertices.

Parameters

  • bounds (NumberArray6) — [xmin, ymin, zmin, xmax, ymax, zmax].

_createPlainBounds()

Inherited from Segment#_createPlainBounds

Overrides: Segment#_createPlainBounds

Creates the plain segment box center and half diagonal, the LOD volume without terrain.

setLodRadius(radius: number)

Inherited from Segment#setLodRadius

Overrides: Segment#setLodRadius

Raises the LOD center over the plain segment center by the height of the median vertex radius over the surface.

Parameters

  • radius (number) — Median geocentric radius of the segment vertices.

getLonLat(lon: number, lat: number): LonLat

Inherited from Segment#getLonLat

Overrides: Segment#getLonLat

Returns the geodetic coordinates of the native point.

Parameters

  • lon (number) — Native longitude.
  • lat (number) — Native latitude.

Returns

_getCyclicLonShift( sourceExtent: Extent, targetExtent: Extent, worldWidth: number, ): number

Inherited from Segment#_getCyclicLonShift

Overrides: Segment#_getCyclicLonShift

Computes cyclic longitude shift for sourceExtent to align it with targetExtent in wrapped horizontal coordinate space (for example, Web Mercator world copies).

Parameters

  • sourceExtent (Extent) — Source extent to shift along longitude.
  • targetExtent (Extent) — Target extent used as alignment reference.
  • worldWidth (number) — Full world width in projection units.

Returns

  • number — Longitude shift to apply to sourceExtent.

Instance Fields

node: quadTree.Node

Inherited from Segment#node

Overrides: Segment#node

Quad tree node of the segment.

planet: Planet

Inherited from Segment#planet

Overrides: Segment#planet

Planet pointer.

handler: Handler

Inherited from Segment#handler

Overrides: Segment#handler

WebGl handler pointer.

bsphere: Sphere

Inherited from Segment#bsphere

Overrides: Segment#bsphere

Segment bounding sphere

bbox: Box

Inherited from Segment#bbox

Overrides: Segment#bbox

Segment bounding box.

_extent: Extent

Inherited from Segment#_extent

Overrides: Segment#_extent

Geographical extent.

gridSize: number

Inherited from Segment#gridSize

Overrides: Segment#gridSize

Vertices grid size.

tileZoom: number

Inherited from Segment#tileZoom

Overrides: Segment#tileZoom

Tile zoom index.

tileX: number

Inherited from Segment#tileX

Overrides: Segment#tileX

Horizontal tile index.

tileY: number

Inherited from Segment#tileY

Overrides: Segment#tileY

Vertical tile index.

materials: Array.<planetSegment.Material>

Inherited from Segment#materials

Overrides: Segment#materials

Texture materials array.

plainReady: boolean

Inherited from Segment#plainReady

Overrides: Segment#plainReady

Plain segment vertices was created.

initialized: boolean

Inherited from Segment#initialized

Overrides: Segment#initialized

Segment is ready to create plain vertices.

normalMapReady: boolean

Inherited from Segment#normalMapReady

Overrides: Segment#normalMapReady

Normal map is allready made.

parentNormalMapReady: boolean

Inherited from Segment#parentNormalMapReady

Overrides: Segment#parentNormalMapReady

Parent normal map is made allready(optimization parameter).

terrainReady: boolean

Inherited from Segment#terrainReady

Overrides: Segment#terrainReady

Terrain is allready applied flag.

terrainIsLoading: boolean

Inherited from Segment#terrainIsLoading

Overrides: Segment#terrainIsLoading

Terrain is loading now flag.

terrainExists: boolean

Inherited from Segment#terrainExists

Overrides: Segment#terrainExists

Terrain existing flag.