@openglobus/og 0.11.2 → 0.11.7

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 (273) hide show
  1. package/package.json +13 -13
  2. package/src/og/Clock.js +10 -10
  3. package/src/og/Events.js +8 -6
  4. package/src/og/Extent.js +82 -41
  5. package/src/og/Globe.js +25 -13
  6. package/src/og/ImageCanvas.js +22 -16
  7. package/src/og/LonLat.js +16 -13
  8. package/src/og/Popup.js +21 -14
  9. package/src/og/QueueArray.js +6 -2
  10. package/src/og/Rectangle.js +11 -6
  11. package/src/og/Stack.js +5 -2
  12. package/src/og/ajax.js +21 -33
  13. package/src/og/astro/astro.js +5 -5
  14. package/src/og/astro/earth.js +22 -16
  15. package/src/og/astro/jd.js +23 -18
  16. package/src/og/astro/orbit.js +13 -11
  17. package/src/og/astro/rotation.js +17 -8
  18. package/src/og/bv/Box.js +7 -3
  19. package/src/og/bv/Sphere.js +14 -11
  20. package/src/og/camera/Camera.js +51 -54
  21. package/src/og/camera/Frustum.js +29 -18
  22. package/src/og/camera/PlanetCamera.js +32 -23
  23. package/src/og/control/CompassButton.js +5 -1
  24. package/src/og/control/Control.js +12 -10
  25. package/src/og/control/DebugInfo.js +4 -1
  26. package/src/og/control/EarthCoordinates.js +54 -33
  27. package/src/og/control/KeyboardNavigation.js +10 -10
  28. package/src/og/control/LayerSwitcher.js +22 -21
  29. package/src/og/control/Lighting.js +34 -3
  30. package/src/og/control/MouseNavigation.js +1 -1
  31. package/src/og/control/ScaleControl.js +1 -1
  32. package/src/og/control/SegmentBoundVisualization.js +6 -7
  33. package/src/og/control/ShowFps.js +13 -8
  34. package/src/og/control/SimpleNavigation.js +6 -8
  35. package/src/og/control/Sun.js +25 -15
  36. package/src/og/control/ToggleWireframe.js +4 -4
  37. package/src/og/control/TouchNavigation.js +44 -33
  38. package/src/og/control/ZoomControl.js +41 -25
  39. package/src/og/ellipsoid/Ellipsoid.js +162 -66
  40. package/src/og/ellipsoid/wgs84.js +4 -4
  41. package/src/og/entity/BaseBillboard.js +100 -56
  42. package/src/og/entity/Billboard.js +14 -10
  43. package/src/og/entity/BillboardHandler.js +317 -60
  44. package/src/og/entity/Entity.js +100 -68
  45. package/src/og/entity/EntityCollection.js +70 -47
  46. package/src/og/entity/GeoObject.js +228 -0
  47. package/src/og/entity/GeoObjectHandler.js +910 -0
  48. package/src/og/entity/Geometry.js +27 -24
  49. package/src/og/entity/GeometryHandler.js +596 -124
  50. package/src/og/entity/Label.js +80 -49
  51. package/src/og/entity/LabelHandler.js +45 -244
  52. package/src/og/entity/LabelWorker.js +218 -0
  53. package/src/og/entity/Object3d.js +504 -0
  54. package/src/og/entity/PointCloud.js +80 -32
  55. package/src/og/entity/PointCloudHandler.js +8 -8
  56. package/src/og/entity/Polyline.js +16 -16
  57. package/src/og/entity/Ray.js +60 -27
  58. package/src/og/entity/Strip.js +77 -48
  59. package/src/og/entity/StripHandler.js +26 -26
  60. package/src/og/entity/index.js +8 -16
  61. package/src/og/layer/BaseGeoImage.js +54 -23
  62. package/src/og/layer/CanvasTiles.js +24 -24
  63. package/src/og/layer/GeoImage.js +9 -9
  64. package/src/og/layer/GeoVideo.js +3 -3
  65. package/src/og/layer/KML.js +63 -37
  66. package/src/og/layer/Layer.js +44 -21
  67. package/src/og/layer/Material.js +23 -20
  68. package/src/og/layer/Vector.js +114 -68
  69. package/src/og/layer/WMS.js +34 -17
  70. package/src/og/layer/XYZ.js +48 -46
  71. package/src/og/light/LightSource.js +46 -39
  72. package/src/og/math/Mat3.js +34 -22
  73. package/src/og/math/Mat4.js +603 -459
  74. package/src/og/math/Plane.js +21 -20
  75. package/src/og/math/Quat.js +182 -139
  76. package/src/og/math/Ray.js +38 -33
  77. package/src/og/math/Vec2.js +85 -75
  78. package/src/og/math/Vec3.js +142 -112
  79. package/src/og/math/Vec4.js +27 -31
  80. package/src/og/math/coder.js +10 -10
  81. package/src/og/math.js +12 -12
  82. package/src/og/proj/EPSG3857.js +4 -4
  83. package/src/og/proj/EPSG4326.js +4 -4
  84. package/src/og/proj/Proj.js +4 -6
  85. package/src/og/quadTree/Node.js +8 -8
  86. package/src/og/renderer/Renderer.js +59 -52
  87. package/src/og/renderer/RendererEvents.js +50 -27
  88. package/src/og/scene/BaseNode.js +7 -8
  89. package/src/og/scene/Planet.js +102 -103
  90. package/src/og/scene/RenderNode.js +28 -21
  91. package/src/og/segment/Segment.js +26 -21
  92. package/src/og/segment/SegmentLonLat.js +5 -5
  93. package/src/og/shaders/drawnode.js +135 -142
  94. package/src/og/shaders/geoObject.js +211 -0
  95. package/src/og/shaders/pointCloud.js +41 -41
  96. package/src/og/shaders/shape.js +12 -18
  97. package/src/og/shaders/skybox.js +36 -36
  98. package/src/og/shaders/toneMapping.js +1 -0
  99. package/src/og/shapes/BaseShape.js +126 -54
  100. package/src/og/shapes/Icosphere.js +29 -14
  101. package/src/og/shapes/Sphere.js +12 -15
  102. package/src/og/terrain/BilTerrain.js +1 -0
  103. package/src/og/terrain/EmptyTerrain.js +2 -2
  104. package/src/og/terrain/GlobusTerrain.js +9 -9
  105. package/src/og/utils/FontAtlas.js +6 -2
  106. package/src/og/utils/TextureAtlas.js +22 -24
  107. package/src/og/utils/VectorTileCreator.js +1 -3
  108. package/src/og/utils/shared.js +16 -16
  109. package/src/og/webgl/Framebuffer.js +88 -40
  110. package/src/og/webgl/Handler.js +243 -169
  111. package/src/og/webgl/Multisample.js +47 -19
  112. package/src/og/webgl/Program.js +79 -34
  113. package/src/og/webgl/ProgramController.js +17 -13
  114. package/src/og/webgl/callbacks.js +8 -8
  115. package/src/og/inherits.js +0 -8
  116. package/src/og/utils/polylabel.js +0 -176
  117. package/types/Clock.d.ts +0 -90
  118. package/types/Deferred.d.ts +0 -6
  119. package/types/Events.d.ts +0 -73
  120. package/types/Extent.d.ts +0 -166
  121. package/types/Globe.d.ts +0 -75
  122. package/types/ImageCanvas.d.ts +0 -121
  123. package/types/Lock.d.ts +0 -12
  124. package/types/LonLat.d.ts +0 -108
  125. package/types/Popup.d.ts +0 -38
  126. package/types/QueueArray.d.ts +0 -15
  127. package/types/Rectangle.d.ts +0 -74
  128. package/types/Stack.d.ts +0 -15
  129. package/types/ajax.d.ts +0 -24
  130. package/types/arial.d.ts +0 -48
  131. package/types/astro/astro.d.ts +0 -38
  132. package/types/astro/earth.d.ts +0 -6
  133. package/types/astro/jd.d.ts +0 -254
  134. package/types/bv/Box.d.ts +0 -25
  135. package/types/bv/Sphere.d.ts +0 -38
  136. package/types/bv/index.d.ts +0 -3
  137. package/types/camera/Camera.d.ts +0 -303
  138. package/types/camera/Frustum.d.ts +0 -129
  139. package/types/camera/PlanetCamera.d.ts +0 -223
  140. package/types/camera/index.d.ts +0 -3
  141. package/types/cons.d.ts +0 -40
  142. package/types/control/CompassButton.d.ts +0 -18
  143. package/types/control/Control.d.ts +0 -101
  144. package/types/control/DebugInfo.d.ts +0 -16
  145. package/types/control/EarthCoordinates.d.ts +0 -47
  146. package/types/control/EarthNavigation.d.ts +0 -42
  147. package/types/control/GeoImageDragControl.d.ts +0 -6
  148. package/types/control/KeyboardNavigation.d.ts +0 -22
  149. package/types/control/LayerSwitcher.d.ts +0 -23
  150. package/types/control/Lighting.d.ts +0 -16
  151. package/types/control/MouseNavigation.d.ts +0 -51
  152. package/types/control/ScaleControl.d.ts +0 -22
  153. package/types/control/ShowFps.d.ts +0 -12
  154. package/types/control/SimpleNavigation.d.ts +0 -28
  155. package/types/control/Sun.d.ts +0 -52
  156. package/types/control/ToggleWireframe.d.ts +0 -12
  157. package/types/control/TouchNavigation.d.ts +0 -50
  158. package/types/control/ZoomControl.d.ts +0 -28
  159. package/types/control/index.d.ts +0 -17
  160. package/types/ellipsoid/Ellipsoid.d.ts +0 -142
  161. package/types/ellipsoid/index.d.ts +0 -3
  162. package/types/ellipsoid/wgs84.d.ts +0 -5
  163. package/types/entity/BaseBillboard.d.ts +0 -208
  164. package/types/entity/Billboard.d.ts +0 -94
  165. package/types/entity/BillboardHandler.d.ts +0 -74
  166. package/types/entity/Entity.d.ts +0 -331
  167. package/types/entity/EntityCollection.d.ts +0 -303
  168. package/types/entity/Geometry.d.ts +0 -73
  169. package/types/entity/GeometryHandler.d.ts +0 -76
  170. package/types/entity/Label.d.ts +0 -194
  171. package/types/entity/LabelHandler.d.ts +0 -24
  172. package/types/entity/PointCloud.d.ts +0 -174
  173. package/types/entity/PointCloudHandler.d.ts +0 -38
  174. package/types/entity/Polyline.d.ts +0 -304
  175. package/types/entity/PolylineHandler.d.ts +0 -18
  176. package/types/entity/Ray.d.ts +0 -123
  177. package/types/entity/RayHandler.d.ts +0 -67
  178. package/types/entity/ShapeHandler.d.ts +0 -22
  179. package/types/entity/Strip.d.ts +0 -118
  180. package/types/entity/StripHandler.d.ts +0 -38
  181. package/types/entity/index.d.ts +0 -8
  182. package/types/index.core.d.ts +0 -65
  183. package/types/index.d.ts +0 -45
  184. package/types/index.webgl.d.ts +0 -7
  185. package/types/inherits.d.ts +0 -4
  186. package/types/input/KeyboardHandler.d.ts +0 -10
  187. package/types/input/MouseHandler.d.ts +0 -5
  188. package/types/input/TouchHandler.d.ts +0 -5
  189. package/types/input/input.d.ts +0 -34
  190. package/types/layer/BaseGeoImage.d.ts +0 -107
  191. package/types/layer/CanvasTiles.d.ts +0 -75
  192. package/types/layer/GeoImage.d.ts +0 -65
  193. package/types/layer/GeoTexture2d.d.ts +0 -8
  194. package/types/layer/GeoVideo.d.ts +0 -80
  195. package/types/layer/KML.d.ts +0 -58
  196. package/types/layer/Layer.d.ts +0 -321
  197. package/types/layer/Material.d.ts +0 -48
  198. package/types/layer/Vector.d.ts +0 -228
  199. package/types/layer/WMS.d.ts +0 -66
  200. package/types/layer/XYZ.d.ts +0 -130
  201. package/types/layer/index.d.ts +0 -10
  202. package/types/light/LightSource.d.ts +0 -177
  203. package/types/math/Line2.d.ts +0 -11
  204. package/types/math/Line3.d.ts +0 -10
  205. package/types/math/Mat3.d.ts +0 -63
  206. package/types/math/Mat4.d.ts +0 -173
  207. package/types/math/Plane.d.ts +0 -17
  208. package/types/math/Quat.d.ts +0 -376
  209. package/types/math/Ray.d.ts +0 -81
  210. package/types/math/Vec2.d.ts +0 -308
  211. package/types/math/Vec3.d.ts +0 -459
  212. package/types/math/Vec4.d.ts +0 -161
  213. package/types/math/coder.d.ts +0 -42
  214. package/types/math/index.d.ts +0 -11
  215. package/types/math.d.ts +0 -261
  216. package/types/mercator.d.ts +0 -92
  217. package/types/proj/EPSG3857.d.ts +0 -5
  218. package/types/proj/EPSG4326.d.ts +0 -5
  219. package/types/proj/Proj.d.ts +0 -42
  220. package/types/quadTree/EntityCollectionNode.d.ts +0 -34
  221. package/types/quadTree/Node.d.ts +0 -61
  222. package/types/quadTree/quadTree.d.ts +0 -40
  223. package/types/renderer/Renderer.d.ts +0 -296
  224. package/types/renderer/RendererEvents.d.ts +0 -230
  225. package/types/res/images.d.ts +0 -3
  226. package/types/scene/Axes.d.ts +0 -11
  227. package/types/scene/BaseNode.d.ts +0 -60
  228. package/types/scene/Planet.d.ts +0 -574
  229. package/types/scene/RenderNode.d.ts +0 -143
  230. package/types/scene/SkyBox.d.ts +0 -10
  231. package/types/scene/index.d.ts +0 -4
  232. package/types/segment/Segment.d.ts +0 -271
  233. package/types/segment/SegmentLonLat.d.ts +0 -62
  234. package/types/segment/segmentHelper.d.ts +0 -13
  235. package/types/shaders/billboard.d.ts +0 -3
  236. package/types/shaders/depth.d.ts +0 -2
  237. package/types/shaders/drawnode.d.ts +0 -7
  238. package/types/shaders/label.d.ts +0 -4
  239. package/types/shaders/pointCloud.d.ts +0 -2
  240. package/types/shaders/polyline.d.ts +0 -3
  241. package/types/shaders/ray.d.ts +0 -2
  242. package/types/shaders/screenFrame.d.ts +0 -2
  243. package/types/shaders/shape.d.ts +0 -4
  244. package/types/shaders/skybox.d.ts +0 -2
  245. package/types/shaders/toneMapping.d.ts +0 -2
  246. package/types/shapes/BaseShape.d.ts +0 -247
  247. package/types/shapes/Sphere.d.ts +0 -41
  248. package/types/terrain/BilTerrain.d.ts +0 -8
  249. package/types/terrain/EmptyTerrain.d.ts +0 -72
  250. package/types/terrain/Geoid.d.ts +0 -26
  251. package/types/terrain/GlobusTerrain.d.ts +0 -153
  252. package/types/terrain/MapboxTerrain.d.ts +0 -8
  253. package/types/terrain/index.d.ts +0 -5
  254. package/types/utils/FontAtlas.d.ts +0 -14
  255. package/types/utils/GeoImageCreator.d.ts +0 -30
  256. package/types/utils/ImagesCacheManager.d.ts +0 -10
  257. package/types/utils/Loader.d.ts +0 -25
  258. package/types/utils/NormalMapCreator.d.ts +0 -39
  259. package/types/utils/PlainSegmentWorker.d.ts +0 -10
  260. package/types/utils/TerrainWorker.d.ts +0 -9
  261. package/types/utils/TextureAtlas.d.ts +0 -111
  262. package/types/utils/VectorTileCreator.d.ts +0 -16
  263. package/types/utils/colorTable.d.ts +0 -143
  264. package/types/utils/earcut.d.ts +0 -6
  265. package/types/utils/shared.d.ts +0 -230
  266. package/types/webgl/Framebuffer.d.ts +0 -135
  267. package/types/webgl/Handler.d.ts +0 -372
  268. package/types/webgl/Multisample.d.ts +0 -89
  269. package/types/webgl/Program.d.ts +0 -155
  270. package/types/webgl/ProgramController.d.ts +0 -84
  271. package/types/webgl/callbacks.d.ts +0 -1
  272. package/types/webgl/index.d.ts +0 -6
  273. package/types/webgl/types.d.ts +0 -2
