Class: Planet

og.scene.Planet

new og.scene.Planet(name, ellipsoid)

Main class for rendering planet
Name Type Description
name string Planet name(Earth by default)
ellipsoid og.Ellipsoid Planet ellipsoid(WGS84 by default)
Fires:

Extends

Members

static,constantog.scene.Planet.MAX_NODESnumber

Maximum created nodes count. The more nodes count the more memory usage.
Default Value:
  • 120

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 buffer array for differrent grid size segments.

protected_nightTexture

Night glowing gl texture.

protected_planetRadius2number

Squared ellipsoid radius.

protected_quadTreeog.quadTree.QuadNode

Mercator grid tree.

protected_quadTreeNorthog.quadTree.QuadNode

North grid tree.

protected_quadTreeSouthog.quadTree.QuadNode

South grid tree.

protected_renderedNodesog.quadTree.QuadNode

Planet's segments collected for the 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_viewExtentMercog.Extent

Current view geodetic Web Mercator extent.

protected_viewExtentWGS84og.Extent

Current view geodetic WGS84 extent.

protected_visibleNodesog.quadTree.QuadNode

Current visible mercator segments tree nodes array.

protected_visibleNodesNorthog.quadTree.QuadNode

Current visible north pole nodes tree nodes array.

protected_visibleNodesSouthog.quadTree.QuadNode

Current visible south pole nodes tree nodes array.

baseLayerog.layer.Layer

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

protectedbillboardsTextureAtlasog.utils.TextureAtlas

Texture atlas for the billboards images. One atlas per node.
Camera is this.renderer.activeCamera pointer.

childNodesArray.<og.scene.Node>

Children nodes.

ellipsoidog.Ellipsoid

entityCollectionsArray.<og.EntityCollection>

Entity collection array.

eventsog.Events

Render node events.

fontAtlasog.utils.FontAtlas

Texture font atlas for the font families and styles. One atlas per node.

layerLockog.idle.Lock

Layers activity lock.

layersArray.<og.layer.Layer>

All layers array.

lightEnabledboolean

Lighting calculations.

maxCurrZoomnumber

Current visible maximal zoom index planet segment.

minCurrZoomnumber

Current visible minimal zoom index planet segment.

mousePositionOnEarthog.math.Vector3

Screen mouse pointer projected to planet cartesian position.

namestring

Node name.
Object async creates normal map segment textures.

parentNodeog.scene.Node

Parent node pointer.

RATIO_LODnumber

Level of the visible segment detalization.

rendererog.Renderer

Renderer that calls frame() callback.

show

Show rendering.

constantSLICE_SIZE

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

terrainLockog.idle.Lock

Terrain providers activity lock.
Terrain provider.

topNodeog.scene.Node

Top scene tree node pointer.

visibleTileLayersArray.<og.layer.Layer>

Current visible imagery tile layers array.

protectedvisibleVectorLayersArray.<og.layer.Vector>

Current visible vector layers array.

Methods

inherited protected_clear()

Clear current node.

protected_clearLayerMaterial(layer)

Name Type Description
layer og.layer.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.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.BaseControl Control.

addControls(cArr)

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

inherited addEntityCollection(entityCollection, isHidden){og.scene.RenderNode}

Adds entity collection.
Name Type Description
entityCollection og.EntityCollection Entity collection.
isHidden boolean optional If it's true that this collection has specific rendering.
Returns:
Type Description
og.scene.RenderNode

addLayer(layer)

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

addLayers(layers)

Adds the given layers array to the planet.
Name Type Description
layers Array.<og.layer.Layer> Layers array.
Adds point light source.
Name Type Description
light og.LightSource Light source.
Returns:
Type Description
og.scene.RenderNode
Adds node to the current hierarchy.

inherited assignRenderer(renderer)

Assign render node with renderer.
Name Type Description
renderer og.Renderer Redner node's renderer.

createDefaultTextures()

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

