better types

This commit is contained in:
Thibaut Lassalle 2021-10-30 07:55:05 -07:00
parent 94c13a333a
commit 9eda4928bf
69 changed files with 846 additions and 838 deletions

View File

@ -53,7 +53,7 @@ export class Extent {
* Creates extent instance from values in array.
* @static
* @param {Array.<number>} arr - South west and north east longitude and latidudes packed in array. (exactly 4 entries)
* @return {og.Extent} Extent object.
* @return {Extent} Extent object.
*/
static createFromArray(arr) {
return new Extent(new LonLat(arr[0], arr[1]), new LonLat(arr[2], arr[3]));
@ -82,7 +82,7 @@ export class Extent {
* Creates bound extent instance by coordinate array.
* @static
* @param {Array.<Array<number>>} arr - Coordinate array. (exactly 2 entries)
* @return {og.Extent} Extent object.
* @return {Extent} Extent object.
*/
static createByCoordinatesArr(arr) {
let lonmin = math.MAX, lonmax = math.MIN,
@ -105,7 +105,7 @@ export class Extent {
* @param {number} z -
* @param {number} width -
* @param {number} height -
* @returns {og.Extent} -
* @returns {Extent} -
*/
static fromTile(x, y, z, width, height) {
width = width || mercator.POLE_DOUBLE;
@ -127,7 +127,7 @@ export class Extent {
* Sets current bounding extent object by coordinate array.
* @public
* @param {Array.<LonLat>} arr - Coordinate array.
* @return {og.Extent} Current extent.
* @return {Extent} Current extent.
*/
setByCoordinates(arr) {
let lonmin = math.MAX, lonmax = math.MIN,
@ -193,7 +193,7 @@ export class Extent {
/**
* Creates clone instance of the current extent.
* @public
* @return {og.Extent} Extent clone.
* @return {Extent} Extent clone.
*/
clone() {
return new Extent(this.southWest.clone(), this.northEast.clone());
@ -261,7 +261,7 @@ export class Extent {
/**
* Returns extents are equals.
* @param {og.Extent} extent - Extent.
* @param {Extent} extent - Extent.
* @returns {boolean} -
*/
equals(extent) {
@ -272,7 +272,7 @@ export class Extent {
/**
* Converts extent coordinates to mercator projection coordinates.
* @public
* @return {og.Extent} New instance of the current extent.
* @return {Extent} New instance of the current extent.
*/
forwardMercator() {
return new Extent(this.southWest.forwardMercator(), this.northEast.forwardMercator());
@ -281,7 +281,7 @@ export class Extent {
/**
* Converts extent coordinates from mercator projection to degrees.
* @public
* @return {og.Extent} New instance of the current extent.
* @return {Extent} New instance of the current extent.
*/
inverseMercator() {
return new Extent(this.southWest.inverseMercator(), this.northEast.inverseMercator());
@ -290,7 +290,7 @@ export class Extent {
/**
* Gets cartesian bounding bounds of the current ellipsoid.
* @public
* @param {og.Ellipsoid} ellipsoid - Ellipsoid.
* @param {Ellipsoid} ellipsoid - Ellipsoid.
* @return {Array.<number>} Cartesian 3d coordinate array. (exactly 6 entries)
*/
getCartesianBounds(ellipsoid) {

View File

@ -50,12 +50,12 @@ const PLANET_NAME_PREFIX = "globus_planet_";
*
* @param {object} options - Options:
* @param {string} options.target - HTML element id where planet canvas have to be created.
* @param {og.scene.RenderNode} [options.skybox] - Render skybox. null - default.
* @param {scene.RenderNode} [options.skybox] - Render skybox. null - default.
* @param {string} [options.name] - Planet name. Default is unic identifier.
* @param {og.terrain.Terrain} [options.terrain] - Terrain provider. Default no terrain - og.terrain.EmptyTerrain.
* @param {Array.<og.control.Control>} [options.controls] - Renderer controls array.
* @param {Array.<og.Layer>} [options.layers] - Planet layers.
* @param {og.Extent} [options.viewExtent] - Viewable starting extent.
* @param {terrain.Terrain} [options.terrain] - Terrain provider. Default no terrain - og.terrain.EmptyTerrain.
* @param {Array.<control.Control>} [options.controls] - Renderer controls array.
* @param {Array.<Layer>} [options.layers] - Planet layers.
* @param {Extent} [options.viewExtent] - Viewable starting extent.
* @param {boolean} [options.autoActivate] - Globe rendering auto activation flag. True is default.
* @param {DOMElement} [options.attributionContainer] - Container for attribution list.
* @param {Number} [options.maxGridSize] = Maximal segment grid size. 128 is default
@ -108,7 +108,7 @@ class Globe {
/**
* Interface for the renderer context(events, input states, renderer nodes etc.)
* @public
* @type {og.Renderer}
* @type {Renderer}
*/
this.renderer = new Renderer(
new Handler(_canvasId, {
@ -148,7 +148,7 @@ class Globe {
/**
* Render node renders a planet.
* @public
* @type {og.scene.Planet|og.scene.PlanetAtmosphere}
* @type {scene.Planet|og.scene.PlanetAtmosphere}
*/
// TODO:
} else {

View File

@ -43,7 +43,7 @@ class Rectangle {
/**
* Clone rectangle object.
* @public
* @returns {og.Rectangle}
* @returns {Rectangle}
*/
clone() {
return new Rectangle(this.left, this.top, this.right, this.bottom);

View File

@ -13,7 +13,7 @@ import { Vec3 } from '../math/Vec3.js';
/**
* Returns Sun position in the geocentric coordinate system by the time.
* @param {Number} jDate - Julian date time.
* @returns {og.Vec3} - Sun geocentric coordinates.
* @returns {Vec3} - Sun geocentric coordinates.
*/
export function getSunPosition(jDate) {
// http://stjarnhimlen.se/comp/tutorial.html

View File

@ -15,7 +15,7 @@ class Box {
/**
* Vertices array.
* @public
* @type{Array.<og.Vec3>}
* @type{Array.<Vec3>}
*/
this.vertices = [
new Vec3(),
@ -65,8 +65,8 @@ class Box {
/**
* Sets bounding box coordiantes by ellipsoid geodetic extend.
* @param {og.Ellipsoid} ellipsoid - Ellipsoid.
* @param {og.Extent} extent - Geodetic extent.
* @param {Ellipsoid} ellipsoid - Ellipsoid.
* @param {Extent} extent - Geodetic extent.
*/
setFromExtent(ellipsoid, extent) {
this.setFromBoundsArr(extent.getCartesianBounds(ellipsoid));

View File

@ -10,7 +10,7 @@ import { Vec3 } from '../math/Vec3.js';
* Bounding sphere class.
* @class
* @param {Number} [radius] - Bounding sphere radius.
* @param {og.Vec3} [center] - Bounding sphere coordiantes.
* @param {Vec3} [center] - Bounding sphere coordiantes.
*/
class Sphere {
/**
@ -30,7 +30,7 @@ class Sphere {
/**
* Sphere coordiantes.
* @public
* @type {og.Vec3}
* @type {Vec3}
*/
this.center = center ? center.clone() : new Vec3();
}
@ -47,8 +47,8 @@ class Sphere {
/**
* Sets bounding sphere coordiantes by ellipsoid geodetic extend.
* @param {og.Ellipsoid} ellipsoid - Ellipsoid.
* @param {og.Extent} extent - Geodetic extent.
* @param {Ellipsoid} ellipsoid - Ellipsoid.
* @param {Extent} extent - Geodetic extent.
*/
setFromExtent(ellipsoid, extent) {
this.setFromBounds(extent.getCartesianBounds(ellipsoid));

View File

@ -12,15 +12,15 @@ import { Mat4 } from "../math/Mat4.js";
/**
* Camera class.
* @class
* @param {og.Renderer} [renderer] - Renderer uses the camera instance.
* @param {Renderer} [renderer] - Renderer uses the camera instance.
* @param {Object} [options] - Camera options:
* @param {Object} [options.name] - Camera name.
* @param {number} [options.viewAngle=38] - Camera angle of view. Default is 30.0
* @param {number} [options.near=1] - Camera near plane distance. Default is 1.0
* @param {number} [options.far=og.math.MAX] - Camera far plane distance. Deafult is og.math.MAX
* @param {og.Vec3} [options.eye=[0,0,0]] - Camera eye position. Default (0,0,0)
* @param {og.Vec3} [options.look=[0,0,0]] - Camera look position. Default (0,0,0)
* @param {og.Vec3} [options.up=[0,1,0]] - Camera eye position. Default (0,1,0)
* @param {Vec3} [options.eye=[0,0,0]] - Camera eye position. Default (0,0,0)
* @param {Vec3} [options.look=[0,0,0]] - Camera look position. Default (0,0,0)
* @param {Vec3} [options.up=[0,1,0]] - Camera eye position. Default (0,1,0)
*
* @fires og.Camera#viewchange
*/
@ -29,35 +29,35 @@ class Camera {
/**
* Assigned renderer
* @public
* @type {og.Renderer}
* @type {Renderer}
*/
this.renderer = renderer;
/**
* Camera events handler
* @public
* @type {og.Events}
* @type {Events}
*/
this.events = new Events(EVENT_NAMES, this);
/**
* Camera position.
* @public
* @type {og.Vec3}
* @type {Vec3}
*/
this.eye = new Vec3();
/**
* Camera RTE high position
* @public
* @type {og.Vec3}
* @type {Vec3}
*/
this.eyeHigh = new Float32Array(3);
/**
* Camera RTE low position
* @public
* @type {og.Vec3}
* @type {Vec3}
*/
this.eyeLow = new Float32Array(3);
@ -78,35 +78,35 @@ class Camera {
/**
* Camera normal matrix.
* @protected
* @type {og.Mat3}
* @type {Mat3}
*/
this._normalMatrix = new Mat3();
/**
* Camera view matrix.
* @protected
* @type {og.Mat4}
* @type {Mat4}
*/
this._viewMatrix = new Mat4();
/**
* Camera right vector.
* @protected
* @type {og.Vec3}
* @type {Vec3}
*/
this._u = new Vec3(0.0, 1.0, 0.0); // up x n
/**
* Camera up vector.
* @protected
* @type {og.Vec3}
* @type {Vec3}
*/
this._v = new Vec3(1.0, 0.0, 0.0); // n x u - UP
/**
* Camera forward vector.
* @protected
* @type {og.Vec3}
* @type {Vec3}
*/
this._n = new Vec3(0.0, 0.0, 1.0); // eye - look - FORWARD
@ -199,14 +199,14 @@ class Camera {
/**
* Camera initialization.
* @public
* @param {og.Renderer} renderer - OpenGlobus renderer object.
* @param {Renderer} renderer - OpenGlobus renderer object.
* @param {Object} [options] - Camera options:
* @param {number} [options.viewAngle] - Camera angle of view. Default is 30.0
* @param {number} [options.near] - Camera near plane distance. Default is 1.0
* @param {number} [options.far] - Camera far plane distance. Deafult is og.math.MAX
* @param {og.Vec3} [options.eye] - Camera eye position. Default (0,0,0)
* @param {og.Vec3} [options.look] - Camera look position. Default (0,0,0)
* @param {og.Vec3} [options.up] - Camera eye position. Default (0,1,0)
* @param {Vec3} [options.eye] - Camera eye position. Default (0,0,0)
* @param {Vec3} [options.look] - Camera look position. Default (0,0,0)
* @param {Vec3} [options.up] - Camera eye position. Default (0,1,0)
*/
_init(options) {
this._setProj(this._viewAngle, this._aspect);
@ -362,10 +362,10 @@ class Camera {
/**
* Sets camera to eye position
* @public
* @param {og.Vec3} eye - Camera position
* @param {og.Vec3} look - Look point
* @param {og.Vec3} up - Camera up vector
* @returns {og.Camera} - This camera
* @param {Vec3} eye - Camera position
* @param {Vec3} look - Look point
* @param {Vec3} up - Camera up vector
* @returns {Camera} - This camera
*/
set(eye, look, up) {
this.eye.x = eye.x;
@ -386,8 +386,8 @@ class Camera {
/**
* Sets camera look point
* @public
* @param {og.Vec3} look - Look point
* @param {og.Vec3} [up] - Camera up vector otherwise camera current up vector(this._v)
* @param {Vec3} look - Look point
* @param {Vec3} [up] - Camera up vector otherwise camera current up vector(this._v)
*/
look(look, up) {
this._n.set(this.eye.x - look.x, this.eye.y - look.y, this.eye.z - look.z);
@ -478,7 +478,7 @@ class Camera {
* @public
* @param {number} x - Scren X coordinate
* @param {number} y - Scren Y coordinate
* @returns {og.Vec3} - Direction vector
* @returns {Vec3} - Direction vector
*/
unproject(x, y) {
var c = this.renderer.handler.canvas,
@ -501,8 +501,8 @@ class Camera {
/**
* Gets projected 3d point to the 2d screen coordiantes
* @public
* @param {og.Vec3} v - Cartesian 3d coordiantes
* @returns {og.Vec2} - Screen point coordinates
* @param {Vec3} v - Cartesian 3d coordiantes
* @returns {Vec2} - Screen point coordinates
*/
project(v) {
var r = this.frustums[0]._projectionViewMatrix.mulVec4(v.toVec4()),
@ -516,8 +516,8 @@ class Camera {
* @param {number} angle - Rotation angle in radians
* @param {boolean} isArc - If true camera up vector gets from current up vector every frame,
* otherwise up is always input parameter.
* @param {og.Vec3} center - Point that the camera rotates around
* @param {og.math.Vecto3} [up] - Camera up vector
* @param {Vec3} center - Point that the camera rotates around
* @param {math.Vecto3} [up] - Camera up vector
*/
rotateAround(angle, isArc, center, up) {
center = center || Vec3.ZERO;
@ -541,8 +541,8 @@ class Camera {
* @param {number} angle - Rotation angle in radians.
* @param {boolaen} isArc - If true camera up vector gets from current up vector every frame,
* otherwise up is always input parameter.
* @param {og.Vec3} center - Point that the camera rotates around.
* @param {og.Vec3} [up] - Camera up vector.
* @param {Vec3} center - Point that the camera rotates around.
* @param {Vec3} [up] - Camera up vector.
*/
rotateHorizontal(angle, isArc, center, up) {
this.rotateAround(angle, isArc, center, up);
@ -551,7 +551,7 @@ class Camera {
/**
* Rotates camera around center point by vecrtical.
* @param {number} angle - Rotation angle in radians.
* @param {og.Vec3} center - Point that the camera rotates around.
* @param {Vec3} center - Point that the camera rotates around.
*/
rotateVertical(angle, center) {
this.rotateAround(angle, false, center, this._u);
@ -560,8 +560,8 @@ class Camera {
/**
* Gets 3d size factor. Uses in LOD distance calculation.
* @public
* @param {og.Vec3} p - Far point.
* @param {og.Vec3} r - Far point.
* @param {Vec3} p - Far point.
* @param {Vec3} r - Far point.
* @returns {number} - Size factor.
*/
projectedSize(p, r) {
@ -571,7 +571,7 @@ class Camera {
/**
* Returns normal matrix.
* @public
* @returns {og.Mat3} - Normal matrix.
* @returns {Mat3} - Normal matrix.
*/
getNormalMatrix() {
return this._normalMatrix._m;
@ -580,7 +580,7 @@ class Camera {
/**
* Returns model matrix.
* @public
* @returns {og.Mat4} - View matrix.
* @returns {Mat4} - View matrix.
*/
getViewMatrix() {
return this._viewMatrix._m;
@ -601,7 +601,7 @@ class Camera {
/**
* Returns projection matrix.
* @public
* @returns {og.Mat4} - Projection matrix.
* @returns {Mat4} - Projection matrix.
*/
getProjectionMatrix() {
return this.frustum._projectionMatrix._m;
@ -610,7 +610,7 @@ class Camera {
/**
* Returns projection and model matrix product.
* @public
* @return {og.Mat4} - Projection-view matrix.
* @return {Mat4} - Projection-view matrix.
*/
getProjectionViewMatrix() {
return this.frustum._projectionViewMatrix._m;
@ -619,7 +619,7 @@ class Camera {
/**
* Returns inverse projection and model matrix product.
* @public
* @returns {og.Mat4} - Inversed projection-view matrix.
* @returns {Mat4} - Inversed projection-view matrix.
*/
getInverseProjectionViewMatrix() {
return this.frustum._inverseProjectionViewMatrix._m;
@ -628,7 +628,7 @@ class Camera {
/**
* Returns inverse projection matrix.
* @public
* @returns {og.Mat4} - Inversed projection-view matrix.
* @returns {Mat4} - Inversed projection-view matrix.
*/
getInverseProjectionMatrix() {
return this.frustum._inverseProjectionMatrix._m;

View File

@ -29,28 +29,28 @@ class Frustum {
/**
* Camera projection matrix.
* @protected
* @type {og.Mat4}
* @type {Mat4}
*/
this._projectionMatrix = new Mat4();
/**
* Camera inverse projection matrix.
* @protected
* @type {og.Mat4}
* @type {Mat4}
*/
this._inverseProjectionMatrix = new Mat4();
/**
* Product of projection and view matrices.
* @protected
* @type {og.Mat4}
* @type {Mat4}
*/
this._projectionViewMatrix = new Mat4();
/**
* Inverse projectionView Matrix.
* @protected
* @type {og.Mat4}
* @type {Mat4}
*/
this._inverseProjectionViewMatrix = new Mat4();
@ -210,7 +210,7 @@ class Frustum {
/**
* Returns true if a point in the frustum.
* @public
* @param {og.Vec3} point - Cartesian point.
* @param {Vec3} point - Cartesian point.
* @returns {boolean} -
*/
containsPoint(point) {
@ -227,7 +227,7 @@ class Frustum {
/**
* Returns true if the frustum contains a bonding sphere, but bottom plane exclude.
* @public
* @param {og.bv.Sphere} sphere - Bounding sphere.
* @param {bv.Sphere} sphere - Bounding sphere.
* @returns {boolean} -
*/
containsSphereBottomExc(sphere) {
@ -251,7 +251,7 @@ class Frustum {
/**
* Returns true if the frustum contains a bonding sphere.
* @public
* @param {og.bv.Sphere} sphere - Bounding sphere.
* @param {bv.Sphere} sphere - Bounding sphere.
* @returns {boolean} -
*/
containsSphere(sphere) {
@ -287,7 +287,7 @@ class Frustum {
/**
* Returns true if the frustum contains a bounding box.
* @public
* @param {og.bv.Box} box - Bounding box.
* @param {bv.Box} box - Bounding box.
* @returns {boolean} -
*/
containsBox(box) {

View File

@ -18,7 +18,7 @@ import { Mat4 } from "../math/Mat4.js";
* Planet camera.
* @class
* @extends {Camera}
* @param {og.RenderNode} planet - Planet render node.
* @param {RenderNode} planet - Planet render node.
* @param {Object} [options] - Planet camera options:
* @param {Object} [options.name] - Camera name.
* @param {number} [options.viewAngle=37] - Camera angle of view. Default is 35.0
@ -26,9 +26,9 @@ import { Mat4 } from "../math/Mat4.js";
* @param {number} [options.far] - Camera far plane distance. Deafult is og.math.MAX
* @param {number} [options.minAltitude] - Minimal altitude for the camera. Deafult is 1
* @param {number} [options.maxAltitude] - Maximal altitude for the camera. Deafult is 20000000
* @param {og.Vec3} [options.eye] - Camera eye position. Default (0,0,0)
* @param {og.Vec3} [options.look] - Camera look position. Default (0,0,0)
* @param {og.Vec3} [options.up] - Camera eye position. Default (0,1,0)
* @param {Vec3} [options.eye] - Camera eye position. Default (0,0,0)
* @param {Vec3} [options.look] - Camera look position. Default (0,0,0)
* @param {Vec3} [options.up] - Camera eye position. Default (0,1,0)
*/
class PlanetCamera extends Camera {
constructor(planet, options) {
@ -50,7 +50,7 @@ class PlanetCamera extends Camera {
/**
* Assigned camera's planet.
* @public
* @type {og.scene.Planet}
* @type {scene.Planet}
*/
this.planet = planet;
@ -92,14 +92,14 @@ class PlanetCamera extends Camera {
/**
* Cartesian coordinates on the terrain.
* @protected
* @type {og.Vec3}
* @type {Vec3}
*/
this._terrainPoint = new Vec3();
/**
* Quad node that camera flies over.
* @protected
* @type {og.quadTree.Node}
* @type {quadTree.Node}
*/
this._insideSegment = null;
@ -178,7 +178,7 @@ class PlanetCamera extends Camera {
* @public
* @param {LonLat} lonlat - New camera and camera view position.
* @param {LonLat} [lookLonLat] - Look up coordinates.
* @param {og.Vec3} [up] - Camera UP vector. Default (0,1,0)
* @param {Vec3} [up] - Camera UP vector. Default (0,1,0)
*/
setLonLat(lonlat, lookLonLat, up) {
this.stopFlying();
@ -211,9 +211,9 @@ class PlanetCamera extends Camera {
/**
* Gets position by viewable extent.
* @public
* @param {og.Extent} extent - Viewable extent.
* @param {Extent} extent - Viewable extent.
* @param {Number} height - Camera height
* @returns {og.Vec3}
* @returns {Vec3}
*/
getExtentPosition(extent, height) {
var north = extent.getNorth();
@ -281,7 +281,7 @@ class PlanetCamera extends Camera {
/**
* View current extent.
* @public
* @param {og.Extent} extent - Current extent.
* @param {Extent} extent - Current extent.
*/
viewExtent(extent, height) {
this.stopFlying();
@ -292,8 +292,8 @@ class PlanetCamera extends Camera {
/**
* Flies to the current extent.
* @public
* @param {og.Extent} extent - Current extent.
* @param {og.Vec3} [up] - Camera UP in the end of flying. Default - (0,1,0)
* @param {Extent} extent - Current extent.
* @param {Vec3} [up] - Camera UP in the end of flying. Default - (0,1,0)
* @param {Number} [ampl] - Altitude amplitude factor.
* @param {cameraCallback} [completeCallback] - Callback that calls after flying when flying is finished.
* @param {cameraCallback} [startCallback] - Callback that calls befor the flying begins.
@ -356,9 +356,9 @@ class PlanetCamera extends Camera {
/**
* Flies to the cartesian coordinates.
* @public
* @param {og.Vec3} cartesian - Finish cartesian coordinates.
* @param {og.Vec3} [look] - Camera LOOK in the end of flying. Default - (0,0,0)
* @param {og.Vec3} [up] - Camera UP vector in the end of flying. Default - (0,1,0)
* @param {Vec3} cartesian - Finish cartesian coordinates.
* @param {Vec3} [look] - Camera LOOK in the end of flying. Default - (0,0,0)
* @param {Vec3} [up] - Camera UP vector in the end of flying. Default - (0,1,0)
* @param {Number} [ampl=1.0] - Altitude amplitude factor.
* @param {cameraCallback} [completeCallback] - Callback that calls after flying when flying is finished.
* @param {cameraCallback} [startCallback] - Callback that calls befor the flying begins.
@ -453,8 +453,8 @@ class PlanetCamera extends Camera {
* Flies to the geo coordiantes.
* @public
* @param {LonLat} lonlat - Finish coordinates.
* @param {og.Vec3} [look] - Camera LOOK in the end of flying. Default - (0,0,0)
* @param {og.Vec3} [up] - Camera UP vector in the end of flying. Default - (0,1,0)
* @param {Vec3} [look] - Camera LOOK in the end of flying. Default - (0,0,0)
* @param {Vec3} [up] - Camera UP vector in the end of flying. Default - (0,1,0)
* @param {Number} [ampl] - Altitude amplitude factor.
* @param {cameraCallback} [completeCallback] - Callback that calls after flying when flying is finished.
* @param {cameraCallback} [startCallback] - Callback that calls befor the flying begins.

View File

@ -29,7 +29,7 @@ class Control {
/**
* Assigned renderer.
* @public
* @type {og.Renderer}
* @type {Renderer}
*/
this.renderer = null;
@ -106,7 +106,7 @@ class Control {
/**
* Assign renderer to the control.
* @public
* @type {og.Renderer}
* @type {Renderer}
*/
addTo(renderer) {
if (renderer) {

View File

@ -96,7 +96,7 @@ class EarthCoordinates extends Control {
/**
* Current position.
* @public
* @type {og.Vec3}
* @type {Vec3}
*/
this.position = null;
}

View File

@ -28,7 +28,7 @@ class Sun extends Control {
/**
* Earth planet node.
* @public
* @type {og.scene.Planet}
* @type {scene.Planet}
*/
this.planet = null;
@ -46,7 +46,7 @@ class Sun extends Control {
/**
* Light source.
* @public
* @type {og.LightSource}
* @type {LightSource}
*/
this.sunlight = null;

View File

@ -226,7 +226,7 @@ class Ellipsoid {
* Gets cartesian ECEF from Wgs84 geodetic coordiantes.
* @public
* @param {LonLat} lonlat - Degrees geodetic coordiantes.
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
lonLatToCartesian(lonlat) {
var latrad = math.RADIANS * lonlat.lat,
@ -247,8 +247,8 @@ class Ellipsoid {
* Gets cartesian ECEF from Wgs84 geodetic coordiantes.
* @public
* @param {LonLat} lonlat - Degrees geodetic coordiantes.
* @param {og.Vec3} res - Output result.
* @returns {og.Vec3} -
* @param {Vec3} res - Output result.
* @returns {Vec3} -
*/
lonLatToCartesianRes(lonlat, res) {
var latrad = math.RADIANS * lonlat.lat,
@ -272,7 +272,7 @@ class Ellipsoid {
* @param {Number} lon - Longitude.
* @param {Number} lat - Latitude.
* @param {Number} height - Height.
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
geodeticToCartesian(lon, lat, height = 0) {
var latrad = math.RADIANS * lat,
@ -292,7 +292,7 @@ class Ellipsoid {
/**
* Gets Wgs84 geodetic coordiantes from cartesian ECEF.
* @public
* @param {og.Vec3} cartesian - Cartesian coordinates.
* @param {Vec3} cartesian - Cartesian coordinates.
* @returns {LonLat} -
*/
cartesianToLonLat(cartesian) {
@ -321,8 +321,8 @@ class Ellipsoid {
/**
* Gets ellipsoid surface normal.
* @public
* @param {og.Vec3} coord - Spatial coordiantes.
* @returns {og.Vec3} -
* @param {Vec3} coord - Spatial coordiantes.
* @returns {Vec3} -
*/
getSurfaceNormal3v(coord) {
var r2 = this._invRadii2;
@ -403,9 +403,9 @@ class Ellipsoid {
* Returns ray vector hit ellipsoid coordinates.
* If the ray doesn't hit ellipsoid returns null.
* @public
* @param {og.Vec3} origin - Ray origin point.
* @param {og.Vec3} direction - Ray direction.
* @returns {og.Vec3} -
* @param {Vec3} origin - Ray origin point.
* @param {Vec3} direction - Ray direction.
* @returns {Vec3} -
*/
hitRay(origin, direction) {

View File

@ -8,6 +8,6 @@ import { Ellipsoid } from './Ellipsoid.js';
/**
* WGS84 ellipsoid object.
* @type {og.Ellipsoid}
* @type {Ellipsoid}
*/
export const wgs84 = new Ellipsoid(6378137.000, 6356752.3142);

View File

@ -11,11 +11,11 @@ import { Vec3 } from '../math/Vec3.js';
* Base prototype for billboard and label classes.
* @class
* @param {Object} [options] - Options:
* @param {og.Vec3|Array.<number>} [options.position] - Billboard spatial position.
* @param {Vec3|Array.<number>} [options.position] - Billboard spatial position.
* @param {number} [options.rotation] - Screen angle rotaion.
* @param {og.Vec4|string|Array.<number>} [options.color] - Billboard color.
* @param {og.Vec3|Array.<number>} [options.alignedAxis] - Billboard aligned vector.
* @param {og.Vec3|Array.<number>} [options.offset] - Billboard center screen offset.
* @param {Vec4|string|Array.<number>} [options.color] - Billboard color.
* @param {Vec3|Array.<number>} [options.alignedAxis] - Billboard aligned vector.
* @param {Vec3|Array.<number>} [options.offset] - Billboard center screen offset.
* @param {boolean} [options.visibility] - Visibility.
*/
class BaseBillboard {
@ -33,7 +33,7 @@ class BaseBillboard {
/**
* Billboard center cartesian position.
* @protected
* @type {og.Vec3}
* @type {Vec3}
*/
this._position = utils.createVector3(options.position);
@ -53,21 +53,21 @@ class BaseBillboard {
/**
* RGBA color.
* @protected
* @type {og.Vec4}
* @type {Vec4}
*/
this._color = utils.createColorRGBA(options.color);
/**
* Cartesian aligned axis vector.
* @protected
* @type {og.Vec3}
* @type {Vec3}
*/
this._alignedAxis = utils.createVector3(options.alignedAxis);
/**
* Billboard center screen space offset. Where x,y - screen space offset and z - depth offset.
* @protected
* @type {og.math.Vecto3}
* @type {math.Vecto3}
*/
this._offset = utils.createVector3(options.offset);
@ -81,14 +81,14 @@ class BaseBillboard {
/**
* Entity instance that holds this billboard.
* @protected
* @type {og.Entity}
* @type {Entity}
*/
this._entity = null;
/**
* Handler that stores and renders this billboard object.
* @protected
* @type {og.BillboardHandler}
* @type {BillboardHandler}
*/
this._handler = null;
@ -129,7 +129,7 @@ class BaseBillboard {
/**
* Sets billboard position.
* @public
* @param {og.Vec3} position - Cartesian coordinates.
* @param {Vec3} position - Cartesian coordinates.
*/
setPosition3v(position) {
this._position.x = position.x;
@ -142,7 +142,7 @@ class BaseBillboard {
/**
* Returns billboard position.
* @public
* @returns {og.Vec3}
* @returns {Vec3}
*/
getPosition() {
return this._position;
@ -165,7 +165,7 @@ class BaseBillboard {
/**
* Sets screen space offset.
* @public
* @param {og.Vec2} offset - Offset size.
* @param {Vec2} offset - Offset size.
*/
setOffset3v(offset) {
this._offset.x = offset.x;
@ -177,7 +177,7 @@ class BaseBillboard {
/**
* Returns billboard screen space offset size.
* @public
* @returns {og.Vec3}
* @returns {Vec3}
*/
getOffset() {
return this._offset;
@ -231,7 +231,7 @@ class BaseBillboard {
/**
* Sets RGBA color. Each channel from 0.0 to 1.0.
* @public
* @param {og.Vec4} color - RGBA vector.
* @param {Vec4} color - RGBA vector.
*/
setColor4v(color) {
this._color.x = color.x;
@ -253,7 +253,7 @@ class BaseBillboard {
/**
* Returns RGBA color.
* @public
* @returns {og.Vec4}
* @returns {Vec4}
*/
getColor() {
return this._color;
@ -295,7 +295,7 @@ class BaseBillboard {
/**
* Sets billboard aligned vector.
* @public
* @param {og.math.Vecto3} alignedAxis - Vector to align.
* @param {math.Vecto3} alignedAxis - Vector to align.
*/
setAlignedAxis3v(alignedAxis) {
this._alignedAxis.x = alignedAxis.x;
@ -307,7 +307,7 @@ class BaseBillboard {
/**
* Returns aligned vector.
* @public
* @returns {og.Vec3}
* @returns {Vec3}
*/
getAlignedAxis() {
return this._alignedAxis;
@ -325,7 +325,7 @@ class BaseBillboard {
/**
* Sets billboard picking color.
* @public
* @param {og.Vec3} color - Picking color.
* @param {Vec3} color - Picking color.
*/
setPickingColor3v(color) {
this._handler && this._handler.setPickingColorArr(this._handlerIndex, color);

View File

@ -11,11 +11,11 @@ import { BaseBillboard } from './BaseBillboard.js';
* @class
* @extends {BaseBillboard}
* @param {Object} [options] - Options:
* @param {og.Vec3|Array.<number>} [options.position] - Billboard spatial position.
* @param {Vec3|Array.<number>} [options.position] - Billboard spatial position.
* @param {number} [options.rotation] - Screen angle rotaion.
* @param {og.Vec4|string|Array.<number>} [options.color] - Billboard color.
* @param {og.Vec3|Array.<number>} [options.alignedAxis] - Billboard aligned vector.
* @param {og.Vec3|Array.<number>} [options.offset] - Billboard center screen offset.
* @param {Vec4|string|Array.<number>} [options.color] - Billboard color.
* @param {Vec3|Array.<number>} [options.alignedAxis] - Billboard aligned vector.
* @param {Vec3|Array.<number>} [options.offset] - Billboard center screen offset.
* @param {boolean} [options.visibility] - Visibility.
* @param {string} [options.src] - Billboard image url source.
* @param {Image} [options.image] - Billboard image object.

View File

@ -25,7 +25,7 @@ import { Vec3 } from '../math/Vec3.js';
* @class
* @param {Object} [options] - Entity options:
* @param {string} [options.name] - A human readable name to display to users. It does not have to be unique.
* @param {og.Vec3|Array.<number>} [options.cartesian] - Spatial entities like billboard, label, sphere etc. cartesian position.
* @param {Vec3|Array.<number>} [options.cartesian] - Spatial entities like billboard, label, sphere etc. cartesian position.
* @param {LonLat} [options.lonlat] - Geodetic coordiantes for an entities like billboard, label, sphere etc.
* @param {boolean} [options.aground] - True for entities that have to be placed on the relief.
* @param {boolean} [options.visibility] - Entity visibility.
@ -70,21 +70,21 @@ class Entity {
/**
* Children entities.
* @public
* @type {Array.<og.Entity>}
* @type {Array.<Entity>}
*/
this.childrenNodes = [];
/**
* Parent entity.
* @public
* @type {og.Entity}
* @type {Entity}
*/
this.parent = null;
/**
* Entity cartesian position.
* @protected
* @type {og.Vec3}
* @type {Vec3}
*/
this._cartesian = utils.createVector3(options.cartesian);
@ -119,7 +119,7 @@ class Entity {
/**
* Entity collection that this entity belongs to.
* @protected
* @type {og.EntityCollection}
* @type {EntityCollection}
*/
this._entityCollection = null;
@ -133,7 +133,7 @@ class Entity {
/**
* Assigned vector layer pointer.
* @protected
* @type {og.layer.Vector}
* @type {layer.Vector}
*/
this._layer = null;
@ -147,7 +147,7 @@ class Entity {
/**
* Picking color.
* @protected
* @type {og.Vec3}
* @type {Vec3}
*/
this._pickingColor = new Vec3(0, 0, 0);
@ -166,56 +166,56 @@ class Entity {
/**
* Billboard entity.
* @public
* @type {og.Billboard}
* @type {Billboard}
*/
this.billboard = this._createOptionFeature('billboard', options.billboard);
/**
* Text label entity.
* @public
* @type {og.Label}
* @type {Label}
*/
this.label = this._createOptionFeature('label', options.label);
/**
* Shape entity.
* @public
* @type {og.shape.BaseShape}
* @type {shape.BaseShape}
*/
this.shape = this._createOptionFeature('sphere', options.sphere || options.box);
/**
* Polyline entity.
* @public
* @type {og.Polyline}
* @type {Polyline}
*/
this.polyline = this._createOptionFeature('polyline', options.polyline);
/**
* Ray entity.
* @public
* @type {og.ray}
* @type {ray}
*/
this.ray = this._createOptionFeature('ray', options.ray);
/**
* PointCloud entity.
* @public
* @type {og.PointCloud}
* @type {PointCloud}
*/
this.pointCloud = this._createOptionFeature('pointCloud', options.pointCloud);
/**
* Geometry entity(available for vector layer only).
* @public
* @type {og.Geometry}
* @type {Geometry}
*/
this.geometry = this._createOptionFeature('geometry', options.geometry);
/**
* Strip entity.
* @public
* @type {og.Strip}
* @type {Strip}
*/
this.strip = this._createOptionFeature('strip', options.strip);
}
@ -250,9 +250,9 @@ class Entity {
/**
* Adds current entity into the specified entity collection.
* @public
* @param {og.EntityCollection|og.layer.Vector} collection - Specified entity collection or vector layer.
* @param {EntityCollection|og.layer.Vector} collection - Specified entity collection or vector layer.
* @param {Boolean} [rightNow=false] - Entity insertion option for vector layer.
* @returns {og.Entity} - This object.
* @returns {Entity} - This object.
*/
addTo(collection, rightNow) {
collection.add(this, rightNow);
@ -311,7 +311,7 @@ class Entity {
/**
* Sets entity cartesian position.
* @public
* @param {og.Vec3} cartesian - Cartesian position in 3d space.
* @param {Vec3} cartesian - Cartesian position in 3d space.
*/
setCartesian3v(cartesian) {
this.setCartesian(cartesian.x, cartesian.y, cartesian.z);
@ -364,7 +364,7 @@ class Entity {
/**
* Sets entity cartesian position without event dispatching.
* @protected
* @param {og.Vec3} cartesian - Cartesian position in 3d space.
* @param {Vec3} cartesian - Cartesian position in 3d space.
* @param {boolean} skipLonLat - skip geodetic calculation.
*/
_setCartesian3vSilent(cartesian, skipLonLat) {
@ -458,7 +458,7 @@ class Entity {
/**
* Returns carteain position.
* @public
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
getCartesian() {
return this._cartesian.clone();
@ -467,8 +467,8 @@ class Entity {
/**
* Sets entity billboard.
* @public
* @param {og.Billboard} billboard - Billboard object.
* @returns {og.Billboard} -
* @param {Billboard} billboard - Billboard object.
* @returns {Billboard} -
*/
setBillboard(billboard) {
if (this.billboard) {
@ -485,8 +485,8 @@ class Entity {
/**
* Sets entity label.
* @public
* @param {og.Label} label - Text label.
* @returns {og.Label} -
* @param {Label} label - Text label.
* @returns {Label} -
*/
setLabel(label) {
if (this.label) {
@ -503,8 +503,8 @@ class Entity {
/**
* Sets entity ray.
* @public
* @param {og.Ray} ray - Ray object.
* @returns {og.Ray} -
* @param {Ray} ray - Ray object.
* @returns {Ray} -
*/
setRay(ray) {
if (this.ray) {
@ -520,8 +520,8 @@ class Entity {
/**
* Sets entity shape.
* @public
* @param {og.BaseShape} shape - Shape object.
* @returns {og.Polyline} -
* @param {BaseShape} shape - Shape object.
* @returns {Polyline} -
*/
setShape(shape) {
if (this.shape) {
@ -538,8 +538,8 @@ class Entity {
/**
* Sets entity polyline.
* @public
* @param {og.Polyline} polyline - Polyline object.
* @returns {og.Polyline} -
* @param {Polyline} polyline - Polyline object.
* @returns {Polyline} -
*/
setPolyline(polyline) {
if (this.polyline) {
@ -555,8 +555,8 @@ class Entity {
/**
* Sets entity pointCloud.
* @public
* @param {og.PointCloud} pointCloud - PointCloud object.
* @returns {og.PointCloud} -
* @param {PointCloud} pointCloud - PointCloud object.
* @returns {PointCloud} -
*/
setPointCloud(pointCloud) {
if (this.pointCloud) {
@ -572,8 +572,8 @@ class Entity {
/**
* Sets entity geometry.
* @public
* @param {og.Geometry} geometry - Geometry object.
* @returns {og.Geometry} -
* @param {Geometry} geometry - Geometry object.
* @returns {Geometry} -
*/
setGeometry(geometry) {
if (this.geometry) {
@ -589,8 +589,8 @@ class Entity {
/**
* Sets entity strip.
* @public
* @param {og.Strip} strip - Strip object.
* @returns {og.Strip} -
* @param {Strip} strip - Strip object.
* @returns {Strip} -
*/
setStrip(strip) {
if (this.strip) {
@ -618,7 +618,7 @@ class Entity {
/**
* Append child entity.
* @public
* @param {og.Entity} entity - Child entity.
* @param {Entity} entity - Child entity.
*/
appendChild(entity) {
entity._entityCollection = this._entityCollection;
@ -661,7 +661,7 @@ class Entity {
/**
* Return geodethic extent.
* @returns {og.Extent} -
* @returns {Extent} -
*/
getExtent() {
var res;

View File

@ -19,7 +19,7 @@ import { ShapeHandler } from './ShapeHandler.js';
* Entity collection provide handlers for an each type of entity like billboard, label or 3ds object.
* @constructor
* @param {Object} [options] - Entity options:
* @param {Array.<og.Entity>} [options.entities] - Entities array.
* @param {Array.<Entity>} [options.entities] - Entities array.
* @param {boolean} [options.visibility=true] - Entity visibility.
* @param {Array.<number>} [options.scaleByDistance] - Entity scale by distance parameters. (exactly 3 entries)
* First index - near distance to the entity, after entity becomes full scale.
@ -85,7 +85,7 @@ class EntityCollection {
/**
* Render node context.
* @public
* @type {og.scene.RenderNode}
* @type {scene.RenderNode}
*/
this.renderNode = null;
@ -113,49 +113,49 @@ class EntityCollection {
/**
* Billboards handler
* @public
* @type {og.BillboardHandler}
* @type {BillboardHandler}
*/
this.billboardHandler = new BillboardHandler(this);
/**
* Labels handler
* @public
* @type {og.LabelHandler}
* @type {LabelHandler}
*/
this.labelHandler = new LabelHandler(this, options.labelMaxLetters);
/**
* Shape handler
* @public
* @type {og.ShapeHandler}
* @type {ShapeHandler}
*/
this.shapeHandler = new ShapeHandler(this);
/**
* Polyline handler
* @public
* @type {og.PolylineHandler}
* @type {PolylineHandler}
*/
this.polylineHandler = new PolylineHandler(this);
/**
* Ray handler
* @public
* @type {og.RayHandler}
* @type {RayHandler}
*/
this.rayHandler = new RayHandler(this);
/**
* PointCloud handler
* @public
* @type {og.PointCloudHandler}
* @type {PointCloudHandler}
*/
this.pointCloudHandler = new PointCloudHandler(this);
/**
* Strip handler
* @public
* @type {og.StripHandler}
* @type {StripHandler}
*/
this.stripHandler = new StripHandler(this);
@ -166,7 +166,7 @@ class EntityCollection {
/**
* Entities array.
* @protected
* @type {Array.<og.Entity>}
* @type {Array.<Entity>}
*/
this._entities = [];
@ -198,7 +198,7 @@ class EntityCollection {
/**
* Entity collection events handler.
* @public
* @type {og.Events}
* @type {Events}
*/
this.events = new Events(EVENT_NAMES, this);
@ -328,8 +328,8 @@ class EntityCollection {
/**
* Adds entity to the collection and returns collection.
* @public
* @param {og.Entity} entity - Entity.
* @returns {og.EntityCollection} -
* @param {Entity} entity - Entity.
* @returns {EntityCollection} -
*/
add(entity) {
if (!entity._entityCollection) {
@ -352,8 +352,8 @@ class EntityCollection {
/**
* Adds entities array to the collection and returns collection.
* @public
* @param {Array.<og.Entity>} entities - Entities array.
* @returns {og.EntityCollection} -
* @param {Array.<Entity>} entities - Entities array.
* @returns {EntityCollection} -
*/
addEntities(entities) {
for (let i = 0, len = entities.length; i < len; i++) {
@ -365,7 +365,7 @@ class EntityCollection {
/**
* Returns true if the entity belongs this collection, otherwise returns false.
* @public
* @param {og.Entity} entity - Entity.
* @param {Entity} entity - Entity.
* @returns {boolean} -
*/
belongs(entity) {
@ -405,7 +405,7 @@ class EntityCollection {
/**
* Removes entity from this collection.
* @public
* @param {og.Entity} entity - Entity to remove.
* @param {Entity} entity - Entity to remove.
*/
removeEntity(entity) {
this._entities.splice(entity._entityCollectionIndex, 1);
@ -468,9 +468,9 @@ class EntityCollection {
/**
* Adds this collection to render node.
* @public
* @param {og.scene.RenderNode} renderNode - Render node.
* @param {scene.RenderNode} renderNode - Render node.
* @param {boolean} [isHidden] - Uses in vector layers that render in planet render specific function.
* @returns {og.EntityCollection} -
* @returns {EntityCollection} -
*/
addTo(renderNode, isHidden) {
if (!this.renderNode) {
@ -490,7 +490,7 @@ class EntityCollection {
/**
* This function is called in the RenderNode assign function.
* @param {og.RenderNode} renderNode
* @param {RenderNode} renderNode
*/
bindRenderNode(renderNode) {
@ -514,7 +514,7 @@ class EntityCollection {
/**
* Updates coordiantes all lonLat entities in collection after collecction attached to the planet node.
* @private
* @param {og.Ellipsoid} ellipsoid - Globe ellipsoid.
* @param {Ellipsoid} ellipsoid - Globe ellipsoid.
*/
_updateGeodeticCoordinates(ellipsoid) {
var e = this._entities;
@ -571,7 +571,7 @@ class EntityCollection {
/**
* Gets entity array.
* @public
* @returns {Array.<og.Entity>} -
* @returns {Array.<Entity>} -
*/
getEntities() {
return [].concat(this._entities);
@ -622,7 +622,7 @@ class EntityCollection {
/**
* Clears entity recursevely.
* @private
* @param {og.Entity} entity - Entity to clear.
* @param {Entity} entity - Entity to clear.
*/
_clearEntity(entity) {
entity._entityCollection = null;

View File

@ -27,7 +27,7 @@ class Geometry {
/**
* Entity instance that holds this geometry.
* @protected
* @type {og.Entity}
* @type {Entity}
*/
this._entity = null;
@ -96,7 +96,7 @@ class Geometry {
@static
@param {Object} geometryObj - GeoJSON style geometry feature.
@param {LonLat[]} outCoordinates - Geometry feature coordinates clone.
@returns {og.Extent} -
@returns {Extent} -
*/
static getExtent(geometryObj, outCoordinates) {
var res = new Extent(new LonLat(180.0, 90.0), new LonLat(-180.0, -90.0));

View File

@ -253,7 +253,7 @@ class GeometryHandler {
/**
* @public
* @param {og.Geometry} geometry - Geometry object.
* @param {Geometry} geometry - Geometry object.
*/
add(geometry) {
//

View File

@ -30,11 +30,11 @@ const STR2ALIGN = {
* @class
* @extends {BaseBillboard}
* @param {Object} [options] - Label options:
* @param {og.Vec3|Array.<number>} [options.position] - Billboard spatial position.
* @param {Vec3|Array.<number>} [options.position] - Billboard spatial position.
* @param {number} [options.rotation] - Screen angle rotaion.
* @param {og.Vec4|string|Array.<number>} [options.color] - Billboard color.
* @param {og.Vec3|Array.<number>} [options.alignedAxis] - Billboard aligned vector.
* @param {og.Vec3|Array.<number>} [options.offset] - Billboard center screen offset.
* @param {Vec4|string|Array.<number>} [options.color] - Billboard color.
* @param {Vec3|Array.<number>} [options.alignedAxis] - Billboard aligned vector.
* @param {Vec3|Array.<number>} [options.offset] - Billboard center screen offset.
* @param {boolean} [options.visibility] - Visibility.
* @param {string} [options.text] - Text string.
* @param {string} [options.face] - HTML5 font face.
@ -42,8 +42,8 @@ const STR2ALIGN = {
* @param {string} [options.style] - HTML5 font style. Example 'normal', 'italic'.
* @param {string} [options.weight] - HTML5 font weight. Example 'normal', 'bold'.
* @param {number} [options.outline] - Text outline size. 0 - no outline, 1 - maximum outline. Default 0.58.
* @param {og.Vec4|string|Array.<number>} [options.outlineColor] - Outline color.
* @param {og.Label.ALIGN} [options.align] - Text horizontal align: "left", "right" and "center".
* @param {Vec4|string|Array.<number>} [options.outlineColor] - Outline color.
* @param {Label.ALIGN} [options.align] - Text horizontal align: "left", "right" and "center".
*/
class Label extends BaseBillboard {
constructor(options) {
@ -82,14 +82,14 @@ class Label extends BaseBillboard {
/**
* Label outline color.
* @private
* @type {og.Vec4}
* @type {Vec4}
*/
this._outlineColor = utils.createColorRGBA(options.outlineColor, new Vec4(0.0, 0.0, 0.0, 1.0));
/**
* Text horizontal align: "left", "right" and "center".
* @private
* @type {og.Label.ALIGN}
* @type {Label.ALIGN}
*/
this._align = options.align ? STR2ALIGN[options.align.trim().toLowerCase()] || ALIGN.RIGHT : ALIGN.RIGHT;
@ -103,7 +103,7 @@ class Label extends BaseBillboard {
/**
* Font atlas pointer.
* @private
* @type {og.utils.FontAtlas}
* @type {utils.FontAtlas}
*/
this._fontAtlas = null;
}
@ -131,7 +131,7 @@ class Label extends BaseBillboard {
/**
* Sets label text align. Could be center, left or right. Left is default.
* @public
* @param {og.Label.ALIGN} align - Text align.
* @param {Label.ALIGN} align - Text align.
*/
setAlign(align) {
this._align = STR2ALIGN[align.trim().toLowerCase()];
@ -141,7 +141,7 @@ class Label extends BaseBillboard {
/**
* Gets label text current alignment.
* @public
* @returns {og.Label.ALIGN}
* @returns {Label.ALIGN}
*/
getAlign() {
return this._align;
@ -235,7 +235,7 @@ class Label extends BaseBillboard {
/**
* Sets text outline color.
* @public
* @param {og.Vec4} rgba - Color vector.
* @param {Vec4} rgba - Color vector.
*/
setOutlineColor4v(rgba) {
this._outlineColor.x = rgba.x;
@ -257,7 +257,7 @@ class Label extends BaseBillboard {
/**
* Gets outline color vector.
* @public
* @returns {og.Vec4}
* @returns {Vec4}
*/
getOutlineColor() {
return this._outlineColor;
@ -304,7 +304,7 @@ class Label extends BaseBillboard {
/**
* Assigns font atlas and update.
* @public
* @param {og.utils.FontAtlas} fontAtlas - Font atlas.
* @param {utils.FontAtlas} fontAtlas - Font atlas.
*/
assignFontAtlas(fontAtlas) {
!this._fontAtlas && (this._fontAtlas = fontAtlas);

View File

@ -68,14 +68,14 @@ class PointCloud {
/**
* Parent collection render node.
* @private
* @type {og.scene.RenderNode}
* @type {scene.RenderNode}
*/
this._renderNode = null;
/**
* Entity instance that holds this point cloud.
* @private
* @type {og.Entity}
* @type {Entity}
*/
this._entity = null;
@ -114,7 +114,7 @@ class PointCloud {
/**
* Handler that stores and renders this object.
* @private
* @type {og.PointCloudHandler}
* @type {PointCloudHandler}
*/
this._handler = null;
this._handlerIndex = -1;
@ -189,7 +189,7 @@ class PointCloud {
/**
* Assign rendering scene node.
* @public
* @param {og.scene.RenderNode} renderNode - Assigned render node.
* @param {scene.RenderNode} renderNode - Assigned render node.
*/
setRenderNode(renderNode) {
this._renderNode = renderNode;

View File

@ -19,21 +19,21 @@ class PointCloudHandler {
/**
* Parent collection
* @private
* @type {og.EntityCollection}
* @type {EntityCollection}
*/
this._entityCollection = entityCollection;
/**
* Renderer
* @private
* @type {og.Renderer}
* @type {Renderer}
*/
this._renderer = null;
/**
* Point cloud array
* @private
* @type {Array.<og.PointCloud>}
* @type {Array.<PointCloud>}
*/
this._pointClouds = [];

View File

@ -32,7 +32,7 @@ const A = 3;
* @param {Object} [options] - Polyline options:
* @param {number} [options.thickness] - Thickness in screen pixels 1.5 is default.
* @param {Number} [options.altitude] - Relative to ground layers altitude value.
* @param {og.Vec4} [options.color] - RGBA color.
* @param {Vec4} [options.color] - RGBA color.
* @param {Boolean} [options.opacity] - Line opacity.
* @param {Boolean} [options.visibility] - Polyline visibility. True default.
* @param {Boolean} [options.isClosed] - Closed geometry type identificator.
@ -88,7 +88,7 @@ class Polyline {
/**
* Polyline cartesian coordinates.
* @private
* @type {Array.<og.Vec3>}
* @type {Array.<Vec3>}
*/
this._path3v = [];
@ -113,7 +113,7 @@ class Polyline {
/**
* Polyline geodetic extent.
* @protected
* @type {og.Extent}
* @type {Extent}
*/
this._extent = new Extent();
@ -136,14 +136,14 @@ class Polyline {
/**
* Entity instance that holds this Polyline.
* @private
* @type {og.Entity}
* @type {Entity}
*/
this._entity = null;
/**
* Handler that stores and renders this Polyline object.
* @private
* @type {og.PolylineHandler}
* @type {PolylineHandler}
*/
this._handler = null;
this._handlerIndex = -1;
@ -183,11 +183,11 @@ class Polyline {
* @param {Number[]} outVertices - Out vertices data array.
* @param {Number[]} outOrders - Out vertices orders data array.
* @param {Number[]} outIndexes - Out vertices indexes data array.
* @param {og.Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
* @param {Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
* @param {Array.<Array.<LonLat>>} [outTransformedPathLonLat] - Geodetic coordinates out array.
* @param {Array.<Array.<LonLat>>} [outPath3v] - Cartesian coordinates out array.
* @param {Array.<Array.<LonLat>>} [outTransformedPathMerc] - Mercator coordinates out array.
* @param {og.Extent} [outExtent] - Geodetic line extent.
* @param {Extent} [outExtent] - Geodetic line extent.
* @param {Array} [outColors]
* @static
*/
@ -454,11 +454,11 @@ class Polyline {
* @param {Number[]} outVertices - Out vertices data array.
* @param {Number[]} outOrders - Out vertices orders data array.
* @param {Number[]} outIndexes - Out vertices indexes data array.
* @param {og.Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
* @param {Ellipsoid} [ellipsoid] - Ellipsoid to coordinates transformation.
* @param {Array.<Array.<LonLat>>} [outTransformedPathLonLat] - Geodetic coordinates out array.
* @param {Array.<Array.<LonLat>>} [outPath3v] - Cartesian coordinates out array.
* @param {Array.<Array.<LonLat>>} [outTransformedPathMerc] - Mercator coordinates out array.
* @param {og.Extent} [outExtent] - Geodetic line extent.
* @param {Extent} [outExtent] - Geodetic line extent.
* @static
*/
static appendPoint3v(
@ -706,11 +706,11 @@ class Polyline {
* @param {Number[]} outVertices - Out vertices data array.
* @param {Number[]} outOrders - Out vertices orders data array.
* @param {Number[]} outIndexes - Out indexes data array.
* @param {og.Ellipsoid} ellipsoid - Ellipsoid to coordinates transformation.
* @param {Ellipsoid} ellipsoid - Ellipsoid to coordinates transformation.
* @param {Array.<Array.<number>>} outTransformedPathCartesian - Cartesian coordinates out array. [[0,0,0], [1,1,1],...]
* @param {Array.<Array.<LonLat>>} outPathLonLat - Geographic coordinates out array.
* @param {Array.<Array.<LonLat>>} outTransformedPathMerc - Mercator coordinates out array.
* @param {og.Extent} outExtent - Geodetic line extent.
* @param {Extent} outExtent - Geodetic line extent.
* @static
*/
static appendLineDataLonLat(
@ -1579,7 +1579,7 @@ class Polyline {
/**
* Adds a new cartesian point in the end of the path in a last line segment.
* @public
* @param {og.Vec3} point3v - New coordinate.
* @param {Vec3} point3v - New coordinate.
*/
appendPoint3v(point3v, color, skipEllipsoid) {
if (this._path3v.length === 0) {
@ -1623,7 +1623,7 @@ class Polyline {
/**
* Adds a new cartesian point in the end of the path.
* @public
* @param {og.Vec3} point3v - New coordinate.
* @param {Vec3} point3v - New coordinate.
* @param {number} [multiLineIndex=0] - Path part index, first by default.
*/
addPoint3v(point3v, multiLineIndex = 0) {
@ -1752,7 +1752,7 @@ class Polyline {
/**
* Assign with render node.
* @public
* @param {og.scene.RenderNode} renderNode -
* @param {scene.RenderNode} renderNode -
*/
setRenderNode(renderNode) {
if (renderNode) {
@ -1870,7 +1870,7 @@ class Polyline {
/**
* Returns polyline geodetic extent.
* @public
* @returns {og.Extent} - Geodetic extent
* @returns {Extent} - Geodetic extent
*/
getExtent() {
return this._extent.clone();
@ -1878,7 +1878,7 @@ class Polyline {
/**
* Returns path cartesian coordinates.
* @return {Array.<og.Vec3>} Polyline path.
* @return {Array.<Vec3>} Polyline path.
*/
getPath3v() {
return this._path3v;

View File

@ -13,10 +13,10 @@ import { doubleToTwoFloats2 } from '../math/coder.js';
* Ray class.
* @class
* @param {Object} [options] - Options:
* @param {og.Vec3|Array.<number>} [options.startPosition] - Ray start point position.
* @param {og.Vec3|Array.<number>} [options.endPosition] - Ray end point position.
* @param {og.Vec3|Array.<number>} [options.startColor] - Ray start point color.
* @param {og.Vec3|Array.<number>} [options.endColor] - Ray end point color.
* @param {Vec3|Array.<number>} [options.startPosition] - Ray start point position.
* @param {Vec3|Array.<number>} [options.endPosition] - Ray end point position.
* @param {Vec3|Array.<number>} [options.startColor] - Ray start point color.
* @param {Vec3|Array.<number>} [options.endColor] - Ray end point color.
* @param {boolean} [options.visibility] - Visibility.
*/
class Ray {
@ -65,14 +65,14 @@ class Ray {
/**
* Entity instance that holds this billboard.
* @protected
* @type {og.Entity}
* @type {Entity}
*/
this._entity = null;
/**
* Handler that stores and renders this billboard object.
* @protected
* @type {og.BillboardHandler}
* @type {BillboardHandler}
*/
this._handler = null;
@ -102,7 +102,7 @@ class Ray {
/**
* Sets ray start position.
* @public
* @param {og.Vec3} position - Cartesian coordinates.
* @param {Vec3} position - Cartesian coordinates.
*/
setStartPosition3v(position) {
this._startPosition.x = position.x;
@ -130,7 +130,7 @@ class Ray {
/**
* Sets ray end position.
* @public
* @param {og.Vec3} position - Cartesian coordinates.
* @param {Vec3} position - Cartesian coordinates.
*/
setEndPosition3v(position) {
this._endPosition.x = position.x;
@ -184,7 +184,7 @@ class Ray {
/**
* Returns ray start position.
* @public
* @returns {og.Vec3}
* @returns {Vec3}
*/
getStartPosition() {
return this._startPosition;
@ -193,7 +193,7 @@ class Ray {
/**
* Returns ray end position.
* @public
* @returns {og.Vec3}
* @returns {Vec3}
*/
getEndPosition() {
return this._endPosition;
@ -230,7 +230,7 @@ class Ray {
/**
* Sets billboard picking color.
* @public
* @param {og.Vec3} color - Picking color.
* @param {Vec3} color - Picking color.
*/
setPickingColor3v(color) {
this._handler && this._handler.setPickingColorArr(this._handlerIndex, color);

View File

@ -57,14 +57,14 @@ class Strip {
/**
* Parent collection render node.
* @private
* @type {og.scene.RenderNode}
* @type {scene.RenderNode}
*/
this._renderNode = null;
/**
* Entity instance that holds this strip.
* @private
* @type {og.Entity}
* @type {Entity}
*/
this._entity = null;
@ -87,7 +87,7 @@ class Strip {
/**
* Handler that stores and renders this object.
* @private
* @type {og.StripHandler}
* @type {StripHandler}
*/
this._handler = null;
this._handlerIndex = -1;
@ -111,7 +111,7 @@ class Strip {
/**
* Assign picking color.
* @protected
* @param {og.Vec3} color - Picking RGB color.
* @param {Vec3} color - Picking RGB color.
*/
setPickingColor3v(color) {
this._pickingColor[0] = color.x / 255.0;
@ -177,7 +177,7 @@ class Strip {
/**
* Assign rendering scene node.
* @public
* @param {og.scene.RenderNode} renderNode - Assigned render node.
* @param {scene.RenderNode} renderNode - Assigned render node.
*/
setRenderNode(renderNode) {
this._renderNode = renderNode;

View File

@ -15,21 +15,21 @@ class StripHandler {
/**
* Parent collection
* @private
* @type {og.EntityCollection}
* @type {EntityCollection}
*/
this._entityCollection = entityCollection;
/**
* Renderer
* @private
* @type {og.Renderer}
* @type {Renderer}
*/
this._renderer = null;
/**
* Point cloud array
* @private
* @type {Array.<og.Strip>}
* @type {Array.<Strip>}
*/
this._strips = [];

View File

@ -154,7 +154,7 @@ class BaseGeoImage extends Layer {
/**
* @virtual
* @param {og.planetSegment.Material} material - GeoImage material.
* @param {planetSegment.Material} material - GeoImage material.
*/
abortMaterialLoading(material) {
this._creationProceeding = false;
@ -215,7 +215,7 @@ class BaseGeoImage extends Layer {
/**
* @virtual
* @protected
* @param {og.planetSegment.Material} material - GeoImage material.
* @param {planetSegment.Material} material - GeoImage material.
*/
clearMaterial(material) {
material.image = null;
@ -227,7 +227,7 @@ class BaseGeoImage extends Layer {
/**
* @virtual
* @protected
* @param {og.planetSegment.Material} material - GeoImage material.
* @param {planetSegment.Material} material - GeoImage material.
* @returns {Array<number> } -
*/
applyMaterial(material) {

View File

@ -41,7 +41,7 @@ const EVENT_NAMES = [
* @param {string} [options.attribution] - Layer attribution that displayed in the attribution area on the screen.
* @param {boolean} [options.isBaseLayer=false] - Base layer flag.
* @param {boolean} [options.visibility=true] - Layer visibility.
* @param {og.layer.CanvasTiles~drawTileCallback} [options.drawTile] - Draw tile callback.
* @param {layer.CanvasTiles~drawTileCallback} [options.drawTile] - Draw tile callback.
* @fires og.layer.CanvasTiles#load
* @fires og.layer.CanvasTiles#loadend
*/
@ -63,13 +63,13 @@ class CanvasTiles extends Layer {
/**
* Tile pending queue that waiting for create.
* @protected
* @type {Array.<og.planetSegment.Material>}
* @type {Array.<planetSegment.Material>}
*/
this._pendingsQueue = []; // new og.QueueArray();
/**
* Draw tile callback.
* @type {og.layer.CanvasTiles~drawTileCallback}
* @type {layer.CanvasTiles~drawTileCallback}
* @public
*/
this.drawTile = options.drawTile || null;
@ -116,7 +116,7 @@ class CanvasTiles extends Layer {
* Start to load tile material.
* @public
* @virtual
* @param {og.planetSegment.Material} material -
* @param {planetSegment.Material} material -
*/
loadMaterial(material) {
var seg = material.segment;
@ -143,7 +143,7 @@ class CanvasTiles extends Layer {
/**
* Loads material image and apply it to the planet segment.
* @protected
* @param {og.planetSegment.Material} material - Loads material image.
* @param {planetSegment.Material} material - Loads material image.
*/
_exec(material) {
CanvasTiles.__requestsCounter++;
@ -153,7 +153,7 @@ class CanvasTiles extends Layer {
/**
* Tile custom draw function.
* @callback og.layer.CanvasTiles~drawTileCallback
* @param {og.planetSegment.Material} material
* @param {planetSegment.Material} material
* @param {applyCanvasCallback} applyCanvasCallback
*/
var e = that.events.load;
@ -186,7 +186,7 @@ class CanvasTiles extends Layer {
/**
* Abort exact material loading.
* @public
* @param {og.planetSegment.Material} material - Segment material.
* @param {planetSegment.Material} material - Segment material.
*/
abortMaterialLoading(material) {
if (material.isLoading && material.image) {

View File

@ -84,7 +84,7 @@ class GeoImage extends BaseGeoImage {
* Loads planet segment material. In this case - GeoImage source image.
* @virtual
* @public
* @param {og.planetSegment.Material} material - GeoImage planet material.
* @param {planetSegment.Material} material - GeoImage planet material.
*/
loadMaterial(material) {
material.isLoading = true;
@ -114,7 +114,7 @@ class GeoImage extends BaseGeoImage {
/**
* @virtual
* @param {og.planetSegment.Material} material - GeoImage material.
* @param {planetSegment.Material} material - GeoImage material.
*/
abortMaterialLoading(material) {
this._image && (this._image.src = '');

View File

@ -139,7 +139,7 @@ class GeoVideo extends BaseGeoImage {
* Loads planet segment material. In this case - GeoImage source video.
* @virtual
* @public
* @param {og.planetSegment.Material} material - GeoImage planet material.
* @param {planetSegment.Material} material - GeoImage planet material.
*/
loadMaterial(material) {
material.isLoading = true;
@ -177,7 +177,7 @@ class GeoVideo extends BaseGeoImage {
/**
* @virtual
* @param {og.planetSegment.Material} material - GeoImage material.
* @param {planetSegment.Material} material - GeoImage material.
*/
abortMaterialLoading(material) {
this._video && (this._video.src = "");

View File

@ -24,6 +24,9 @@ export class KML extends Vector {
super(name, options);
this._extent = null;
this._billboard = options.billboard || { src: 'https://openglobus.org/examples/billboards/carrot.png' };
/**
* @type {string}
*/
this._color = options.color || '#6689db';
}
@ -45,7 +48,7 @@ export class KML extends Vector {
* @private
* @param {Array} coordonates
* @param {string} color
* @returns {Array<og.Entity>}
* @returns {Array<Entity>}
*/
_convertCoordonatesIntoEntities(coordinates, color, billboard) {
const extent = new Extent(new LonLat(180.0, 90.0), new LonLat(-180.0, -90.0));
@ -78,6 +81,7 @@ export class KML extends Vector {
/**
* @private
* @returns {Document}
*/
_getXmlContent(file) {
return new Promise(resolve => {
@ -102,7 +106,7 @@ export class KML extends Vector {
/**
* @public
* @param {File[]} kmls
* @returns {Promise}
* @returns {Promise<{entities: Entity[], extent: Extent}>}
*/
async addKmlFromFiles(kmls) {
const kmlObjs = await Promise.all(kmls.map(this._getXmlContent));
@ -145,7 +149,7 @@ export class KML extends Vector {
/**
* @public
* @param {string} url - Url of the KML to display. './myFile.kml' or 'http://mySite/myFile.kml' for example.
* @returns {Promise}
* @returns {Promise<{entities: Entity[], extent: Extent}>}
*/
async addKmlFromUrl(url) {
const kml = await this._getKmlFromUrl(url);

View File

@ -28,10 +28,10 @@ export const FADING_FACTOR = 0.29;
* @param {string} [options.attribution] - Layer attribution that displayed in the attribution area on the screen.
* @param {boolean} [options.isBaseLayer=false] - This is a base layer.
* @param {boolean} [options.visibility=true] - Layer visibility.
* @param {og.Extent} [options.extent=[[-180.0, -90.0], [180.0, 90.0]]] - Visible extent.
* @param {og.Vec3} [options.ambient=[0.1, 0.1, 0.21]] - Ambient RGB color.
* @param {og.Vec3} [options.diffuse=[1.0, 1.0, 1.0]] - Diffuse RGB color.
* @param {og.Vec3} [options.specular=[0.00025, 0.00015, 0.0001]] - Specular RGB color.
* @param {Extent} [options.extent=[[-180.0, -90.0], [180.0, 90.0]]] - Visible extent.
* @param {Vec3} [options.ambient=[0.1, 0.1, 0.21]] - Ambient RGB color.
* @param {Vec3} [options.diffuse=[1.0, 1.0, 1.0]] - Diffuse RGB color.
* @param {Vec3} [options.specular=[0.00025, 0.00015, 0.0001]] - Specular RGB color.
* @param {Number} [options.shininess=100] - Shininess.
*
* @fires og.Layer#visibilitychange
@ -118,7 +118,7 @@ class Layer {
/**
* Planet node.
* @protected
* @type {og.scene.Planet}
* @type {scene.Planet}
*/
this._planet = null;
@ -179,14 +179,14 @@ class Layer {
/**
* Visible degrees extent.
* @protected
* @type {og.Extent}
* @type {Extent}
*/
this._extent = null;
/**
* Visible mercator extent.
* @protected
* @type {og.Extent}
* @type {Extent}
*/
this._extentMerc = null;
@ -201,7 +201,7 @@ class Layer {
/**
* Layer picking color. Assign when added to the planet.
* @protected
* @type {og.Vec3}
* @type {Vec3}
*/
this._pickingColor = new Vec3();
@ -210,7 +210,7 @@ class Layer {
/**
* Events handler.
* @public
* @type {og.Events}
* @type {Events}
*/
this.events = new Events(EVENT_NAMES, this);
}
@ -310,7 +310,7 @@ class Layer {
/**
* Compares layers instances.
* @public
* @param {og.Layer} layer - Layer instance to compare.
* @param {Layer} layer - Layer instance to compare.
* @returns {boolean} - Returns true if the layers is the same instance of the input.
*/
isEqual(layer) {
@ -321,7 +321,7 @@ class Layer {
* Assign the planet.
* @protected
* @virtual
* @param {og.scene.Planet} planet - Planet render node.
* @param {scene.Planet} planet - Planet render node.
*/
_assignPlanet(planet) {
planet.layers.push(this);
@ -348,7 +348,7 @@ class Layer {
/**
* Adds layer to the planet.
* @public
* @param {og.scene.Planet} planet - Adds layer to the planet.
* @param {scene.Planet} planet - Adds layer to the planet.
*/
addTo(planet) {
if (!this._planet) {
@ -360,7 +360,7 @@ class Layer {
/**
* Removes from planet.
* @public
* @returns {og.Layer} -This layer.
* @returns {Layer} -This layer.
*/
remove() {
var p = this._planet;
@ -514,7 +514,7 @@ class Layer {
/**
* Sets visible geographical extent.
* @public
* @param {og.Extent} extent - Layer visible geographical extent.
* @param {Extent} extent - Layer visible geographical extent.
*/
setExtent(extent) {
var sw = extent.southWest.clone(),
@ -533,7 +533,7 @@ class Layer {
/**
* Gets layer extent.
* @public
* @return {og.Extent} - Layer geodetic extent.
* @return {Extent} - Layer geodetic extent.
*/
getExtent() {
return this._extent;

View File

@ -47,7 +47,7 @@ function _entitiesConstructor(entities) {
* @param {string} [options.zIndex=0] - Layer Z-order index. 0 is default.
* @param {boolean} [options.visibility=true] - Layer visibility. True is default.
* @param {boolean} [options.isBaseLayer=false] - Layer base layer. False is default.
* @param {Array.<og.Entity>} [options.entities] - Entities array.
* @param {Array.<Entity>} [options.entities] - Entities array.
* @param {Array.<number>} [options.scaleByDistance] - Scale by distance parameters. (exactly 3 entries)
* First index - near distance to the entity, after entity becomes full scale.
* Second index - far distance to the entity, when entity becomes zero scale.
@ -183,8 +183,8 @@ class Vector extends Layer {
/**
* Adds layer to the planet.
* @public
* @param {og.Planet} planet - Planet scene object.
* @returns {og.layer.Vector} -
* @param {Planet} planet - Planet scene object.
* @returns {layer.Vector} -
*/
addTo(planet) {
if (!this._planet) {
@ -200,7 +200,7 @@ class Vector extends Layer {
/**
* Returns stored entities.
* @public
* @returns {Array.<og.Entity>} -
* @returns {Array.<Entity>} -
*/
getEntities() {
return [].concat(this._entities);
@ -237,9 +237,9 @@ class Vector extends Layer {
/**
* Adds entity to the layer.
* @public
* @param {og.Entity} entity - Entity.
* @param {Entity} entity - Entity.
* @param {boolean} [rightNow] - Entity insertion option. False is deafult.
* @returns {og.layer.Vector} - Returns this layer.
* @returns {layer.Vector} - Returns this layer.
*/
add(entity, rightNow) {
if (!(entity._layer || entity._entityCollection)) {
@ -255,10 +255,10 @@ class Vector extends Layer {
/**
* Adds entity to the layer in the index position.
* @public
* @param {og.Entity} entity - Entity.
* @param {Entity} entity - Entity.
* @param {Number} index - Index position.
* @param {boolean} [rightNow] - Entity insertion option. False is deafult.
* @returns {og.layer.Vector} - Returns this layer.
* @returns {layer.Vector} - Returns this layer.
*/
insert(entity, index, rightNow) {
if (!(entity._layer || entity._entityCollection)) {
@ -334,9 +334,9 @@ class Vector extends Layer {
/**
* Adds entity array to the layer.
* @public
* @param {Array.<og.Entity>} entities - Entities array.
* @param {Array.<Entity>} entities - Entities array.
* @param {boolean} [rightNow] - Entity insertion option. False is deafult.
* @returns {og.layer.Vector} - Returns this layer.
* @returns {layer.Vector} - Returns this layer.
*/
addEntities(entities, rightNow) {
var i = entities.length;
@ -350,8 +350,8 @@ class Vector extends Layer {
* Remove entity from layer.
* TODO: memory leaks.
* @public
* @param {og.Entity} entity - Entity to remove.
* @returns {og.layer.Vector} - Returns this layer.
* @param {Entity} entity - Entity to remove.
* @returns {layer.Vector} - Returns this layer.
*/
removeEntity(entity) {
if (entity._layer && this.isEqual(entity._layer)) {
@ -447,8 +447,8 @@ class Vector extends Layer {
/**
* Removes entities from layer.
* @public
* @param {Array.<og.Entity>} entities - Entity array.
* @returns {og.layer.Vector} - Returns this layer.
* @param {Array.<Entity>} entities - Entity array.
* @returns {layer.Vector} - Returns this layer.
*/
removeEntities(entities) {
var i = entities.length;
@ -464,7 +464,7 @@ class Vector extends Layer {
* @param {number} near - Full scale entity distance.
* @param {number} far - Zerol scale entity distance.
* @param {number} [farInvisible] - Entity visibility distance.
* @returns {og.layer.Vector} -
* @returns {layer.Vector} -
*/
setScaleByDistance(near, far, farInvisible) {
this.scaleByDistance[0] = near;
@ -517,8 +517,8 @@ class Vector extends Layer {
/**
* Removes current entities from layer and adds new entities.
* @public
* @param {Array.<og.Entity>} entities - New entity array.
* @returns {og.layer.Vector} - Returns layer instance.
* @param {Array.<Entity>} entities - New entity array.
* @returns {layer.Vector} - Returns layer instance.
*/
setEntities(entities) {
@ -823,7 +823,7 @@ class Vector extends Layer {
* Start to load tile material.
* @public
* @virtual
* @param {og.Segment.Material} material - Current material.
* @param {Segment.Material} material - Current material.
*/
loadMaterial(material) {
@ -845,7 +845,7 @@ class Vector extends Layer {
/**
* Abort exact material loading.
* @public
* @param {og.planetSegment.Material} material - Segment material.
* @param {planetSegment.Material} material - Segment material.
*/
abortMaterialLoading(material) {
material.isLoading = false;

View File

@ -28,7 +28,7 @@ import { RENDERING } from '../quadTree/quadTree.js';
* @param {boolean} [options.visibility=true] - Layer visibility.
* @param {string} [options.crossOrigin=true] - If true, all tiles will have their crossOrigin attribute set to ''.
* @param {string} options.url - Tile url source template(see example below).
* @param {og.layer.XYZ~_urlRewriteCallback} options.urlRewrite - Url rewrite function.
* @param {layer.XYZ~_urlRewriteCallback} options.urlRewrite - Url rewrite function.
* @fires og.layer.XYZ#load
* @fires og.layer.XYZ#loadend
*
@ -88,7 +88,7 @@ class XYZ extends Layer {
* Rewrites imagery tile url query.
* @private
* @callback og.layer.XYZ~_urlRewriteCallback
* @param {og.planetSegment.Segment} segment - Segment to load.
* @param {planetSegment.Segment} segment - Segment to load.
* @param {string} url - Created url.
* @returns {string} - Url query string.
*/
@ -143,7 +143,7 @@ class XYZ extends Layer {
* Start to load tile material.
* @public
* @virtual
* @param {og.planetSegment.Material} material - Loads current material.
* @param {planetSegment.Material} material - Loads current material.
*/
loadMaterial(material, forceLoading) {
@ -197,7 +197,7 @@ class XYZ extends Layer {
* Creates query url.
* @protected
* @virtual
* @param {og.planetSegment.Segment} segment - Creates specific url for current segment.
* @param {planetSegment.Segment} segment - Creates specific url for current segment.
* @returns {String} - Returns url string.
*/
_createUrl(segment) {
@ -216,7 +216,7 @@ class XYZ extends Layer {
/**
* Returns actual url query string.
* @protected
* @param {og.planetSegment.Segment} segment - Segment that loads image data.
* @param {planetSegment.Segment} segment - Segment that loads image data.
* @returns {string} - Url string.
*/
_getHTTPRequestString(segment) {
@ -226,7 +226,7 @@ class XYZ extends Layer {
/**
* Sets url rewrite callback, used for custom url rewriting for every tile laoding.
* @public
* @param {og.layer.XYZ~_urlRewriteCallback} ur - The callback that returns tile custom created url.
* @param {layer.XYZ~_urlRewriteCallback} ur - The callback that returns tile custom created url.
*/
setUrlRewriteCallback(ur) {
this._urlRewriteCallback = ur;

View File

@ -11,10 +11,10 @@ import { Vec3 } from '../math/Vec3.js';
* @class
* @param {string} [name] - Light source name.
* @param {Object} [params] - Light parameters:
* @param {og.Vec3} [params.position] - Light source position if it is a point light, otherwise it is a light direction vector.
* @param {og.Vec3} [params.ambient] - Ambient RGB color.
* @param {og.Vec3} [params.diffuse] - Diffuse RGB color.
* @param {og.Vec3} [params.specular] - Specular RGB color.
* @param {Vec3} [params.position] - Light source position if it is a point light, otherwise it is a light direction vector.
* @param {Vec3} [params.ambient] - Ambient RGB color.
* @param {Vec3} [params.diffuse] - Diffuse RGB color.
* @param {Vec3} [params.specular] - Specular RGB color.
* @param {number} [params.shininess] - Specular shininess.
*/
class LightSource {
@ -42,14 +42,14 @@ class LightSource {
/**
* Render node where light is shines.
* @protected
* @type {og.scene.RenderNode}
* @type {scene.RenderNode}
*/
this._renderNode = null;
/**
* Light position.
* @protected
* @type {og.Vec3}
* @type {Vec3}
*/
this._position = params.position || new Vec3();
@ -63,21 +63,21 @@ class LightSource {
/**
* Ambient color.
* @protected
* @type {og.Vec3}
* @type {Vec3}
*/
this._ambient = params.ambient || new Vec3();
/**
* Diffuse color.
* @protected
* @type {og.Vec3}
* @type {Vec3}
*/
this._diffuse = params.diffuse || new Vec3(0.8, 0.8, 0.8);
/**
* Specular color.
* @protected
* @type {og.Vec3}
* @type {Vec3}
*/
this._specular = params.specular || new Vec3(0.18, 0.18, 0.18);
@ -105,7 +105,7 @@ class LightSource {
* Creates clone of the current light object.
* @todo: TODO
* @public
* @returns {og.LightSource}
* @returns {LightSource}
*/
clone() {
// TODO
@ -158,8 +158,8 @@ class LightSource {
/**
* Set light source position, or if it is a directional type sets light direction vector.
* @public
* @param {og.Vec3} position - Light position or direction vector.
* @returns {og.LightSource}
* @param {Vec3} position - Light position or direction vector.
* @returns {LightSource}
*/
setPosition3v(position) {
this._position.x = position.x;
@ -171,8 +171,8 @@ class LightSource {
/**
* Set light source position, or if it is a directional type sets light direction vector.
* @public
* @param {og.Vec3} position - Light position or direction vector.
* @returns {og.LightSource}
* @param {Vec3} position - Light position or direction vector.
* @returns {LightSource}
*/
setPosition(x, y, z) {
this._position.x = x;
@ -184,7 +184,7 @@ class LightSource {
/**
* Returns light source position, or if it is a directional type sets light direction vector.
* @public
* @returns {og.Vec3} - Light source position/direction.
* @returns {Vec3} - Light source position/direction.
*/
getPosition() {
return this._position.clone();
@ -193,8 +193,8 @@ class LightSource {
/**
* Set ambient color.
* @public
* @param {og.Vec3} rgb - Ambient color.
* @returns {og.LightSource}
* @param {Vec3} rgb - Ambient color.
* @returns {LightSource}
*/
setAmbient3v(rgb) {
return this.setAmbient(rgb.x, rgb.y, rgb.z);
@ -203,8 +203,8 @@ class LightSource {
/**
* Set diffuse color.
* @public
* @param {og.Vec3} rgb - Diffuse color.
* @returns {og.LightSource}
* @param {Vec3} rgb - Diffuse color.
* @returns {LightSource}
*/
setDiffuse3v(rgb) {
return this.setDiffuse(rgb.x, rgb.y, rgb.z);
@ -213,8 +213,8 @@ class LightSource {
/**
* Set specular color.
* @public
* @param {og.Vec3} rgb - Specular color.
* @returns {og.LightSource}
* @param {Vec3} rgb - Specular color.
* @returns {LightSource}
*/
setSpecular3v(rgb) {
return this.setSpecular(rgb.x, rgb.y, rgb.z);
@ -223,8 +223,8 @@ class LightSource {
/**
* Set ambient color.
* @public
* @param {og.Vec3} rgb - Ambient color.
* @returns {og.LightSource}
* @param {Vec3} rgb - Ambient color.
* @returns {LightSource}
*/
setAmbient(r, g, b) {
this._ambient.set(r, g, b);
@ -243,7 +243,7 @@ class LightSource {
/**
* Set diffuse color.
* @public
* @returns {og.LightSource}
* @returns {LightSource}
*/
setDiffuse(r, g, b) {
this._diffuse.set(r, g, b);
@ -262,7 +262,7 @@ class LightSource {
/**
* Set specular color.
* @public
* @returns {og.LightSource}
* @returns {LightSource}
*/
setSpecular(r, g, b) {
this._specular.set(r, g, b);
@ -281,7 +281,7 @@ class LightSource {
/**
* Set material shininess.
* @public
* @returns {og.LightSource}
* @returns {LightSource}
*/
setShininess(shininess) {
this._shininess = shininess;
@ -298,7 +298,7 @@ class LightSource {
/**
* Sets light to black.
* @public
* @returns {og.LightSource}
* @returns {LightSource}
*/
setBlack() {
this._ambient.clear();
@ -320,8 +320,8 @@ class LightSource {
/**
* Adds current light to the render node scene.
* @public
* @param {og.scene.RenderNode} renderNode - Render node scene.
* @returns {og.LightSource}
* @param {scene.RenderNode} renderNode - Render node scene.
* @returns {LightSource}
*/
addTo(renderNode) {
this._renderNode = renderNode;

View File

@ -299,11 +299,11 @@ export function bezier1v(t, p0, p1, p2, p3) {
* Performs a 3D bezier interpolation.
* @function
* @param {number} t - Interpolation value.
* @param {og.Vec3} p0 - First control point.
* @param {og.Vec3} p1 - Second control point.
* @param {og.Vec3} p2 - Third control point.
* @param {og.Vec3} p3 - Fourth control point.
* @returns {og.Vec3} -
* @param {Vec3} p0 - First control point.
* @param {Vec3} p1 - Second control point.
* @param {Vec3} p2 - Third control point.
* @param {Vec3} p3 - Fourth control point.
* @returns {Vec3} -
*/
export function bezier3v(t, p0, p1, p2, p3) {
var u = 1 - t;

View File

@ -26,7 +26,7 @@ export class Mat3 {
* Sets column-major order array matrix.
* @public
* @param {Array.<number>} m - Matrix array.
* @returns {og.Mat3}
* @returns {Mat3}
*/
set(m) {
this._m[0] = m[0];
@ -44,7 +44,7 @@ export class Mat3 {
/**
* Duplicates a Mat3 instance.
* @public
* @returns {og.Mat3}
* @returns {Mat3}
*/
clone() {
var res = new Mat3();
@ -55,8 +55,8 @@ export class Mat3 {
/**
* Copy matrix.
* @public
* @param {og.Mat3} a - Matrix to copy.
* @returns {og.Mat3}
* @param {Mat3} a - Matrix to copy.
* @returns {Mat3}
*/
copy(a) {
return this.set(a._m);
@ -65,7 +65,7 @@ export class Mat3 {
/**
* Creates trasposed matrix from the current.
* @public
* @returns {og.Mat3}
* @returns {Mat3}
*/
transposeTo() {
var res = new Mat3();
@ -79,7 +79,7 @@ export class Mat3 {
/**
* Sets matrix to identity.
* @public
* @returns {og.Mat3}
* @returns {Mat3}
*/
setIdentity() {
this._m[0] = 1; this._m[1] = 0; this._m[2] = 0;
@ -91,8 +91,8 @@ export class Mat3 {
/**
* Multiply to 3d vector.
* @public
* @params {og.Vec3} p - 3d vector.
* @returns {og.Vec3}
* @params {Vec3} p - 3d vector.
* @returns {Vec3}
*/
mulVec(p) {
var d = p.x, e = p.y, g = p.z;
@ -107,7 +107,7 @@ export class Mat3 {
/**
* Converts to 4x4 matrix.
* @public
* @returns {og.Mat4}
* @returns {Mat4}
*/
toMatrix4() {
var res = new Mat4();
@ -137,7 +137,7 @@ export class Mat3 {
/**
* Mat3 factory.
* @static
* @return {og.Mat3}
* @return {Mat3}
*/
export function mat3() {
return new Mat3();

View File

@ -22,7 +22,7 @@ export class Mat4 {
/**
* Returns identity matrix instance.
* @static
* @returns {og.Mat4} -
* @returns {Mat4} -
*/
static get identity() {
var res = new Mat4();
@ -37,7 +37,7 @@ export class Mat4 {
* Sets column-major order array matrix.
* @public
* @param {Array.<number>} m - Matrix array.
* @returns {og.Mat4} -
* @returns {Mat4} -
*/
set(m) {
this._m[0] = m[0];
@ -62,7 +62,7 @@ export class Mat4 {
/**
* Duplicates a Matrix3 instance.
* @public
* @returns {og.Mat4} -
* @returns {Mat4} -
*/
clone() {
var res = new Mat4();
@ -73,7 +73,7 @@ export class Mat4 {
/**
* Copy matrix.
* @public
* @param {og.Mat3} a - Matrix to copy.
* @param {Mat3} a - Matrix to copy.
*/
copy(a) {
this.set(a._m);
@ -82,7 +82,7 @@ export class Mat4 {
/**
* Converts to 3x3 matrix.
* @public
* @returns {og.Mat3} -
* @returns {Mat3} -
*/
toMatrix3() {
var res = new Mat3();
@ -103,8 +103,8 @@ export class Mat4 {
/**
* Multiply to 3d vector.
* @public
* @param {og.Vec3} p - 3d vector.
* @returns {og.Vec3} -
* @param {Vec3} p - 3d vector.
* @returns {Vec3} -
*/
mulVec3(p) {
var d = p.x, e = p.y, g = p.z;
@ -118,8 +118,8 @@ export class Mat4 {
/**
* Multiply to 4d vector.
* @public
* @param {og.Vec4} p - 4d vector.
* @returns {og.Vec4} -
* @param {Vec4} p - 4d vector.
* @returns {Vec4} -
*/
mulVec4(p) {
var d = p.x, e = p.y, g = p.z, f = p.w;
@ -134,7 +134,7 @@ export class Mat4 {
/**
* Creates an inversed 3x3 matrix of the current.
* @public
* @returns {og.Mat3} -
* @returns {Mat3} -
*/
toInverseMatrix3() {
var a = this._m;
@ -168,7 +168,7 @@ export class Mat4 {
/**
* Creates an inversed matrix of the current.
* @public
* @returns {og.Mat4} -
* @returns {Mat4} -
*/
inverseTo(res) {
var c = this._m[0], d = this._m[1], e = this._m[2], g = this._m[3],
@ -200,7 +200,7 @@ export class Mat4 {
/**
* Creates a trasposed matrix of the current.
* @public
* @returns {og.Mat4} -
* @returns {Mat4} -
*/
transposeTo() {
var res = new Mat4();
@ -214,7 +214,7 @@ export class Mat4 {
/**
* Sets matrix to identity.
* @public
* @returns {og.Mat4} -
* @returns {Mat4} -
*/
setIdentity() {
this._m[0] = 1; this._m[1] = 0; this._m[2] = 0; this._m[3] = 0;
@ -227,8 +227,8 @@ export class Mat4 {
/**
* Computes the product of two matrices.
* @public
* @param {og.Mat4} mx - Matrix to multiply.
* @returns {og.Mat4} -
* @param {Mat4} mx - Matrix to multiply.
* @returns {Mat4} -
*/
mul(mx) {
let d = this._m[0], e = this._m[1], g = this._m[2], f = this._m[3],
@ -252,8 +252,8 @@ export class Mat4 {
/**
* Add translation vector to the current matrix.
* @public
* @param {og.Vec3} v - Translate vector.
* @returns {og.Mat4} -
* @param {Vec3} v - Translate vector.
* @returns {Mat4} -
*/
translate(v) {
var d = v.x, e = v.y, b = v.z;
@ -268,8 +268,8 @@ export class Mat4 {
/**
* Sets translation matrix to the position.
* @public
* @param {og.Vec3} v - Translate to position.
* @returns {og.Mat4} -
* @param {Vec3} v - Translate to position.
* @returns {Mat4} -
*/
translateToPosition(v) {
var a = this._m;
@ -282,9 +282,9 @@ export class Mat4 {
/**
* Rotate currrent matrix around the aligned axis and angle.
* @public
* @param {og.Vec3} u - Aligned axis.
* @param {Vec3} u - Aligned axis.
* @param {number} angle - Aligned axis angle in radians.
* @returns {og.Mat4} -
* @returns {Mat4} -
* @todo: OPTIMIZE: reveal multiplication
*/
rotate(u, angle) {
@ -302,9 +302,9 @@ export class Mat4 {
/**
* Sets current rotation matrix around the aligned axis and angle.
* @public
* @param {og.Vec3} u - Aligned axis.
* @param {Vec3} u - Aligned axis.
* @param {number} angle - Aligned axis angle in radians.
* @returns {og.Mat4} -
* @returns {Mat4} -
*/
setRotation(u, angle) {
var c = Math.cos(angle),
@ -320,9 +320,9 @@ export class Mat4 {
/**
* Gets the rotation matrix from one vector to another.
* @public
* @param {og.Vec3} a - Firtst vector.
* @param {og.Vec3} b - Second vector.
* @returns {og.Mat4} -
* @param {Vec3} a - Firtst vector.
* @param {Vec3} b - Second vector.
* @returns {Mat4} -
*/
rotateBetweenVectors(a, b) {
var q = Quat.getRotationBetweenVectors(a, b);
@ -332,8 +332,8 @@ export class Mat4 {
/**
* Scale current matrix to the vector values.
* @public
* @param {og.Vec3} v - Scale vector.
* @returns {og.Mat4} -
* @param {Vec3} v - Scale vector.
* @returns {Mat4} -
*/
scale(v) {
var mx = this._m;
@ -352,7 +352,7 @@ export class Mat4 {
* @param {number} top -
* @param {number} near -
* @param {number} far -
* @returns {og.Mat4} -
* @returns {Mat4} -
*/
setPerspective(left, right, bottom, top, near, far) {
var h = right - left, i = top - bottom, j = far - near;
@ -384,7 +384,7 @@ export class Mat4 {
* @param {number} top -
* @param {number} near -
* @param {number} far -
* @return {og.Mat4} -
* @return {Mat4} -
*/
setOrtho(left, right, bottom, top, near, far) {
@ -418,7 +418,7 @@ export class Mat4 {
* @param {number} ax - Rotation angle in radians arond X axis.
* @param {number} ay - Rotation angle in radians arond Y axis.
* @param {number} az - Rotation angle in radians arond Z axis.
* @returns {og.Mat4} -
* @returns {Mat4} -
*/
eulerToMatrix(ax, ay, az) {
var a = Math.cos(ax),
@ -452,7 +452,7 @@ export class Mat4 {
/**
* Mat4 factory.
* @static
* @returns {og.Mat4} -
* @returns {Mat4} -
*/
export function mat4() {
return new og.Mat4();

View File

@ -6,8 +6,8 @@ import { Vec3 } from './Vec3.js';
/**
* Plane class.
* @constructor
* @param {og.Vec3} [p] - Plane point.
* @param {og.Vec3} [n] - Planet normal.
* @param {Vec3} [p] - Plane point.
* @param {Vec3} [n] - Planet normal.
*/
class Plane {
constructor(p, n) {

View File

@ -58,7 +58,7 @@ export class Quat {
/**
* Identity Quat.
* @const
* @type {og.Quat}
* @type {Quat}
*/
static get IDENTITY() {
return new Quat(0.0, 0.0, 0.0, 1.0);
@ -68,7 +68,7 @@ export class Quat {
* Returns a Quat represents rotation around X axis.
* @static
* @param {number} a - The angle in radians to rotate around the axis.
* @returns {og.Quat} -
* @returns {Quat} -
*/
static xRotation(a) {
a *= 0.5;
@ -79,7 +79,7 @@ export class Quat {
* Returns a Quat represents rotation around Y axis.
* @static
* @param {number} a - The angle in radians to rotate around the axis.
* @returns {og.Quat} -
* @returns {Quat} -
*/
static yRotation(a) {
a *= 0.5;
@ -90,7 +90,7 @@ export class Quat {
* Returns a Quat represents rotation around Z axis.
* @static
* @param {number} a - The angle in radians to rotate around the axis.
* @returns {og.Quat} -
* @returns {Quat} -
*/
static zRotation(a) {
a *= 0.5;
@ -100,9 +100,9 @@ export class Quat {
/**
* Computes a Quat representing a rotation around an axis.
* @static
* @param {og.Vec3} axis - The axis of rotation.
* @param {Vec3} axis - The axis of rotation.
* @param {number} [angle=0.0] The angle in radians to rotate around the axis.
* @returns {og.Quat} -
* @returns {Quat} -
*/
static axisAngleToQuat(axis, angle) {
angle = angle || 0.0;
@ -119,9 +119,9 @@ export class Quat {
/**
* Computes a rotation from the given heading and up vector.
* @static
* @param {og.Vec3} forward - Heading target coordinates.
* @param {og.Vec3} up - Up vector.
* @returns {og.Quat} -
* @param {Vec3} forward - Heading target coordinates.
* @param {Vec3} up - Up vector.
* @returns {Quat} -
*/
static getLookRotation(forward, up) {
@ -173,9 +173,9 @@ export class Quat {
/**
* Computes a Quat from from source point heading to the destination point.
* @static
* @param {og.Vec3} sourcePoint - Source coordinate.
* @param {og.Vec3} destPoint - Destination coordinate.
* @returns {og.Quat} -
* @param {Vec3} sourcePoint - Source coordinate.
* @param {Vec3} destPoint - Destination coordinate.
* @returns {Quat} -
*/
static getLookAtSourceDest(sourcePoint, destPoint) {
var forwardVector = destPoint.subA(sourcePoint).normalize();
@ -194,9 +194,9 @@ export class Quat {
/**
* Compute rotation between two vectors.
* @static
* @param {og.Vec3} u - First vector.
* @param {og.Vec3} v - Second vector.
* @returns {og.Quat} -
* @param {Vec3} u - First vector.
* @param {Vec3} v - Second vector.
* @returns {Quat} -
*/
static getRotationBetweenVectors(u, v) {
var w = u.cross(v);
@ -207,10 +207,10 @@ export class Quat {
/**
* Compute rotation between two vectors.
* @static
* @param {og.Vec3} u - First vector.
* @param {og.Vec3} v - Second vector.
* @param {Vec3} u - First vector.
* @param {Vec3} v - Second vector.
* @param {Quat} res
* @returns {og.Quat} -
* @returns {Quat} -
*/
static getRotationBetweenVectorsRes(u, v, res) {
var w = u.cross(v);
@ -223,10 +223,10 @@ export class Quat {
* for exactly opposite vectors. If vectors exaclty in the same
* direction than returns identity Quat.
* @static
* @param {og.Vec3} source - First vector.
* @param {og.Vec3} dest - Second vector.
* @param {og.Vec3} up - Up vector.
* @returns {og.Quat} -
* @param {Vec3} source - First vector.
* @param {Vec3} dest - Second vector.
* @param {Vec3} up - Up vector.
* @returns {Quat} -
*/
static getRotationBetweenVectorsUp(source, dest, up) {
var dot = source.dot(dest);
@ -248,8 +248,8 @@ export class Quat {
/**
* Returns true if the components are zero.
* @public
* @param {og.Quat} q - Quat to subtract.
* @returns {og.Quat} -
* @param {Quat} q - Quat to subtract.
* @returns {Quat} -
*/
isZero() {
return this.x === 0.0 && this.y === 0.0 && this.z === 0.0 && this.w === 0.0;
@ -258,7 +258,7 @@ export class Quat {
/**
* Clear Quat. Sets zeroes.
* @public
* @returns {og.Quat} -
* @returns {Quat} -
*/
clear() {
this.x = this.y = this.z = this.w = 0;
@ -272,7 +272,7 @@ export class Quat {
* @param {Number} [y=0.0] The Y component.
* @param {Number} [z=0.0] The Z component.
* @param {Number} [w=0.0] The W component.
* @returns {og.Quat} -
* @returns {Quat} -
*/
set(x, y, z, w) {
this.x = x;
@ -285,8 +285,8 @@ export class Quat {
/**
* Copy Quat values.
* @public
* @param {og.Quat} q - Copy Quat.
* @returns {og.Quat} -
* @param {Quat} q - Copy Quat.
* @returns {Quat} -
*/
copy(q) {
this.x = q.x;
@ -299,7 +299,7 @@ export class Quat {
/**
* Set current Quat instance to identity Quat.
* @public
* @returns {og.Quat} -
* @returns {Quat} -
*/
setIdentity() {
this.x = 0.0;
@ -312,7 +312,7 @@ export class Quat {
/**
* Duplicates a Quat instance.
* @public
* @returns {og.Quat} -
* @returns {Quat} -
*/
clone() {
return new Quat(this.x, this.y, this.z, this.w);
@ -321,8 +321,8 @@ export class Quat {
/**
* Computes the componentwise sum of two Quats.
* @public
* @param {og.Quat} q - Quat to add.
* @returns {og.Quat} -
* @param {Quat} q - Quat to add.
* @returns {Quat} -
*/
add(q) {
return new Quat(this.x + q.x, this.y + q.y, this.z + q.z, this.w + q.w);
@ -331,8 +331,8 @@ export class Quat {
/**
* Computes the componentwise difference of two Quats.
* @public
* @param {og.Quat} q - Quat to subtract.
* @returns {og.Quat} -
* @param {Quat} q - Quat to subtract.
* @returns {Quat} -
*/
sub(q) {
return new Quat(this.x - q.x, this.y - q.y, this.z - q.z, this.w - q.w);
@ -342,7 +342,7 @@ export class Quat {
* Multiplies the provided Quat componentwise by the provided scalar.
* @public
* @param {Number} scale - The scalar to multiply with.
* @returns {og.Quat} -
* @returns {Quat} -
*/
scaleTo(scale) {
return new Quat(this.x * scale, this.y * scale, this.z * scale, this.w * scale);
@ -352,7 +352,7 @@ export class Quat {
* Multiplies the provided Quat componentwise.
* @public
* @param {Number} scale - The scalar to multiply with.
* @returns {og.Quat} -
* @returns {Quat} -
*/
scale(scale) {
this.x *= scale; this.y *= scale; this.z *= scale; this.w *= scale;
@ -374,7 +374,7 @@ export class Quat {
* @param {number} lat - Latitude.
* @param {number} lon - Longitude.
* @param {number} angle - Angle in radians.
* @returns {og.Quat} -
* @returns {Quat} -
*/
setFromSphericalCoords(lat, lon, angle) {
var sin_a = Math.sin(angle / 2);
@ -393,9 +393,9 @@ export class Quat {
/**
* Sets rotation with the given heading and up vectors.
* @static
* @param {og.Vec3} forward - Heading target coordinates.
* @param {og.Vec3} up - Up vector.
* @returns {og.Quat} -
* @param {Vec3} forward - Heading target coordinates.
* @param {Vec3} up - Up vector.
* @returns {Quat} -
*/
setLookRotation(forward, up) {
@ -466,9 +466,9 @@ export class Quat {
/**
* Sets current Quat representing a rotation around an axis.
* @public
* @param {og.Vec3} axis - The axis of rotation.
* @param {Vec3} axis - The axis of rotation.
* @param {number} angle The angle in radians to rotate around the axis.
* @returns {og.Quat} -
* @returns {Quat} -
*/
setFromAxisAngle(axis, angle) {
var v = axis.normal();
@ -507,7 +507,7 @@ export class Quat {
* @param {number} pitch - Pitch angle in degrees.
* @param {number} yaw - Yaw angle in degrees.
* @param {number} roll - Roll angle in degrees.
* @returns {og.Quat} -
* @returns {Quat} -
*/
setFromEulerAngles(pitch, yaw, roll) {
var ex = pitch * math.RADIANS_HALF,
@ -563,8 +563,8 @@ export class Quat {
/**
* Computes a Quat from the provided 4x4 matrix instance.
* @public
* @param {og.Mat4} m - The rotation matrix.
* @returns {og.Quat} -
* @param {Mat4} m - The rotation matrix.
* @returns {Quat} -
*/
setFromMatrix4(m) {
var tr, s, q = [];
@ -610,7 +610,7 @@ export class Quat {
/**
* Converts current Quat to the rotation 4x4 matrix.
* @public
* @returns {og.Mat4} -
* @returns {Mat4} -
*/
getMat4(out) {
var xs = this.x + this.x;
@ -632,7 +632,7 @@ export class Quat {
/**
* Converts current Quat to the rotation 3x3 matrix.
* @public
* @returns {og.Mat3} -
* @returns {Mat3} -
* @todo NOT TESTED
*/
getMat3() {
@ -668,8 +668,8 @@ export class Quat {
/**
* Returns quatrenion and vector production.
* @public
* @param {og.Vec3} v - 3d Vector.
* @returns {og.Vec3} -
* @param {Vec3} v - 3d Vector.
* @returns {Vec3} -
*/
mulVec3(v) {
@ -700,8 +700,8 @@ export class Quat {
/**
* Computes the product of two Quats.
* @public
* @param {og.Quat} q - Quat to multiply.
* @returns {og.Quat} -
* @param {Quat} q - Quat to multiply.
* @returns {Quat} -
*/
mul(q) {
var d = this.x, e = this.y, g = this.z, a = this.w;
@ -716,8 +716,8 @@ export class Quat {
/**
* Computes the product of two Quats.
* @public
* @param {og.Quat} q - Quat to multiply.
* @returns {og.Quat} -
* @param {Quat} q - Quat to multiply.
* @returns {Quat} -
*/
mulA(q) {
var d = this.x, e = this.y, g = this.z, a = this.w;
@ -732,7 +732,7 @@ export class Quat {
/**
* Gets the conjugate of the Quat.
* @public
* @returns {og.Quat} -
* @returns {Quat} -
*/
conjugate() {
return new Quat(-this.x, -this.y, -this.z, this.w);
@ -741,7 +741,7 @@ export class Quat {
/**
* Computes the inverse of the Quat.
* @public
* @returns {og.Quat} -
* @returns {Quat} -
*/
inverse() {
var n = 1 / this.magnitude2();
@ -771,7 +771,7 @@ export class Quat {
/**
* Computes the dot (scalar) product of two Quats.
* @public
* @param {og.Quat} q - Second quatrnion.
* @param {Quat} q - Second quatrnion.
* @returns {number} -
*/
dot(q) {
@ -781,7 +781,7 @@ export class Quat {
/**
* Current Quat normalization.
* @public
* @returns {og.Quat} -
* @returns {Quat} -
*/
normalize() {
var c = this.x, d = this.y, e = this.z, g = this.w,
@ -804,7 +804,7 @@ export class Quat {
/**
* Compares two Quats.
* @public
* @param {og.Quat} q - Second quatrnion.
* @param {Quat} q - Second quatrnion.
* @returns {Boolean} -
*/
isEqual(q) {
@ -818,9 +818,9 @@ export class Quat {
/**
* Performs a spherical linear interpolation between two Quats.
* @public
* @param {og.Quat} b - The end rotation Quat.
* @param {Quat} b - The end rotation Quat.
* @param {number} t - interpolation amount between the two Quats.
* @returns {og.Quat} -
* @returns {Quat} -
*/
slerp(b, t) {
@ -929,7 +929,7 @@ export class Quat {
* @param {Number} [y=0.0] The Y component.
* @param {Number} [z=0.0] The Z component.
* @param {Number} [w=0.0] The W component.
* @returns {og.Quat} -
* @returns {Quat} -
*/
export function quat(x, y, z, w) {
return new Quat(x, y, z, w);

View File

@ -10,8 +10,8 @@ import { Vec3 } from './Vec3.js';
/**
* Represents a ray that extends infinitely from the provided origin in the provided direction.
* @class
* @param {og.Vec3} origin - The origin of the ray.
* @param {og.Vec3} direction - The direction of the ray.
* @param {Vec3} origin - The origin of the ray.
* @param {Vec3} direction - The direction of the ray.
*/
export class Ray {
constructor(origin, direction) {
@ -19,14 +19,14 @@ export class Ray {
/**
* The origin of the ray.
* @public
* @type {og.Vec3}
* @type {Vec3}
*/
this.origin = origin || new Vec3();
/**
* The direction of the ray.
* @public
* @type {og.Vec3}
* @type {Vec3}
*/
this.direction = direction || new Vec3();
}
@ -44,9 +44,9 @@ export class Ray {
/**
* Sets a ray parameters.
* @public
* @param {og.Vec3} origin - The origin of the ray.
* @param {og.Vec3} direction - The direction of the ray.
* @returns {og.Ray}
* @param {Vec3} origin - The origin of the ray.
* @param {Vec3} direction - The direction of the ray.
* @returns {Ray}
*/
set(origin, direction) {
this.origin = origin;
@ -58,7 +58,7 @@ export class Ray {
* Computes the point along the ray on the distance.
* @public
* @param {number} distance - Point distance.
* @returns {og.Vec3}
* @returns {Vec3}
*/
getPoint(distance) {
return Vec3.add(this.origin, this.direction.scaleTo(distance));
@ -67,10 +67,10 @@ export class Ray {
/**
* Returns ray hit a triange result.
* @public
* @param {og.Vec3} v0 - First triangle corner coordinate.
* @param {og.Vec3} v1 - Second triangle corner coordinate.
* @param {og.Vec3} v2 - Third triangle corner coordinate.
* @param {og.Vec3} res - Hit point object pointer that stores hit result.
* @param {Vec3} v0 - First triangle corner coordinate.
* @param {Vec3} v1 - Second triangle corner coordinate.
* @param {Vec3} v2 - Third triangle corner coordinate.
* @param {Vec3} res - Hit point object pointer that stores hit result.
* @returns {number} - Hit code, could 0 - og.Ray.OUTSIDE, 1 - og.Ray.INSIDE,
* 2 - og.Ray.INPLANE and 3 - og.Ray.AWAY(ray goes away from triangle).
*/
@ -130,10 +130,10 @@ export class Ray {
/**
* Gets a ray hit a plane result. If the ray cross the plane returns 1 - og.Ray.INSIDE otherwise returns 0 - og.Ray.OUTSIDE.
* @public
* @param {og.Vec3} v0 - First plane point.
* @param {og.Vec3} v1 - Second plane point.
* @param {og.Vec3} v2 - Third plane point.
* @param {og.Vec3} res - Hit point object pointer that stores hit result.
* @param {Vec3} v0 - First plane point.
* @param {Vec3} v1 - Second plane point.
* @param {Vec3} v2 - Third plane point.
* @param {Vec3} res - Hit point object pointer that stores hit result.
* @returns {number}
*/
hitPlane(v0, v1, v2, res) {
@ -171,8 +171,8 @@ export class Ray {
/**
* Returns a ray hit sphere coordiante. If there isn't hit returns null.
* @public
* @param {og.bv.Sphere} sphere - Sphere object.
* @returns {og.Vec3}
* @param {bv.Sphere} sphere - Sphere object.
* @returns {Vec3}
*/
hitSphere(sphere) {
var r = sphere.radius,
@ -224,9 +224,9 @@ export class Ray {
/**
* Ray object creator.
* @function
* @param {og.Vec3} origin - The origin of the ray.
* @param {og.Vec3} direction - The direction of the ray.
* @returns {og.Ray}
* @param {Vec3} origin - The origin of the ray.
* @param {Vec3} direction - The direction of the ray.
* @returns {Ray}
*/
export function ray(origin, direction) {
return new Ray(origin, direction);

View File

@ -42,9 +42,9 @@ export class Vec2 {
/**
* Returns summary vector.
* @static
* @param {og.math.Vec2} a - First vector.
* @param {og.math.Vec2} b - Second vector.
* @returns {og.math.Vec2} - Summary vector.
* @param {math.Vec2} a - First vector.
* @param {math.Vec2} b - Second vector.
* @returns {math.Vec2} - Summary vector.
*/
static add(a, b) {
var res = new Vec2(a.x, a.y);
@ -55,9 +55,9 @@ export class Vec2 {
/**
* Returns two vectors subtraction.
* @static
* @param {og.math.Vec2} a - First vector.
* @param {og.math.Vec2} b - Second vector.
* @returns {og.math.Vec2} - Vectors subtraction.
* @param {math.Vec2} a - First vector.
* @param {math.Vec2} b - Second vector.
* @returns {math.Vec2} - Vectors subtraction.
*/
static sub(a, b) {
var res = new Vec2(a.x, a.y);
@ -68,9 +68,9 @@ export class Vec2 {
/**
* Returns scaled vector.
* @static
* @param {og.math.Vec2} a - Input vector.
* @param {math.Vec2} a - Input vector.
* @param {number} scale - Scale value.
* @returns {og.math.Vec2}
* @returns {math.Vec2}
*/
static scale(a, scale) {
var res = new Vec2(a.x, a.y);
@ -81,9 +81,9 @@ export class Vec2 {
/**
* Returns two vectors production.
* @static
* @param {og.math.Vec2} a - First vector.
* @param {og.math.Vec2} b - Second vector.
* @returns {og.math.Vec2}
* @param {math.Vec2} a - First vector.
* @param {math.Vec2} b - Second vector.
* @returns {math.Vec2}
*/
static mul(a, b) {
var res = new Vec2(a.x, a.y);
@ -94,9 +94,9 @@ export class Vec2 {
/**
* Returns vector components division product one to another.
* @static
* @param {og.math.Vec2} a - First vector.
* @param {og.math.Vec2} b - Second vector.
* @returns {og.math.Vec2}
* @param {math.Vec2} a - First vector.
* @param {math.Vec2} b - Second vector.
* @returns {math.Vec2}
*/
static div(a, b) {
var res = new Vec2(a.x, a.y);
@ -107,9 +107,9 @@ export class Vec2 {
/**
* Get projection of the first vector to the second.
* @static
* @param {og.math.Vec2} b - First vector.
* @param {og.math.Vec2} a - Second vector.
* @returns {og.math.Vec2}
* @param {math.Vec2} b - First vector.
* @param {math.Vec2} a - Second vector.
* @returns {math.Vec2}
*/
static proj_b_to_a(b, a) {
return a.scaleTo(a.dot(b) / a.dot(a));
@ -118,8 +118,8 @@ export class Vec2 {
/**
* Gets angle between two vectors.
* @static
* @param {og.math.Vec2} a - First vector.
* @param {og.math.Vec2} b - Second vector.
* @param {math.Vec2} a - First vector.
* @param {math.Vec2} b - Second vector.
* @returns {number}
*/
static angle(a, b) {
@ -129,9 +129,9 @@ export class Vec2 {
/**
* Makes vectors normalized and orthogonal to each other.
* @static
* @param {og.math.Vec2} normal - Normal vector.
* @param {og.math.Vec2} tangent - Tangent vector.
* @returns {og.math.Vec2}
* @param {math.Vec2} normal - Normal vector.
* @param {math.Vec2} tangent - Tangent vector.
* @returns {math.Vec2}
*/
static orthoNormalize(normal, tangent) {
normal = normal.norm();
@ -142,7 +142,7 @@ export class Vec2 {
/**
* Converts to 3d vector, third value is 0.0.
* @public
* @returns {og.Vec3}
* @returns {Vec3}
*/
toVector3() {
return new Vec3(this.x, this.y, 0);
@ -151,7 +151,7 @@ export class Vec2 {
/**
* Returns clone vector.
* @public
* @returns {og.math.Vec2}
* @returns {math.Vec2}
*/
clone() {
return new Vec2(this.x, this.y);
@ -160,7 +160,7 @@ export class Vec2 {
/**
* Compares with vector. Returns true if it equals another.
* @public
* @param {og.math.Vec2} p - Vector to compare.
* @param {math.Vec2} p - Vector to compare.
* @returns {boolean}
*/
equal(p) {
@ -169,8 +169,8 @@ export class Vec2 {
/**
* Copy input vector's values.
* @param {og.math.Vec2} point2 - Vector to copy.
* @returns {og.math.Vec2}
* @param {math.Vec2} point2 - Vector to copy.
* @returns {math.Vec2}
*/
copy(point2) {
this.x = point2.x;
@ -199,8 +199,8 @@ export class Vec2 {
/**
* Adds vector to the current.
* @public
* @param {og.math.Vec2}
* @returns {og.math.Vec2}
* @param {math.Vec2}
* @returns {math.Vec2}
*/
addA(v) {
this.x += v.x;
@ -211,8 +211,8 @@ export class Vec2 {
/**
* Summarize two vectors.
* @public
* @param {og.math.Vec2}
* @returns {og.math.Vec2}
* @param {math.Vec2}
* @returns {math.Vec2}
*/
add(v) {
return new Vec2(this.x + v.x, this.y + v.y);
@ -221,8 +221,8 @@ export class Vec2 {
/**
* Subtract vector from the current where results saved on the current instance.
* @public
* @param {og.math.Vec2} v - Subtract vector.
* @returns {og.math.Vec2}
* @param {math.Vec2} v - Subtract vector.
* @returns {math.Vec2}
*/
subA(v) {
this.x -= v.x;
@ -233,8 +233,8 @@ export class Vec2 {
/**
* Subtract vector from the current.
* @public
* @param {og.math.Vec2} v - Subtract vector.
* @returns {og.math.Vec2}
* @param {math.Vec2} v - Subtract vector.
* @returns {math.Vec2}
*/
sub(v) {
return new Vec2(this.x - v.x, this.y - v.y);
@ -244,7 +244,7 @@ export class Vec2 {
* Scale current vector.
* @public
* @param {number} scale - Scale value.
* @returns {og.math.Vec2}
* @returns {math.Vec2}
*/
scale(scale) {
this.x *= scale;
@ -256,7 +256,7 @@ export class Vec2 {
* Scale current vector to another instance.
* @public
* @param {number} scale - Scale value.
* @returns {og.math.Vec2}
* @returns {math.Vec2}
*/
scaleTo(scale) {
return new Vec2(this.x * scale, this.y * scale);
@ -265,8 +265,8 @@ export class Vec2 {
/**
* Multiply current vector object to another and store result in the current instance.
* @public
* @param {og.math.Vec2} vec - Multiply vector.
* @returns {og.math.Vec2}
* @param {math.Vec2} vec - Multiply vector.
* @returns {math.Vec2}
*/
mulA(vec) {
this.x *= vec.x;
@ -277,8 +277,8 @@ export class Vec2 {
/**
* Multiply current vector object to another and returns new vector instance.
* @public
* @param {og.math.Vec2} vec - Multiply vector.
* @returns {og.math.Vec2}
* @param {math.Vec2} vec - Multiply vector.
* @returns {math.Vec2}
*/
mul(vec) {
return new Vec2(this.x * vec.x, this.y * vec.y);
@ -287,8 +287,8 @@ export class Vec2 {
/**
* Divide current vector's components to another. Results stores in the current vector object.
* @public
* @param {og.math.Vec2}
* @returns {og.math.Vec2}
* @param {math.Vec2}
* @returns {math.Vec2}
*/
divA(vec) {
this.x /= vec.x;
@ -299,7 +299,7 @@ export class Vec2 {
/**
* Gets vectors dot production.
* @public
* @param {og.math.Vec2} v - Another vector.
* @param {math.Vec2} v - Another vector.
* @returns {number}
*/
dot(v) {
@ -319,8 +319,8 @@ export class Vec2 {
/**
* Gets vectors cross production.
* @public
* @param {og.math.Vec2} v - Another vector.
* @returns {og.math.Vec2}
* @param {math.Vec2} v - Another vector.
* @returns {math.Vec2}
*/
cross(v) {
return this.x * v.y - this.y * v.x;
@ -329,7 +329,7 @@ export class Vec2 {
/**
* Sets vector to zero.
* @public
* @returns {og.math.Vec2}
* @returns {math.Vec2}
*/
clear() {
this.x = this.y = 0;
@ -339,7 +339,7 @@ export class Vec2 {
/**
* Returns normalized vector.
* @public
* @returns {og.math.Vec2}
* @returns {math.Vec2}
*/
normal() {
var res = new Vec2();
@ -356,7 +356,7 @@ export class Vec2 {
/**
* Normalize current vector.
* @public
* @returns {og.math.Vec2}
* @returns {math.Vec2}
*/
normalize() {
var length = 1.0 / this.length();
@ -379,7 +379,7 @@ export class Vec2 {
/**
* Gets distance to point.
* @public
* @param {og.math.Vec2} p - Distant point.
* @param {math.Vec2} p - Distant point.
* @returns {number}
*/
distance(p) {
@ -392,7 +392,7 @@ export class Vec2 {
* @public
* @param {number} x - Value X.
* @param {number} y - Value Y.
* @returns {og.math.Vec2}
* @returns {math.Vec2}
*/
set(x, y) {
this.x = x;
@ -403,7 +403,7 @@ export class Vec2 {
/**
* Negate current vector.
* @public
* @returns {og.math.Vec2}
* @returns {math.Vec2}
*/
negate() {
this.x = -this.x;
@ -414,7 +414,7 @@ export class Vec2 {
/**
* Negate current vector to another instance.
* @public
* @returns {og.math.Vec2}
* @returns {math.Vec2}
*/
negateTo() {
return new Vec2(-this.x, -this.y);
@ -423,9 +423,9 @@ export class Vec2 {
/**
* Gets projected point coordinates of the current vector on the ray.
* @public
* @param {og.math.Vec2} pos - Ray position.
* @param {og.math.Vec2} direction - Ray direction.
* @returns {og.math.Vec2}
* @param {math.Vec2} pos - Ray position.
* @param {math.Vec2} direction - Ray direction.
* @returns {math.Vec2}
*/
projToRay(pos, direction) {
var v = Vec2.proj_b_to_a(Vec2.sub(this, pos), direction);
@ -436,7 +436,7 @@ export class Vec2 {
/**
* Gets angle between two vectors.
* @public
* @param {og.math.Vec2} a - Another vector.
* @param {math.Vec2} a - Another vector.
* @returns {number}
*/
angle(a) {
@ -446,9 +446,9 @@ export class Vec2 {
/**
* Returns two vectors linear interpolation.
* @public
* @param {og.math.Vec2} v2 - End vector.
* @param {math.Vec2} v2 - End vector.
* @param {number} l - Interpolate value.
* @returns {og.math.Vec2}
* @returns {math.Vec2}
*/
lerp(v1, v2, l) {
var res = Vec2.clone(this);
@ -470,9 +470,9 @@ export class Vec2 {
* the vectors are treated as directions rather than points in space. The direction of the returned vector is interpolated
* by the angle and its magnitude is interpolated between the magnitudes of from and to.
* @public
* @param {og.math.Vec2} v2 -
* @param {math.Vec2} v2 -
* @param {number} t - The parameter t is clamped to the range [0, 1].
* @returns {og.math.Vec2}
* @returns {math.Vec2}
*/
slerp(v2, t) {
var res = new Vec2();
@ -507,7 +507,7 @@ export class Vec2 {
* @function
* @param {number} [x] - First cvalue.
* @param {number} [y] - Second value.
* @returns {og.math.Vec2}
* @returns {math.Vec2}
*/
export function vec2(x, y) {
return new Vec2(x, y);

View File

@ -148,7 +148,7 @@ export class Vec3 {
* Creates 3d vector from array.
* @function
* @param {Array.<number>} arr - Input array (exactly 3 entries)
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
static fromVec(arr) {
return new Vec3(arr[0], arr[1], arr[2]);
@ -157,8 +157,8 @@ export class Vec3 {
/**
* Gets angle between two vectors.
* @static
* @param {og.Vec3} a - First vector.
* @param {og.Vec3} b - Second vector.
* @param {Vec3} a - First vector.
* @param {Vec3} b - Second vector.
* @returns {number} -
*/
static angle(a, b) {
@ -168,10 +168,10 @@ export class Vec3 {
/**
* Returns two vectors linear interpolation.
* @static
* @param {og.Vec3} v1 - Start vector.
* @param {og.Vec3} v2 - End vector.
* @param {Vec3} v1 - Start vector.
* @param {Vec3} v2 - End vector.
* @param {number} l - Interpolate value.
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
static lerp(v1, v2, l) {
return Vec3(v1.x + (v2.x - v1.x) * l, v1.y + (v2.y - v1.y) * l, v1.z + (v2.z - v1.z) * l);
@ -180,9 +180,9 @@ export class Vec3 {
/**
* Returns summary vector.
* @static
* @param {og.Vec3} a - First vector.
* @param {og.Vec3} b - Second vector.
* @returns {og.Vec3} - Summary vector.
* @param {Vec3} a - First vector.
* @param {Vec3} b - Second vector.
* @returns {Vec3} - Summary vector.
*/
static add(a, b) {
var res = new Vec3(a.x, a.y, a.z);
@ -193,9 +193,9 @@ export class Vec3 {
/**
* Returns two vectors subtraction.
* @static
* @param {og.Vec3} a - First vector.
* @param {og.Vec3} b - Second vector.
* @returns {og.Vec3} - Vectors subtraction.
* @param {Vec3} a - First vector.
* @param {Vec3} b - Second vector.
* @returns {Vec3} - Vectors subtraction.
*/
static sub(a, b) {
var res = new Vec3(a.x, a.y, a.z);
@ -206,9 +206,9 @@ export class Vec3 {
/**
* Returns scaled vector.
* @static
* @param {og.Vec3} a - Input vector.
* @param {Vec3} a - Input vector.
* @param {number} scale - Scale value.
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
static scale(a, scale) {
var res = new Vec3(a.x, a.y, a.z);
@ -219,9 +219,9 @@ export class Vec3 {
/**
* Returns two vectors production.
* @static
* @param {og.Vec3} a - First vector.
* @param {og.Vec3} b - Second vector.
* @returns {og.Vec3} -
* @param {Vec3} a - First vector.
* @param {Vec3} b - Second vector.
* @returns {Vec3} -
*/
static mul(a, b) {
var res = new Vec3(a.x, a.y, a.z);
@ -232,9 +232,9 @@ export class Vec3 {
/**
* Returns true if two vectors are non collinear.
* @public
* @param {og.Vec3} a - First vector.
* @param {og.Vec3} b - Second vector.
* @returns {og.Vec3} -
* @param {Vec3} a - First vector.
* @param {Vec3} b - Second vector.
* @returns {Vec3} -
*/
static noncollinear(a, b) {
return a.y * b.z - a.z * b.y || a.z * b.x - a.x * b.z || a.x * b.y - a.y * b.z;
@ -243,10 +243,10 @@ export class Vec3 {
/**
* Get projection of the vector to plane where n - normal to the plane.
* @static
* @param {og.Vec3} b - Vector to project.
* @param {og.Vec3} n - Plane normal.
* @param {og.Vec3} [def] - Default value for non existed result.
* @returns {og.Vec3} -
* @param {Vec3} b - Vector to project.
* @param {Vec3} n - Plane normal.
* @param {Vec3} [def] - Default value for non existed result.
* @returns {Vec3} -
*/
static proj_b_to_plane(b, n, def) {
var res = b.sub(n.scaleTo(n.dot(b) / n.dot(n)));
@ -259,9 +259,9 @@ export class Vec3 {
/**
* Get projection of the first vector to the second.
* @static
* @param {og.Vec3} b - First vector.
* @param {og.Vec3} a - Second vector.
* @returns {og.Vec3} -
* @param {Vec3} b - First vector.
* @param {Vec3} a - Second vector.
* @returns {Vec3} -
*/
static proj_b_to_a(b, a) {
return a.scaleTo(a.dot(b) / a.dot(a));
@ -271,9 +271,9 @@ export class Vec3 {
* Makes vectors normalized and orthogonal to each other.
* Normalizes normal. Normalizes tangent and makes sure it is orthogonal to normal (that is, angle between them is 90 degrees).
* @static
* @param {og.Vec3} normal - Normal vector.
* @param {og.Vec3} tangent - Tangent vector.
* @returns {og.Vec3} -
* @param {Vec3} normal - Normal vector.
* @param {Vec3} tangent - Tangent vector.
* @returns {Vec3} -
*/
static orthoNormalize(normal, tangent) {
normal = normal.normal();
@ -284,9 +284,9 @@ export class Vec3 {
/**
* Returns vector components division product one to another.
* @static
* @param {og.Vec3} a - First vector.
* @param {og.Vec3} b - Second vector.
* @returns {og.Vec3} -
* @param {Vec3} a - First vector.
* @param {Vec3} b - Second vector.
* @returns {Vec3} -
*/
static div(a, b) {
var res = new Vec3(a.x, a.y, a.z);
@ -297,7 +297,7 @@ export class Vec3 {
/**
* Converts to 4d vector, Fourth value is 1.0.
* @public
* @returns {og.Vec4} -
* @returns {Vec4} -
*/
toVec4() {
return new Vec4(this.x, this.y, this.z, 1.0);
@ -306,7 +306,7 @@ export class Vec3 {
/**
* Returns clone vector.
* @public
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
clone() {
return new Vec3(this.x, this.y, this.z);
@ -333,8 +333,8 @@ export class Vec3 {
/**
* Get projection of the first vector to the second.
* @static
* @param {og.Vec3} a - Project vector.
* @returns {og.Vec3} -
* @param {Vec3} a - Project vector.
* @returns {Vec3} -
*/
projToVec(a) {
return a.scaleTo(a.dot(this) / a.dot(a));
@ -343,7 +343,7 @@ export class Vec3 {
/**
* Compares with vector. Returns true if it equals another.
* @public
* @param {og.Vec3} p - Vector to compare.
* @param {Vec3} p - Vector to compare.
* @returns {boolean} -
*/
equal(p) {
@ -352,8 +352,8 @@ export class Vec3 {
/**
* Copy input vector's values.
* @param {og.Vec3} point3 - Vector to copy.
* @returns {og.Vec3} -
* @param {Vec3} point3 - Vector to copy.
* @returns {Vec3} -
*/
copy(point3) {
this.x = point3.x;
@ -383,7 +383,7 @@ export class Vec3 {
/**
* Converts vector's values to a quaternion object.
* @public
* @returns {og.Quat} -
* @returns {Quat} -
*/
getQuat() {
return new Quat(this.x, this.y, this.z);
@ -392,8 +392,8 @@ export class Vec3 {
/**
* Adds vector to the current.
* @public
* @param {og.Vec3} point3 - Point to add.
* @returns {og.Vec3} -
* @param {Vec3} point3 - Point to add.
* @returns {Vec3} -
*/
addA(point3) {
this.x += point3.x;
@ -405,8 +405,8 @@ export class Vec3 {
/**
* Gets two vectors summarization.
* @public
* @param {og.Vec3} point3 - Vector to add.
* @returns {og.Vec3} Returns a sum vector.
* @param {Vec3} point3 - Vector to add.
* @returns {Vec3} Returns a sum vector.
*/
add(point3) {
return new Vec3(this.x + point3.x, this.y + point3.y, this.z + point3.z);
@ -415,8 +415,8 @@ export class Vec3 {
/**
* Subtract vector from the current.
* @public
* @param {og.Vec3} point3 - Subtract vector.
* @returns {og.Vec3} -
* @param {Vec3} point3 - Subtract vector.
* @returns {Vec3} -
*/
subA(point3) {
this.x -= point3.x;
@ -428,8 +428,8 @@ export class Vec3 {
/**
* Gets vector subtraction.
* @public
* @param {og.Vec3} point3 - Subtract vector.
* @return {og.Vec3} Returns new instance of a subtraction
* @param {Vec3} point3 - Subtract vector.
* @return {Vec3} Returns new instance of a subtraction
*/
sub(point3) {
return new Vec3(this.x - point3.x, this.y - point3.y, this.z - point3.z);
@ -439,7 +439,7 @@ export class Vec3 {
* Scale current vector.
* @public
* @param {number} scale - Scale value.
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
scale(scale) {
this.x *= scale;
@ -452,7 +452,7 @@ export class Vec3 {
* Scale current vector to another instance.
* @public
* @param {number} scale - Scale value.
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
scaleTo(scale) {
return new Vec3(this.x * scale, this.y * scale, this.z * scale);
@ -461,8 +461,8 @@ export class Vec3 {
/**
* Multiply current vector object to another and store result in the current instance.
* @public
* @param {og.Vec3} vec - Multiply vector.
* @returns {og.Vec3} -
* @param {Vec3} vec - Multiply vector.
* @returns {Vec3} -
*/
mulA(vec) {
this.x *= vec.x;
@ -474,8 +474,8 @@ export class Vec3 {
/**
* Multiply current vector object to another and returns new vector instance.
* @public
* @param {og.Vec3} vec - Multiply vector.
* @returns {og.Vec3} -
* @param {Vec3} vec - Multiply vector.
* @returns {Vec3} -
*/
mul(vec) {
return new Vec3(this.x * vec.x, this.y * vec.y, this.z * vec.z);
@ -484,8 +484,8 @@ export class Vec3 {
/**
* Divide current vector's components to another. Results stores in the current vector object.
* @public
* @param {og.Vec3} vec - Div vector.
* @returns {og.Vec3} -
* @param {Vec3} vec - Div vector.
* @returns {Vec3} -
*/
divA(vec) {
this.x /= vec.x;
@ -497,8 +497,8 @@ export class Vec3 {
/**
* Divide current vector's components to another and returns new vector instance.
* @public
* @param {og.Vec3} vec - Div vector.
* @returns {og.Vec3} -
* @param {Vec3} vec - Div vector.
* @returns {Vec3} -
*/
div(vec) {
return new Vec3(this.x / vec.x, this.y / vec.y, this.z / vec.z);
@ -507,7 +507,7 @@ export class Vec3 {
/**
* Gets vectors dot production.
* @public
* @param {og.Vec3} point3 - Another vector.
* @param {Vec3} point3 - Another vector.
* @returns {number} -
*/
dot(point3) {
@ -527,8 +527,8 @@ export class Vec3 {
/**
* Gets vectors cross production.
* @public
* @param {og.Vec3} point3 - Another vector.
* @returns {og.Vec3} -
* @param {Vec3} point3 - Another vector.
* @returns {Vec3} -
*/
cross(point3) {
return new Vec3(
@ -541,7 +541,7 @@ export class Vec3 {
/**
* Sets vector to zero.
* @public
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
clear() {
this.x = this.y = this.z = 0;
@ -551,7 +551,7 @@ export class Vec3 {
/**
* Returns normalized vector.
* @public
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
getNormal() {
var res = new Vec3();
@ -570,7 +570,7 @@ export class Vec3 {
* Returns normalized vector.
* @deprecated
* @public
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
normal() {
var res = new Vec3();
@ -588,7 +588,7 @@ export class Vec3 {
/**
* Returns normalized negate vector.
* @public
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
normalNegate() {
var res = new Vec3();
@ -606,7 +606,7 @@ export class Vec3 {
/**
* Returns normalized negate scale vector.
* @public
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
normalNegateScale(scale) {
var res = new Vec3();
@ -624,7 +624,7 @@ export class Vec3 {
/**
* Returns normalized scale vector.
* @public
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
normalScale(scale) {
var res = new Vec3();
@ -642,7 +642,7 @@ export class Vec3 {
/**
* Normalize current vector.
* @public
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
normalize() {
var length = 1.0 / this.length();
@ -676,7 +676,7 @@ export class Vec3 {
/**
* Gets distance to point.
* @public
* @param {og.Vec3} point3 - Distant point.
* @param {Vec3} point3 - Distant point.
* @returns {number} -
*/
distance(point3) {
@ -689,7 +689,7 @@ export class Vec3 {
* @param {number} x - Value X.
* @param {number} y - Value Y.
* @param {number} z - Value Z.
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
set(x, y, z) {
this.x = x;
@ -701,7 +701,7 @@ export class Vec3 {
/**
* Negate current vector.
* @public
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
negate() {
this.x = -this.x;
@ -713,7 +713,7 @@ export class Vec3 {
/**
* Negate current vector to another instance.
* @public
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
negateTo() {
return new Vec3(-this.x, -this.y, -this.z);
@ -722,9 +722,9 @@ export class Vec3 {
/**
* Gets projected point coordinates of the current vector on the ray.
* @public
* @param {og.Vec3} pos - Ray position.
* @param {og.Vec3} direction - Ray direction.
* @returns {og.Vec3} -
* @param {Vec3} pos - Ray position.
* @param {Vec3} direction - Ray direction.
* @returns {Vec3} -
*/
projToRay(pos, direction) {
var v = Vec3.proj_b_to_a(Vec3.sub(this, pos), direction);
@ -735,7 +735,7 @@ export class Vec3 {
/**
* Gets angle between two vectors.
* @public
* @param {og.Vec3} a - Another vector.
* @param {Vec3} a - Another vector.
* @returns {number} -
*/
angle(a) {
@ -745,9 +745,9 @@ export class Vec3 {
/**
* Returns two vectors linear interpolation.
* @public
* @param {og.Vec3} v2 - End vector.
* @param {Vec3} v2 - End vector.
* @param {number} l - Interpolate value.
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
lerp(v2, l) {
return new Vec3(this.x + (v2.x - this.x) * l, this.y + (v2.y - this.y) * l, this.z + (v2.z - this.z) * l);
@ -756,9 +756,9 @@ export class Vec3 {
/**
* Returns vector interpolation by v(t) = v1 * t + v2 * (1 - t)
* @public
* @param {og.Vec3} v2 - End vector.
* @param {Vec3} v2 - End vector.
* @param {number} t - Interpolate value.
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
smerp(v2, t) {
var one_d = 1 - t;
@ -773,9 +773,9 @@ export class Vec3 {
* the vectors are treated as directions rather than points in space. The direction of the returned vector is interpolated
* by the angle and its magnitude is interpolated between the magnitudes of from and to.
* @public
* @param {og.Vec3} v2 -
* @param {Vec3} v2 -
* @param {number} t - The parameter t is clamped to the range [0, 1].
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
slerp(v2, t) {
var res = new Vec3();
@ -857,7 +857,7 @@ export class Vec3 {
* @param {number} [x] - First cvalue.
* @param {number} [y] - Second value.
* @param {number} [z] - Third value.
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
export function vec3(x, y, z) {
return new Vec3(x, y, z);

View File

@ -46,7 +46,7 @@ export class Vec4 {
/**
* Identity vector [0,0,0,1].
* @const
* @type {og.math.Vec4}
* @type {math.Vec4}
*/
static get identity() { return new Vec4(0, 0, 0, 1) }
@ -54,7 +54,7 @@ export class Vec4 {
* Creates 4d vector from array.
* @function
* @param {Array.<number>} - (exactly 4 entries)
* @returns {og.math.Vec4}
* @returns {math.Vec4}
*/
static fromVec(arr) {
return new Vec4(arr[0], arr[1], arr[2], arr[3]);
@ -63,7 +63,7 @@ export class Vec4 {
/**
* Converts to 3d vector, without fourth value.
* @public
* @returns {og.Vec3}
* @returns {Vec3}
*/
toVec3() {
return new Vec3(this.x, this.y, this.z);
@ -72,7 +72,7 @@ export class Vec4 {
/**
* Returns clone vector.
* @public
* @returns {og.math.Vec4}
* @returns {math.Vec4}
*/
clone(v) {
return new Vec4(this.x, this.y, this.z, this.w);
@ -81,7 +81,7 @@ export class Vec4 {
/**
* Compares with vector. Returns true if it equals another.
* @public
* @param {og.math.Vec4} p - Vector to compare.
* @param {math.Vec4} p - Vector to compare.
* @returns {boolean}
*/
equal(v) {
@ -90,8 +90,8 @@ export class Vec4 {
/**
* Copy input vector's values.
* @param {og.math.Vec4} v - Vector to copy.
* @returns {og.math.Vec4}
* @param {math.Vec4} v - Vector to copy.
* @returns {math.Vec4}
*/
copy(v) {
this.x = v.x;
@ -127,7 +127,7 @@ export class Vec4 {
* @param {number} y - Value Y.
* @param {number} z - Value Z.
* @param {number} w - Value W.
* @returns {og.math.Vec4}
* @returns {math.Vec4}
*/
set(x, y, z, w) {
this.x = x;
@ -140,8 +140,8 @@ export class Vec4 {
/**
* Adds vector to the current.
* @public
* @param {og.math.Vec4}
* @returns {og.math.Vec4}
* @param {math.Vec4}
* @returns {math.Vec4}
*/
addA(v) {
this.x += v.x;
@ -154,8 +154,8 @@ export class Vec4 {
/**
* Subtract vector from the current.
* @public
* @param {og.math.Vec4} v - Subtract vector.
* @returns {og.math.Vec4}
* @param {math.Vec4} v - Subtract vector.
* @returns {math.Vec4}
*/
subA(v) {
this.x -= v.x;
@ -169,7 +169,7 @@ export class Vec4 {
* Scale current vector.
* @public
* @param {number} scale - Scale value.
* @returns {og.math.Vec4}
* @returns {math.Vec4}
*/
scale(scale) {
this.x *= scale;
@ -182,7 +182,7 @@ export class Vec4 {
/**
* Makes vector affinity. Thereby fourh component becomes to 1.0.
* @public
* @returns {og.math.Vec4}
* @returns {math.Vec4}
*/
affinity() {
var iw = 1 / this.w;
@ -197,7 +197,7 @@ export class Vec4 {
* Scale current vector to another instance.
* @public
* @param {number} scale - Scale value.
* @returns {og.Vec3}
* @returns {Vec3}
*/
scaleTo(scale) {
return new Vec4(this.x * scale, this.y * scale, this.z * scale, this.w * scale);
@ -206,7 +206,7 @@ export class Vec4 {
/**
* Vector's edge function that returns vector where each component is 0.0 if it's smaller then edge and otherwise 1.0.
* @public
* @returns {og.math.Vec4}
* @returns {math.Vec4}
*/
getStep(edge) {
return new Vec4(
@ -220,7 +220,7 @@ export class Vec4 {
/**
* The vector fract function returns the vector of fractional parts of each value, i.e. x minus floor(x).
* @public
* @returns {og.math.Vec4}
* @returns {math.Vec4}
*/
getFrac(v) {
return new Vec4(
@ -234,7 +234,7 @@ export class Vec4 {
/**
* Gets vectors dot production.
* @public
* @param {og.math.Vec4} v - Another vector.
* @param {math.Vec4} v - Another vector.
* @returns {number} - Dot product.
*/
dot(v) {
@ -258,7 +258,7 @@ export class Vec4 {
* @param {number} [y] - Second value.
* @param {number} [z] - Third value.
* @param {number} [w] - Fourth value.
* @returns {og.math.Vec4}
* @returns {math.Vec4}
*/
export function vec4(x, y, z, w) {
return new og.math.Vec4(x, y, z, w);

View File

@ -11,7 +11,7 @@ import { Vec4 } from './Vec4.js';
* Encode 32 bit float value to the RGBA vector.
* @function
* @param {number} v - 32 bit float value.
* @returns {og.math.Vec4} - RGBA vector value.
* @returns {math.Vec4} - RGBA vector value.
*/
export function encodeFloatToRGBA(v) {
var enc = new Vec4(1.0 * v % 1, 255.0 * v % 1, 65025.0 * v % 1, 160581375.0 * v % 1);
@ -22,7 +22,7 @@ export function encodeFloatToRGBA(v) {
/**
* Decode RGBA vector to 32 bit float value.
* @function
* @param {og.Vec4} rgba - RGBA encoded 32 bit float value.
* @param {Vec4} rgba - RGBA encoded 32 bit float value.
* @returns {number} - Float value.
*/
export function decodeFloatFromRGBA(rgba) {
@ -35,7 +35,7 @@ export function decodeFloatFromRGBA(rgba) {
/**
* Decode RGBA vector to 32 bit float value.
* @function
* @param {og.Vec4} rgba - RGBA encoded 32 bit float value.
* @param {Vec4} rgba - RGBA encoded 32 bit float value.
* @returns {number} - Float value.
*/
export function decodeFloatFromRGBAArr(arr, use32) {

View File

@ -8,6 +8,6 @@ import { Units, Proj } from './Proj.js';
/**
* EPSG:3857 projection object.
* @type {og.Proj}
* @type {Proj}
*/
export const EPSG3857 = new Proj({ code: "epsg:3857", units: Units.METERS });

View File

@ -8,6 +8,6 @@ import { Units, Proj } from './Proj.js';
/**
* EPSG:4326 projection object.
* @type {og.Proj}
* @type {Proj}
*/
export const EPSG4326 = new Proj({ code: "epsg:4326", units: Units.DEGREES });

View File

@ -39,7 +39,7 @@ class Proj {
/**
* @public
* @type {og.proj.Units}
* @type {proj.Units}
*/
this.units = /** @type {Units} */ (options.units);
@ -54,7 +54,7 @@ class Proj {
/**
* Compare projections.
* @public
* @param {og.Proj} proj - Projetion object.
* @param {Proj} proj - Projetion object.
* @returns {boolean}
*/
equal(proj) {

View File

@ -55,13 +55,13 @@ let BOUNDS = {
/**
* Quad tree planet segment node.
* @constructor
* @param {og.planetSegment.Segment|og.planetSegment.SegmentLonLat} segmentPrototype - Planet segment node constructor.
* @param {og.scene.RenderNode} planet - Planet render node.
* @param {planetSegment.Segment|og.planetSegment.SegmentLonLat} segmentPrototype - Planet segment node constructor.
* @param {scene.RenderNode} planet - Planet render node.
* @param {number} partId - NorthEast, SouthWest etc.
* @param {og.quadTree.Node} parent - Parent of this node.
* @param {quadTree.Node} parent - Parent of this node.
* @param {number} id - Tree node identifier (id * 4 + 1);
* @param {number} tileZoom - Deep index of the quad tree.
* @param {og.Extent} extent - Planet segment extent.
* @param {Extent} extent - Planet segment extent.
*/
class Node {
@ -173,7 +173,7 @@ class Node {
* Returns the same deep existent neighbour node.
* @public
* @param {Number} side - Neighbour side index e.g. og.quadTree.N, og.quadTree.W etc.
* @returns {og.quadTree.Node} -
* @returns {quadTree.Node} -
*/
getEqualNeighbor(side) {
var pn = this;

View File

@ -24,7 +24,7 @@ let __depthCallbackCounter__ = 0;
/**
* Represents high level WebGL context interface that starts WebGL handler working in real time.
* @class
* @param {og.webgl.Handler} handler - WebGL handler context.
* @param {webgl.Handler} handler - WebGL handler context.
* @param {Object} [params] - Renderer parameters:
* @fires og.RendererEvents#draw
* @fires og.RendererEvents#resize
@ -69,7 +69,7 @@ class Renderer {
/**
* WebGL handler context.
* @public
* @type {og.webgl.Handler}
* @type {webgl.Handler}
*/
this.handler = handler;
@ -86,7 +86,7 @@ class Renderer {
/**
* Render nodes drawing queue.
* @private
* @type {Array.<og.scene.RenderNode>}
* @type {Array.<scene.RenderNode>}
*/
this._renderNodesArr = [];
@ -100,14 +100,14 @@ class Renderer {
/**
* Current active camera.
* @public
* @type {og.Camera}
* @type {Camera}
*/
this.activeCamera = null;
/**
* Renderer events. Represents interface for setting events like mousemove, draw, keypress etc.
* @public
* @type {og.RendererEvents}
* @type {RendererEvents}
*/
this.events = new RendererEvents(this);
@ -140,20 +140,20 @@ class Renderer {
/**
* Color picking objects rendering queue.
* @type {Array.<og.Renderer~pickingCallback>}
* @type {Array.<Renderer~pickingCallback>}
*/
this._pickingCallbacks = [];
/**
* Picking objects(labels and billboards) framebuffer.
* @public
* @type {og.webgl.Framebuffer}
* @type {webgl.Framebuffer}
*/
this.pickingFramebuffer = null;
/**
* Depth objects rendering queue.
* @type {Array.<og.Renderer~depthCallback>}
* @type {Array.<Renderer~depthCallback>}
*/
this._depthCallbacks = [];
@ -193,14 +193,14 @@ class Renderer {
/**
* Texture atlas for the billboards images. One atlas per node.
* @protected
* @type {og.utils.TextureAtlas}
* @type {utils.TextureAtlas}
*/
this.billboardsTextureAtlas = new TextureAtlas();
/**
* Texture font atlas for the font families and styles. One atlas per node.
* @public
* @type {og.utils.FontAtlas}
* @type {utils.FontAtlas}
*/
this.fontAtlas = new FontAtlas();
@ -249,7 +249,7 @@ class Renderer {
/**
* Adds picking rendering callback function.
* @param {object} sender - Callback context.
* @param {og.Renderer~pickingCallback} callback - Rendering callback.
* @param {Renderer~pickingCallback} callback - Rendering callback.
* @returns {Number} Handler id
*/
addPickingCallback(sender, callback) {
@ -346,7 +346,7 @@ class Renderer {
/**
* Get center of the screen
* @public
* @returns {og.math.Vec2} -
* @returns {math.Vec2} -
*/
getCenter() {
var cnv = this.handler.canvas;
@ -355,7 +355,7 @@ class Renderer {
/**
* Add the given control to the renderer.
* @param {og.control.Control} control - Control.
* @param {control.Control} control - Control.
*/
addControl(control) {
control.addTo(this);
@ -363,7 +363,7 @@ class Renderer {
/**
* Add the given controls array to the planet node.
* @param {Array.<og.control.Control>} cArr - Control array.
* @param {Array.<control.Control>} cArr - Control array.
*/
addControls(cArr) {
for (var i = 0; i < cArr.length; i++) {
@ -373,7 +373,7 @@ class Renderer {
/**
* Remove control from the renderer.
* @param {og.control.Control} control - Control.
* @param {control.Control} control - Control.
*/
removeControl(control) {
control.remove();
@ -564,7 +564,7 @@ class Renderer {
/**
* Adds render node to the renderer.
* @public
* @param {og.scene.RenderNode} renderNode - Render node.
* @param {scene.RenderNode} renderNode - Render node.
*/
addNode(renderNode) {
if (!this.renderNodes[renderNode.name]) {
@ -579,7 +579,7 @@ class Renderer {
/**
* Adds render node to the renderer before specific node.
* @public
* @param {og.scene.RenderNode} renderNode - Render node.
* @param {scene.RenderNode} renderNode - Render node.
*/
addNodeBefore(renderNode, renderNodeBefore) {
if (!this.renderNodes[renderNode.name]) {
@ -600,7 +600,7 @@ class Renderer {
/**
* Adds render nodes array to the renderer.
* @public
* @param {Array.<og.scene.RenderNode>} nodesArr - Render nodes array.
* @param {Array.<scene.RenderNode>} nodesArr - Render nodes array.
*/
addNodes(nodesArr) {
for (var i = 0; i < nodesArr.length; i++) {

View File

@ -19,7 +19,7 @@ const MB_M = 0b0100;
/**
* Renderer events handler.
* @class
* @param {og.Renderer} renderer - Renderer object, events that works for.
* @param {Renderer} renderer - Renderer object, events that works for.
*/
class RendererEvents extends Events {
constructor(renderer) {
@ -28,28 +28,28 @@ class RendererEvents extends Events {
/**
* Assigned renderer.
* @public
* @type {og.Renderer}
* @type {Renderer}
*/
this.renderer = renderer;
/**
* Low level touch events handler.
* @private
* @type {og.input.TouchHandler}
* @type {input.TouchHandler}
*/
this._touchHandler = new TouchHandler(renderer.handler.canvas);
/**
* Low level mouse events handler.
* @private
* @type {og.input.MouseHandler}
* @type {input.MouseHandler}
*/
this._mouseHandler = new MouseHandler(renderer.handler.canvas);
/**
* Low level keyboard events handler.
* @private
* @type {og.input.KeyboardHandler}
* @type {input.KeyboardHandler}
*/
this._keyboardHandler = new KeyboardHandler();

View File

@ -22,7 +22,7 @@ class BaseNode {
/**
* Top scene tree node pointer.
* @public
* @type {og.RenderNode}
* @type {RenderNode}
*/
this.topNode = this;
@ -32,14 +32,14 @@ class BaseNode {
/**
* Children nodes.
* @public
* @type {Array.<og.RenderNode>}
* @type {Array.<RenderNode>}
*/
this.childNodes = [];
/**
* Parent node pointer.
* @public
* @type {og.RenderNode}
* @type {RenderNode}
*/
this.parentNode = null;
@ -60,7 +60,7 @@ class BaseNode {
/**
* Adds node to the current hierarchy.
* @public
* @type {og.BaseNode}
* @type {BaseNode}
*/
addNode(node) {
if (this.parentNode == null) {
@ -89,7 +89,7 @@ class BaseNode {
* Gets node by name in the current.
* @public
* @param {string} name - Node name.
* @return {og.RenderNode} Node object in the current node.
* @return {RenderNode} Node object in the current node.
*/
getNodeByName(name) {
return this._dictionary[name];

View File

@ -91,7 +91,7 @@ const EVENT_NAMES = [
* @class
* @extends {RenderNode}
* @param {string} name - Planet name(Earth by default)
* @param {og.Ellipsoid} ellipsoid - Planet ellipsoid(WGS84 by default)
* @param {Ellipsoid} ellipsoid - Planet ellipsoid(WGS84 by default)
* @param {Number} [maxGridSize=128] - Segment maximal grid size
* @fires og.scene.Planet#draw
* @fires og.scene.Planet#layeradd
@ -106,7 +106,7 @@ export class Planet extends RenderNode {
/**
* @public
* @type {og.Ellipsoid}
* @type {Ellipsoid}
*/
this.ellipsoid = options.ellipsoid || wgs84;
@ -126,21 +126,21 @@ export class Planet extends RenderNode {
/**
* All layers array.
* @public
* @type {Array.<og.Layer>}
* @type {Array.<Layer>}
*/
this.layers = [];
/**
* Current visible imagery tile layers array.
* @public
* @type {Array.<og.Layer>}
* @type {Array.<Layer>}
*/
this.visibleTileLayers = [];
/**
* Current visible vector layers array.
* @protected
* @type {Array.<og.layer.Vector>}
* @type {Array.<layer.Vector>}
*/
this.visibleVectorLayers = [];
@ -149,28 +149,28 @@ export class Planet extends RenderNode {
/**
* Vector layers visible nodes with collections.
* @protected
* @type {Array.<og.EntityCollection>}
* @type {Array.<EntityCollection>}
*/
this._frustumEntityCollections = [];
/**
* There is only one base layer on the globe when layer.isBaseLayer is true.
* @public
* @type {og.Layer}
* @type {Layer}
*/
this.baseLayer = null;
/**
* Terrain provider.
* @public
* @type {og.terrain.Terrain}
* @type {terrain.Terrain}
*/
this.terrain = null;
/**
* Camera is this.renderer.activeCamera pointer.
* @public
* @type {og.PlanetCamera}
* @type {PlanetCamera}
*/
this.camera = null;
@ -180,7 +180,7 @@ export class Planet extends RenderNode {
/**
* Screen mouse pointer projected to planet cartesian position.
* @public
* @type {og.Vec3}
* @type {Vec3}
*/
this.mousePositionOnEarth = new Vec3();
@ -212,7 +212,7 @@ export class Planet extends RenderNode {
/**
* Planet's segments collected for rendering frame.
* @protected
* @type {og.quadTree.Node}
* @type {quadTree.Node}
*/
this._renderedNodes = [];
this._renderedNodesInFrustum = [];
@ -220,42 +220,42 @@ export class Planet extends RenderNode {
/**
* Created nodes cache
* @protected
* @type {og.quadTree.Node}
* @type {quadTree.Node}
*/
this._quadTreeNodesCacheMerc = {};
/**
* Current visible mercator segments tree nodes array.
* @protected
* @type {og.quadTree.Node}
* @type {quadTree.Node}
*/
this._visibleNodes = {};
/**
* Current visible north pole nodes tree nodes array.
* @protected
* @type {og.quadTree.Node}
* @type {quadTree.Node}
*/
this._visibleNodesNorth = {};
/**
* Current visible south pole nodes tree nodes array.
* @protected
* @type {og.quadTree.Node}
* @type {quadTree.Node}
*/
this._visibleNodesSouth = {};
/**
* Layers activity lock.
* @public
* @type {og.idle.Lock}
* @type {idle.Lock}
*/
this.layerLock = new Lock();
/**
* Terrain providers activity lock.
* @public
* @type {og.idle.Lock}
* @type {idle.Lock}
*/
this.terrainLock = new Lock();
@ -298,21 +298,21 @@ export class Planet extends RenderNode {
/**
* Mercator grid tree.
* @protected
* @type {og.quadTree.Node}
* @type {quadTree.Node}
*/
this._quadTree = null;
/**
* North grid tree.
* @protected
* @type {og.quadTree.Node}
* @type {quadTree.Node}
*/
this._quadTreeNorth = null;
/**
* South grid tree.
* @protected
* @type {og.quadTree.Node}
* @type {quadTree.Node}
*/
this._quadTreeSouth = null;
@ -378,7 +378,7 @@ export class Planet extends RenderNode {
/**
* GeoImage creator.
* @protected
* @type{og.utils.GeoImageCreator}
* @type{utils.GeoImageCreator}
*/
this._geoImageCreator = null;
@ -415,7 +415,7 @@ export class Planet extends RenderNode {
/**
* Add the given control to the renderer of the planet scene.
* @param {og.control.Control} control - Control.
* @param {control.Control} control - Control.
*/
addControl(control) {
control.planet = this;
@ -431,7 +431,7 @@ export class Planet extends RenderNode {
/**
* Add the given controls array to the renderer of the planet.
* @param {Array.<og.control.Control>} cArr - Control array.
* @param {Array.<control.Control>} cArr - Control array.
*/
addControls(cArr) {
for (var i = 0; i < cArr.length; i++) {
@ -443,7 +443,7 @@ export class Planet extends RenderNode {
* Return layer by it name
* @param {string} name - Name of the layer. og.Layer.prototype.name
* @public
* @returns {og.Layer} -
* @returns {Layer} -
*/
getLayerByName(name) {
var i = this.layers.length;
@ -456,7 +456,7 @@ export class Planet extends RenderNode {
/**
* Adds the given layer to the planet.
* @param {og.Layer} layer - Layer object.
* @param {Layer} layer - Layer object.
* @public
*/
addLayer(layer) {
@ -465,7 +465,7 @@ export class Planet extends RenderNode {
/**
* Dispatch layer visibility changing event.
* @param {og.Layer} layer - Changed layer.
* @param {Layer} layer - Changed layer.
* @protected
*/
_onLayerVisibilityChanged(layer) {
@ -474,7 +474,7 @@ export class Planet extends RenderNode {
/**
* Adds the given layers array to the planet.
* @param {Array.<og.Layer>} layers - Layers array.
* @param {Array.<Layer>} layers - Layers array.
* @public
*/
addLayers(layers) {
@ -485,8 +485,8 @@ export class Planet extends RenderNode {
/**
* Removes the given layer from the planet.
* @param {og.Layer} layer - Layer to remove.
* @return {og.Layer|undefined} The removed layer or undefined if the layer was not found.
* @param {Layer} layer - Layer to remove.
* @return {Layer|undefined} The removed layer or undefined if the layer was not found.
* @public
*/
removeLayer(layer) {
@ -496,7 +496,7 @@ export class Planet extends RenderNode {
/**
*
* @protected
* @param {og.Layer} layer - Material layer.
* @param {Layer} layer - Material layer.
*/
_clearLayerMaterial(layer) {
var lid = layer._id;
@ -511,7 +511,7 @@ export class Planet extends RenderNode {
/**
* Get the collection of layers associated with this planet.
* @return {Array.<og.Layer>} Layers array.
* @return {Array.<Layer>} Layers array.
* @public
*/
getLayers() {
@ -520,7 +520,7 @@ export class Planet extends RenderNode {
/**
* Sets base layer coverage to the planet.
* @param {og.Layer} layer - Layer object.
* @param {Layer} layer - Layer object.
* @public
*/
setBaseLayer(layer) {
@ -560,7 +560,7 @@ export class Planet extends RenderNode {
/**
* Sets terrain provider
* @public
* @param {og.terrain.Terrain} terrain - Terrain provider.
* @param {terrain.Terrain} terrain - Terrain provider.
*/
setTerrain(terrain) {
this._renderCompletedActivated = false;
@ -1457,8 +1457,8 @@ export class Planet extends RenderNode {
* Returns ray vector hit ellipsoid coordinates.
* If the ray doesn't hit ellipsoit returns null.
* @public
* @param {og.Ray} ray - Ray 3d.
* @returns {og.Vec3} -
* @param {Ray} ray - Ray 3d.
* @returns {Vec3} -
*/
getRayIntersectionEllipsoid(ray) {
return this.ellipsoid.hitRay(ray.origin, ray.direction);
@ -1467,8 +1467,8 @@ export class Planet extends RenderNode {
/**
* Returns 2d screen coordanates projection point to the planet ellipsoid 3d coordinates.
* @public
* @param {og.math.Pixel} px - 2D sreen coordinates.
* @returns {og.Vec3} -
* @param {math.Pixel} px - 2D sreen coordinates.
* @returns {Vec3} -
*/
getCartesianFromPixelEllipsoid(px) {
var cam = this.renderer.activeCamera;
@ -1478,7 +1478,7 @@ export class Planet extends RenderNode {
/**
* Returns 2d screen coordanates projection point to the planet ellipsoid geographical coordinates.
* @public
* @param {og.math.Pixel} px - 2D screen coordinates.
* @param {math.Pixel} px - 2D screen coordinates.
* @returns {LonLat} -
*/
getLonLatFromPixelEllipsoid(px) {
@ -1494,7 +1494,7 @@ export class Planet extends RenderNode {
* position or null if mouse cursor is outside the planet.
* @public
* @param {Boolean} [force=false] - Force framebuffer rendering.
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
getCartesianFromMouseTerrain(force) {
var ms = this.renderer.events.mouseState;
@ -1509,9 +1509,9 @@ export class Planet extends RenderNode {
* Returns 3d cartesian coordinates on the relief planet by 2d screen coordinates.
* position or null if input coordinates is outside the planet.
* @public
* @param {og.Vec2} px - Pixel screen 2d coordinates.
* @param {Vec2} px - Pixel screen 2d coordinates.
* @param {Boolean} [force=false] - Force framebuffer rendering.
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
getCartesianFromPixelTerrain(px, force) {
var distance = this.getDistanceFromPixel(px, force);
@ -1526,7 +1526,7 @@ export class Planet extends RenderNode {
* Returns geographical coordinates on the relief planet by 2d screen coordinates.
* position or null if input coordinates is outside the planet.
* @public
* @param {og.Vec2} px - Pixel screen 2d coordinates.
* @param {Vec2} px - Pixel screen 2d coordinates.
* @param {Boolean} [force=false] - Force framebuffer rendering.
* @returns {LonLat} -
*/
@ -1541,8 +1541,8 @@ export class Planet extends RenderNode {
/**
* Returns projected 2d screen coordinates by 3d cartesian coordiantes.
* @public
* @param {og.Vec3} coords - Cartesian coordinates.
* @returns {og.Vec2} -
* @param {Vec3} coords - Cartesian coordinates.
* @returns {Vec2} -
*/
getPixelFromCartesian(coords) {
return this.renderer.activeCamera.project(coords);
@ -1552,7 +1552,7 @@ export class Planet extends RenderNode {
* Returns projected 2d screen coordinates by geographical coordinates.
* @public
* @param {LonLat} lonlat - Geographical coordinates.
* @returns {og.Vec2} -
* @returns {Vec2} -
*/
getPixelFromLonLat(lonlat) {
var coords = this.ellipsoid.lonLatToCartesian(lonlat);
@ -1566,7 +1566,7 @@ export class Planet extends RenderNode {
* Returns distance from active camera to the the planet ellipsoid
* coordiantes unprojected by 2d screen coordiantes, or null if screen coordinates outside the planet.
* @public
* @param {og.Vec2} px - Screen coordinates.
* @param {Vec2} px - Screen coordinates.
* @returns {number} -
*/
getDistanceFromPixelEllipsoid(px) {
@ -1580,7 +1580,7 @@ export class Planet extends RenderNode {
* If screen coordinates inside the planet but relief is not exists in the
* point than function returns distance to the planet ellipsoid.
* @public
* @param {og.Vec2} px - Screen coordinates.
* @param {Vec2} px - Screen coordinates.
* @param {Boolean} [force=false] - Force framebuffer rendering.
* @returns {number} -
*/
@ -1624,7 +1624,7 @@ export class Planet extends RenderNode {
/**
* Sets camera to the planet geographical extent.
* @public
* @param {og.Extent} extent - Geographical extent.
* @param {Extent} extent - Geographical extent.
*/
viewExtent(extent) {
this.renderer.activeCamera.viewExtent(extent);
@ -1648,7 +1648,7 @@ export class Planet extends RenderNode {
/**
* Gets current viewing geographical extent.
* @public
* @returns {og.Extent} -
* @returns {Extent} -
*/
getViewExtent() {
return this._viewExtent;
@ -1680,7 +1680,7 @@ export class Planet extends RenderNode {
* Sets camera to the planet geographical position.
* @public
* @param {LonLat} lonlat - New geographical position.
* @param {og.Vec3} [up] - Camera UP vector.
* @param {Vec3} [up] - Camera UP vector.
*/
viewLonLat(lonlat, up) {
this.renderer.activeCamera.setLonLat(lonlat, up);
@ -1689,9 +1689,9 @@ export class Planet extends RenderNode {
/**
* Fly camera to the planet geographical extent.
* @public
* @param {og.Extent} extent - Geographical extent.
* @param {Extent} extent - Geographical extent.
* @param {Number} [height] - Height on the end of the flight route.
* @param {og.Vec3} [up] - Camera UP vector on the end of a flying.
* @param {Vec3} [up] - Camera UP vector on the end of a flying.
* @param {Number} [ampl] - Altitude amplitude factor.
* @param {cameraCallback} [startCallback] - Callback that calls after flying when flying is finished.
* @param {cameraCallback} [completeCallback] - Callback that calls befor the flying begins.
@ -1710,9 +1710,9 @@ export class Planet extends RenderNode {
/**
* Fly camera to the new point.
* @public
* @param {og.Vec3} cartesian - Fly coordiantes.
* @param {og.Vec3} [look] - Camera "look at" point.
* @param {og.Vec3} [up] - Camera UP vector on the end of a flying.
* @param {Vec3} cartesian - Fly coordiantes.
* @param {Vec3} [look] - Camera "look at" point.
* @param {Vec3} [up] - Camera UP vector on the end of a flying.
* @param {Number} [ampl] - Altitude amplitude factor.
* @param [completeCallback]
* @param [startCallback]
@ -1734,8 +1734,8 @@ export class Planet extends RenderNode {
* Fly camera to the new geographical position.
* @public
* @param {LonLat} lonlat - Fly geographical coordiantes.
* @param {og.Vec3} [look] - Camera "look at" point on the end of a flying.
* @param {og.Vec3} [up] - Camera UP vector on the end of a flying.
* @param {Vec3} [look] - Camera "look at" point on the end of a flying.
* @param {Vec3} [up] - Camera UP vector on the end of a flying.
* @param {Number} [ampl] - Altitude amplitude factor.
* @param [completeCallback]
* @param [startCallback]

View File

@ -20,7 +20,7 @@ class RenderNode extends BaseNode {
/**
* Renderer that calls frame() callback.
* @public
* @type {og.Renderer}
* @type {Renderer}
*/
this.renderer = null;
@ -43,7 +43,7 @@ class RenderNode extends BaseNode {
/**
* Point light array.
* @private
* @type {Array.<og.LightSource>}
* @type {Array.<LightSource>}
*/
this._lights = [];
this._lightsTransformedPositions = [];
@ -54,7 +54,7 @@ class RenderNode extends BaseNode {
/**
* Entity collection array.
* @public
* @type {Array.<og.EntityCollection>}
* @type {Array.<EntityCollection>}
*/
this.entityCollections = [];
@ -66,7 +66,7 @@ class RenderNode extends BaseNode {
/**
* Adds node to the current hierarchy.
* @public
* @type {og.RenderNode}
* @type {RenderNode}
*/
addNode(node) {
super.addNode(node);
@ -76,7 +76,7 @@ class RenderNode extends BaseNode {
/**
* Assign render node with renderer.
* @public
* @param {og.Renderer} renderer - Redner node's renderer.
* @param {Renderer} renderer - Redner node's renderer.
*/
assign(renderer) {
this.renderer = renderer;
@ -119,9 +119,9 @@ class RenderNode extends BaseNode {
/**
* Adds entity collection.
* @public
* @param {og.EntityCollection} entityCollection - Entity collection.
* @param {EntityCollection} entityCollection - Entity collection.
* @param {boolean} [isHidden] - If it's true that this collection has specific rendering.
* @returns {og.scene.RenderNode} -
* @returns {scene.RenderNode} -
*/
addEntityCollection(entityCollection, isHidden) {
entityCollection.addTo(this, isHidden);
@ -131,7 +131,7 @@ class RenderNode extends BaseNode {
/**
* Removes entity collection.
* @public
* @param {og.EntityCollection} entityCollection - Entity collection for remove.
* @param {EntityCollection} entityCollection - Entity collection for remove.
*/
removeEntityCollection(entityCollection) {
entityCollection.remove();
@ -140,8 +140,8 @@ class RenderNode extends BaseNode {
/**
* Adds point light source.
* @public
* @param {og.LightSource} light - Light source.
* @returns {og.scene.RenderNode}
* @param {LightSource} light - Light source.
* @returns {scene.RenderNode}
*/
addLight(light) {
light.addTo(this);
@ -152,7 +152,7 @@ class RenderNode extends BaseNode {
* Gets light object by its name.
* @public
* @param {string} name - Point light name.
* @returns {og.LightSource}
* @returns {LightSource}
*/
getLightByName(name) {
var li = this._lightsNames.indexOf(name);
@ -162,7 +162,7 @@ class RenderNode extends BaseNode {
/**
* Removes light source.
* @public
* @param {og.LightSource} light - Light source object.
* @param {LightSource} light - Light source object.
*/
removeLight(light) {
light.remove();

View File

@ -58,10 +58,10 @@ window.BBSC = 100;
/**
* Planet segment Web Mercator tile class that stored and rendered with quad tree.
* @class
* @param {og.quadTree.Node} node - Segment node.
* @param {og.scene.Planet} planet - Current planet scene.
* @param {quadTree.Node} node - Segment node.
* @param {scene.Planet} planet - Current planet scene.
* @param {Number} tileZoom - Zoom index.
* @param {og.Extent} extent - Segment extent.
* @param {Extent} extent - Segment extent.
*/
class Segment {
/**
@ -79,25 +79,25 @@ class Segment {
/**
* Quad tree node of the segment.
* @type {og.quadTree.Node}
* @type {quadTree.Node}
*/
this.node = node;
/**
* Planet pointer.
* @type {og.scene.Planet}
* @type {scene.Planet}
*/
this.planet = planet;
/**
* WebGl handler pointer.
* @type {og.webgl.Handler}
* @type {webgl.Handler}
*/
this.handler = planet.renderer.handler;
/**
* Segment bounding sphere
* @type {og.bv.Sphere}
* @type {bv.Sphere}
*/
this.bsphere = new Sphere();
@ -105,7 +105,7 @@ class Segment {
/**
* Segment bounding box.
* @type {og.bv.Box}
* @type {bv.Box}
*/
this.bbox = new Box();
@ -116,7 +116,7 @@ class Segment {
/**
* Geographical extent.
* @type {og.Extent}
* @type {Extent}
*/
this._extent = extent;
@ -162,7 +162,7 @@ class Segment {
/**
* Texture materials array.
* @type {Array.<og.planetSegment.Material>}
* @type {Array.<planetSegment.Material>}
*/
this.materials = [];
@ -252,7 +252,7 @@ class Segment {
/**
* Returns that segment good for rendering with camera by current lod ratio.
* @public
* @param {og.Camera} camera - Camera object.
* @param {Camera} camera - Camera object.
* @returns {boolean} -
*/
acceptForRendering(camera) {
@ -265,10 +265,10 @@ class Segment {
/**
* Returns entity terrain point.
* @public
* @param {og.Entity} entity - Entity.
* @param {og.Vec3} res - Point coordinates.
* @param {og.Vec3} [normal] - Terrain point normal.
* @returns {og.Vec3} -
* @param {Entity} entity - Entity.
* @param {Vec3} res - Point coordinates.
* @param {Vec3} [normal] - Terrain point normal.
* @returns {Vec3} -
*/
getEntityTerrainPoint(entity, res, normal) {
return this.getTerrainPoint(entity._cartesian, entity._lonlatMerc, res, normal);
@ -281,10 +281,10 @@ class Segment {
/**
* Returns distance from object to terrain coordinates and terrain point that calculates out in the res parameter.
* @public
* @param {og.Vec3} xyz - Cartesian object position.
* @param {Vec3} xyz - Cartesian object position.
* @param {LonLat} insideSegmentPosition - Geodetic object position.
* @param {og.Vec3} [res] - Result cartesian coordiantes on the terrain.
* @param {og.Vec3} [normal] - Terrain point normal.
* @param {Vec3} [res] - Result cartesian coordiantes on the terrain.
* @param {Vec3} [normal] - Terrain point normal.
* @returns {number} -
*/
getTerrainPoint(xyz, insideSegmentPosition, res, normal) {
@ -375,6 +375,10 @@ class Segment {
return lonlat.forwardMercator();
}
/**
*
* @param {boolean} forceLoading
*/
loadTerrain(forceLoading) {
if (this.tileZoom < this.planet.terrain.minZoom) {
this.terrainIsLoading = true;
@ -1434,8 +1438,8 @@ class Segment {
/**
* Gets specific layer material.
* @public
* @param {og.Layer} layer - Layer object.
* @returns {og.planetSegment.Material} - Segment material.
* @param {Layer} layer - Layer object.
* @returns {planetSegment.Material} - Segment material.
*/
getMaterialByLayer(layer) {
return this.materials[layer._id];

View File

@ -20,10 +20,10 @@ let _tempHigh = new Vec3(),
* Planet segment Web Mercator tile class that stored and rendered with quad tree.
* @class
* @extends {Segment}
* @param {og.quadNode.Node} node - Quad tree segment node.
* @param {og.scene.Planet} planet - Scene planet.
* @param {quadNode.Node} node - Quad tree segment node.
* @param {scene.Planet} planet - Scene planet.
* @param {Number} tileZoom - Segment tile zoom index.
* @param {og.Extent} extent - Segment WGS84 extent.
* @param {Extent} extent - Segment WGS84 extent.
*/
class SegmentLonLat extends Segment {
/**

View File

@ -12,9 +12,9 @@ import { Mat4 } from '../math/Mat4.js';
* Base geometry shape class.
* @class
* @param {Object} options - Shape parameters:
* @param {og.Vec3} [options.position] - Shape position.
* @param {og.Quat} [options.orientation] - Shape orientation(rotation).
* @param {og.Vec3} [options.scale] - Scale vector.
* @param {Vec3} [options.position] - Shape position.
* @param {Quat} [options.orientation] - Shape orientation(rotation).
* @param {Vec3} [options.scale] - Scale vector.
* @param {Array.<number>} [options.color] - Shape RGBA color. (exactly 4 entries)
* @param {string} [options.src] - Texture image url source.
* @param {boolean} [options.visibility] - Shape visibility.
@ -36,21 +36,21 @@ class BaseShape {
/**
* Shape position.
* @public
* @type {og.Vec3}
* @type {Vec3}
*/
this.position = options.position || new Vec3();
/**
* Shape orientation(rotation)
* @public
* @type {og.Quat}
* @type {Quat}
*/
this.orientation = options.orientation || new Quat(0.0, 0.0, 0.0, 1.0);
/**
* Scale.
* @public
* @type {og.Vec3}
* @type {Vec3}
*/
this.scale = options.scale || new Vec3(1.0, 1.0, 1.0);
@ -130,21 +130,21 @@ class BaseShape {
/**
* Scale matrix.
* @protected
* @type {og.Mat4}
* @type {Mat4}
*/
this._mxScale = new Mat4().setIdentity().scale(this.scale);
/**
* Translation matrix.
* @protected
* @type {og.Mat4}
* @type {Mat4}
*/
this._mxTranslation = new Mat4().setIdentity();
/**
* Model matrix.
* @protected
* @type {og.Mat4}
* @type {Mat4}
*/
this._mxModel = new Mat4().setIdentity();
@ -157,7 +157,7 @@ class BaseShape {
/**
* Assigned render node.
* @protected
* @type {og.scene.RenderNode}
* @type {scene.RenderNode}
*/
this._renderNode = null;
@ -171,14 +171,14 @@ class BaseShape {
/**
* Entity instance that holds this shape.
* @protected
* @type {og.Entity}
* @type {Entity}
*/
this._entity = null;
/**
* Handler that stores and renders this shape object.
* @protected
* @type {og.ShapeHandler}
* @type {ShapeHandler}
*/
this._handler = null;
@ -240,7 +240,7 @@ class BaseShape {
/**
* Sets shape color.
* @public
* @param {og.Vec4} color - RGBA color vector.
* @param {Vec4} color - RGBA color vector.
*/
setColor4v(color) {
this.color[0] = color.x;
@ -296,7 +296,7 @@ class BaseShape {
/**
* Assign render node.
* @public
* @param {og.scene.RenderNode} renderNode - Render node to assign.
* @param {scene.RenderNode} renderNode - Render node to assign.
*/
setRenderNode(renderNode) {
this._renderNode = renderNode;
@ -314,7 +314,7 @@ class BaseShape {
/**
* Sets shape position.
* @public
* @param {og.Vec3} position - Shape position.
* @param {Vec3} position - Shape position.
*/
setPosition3v(position) {
this.position.copy(position);
@ -325,7 +325,7 @@ class BaseShape {
/**
* Translate shape position to vector.
* @public
* @param {og.Vec3} vec - Translation vector.
* @param {Vec3} vec - Translation vector.
*/
translate3v(vec) {
this.position.addA(vec);
@ -334,7 +334,7 @@ class BaseShape {
/**
* Sets shape scale.
* @param {og.Vec3} scale - Scale vector.
* @param {Vec3} scale - Scale vector.
*/
setScale3v(scale) {
this.scale.copy(scale);
@ -358,7 +358,7 @@ class BaseShape {
/**
* Assign picking color.
* @protected
* @param {og.Vec3} color - Picking RGB color.
* @param {Vec3} color - Picking RGB color.
*/
setPickingColor3v(color) {
//...

View File

@ -10,9 +10,9 @@ import { BaseShape } from './BaseShape.js';
* @class
* @extends {BaseShape}
* @param {Object} options - Icosphere parameters:
* @param {og.Vec3} [options.position] - Icosphere position.
* @param {og.Quat} [options.orientation] - Icosphere orientation(rotation).
* @param {og.Vec3} [options.scale] - Scale vector.
* @param {Vec3} [options.position] - Icosphere position.
* @param {Quat} [options.orientation] - Icosphere orientation(rotation).
* @param {Vec3} [options.scale] - Scale vector.
* @param {Array.<number>} [options.color] - Icosphere RGBA color. (exactly 4 entries)
* @param {string} [options.src] - Texture image url source.
* @param {boolean} [options.visibility] - Icosphere visibility.

View File

@ -10,9 +10,9 @@ import { BaseShape } from './BaseShape.js';
* @class
* @extends {BaseShape}
* @param {Object} options - Sphere parameters:
* @param {og.Vec3} [options.position] - Sphere position.
* @param {og.Quat} [options.orientation] - Sphere orientation(rotation).
* @param {og.Vec3} [options.scale] - Scale vector.
* @param {Vec3} [options.position] - Sphere position.
* @param {Quat} [options.orientation] - Sphere orientation(rotation).
* @param {Vec3} [options.scale] - Scale vector.
* @param {Array.<number>} [options.color] - Sphere RGBA color. (exactly 4 entries)
* @param {string} [options.src] - Texture image url source.
* @param {boolean} [options.visibility] - Sphere visibility.

View File

@ -58,7 +58,7 @@ class EmptyTerrain {
/**
* Planet node.
* @protected
* @type {og.scene.Planet}
* @type {scene.Planet}
*/
this._planet = null;
@ -117,7 +117,7 @@ class EmptyTerrain {
* Loads or creates segment elevation data.
* @public
* @virtual
* @param {og.planetSegment.Segment} segment - Segment to create elevation data.
* @param {planetSegment.Segment} segment - Segment to create elevation data.
*/
handleSegmentTerrain(segment) {
segment.terrainIsLoading = false;

View File

@ -17,7 +17,6 @@ import { Vec3 } from "../math/Vec3.js";
import { Ray } from "../math/Ray.js";
import { Extent } from "../Extent.js";
import { LonLat } from "../LonLat.js";
import { MAX_NORMAL_ZOOM } from "../segment/Segment.js";
const EVENT_NAMES = [
/**
@ -63,7 +62,7 @@ class GlobusTerrain extends EmptyTerrain {
/**
* Events handler.
* @public
* @type {og.Events}
* @type {Events}
*/
this.events = new Events(EVENT_NAMES, this);
@ -140,7 +139,7 @@ class GlobusTerrain extends EmptyTerrain {
* Rewrites elevation storage url query.
* @private
* @callback og.terrain.GlobusTerrain~_urlRewriteCallback
* @param {og.planetSegment.Segment} segment - Segment to load.
* @param {planetSegment.Segment} segment - Segment to load.
* @param {string} url - Created url.
* @returns {string} - Url query string.
*/
@ -350,7 +349,8 @@ class GlobusTerrain extends EmptyTerrain {
* Starts to load segment data.
* @public
* @virtual
* @param {og.planetSegment.Segment} segment - Segment that wants a terrain data.
* @param {Segment} segment - Segment that wants a terrain data.
* @param {boolean} forceLoading
*/
loadTerrain(segment, forceLoading) {
if (this._planet.terrainLock.isFree()) {
@ -400,7 +400,7 @@ class GlobusTerrain extends EmptyTerrain {
* Creates query url.
* @protected
* @virtual
* @param {og.planetSegment.Segment} segment -
* @param {planetSegment.Segment} segment -
* @returns {string} -
*/
_createUrl(segment) {
@ -414,7 +414,7 @@ class GlobusTerrain extends EmptyTerrain {
/**
* Returns actual url query string.
* @protected
* @param {og.planetSegment.Segment} segment - Segment that loads image data.
* @param {planetSegment.Segment} segment - Segment that loads image data.
* @returns {string} - Url string.
*/
_getHTTPRequestString(segment) {
@ -426,7 +426,7 @@ class GlobusTerrain extends EmptyTerrain {
/**
* Sets url rewrite callback, used for custom url rewriting for every tile laoding.
* @public
* @param {og.terrain.GlobusTerrain~_urlRewriteCallback} ur - The callback that returns tile custom created url.
* @param {terrain.GlobusTerrain~_urlRewriteCallback} ur - The callback that returns tile custom created url.
*/
setUrlRewriteCallback(ur) {
this._urlRewriteCallback = ur;
@ -445,7 +445,7 @@ class GlobusTerrain extends EmptyTerrain {
/**
* @protected
* @param {og.planetSegment.Segment} segment -
* @param {planetSegment.Segment} segment -
* @param {*} data -
*/
_applyElevationsData(segment, elevations) {

View File

@ -17,7 +17,7 @@ class TextureAtlas {
/**
* Atlas nodes where input images store. It can be access by image.__nodeIndex.
* @public
* @type {Array.<og.utils.TextureAtlasNode >}
* @type {Array.<utils.TextureAtlasNode >}
*/
this.nodes = [];
@ -71,7 +71,7 @@ class TextureAtlas {
/**
* Sets openglobus gl handler that creates gl texture.
* @public
* @param {og.webgl.Handler} handler - WebGL handler.
* @param {webgl.Handler} handler - WebGL handler.
*/
assignHandler(handler) {
this._handler = handler;
@ -95,7 +95,7 @@ class TextureAtlas {
* @param {Object} image - Input javascript image object.
* @param {boolean} [fastInsert] - If it's true atlas doesnt restore all images again
* and store image in the curent atlas sheme.
* @returns {og.utils.TextureAtlasNode} -
* @returns {utils.TextureAtlasNode} -
*/
addImage(image, fastInsert) {
@ -215,7 +215,7 @@ class TextureAtlas {
/**
* Atlas binary tree node.
* @class
* @param {og.Rectangle} rect - Node image rectangle.
* @param {Rectangle} rect - Node image rectangle.
*/
class TextureAtlasNode {
constructor(rect, texCoords) {

View File

@ -56,7 +56,7 @@ export function readTextFile(fileUrl) {
* Convert html color string to the RGBA number vector.
* @param {string} htmlColor - HTML string("#C6C6C6" or "#EF5" or "rgb(8,8,8)" or "rgba(8,8,8)") color.
* @param {number} [opacity] - Opacity for the output vector.
* @returns {og.math.Vec4} -
* @returns {math.Vec4} -
*/
export function htmlColorToRgba(htmlColor, opacity) {
var hColor = colorTable[htmlColor];
@ -99,7 +99,7 @@ export function htmlColorToFloat32Array(htmlColor, opacity) {
* Convert html color string to the RGB number vector.
* @param {string} htmlColor - HTML string("#C6C6C6" or "#EF5" or "rgb(8,8,8)" or "rgba(8,8,8)") color.
* @param {number} [opacity] - Opacity for the output vector.
* @returns {og.Vec3} -
* @returns {Vec3} -
*/
export function htmlColorToRgb(htmlColor) {
var hColor = colorTable[htmlColor];
@ -283,7 +283,7 @@ export function binarySearchFast(arr, x) {
* Finds an item in a sorted array.
* @param {Array} ar The sorted array to search.
* @param {Object} el The item to find in the array.
* @param {og.utils.binarySearch~compare_fn} compare_fn comparator The function to use to compare the item to
* @param {utils.binarySearch~compare_fn} compare_fn comparator The function to use to compare the item to
* elements in the array.
* @returns {Number} a negative number if a is less than b; 0 if a is equal to b;a positive number of a is greater than b.
*
@ -316,7 +316,7 @@ export function binarySearch(ar, el, compare_fn) {
* Binary insertion that uses binarySearch algorithm.
* @param {Array} ar - The sorted array to insert.
* @param {Object} el - The item to insert.
* @param {og.utils.binarySearch~compare_fn} compare_fn - comparator The function to use to compare the item to
* @param {utils.binarySearch~compare_fn} compare_fn - comparator The function to use to compare the item to
* elements in the array.
* @returns {Number} Array index position in which item inserted in.
*/
@ -332,12 +332,12 @@ export function binaryInsert(ar, el, compare_fn) {
/**
* Returns two segment lines intersection coordinate.
* @static
* @param {og.math.Vec2} start1 - First line first coordinate.
* @param {og.math.Vec2} end1 - First line second coordinate.
* @param {og.math.Vec2} start2 - Second line first coordinate.
* @param {og.math.Vec2} end2 - Second line second coordinate.
* @param {math.Vec2} start1 - First line first coordinate.
* @param {math.Vec2} end1 - First line second coordinate.
* @param {math.Vec2} start2 - Second line first coordinate.
* @param {math.Vec2} end2 - Second line second coordinate.
* @param {boolean} [isSegment] - Lines are segments.
* @return {og.math.Vec2} - Intersection coordinate.
* @return {math.Vec2} - Intersection coordinate.
*/
export function getLinesIntersection2v(start1, end1, start2, end2, isSegment) {
var dir1 = end1.sub(start1);
@ -372,12 +372,12 @@ export function getLinesIntersection2v(start1, end1, start2, end2, isSegment) {
/**
* Returns two segment lines intersection coordinate.
* @static
* @param {og.math.Vec2} start1 - First line first coordinate.
* @param {og.math.Vec2} end1 - First line second coordinate.
* @param {og.math.Vec2} start2 - Second line first coordinate.
* @param {og.math.Vec2} end2 - Second line second coordinate.
* @param {math.Vec2} start1 - First line first coordinate.
* @param {math.Vec2} end1 - First line second coordinate.
* @param {math.Vec2} start2 - Second line first coordinate.
* @param {math.Vec2} end2 - Second line second coordinate.
* @param {boolean} [isSegment] - Lines are segments.
* @return {og.math.Vec2} - Intersection coordinate.
* @return {math.Vec2} - Intersection coordinate.
*/
export function getLinesIntersectionLonLat(start1, end1, start2, end2, isSegment) {
var dir1 = new LonLat(end1.lon - start1.lon, end1.lat - start1.lat);

View File

@ -9,7 +9,7 @@ import { ImageCanvas } from '../ImageCanvas.js';
/**
* Class represents framebuffer.
* @class
* @param {og.webgl.Handler} handler - WebGL handler.
* @param {webgl.Handler} handler - WebGL handler.
* @param {Object} [options] - Framebuffer options:
* @param {number} [options.width] - Framebuffer width. Default is handler canvas width.
* @param {number} [options.height] - Framebuffer height. Default is handler canvas height.
@ -27,7 +27,7 @@ export class Framebuffer {
/**
* WebGL handler.
* @public
* @type {og.webgl.Handler}
* @type {webgl.Handler}
*/
this.handler = handler;
@ -269,7 +269,7 @@ export class Framebuffer {
/**
* Activate framebuffer frame to draw.
* @public
* @returns {og.webgl.Framebuffer} Returns Current framebuffer.
* @returns {webgl.Framebuffer} Returns Current framebuffer.
*/
activate() {
var gl = this.handler.gl;

View File

@ -40,14 +40,14 @@ class Handler {
/**
* Application default timer.
* @public
* @type {og.Clock}
* @type {Clock}
*/
this.defaultClock = new Clock();
/**
* Custom timers.
* @protected
* @type{og.Clock[]}
* @type{Clock[]}
*/
this._clocks = [];
@ -83,7 +83,7 @@ class Handler {
/**
* Current active shader program controller.
* @public
* @type {og.webgl.ProgramController}
* @type {webgl.ProgramController}
*/
this.activeProgram = null;
@ -483,9 +483,9 @@ class Handler {
/**
* Adds shader program to the handler.
* @public
* @param {og.webgl.Program} program - Shader program.
* @param {webgl.Program} program - Shader program.
* @param {boolean} [notActivate] - If it's true program will not compile.
* @return {og.webgl.Program} -
* @return {webgl.Program} -
*/
addProgram(program, notActivate) {
if (!this.programs[program.name]) {
@ -515,7 +515,7 @@ class Handler {
/**
* Adds shader programs to the handler.
* @public
* @param {Array.<og.webgl.Program>} programsArr - Shader program array.
* @param {Array.<webgl.Program>} programsArr - Shader program array.
*/
addPrograms(programsArr) {
for (var i = 0; i < programsArr.length; i++) {
@ -526,7 +526,7 @@ class Handler {
/**
* Used in addProgram
* @private
* @param {og.webgl.ProgramController} sc - Program controller
* @param {webgl.ProgramController} sc - Program controller
*/
_initProgramController(sc) {
if (this._initialized) {

View File

@ -7,7 +7,7 @@
/**
* Class represents multisample framebuffer.
* @class
* @param {og.webgl.Handler} handler - WebGL handler.
* @param {webgl.Handler} handler - WebGL handler.
* @param {Object} [options] - Framebuffer options:
* @param {number} [options.width] - Framebuffer width. Default is handler canvas width.
* @param {number} [options.height] - Framebuffer height. Default is handler canvas height.
@ -24,7 +24,7 @@ export class Multisample {
/**
* WebGL handler.
* @public
* @type {og.webgl.Handler}
* @type {webgl.Handler}
*/
this.handler = handler;
@ -193,7 +193,7 @@ export class Multisample {
/**
* Activate framebuffer frame to draw.
* @public
* @returns {og.webgl.Framebuffer} Returns Current framebuffer.
* @returns {webgl.Framebuffer} Returns Current framebuffer.
*/
activate() {
var gl = this.handler.gl;

View File

@ -122,7 +122,7 @@ class Program {
/**
* Bind program buffer.
* @function
* @param {og.webgl.Program} program - Used program.
* @param {webgl.Program} program - Used program.
* @param {Object} variable - Variable represents buffer data.
*/
static bindBuffer(program, variable) {

View File

@ -5,8 +5,8 @@
* program capabilities, like switching program during the rendering.
* Get access to the program from ...handler.programs.<program name> etc.
* @class
* @param {og.webgl.Handler} handler - Handler.
* @param {og.webgl.Program} program - Shader program.
* @param {webgl.Handler} handler - Handler.
* @param {webgl.Program} program - Shader program.
*/
export class ProgramController {
@ -15,14 +15,14 @@ export class ProgramController {
/**
* Shader program.
* @private
* @type {og.webgl.Program}
* @type {webgl.Program}
*/
this._program = program;
/**
* Handler.
* @private
* @type {og.webgl.Handler}
* @type {webgl.Handler}
*/
this._handler = handler;
@ -45,7 +45,7 @@ export class ProgramController {
/**
* Returns controller's shader program.
* @public
* @return {og.webgl.Program} -
* @return {webgl.Program} -
*/
getProgram() {
return this._program;
@ -106,7 +106,7 @@ export class ProgramController {
* Sets program uniforms and attributes values and return controller instance.
* @public
* @param {Object} params - Object with variable name and value like { value: 12, someArray:[1,2,3], uSampler: texture,... }
* @return {og.webgl.ProgramController} -
* @return {webgl.ProgramController} -
*/
set(params) {
this.activate();
@ -119,7 +119,7 @@ export class ProgramController {
* @public
* @param {number} mode - Gl draw mode
* @param {WEBGLBuffer} buffer - Buffer to draw.
* @return {og.webgl.ProgramController} Returns current shader controller instance.
* @return {webgl.ProgramController} Returns current shader controller instance.
*/
drawIndexBuffer(mode, buffer) {
this._program.drawIndexBuffer(mode, buffer);
@ -130,7 +130,7 @@ export class ProgramController {
* Calls Gl drawArray function.
* @param {number} mode - Gl draw mode.
* @param {number} numItems - draw items count.
* @return {og.webgl.ProgramController} Returns current shader controller instance.
* @return {webgl.ProgramController} Returns current shader controller instance.
*/
drawArrays(mode, numItems) {
this._program.drawArrays(mode, numItems);