@@ -1,372 +0,0 @@
1
- /**
2
- * A WebGL handler for accessing low-level WebGL capabilities.
3
- * @class
4
- * @param {string} id - Canvas element id that WebGL handler assing with. If it's null
5
- * or undefined creates hidden canvas and handler bacomes hidden.
6
- * @param {Object} [params] - Handler options:
7
- * @param {number} [params.anisotropy] - Anisitropy filter degree. 8 is default.
8
- * @param {number} [params.width] - Hidden handler width. 256 is default.
9
- * @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
- * @param {Array.<string>} [params.extensions] - Additional WebGL extension list. Available by default: EXT_texture_filter_anisotropic.
12
- */
13
- export class Handler {
14
- /**
15
- * The return value is null if the extension is not supported, or an extension object otherwise.
16
- * @param {Object} gl - WebGl context pointer.
17
- * @param {String} name - Extension name.
18
- * @returns {Object} -
19
- */
20
- static getExtension(gl: any, name: string): any;
21
- /**
22
- * Returns a drawing context on the canvas, or null if the context identifier is not supported.
23
- * @param {Object} canvas - HTML canvas object.
24
- * @param {Object} [contextAttributes] - See canvas.getContext contextAttributes.
25
- * @returns {Object} -
26
- */
27
- static getContext(canvas: any, contextAttributes?: any): any;
28
- constructor(id: any, params: any);
29
- /**
30
- * Application default timer.
31
- * @public
32
- * @type {og.Clock}
33
- */
34
- public defaultClock: any;
35
- /**
36
- * Custom timers.
37
- * @protected
38
- * @type{og.Clock[]}
39
- */
40
- protected _clocks: any[];
41
- /**
42
- * Draw frame time in milliseconds.
43
- * @public
44
- * @readonly
45
- * @type {number}
46
- */
47
- public readonly deltaTime: number;
48
- /**
49
- * WebGL rendering canvas element.
50
- * @public
51
- * @type {Object}
52
- */
53
- public canvas: any;
54
- /**
55
- * WebGL context.
56
- * @public
57
- * @type {Object}
58
- */
59
- public gl: any;
60
- /**
61
- * Shader program controller list.
62
- * @public
63
- * @type {Object.<og.webgl.ProgramController>}
64
- */
65
- public programs: any;
66
- /**
67
- * Current active shader program controller.
68
- * @public
69
- * @type {og.webgl.ProgramController}
70
- */
71
- public activeProgram: any;
72
- /**
73
- * Handler parameters.
74
- * @private
75
- * @type {Object}
76
- */
77
- private _params;
78
- _oneByHeight: number;
79
- /**
80
- * Current WebGL extensions. Becomes here after context initialization.
81
- * @public
82
- * @type {Object}
83
- */
84
- public extensions: any;
85
- /**
86
- * HTML Canvas object id.
87
- * @private
88
- * @type {Object}
89
- */
90
- private _id;
91
- _lastAnimationFrameTime: number;
92
- _initialized: boolean;
93
- /**
94
- * Animation frame function assigned from outside(Ex. from Renderer).
95
- * @private
96
- * @type {frameCallback}
97
- */
98
- private _frameCallback;
99
- transparentTexture: any;
100
- framebufferStack: Stack;
101
- /**
102
- * Sets animation frame function.
103
- * @public
104
- * @param {callback} callback - Frame callback.
105
- */
106
- 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
- /**
115
- * Creates empty texture.
116
- * @public
117
- * @param {Number} [width=1] - Specifies the width of the texture image..
118
- * @param {Number} [height=1] - Specifies the width of the texture image..
119
- * @param {String} [filter="NEAREST"] - Specifies GL_TEXTURE_MIN(MAX)_FILTER texture value.
120
- * @param {String} [internalFormat="RGBA"] - Specifies the color components in the texture.
121
- * @param {String} [format="RGBA"] - Specifies the format of the texel data.
122
- * @param {String} [type="UNSIGNED_BYTE"] - Specifies the data type of the texel data.
123
- * @param {Number} [levels=0] - Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
124
- * @returns {Object} - WebGL texture object.
125
- */
126
- public createEmptyTexture2DExt(width?: number, height?: number, filter?: string, internalFormat?: string, format?: string, type?: string, level?: number): any;
127
- /**
128
- * Creates Empty NEAREST filtered texture.
129
- * @public
130
- * @param {number} width - Empty texture width.
131
- * @param {number} height - Empty texture height.
132
- * @returns {Object} - WebGL texture object.
133
- */
134
- public createEmptyTexture_n(width: number, height: number): any;
135
- /**
136
- * Creates empty LINEAR filtered texture.
137
- * @public
138
- * @param {number} width - Empty texture width.
139
- * @param {number} height - Empty texture height.
140
- * @returns {Object} - WebGL texture object.
141
- */
142
- 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
- /**
165
- * Creates DEFAULT filter texture, ANISOTROPY is default.
166
- * @public
167
- * @param {Object} image - Image or Canvas object.
168
- * @returns {Object} - WebGL texture object.
169
- */
170
- public createTexture(image: any): any;
171
- /**
172
- * Creates cube texture.
173
- * @public
174
- * @param {Object.<string>} params - Face image urls:
175
- * @param {string} params.px - Positive X or right image url.
176
- * @param {string} params.nx - Negative X or left image url.
177
- * @param {string} params.py - Positive Y or up image url.
178
- * @param {string} params.ny - Negative Y or bottom image url.
179
- * @param {string} params.pz - Positive Z or face image url.
180
- * @param {string} params.nz - Negative Z or back image url.
181
- * @returns {Object} - WebGL texture object.
182
- */
183
- public loadCubeMapTexture(params: any): any;
184
- /**
185
- * Adds shader program to the handler.
186
- * @public
187
- * @param {og.webgl.Program} program - Shader program.
188
- * @param {boolean} [notActivate] - If it's true program will not compile.
189
- * @return {og.webgl.Program} -
190
- */
191
- public addProgram(program: any, notActivate?: boolean): any;
192
- /**
193
- * Removes shader program from handler.
194
- * @public
195
- * @param {String} name - Shader program name.
196
- */
197
- public removeProgram(name: string): void;
198
- /**
199
- * Adds shader programs to the handler.
200
- * @public
201
- * @param {Array.<og.webgl.Program>} programsArr - Shader program array.
202
- */
203
- public addPrograms(programsArr: Array<any>): void;
204
- /**
205
- * Used in addProgram
206
- * @private
207
- * @param {og.webgl.ProgramController} sc - Program controller
208
- */
209
- private _initProgramController;
210
- /**
211
- * Used in init function.
212
- * @private
213
- */
214
- private _initPrograms;
215
- /**
216
- * Initialize additional WebGL extensions.
217
- * @public
218
- * @param {string} extensionStr - Extension name.
219
- * @param {boolean} showLog - Show logging.
220
- * @return {Object} -
221
- */
222
- public initializeExtension(extensionStr: string, showLog: boolean): any;
223
- /**
224
- * Main function that initialize handler.
225
- * @public
226
- */
227
- public initialize(): void;
228
- /**
229
- * Sets default gl render parameters. Used in init function.
230
- * @private
231
- */
232
- private _setDefaults;
233
- /**
234
- * Activate depth test.
235
- * @public
236
- */
237
- public activateDepthTest(): void;
238
- /**
239
- * Deactivate depth test.
240
- * @public
241
- */
242
- public deactivateDepthTest(): void;
243
- /**
244
- * Activate face culling.
245
- * @public
246
- */
247
- public activateFaceCulling(): void;
248
- /**
249
- * Deactivate face cullting.
250
- * @public
251
- */
252
- public deactivateFaceCulling(): void;
253
- /**
254
- * Activate blending.
255
- * @public
256
- */
257
- public activateBlending(): void;
258
- /**
259
- * Deactivate blending.
260
- * @public
261
- */
262
- public deactivateBlending(): void;
263
- /**
264
- * Creates STREAM_DRAW ARRAY buffer.
265
- * @public
266
- * @param {Array.<number>} array - Input array.
267
- * @param {number} itemSize - Array item size.
268
- * @param {number} numItems - Items quantity.
269
- * @param {number} [usage=STATIC_DRAW] - Parameter of the bufferData call can be one of STATIC_DRAW, DYNAMIC_DRAW, or STREAM_DRAW.
270
- * @return {Object} -
271
- */
272
- public createStreamArrayBuffer(itemSize: number, numItems: number, usage?: number, bites?: number): any;
273
- /**
274
- * Load stream ARRAY buffer.
275
- * @public
276
- * @param {Array.<number>} array - Input array.
277
- * @param {number} itemSize - Array item size.
278
- * @param {number} numItems - Items quantity.
279
- * @param {number} [usage=STATIC_DRAW] - Parameter of the bufferData call can be one of STATIC_DRAW, DYNAMIC_DRAW, or STREAM_DRAW.
280
- * @return {Object} -
281
- */
282
- public setStreamArrayBuffer(buffer: any, array: Array<number>, offset?: number): any;
283
- /**
284
- * Creates ARRAY buffer.
285
- * @public
286
- * @param {Array.<number>} array - Input array.
287
- * @param {number} itemSize - Array item size.
288
- * @param {number} numItems - Items quantity.
289
- * @param {number} [usage=STATIC_DRAW] - Parameter of the bufferData call can be one of STATIC_DRAW, DYNAMIC_DRAW, or STREAM_DRAW.
290
- * @return {Object} -
291
- */
292
- public createArrayBuffer(array: Array<number>, itemSize: number, numItems: number, usage?: number): any;
293
- /**
294
- * Creates ELEMENT ARRAY buffer.
295
- * @public
296
- * @param {Array.<number>} array - Input array.
297
- * @param {number} itemSize - Array item size.
298
- * @param {number} numItems - Items quantity.
299
- * @param {number} [usage=STATIC_DRAW] - Parameter of the bufferData call can be one of STATIC_DRAW, DYNAMIC_DRAW, or STREAM_DRAW.
300
- * @return {Object} -
301
- */
302
- public createElementArrayBuffer(array: Array<number>, itemSize: number, numItems: number, usage?: number): any;
303
- /**
304
- * Sets handler canvas size.
305
- * @public
306
- * @param {number} w - Canvas width.
307
- * @param {number} h - Canvas height.
308
- */
309
- public setSize(w: number, h: number): void;
310
- /**
311
- * Returns context screen width.
312
- * @public
313
- * @returns {number} -
314
- */
315
- public getWidth(): number;
316
- /**
317
- * Returns context screen height.
318
- * @public
319
- * @returns {number} -
320
- */
321
- public getHeight(): number;
322
- /**
323
- * Returns canvas aspect ratio.
324
- * @public
325
- * @returns {number} -
326
- */
327
- public getClientAspect(): number;
328
- /**
329
- * Returns screen center coordinates.
330
- * @public
331
- * @returns {number} -
332
- */
333
- public getCenter(): number;
334
- /**
335
- * Draw single frame.
336
- * @public
337
- * @param {number} now - Frame current time milliseconds.
338
- */
339
- public drawFrame(): void;
340
- /**
341
- * Clearing gl frame.
342
- * @public
343
- */
344
- public clearFrame(): void;
345
- /**
346
- * Starts animation loop.
347
- * @public
348
- */
349
- public start(): void;
350
- stop(): void;
351
- _requestAnimationFrameId: number;
352
- /**
353
- * Make animation.
354
- * @private
355
- */
356
- private _animationFrameCallback;
357
- /**
358
- * Creates default texture object
359
- * @public
360
- * @param {Object} [params] - Texture parameters:
361
- * @param {callback} [success] - Creation callback
362
- */
363
- public createDefaultTexture(params?: any, success?: any): void;
364
- /**
365
- * @public
366
- */
367
- public destroy(): void;
368
- addClock(clock: any): void;
369
- addClocks(clockArr: any): void;
370
- removeClock(clock: any): void;
371
- }
372
- import { Stack } from "../Stack.js";
@@ -1,89 +0,0 @@
1
- /**
2
- * Class represents multisample framebuffer.
3
- * @class
4
- * @param {og.webgl.Handler} handler - WebGL handler.
5
- * @param {Object} [options] - Framebuffer options:
6
- * @param {number} [options.width] - Framebuffer width. Default is handler canvas width.
7
- * @param {number} [options.height] - Framebuffer height. Default is handler canvas height.
8
- * @param {Object} [options.texture] - Texture to render.
9
- * @param {String} [options.depthComponent="DEPTH_COMPONENT16"] - Specifies depth buffer size.
10
- * @param {Boolean} [options.useDepth] - Using depth buffer during the rendering.
11
- */
12
- export class Multisample {
13
- constructor(handler: any, options: any);
14
- /**
15
- * WebGL handler.
16
- * @public
17
- * @type {og.webgl.Handler}
18
- */
19
- public handler: any;
20
- _internalFormat: any;
21
- /**
22
- * Framebuffer object.
23
- * @private
24
- * @type {Object}
25
- */
26
- private _fbo;
27
- /**
28
- * Renderbuffer object.
29
- * @private
30
- * @type {Object}
31
- */
32
- private _depthRenderbuffer;
33
- /**
34
- * Framebuffer width.
35
- * @private
36
- * @type {number}
37
- */
38
- private _width;
39
- /**
40
- * Framebuffer width.
41
- * @private
42
- * @type {number}
43
- */
44
- private _height;
45
- _msaa: any;
46
- _useDepth: any;
47
- _depthComponent: any;
48
- /**
49
- * Framebuffer activity.
50
- * @private
51
- * @type {boolean}
52
- */
53
- private _active;
54
- _size: any;
55
- _filter: any;
56
- _glFilter: any;
57
- renderbuffers: any[];
58
- destroy(): void;
59
- /**
60
- * Framebuffer initialization.
61
- * @private
62
- */
63
- private init;
64
- blitTo(framebuffer: any, attachmentIndex?: number): void;
65
- /**
66
- * Sets framebuffer viewport size.
67
- * @public
68
- * @param {number} width - Framebuffer width.
69
- * @param {number} height - Framebuffer height.
70
- */
71
- public setSize(width: number, height: number, forceDestroy: any): void;
72
- /**
73
- * Returns framebuffer completed.
74
- * @public
75
- * @returns {boolean} -
76
- */
77
- public isComplete(): boolean;
78
- /**
79
- * Activate framebuffer frame to draw.
80
- * @public
81
- * @returns {og.webgl.Framebuffer} Returns Current framebuffer.
82
- */
83
- public activate(): any;
84
- /**
85
- * Deactivate framebuffer frame.
86
- * @public
87
- */
88
- public deactivate(): void;
89
- }
@@ -1,155 +0,0 @@
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
- }
@@ -1,84 +0,0 @@
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
- }
@@ -1 +0,0 @@
1
- export namespace callbacks { }
@@ -1,6 +0,0 @@
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 };
@@ -1,2 +0,0 @@
1
- export const types: {};
2
- export const typeStr: {};