Constructor
new Planet()
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options.name | string | <optional> | "Earth" | Planet name(Earth by default) |
options.ellipsoid | Ellipsoid | <optional> | Planet ellipsoid(WGS84 by default) | |
options.maxGridSize | Number | <optional> | 128 | Segment maximal grid size |
options.maxEqualZoomAltitude | Number | <optional> | 15000000.0 | Maximal altitude since segments on the screen become the same zoom level |
options.minEqualZoomAltitude | Number | <optional> | 10000.0 | Minimal altitude since segments on the screen become the same zoom level |
options.minEqualZoomCameraSlope | Number | <optional> | 0.8 | Minimal camera slope above te globe where segments on the screen become the same zoom level |
- Source
- EventsHandler
#event:draw - EventsHandler
#event:layeradd - EventsHandler
#event:baselayerchange - EventsHandler
#event:layerremove - EventsHandler
#event:layervisibilitychange - EventsHandler
#event:geoimageadd
Extends
Members
terrainReady
Returns true if current terrain data set is loaded
- Source
Methods
(protected) _applyAttribution()
Apply to render list of layer attributions
- Source
(protected) _clear()
Clear current node.
- Overrides
- Source
_clearLayerMaterial(layer)
Name | Type | Description |
---|---|---|
layer | Layer | Material layer. |
- Source
(protected) _collectRenderNodes()
Collects visible quad nodes.
- Source
_onLayerVisibilityChanged(layer)
Dispatch layer visibility changing event.
Name | Type | Description |
---|---|---|
layer | Layer | Changed layer. |
- Source
_renderingScreenNodes()
Drawing nodes
- Source
(protected) _sortLayers()
Sort visible layer - preparing for rendering.
- Source
addControl(control)
Add the given control to the renderer of the planet scene.
Name | Type | Description |
---|---|---|
control | Control | Control. |
- Source
addControls(cArr)
Add the given controls array to the renderer of the planet.
Name | Type | Description |
---|---|---|
cArr | Array.<Control> | Control array. |
- Source
addEntityCollection(entityCollection, isHiddenopt) → {RenderNode}
Adds entity collection.
Name | Type | Attributes | Description |
---|---|---|---|
entityCollection | EntityCollection | Entity collection. | |
isHidden | boolean | <optional> | If it's true that this collection has specific rendering. |
- Overrides
- Source
- Type:
- RenderNode
addLayer(layer)
Adds layer to the planet.
Name | Type | Description |
---|---|---|
layer | Layer | Layer object. |
- Source
addLayers(layers)
Adds the given layers array to the planet.
Name | Type | Description |
---|---|---|
layers | Array.<Layer> | Layers array. |
- Source
addLight(light) → {RenderNode}
Adds point light source.
Name | Type | Description |
---|---|---|
light | LightSource | Light source. |
- Overrides
- Source
- Type:
- RenderNode
addNode()
Adds node to the current hierarchy.
- Overrides
- Source
assign(renderer)
Assign render node with renderer.
Name | Type | Description |
---|---|---|
renderer | Renderer | Render node's renderer. |
- Overrides
- Source
createDefaultTextures()
Creates default textures first for the North Pole and whole globe and second for the South Pole.
- Source
destroy()
Destroy node.
- Overrides
- Source
drawNode()
Calls render frame node's callback. Used in renderer.
- Overrides
- Source
drawPickingEntityCollections(ec)
Draw entity collections picking frame.
Name | Type | Description |
---|---|---|
ec | Array.<EntityCollection> | Entity collection array. |
- Source
flyCartesian(cartesian, lookopt, upopt, amplopt, completeCallbackopt, startCallbackopt, frameCallbackopt)
Fly camera to the point.
Name | Type | Attributes | Description |
---|---|---|---|
cartesian | Vec3 | Point coordinates. | |
look | Vec3 | <optional> | Camera "look at" point. |
up | Vec3 | <optional> | Camera UP vector on the end of a flying. |
ampl | Number | <optional> | Altitude amplitude factor. |
completeCallback | function | <optional> | Call the function in the end of flight |
startCallback | function | <optional> | Call the function in the beginning |
frameCallback | function | <optional> | Each frame callback |
- Source
flyExtent(extent, heightopt, upopt, amplopt, startCallbackopt, completeCallbackopt)
Fly active camera to the view extent.
Name | Type | Attributes | Description |
---|---|---|---|
extent | Extent | Geographical extent. | |
height | Number | <optional> | Height on the end of the flight route. |
up | Vec3 | <optional> | Camera UP vector on the end of a flying. |
ampl | Number | <optional> | Altitude amplitude factor. |
startCallback | function | <optional> | Callback that calls before the flying begins. |
completeCallback | function | <optional> | Callback that calls after flying when flying is finished. |
- Source
flyLonLat(lonlat, lookopt, upopt, amplopt, completeCallbackopt, startCallbackopt, frameCallbackopt)
Fly camera to the geodetic position.
Name | Type | Attributes | Description |
---|---|---|---|
lonlat | LonLat | Fly geographical coordinates. | |
look | Vec3 | | <optional> | Camera viewpoint in the end of the flight. |
up | Vec3 | <optional> | Camera UP vector on the end of a flying. |
ampl | Number | <optional> | Altitude amplitude factor. |
completeCallback | <optional> | ||
startCallback | <optional> | ||
frameCallback | <optional> |
- Source
frame()
Render node callback. Frame function is called for each renderer activrCamera frustum.
- Source
getCartesianFromMouseTerrain() → {Vec3|undefined}
Returns mouse position cartesian coordinates on the current terrain.
- Source
- Type:
- Vec3 |
undefined
getCartesianFromPixelEllipsoid(px) → {Vec3|undefined}
Project screen coordinates to the planet ellipsoid.
Name | Type | Description |
---|---|---|
px | Vec2 | | Screen coordinates. |
- Source
- Cartesian coordinates.
- Type:
- Vec3 |
undefined
getCartesianFromPixelTerrain(px) → {Vec3|undefined}
Returns screen coordinates cartesian coordinates on the current terrain. position or null if input coordinates is outside the planet.
Name | Type | Description |
---|---|---|
px | Vec2 | Pixel screen 2d coordinates. |
- Source
- Type:
- Vec3 |
undefined
getDistanceFromPixel(px) → {number|undefined}
Returns distance from active (screen) camera to the planet terrain by screen coordinates.
Name | Type | Description |
---|---|---|
px | Vec2 | | Screen coordinates. |
- Source
- Type:
- number |
undefined
getDistanceFromPixelEllipsoid(px) → {number}
Returns distance from an active (screen) camera to the planet ellipsoid.
Name | Type | Description |
---|---|---|
px | Vec2 | Screen coordinates. |
- Source
- Type:
- number
getExtent() → {Extent}
Gets current camera view extent.
- Source
- Type:
- Extent
getHeightFactor() → {number}
Gets elevation scale.
- Source
Terrain elevation scale
- Type:
- number
getLayerByName(name) → {Layer}
Return layer by it name
Name | Type | Description |
---|---|---|
name | string | Name of the layer. og.Layer.prototype.name |
- Source
- Type:
- Layer
getLayers() → {Array.<Layer>}
- Source
Layers array.
- Type:
- Array.<Layer>
getLonLatFromPixelEllipsoid(px) → {LonLat|undefined}
Project screen coordinates to the planet ellipsoid.
Name | Type | Description |
---|---|---|
px | Vec2 | | Screen coordinates. |
- Source
- Geodetic coordinates.
- Type:
- LonLat |
undefined
getLonLatFromPixelTerrain(px) → {LonLat|undefined}
Returns geodetic coordinates on the current terrain planet by its screen coordinates. position or null if input coordinates is outside the planet.
Name | Type | Description |
---|---|---|
px | Vec2 | | Pixel screen 2d coordinates. |
- Source
- Type:
- LonLat |
undefined
getNodeByName(name) → {RenderNode}
Gets node by name in the current.
Name | Type | Description |
---|---|---|
name | string | Node name. |
- Overrides
- Source
Node object in the current node.
- Type:
- RenderNode
getPixelFromCartesian(coords) → {Vec2}
Project cartesian coordinates to screen space.
Name | Type | Description |
---|---|---|
coords | Vec3 | Cartesian coordinates. |
- Source
- Screen coordinates.
- Type:
- Vec2
getPixelFromLonLat(lonlat) → {Vec2|undefined}
Project geodetic coordinates to screen space.
Name | Type | Description |
---|---|---|
lonlat | LonLat | Geodetic coordinates. |
- Source
- Screen coordinates.
- Type:
- Vec2 |
undefined
getRayIntersectionEllipsoid(ray) → {Vec3|undefined}
Returns ray vector hit ellipsoid coordinates. If the ray doesn't hit ellipsoid it returns 'undefined'.
Name | Type | Description |
---|---|---|
ray | Ray | Ray. |
- Source
- Type:
- Vec3 |
undefined
isActive() → {Boolean}
Gets render node activity.
- Overrides
- Source
- Type:
- Boolean
memClear()
Starts clear memory thread.
- Source
preDrawNode()
Calls render frame node's callback. Used in renderer.
- Overrides
- Source
preFrame()
Render node callback.
- Source
removeEntityCollection(entityCollection)
Removes entity collection.
Name | Type | Description |
---|---|---|
entityCollection | EntityCollection | Entity collection for remove. |
- Overrides
- Source
removeLayer(layer)
Removes the given layer from the planet.
Name | Type | Description |
---|---|---|
layer | Layer | Layer to remove. |
- Source
setActive(isActive)
Rendering activation.
Name | Type | Description |
---|---|---|
isActive | boolean | Activation flag. |
- Overrides
- Source
setBaseLayer(layer)
Sets base layer coverage to the planet.
Name | Type | Description |
---|---|---|
layer | Layer | Layer object. |
- Source
setDrawMode(mode)
Sets draw mode
Name | Type | Description |
---|---|---|
mode | Number | Draw mode, such as gl.TRIANGLES, gl.TRIANGLE_STRIP, gl.LINES etc. |
- Overrides
- Source
setHeightFactor(factor)
Sets elevation scale. 1.0 is default.
Name | Type | Description |
---|---|---|
factor | number | Elevation scale. |
- Source
setTerrain(terrain)
Sets terrain provider
Name | Type | Description |
---|---|---|
terrain | EmptyTerrain | Terrain provider. |
- Source
stopDragging()
- Source
stopFlying()
Stop current flight.
- Source
updateAttributionsList()
Updates attribution lists
- Source
viewExtent(extent)
Sets camera to the planet geographical extent.
Name | Type | Description |
---|---|---|
extent | Extent | Geographical extent. |
- Source
viewExtentArr(extentArr)
Fits camera position for the view extent.
Name | Type | Description |
---|---|---|
extentArr | Array.<number> | Geographical extent array, (exactly 4 entries) where index 0 - southwest longitude, 1 - latitude southwest, 2 - longitude northeast, 3 - latitude northeast. |
- Source
viewLonLat(lonlat, lookLonLatopt, upopt)
Sets camera to the planet geographical position.
Name | Type | Attributes | Description |
---|---|---|---|
lonlat | LonLat | Camera position. | |
lookLonLat | LonLat | <optional> | Viewpoint. |
up | Vec3 | <optional> | Camera up vector. |
- Source