inherited drawEntityCollections()

Calls render frame node's callback. Used in renderer.

inherited drawPickingEntityCollections()

flyCartesian(cartesian, look, up)

Fly camera to the new point.
Name Type Description
cartesian og.math.Vector3 Fly coordiantes.
look og.math.Vector3 optional Camera "look at" point.
up og.math.Vector3 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.math.Vector3 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.math.Vector3 optional Camera "look at" point on the end of a flying.
up og.math.Vector3 optional Camera UP vector on the end of a flying.
Render node callback.

getCartesianFromMouseTerrain(){og.math.Vector3}

Returns 3d cartesian coordinates on the relief planet by mouse cursor position or null if mouse cursor is outside the planet.
Returns:
Type Description
og.math.Vector3

getCartesianFromPixelEllipsoid(px)

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

getCartesianFromPixelTerrain(px){og.math.Vector3}

Returns 3d cartesian coordinates on the relief planet by 2d screen coordinates. position or null if input coordinates is outside the planet.
Name Type Description
px og.math.Vector2 Pixel screen 2d coordinates.
Returns:
Type Description
og.math.Vector3

getDistanceFromPixel(px){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 Description
px og.math.Vector2
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.math.Vector2
Returns:
Type Description
number

getHeightFactor(){number}

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

getLayerByName(name){og.layer.Layer}

Return layer by it name
Name Type Description
name string Name of the layer. og.layer.Layer.prototype.name
Returns:
Type Description
og.layer.Layer
Get the collection of layers associated with this planet.
Returns:
Type Description
Array.<og.layer.Layer> Layers array.
Gets light object by its name.
Name Type Description
name string Point light name.
Returns:
Type Description
og.LightSource

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){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 Description
px og.math.Vector2 Pixel screen 2d coordinates.
Returns:
Type Description
og.LonLat
Gets node by name in the current.
Name Type Description
name string Node name.
Returns:
Type Description
og.scene.Node Node object in the current node.

getPixelFromCartesian(coords){og.math.Vector2}

Returns projected 2d screen coordinates by 3d cartesian coordiantes.
Name Type Description
coords og.math.Vector3 Cartesian coordinates.
Returns:
Type Description
og.math.Vector2

getPixelFromLonLat(lonlat){og.math.Vector2}

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

getRayIntersectionEllipsoid(ray){og.math.Vector3}

Returns ray vector hit ellipsoid coordinates. If the ray doesn't hit ellipsoit returns null.
Name Type Description
ray og.math.Ray Ray 3d.
Returns:
Type Description
og.math.Vector3
Gets current viewing geographical extent.
Returns:
Type Description
og.Extent

abstractinitialization()

Gets render node activity.
Returns:
Type Description
boolean
Starts clear memory thread.

inherited removeEntityCollection(entityCollection)

Removes entity collection.
Name Type Description
entityCollection og.EntityCollection Entity collection for remove.

removeLayer(layer){og.layer.Layer|undefined}

Removes the given layer from the planet.
Name Type Description
layer og.layer.Layer Layer to remove.
Returns:
Type Description
og.layer.Layer | undefined The removed layer or undefined if the layer was not found.
Removes light source.
Name Type Description
light og.LightSource Light source object.
Activate rendering this node.
Name Type Description
isActive boolean Activation flag.

setBaseLayer(layer)

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

setHeightFactor(factor)

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

setTerrainProvider(terrain)

Sets terrain provider
Name Type Description
terrain og.terrainProvider.TerrainProvider Terrain provider.
Breaks the flight.
This function have to be called manualy in each render node frame callback, before drawing scene geometry.

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.math.Vector3 optional Camera UP vector.

Events

baselayerchange

Triggered when base layer changed.
Triggered before globe frame begins to render.
Triggered when layer has added to the planet.
Triggered when layer has removed from the planet.

layervisibilitychange

Triggered when some layer visibility changed.