@openglobus/og 0.11.5 → 0.12.0

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