Segment

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

Constructor

new Segment(node, planet, tileZoom, extent)

Parameters:
NameTypeDescription
nodequadTree.Node

Segment node.

planetPlanet

Current planet scene.

tileZoomNumber

Zoom index.

extentExtent

Segment extent.

Members

_extent :Extent

Geographical extent.

Type:

bbox :Box

Segment bounding box.

Type:

bsphere :Sphere

Segment bounding sphere

Type:

gridSize :number

Vertices grid size.

Type:
  • number

handler :Handler

WebGl handler pointer.

Type:

initialized :boolean

Segment is ready to create plain vertices.

Type:
  • boolean

materials :Array.<planetSegment.Material>

Texture materials array.

Type:
  • Array.<planetSegment.Material>

materials

node :quadTree.Node

Quad tree node of the segment.

Type:
  • quadTree.Node

normalMapReady :boolean

Normal map is allready made.

Type:
  • boolean

parentNormalMapReady :boolean

Parent normal map is made allready(optimization parameter).

Type:
  • boolean

plainReady :boolean

Plain segment vertices was created.

Type:
  • boolean

planet :Planet

Planet pointer.

Type:

terrainExists :boolean

Terrain existing flag.

Type:
  • boolean

terrainIsLoading :boolean

Terrain is loading now flag.

Type:
  • boolean

terrainReady :boolean

Terrain is allready applied flag.

Type:
  • boolean

tileX :number

Horizontal tile index.

Type:
  • number

tileY :number

Vertical tile index.

Type:
  • number

tileZoom :number

Tile zoom index.

Type:
  • number

Methods

_freeCache()

Removes cache records.

(protected) _getLayerExtentOffset(layer)

Parameters:
NameTypeDescription
layer
To Do
  • siplify layer._extentMerc in this.getLayerExtent(layer)

_setExtentLonLat()

acceptForRendering(camera) → {boolean}

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

Parameters:
NameTypeDescription
cameraCamera

Camera object.

Returns:
Type: 
boolean

clearSegment()

Clear but not destroy segment data.

createBoundsByExtent()

Creates bound volumes by segment geographical extent.

deleteBuffers()

Delete segment gl buffers.

deleteElevations()

Delete elevation data.

deleteMaterials()

Delete materials.

destroySegment()

Clear and destroy all segment data.

elevationsExists(elevations)

Terrain obtained from server.

Parameters:
NameTypeDescription
elevationsFloat32Array

Elevation data.

elevationsExists(elevations)

Terrain obtained from server.

Parameters:
NameTypeDescription
elevationsFloat32Array

Elevation data.

elevationsNotExists()

Terrain is not obtained or not exists on the server.

elevationsNotExists()

Keep plain elevation segment for rendering

'this.tileZoom <= this.planet.terrain.maxZoom' it means, that the segment is plain

getEntityTerrainPoint(entity, res, normalopt) → {Vec3}

Returns entity terrain point.

Parameters:
NameTypeAttributesDescription
entityEntity

Entity.

resVec3

Point coordinates.

normalVec3<optional>

Terrain point normal.

Returns:
Type: 
Vec3

getEntityTerrainPoint(entity, res) → {Vec3}

Returns entity terrain point.

Parameters:
NameTypeDescription
entityEntity

Entity.

resVec3

Point coordinates.

Returns:
Type: 
Vec3

getMaterialByLayer(layer) → {planetSegment.Material}

Gets specific layer material.

Parameters:
NameTypeDescription
layerLayer

Layer object.

Returns:
  • Segment material.
Type: 
planetSegment.Material

getMaterialByLayer(layer) → {Material|undefined}

Gets specific layer material.

Parameters:
NameTypeDescription
layerLayer

Layer object.

Returns:
  • Segment material.
Type: 
Material | undefined

getTerrainPoint(xyz, insideSegmentPosition, resopt, normalopt) → {number}

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

Parameters:
NameTypeAttributesDescription
xyzVec3

Cartesian object position.

insideSegmentPositionLonLat

Geodetic object position.

resVec3<optional>

Result cartesian coordinates on the terrain.

normalVec3<optional>

Terrain point normal.

Returns:
Type: 
number

getTerrainPoint(xyz, insideSegmentPosition, resopt) → {number}

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

Parameters:
NameTypeAttributesDescription
xyzVec3

Cartesian object position.

insideSegmentPositionLonLat

Geodetic object position.

resVec3<optional>

Result cartesian coordinates on the terrain.

Returns:
Type: 
number

loadTerrain(forceLoading)

Parameters:
NameTypeDescription
forceLoadingboolean

projectNative(lonlat) → {LonLat}

Project wgs86 to segment native projection.

Parameters:
NameTypeDescription
lonlatLonLat

Coordinates to project.

Returns:
Type: 
LonLat

projectNative(lonlat) → {LonLat}

Project wgs86 to segment native projection.

Parameters:
NameTypeDescription
lonlatLonLat

Coordinates to project.

Returns:
Type: 
LonLat

