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