Members
(constant) ARCSECONDS_TO_RADIANS
(constant) AU_TO_METERS
IAU 1976 value
- Source
(constant) COMSIDE
First index is {NW,NE,SW,SE}, another one is {N,E,S,W}
- Source
(constant) DAYS_PER_JULIAN_CENTURY
Days in julian century.
- Source
(constant) DAYS_PER_JULIAN_YEAR
Days in julian year.
- Source
(constant) DEFAULT_MAX_NODES :number
Maximum created nodes count. The more nodes count the more memory usage. When the maximum node count is exceeded, memClear() will be called.
- number
- Default Value
- 400
- Source
(constant) DEGREES
(constant) DEGREES_DOUBLE
(constant) DEGREES_TO_HOURS
(constant) EARTH_GRAVITATIONAL_PARAMETER
Earth gravitational parameter product of gravitational constant G and the mass M of the Earth.
- Source
(constant) HOURS_PER_DAY
Hours in day.
- Source
(constant) HOURS_TO_DEGREES
(constant) HOURS_TO_RADIANS
(constant) J2000
Julian date of 2000 year. Epoch.
- Source
(constant) J2000_OBLIQUITY
Angle between J2000 mean equator and the ecliptic plane. 23 deg 26' 21".448 (Seidelmann, Explanatory Supplement to the Astronomical Almanac (1992), eqn 3.222-1.
- Source
(constant) LOG2
(constant) MAX
(constant) MAX32
(constant) MAX_LAT :number
Max mercator latitude.
- number
- Source
(constant) METERS_PER_UNIT :Record.<string, number>
Meters per unit lookup table.
- Record.<string, number>
- Source
(constant) MILLISECONDS_PER_DAY
Milliseconds in day.
- Source
(constant) MILLISECONDS_PER_SECOND
Milliseconds in second.
- Source
(constant) MIN
(constant) MINUTES_PER_DAY
Minutes in day.
- Source
(constant) MINUTES_PER_HOUR
Minutes in hour.
- Source
(constant) MIN_LAT :number
Min mercator latitude.
- number
- Source
(constant) MODIFIED_JULIAN_DATE_DIFFERENCE
Modified julian date difference.
- Source
Mat3
Mat3 factory.
- Source
Mat4
Mat4 factory.
- Source
(constant) NEIGHBOUR
First index is {N,E,S,W} and second is {NW,NE,SW,SE}
- Source
(constant) NOPSORD
Neighbos's opside array order. For example NW node by E side array index is 0, SE node by S side is 1.
- Source
(constant) ONE_BY_HOURS_PER_DAY
One by hours in day.
- Source
(constant) ONE_BY_MILLISECONDS_PER_DAY
One by milliseconds in day.
- Source
(constant) ONE_BY_MINUTES_PER_DAY
One by minutes in day.
- Source
(constant) ONE_BY_POLE_DOUBLE :number
One by mercator double size.
- number
- Source
(constant) ONE_BY_SECONDS_PER_DAY
One by seconds in day.
- Source
(constant) ONE_BY_SECONDS_PER_HOUR
One by seconds in hour.
- Source
(constant) ONE_BY_SECONDS_PER_MINUTE
One by seconds in minute.
- Source
(constant) OPPART
Neighbor's oposite part. For example oposite side on the east neighbor side is: [S][SE] = NE
- Source
(constant) OPSIDE
World opposite side table.
- Source
(constant) PARTOFFSET
Gets segment part left to right or up to downo ffset against neighbour side. Where 0 - no offset 1 - half segment size offset.
- Source
(constant) PICOSECOND
Seconds in picoseconds.
- Source
(constant) PI_TWO
(constant) PLANET_NAME_PREFIX :string
- string
(constant) POLE :number
Mercator size.
- number
- Source
(constant) POLE_DOUBLE :number
Double mercator size.
- number
- Source
(constant) RADIANS
(constant) RADIANS_HALF
(constant) RADIANS_TO_HOURS
(constant) SAFE
Point types
(constant) SECONDS_PER_12_HOURS
Seconds in 12 hours.
- Source
(constant) SECONDS_PER_DAY
Seconds in day.
- Source
(constant) SECONDS_PER_HOUR
Seconds in hour.
- Source
(constant) SECONDS_PER_MILLISECOND
Seconds in millisecond.
- Source
(constant) SECONDS_PER_MINUTE
Seconds in minute.
- Source
(constant) SQRT_HALF
(constant) STR2ALIGN :number
Text align options.
- number
| Name | Type | Description |
|---|---|---|
left | number | |
right | number | |
center | number |
- Source
(constant) SUN_GRAVITATIONAL_PARAMETER
Sun gravitational parameter product of gravitational constant G and the mass M of the Sun.
- Source
(constant) TDT_TAI
Terrestrial and atomic time difference.
- Source
(constant) TRACK
drawData index names
(constant) TWO_PI
(constant) Units :string
Projection units: 'degrees', 'ft', 'm' or 'km'.
- string
| Name | Type | Description |
|---|---|---|
DEGREES | string | |
FEET | string | |
METERS | string | |
KILOMETERS | string |
- Source
_currPickingColor :Array.<number>
Stores current picking rgb color.
- Array.<number>
_prevPickingColor :Array.<number>
Stores previous picked rgb color.
- Array.<number>
(constant) mars :Ellipsoid
Mars ellipsoid object.
- Source
(constant) moon :Ellipsoid
Moon ellipsoid object.
- Source
(constant) visibleExtent
- Deprecated
- Yes
(constant) wgs84 :Ellipsoid
WGS84 ellipsoid object.
- Source
Methods
DEG2RAD(degrees) → {number}
Converts degrees value to radians.
| Name | Type | Description |
|---|---|---|
degrees | number | Degree value. |
- Type:
- number
DateToTAI(date) → {JulianDate}
Converts javascript date to the atomic(TAI) julian date.
| Name | Type | Description |
|---|---|---|
date | Date | Date. |
- Source
TAI julian date
- Type:
- JulianDate
DateToUTC(date) → {JulianDate}
Converts javascript date to the universal(UTC) julian date.
| Name | Type | Description |
|---|---|---|
date | Date | Date. |
- Source
UTC julian date
- Type:
- JulianDate
Quat(xopt, yopt, zopt, wopt) → {Quat}
Creates Quat instance.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
x | Number | <optional> | 0.0 | The X component. |
y | Number | <optional> | 0.0 | The Y component. |
z | Number | <optional> | 0.0 | The Z component. |
w | Number | <optional> | 0.0 | The W component. |
- Source
- Type:
- Quat
RAD2DEG(angle) → {number}
Converts radians value to degrees.
| Name | Type | Description |
|---|---|---|
angle | number | Degree value. |
- Type:
- number
T(jd) → {number}
Returns julian days from Epoch.
| Name | Type | Description |
|---|---|---|
jd | JulianDate | Julian date. |
- Source
Days from epoch
- Type:
- number
TAItoDate(tai) → {Date}
Converts TAI julian date to the javascript date object.
| Name | Type | Description |
|---|---|---|
tai | JulianDate | TAI julian date. |
- Source
JavaScript Date object
- Type:
- Date
TAItoTDB(tai) → {JulianDate}
Converts atomic time to barycentric dynamical time.
| Name | Type | Description |
|---|---|---|
tai | JulianDate | Atomic time. |
- Source
- returns barycentric dynamical time.
- Type:
- JulianDate
TAItoUTC(tai) → {JulianDate|undefined}
Converts atomic julian date(TAI) to the coordinated universal(UTC) julian date.
| Name | Type | Description |
|---|---|---|
tai | JulianDate | TAI julian date. |
- Source
UTC julian date
- Type:
- JulianDate |
undefined
UTCtoDate(utc) → {Date}
Converts UTC julian date to the javascript date object.
| Name | Type | Description |
|---|---|---|
utc | JulianDate | UTC julian date. |
- Source
JavaScript Date object
- Type:
- Date
UTCtoTAI(jd) → {JulianDate}
Converts coordinated universal(UTC) julian date to atomic(TAI) julian date.
| Name | Type | Description |
|---|---|---|
jd | JulianDate | UTC julian date. |
- Source
TAI julian date
- Type:
- JulianDate
Vec2(xopt, yopt) → {Vec2}
Vector 2d object creator.
| Name | Type | Attributes | Description |
|---|---|---|---|
x | number | <optional> | First value. |
y | number | <optional> | Second value. |
- Source
- Type:
- Vec2
Vec3(xopt, yopt, zopt) → {Vec3}
Vector 3d object creator.
| Name | Type | Attributes | Description |
|---|---|---|---|
x | number | <optional> | Value X. |
y | number | <optional> | Value Y. |
z | number | <optional> | Value Z. |
- Source
- Type:
- Vec3
Vec4(xopt, yopt, zopt, wopt) → {Vec4}
Vector 4d object creator.
| Name | Type | Attributes | Description |
|---|---|---|---|
x | number | <optional> | First value. |
y | number | <optional> | Second value. |
z | number | <optional> | Third value. |
w | number | <optional> | Fourth value. |
- Source
- Type:
- Vec4
_entitiesConstructor(entities) → {Array.<Entity>}
Creates entity instance array.
| Name | Type | Description |
|---|---|---|
entities | Array.<Entity> | | Entity array. |
- Source
- Entity array.
- Type:
- Array.<Entity>
addDays(jd, days) → {JulianDate}
Adds days to the julian date.
| Name | Type | Description |
|---|---|---|
jd | JulianDate | Julian date. |
days | number | Days to add. |
- Source
Julian date
- Type:
- JulianDate
addHours(jd, hours) → {JulianDate}
Adds hours to the julian date.
| Name | Type | Description |
|---|---|---|
jd | JulianDate | Julian date. |
hours | number | Hours to add. |
- Source
Julian date
- Type:
- JulianDate
addMilliseconds(jd, milliseconds) → {JulianDate}
Adds milliseconds to the julian date.
| Name | Type | Description |
|---|---|---|
jd | JulianDate | Julian date. |
milliseconds | number | Milliseconds to add. |
- Source
Julian date
- Type:
- JulianDate
addMinutes(jd, minutes) → {JulianDate}
Adds minutes to the julian date.
| Name | Type | Description |
|---|---|---|
jd | JulianDate | Julian date. |
minutes | number | Minutes to add. |
- Source
Julian date
- Type:
- JulianDate
addSeconds(jd, seconds) → {JulianDate}
Adds seconds to the julian date.
| Name | Type | Description |
|---|---|---|
jd | JulianDate | Julian date. |
seconds | number | Seconds to add. |
- Source
Julian date
- Type:
- JulianDate
bezier3v(t, p0, p1, p2, p3) → {Vec3}
Performs a 3D bezier interpolation.
| Name | Type | Description |
|---|---|---|
t | number | Interpolation value. |
p0 | Vec3 | First control point. |
p1 | Vec3 | Second control point. |
p2 | Vec3 | Third control point. |
p3 | Vec3 | Fourth control point. |
- Type:
- Vec3
clamp(value, min, max) → {number}
Clamp the number.
| Name | Type | Description |
|---|---|---|
value | number | Input number. |
min | number | Minimal edge. |
max | number | Maximal edge. |
- Type:
- number
clamp(12, 1, 5)
//returns 5daysToSeconds(d) → {number}
Returns seconds in days.
| Name | Type | Description |
|---|---|---|
d | number | Days. |
- Source
Seconds
- Type:
- number
degToDec(d, m, s, popt) → {number}
Converts degrees value to decimal.
| Name | Type | Attributes | Description |
|---|---|---|---|
d | number | Degrees. | |
m | number | Minutes. | |
s | number | Seconds. | |
p | boolean | <optional> | Positive flag. False - default. |
- Type:
- number
exp2(n) → {number}
Returns two power of n.
| Name | Type | Description |
|---|---|---|
n | number | Power value. |
- Type:
- number
forwardArray(lonlatArr) → {Array.<LonLat>}
Converts geodetic coordinate array to mercator coordinate array.
| Name | Type | Description |
|---|---|---|
lonlatArr | Array.<LonLat> | LonLat array to convert. |
- Source
Converted mercator coordinates.
- Type:
- Array.<LonLat>
forward_lat(lat) → {number}
Converts degrees latitude to mercator coordinate.
| Name | Type | Description |
|---|---|---|
lat | number | Degrees geodetic latitude. |
- Source
- Type:
- number
forward_lon(lon) → {number}
Converts degrees longitude to mercator coordinate.
| Name | Type | Description |
|---|---|---|
lon | number | Degrees geodetic longitude. |
- Source
- Type:
- number
frac(x) → {number}
The frac function returns the fractional part of x, i.e. x minus floor(x).
| Name | Type | Description |
|---|---|---|
x | number | Input value. |
- Type:
- number
getAngleBetweenAzimuths(a, b) → {number}
Returns angle between two azimuths
| Name | Type | Description |
|---|---|---|
a | number | First azimuth angle |
b | number | Second azimuth angle |
- Type:
- number
getAngleDirection(a, b) → {number}
| Name | Type | Description |
|---|---|---|
a | First bearing angle | |
b | Second bearing angle |
- Type:
- number
getDayNumber(year, month, day) → {number}
Gets the date's julian day.
| Name | Type | Description |
|---|---|---|
year | number | Year. |
month | number | Month. |
day | number | Day. |
- Source
Day number
- Type:
- number
getDays(jd) → {number}
Gets days of a julian date.
| Name | Type | Description |
|---|---|---|
jd | JulianDate | julian date. |
- Source
Days
- Type:
- number
getHours(jd) → {number}
Gets hours of a julian date.
| Name | Type | Description |
|---|---|---|
jd | JulianDate | julian date. |
- Source
Hours
- Type:
- number
getMilliseconds(jd) → {number}
Gets milliseconds of a julian date.
| Name | Type | Description |
|---|---|---|
jd | JulianDate | julian date. |
- Source
Milliseconds
- Type:
- number
getMinutes(jd) → {number}
Gets minutes of a julian date.
| Name | Type | Description |
|---|---|---|
jd | JulianDate | julian date. |
- Source
Minutes
- Type:
- number
getSeconds(jd) → {number}
Gets seconds of a julian date.
| Name | Type | Description |
|---|---|---|
jd | JulianDate | julian date. |
- Source
Seconds
- Type:
- number
getSunPosition(jDate) → {Vec3}
Returns Sun position in the geocentric coordinate system by the time.
| Name | Type | Description |
|---|---|---|
jDate | JulianDate | Julian date time. |
- Source
- Sun geocentric coordinates.
- Type:
- Vec3
getTileX(lon, zoom) → {number}
Returns mercator map tile grid horizontal coordinate index by geodetic longitude and zoom level. Where top left corner of the grid is 0 coordinate index.
| Name | Type | Description |
|---|---|---|
lon | number | Geodetic degrees longitude. |
zoom | number | Zoom level. |
- Source
- Type:
- number
getTileY(lat, zoom) → {number}
Returns mercator map tile grid vertical coordinate index by geodetic latitude and zoom level. Where top left corner of the grid is 0 coordinate index.
| Name | Type | Description |
|---|---|---|
lat | number | Geodetic degrees latitude. |
zoom | number | Zoom level. |
- Source
- Type:
- number
inverse_lat(lat) → {number}
Converts mercator latitude to degrees coordinate.
| Name | Type | Description |
|---|---|---|
lat | number | Mercator latitude. |
- Source
- Type:
- number
inverse_lon(lon) → {number}
Converts mercator longitude to degrees coordinate.
| Name | Type | Description |
|---|---|---|
lon | number | Mercator longitude. |
- Source
- Type:
- number
isPowerOfTwo(x) → {boolean}
Check the number is a power of two.
| Name | Type | Description |
|---|---|---|
x | number | Input value. |
- Type:
- boolean
lerp(t, h1, h0) → {number}
Performs a linear interpolation.
| Name | Type | Description |
|---|---|---|
t | number | A value that linearly interpolates between the h0 parameter and the h1 parameter. |
h1 | number | End value. |
h0 | number | Start value. |
- Type:
- number
log(n, base) → {number}
The log function returns the power to which the base value has to be raised to produce n.
| Name | Type | Description |
|---|---|---|
n | number | Produce value. |
base | number | Base value. |
- Type:
- number
log(64, 2)
//returns 6log2(x) → {number}
Returns Math.log(x) / Math.log(2)
| Name | Type | Description |
|---|---|---|
x | number | Input value. |
- Type:
- number
mod(m, n) → {number}
The modulo operation that also works for negative dividends.
| Name | Type | Description |
|---|---|---|
m | number | The dividend. |
n | number | The divisor. |
The remainder.
- Type:
- number
negativePItoPI(a) → {number}
Returns an angle in the range -Pi <= angle <= Pi which is equivalent to the provided angle.
| Name | Type | Description |
|---|---|---|
a | number | Angle in radians. |
- Type:
- number
nextHighestPowerOfTwo(x, maxValueopt) → {number}
Returns next value that is power of two.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
x | number | Input value. | ||
maxValue | number | <optional> | 4096 | Maximal value. |
- Type:
- number
norm_lon(lon) → {number}
Clamp longitude within: -180 to +180 degrees.
| Name | Type | Description |
|---|---|---|
lon | number | Longitude. |
- Type:
- number
pow2i(n) → {number}
Returns two power of integer n.
| Name | Type | Description |
|---|---|---|
n | number | Integer power value. |
- Type:
- number
random(minopt, maxopt) → {number}
Returns random number within the bounds.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
min | number | <optional> | 0 | Minimal bound. |
max | number | <optional> | 1 | Maximal bound. |
- Type:
- number
randomi(min, max) → {number}
Returns random integer number within the bounds.
| Name | Type | Default | Description |
|---|---|---|---|
min | number | 0 | Minimal bound. |
max | number | 1 | Maximal bound. |
- Type:
- number
rev(x) → {number}
Clamp angle value within 360.
| Name | Type | Description |
|---|---|---|
x | number | Input angle. |
- Type:
- number
secondsToDays(s) → {number}
Returns days in seconds.
| Name | Type | Description |
|---|---|---|
s | number | Seconds. |
- Source
Days
- Type:
- number
slice(t, h1, h0) → {number}
Returns a slice of linear interpolation t * (h1 - h0)
| Name | Type | Description |
|---|---|---|
t | number | A value that linearly interpolates between the h0 parameter and the h1 parameter. |
h1 | number | End value. |
h0 | number | Start value. |
- Type:
- number
solve_iteration(f, x0, err, maxIter) → {number}
Solve using iteration; terminate when error is below err or the maximum number of iterations is reached. Used in Euler's equation(see og.orbit) solving.
| Name | Type | Default | Description |
|---|---|---|---|
f | function | Equation. | |
x0 | number | First approximation. | |
err | number | Maximal accepted error value. | |
maxIter | number | 50 | Maximum iterations. |
- The computed solution.
- Type:
- number
solve_iteration_fixed(f, x0, maxIter) → {number}
Solve using iteration method and a fixed number of steps.
| Name | Type | Description |
|---|---|---|
f | function | Equation. Used in Euler's equation(see og.orbit) solving. |
x0 | number | First approximation. |
maxIter | number | Maximum iterations. |
- Type:
- number
step(edge, x) → {number}
Returns 0.0 if x is smaller than edge and otherwise 1.0.
| Name | Type | Description |
|---|---|---|
edge | number | |
x | number | Value to edge. |
- Type:
- number
toKeyField()
Converts a nullable key component into a stable string field.
Used by texture resource keys to make absent/default GPU parameters explicit.
Examples:
- toKeyField("fmt", undefined) => "fmt:default"
- toKeyField("wrap", null) => "wrap:default"
- toKeyField("mime", "image/png") => "mime:image/png"
The "default" value means that the texture will be created using the default behavior of Handler.createTextureDefault(...) for this parameter.
zeroTwoPI(a) → {number}
Returns an angle in the range 0 <= angle <= 2Pi which is equivalent to the provided angle.
| Name | Type | Description |
|---|---|---|
a | number | Angle in radians |
- Type:
- number
Type Definitions
ExtentBoundingBox
- Array.<number>
HandlerEventType
- "visibilitychange" |
"resize"
- Source
QuatAxisAngle
- Object
| Name | Type | Description |
|---|---|---|
axis | Vec3 | The rotation axis. |
angle | number | The rotation angle in radians. |
- Source
Events
#load
Triggered when current tile image has loaded before rendering.
- Source
#loadend
Triggered when all tiles have loaded or loading has stopped.
- Source
baselayerchange
Triggered when the base layer changes.
- Source
changerelativecenter
Triggered when a relative center is changed
doubletouch
Triggered when double touch.
draw
Triggered before the scene frame is rendered (before render nodes).
draw
Triggered before globe frame begins to render.
- Source
forwardpass
Triggered for forward pass
forwardpass
Triggered after all
gbufferpass
Triggered for deferred opaque geometry pass
layeradd
Triggered when a layer is added to the planet.
- Source
layerloadend
Triggered when layer data finishes loading.
- Source
layerremove
Triggered when a layer is removed from the planet.
- Source
layervisibilitychange
Triggered when layer visibility changes.
- Source
lclick
Mouse left button clicked.
ldblclick
Mouse left button double-click.
ldown
Mouse left button is just pressed down (start pressing).
lhold
Mouse left button is pressing.
load
Triggered when the current tile image has loaded before rendering.
- Source
loadend
Triggered when all tiles have loaded or loading has stopped.
- Source
lup
Mouse left button up (stop pressing).
mclick
Mouse middle button clicked.
mdblclick
Mouse middle button double click.
mdown
Mouse middle button is just pressed down (start pressing).
mhold
Mouse middle button is pressing.
mouseenter
Mouse enters the work screen
mouseleave
Mouse leaves the work screen
mousemove
Mouse is moving.
mousestop
Mouse is just stopped.
mousewheel
Mouse wheel is rotated.
mup
Mouse the middle button up (stop pressing).
postdraw
Triggered after a scene frame is rendered (after render nodes).
projchanged
Triggered when camera projection is changed
rclick
Mouse right button clicked.
rdblclick
Mouse right button double click.
rdown
Mouse right button is just pressed down (start pressing).
rendercompleted
Triggered when all data is loaded.
- Source
resize
Triggered when the screen is resized.
resizeend
Triggered when the screen is resized.
rhold
Mouse right button is pressing.
rup
Mouse the right button up (stop pressing).
terraincompleted
Triggered when all terrain data is loaded.
- Source
touchcancel
Triggered when touching cancel.
touchend
Triggered when touching ends.
touchenter
Triggered when touch enter picking an object.
touchleave
Triggered when touch leaves a picked object.
touchmove
Triggered when touch is move.
touchstart
Triggered when touching starts.
transparentpass
Triggered for WOIT (transparency) pass