Segment

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

Constructor

new Segment(node, planet, tileZoom, extent)

Parameters:
NameTypeDescription
nodeNode

Segment node.

planetPlanet

Planet scene.

tileZoomnumber

Zoom index.

extentExtent

Segment extent.

Members

_extent :Extent

Geographical extent.

Type:

bbox :Box

Segment bounding box.

Type:

bsphere :Sphere

Segment bounding sphere

Type:

gridSize :number

Vertices grid size.

Type:
  • number

handler :Handler

WebGl handler pointer.

Type:

initialized :boolean

Segment is ready to create plain vertices.

Type:
  • boolean

materials :Array.<planetSegment.Material>

Texture materials array.

Type:
  • Array.<planetSegment.Material>

materials

node :quadTree.Node

Quad tree node of the segment.

Type:
  • quadTree.Node

normalMapReady :boolean

Normal map is allready made.

Type:
  • boolean

parentNormalMapReady :boolean

Parent normal map is made allready(optimization parameter).

Type:
  • boolean

plainReady :boolean

Plain segment vertices was created.

Type:
  • boolean

planet :Planet

Planet pointer.

Type:

terrainExists :boolean

Terrain existing flag.

Type:
  • boolean

terrainIsLoading :boolean

Terrain is loading now flag.

Type:
  • boolean

terrainReady :boolean

Terrain is allready applied flag.

Type:
  • boolean

tileX :number

Horizontal tile index.

Type:
  • number

tileY :number

Vertical tile index.

Type:
  • number

tileZoom :number

Tile zoom index.

Type:
  • number

Methods

_freeCache()

Removes cache records.

(protected) _getLayerExtentOffset(layer)

Parameters:
NameTypeDescription
layer
To Do
  • siplify layer._extentMerc in this.getLayerExtent(layer)

_setExtentLonLat()

acceptForRendering(camera) → {boolean}

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

Parameters:
NameTypeDescription
cameraCamera

Camera object.

Returns:
Type: 
boolean

clearSegment()

Clear but not destroy segment data.

createBoundsByExtent()

Creates bound volumes by segment geographical extent.

deleteBuffers()

Delete segment gl buffers.

deleteElevations()

Delete elevation data.

deleteMaterials()

Delete materials.

destroySegment()

Clear and destroy all segment data.

elevationsExists(elevations)

Terrain obtained from server.

Parameters:
NameTypeDescription
elevationsFloat32Array

Elevation data.

elevationsExists(elevations)

Terrain obtained from server.

Parameters:
NameTypeDescription
elevationsFloat32Array

Elevation data.

elevationsNotExists()

Terrain is not obtained or not exists on the server.

elevationsNotExists()

Keep plain elevation segment for rendering

'this.tileZoom <= this.planet.terrain.maxZoom' it means, that the segment is plain

getEntityTerrainPoint(entity, res, normalopt) → {Vec3}

Returns entity terrain point.

Parameters:
NameTypeAttributesDescription
entityEntity

Entity.

resVec3

Point coordinates.

normalVec3<optional>

Terrain point normal.

Returns:
Type: 
Vec3

getEntityTerrainPoint(entity, res) → {Vec3}

Returns entity terrain point.

Parameters:
NameTypeDescription
entityEntity

Entity.

resVec3

Point coordinates.

Returns:
Type: 
Vec3

getMaterialByLayer(layer) → {planetSegment.Material}

Gets specific layer material.

Parameters:
NameTypeDescription
layerLayer

Layer object.

Returns:
  • Segment material.
Type: 
planetSegment.Material

getMaterialByLayer(layer) → {Material|undefined}

Gets specific layer material.

Parameters:
NameTypeDescription
layerLayer

Layer object.

Returns:
  • Segment material.
Type: 
Material | undefined

getTerrainPoint(xyz, insideSegmentPosition, resopt, normalopt) → {number}

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

Parameters:
NameTypeAttributesDescription
xyzVec3

Cartesian object position.

insideSegmentPositionLonLat

Geodetic object position.

resVec3<optional>

Result cartesian coordinates on the terrain.

normalVec3<optional>

Terrain point normal.

Returns:
Type: 
number

getTerrainPoint(xyz, insideSegmentPosition, resopt) → {number}

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

Parameters:
NameTypeAttributesDescription
xyzVec3

Cartesian object position.

insideSegmentPositionLonLat

Geodetic object position.

resVec3<optional>

Result cartesian coordinates on the terrain.

Returns:
Type: 
number

loadTerrain(forceLoading)

Parameters:
NameTypeDescription
forceLoadingboolean

projectNative(lonlat) → {LonLat}

Project wgs86 to segment native projection.

Parameters:
NameTypeDescription
lonlatLonLat

Coordinates to project.

Returns:
Type: 
LonLat

projectNative(lonlat) → {LonLat}

Project wgs86 to segment native projection.

Parameters:
NameTypeDescription
lonlatLonLat

Coordinates to project.

Returns:
Type: 
LonLat