Class: Planet

og/scene/Planet~Planet

Main class for rendering planet

new Planet(name, ellipsoid)

Name Type Description
name string Planet name(Earth by default)
ellipsoid og.Ellipsoid Planet ellipsoid(WGS84 by default)
Fires:
  • - Triggered before globe frame begins to render.
  • - Triggered when layer has added to the planet.
  • - Triggered when base layer changed.
  • - Triggered when layer has removed from the planet.
  • - Triggered when some layer visibility changed.

Extends

  • og.scene.RenderNode

Members

protected_createdNodesCount

protected_currentDistanceFromPixelnumber

Calculates when mouse is moving or planet is rotating.

protected_fnRendering

protected_frustumEntityCollectionsArray.<og.EntityCollection>

Vector layers visible nodes with collections.

protected_geoImageCreator

GeoImage creator.

protected_heightFactornumber

Height scale factor. 1 - is normal elevation scale.

protected_heightPickingFramebufferObject

Framebuffer for relief. Is null when WEBGL_draw_buffers extension initialized.

protected_indexesBuffersArray.<Array.<number>>

Precomputed indexes buffers for differrent grid size segments.

protected_indexesCacheArray.<Array.<number>>

Precomputed indexes array for differrent grid size segments.

_lodRationumber

Level of the visible segment detalization.

protected_nightTexture

Night glowing gl texture.

protected_planetRadius2number

Squared ellipsoid radius.

protected_quadTreeog.quadTree.Node

Mercator grid tree.

protected_quadTreeNodesCacheMercog.quadTree.Node

Created nodes cache

protected_quadTreeNorthog.quadTree.Node

North grid tree.

protected_quadTreeSouthog.quadTree.Node

South grid tree.

protected_renderedNodesog.quadTree.Node

Planet's segments collected for rendering frame.

protected_specularTexture

Specular mask gl texture.

protected_tcolorArr

Layer's transparent colors.

protected_useNightTextureboolean

True for rendering night glowing texture.

protected_useSpecularTextureboolean

True for rendering specular mask texture.

protected_viewChanged

protected_visibleNodesog.quadTree.Node

Current visible mercator segments tree nodes array.

protected_visibleNodesNorthog.quadTree.Node

Current visible north pole nodes tree nodes array.

protected_visibleNodesSouthog.quadTree.Node

Current visible south pole nodes tree nodes array.

baseLayerog.Layer

There is only one base layer on the globe when layer.isBaseLayer is true.

cameraog.PlanetCamera

Camera is this.renderer.activeCamera pointer.

ellipsoidog.Ellipsoid

layerLockog.idle.Lock

Layers activity lock.

layersArray.<og.Layer>

All layers array.

maxCurrZoomnumber

Current visible maximal zoom index planet segment.

minCurrZoomnumber

Current visible minimal zoom index planet segment.

mousePositionOnEarthog.Vec3

Screen mouse pointer projected to planet cartesian position.

constantSLICE_SIZE

Segment multiple textures size.(4 - convinient value for the most devices)

terrainog.terrain.Terrain

Terrain provider.

terrainLockog.idle.Lock

Terrain providers activity lock.

visibleTileLayersArray.<og.Layer>

Current visible imagery tile layers array.

protectedvisibleVectorLayersArray.<og.layer.Vector>

Current visible vector layers array.

Methods

protected_clearLayerMaterial(layer)

Name Type Description
layer og.Layer Material layer.

protected_collectRenderNodes()

Collects visible quad nodes.

protected_frustumEntityCollectionPickingCallback()

Vector layers picking pass.

abstract,protected_initializeShaders()

abstract,protected_multiframebufferRendering()

protected_multiRenderNodesPASS()

protected_onLayerVisibilityChanged(layer)

Dispatch layer visibility changing event.
Name Type Description
layer og.Layer Changed layer.

protected_renderColorPickingFramebufferPASS()

protected_renderHeightPickingFramebufferPASS()

protected_renderScreenNodesPASS()

protected_renderVectorLayersPASS()

Vector layers rendering

abstract,protected_singleframebufferRendering()

protected_sortLayers()

Sort visible layer - preparing for rendering.

addControl(control)

Add the given control to the renderer of the planet scene.
Name Type Description
control og.control.Control Control.

addControls(cArr)

Add the given controls array to the renderer of the planet.
Name Type Description
cArr Array.<og.control.Control> Control array.

addLayer(layer)

Adds the given layer to the planet.
Name Type Description
layer og.Layer Layer object.

addLayers(layers)

Adds the given layers array to the planet.
Name Type Description
layers Array.<og.Layer> Layers array.

createDefaultTextures()

Creates default textures first for nirth pole and whole globe and second for south pole.

flyCartesian(cartesian, look, up)

Fly camera to the new point.
Name Type Description
cartesian og.Vec3 Fly coordiantes.
look og.Vec3 optional Camera "look at" point.
up og.Vec3 optional Camera UP vector on the end of a flying.

flyExtent(extent, up)

Fly camera to the planet geographical extent.
Name Type Description
extent og.Extent Geographical extent.
up og.Vec3 optional Camera UP vector on the end of a flying.

flyLonLat(lonlat, look, up)

