WorldWind

open class WorldWind @JvmOverloads constructor(gl: Kgl, val renderResourceCache: RenderResourceCache, var globe: Globe = Globe(), var tessellator: Tessellator = BasicTessellator(), var frameController: FrameController = BasicFrameController(), var frameMetrics: FrameMetrics? = null)

Main WorldWind model, containing globe, terrain, renderable layers, camera, viewport and frame rendering logic.

Constructors

Link copied to clipboard
constructor(gl: Kgl, renderResourceCache: RenderResourceCache, globe: Globe = Globe(), tessellator: Tessellator = BasicTessellator(), frameController: FrameController = BasicFrameController(), frameMetrics: FrameMetrics? = null)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
interface EventListener

Properties

Link copied to clipboard

Atmosphere altitude above ellipsoid. Used to control when objects are clipped by the far plain behind the globe.

Link copied to clipboard

Current user view point parameters: location, altitude, orientation and field of view.

Link copied to clipboard

Scale of logical pixel size to hardware display pixel size. Used to adopt general level of details to screen density.

Link copied to clipboard

Returns the minimum distance from the globe's surface necessary to make the globe's extents visible in this World Window.

Link copied to clipboard

Artificial restriction of far distance. Applied only if automatically calculated distance is grater.

Link copied to clipboard

Fog-based far-field tile detail degradation settings, snapshotted into the render context each frame. Per-engine, so multiple WorldWindows can differ.

Link copied to clipboard

Frame rendering and drawing logic implementation.

Link copied to clipboard

Helper class implementing FrameMetrics to measure performance.

Link copied to clipboard

Planet or celestial object approximated by a reference ellipsoid and elevation models.

Link copied to clipboard

The GoToAnimator used by this WorldWindow to respond to its goTo method.

Link copied to clipboard

Keep pixel scale when changing the height of viewport by adapting field of view

Link copied to clipboard

List of renderable object layers to be displayed by this WorldWind.

Link copied to clipboard

Per-frame light callback invoked when time is null. Should write a world-space unit vector pointing toward the light into RenderContext.lightDirection — e.g. a fixed camera-relative sun angle for shadows without a day/night terminator. When both time and this provider are null, the light defaults to the surface normal at the camera's foot point (scene lit from the zenith).

Link copied to clipboard

Platform-dependent GPU resource cache manager.

Link copied to clipboard

Terrain model tessellator.

Link copied to clipboard

Scene time, mirrored into RenderContext.time each frame. When set, the world light direction (RenderContext.lightDirection) follows the real sun at this moment, driving lambert shading, shadows, the atmosphere day/night terminator and star field positions.

Link copied to clipboard

Screen area occupied by this WorldWind.

Functions

Link copied to clipboard
open fun cameraAsLookAt(result: LookAt, lookAtPosition: Position? = null): LookAt

Get look at orientation and range based on current camera position and specified geographic position

Link copied to clipboard
open fun cameraFromLookAt(lookAt: LookAt)

Set camera position and orientation, based on look at position, orientation and range

Link copied to clipboard
fun cartesianToScreenPoint(point: Vec3, result: Vec2): Boolean
open fun cartesianToScreenPoint(x: Double, y: Double, z: Double, result: Vec2): Boolean

Transforms a Cartesian coordinate point to viewport coordinates.
This stores the converted point in the result argument, and returns a boolean value indicating whether the converted is successful. This returns false if the Cartesian point is clipped by either the WorldWindow's near clipping plane or far clipping plane.

Link copied to clipboard
open fun drawFrame(frame: Frame)
Link copied to clipboard
fun geographicToScreenPoint(position: Position, result: Vec2): Boolean
open fun geographicToScreenPoint(latitude: Angle, longitude: Angle, altitude: Double, result: Vec2): Boolean

Transforms a geographic position to viewport coordinates.
This stores the converted point in the result argument, and returns a boolean value indicating whether the converted is successful. This returns false if the Cartesian point is clipped by either of the WorldWindow's near clipping plane or far clipping plane.

Link copied to clipboard
open fun pickTerrainPosition(x: Double, y: Double, result: Position): Boolean

More efficient way to determine terrain position at screen point using terrain from last rendered frame.

Link copied to clipboard
open fun pixelSizeAtDistance(distance: Double): Double

Returns the height of a pixel at a given distance from the eye point. This method assumes the model of a screen composed of rectangular pixels, where pixel coordinates denote infinitely thin space between pixels. The units of the returned size are in meters per pixel.
The result of this method is undefined if the distance is negative.

Link copied to clipboard
open fun rayThroughScreenPoint(x: Double, y: Double, result: Line): Boolean

Computes a Cartesian coordinate ray that passes through a screen point.

Link copied to clipboard
open fun renderFrame(frame: Frame): Boolean
Link copied to clipboard
open fun reset()

Reset internal WorldWind state to initial values.

Link copied to clipboard

Converts a screen point to the geographic coordinates on the globe ellipsoid, ignoring terrain altitude.

Link copied to clipboard
open fun screenPointToPositionAtAltitude(x: Double, y: Double, altitude: Double, result: Position): Boolean

Converts a screen point to geographic coordinates on a surface offset upward by altitude meters from the reference ellipsoid (terrain ignored). Symmetric with geographicToScreenPoint at the same altitude, so screen deltas and geographic deltas stay consistent under perspective — used by SelectDragDetector to drag ABSOLUTE-altitude shapes without the cursor racing ahead. altitude == 0 collapses to screenPointToGroundPosition.

Link copied to clipboard
open fun setupDrawContext()

Specify the default WorldWind OpenGL state.

Link copied to clipboard
open fun setupViewport(width: Int, height: Int, density: Float)

Apply new viewport dimensions.