@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.
Files changed (172) hide show
  1. package/css/og.css +1 -1
  2. package/package.json +11 -9
  3. package/src/og/Extent.js +274 -273
  4. package/src/og/Globe.js +11 -3
  5. package/src/og/LonLat.js +152 -146
  6. package/src/og/Popup.js +2 -1
  7. package/src/og/camera/PlanetCamera.js +112 -38
  8. package/src/og/control/EarthNavigation.js +259 -0
  9. package/src/og/control/MouseNavigation.js +68 -40
  10. package/src/og/entity/EntityCollection.js +1 -1
  11. package/src/og/entity/LabelHandler.js +366 -74
  12. package/src/og/entity/Polyline.js +3 -2
  13. package/src/og/layer/CanvasTiles.js +32 -30
  14. package/src/og/layer/KML.js +159 -0
  15. package/src/og/layer/Vector.js +5 -0
  16. package/src/og/layer/index.js +2 -1
  17. package/src/og/math/Vec2.js +448 -448
  18. package/src/og/math/Vec3.js +759 -757
  19. package/src/og/math/Vec4.js +216 -215
  20. package/src/og/quadTree/Node.js +67 -13
  21. package/src/og/renderer/RendererEvents.js +21 -16
  22. package/src/og/scene/Planet.js +25 -10
  23. package/src/og/segment/Segment.js +3 -3
  24. package/src/og/segment/SegmentLonLat.js +7 -0
  25. package/src/og/terrain/GlobusTerrain.js +4 -0
  26. package/src/og/utils/FontAtlas.js +1 -0
  27. package/src/og/utils/GeoImageCreator.js +123 -121
  28. package/src/og/utils/Loader.js +81 -80
  29. package/src/og/utils/NormalMapCreator.js +320 -318
  30. package/src/og/utils/VectorTileCreator.js +251 -250
  31. package/src/og/webgl/Framebuffer.js +265 -264
  32. package/src/og/webgl/Handler.js +1022 -1001
  33. package/src/og/webgl/Multisample.js +169 -168
  34. package/src/og/webgl/ProgramController.js +113 -112
  35. package/types/Clock.d.ts +90 -0
  36. package/types/Deferred.d.ts +6 -0
  37. package/types/Events.d.ts +73 -0
  38. package/types/Extent.d.ts +162 -0
  39. package/types/Globe.d.ts +80 -0
  40. package/types/ImageCanvas.d.ts +121 -0
  41. package/types/Lock.d.ts +12 -0
  42. package/types/LonLat.d.ts +108 -0
  43. package/types/Popup.d.ts +38 -0
  44. package/types/QueueArray.d.ts +15 -0
  45. package/types/Rectangle.d.ts +74 -0
  46. package/types/Stack.d.ts +15 -0
  47. package/types/ajax.d.ts +24 -0
  48. package/types/arial.d.ts +48 -0
  49. package/types/astro/astro.d.ts +38 -0
  50. package/types/astro/earth.d.ts +6 -0
  51. package/types/astro/jd.d.ts +254 -0
  52. package/types/bv/Box.d.ts +25 -0
  53. package/types/bv/Sphere.d.ts +32 -0
  54. package/types/bv/index.d.ts +3 -0
  55. package/types/camera/Camera.d.ts +303 -0
  56. package/types/camera/Frustum.d.ts +129 -0
  57. package/types/camera/PlanetCamera.d.ts +222 -0
  58. package/types/camera/index.d.ts +3 -0
  59. package/types/cons.d.ts +40 -0
  60. package/types/control/CompassButton.d.ts +17 -0
  61. package/types/control/Control.d.ts +101 -0
  62. package/types/control/DebugInfo.d.ts +16 -0
  63. package/types/control/EarthCoordinates.d.ts +47 -0
  64. package/types/control/GeoImageDragControl.d.ts +6 -0
  65. package/types/control/KeyboardNavigation.d.ts +22 -0
  66. package/types/control/LayerSwitcher.d.ts +23 -0
  67. package/types/control/Lighting.d.ts +16 -0
  68. package/types/control/ScaleControl.d.ts +22 -0
  69. package/types/control/ShowFps.d.ts +12 -0
  70. package/types/control/SimpleNavigation.d.ts +28 -0
  71. package/types/control/Sun.d.ts +52 -0
  72. package/types/control/ToggleWireframe.d.ts +12 -0
  73. package/types/control/ZoomControl.d.ts +28 -0
  74. package/types/control/index.d.ts +15 -0
  75. package/types/ellipsoid/Ellipsoid.d.ts +142 -0
  76. package/types/ellipsoid/index.d.ts +3 -0
  77. package/types/ellipsoid/wgs84.d.ts +5 -0
  78. package/types/entity/BaseBillboard.d.ts +208 -0
  79. package/types/entity/Billboard.d.ts +94 -0
  80. package/types/entity/BillboardHandler.d.ts +74 -0
  81. package/types/entity/Entity.d.ts +330 -0
  82. package/types/entity/EntityCollection.d.ts +303 -0
  83. package/types/entity/Geometry.d.ts +72 -0
  84. package/types/entity/GeometryHandler.d.ts +76 -0
  85. package/types/entity/Label.d.ts +194 -0
  86. package/types/entity/LabelHandler.d.ts +24 -0
  87. package/types/entity/PointCloud.d.ts +174 -0
  88. package/types/entity/PointCloudHandler.d.ts +38 -0
  89. package/types/entity/Polyline.d.ts +303 -0
  90. package/types/entity/PolylineHandler.d.ts +18 -0
  91. package/types/entity/Ray.d.ts +123 -0
  92. package/types/entity/RayHandler.d.ts +67 -0
  93. package/types/entity/ShapeHandler.d.ts +22 -0
  94. package/types/entity/Strip.d.ts +118 -0
  95. package/types/entity/StripHandler.d.ts +38 -0
  96. package/types/entity/index.d.ts +8 -0
  97. package/types/index.core.d.ts +65 -0
  98. package/types/index.d.ts +45 -0
  99. package/types/index.webgl.d.ts +7 -0
  100. package/types/inherits.d.ts +4 -0
  101. package/types/input/input.d.ts +34 -0
  102. package/types/layer/BaseGeoImage.d.ts +106 -0
  103. package/types/layer/CanvasTiles.d.ts +75 -0
  104. package/types/layer/GeoImage.d.ts +65 -0
  105. package/types/layer/GeoTexture2d.d.ts +8 -0
  106. package/types/layer/GeoVideo.d.ts +80 -0
  107. package/types/layer/KML.d.ts +58 -0
  108. package/types/layer/WMS.d.ts +66 -0
  109. package/types/layer/XYZ.d.ts +126 -0
  110. package/types/layer/index.d.ts +10 -0
  111. package/types/light/LightSource.d.ts +177 -0
  112. package/types/math/Mat3.d.ts +53 -0
  113. package/types/math/Mat4.d.ts +157 -0
  114. package/types/math/Plane.d.ts +17 -0
  115. package/types/math/Vec2.d.ts +308 -0
  116. package/types/math/Vec3.d.ts +459 -0
  117. package/types/math/Vec4.d.ts +161 -0
  118. package/types/math/coder.d.ts +42 -0
  119. package/types/math/index.d.ts +11 -0
  120. package/types/math.d.ts +261 -0
  121. package/types/mercator.d.ts +92 -0
  122. package/types/proj/EPSG3857.d.ts +5 -0
  123. package/types/proj/EPSG4326.d.ts +5 -0
  124. package/types/quadTree/quadTree.d.ts +40 -0
  125. package/types/renderer/RendererEvents.d.ts +230 -0
  126. package/types/res/images.d.ts +3 -0
  127. package/types/scene/Axes.d.ts +11 -0
  128. package/types/scene/BaseNode.d.ts +60 -0
  129. package/types/scene/Planet.d.ts +572 -0
  130. package/types/scene/RenderNode.d.ts +143 -0
  131. package/types/scene/SkyBox.d.ts +10 -0
  132. package/types/scene/index.d.ts +4 -0
  133. package/types/segment/segmentHelper.d.ts +13 -0
  134. package/types/shaders/billboard.d.ts +3 -0
  135. package/types/shaders/depth.d.ts +2 -0
  136. package/types/shaders/drawnode.d.ts +7 -0
  137. package/types/shaders/label.d.ts +4 -0
  138. package/types/shaders/pointCloud.d.ts +2 -0
  139. package/types/shaders/polyline.d.ts +3 -0
  140. package/types/shaders/ray.d.ts +2 -0
  141. package/types/shaders/screenFrame.d.ts +2 -0
  142. package/types/shaders/shape.d.ts +4 -0
  143. package/types/shaders/skybox.d.ts +2 -0
  144. package/types/shaders/toneMapping.d.ts +2 -0
  145. package/types/shapes/BaseShape.d.ts +247 -0
  146. package/types/shapes/Sphere.d.ts +41 -0
  147. package/types/terrain/BilTerrain.d.ts +8 -0
  148. package/types/terrain/EmptyTerrain.d.ts +72 -0
  149. package/types/terrain/Geoid.d.ts +26 -0
  150. package/types/terrain/GlobusTerrain.d.ts +153 -0
  151. package/types/terrain/MapboxTerrain.d.ts +8 -0
  152. package/types/terrain/index.d.ts +5 -0
  153. package/types/utils/FontAtlas.d.ts +14 -0
  154. package/types/utils/GeoImageCreator.d.ts +29 -0
  155. package/types/utils/ImagesCacheManager.d.ts +10 -0
  156. package/types/utils/Loader.d.ts +25 -0
  157. package/types/utils/NormalMapCreator.d.ts +39 -0
  158. package/types/utils/PlainSegmentWorker.d.ts +10 -0
  159. package/types/utils/TerrainWorker.d.ts +9 -0
  160. package/types/utils/TextureAtlas.d.ts +111 -0
  161. package/types/utils/VectorTileCreator.d.ts +16 -0
  162. package/types/utils/colorTable.d.ts +143 -0
  163. package/types/utils/earcut.d.ts +6 -0
  164. package/types/utils/shared.d.ts +230 -0
  165. package/types/webgl/Framebuffer.d.ts +135 -0
  166. package/types/webgl/Handler.d.ts +372 -0
  167. package/types/webgl/Multisample.d.ts +89 -0
  168. package/types/webgl/Program.d.ts +155 -0
  169. package/types/webgl/ProgramController.d.ts +84 -0
  170. package/types/webgl/callbacks.d.ts +1 -0
  171. package/types/webgl/index.d.ts +6 -0
  172. 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 };
@@ -0,0 +1,2 @@
1
+ export const types: {};
2
+ export const typeStr: {};