Fly camera to the new geographical position.
Name Type Description
lonlat og.LonLat Fly geographical coordiantes.
look og.Vec3 optional Camera "look at" point on the end of a flying.
up og.Vec3 optional Camera UP vector on the end of a flying.
Render node callback.

getCartesianFromMouseTerrain(force){og.Vec3}

Returns 3d cartesian coordinates on the relief planet by mouse cursor position or null if mouse cursor is outside the planet.
Name Type Default Description
force Boolean false optional Force framebuffer rendering.
Returns:
Type Description
og.Vec3 -

getCartesianFromPixelEllipsoid(px){og.Vec3}

Returns 2d screen coordanates projection point to the planet ellipsoid 3d coordinates.
Name Type Description
px og.math.Pixel 2D sreen coordinates.
Returns:
Type Description
og.Vec3 -

getCartesianFromPixelTerrain(px, force){og.Vec3}

Returns 3d cartesian coordinates on the relief planet by 2d screen coordinates. position or null if input coordinates is outside the planet.
Name Type Default Description
px og.Vec2 Pixel screen 2d coordinates.
force Boolean false optional Force framebuffer rendering.
Returns:
Type Description
og.Vec3 -

getDistanceFromPixel(px, force){number}

Returns distance from active camera to the the relief planet coordiantes unprojected by 2d screen coordiantes, or null if screen coordinates outside the planet. If screen coordinates inside the planet but relief is not exists in the point than function returns distance to the planet ellipsoid.
Name Type Default Description
px og.Vec2 Screen coordinates.
force Boolean false optional Force framebuffer rendering.
Returns:
Type Description
number -

getDistanceFromPixelEllipsoid(px){number}

Returns distance from active camera to the the planet ellipsoid coordiantes unprojected by 2d screen coordiantes, or null if screen coordinates outside the planet.
Name Type Description
px og.Vec2 Screen coordinates.
Returns:
Type Description
number -

getHeightFactor(){number}

Gets elevation scale.
Returns:
Type Description
number Terrain elevation scale

getLayerByName(name){og.Layer}

Return layer by it name
Name Type Description
name string Name of the layer. og.Layer.prototype.name
Returns:
Type Description
og.Layer -

getLayers(){Array.<og.Layer>}

Get the collection of layers associated with this planet.
Returns:
Type Description
Array.<og.Layer> Layers array.

getLonLatFromPixelEllipsoid(px){og.LonLat}

Returns 2d screen coordanates projection point to the planet ellipsoid geographical coordinates.
Name Type Description
px og.math.Pixel 2D screen coordinates.
Returns:
Type Description
og.LonLat -

getLonLatFromPixelTerrain(px, force){og.LonLat}

Returns geographical coordinates on the relief planet by 2d screen coordinates. position or null if input coordinates is outside the planet.
Name Type Default Description
px og.Vec2 Pixel screen 2d coordinates.
force Boolean false optional Force framebuffer rendering.
Returns:
Type Description
og.LonLat -

getPixelFromCartesian(coords){og.Vec2}

Returns projected 2d screen coordinates by 3d cartesian coordiantes.
Name Type Description
coords og.Vec3 Cartesian coordinates.
Returns:
Type Description
og.Vec2 -

getPixelFromLonLat(lonlat){og.Vec2}

Returns projected 2d screen coordinates by geographical coordinates.
Name Type Description
lonlat og.LonLat Geographical coordinates.
Returns:
Type Description
og.Vec2 -

getRayIntersectionEllipsoid(ray){og.Vec3}

Returns ray vector hit ellipsoid coordinates. If the ray doesn't hit ellipsoit returns null.
Name Type Description
ray og.Ray Ray 3d.
Returns:
Type Description
og.Vec3 -

getViewExtent(){og.Extent}

Gets current viewing geographical extent.
Returns:
Type Description
og.Extent -

abstractinitialization()

Starts clear memory thread.

removeLayer(layer){og.Layer|undefined}

Removes the given layer from the planet.
Name Type Description
layer og.Layer Layer to remove.
Returns:
Type Description
og.Layer | undefined The removed layer or undefined if the layer was not found.

setBaseLayer(layer)

Sets base layer coverage to the planet.
Name Type Description
layer og.Layer Layer object.

setHeightFactor(factor)

Sets elevation scale. 1.0 is default.
Name Type Description
factor number Elevation scale.

setTerrain(terrain)

Sets terrain provider
Name Type Description
terrain og.terrain.Terrain Terrain provider.
Breaks the flight.

updateAttributionsList()

Updates attribution lists

updateVisibleLayers()

Updates visible layers.

viewExtent(extent)

Sets camera to the planet geographical extent.
Name Type Description
extent og.Extent Geographical extent.

viewExtentArr(extentArr)

Sets camera to the planet geographical extent.
Name Type Description
extentArr Array.<number, number, number, number> Geographical extent array, where index 0 - southwest longitude, 1 - latitude southwest, 2 - longitude northeast, 3 - latitude northeast.

viewLonLat(lonlat, up)

Sets camera to the planet geographical position.
Name Type Description
lonlat og.LonLat New geographical position.
up og.Vec3 optional Camera UP vector.