@openglobus/og 0.10.4 → 0.11.1
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/css/og.css +1 -1
- package/package.json +11 -9
- package/src/og/Extent.js +274 -273
- package/src/og/Globe.js +11 -3
- package/src/og/LonLat.js +152 -146
- package/src/og/Popup.js +2 -1
- package/src/og/camera/PlanetCamera.js +112 -38
- package/src/og/control/EarthNavigation.js +259 -0
- package/src/og/control/MouseNavigation.js +68 -40
- package/src/og/entity/EntityCollection.js +1 -1
- package/src/og/entity/LabelHandler.js +366 -74
- package/src/og/entity/Polyline.js +3 -2
- package/src/og/layer/CanvasTiles.js +32 -30
- package/src/og/layer/KML.js +159 -0
- package/src/og/layer/Vector.js +5 -0
- package/src/og/layer/index.js +2 -1
- package/src/og/math/Vec2.js +448 -448
- package/src/og/math/Vec3.js +759 -757
- package/src/og/math/Vec4.js +216 -215
- package/src/og/quadTree/Node.js +67 -13
- package/src/og/renderer/RendererEvents.js +21 -16
- package/src/og/scene/Planet.js +25 -10
- package/src/og/segment/Segment.js +3 -3
- package/src/og/segment/SegmentLonLat.js +7 -0
- package/src/og/terrain/GlobusTerrain.js +4 -0
- package/src/og/utils/FontAtlas.js +1 -0
- package/src/og/utils/GeoImageCreator.js +123 -121
- package/src/og/utils/Loader.js +81 -80
- package/src/og/utils/NormalMapCreator.js +320 -318
- package/src/og/utils/VectorTileCreator.js +251 -250
- package/src/og/webgl/Framebuffer.js +265 -264
- package/src/og/webgl/Handler.js +1022 -1001
- package/src/og/webgl/Multisample.js +169 -168
- package/src/og/webgl/ProgramController.js +113 -112
- package/types/Clock.d.ts +90 -0
- package/types/Deferred.d.ts +6 -0
- package/types/Events.d.ts +73 -0
- package/types/Extent.d.ts +162 -0
- package/types/Globe.d.ts +80 -0
- package/types/ImageCanvas.d.ts +121 -0
- package/types/Lock.d.ts +12 -0
- package/types/LonLat.d.ts +108 -0
- package/types/Popup.d.ts +38 -0
- package/types/QueueArray.d.ts +15 -0
- package/types/Rectangle.d.ts +74 -0
- package/types/Stack.d.ts +15 -0
- package/types/ajax.d.ts +24 -0
- package/types/arial.d.ts +48 -0
- package/types/astro/astro.d.ts +38 -0
- package/types/astro/earth.d.ts +6 -0
- package/types/astro/jd.d.ts +254 -0
- package/types/bv/Box.d.ts +25 -0
- package/types/bv/Sphere.d.ts +32 -0
- package/types/bv/index.d.ts +3 -0
- package/types/camera/Camera.d.ts +303 -0
- package/types/camera/Frustum.d.ts +129 -0
- package/types/camera/PlanetCamera.d.ts +222 -0
- package/types/camera/index.d.ts +3 -0
- package/types/cons.d.ts +40 -0
- package/types/control/CompassButton.d.ts +17 -0
- package/types/control/Control.d.ts +101 -0
- package/types/control/DebugInfo.d.ts +16 -0
- package/types/control/EarthCoordinates.d.ts +47 -0
- package/types/control/GeoImageDragControl.d.ts +6 -0
- package/types/control/KeyboardNavigation.d.ts +22 -0
- package/types/control/LayerSwitcher.d.ts +23 -0
- package/types/control/Lighting.d.ts +16 -0
- package/types/control/ScaleControl.d.ts +22 -0
- package/types/control/ShowFps.d.ts +12 -0
- package/types/control/SimpleNavigation.d.ts +28 -0
- package/types/control/Sun.d.ts +52 -0
- package/types/control/ToggleWireframe.d.ts +12 -0
- package/types/control/ZoomControl.d.ts +28 -0
- package/types/control/index.d.ts +15 -0
- package/types/ellipsoid/Ellipsoid.d.ts +142 -0
- package/types/ellipsoid/index.d.ts +3 -0
- package/types/ellipsoid/wgs84.d.ts +5 -0
- package/types/entity/BaseBillboard.d.ts +208 -0
- package/types/entity/Billboard.d.ts +94 -0
- package/types/entity/BillboardHandler.d.ts +74 -0
- package/types/entity/Entity.d.ts +330 -0
- package/types/entity/EntityCollection.d.ts +303 -0
- package/types/entity/Geometry.d.ts +72 -0
- package/types/entity/GeometryHandler.d.ts +76 -0
- package/types/entity/Label.d.ts +194 -0
- package/types/entity/LabelHandler.d.ts +24 -0
- package/types/entity/PointCloud.d.ts +174 -0
- package/types/entity/PointCloudHandler.d.ts +38 -0
- package/types/entity/Polyline.d.ts +303 -0
- package/types/entity/PolylineHandler.d.ts +18 -0
- package/types/entity/Ray.d.ts +123 -0
- package/types/entity/RayHandler.d.ts +67 -0
- package/types/entity/ShapeHandler.d.ts +22 -0
- package/types/entity/Strip.d.ts +118 -0
- package/types/entity/StripHandler.d.ts +38 -0
- package/types/entity/index.d.ts +8 -0
- package/types/index.core.d.ts +65 -0
- package/types/index.d.ts +45 -0
- package/types/index.webgl.d.ts +7 -0
- package/types/inherits.d.ts +4 -0
- package/types/input/input.d.ts +34 -0
- package/types/layer/BaseGeoImage.d.ts +106 -0
- package/types/layer/CanvasTiles.d.ts +75 -0
- package/types/layer/GeoImage.d.ts +65 -0
- package/types/layer/GeoTexture2d.d.ts +8 -0
- package/types/layer/GeoVideo.d.ts +80 -0
- package/types/layer/KML.d.ts +58 -0
- package/types/layer/WMS.d.ts +66 -0
- package/types/layer/XYZ.d.ts +126 -0
- package/types/layer/index.d.ts +10 -0
- package/types/light/LightSource.d.ts +177 -0
- package/types/math/Mat3.d.ts +53 -0
- package/types/math/Mat4.d.ts +157 -0
- package/types/math/Plane.d.ts +17 -0
- package/types/math/Vec2.d.ts +308 -0
- package/types/math/Vec3.d.ts +459 -0
- package/types/math/Vec4.d.ts +161 -0
- package/types/math/coder.d.ts +42 -0
- package/types/math/index.d.ts +11 -0
- package/types/math.d.ts +261 -0
- package/types/mercator.d.ts +92 -0
- package/types/proj/EPSG3857.d.ts +5 -0
- package/types/proj/EPSG4326.d.ts +5 -0
- package/types/quadTree/quadTree.d.ts +40 -0
- package/types/renderer/RendererEvents.d.ts +230 -0
- package/types/res/images.d.ts +3 -0
- package/types/scene/Axes.d.ts +11 -0
- package/types/scene/BaseNode.d.ts +60 -0
- package/types/scene/Planet.d.ts +572 -0
- package/types/scene/RenderNode.d.ts +143 -0
- package/types/scene/SkyBox.d.ts +10 -0
- package/types/scene/index.d.ts +4 -0
- package/types/segment/segmentHelper.d.ts +13 -0
- package/types/shaders/billboard.d.ts +3 -0
- package/types/shaders/depth.d.ts +2 -0
- package/types/shaders/drawnode.d.ts +7 -0
- package/types/shaders/label.d.ts +4 -0
- package/types/shaders/pointCloud.d.ts +2 -0
- package/types/shaders/polyline.d.ts +3 -0
- package/types/shaders/ray.d.ts +2 -0
- package/types/shaders/screenFrame.d.ts +2 -0
- package/types/shaders/shape.d.ts +4 -0
- package/types/shaders/skybox.d.ts +2 -0
- package/types/shaders/toneMapping.d.ts +2 -0
- package/types/shapes/BaseShape.d.ts +247 -0
- package/types/shapes/Sphere.d.ts +41 -0
- package/types/terrain/BilTerrain.d.ts +8 -0
- package/types/terrain/EmptyTerrain.d.ts +72 -0
- package/types/terrain/Geoid.d.ts +26 -0
- package/types/terrain/GlobusTerrain.d.ts +153 -0
- package/types/terrain/MapboxTerrain.d.ts +8 -0
- package/types/terrain/index.d.ts +5 -0
- package/types/utils/FontAtlas.d.ts +14 -0
- package/types/utils/GeoImageCreator.d.ts +29 -0
- package/types/utils/ImagesCacheManager.d.ts +10 -0
- package/types/utils/Loader.d.ts +25 -0
- package/types/utils/NormalMapCreator.d.ts +39 -0
- package/types/utils/PlainSegmentWorker.d.ts +10 -0
- package/types/utils/TerrainWorker.d.ts +9 -0
- package/types/utils/TextureAtlas.d.ts +111 -0
- package/types/utils/VectorTileCreator.d.ts +16 -0
- package/types/utils/colorTable.d.ts +143 -0
- package/types/utils/earcut.d.ts +6 -0
- package/types/utils/shared.d.ts +230 -0
- package/types/webgl/Framebuffer.d.ts +135 -0
- package/types/webgl/Handler.d.ts +372 -0
- package/types/webgl/Multisample.d.ts +89 -0
- package/types/webgl/Program.d.ts +155 -0
- package/types/webgl/ProgramController.d.ts +84 -0
- package/types/webgl/callbacks.d.ts +1 -0
- package/types/webgl/index.d.ts +6 -0
- package/types/webgl/types.d.ts +2 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents more comfortable using WebGL shader program.
|
|
3
|
+
* @class
|
|
4
|
+
* @param {string} name - Shader program name identificator.
|
|
5
|
+
* @param {object} material - Object stores uniforms, attributes and program codes:
|
|
6
|
+
* @param {object} material.uniforms - Uniforms definition section.
|
|
7
|
+
* @param {object} material.attributes - Attributes definition section.
|
|
8
|
+
* @param {string} material.vertexShader - Vertex glsl code.
|
|
9
|
+
* @param {string} material.fragmentShader - Fragment glsl code.
|
|
10
|
+
*/
|
|
11
|
+
export class Program {
|
|
12
|
+
/**
|
|
13
|
+
* Bind program buffer.
|
|
14
|
+
* @function
|
|
15
|
+
* @param {og.webgl.Program} program - Used program.
|
|
16
|
+
* @param {Object} variable - Variable represents buffer data.
|
|
17
|
+
*/
|
|
18
|
+
static bindBuffer(program: any, variable: any): void;
|
|
19
|
+
constructor(name: any, material: any);
|
|
20
|
+
/**
|
|
21
|
+
* Shader progarm name.
|
|
22
|
+
* @public
|
|
23
|
+
* @type {string}
|
|
24
|
+
*/
|
|
25
|
+
public name: string;
|
|
26
|
+
attributes: {};
|
|
27
|
+
uniforms: {};
|
|
28
|
+
/**
|
|
29
|
+
* Attributes.
|
|
30
|
+
* @public
|
|
31
|
+
* @type {Object}
|
|
32
|
+
*/
|
|
33
|
+
public _attributes: any;
|
|
34
|
+
/**
|
|
35
|
+
* Uniforms.
|
|
36
|
+
* @public
|
|
37
|
+
* @type {Object}
|
|
38
|
+
*/
|
|
39
|
+
public _uniforms: any;
|
|
40
|
+
/**
|
|
41
|
+
* Vertex shader.
|
|
42
|
+
* @public
|
|
43
|
+
* @type {string}
|
|
44
|
+
*/
|
|
45
|
+
public vertexShader: string;
|
|
46
|
+
/**
|
|
47
|
+
* Fragment shader.
|
|
48
|
+
* @public
|
|
49
|
+
* @type {string}
|
|
50
|
+
*/
|
|
51
|
+
public fragmentShader: string;
|
|
52
|
+
/**
|
|
53
|
+
* Webgl context.
|
|
54
|
+
* @public
|
|
55
|
+
* @type {Object}
|
|
56
|
+
*/
|
|
57
|
+
public gl: any;
|
|
58
|
+
/**
|
|
59
|
+
* All program variables.
|
|
60
|
+
* @private
|
|
61
|
+
* @type {Object}
|
|
62
|
+
*/
|
|
63
|
+
private _variables;
|
|
64
|
+
/**
|
|
65
|
+
* Program pointer.
|
|
66
|
+
* @private
|
|
67
|
+
* @type {Object}
|
|
68
|
+
*/
|
|
69
|
+
private _p;
|
|
70
|
+
/**
|
|
71
|
+
* Texture counter.
|
|
72
|
+
* @prvate
|
|
73
|
+
* @type {number}
|
|
74
|
+
*/
|
|
75
|
+
_textureID: number;
|
|
76
|
+
/**
|
|
77
|
+
* Program attributes array.
|
|
78
|
+
* @private
|
|
79
|
+
* @type {Array.<Object>}
|
|
80
|
+
*/
|
|
81
|
+
private _attribArrays;
|
|
82
|
+
/**
|
|
83
|
+
* Sets the current program frame.
|
|
84
|
+
* @public
|
|
85
|
+
*/
|
|
86
|
+
public use(): void;
|
|
87
|
+
/**
|
|
88
|
+
* Sets program variables.
|
|
89
|
+
* @public
|
|
90
|
+
* @param {Object} material - Variables and values object.
|
|
91
|
+
*/
|
|
92
|
+
public set(material: any): void;
|
|
93
|
+
/**
|
|
94
|
+
* Apply current variables.
|
|
95
|
+
* @public
|
|
96
|
+
*/
|
|
97
|
+
public apply(): void;
|
|
98
|
+
/**
|
|
99
|
+
* Calls drawElements index buffer function.
|
|
100
|
+
* @public
|
|
101
|
+
* @param {number} mode - Draw mode(GL_TRIANGLES, GL_LINESTRING etc.).
|
|
102
|
+
* @param {Object} buffer - Index buffer.
|
|
103
|
+
*/
|
|
104
|
+
public drawIndexBuffer(mode: number, buffer: any): void;
|
|
105
|
+
/**
|
|
106
|
+
* Calls drawArrays function.
|
|
107
|
+
* @public
|
|
108
|
+
* @param {number} mode - Draw mode(GL_TRIANGLES, GL_LINESTRING etc.).
|
|
109
|
+
* @param {number} numItems - Curent binded buffer drawing items count.
|
|
110
|
+
*/
|
|
111
|
+
public drawArrays(mode: number, numItems: number): void;
|
|
112
|
+
/**
|
|
113
|
+
* Check and log for an shader compile errors and warnings. Returns True - if no errors otherwise returns False.
|
|
114
|
+
* @private
|
|
115
|
+
* @param {Object} shader - WebGl shader program.
|
|
116
|
+
* @param {string} src - Shader program source.
|
|
117
|
+
* @returns {boolean} -
|
|
118
|
+
*/
|
|
119
|
+
private _getShaderCompileStatus;
|
|
120
|
+
/**
|
|
121
|
+
* Returns compiled vertex shader program pointer.
|
|
122
|
+
* @private
|
|
123
|
+
* @param {string} src - Vertex shader source code.
|
|
124
|
+
* @returns {Object} -
|
|
125
|
+
*/
|
|
126
|
+
private _createVertexShader;
|
|
127
|
+
/**
|
|
128
|
+
* Returns compiled fragment shader program pointer.
|
|
129
|
+
* @private
|
|
130
|
+
* @param {string} src - Vertex shader source code.
|
|
131
|
+
* @returns {Object} -
|
|
132
|
+
*/
|
|
133
|
+
private _createFragmentShader;
|
|
134
|
+
/**
|
|
135
|
+
* Disable current program vertexAttribArrays.
|
|
136
|
+
* @public
|
|
137
|
+
*/
|
|
138
|
+
public disableAttribArrays(): void;
|
|
139
|
+
/**
|
|
140
|
+
* Enable current program vertexAttribArrays.
|
|
141
|
+
* @public
|
|
142
|
+
*/
|
|
143
|
+
public enableAttribArrays(): void;
|
|
144
|
+
/**
|
|
145
|
+
* Delete program.
|
|
146
|
+
* @public
|
|
147
|
+
*/
|
|
148
|
+
public delete(): void;
|
|
149
|
+
/**
|
|
150
|
+
* Creates program.
|
|
151
|
+
* @public
|
|
152
|
+
* @param {Object} gl - WebGl context.
|
|
153
|
+
*/
|
|
154
|
+
public createProgram(gl: any): void;
|
|
155
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is shader program controller that used by hadler object to access the shader
|
|
3
|
+
* program capabilities, like switching program during the rendering.
|
|
4
|
+
* Get access to the program from ...handler.programs.<program name> etc.
|
|
5
|
+
* @class
|
|
6
|
+
* @param {og.webgl.Handler} handler - Handler.
|
|
7
|
+
* @param {og.webgl.Program} program - Shader program.
|
|
8
|
+
*/
|
|
9
|
+
export class ProgramController {
|
|
10
|
+
constructor(handler: any, program: any);
|
|
11
|
+
/**
|
|
12
|
+
* Shader program.
|
|
13
|
+
* @private
|
|
14
|
+
* @type {og.webgl.Program}
|
|
15
|
+
*/
|
|
16
|
+
private _program;
|
|
17
|
+
/**
|
|
18
|
+
* Handler.
|
|
19
|
+
* @private
|
|
20
|
+
* @type {og.webgl.Handler}
|
|
21
|
+
*/
|
|
22
|
+
private _handler;
|
|
23
|
+
/**
|
|
24
|
+
* Program current frame activation flag.
|
|
25
|
+
* @private
|
|
26
|
+
* @type {boolean}
|
|
27
|
+
*/
|
|
28
|
+
private _activated;
|
|
29
|
+
/**
|
|
30
|
+
* Lazy create program call.
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
public initialize(): void;
|
|
34
|
+
/**
|
|
35
|
+
* Returns controller's shader program.
|
|
36
|
+
* @public
|
|
37
|
+
* @return {og.webgl.Program} -
|
|
38
|
+
*/
|
|
39
|
+
public getProgram(): any;
|
|
40
|
+
/**
|
|
41
|
+
* Activates current shader program.
|
|
42
|
+
* @public
|
|
43
|
+
* @returns {ProgramController} -
|
|
44
|
+
*/
|
|
45
|
+
public activate(): ProgramController;
|
|
46
|
+
/**
|
|
47
|
+
* Remove program from handler
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
public remove(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Deactivate shader program. This is not necessary while activae function used.
|
|
53
|
+
* @public
|
|
54
|
+
*/
|
|
55
|
+
public deactivate(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Returns program activity.
|
|
58
|
+
* @public
|
|
59
|
+
* @return {boolean} -
|
|
60
|
+
*/
|
|
61
|
+
public isActive(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Sets program uniforms and attributes values and return controller instance.
|
|
64
|
+
* @public
|
|
65
|
+
* @param {Object} params - Object with variable name and value like { value: 12, someArray:[1,2,3], uSampler: texture,... }
|
|
66
|
+
* @return {og.webgl.ProgramController} -
|
|
67
|
+
*/
|
|
68
|
+
public set(params: any): any;
|
|
69
|
+
/**
|
|
70
|
+
* Draw index buffer with this program.
|
|
71
|
+
* @public
|
|
72
|
+
* @param {number} mode - Gl draw mode
|
|
73
|
+
* @param {WEBGLBuffer} buffer - Buffer to draw.
|
|
74
|
+
* @return {og.webgl.ProgramController} Returns current shader controller instance.
|
|
75
|
+
*/
|
|
76
|
+
public drawIndexBuffer(mode: number, buffer: any): any;
|
|
77
|
+
/**
|
|
78
|
+
* Calls Gl drawArray function.
|
|
79
|
+
* @param {number} mode - Gl draw mode.
|
|
80
|
+
* @param {number} numItems - draw items count.
|
|
81
|
+
* @return {og.webgl.ProgramController} Returns current shader controller instance.
|
|
82
|
+
*/
|
|
83
|
+
drawArrays(mode: number, numItems: number): any;
|
|
84
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export namespace callbacks { }
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Framebuffer } from "./Framebuffer.js";
|
|
2
|
+
import { Handler } from "./Handler.js";
|
|
3
|
+
import { Multisample } from "./Multisample.js";
|
|
4
|
+
import { types } from "./types.js";
|
|
5
|
+
import { Program } from "./Program.js";
|
|
6
|
+
export { Framebuffer, Handler, Multisample, types, Program };
|