@openglobus/og 0.11.1 → 0.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +18 -20
- package/src/og/Clock.js +11 -11
- package/src/og/Deferred.js +1 -1
- package/src/og/Events.js +9 -7
- package/src/og/Extent.js +117 -72
- package/src/og/Globe.js +35 -22
- package/src/og/ImageCanvas.js +24 -18
- package/src/og/Lock.js +2 -2
- package/src/og/LonLat.js +40 -37
- package/src/og/Popup.js +21 -15
- package/src/og/QueueArray.js +7 -3
- package/src/og/Rectangle.js +11 -6
- package/src/og/Stack.js +8 -5
- package/src/og/ajax.js +21 -33
- package/src/og/astro/astro.js +5 -5
- package/src/og/astro/earth.js +23 -17
- package/src/og/astro/jd.js +44 -39
- package/src/og/astro/orbit.js +20 -18
- package/src/og/astro/rotation.js +17 -8
- package/src/og/bv/Box.js +7 -3
- package/src/og/bv/Sphere.js +17 -9
- package/src/og/camera/Camera.js +137 -86
- package/src/og/camera/Frustum.js +30 -19
- package/src/og/camera/PlanetCamera.js +30 -26
- package/src/og/control/CompassButton.js +8 -2
- package/src/og/control/Control.js +13 -11
- package/src/og/control/DebugInfo.js +4 -1
- package/src/og/control/EarthCoordinates.js +62 -41
- package/src/og/control/EarthNavigation.js +20 -22
- package/src/og/control/GeoImageDragControl.js +1 -1
- package/src/og/control/KeyboardNavigation.js +12 -12
- package/src/og/control/LayerSwitcher.js +24 -23
- package/src/og/control/Lighting.js +1 -1
- package/src/og/control/MouseNavigation.js +1 -1
- package/src/og/control/ScaleControl.js +1 -1
- package/src/og/control/SegmentBoundVisualization.js +8 -9
- package/src/og/control/ShowFps.js +15 -10
- package/src/og/control/SimpleNavigation.js +8 -10
- package/src/og/control/Sun.js +25 -15
- package/src/og/control/ToggleWireframe.js +5 -5
- package/src/og/control/TouchNavigation.js +58 -45
- package/src/og/control/ZoomControl.js +41 -25
- package/src/og/control/index.js +4 -0
- package/src/og/ellipsoid/Ellipsoid.js +181 -85
- package/src/og/ellipsoid/wgs84.js +4 -4
- package/src/og/entity/BaseBillboard.js +97 -44
- package/src/og/entity/Billboard.js +15 -11
- package/src/og/entity/BillboardHandler.js +314 -64
- package/src/og/entity/Entity.js +106 -74
- package/src/og/entity/EntityCollection.js +72 -49
- package/src/og/entity/GeoObject.js +228 -0
- package/src/og/entity/GeoObjectHandler.js +910 -0
- package/src/og/entity/Geometry.js +29 -26
- package/src/og/entity/GeometryHandler.js +598 -126
- package/src/og/entity/Label.js +74 -40
- package/src/og/entity/LabelHandler.js +47 -246
- package/src/og/entity/LabelWorker.js +213 -0
- package/src/og/entity/Object3d.js +504 -0
- package/src/og/entity/PointCloud.js +81 -33
- package/src/og/entity/PointCloudHandler.js +9 -9
- package/src/og/entity/Polyline.js +39 -39
- package/src/og/entity/Ray.js +61 -28
- package/src/og/entity/ShapeHandler.js +1 -1
- package/src/og/entity/Strip.js +77 -48
- package/src/og/entity/StripHandler.js +27 -27
- package/src/og/entity/index.js +8 -16
- package/src/og/input/KeyboardHandler.js +107 -104
- package/src/og/input/MouseHandler.js +81 -78
- package/src/og/input/TouchHandler.js +55 -51
- package/src/og/layer/BaseGeoImage.js +61 -30
- package/src/og/layer/CanvasTiles.js +26 -24
- package/src/og/layer/GeoImage.js +10 -10
- package/src/og/layer/GeoTexture2d.js +1 -1
- package/src/og/layer/GeoVideo.js +3 -3
- package/src/og/layer/KML.js +66 -40
- package/src/og/layer/Layer.js +27 -17
- package/src/og/layer/Material.js +93 -61
- package/src/og/layer/Vector.js +118 -72
- package/src/og/layer/WMS.js +36 -19
- package/src/og/layer/XYZ.js +55 -48
- package/src/og/light/LightSource.js +47 -40
- package/src/og/math/Line2.js +24 -24
- package/src/og/math/Line3.js +103 -102
- package/src/og/math/Mat3.js +134 -121
- package/src/og/math/Mat4.js +603 -459
- package/src/og/math/Plane.js +21 -20
- package/src/og/math/Quat.js +980 -927
- package/src/og/math/Ray.js +195 -187
- package/src/og/math/Vec2.js +127 -117
- package/src/og/math/Vec3.js +206 -176
- package/src/og/math/Vec4.js +49 -53
- package/src/og/math/coder.js +18 -18
- package/src/og/math.js +12 -12
- package/src/og/mercator.js +11 -11
- package/src/og/proj/EPSG3857.js +4 -4
- package/src/og/proj/EPSG4326.js +4 -4
- package/src/og/proj/Proj.js +31 -31
- package/src/og/quadTree/EntityCollectionNode.js +310 -300
- package/src/og/quadTree/Node.js +1008 -993
- package/src/og/renderer/Renderer.js +768 -747
- package/src/og/renderer/RendererEvents.js +9 -6
- package/src/og/scene/Axes.js +1 -1
- package/src/og/scene/BaseNode.js +8 -9
- package/src/og/scene/Planet.js +115 -87
- package/src/og/scene/RenderNode.js +29 -22
- package/src/og/scene/SkyBox.js +1 -1
- package/src/og/segment/Segment.js +1886 -1878
- package/src/og/segment/SegmentLonLat.js +298 -268
- package/src/og/segment/segmentHelper.js +11 -11
- package/src/og/shaders/bloom.js +1 -1
- package/src/og/shaders/blur.js +2 -2
- package/src/og/shaders/depth.js +1 -1
- package/src/og/shaders/geoObject.js +211 -0
- package/src/og/shaders/label.js +1 -1
- package/src/og/shaders/lumFilter.js +1 -1
- package/src/og/shaders/pointCloud.js +42 -42
- package/src/og/shaders/screenFrame.js +1 -1
- package/src/og/shaders/shape.js +15 -21
- package/src/og/shaders/skybox.js +37 -37
- package/src/og/shaders/toneMapping.js +1 -1
- package/src/og/shapes/BaseShape.js +129 -57
- package/src/og/shapes/Icosphere.js +30 -15
- package/src/og/shapes/Sphere.js +13 -16
- package/src/og/terrain/BilTerrain.js +2 -1
- package/src/og/terrain/EmptyTerrain.js +2 -2
- package/src/og/terrain/Geoid.js +2 -2
- package/src/og/terrain/GlobusTerrain.js +10 -10
- package/src/og/terrain/MapboxTerrain.js +1 -1
- package/src/og/utils/GeoImageCreator.js +9 -9
- package/src/og/utils/Loader.js +6 -6
- package/src/og/utils/NormalMapCreator.js +13 -13
- package/src/og/utils/TerrainWorker.js +1 -1
- package/src/og/utils/TextureAtlas.js +20 -22
- package/src/og/utils/VectorTileCreator.js +5 -5
- package/src/og/utils/earcut.js +1 -1
- package/src/og/utils/shared.js +15 -15
- package/src/og/webgl/Framebuffer.js +101 -53
- package/src/og/webgl/Handler.js +125 -85
- package/src/og/webgl/Multisample.js +55 -27
- package/src/og/webgl/Program.js +80 -35
- package/src/og/webgl/ProgramController.js +27 -23
- package/src/og/webgl/callbacks.js +8 -8
- package/types/Clock.d.ts +6 -2
- package/types/Deferred.d.ts +1 -1
- package/types/Events.d.ts +8 -4
- package/types/Extent.d.ts +37 -33
- package/types/Globe.d.ts +15 -13
- package/types/ImageCanvas.d.ts +5 -3
- package/types/LonLat.d.ts +24 -24
- package/types/Popup.d.ts +4 -0
- package/types/QueueArray.d.ts +6 -2
- package/types/Rectangle.d.ts +10 -4
- package/types/Stack.d.ts +4 -0
- package/types/ajax.d.ts +1 -1
- package/types/astro/earth.d.ts +3 -2
- package/types/bv/Box.d.ts +10 -5
- package/types/bv/Sphere.d.ts +13 -7
- package/types/camera/Camera.d.ts +90 -81
- package/types/camera/Frustum.d.ts +26 -22
- package/types/camera/PlanetCamera.d.ts +49 -53
- package/types/control/CompassButton.d.ts +4 -4
- package/types/control/Control.d.ts +7 -4
- package/types/control/DebugInfo.d.ts +3 -4
- package/types/control/EarthCoordinates.d.ts +6 -6
- package/types/control/EarthNavigation.d.ts +42 -0
- package/types/control/KeyboardNavigation.d.ts +3 -4
- package/types/control/LayerSwitcher.d.ts +3 -5
- package/types/control/Lighting.d.ts +3 -3
- package/types/control/MouseNavigation.d.ts +47 -0
- package/types/control/ScaleControl.d.ts +3 -3
- package/types/control/ShowFps.d.ts +3 -4
- package/types/control/SimpleNavigation.d.ts +3 -6
- package/types/control/Sun.d.ts +8 -10
- package/types/control/ToggleWireframe.d.ts +3 -3
- package/types/control/TouchNavigation.d.ts +48 -0
- package/types/control/ZoomControl.d.ts +3 -4
- package/types/control/index.d.ts +3 -1
- package/types/ellipsoid/Ellipsoid.d.ts +47 -43
- package/types/ellipsoid/wgs84.d.ts +3 -2
- package/types/entity/BaseBillboard.d.ts +41 -34
- package/types/entity/Billboard.d.ts +7 -7
- package/types/entity/BillboardHandler.d.ts +4 -0
- package/types/entity/Entity.d.ts +101 -83
- package/types/entity/EntityCollection.d.ts +57 -43
- package/types/entity/GeoObject.d.ts +111 -0
- package/types/entity/GeoObjectHandler.d.ts +77 -0
- package/types/entity/Geometry.d.ts +9 -7
- package/types/entity/GeometryHandler.d.ts +2 -2
- package/types/entity/Label.d.ts +24 -29
- package/types/entity/LabelHandler.d.ts +9 -2
- package/types/entity/LabelWorker.d.ts +9 -0
- package/types/entity/PointCloud.d.ts +8 -8
- package/types/entity/PointCloudHandler.d.ts +3 -3
- package/types/entity/Polyline.d.ts +58 -55
- package/types/entity/Ray.d.ts +19 -18
- package/types/entity/Strip.d.ts +8 -7
- package/types/entity/StripHandler.d.ts +3 -3
- package/types/entity/index.d.ts +7 -7
- package/types/input/KeyboardHandler.d.ts +10 -0
- package/types/input/MouseHandler.d.ts +5 -0
- package/types/input/TouchHandler.d.ts +5 -0
- package/types/layer/BaseGeoImage.d.ts +23 -35
- package/types/layer/CanvasTiles.d.ts +15 -22
- package/types/layer/GeoImage.d.ts +5 -18
- package/types/layer/GeoVideo.d.ts +5 -30
- package/types/layer/KML.d.ts +20 -15
- package/types/layer/Layer.d.ts +326 -0
- package/types/layer/Material.d.ts +45 -0
- package/types/layer/Vector.d.ts +208 -0
- package/types/layer/WMS.d.ts +4 -7
- package/types/layer/XYZ.d.ts +19 -25
- package/types/light/LightSource.d.ts +54 -53
- package/types/math/Line2.d.ts +11 -0
- package/types/math/Line3.d.ts +10 -0
- package/types/math/Mat3.d.ts +30 -18
- package/types/math/Mat4.d.ts +71 -52
- package/types/math/Plane.d.ts +5 -4
- package/types/math/Quat.d.ts +379 -0
- package/types/math/Ray.d.ts +82 -0
- package/types/math/Vec2.d.ts +102 -101
- package/types/math/Vec3.d.ts +143 -142
- package/types/math/Vec4.d.ts +40 -39
- package/types/math/coder.d.ts +12 -11
- package/types/math.d.ts +8 -8
- package/types/mercator.d.ts +3 -3
- package/types/proj/EPSG3857.d.ts +3 -2
- package/types/proj/EPSG4326.d.ts +3 -2
- package/types/proj/Proj.d.ts +42 -0
- package/types/quadTree/EntityCollectionNode.d.ts +34 -0
- package/types/quadTree/Node.d.ts +61 -0
- package/types/renderer/Renderer.d.ts +300 -0
- package/types/renderer/RendererEvents.d.ts +10 -7
- package/types/scene/BaseNode.d.ts +9 -9
- package/types/scene/Planet.d.ts +131 -126
- package/types/scene/RenderNode.d.ts +22 -23
- package/types/segment/Segment.d.ts +279 -0
- package/types/segment/SegmentLonLat.d.ts +16 -0
- package/types/shaders/geoObject.d.ts +3 -0
- package/types/shapes/BaseShape.d.ts +43 -40
- package/types/shapes/Sphere.d.ts +7 -7
- package/types/terrain/BilTerrain.d.ts +0 -1
- package/types/terrain/EmptyTerrain.d.ts +4 -4
- package/types/terrain/GlobusTerrain.d.ts +17 -54
- package/types/terrain/MapboxTerrain.d.ts +0 -1
- package/types/utils/GeoImageCreator.d.ts +3 -2
- package/types/utils/TextureAtlas.d.ts +8 -8
- package/types/utils/shared.d.ts +25 -24
- package/types/webgl/Framebuffer.d.ts +5 -5
- package/types/webgl/Handler.d.ts +68 -43
- package/types/webgl/Multisample.d.ts +5 -5
- package/types/webgl/Program.d.ts +8 -2
- package/types/webgl/ProgramController.d.ts +18 -13
- package/src/og/inherits.js +0 -8
- package/src/og/utils/polylabel.js +0 -176
- package/types/inherits.d.ts +0 -4
|
@@ -13,10 +13,10 @@ export class GeoImageCreator {
|
|
|
13
13
|
/**
|
|
14
14
|
* Creates geoImage corners coordinates grid buffer.
|
|
15
15
|
* @public
|
|
16
|
-
* @param{Array.<
|
|
16
|
+
* @param{Array.<LonLat>} c - GeoImage corners coordinates.
|
|
17
17
|
* @return{WebGLBuffer} Grid coordinates buffer.
|
|
18
18
|
*/
|
|
19
|
-
public createGridBuffer(c: Array<
|
|
19
|
+
public createGridBuffer(c: Array<LonLat>, toMerc: any): WebGLBuffer;
|
|
20
20
|
frame(): void;
|
|
21
21
|
add(geoImage: any): void;
|
|
22
22
|
remove(geoImage: any): void;
|
|
@@ -27,3 +27,4 @@ export class GeoImageCreator {
|
|
|
27
27
|
_initShaders(): void;
|
|
28
28
|
}
|
|
29
29
|
import { Framebuffer } from "../webgl/Framebuffer.js";
|
|
30
|
+
import { LonLat } from "../LonLat.js";
|
|
@@ -10,9 +10,9 @@ export class TextureAtlas {
|
|
|
10
10
|
/**
|
|
11
11
|
* Atlas nodes where input images store. It can be access by image.__nodeIndex.
|
|
12
12
|
* @public
|
|
13
|
-
* @type {Array.<
|
|
13
|
+
* @type {Array.<utils.TextureAtlasNode >}
|
|
14
14
|
*/
|
|
15
|
-
public nodes: Array<
|
|
15
|
+
public nodes: Array<utils.TextureAtlasNode>;
|
|
16
16
|
/**
|
|
17
17
|
* Created gl texture.
|
|
18
18
|
* @public
|
|
@@ -23,7 +23,7 @@ export class TextureAtlas {
|
|
|
23
23
|
* @public
|
|
24
24
|
* @type {canvas}
|
|
25
25
|
*/
|
|
26
|
-
public canvas:
|
|
26
|
+
public canvas: canvas;
|
|
27
27
|
_handler: any;
|
|
28
28
|
_images: any[];
|
|
29
29
|
_btree: TextureAtlasNode;
|
|
@@ -49,9 +49,9 @@ export class TextureAtlas {
|
|
|
49
49
|
/**
|
|
50
50
|
* Sets openglobus gl handler that creates gl texture.
|
|
51
51
|
* @public
|
|
52
|
-
* @param {
|
|
52
|
+
* @param {Handler} handler - WebGL handler.
|
|
53
53
|
*/
|
|
54
|
-
public assignHandler(handler:
|
|
54
|
+
public assignHandler(handler: Handler): void;
|
|
55
55
|
/**
|
|
56
56
|
* Returns image diagonal size.
|
|
57
57
|
* @param {Object} image - JavaSript image object.
|
|
@@ -64,9 +64,9 @@ export class TextureAtlas {
|
|
|
64
64
|
* @param {Object} image - Input javascript image object.
|
|
65
65
|
* @param {boolean} [fastInsert] - If it's true atlas doesnt restore all images again
|
|
66
66
|
* and store image in the curent atlas sheme.
|
|
67
|
-
* @returns {
|
|
67
|
+
* @returns {utils.TextureAtlasNode} -
|
|
68
68
|
*/
|
|
69
|
-
public addImage(image: any, fastInsert?: boolean):
|
|
69
|
+
public addImage(image: any, fastInsert?: boolean): utils.TextureAtlasNode;
|
|
70
70
|
_completeNode(nodes: any, node: any): void;
|
|
71
71
|
/**
|
|
72
72
|
* Main atlas making function.
|
|
@@ -97,7 +97,7 @@ export class TextureAtlas {
|
|
|
97
97
|
/**
|
|
98
98
|
* Atlas binary tree node.
|
|
99
99
|
* @class
|
|
100
|
-
* @param {
|
|
100
|
+
* @param {Rectangle} rect - Node image rectangle.
|
|
101
101
|
*/
|
|
102
102
|
export class TextureAtlasNode {
|
|
103
103
|
constructor(rect: any, texCoords: any);
|
package/types/utils/shared.d.ts
CHANGED
|
@@ -12,17 +12,17 @@ export function readTextFile(fileUrl: string): string;
|
|
|
12
12
|
* Convert html color string to the RGBA number vector.
|
|
13
13
|
* @param {string} htmlColor - HTML string("#C6C6C6" or "#EF5" or "rgb(8,8,8)" or "rgba(8,8,8)") color.
|
|
14
14
|
* @param {number} [opacity] - Opacity for the output vector.
|
|
15
|
-
* @returns {
|
|
15
|
+
* @returns {math.Vec4} -
|
|
16
16
|
*/
|
|
17
|
-
export function htmlColorToRgba(htmlColor: string, opacity?: number):
|
|
17
|
+
export function htmlColorToRgba(htmlColor: string, opacity?: number): math.Vec4;
|
|
18
18
|
export function htmlColorToFloat32Array(htmlColor: any, opacity: any): Float32Array;
|
|
19
19
|
/**
|
|
20
20
|
* Convert html color string to the RGB number vector.
|
|
21
21
|
* @param {string} htmlColor - HTML string("#C6C6C6" or "#EF5" or "rgb(8,8,8)" or "rgba(8,8,8)") color.
|
|
22
22
|
* @param {number} [opacity] - Opacity for the output vector.
|
|
23
|
-
* @returns {
|
|
23
|
+
* @returns {Vec3} -
|
|
24
24
|
*/
|
|
25
|
-
export function htmlColorToRgb(htmlColor: string):
|
|
25
|
+
export function htmlColorToRgb(htmlColor: string): Vec3;
|
|
26
26
|
/**
|
|
27
27
|
* Replace template substrings between '{' and '}' tokens.
|
|
28
28
|
* @param {string} template - String with templates in "{" and "}"
|
|
@@ -54,7 +54,7 @@ export function binarySearchFast(arr: any, x: any): number;
|
|
|
54
54
|
* Finds an item in a sorted array.
|
|
55
55
|
* @param {Array} ar The sorted array to search.
|
|
56
56
|
* @param {Object} el The item to find in the array.
|
|
57
|
-
* @param {
|
|
57
|
+
* @param {utils.binarySearch~compare_fn} compare_fn comparator The function to use to compare the item to
|
|
58
58
|
* elements in the array.
|
|
59
59
|
* @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.
|
|
60
60
|
*
|
|
@@ -71,7 +71,7 @@ export function binarySearch(ar: any[], el: any, compare_fn: any): number;
|
|
|
71
71
|
* Binary insertion that uses binarySearch algorithm.
|
|
72
72
|
* @param {Array} ar - The sorted array to insert.
|
|
73
73
|
* @param {Object} el - The item to insert.
|
|
74
|
-
* @param {
|
|
74
|
+
* @param {utils.binarySearch~compare_fn} compare_fn - comparator The function to use to compare the item to
|
|
75
75
|
* elements in the array.
|
|
76
76
|
* @returns {Number} Array index position in which item inserted in.
|
|
77
77
|
*/
|
|
@@ -79,25 +79,25 @@ export function binaryInsert(ar: any[], el: any, compare_fn: any): number;
|
|
|
79
79
|
/**
|
|
80
80
|
* Returns two segment lines intersection coordinate.
|
|
81
81
|
* @static
|
|
82
|
-
* @param {
|
|
83
|
-
* @param {
|
|
84
|
-
* @param {
|
|
85
|
-
* @param {
|
|
82
|
+
* @param {math.Vec2} start1 - First line first coordinate.
|
|
83
|
+
* @param {math.Vec2} end1 - First line second coordinate.
|
|
84
|
+
* @param {math.Vec2} start2 - Second line first coordinate.
|
|
85
|
+
* @param {math.Vec2} end2 - Second line second coordinate.
|
|
86
86
|
* @param {boolean} [isSegment] - Lines are segments.
|
|
87
|
-
* @return {
|
|
87
|
+
* @return {math.Vec2} - Intersection coordinate.
|
|
88
88
|
*/
|
|
89
|
-
export function getLinesIntersection2v(start1:
|
|
89
|
+
export function getLinesIntersection2v(start1: math.Vec2, end1: math.Vec2, start2: math.Vec2, end2: math.Vec2, isSegment?: boolean): math.Vec2;
|
|
90
90
|
/**
|
|
91
91
|
* Returns two segment lines intersection coordinate.
|
|
92
92
|
* @static
|
|
93
|
-
* @param {
|
|
94
|
-
* @param {
|
|
95
|
-
* @param {
|
|
96
|
-
* @param {
|
|
93
|
+
* @param {math.Vec2} start1 - First line first coordinate.
|
|
94
|
+
* @param {math.Vec2} end1 - First line second coordinate.
|
|
95
|
+
* @param {math.Vec2} start2 - Second line first coordinate.
|
|
96
|
+
* @param {math.Vec2} end2 - Second line second coordinate.
|
|
97
97
|
* @param {boolean} [isSegment] - Lines are segments.
|
|
98
|
-
* @return {
|
|
98
|
+
* @return {math.Vec2} - Intersection coordinate.
|
|
99
99
|
*/
|
|
100
|
-
export function getLinesIntersectionLonLat(start1:
|
|
100
|
+
export function getLinesIntersectionLonLat(start1: math.Vec2, end1: math.Vec2, start2: math.Vec2, end2: math.Vec2, isSegment?: boolean): math.Vec2;
|
|
101
101
|
/**
|
|
102
102
|
* Converts XML to JSON
|
|
103
103
|
* @static
|
|
@@ -150,26 +150,26 @@ export function extractElevationTiles(rgbaData: any, outCurrenElevations: any, o
|
|
|
150
150
|
* @param {TypedArray} a
|
|
151
151
|
* @param {TypedArray} b
|
|
152
152
|
*/
|
|
153
|
-
export function concatTypedArrays(a:
|
|
153
|
+
export function concatTypedArrays(a: TypedArray, b: TypedArray): any;
|
|
154
154
|
/**
|
|
155
155
|
* Concatenates two the same arrays
|
|
156
156
|
* @param {TypedArray | Array} a
|
|
157
157
|
* @param {TypedArray | Array} b
|
|
158
158
|
*/
|
|
159
|
-
export function concatArrays(a:
|
|
159
|
+
export function concatArrays(a: TypedArray | any[], b: TypedArray | any[]): any;
|
|
160
160
|
/**
|
|
161
161
|
* Convert simple array to typed
|
|
162
162
|
* @param arr {Array}
|
|
163
163
|
* @param ctor {Float32ArrayConstructor}
|
|
164
164
|
* @returns {TypedArray}
|
|
165
165
|
*/
|
|
166
|
-
export function makeArrayTyped(arr: any[], ctor?: Float32ArrayConstructor):
|
|
166
|
+
export function makeArrayTyped(arr: any[], ctor?: Float32ArrayConstructor): TypedArray;
|
|
167
167
|
/**
|
|
168
168
|
* Convert typed array to array
|
|
169
169
|
* @param arr {TypedArray}
|
|
170
170
|
* @returns {Array}
|
|
171
171
|
*/
|
|
172
|
-
export function makeArray(arr:
|
|
172
|
+
export function makeArray(arr: TypedArray): any[];
|
|
173
173
|
/**
|
|
174
174
|
*
|
|
175
175
|
* @param {TypedArray | Array} arr
|
|
@@ -177,7 +177,7 @@ export function makeArray(arr: any): any[];
|
|
|
177
177
|
* @param {Number} deleteCount
|
|
178
178
|
* @param {Array} elements
|
|
179
179
|
*/
|
|
180
|
-
export function spliceArray(arr:
|
|
180
|
+
export function spliceArray(arr: TypedArray | any[], starting: number, deleteCount: number, elements: any[]): any;
|
|
181
181
|
/**
|
|
182
182
|
*
|
|
183
183
|
* @param {TypedArray} arr
|
|
@@ -185,7 +185,7 @@ export function spliceArray(arr: any | any[], starting: number, deleteCount: num
|
|
|
185
185
|
* @param {Number} deleteCount
|
|
186
186
|
* @param {Array} elements
|
|
187
187
|
*/
|
|
188
|
-
export function spliceTypedArray(arr:
|
|
188
|
+
export function spliceTypedArray(arr: TypedArray, starting: number, deleteCount: number, elements?: any[]): any;
|
|
189
189
|
/**
|
|
190
190
|
* Returns triangle coordinate array from inside of the source triangle array.
|
|
191
191
|
* @static
|
|
@@ -228,3 +228,4 @@ export namespace castType {
|
|
|
228
228
|
function float(v: any): any;
|
|
229
229
|
function boolean(str: any): any;
|
|
230
230
|
}
|
|
231
|
+
import { Vec3 } from "../math/Vec3.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Class represents framebuffer.
|
|
3
3
|
* @class
|
|
4
|
-
* @param {
|
|
4
|
+
* @param {Handler} handler - WebGL handler.
|
|
5
5
|
* @param {Object} [options] - Framebuffer options:
|
|
6
6
|
* @param {number} [options.width] - Framebuffer width. Default is handler canvas width.
|
|
7
7
|
* @param {number} [options.height] - Framebuffer height. Default is handler canvas height.
|
|
@@ -18,9 +18,9 @@ export class Framebuffer {
|
|
|
18
18
|
/**
|
|
19
19
|
* WebGL handler.
|
|
20
20
|
* @public
|
|
21
|
-
* @type {
|
|
21
|
+
* @type {Handler}
|
|
22
22
|
*/
|
|
23
|
-
public handler:
|
|
23
|
+
public handler: Handler;
|
|
24
24
|
/**
|
|
25
25
|
* Framebuffer object.
|
|
26
26
|
* @private
|
|
@@ -113,9 +113,9 @@ export class Framebuffer {
|
|
|
113
113
|
/**
|
|
114
114
|
* Activate framebuffer frame to draw.
|
|
115
115
|
* @public
|
|
116
|
-
* @returns {
|
|
116
|
+
* @returns {Framebuffer} Returns Current framebuffer.
|
|
117
117
|
*/
|
|
118
|
-
public activate():
|
|
118
|
+
public activate(): Framebuffer;
|
|
119
119
|
/**
|
|
120
120
|
* Deactivate framebuffer frame.
|
|
121
121
|
* @public
|
package/types/webgl/Handler.d.ts
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
|
+
export namespace createTexture {
|
|
2
|
+
import NEAREST = Handler.createTexture_n;
|
|
3
|
+
export { NEAREST };
|
|
4
|
+
import LINEAR = Handler.createTexture_l;
|
|
5
|
+
export { LINEAR };
|
|
6
|
+
import MIPMAP = Handler.createTexture_mm;
|
|
7
|
+
export { MIPMAP };
|
|
8
|
+
import ANISOTROPIC = Handler.createTexture_a;
|
|
9
|
+
export { ANISOTROPIC };
|
|
10
|
+
}
|
|
1
11
|
/**
|
|
2
12
|
* A WebGL handler for accessing low-level WebGL capabilities.
|
|
3
13
|
* @class
|
|
4
14
|
* @param {string} id - Canvas element id that WebGL handler assing with. If it's null
|
|
5
15
|
* or undefined creates hidden canvas and handler bacomes hidden.
|
|
6
16
|
* @param {Object} [params] - Handler options:
|
|
7
|
-
* @param {number} [params.anisotropy] -
|
|
17
|
+
* @param {number} [params.anisotropy] - Anisotropy filter degree. 8 is default.
|
|
8
18
|
* @param {number} [params.width] - Hidden handler width. 256 is default.
|
|
9
19
|
* @param {number} [params.height] - Hidden handler height. 256 is default.
|
|
10
|
-
* @param {Object} [param.scontext] - Native WebGL context attributes. See https://www.khronos.org/registry/webgl/specs/latest/1.0/#WEBGLCONTEXTATTRIBUTES
|
|
11
20
|
* @param {Array.<string>} [params.extensions] - Additional WebGL extension list. Available by default: EXT_texture_filter_anisotropic.
|
|
12
21
|
*/
|
|
13
22
|
export class Handler {
|
|
@@ -25,19 +34,47 @@ export class Handler {
|
|
|
25
34
|
* @returns {Object} -
|
|
26
35
|
*/
|
|
27
36
|
static getContext(canvas: any, contextAttributes?: any): any;
|
|
37
|
+
/**
|
|
38
|
+
* Creates NEAREST filter texture.
|
|
39
|
+
* @public
|
|
40
|
+
* @param {Object} image - Image or Canvas object.
|
|
41
|
+
* @returns {Object} - WebGL texture object.
|
|
42
|
+
*/
|
|
43
|
+
public static createTexture_n(handler: any, image: any): any;
|
|
44
|
+
/**
|
|
45
|
+
* Creates LINEAR filter texture.
|
|
46
|
+
* @public
|
|
47
|
+
* @param {Object} image - Image or Canvas object.
|
|
48
|
+
* @returns {Object} - WebGL texture object.
|
|
49
|
+
*/
|
|
50
|
+
public static createTexture_l(handler: any, image: any): any;
|
|
51
|
+
/**
|
|
52
|
+
* Creates MIPMAP filter texture.
|
|
53
|
+
* @public
|
|
54
|
+
* @param {Object} image - Image or Canvas object.
|
|
55
|
+
* @returns {Object} - WebGL texture object.
|
|
56
|
+
*/
|
|
57
|
+
public static createTexture_mm(handler: any, image: any): any;
|
|
58
|
+
/**
|
|
59
|
+
* Creates ANISOTROPY filter texture.
|
|
60
|
+
* @public
|
|
61
|
+
* @param {Object} image - Image or Canvas object.
|
|
62
|
+
* @returns {Object} - WebGL texture object.
|
|
63
|
+
*/
|
|
64
|
+
public static createTexture_a(handler: any, image: any): any;
|
|
28
65
|
constructor(id: any, params: any);
|
|
29
66
|
/**
|
|
30
67
|
* Application default timer.
|
|
31
68
|
* @public
|
|
32
|
-
* @type {
|
|
69
|
+
* @type {Clock}
|
|
33
70
|
*/
|
|
34
|
-
public defaultClock:
|
|
71
|
+
public defaultClock: Clock;
|
|
35
72
|
/**
|
|
36
73
|
* Custom timers.
|
|
37
74
|
* @protected
|
|
38
|
-
* @type{
|
|
75
|
+
* @type{Clock[]}
|
|
39
76
|
*/
|
|
40
|
-
protected _clocks:
|
|
77
|
+
protected _clocks: Clock[];
|
|
41
78
|
/**
|
|
42
79
|
* Draw frame time in milliseconds.
|
|
43
80
|
* @public
|
|
@@ -66,9 +103,9 @@ export class Handler {
|
|
|
66
103
|
/**
|
|
67
104
|
* Current active shader program controller.
|
|
68
105
|
* @public
|
|
69
|
-
* @type {
|
|
106
|
+
* @type {ProgramController}
|
|
70
107
|
*/
|
|
71
|
-
public activeProgram:
|
|
108
|
+
public activeProgram: ProgramController;
|
|
72
109
|
/**
|
|
73
110
|
* Handler parameters.
|
|
74
111
|
* @private
|
|
@@ -104,13 +141,6 @@ export class Handler {
|
|
|
104
141
|
* @param {callback} callback - Frame callback.
|
|
105
142
|
*/
|
|
106
143
|
public setFrameCallback(callback: any): void;
|
|
107
|
-
/**
|
|
108
|
-
* Creates NEAREST filter texture.
|
|
109
|
-
* @public
|
|
110
|
-
* @param {Object} image - Image or Canvas object.
|
|
111
|
-
* @returns {Object} - WebGL texture object.
|
|
112
|
-
*/
|
|
113
|
-
public createTexture_n(image: any): any;
|
|
114
144
|
/**
|
|
115
145
|
* Creates empty texture.
|
|
116
146
|
* @public
|
|
@@ -140,27 +170,6 @@ export class Handler {
|
|
|
140
170
|
* @returns {Object} - WebGL texture object.
|
|
141
171
|
*/
|
|
142
172
|
public createEmptyTexture_l(width: number, height: number): any;
|
|
143
|
-
/**
|
|
144
|
-
* Creates LINEAR filter texture.
|
|
145
|
-
* @public
|
|
146
|
-
* @param {Object} image - Image or Canvas object.
|
|
147
|
-
* @returns {Object} - WebGL texture object.
|
|
148
|
-
*/
|
|
149
|
-
public createTexture_l(image: any): any;
|
|
150
|
-
/**
|
|
151
|
-
* Creates MIPMAP filter texture.
|
|
152
|
-
* @public
|
|
153
|
-
* @param {Object} image - Image or Canvas object.
|
|
154
|
-
* @returns {Object} - WebGL texture object.
|
|
155
|
-
*/
|
|
156
|
-
public createTexture_mm(image: any): any;
|
|
157
|
-
/**
|
|
158
|
-
* Creates ANISOTROPY filter texture.
|
|
159
|
-
* @public
|
|
160
|
-
* @param {Object} image - Image or Canvas object.
|
|
161
|
-
* @returns {Object} - WebGL texture object.
|
|
162
|
-
*/
|
|
163
|
-
public createTexture_a(image: any): any;
|
|
164
173
|
/**
|
|
165
174
|
* Creates DEFAULT filter texture, ANISOTROPY is default.
|
|
166
175
|
* @public
|
|
@@ -168,6 +177,10 @@ export class Handler {
|
|
|
168
177
|
* @returns {Object} - WebGL texture object.
|
|
169
178
|
*/
|
|
170
179
|
public createTexture(image: any): any;
|
|
180
|
+
createTexture_n(image: any): any;
|
|
181
|
+
createTexture_l(image: any): any;
|
|
182
|
+
createTexture_mm(image: any): any;
|
|
183
|
+
createTexture_a(image: any): any;
|
|
171
184
|
/**
|
|
172
185
|
* Creates cube texture.
|
|
173
186
|
* @public
|
|
@@ -184,11 +197,11 @@ export class Handler {
|
|
|
184
197
|
/**
|
|
185
198
|
* Adds shader program to the handler.
|
|
186
199
|
* @public
|
|
187
|
-
* @param {
|
|
200
|
+
* @param {Program} program - Shader program.
|
|
188
201
|
* @param {boolean} [notActivate] - If it's true program will not compile.
|
|
189
|
-
* @return {
|
|
202
|
+
* @return {Program} -
|
|
190
203
|
*/
|
|
191
|
-
public addProgram(program:
|
|
204
|
+
public addProgram(program: Program, notActivate?: boolean): Program;
|
|
192
205
|
/**
|
|
193
206
|
* Removes shader program from handler.
|
|
194
207
|
* @public
|
|
@@ -198,13 +211,13 @@ export class Handler {
|
|
|
198
211
|
/**
|
|
199
212
|
* Adds shader programs to the handler.
|
|
200
213
|
* @public
|
|
201
|
-
* @param {Array.<
|
|
214
|
+
* @param {Array.<Program>} programsArr - Shader program array.
|
|
202
215
|
*/
|
|
203
|
-
public addPrograms(programsArr: Array<
|
|
216
|
+
public addPrograms(programsArr: Array<Program>): void;
|
|
204
217
|
/**
|
|
205
218
|
* Used in addProgram
|
|
206
219
|
* @private
|
|
207
|
-
* @param {
|
|
220
|
+
* @param {ProgramController} sc - Program controller
|
|
208
221
|
*/
|
|
209
222
|
private _initProgramController;
|
|
210
223
|
/**
|
|
@@ -290,6 +303,16 @@ export class Handler {
|
|
|
290
303
|
* @return {Object} -
|
|
291
304
|
*/
|
|
292
305
|
public createArrayBuffer(array: Array<number>, itemSize: number, numItems: number, usage?: number): any;
|
|
306
|
+
/**
|
|
307
|
+
* Creates ARRAY buffer specific length.
|
|
308
|
+
* @public
|
|
309
|
+
* @param {Array.<number>} array - Input array.
|
|
310
|
+
* @param {number} itemSize - Array item size.
|
|
311
|
+
* @param {number} numItems - Items quantity.
|
|
312
|
+
* @param {number} [usage=STATIC_DRAW] - Parameter of the bufferData call can be one of STATIC_DRAW, DYNAMIC_DRAW, or STREAM_DRAW.
|
|
313
|
+
* @return {Object} -
|
|
314
|
+
*/
|
|
315
|
+
public createArrayBufferLength(size: any, usage?: number): any;
|
|
293
316
|
/**
|
|
294
317
|
* Creates ELEMENT ARRAY buffer.
|
|
295
318
|
* @public
|
|
@@ -360,7 +383,7 @@ export class Handler {
|
|
|
360
383
|
* @param {Object} [params] - Texture parameters:
|
|
361
384
|
* @param {callback} [success] - Creation callback
|
|
362
385
|
*/
|
|
363
|
-
public createDefaultTexture(params?: any, success?:
|
|
386
|
+
public createDefaultTexture(params?: any, success?: callback): void;
|
|
364
387
|
/**
|
|
365
388
|
* @public
|
|
366
389
|
*/
|
|
@@ -369,4 +392,6 @@ export class Handler {
|
|
|
369
392
|
addClocks(clockArr: any): void;
|
|
370
393
|
removeClock(clock: any): void;
|
|
371
394
|
}
|
|
395
|
+
import { Clock } from "../Clock.js";
|
|
396
|
+
import { ProgramController } from "./ProgramController.js";
|
|
372
397
|
import { Stack } from "../Stack.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Class represents multisample framebuffer.
|
|
3
3
|
* @class
|
|
4
|
-
* @param {
|
|
4
|
+
* @param {Handler} handler - WebGL handler.
|
|
5
5
|
* @param {Object} [options] - Framebuffer options:
|
|
6
6
|
* @param {number} [options.width] - Framebuffer width. Default is handler canvas width.
|
|
7
7
|
* @param {number} [options.height] - Framebuffer height. Default is handler canvas height.
|
|
@@ -14,9 +14,9 @@ export class Multisample {
|
|
|
14
14
|
/**
|
|
15
15
|
* WebGL handler.
|
|
16
16
|
* @public
|
|
17
|
-
* @type {
|
|
17
|
+
* @type {Handler}
|
|
18
18
|
*/
|
|
19
|
-
public handler:
|
|
19
|
+
public handler: Handler;
|
|
20
20
|
_internalFormat: any;
|
|
21
21
|
/**
|
|
22
22
|
* Framebuffer object.
|
|
@@ -78,9 +78,9 @@ export class Multisample {
|
|
|
78
78
|
/**
|
|
79
79
|
* Activate framebuffer frame to draw.
|
|
80
80
|
* @public
|
|
81
|
-
* @returns {
|
|
81
|
+
* @returns {Framebuffer} Returns Current framebuffer.
|
|
82
82
|
*/
|
|
83
|
-
public activate():
|
|
83
|
+
public activate(): Framebuffer;
|
|
84
84
|
/**
|
|
85
85
|
* Deactivate framebuffer frame.
|
|
86
86
|
* @public
|
package/types/webgl/Program.d.ts
CHANGED
|
@@ -12,10 +12,10 @@ export class Program {
|
|
|
12
12
|
/**
|
|
13
13
|
* Bind program buffer.
|
|
14
14
|
* @function
|
|
15
|
-
* @param {
|
|
15
|
+
* @param {Program} program - Used program.
|
|
16
16
|
* @param {Object} variable - Variable represents buffer data.
|
|
17
17
|
*/
|
|
18
|
-
static bindBuffer(program:
|
|
18
|
+
static bindBuffer(program: Program, variable: any): void;
|
|
19
19
|
constructor(name: any, material: any);
|
|
20
20
|
/**
|
|
21
21
|
* Shader progarm name.
|
|
@@ -79,6 +79,12 @@ export class Program {
|
|
|
79
79
|
* @type {Array.<Object>}
|
|
80
80
|
*/
|
|
81
81
|
private _attribArrays;
|
|
82
|
+
/**
|
|
83
|
+
* Program attributes divisor.
|
|
84
|
+
* @private
|
|
85
|
+
* @type {Array.<Object>}
|
|
86
|
+
*/
|
|
87
|
+
private _attribDivisor;
|
|
82
88
|
/**
|
|
83
89
|
* Sets the current program frame.
|
|
84
90
|
* @public
|
|
@@ -3,21 +3,24 @@
|
|
|
3
3
|
* program capabilities, like switching program during the rendering.
|
|
4
4
|
* Get access to the program from ...handler.programs.<program name> etc.
|
|
5
5
|
* @class
|
|
6
|
-
* @param {og.webgl.Handler} handler - Handler.
|
|
7
|
-
* @param {og.webgl.Program} program - Shader program.
|
|
8
6
|
*/
|
|
9
7
|
export class ProgramController {
|
|
10
|
-
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param {Handler} handler - Handler.
|
|
11
|
+
* @param {Program} program - Shader program.
|
|
12
|
+
*/
|
|
13
|
+
constructor(handler: Handler, program: Program);
|
|
11
14
|
/**
|
|
12
15
|
* Shader program.
|
|
13
16
|
* @private
|
|
14
|
-
* @type {
|
|
17
|
+
* @type {Program}
|
|
15
18
|
*/
|
|
16
19
|
private _program;
|
|
17
20
|
/**
|
|
18
21
|
* Handler.
|
|
19
22
|
* @private
|
|
20
|
-
* @type {
|
|
23
|
+
* @type {Handler}
|
|
21
24
|
*/
|
|
22
25
|
private _handler;
|
|
23
26
|
/**
|
|
@@ -34,9 +37,9 @@ export class ProgramController {
|
|
|
34
37
|
/**
|
|
35
38
|
* Returns controller's shader program.
|
|
36
39
|
* @public
|
|
37
|
-
* @return {
|
|
40
|
+
* @return {Program} -
|
|
38
41
|
*/
|
|
39
|
-
public getProgram():
|
|
42
|
+
public getProgram(): Program;
|
|
40
43
|
/**
|
|
41
44
|
* Activates current shader program.
|
|
42
45
|
* @public
|
|
@@ -63,22 +66,24 @@ export class ProgramController {
|
|
|
63
66
|
* Sets program uniforms and attributes values and return controller instance.
|
|
64
67
|
* @public
|
|
65
68
|
* @param {Object} params - Object with variable name and value like { value: 12, someArray:[1,2,3], uSampler: texture,... }
|
|
66
|
-
* @return {
|
|
69
|
+
* @return {ProgramController} -
|
|
67
70
|
*/
|
|
68
|
-
public set(params: any):
|
|
71
|
+
public set(params: any): ProgramController;
|
|
69
72
|
/**
|
|
70
73
|
* Draw index buffer with this program.
|
|
71
74
|
* @public
|
|
72
75
|
* @param {number} mode - Gl draw mode
|
|
73
76
|
* @param {WEBGLBuffer} buffer - Buffer to draw.
|
|
74
|
-
* @return {
|
|
77
|
+
* @return {ProgramController} Returns current shader controller instance.
|
|
75
78
|
*/
|
|
76
|
-
public drawIndexBuffer(mode: number, buffer:
|
|
79
|
+
public drawIndexBuffer(mode: number, buffer: WEBGLBuffer): ProgramController;
|
|
77
80
|
/**
|
|
78
81
|
* Calls Gl drawArray function.
|
|
79
82
|
* @param {number} mode - Gl draw mode.
|
|
80
83
|
* @param {number} numItems - draw items count.
|
|
81
|
-
* @return {
|
|
84
|
+
* @return {ProgramController} Returns current shader controller instance.
|
|
82
85
|
*/
|
|
83
|
-
drawArrays(mode: number, numItems: number):
|
|
86
|
+
drawArrays(mode: number, numItems: number): ProgramController;
|
|
84
87
|
}
|
|
88
|
+
import { Program } from "./Program.js";
|
|
89
|
+
import { Handler } from "./Handler.js";
|