@openglobus/og 0.11.7 → 0.12.3

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 (211) hide show
  1. package/css/og.css +5 -2
  2. package/dist/@openglobus/og.css +1 -0
  3. package/dist/@openglobus/og.esm.js +21 -0
  4. package/dist/@openglobus/og.esm.js.map +1 -0
  5. package/dist/@openglobus/og.umd.js +21 -0
  6. package/dist/@openglobus/og.umd.js.map +1 -0
  7. package/package.json +11 -11
  8. package/src/og/Globe.js +18 -6
  9. package/src/og/camera/Camera.js +70 -79
  10. package/src/og/camera/PlanetCamera.js +25 -30
  11. package/src/og/control/DebugInfo.js +2 -2
  12. package/src/og/control/EarthNavigation.js +26 -17
  13. package/src/og/control/Lighting.js +52 -73
  14. package/src/og/control/MouseNavigation.js +30 -29
  15. package/src/og/control/MouseWheelZoomControl.js +257 -0
  16. package/src/og/control/Sun.js +3 -3
  17. package/src/og/control/index.js +2 -0
  18. package/src/og/control/visibleExtent/Segment.js +1862 -0
  19. package/src/og/control/visibleExtent/VisibleExtent.js +80 -0
  20. package/src/og/control/visibleExtent/drawnode.js +751 -0
  21. package/src/og/entity/BaseBillboard.js +9 -9
  22. package/src/og/entity/Entity.js +742 -742
  23. package/src/og/entity/GeoObjectHandler.js +138 -134
  24. package/src/og/entity/Label.js +7 -7
  25. package/src/og/entity/LabelHandler.js +2 -1
  26. package/src/og/layer/CanvasTiles.js +8 -12
  27. package/src/og/layer/GeoImage.js +2 -10
  28. package/src/og/layer/GeoTexture2d.js +2 -10
  29. package/src/og/layer/GeoVideo.js +2 -10
  30. package/src/og/layer/KML.js +19 -12
  31. package/src/og/layer/Layer.js +4 -23
  32. package/src/og/layer/WMS.js +0 -2
  33. package/src/og/layer/XYZ.js +31 -33
  34. package/src/og/math/Vec3.js +18 -2
  35. package/src/og/quadTree/Node.js +48 -93
  36. package/src/og/quadTree/quadTree.js +1 -1
  37. package/src/og/renderer/Renderer.js +69 -96
  38. package/src/og/renderer/RendererEvents.js +3 -1
  39. package/src/og/scene/Planet.js +171 -173
  40. package/src/og/segment/Segment.js +99 -268
  41. package/src/og/segment/Slice.js +45 -0
  42. package/src/og/shaders/drawnode.js +171 -350
  43. package/src/og/shaders/geoObject.js +15 -6
  44. package/src/og/terrain/EmptyTerrain.js +3 -2
  45. package/src/og/terrain/GlobusTerrain.js +2 -0
  46. package/src/og/utils/GeoImageCreator.js +5 -1
  47. package/src/og/utils/Loader.js +1 -1
  48. package/src/og/utils/PlainSegmentWorker.js +0 -13
  49. package/src/og/webgl/Handler.js +14 -10
  50. package/types/Clock.d.ts +94 -0
  51. package/types/Deferred.d.ts +6 -0
  52. package/types/Events.d.ts +77 -0
  53. package/types/Extent.d.ts +166 -0
  54. package/types/Globe.d.ts +85 -0
  55. package/types/ImageCanvas.d.ts +123 -0
  56. package/types/Lock.d.ts +12 -0
  57. package/types/LonLat.d.ts +108 -0
  58. package/types/Popup.d.ts +42 -0
  59. package/types/QueueArray.d.ts +19 -0
  60. package/types/Rectangle.d.ts +80 -0
  61. package/types/Stack.d.ts +19 -0
  62. package/types/ajax.d.ts +24 -0
  63. package/types/arial.d.ts +48 -0
  64. package/types/astro/astro.d.ts +38 -0
  65. package/types/astro/earth.d.ts +7 -0
  66. package/types/astro/jd.d.ts +254 -0
  67. package/types/bv/Box.d.ts +30 -0
  68. package/types/bv/Sphere.d.ts +38 -0
  69. package/types/bv/index.d.ts +3 -0
  70. package/types/camera/Camera.d.ts +312 -0
  71. package/types/camera/Frustum.d.ts +133 -0
  72. package/types/camera/PlanetCamera.d.ts +219 -0
  73. package/types/camera/index.d.ts +3 -0
  74. package/types/cons.d.ts +40 -0
  75. package/types/control/CompassButton.d.ts +17 -0
  76. package/types/control/Control.d.ts +104 -0
  77. package/types/control/DebugInfo.d.ts +15 -0
  78. package/types/control/EarthCoordinates.d.ts +47 -0
  79. package/types/control/EarthNavigation.d.ts +43 -0
  80. package/types/control/GeoImageDragControl.d.ts +6 -0
  81. package/types/control/KeyboardNavigation.d.ts +21 -0
  82. package/types/control/LayerSwitcher.d.ts +21 -0
  83. package/types/control/Lighting.d.ts +16 -0
  84. package/types/control/MouseNavigation.d.ts +48 -0
  85. package/types/control/MouseWheelZoomControl.d.ts +45 -0
  86. package/types/control/ScaleControl.d.ts +22 -0
  87. package/types/control/ShowFps.d.ts +11 -0
  88. package/types/control/SimpleNavigation.d.ts +25 -0
  89. package/types/control/Sun.d.ts +50 -0
  90. package/types/control/ToggleWireframe.d.ts +12 -0
  91. package/types/control/TouchNavigation.d.ts +48 -0
  92. package/types/control/ZoomControl.d.ts +27 -0
  93. package/types/control/index.d.ts +18 -0
  94. package/types/ellipsoid/Ellipsoid.d.ts +146 -0
  95. package/types/ellipsoid/index.d.ts +3 -0
  96. package/types/ellipsoid/wgs84.d.ts +6 -0
  97. package/types/entity/BaseBillboard.d.ts +215 -0
  98. package/types/entity/Billboard.d.ts +94 -0
  99. package/types/entity/BillboardHandler.d.ts +79 -0
  100. package/types/entity/Entity.d.ts +348 -0
  101. package/types/entity/EntityCollection.d.ts +317 -0
  102. package/types/entity/GeoObject.d.ts +111 -0
  103. package/types/entity/GeoObjectHandler.d.ts +81 -0
  104. package/types/entity/Geometry.d.ts +74 -0
  105. package/types/entity/GeometryHandler.d.ts +76 -0
  106. package/types/entity/Label.d.ts +189 -0
  107. package/types/entity/LabelHandler.d.ts +31 -0
  108. package/types/entity/LabelWorker.d.ts +11 -0
  109. package/types/entity/PointCloud.d.ts +174 -0
  110. package/types/entity/PointCloudHandler.d.ts +38 -0
  111. package/types/entity/Polyline.d.ts +306 -0
  112. package/types/entity/PolylineHandler.d.ts +18 -0
  113. package/types/entity/Ray.d.ts +124 -0
  114. package/types/entity/RayHandler.d.ts +67 -0
  115. package/types/entity/ShapeHandler.d.ts +22 -0
  116. package/types/entity/Strip.d.ts +119 -0
  117. package/types/entity/StripHandler.d.ts +38 -0
  118. package/types/entity/index.d.ts +8 -0
  119. package/types/index.core.d.ts +65 -0
  120. package/types/index.d.ts +45 -0
  121. package/types/index.webgl.d.ts +7 -0
  122. package/types/input/KeyboardHandler.d.ts +10 -0
  123. package/types/input/MouseHandler.d.ts +5 -0
  124. package/types/input/TouchHandler.d.ts +5 -0
  125. package/types/input/input.d.ts +34 -0
  126. package/types/layer/BaseGeoImage.d.ts +94 -0
  127. package/types/layer/CanvasTiles.d.ts +67 -0
  128. package/types/layer/GeoImage.d.ts +52 -0
  129. package/types/layer/GeoTexture2d.d.ts +8 -0
  130. package/types/layer/GeoVideo.d.ts +55 -0
  131. package/types/layer/KML.d.ts +68 -0
  132. package/types/layer/Layer.d.ts +310 -0
  133. package/types/layer/Material.d.ts +45 -0
  134. package/types/layer/Vector.d.ts +208 -0
  135. package/types/layer/WMS.d.ts +61 -0
  136. package/types/layer/XYZ.d.ts +119 -0
  137. package/types/layer/index.d.ts +10 -0
  138. package/types/light/LightSource.d.ts +178 -0
  139. package/types/math/Line2.d.ts +11 -0
  140. package/types/math/Line3.d.ts +10 -0
  141. package/types/math/Mat3.d.ts +65 -0
  142. package/types/math/Mat4.d.ts +176 -0
  143. package/types/math/Plane.d.ts +18 -0
  144. package/types/math/Quat.d.ts +379 -0
  145. package/types/math/Ray.d.ts +82 -0
  146. package/types/math/Vec2.d.ts +309 -0
  147. package/types/math/Vec3.d.ts +467 -0
  148. package/types/math/Vec4.d.ts +162 -0
  149. package/types/math/coder.d.ts +43 -0
  150. package/types/math/index.d.ts +11 -0
  151. package/types/math.d.ts +261 -0
  152. package/types/mercator.d.ts +92 -0
  153. package/types/proj/EPSG3857.d.ts +6 -0
  154. package/types/proj/EPSG4326.d.ts +6 -0
  155. package/types/proj/Proj.d.ts +42 -0
  156. package/types/quadTree/EntityCollectionNode.d.ts +34 -0
  157. package/types/quadTree/Node.d.ts +60 -0
  158. package/types/quadTree/quadTree.d.ts +40 -0
  159. package/types/renderer/Renderer.d.ts +290 -0
  160. package/types/renderer/RendererEvents.d.ts +237 -0
  161. package/types/res/images.d.ts +3 -0
  162. package/types/scene/Axes.d.ts +11 -0
  163. package/types/scene/BaseNode.d.ts +60 -0
  164. package/types/scene/Planet.d.ts +576 -0
  165. package/types/scene/RenderNode.d.ts +142 -0
  166. package/types/scene/SkyBox.d.ts +10 -0
  167. package/types/scene/index.d.ts +4 -0
  168. package/types/segment/Segment.d.ts +275 -0
  169. package/types/segment/SegmentLonLat.d.ts +17 -0
  170. package/types/segment/Slice.d.ts +10 -0
  171. package/types/segment/segmentHelper.d.ts +13 -0
  172. package/types/shaders/billboard.d.ts +3 -0
  173. package/types/shaders/depth.d.ts +2 -0
  174. package/types/shaders/drawnode.d.ts +7 -0
  175. package/types/shaders/geoObject.d.ts +3 -0
  176. package/types/shaders/label.d.ts +4 -0
  177. package/types/shaders/pointCloud.d.ts +2 -0
  178. package/types/shaders/polyline.d.ts +3 -0
  179. package/types/shaders/ray.d.ts +2 -0
  180. package/types/shaders/screenFrame.d.ts +2 -0
  181. package/types/shaders/shape.d.ts +4 -0
  182. package/types/shaders/skybox.d.ts +2 -0
  183. package/types/shaders/toneMapping.d.ts +2 -0
  184. package/types/shapes/BaseShape.d.ts +250 -0
  185. package/types/shapes/Sphere.d.ts +41 -0
  186. package/types/terrain/BilTerrain.d.ts +7 -0
  187. package/types/terrain/EmptyTerrain.d.ts +73 -0
  188. package/types/terrain/Geoid.d.ts +26 -0
  189. package/types/terrain/GlobusTerrain.d.ts +116 -0
  190. package/types/terrain/MapboxTerrain.d.ts +7 -0
  191. package/types/terrain/index.d.ts +5 -0
  192. package/types/utils/FontAtlas.d.ts +15 -0
  193. package/types/utils/GeoImageCreator.d.ts +30 -0
  194. package/types/utils/ImagesCacheManager.d.ts +10 -0
  195. package/types/utils/Loader.d.ts +25 -0
  196. package/types/utils/NormalMapCreator.d.ts +39 -0
  197. package/types/utils/PlainSegmentWorker.d.ts +10 -0
  198. package/types/utils/TerrainWorker.d.ts +9 -0
  199. package/types/utils/TextureAtlas.d.ts +111 -0
  200. package/types/utils/VectorTileCreator.d.ts +16 -0
  201. package/types/utils/colorTable.d.ts +143 -0
  202. package/types/utils/earcut.d.ts +6 -0
  203. package/types/utils/shared.d.ts +231 -0
  204. package/types/webgl/Framebuffer.d.ts +135 -0
  205. package/types/webgl/Handler.d.ts +417 -0
  206. package/types/webgl/Multisample.d.ts +89 -0
  207. package/types/webgl/Program.d.ts +161 -0
  208. package/types/webgl/ProgramController.d.ts +89 -0
  209. package/types/webgl/callbacks.d.ts +1 -0
  210. package/types/webgl/index.d.ts +6 -0
  211. package/types/webgl/types.d.ts +2 -0
@@ -0,0 +1,254 @@
1
+ /**
2
+ * Returns julian days from Epoch.
3
+ * @param {number} jd - Julian date.
4
+ * @returns {number} Days from epoch
5
+ */
6
+ export function T(jd: number): number;
7
+ /**
8
+ * Gets the date's julian day.
9
+ * @param {number} year - Year.
10
+ * @param {number} month - Month.
11
+ * @param {number} day - Day.
12
+ * @returns {Number} Day number
13
+ */
14
+ export function getDayNumber(year: number, month: number, day: number): number;
15
+ /**
16
+ * Converts javascript date to the universal(UTC) julian date.
17
+ * @param {Date} date - Date.
18
+ * @returns {number} UTC julian date
19
+ */
20
+ export function DateToUTC(date: Date): number;
21
+ /**
22
+ * Converts javascript date to the atomic(TAI) julian date.
23
+ * @param {Date} date - Date.
24
+ * @returns {number} TAI julian date
25
+ */
26
+ export function DateToTAI(date: Date): number;
27
+ /**
28
+ * Converts coordinated universal(UTC) julian date to atomic(TAI) julian date.
29
+ * @param {number} jd - UTC julian date.
30
+ * @returns {number} TAI julian date
31
+ */
32
+ export function UTCtoTAI(jd: number): number;
33
+ /**
34
+ * Converts atomic julian date(TAI) to the coordinated universal(UTC) julian date.
35
+ * @param {number} tai - TAI julian date.
36
+ * @returns {number} UTC julian date
37
+ */
38
+ export function TAItoUTC(tai: number): number;
39
+ /**
40
+ * Converts UTC julian date to the javascript date object.
41
+ * @param {number} utc - UTC julian date.
42
+ * @returns {Date} JavaScript Date object
43
+ */
44
+ export function UTCtoDate(utc: number): Date;
45
+ /**
46
+ * Converts TAI julian date to the javascript date object.
47
+ * @param {number} tai - TAI julian date.
48
+ * @returns {Date} JavaScript Date object
49
+ */
50
+ export function TAItoDate(tai: number): Date;
51
+ /**
52
+ * Adds milliseconds to the julian date.
53
+ * @param {number} jd - Julian date.
54
+ * @param {number} milliseconds - Milliseconds to add.
55
+ * @returns {number} Julian date
56
+ */
57
+ export function addMilliseconds(jd: number, milliseconds: number): number;
58
+ /**
59
+ * Adds seconds to the julian date.
60
+ * @param {number} jd - Julian date.
61
+ * @param {number} seconds - Seconds to add.
62
+ * @returns {number} Julian date
63
+ */
64
+ export function addSeconds(jd: number, seconds: number): number;
65
+ /**
66
+ * Adds hours to the julian date.
67
+ * @param {number} jd - Julian date.
68
+ * @param {number} hours - Hours to add.
69
+ * @returns {number} Julian date
70
+ */
71
+ export function addHours(jd: number, hours: number): number;
72
+ /**
73
+ * Adds minutes to the julian date.
74
+ * @param {number} jd - Julian date.
75
+ * @param {number} minutes - Minutes to add.
76
+ * @returns {number} Julian date
77
+ */
78
+ export function addMinutes(jd: number, minutes: number): number;
79
+ /**
80
+ * Adds days to the julian date.
81
+ * @param {number} jd - Julian date.
82
+ * @param {number} days - Days to add.
83
+ * @returns {number} Julian date
84
+ */
85
+ export function addDays(jd: number, days: number): number;
86
+ /**
87
+ * Gets milliseconds of a julian date.
88
+ * @param {number} js - julian date.
89
+ * @returns {number} Milliseconds
90
+ */
91
+ export function getMilliseconds(jd: any): number;
92
+ /**
93
+ * Gets seconds of a julian date.
94
+ * @param {number} js - julian date.
95
+ * @returns {number} Seconds
96
+ */
97
+ export function getSeconds(jd: any): number;
98
+ /**
99
+ * Gets hours of a julian date.
100
+ * @param {number} js - julian date.
101
+ * @returns {number} Hours
102
+ */
103
+ export function getHours(jd: any): number;
104
+ /**
105
+ * Gets minutes of a julian date.
106
+ * @param {number} js - julian date.
107
+ * @returns {number} Minutes
108
+ */
109
+ export function getMinutes(jd: any): number;
110
+ /**
111
+ * Gets days of a julian date.
112
+ * @param {number} js - julian date.
113
+ * @returns {number} Days
114
+ */
115
+ export function getDays(jd: any): number;
116
+ /**
117
+ * Returns days in seconds.
118
+ * @param {number} s - Seconds.
119
+ * @returns {number} Days
120
+ */
121
+ export function secondsToDays(s: number): number;
122
+ /**
123
+ * Returns seconds in days.
124
+ * @param {number} d - Days.
125
+ * @returns {number} Seconds
126
+ */
127
+ export function daysToSeconds(d: number): number;
128
+ /**
129
+ * Seconds in millisecond.
130
+ * @const
131
+ * @default
132
+ */
133
+ export const SECONDS_PER_MILLISECOND: 0.001;
134
+ /**
135
+ * Milliseconds in second.
136
+ * @const
137
+ * @default
138
+ */
139
+ export const MILLISECONDS_PER_SECOND: 1000;
140
+ /**
141
+ * Seconds in minute.
142
+ * @const
143
+ * @default
144
+ */
145
+ export const SECONDS_PER_MINUTE: 60;
146
+ /**
147
+ * One by seconds in minute.
148
+ * @const
149
+ * @default
150
+ */
151
+ export const ONE_BY_SECONDS_PER_MINUTE: number;
152
+ /**
153
+ * Minutes in hour.
154
+ * @const
155
+ * @default
156
+ */
157
+ export const MINUTES_PER_HOUR: 60;
158
+ /**
159
+ * Hours in day.
160
+ * @const
161
+ * @default
162
+ */
163
+ export const HOURS_PER_DAY: 24;
164
+ /**
165
+ * One by hours in day.
166
+ * @const
167
+ * @default
168
+ */
169
+ export const ONE_BY_HOURS_PER_DAY: number;
170
+ /**
171
+ * Seconds in hour.
172
+ * @const
173
+ * @default
174
+ */
175
+ export const SECONDS_PER_HOUR: 3600;
176
+ /**
177
+ * One by seconds in hour.
178
+ * @const
179
+ * @default
180
+ */
181
+ export const ONE_BY_SECONDS_PER_HOUR: number;
182
+ /**
183
+ * Seconds in 12 hours.
184
+ * @const
185
+ * @default
186
+ */
187
+ export const SECONDS_PER_12_HOURS: number;
188
+ /**
189
+ * Minutes in day.
190
+ * @const
191
+ * @default
192
+ */
193
+ export const MINUTES_PER_DAY: 1440;
194
+ /**
195
+ * One by minutes in day.
196
+ * @const
197
+ * @default
198
+ */
199
+ export const ONE_BY_MINUTES_PER_DAY: number;
200
+ /**
201
+ * Seconds in day.
202
+ * @const
203
+ * @default
204
+ */
205
+ export const SECONDS_PER_DAY: 86400;
206
+ /**
207
+ * Milliseconds in day.
208
+ * @const
209
+ * @default
210
+ */
211
+ export const MILLISECONDS_PER_DAY: 86400000;
212
+ /**
213
+ * One by milliseconds in day.
214
+ * @const
215
+ * @default
216
+ */
217
+ export const ONE_BY_MILLISECONDS_PER_DAY: number;
218
+ /**
219
+ * One by seconds in day.
220
+ * @const
221
+ * @default
222
+ */
223
+ export const ONE_BY_SECONDS_PER_DAY: number;
224
+ /**
225
+ * Days in julian century.
226
+ * @const
227
+ * @default
228
+ */
229
+ export const DAYS_PER_JULIAN_CENTURY: 36525;
230
+ /**
231
+ * Days in julian year.
232
+ * @const
233
+ * @default
234
+ */
235
+ export const DAYS_PER_JULIAN_YEAR: 365.25;
236
+ /**
237
+ * Seconds in picosecond.
238
+ * @const
239
+ * @default
240
+ */
241
+ export const PICOSECOND: 1e-9;
242
+ /**
243
+ * Modified julian date difference.
244
+ * @const
245
+ * @default
246
+ */
247
+ export const MODIFIED_JULIAN_DATE_DIFFERENCE: 2400000.5;
248
+ /**
249
+ * Julian date of 2000 year. Epoch.
250
+ * @const
251
+ * @default
252
+ */
253
+ export const J2000: 2451545;
254
+ export const J2000TAI: number;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Bounding box class.
3
+ * @class
4
+ */
5
+ export class Box {
6
+ /**
7
+ *
8
+ * @param {*} boundsArr
9
+ */
10
+ constructor(boundsArr: any);
11
+ /**
12
+ * Vertices array.
13
+ * @public
14
+ * @type{Array.<Vec3>}
15
+ */
16
+ public vertices: Array<Vec3>;
17
+ copy(bbox: any): void;
18
+ /**
19
+ * Sets bounding box coordinates by the bounds array.
20
+ * @param {Array.<number>} bounds - Bounds is an array where [minX, minY, minZ, maxX, maxY, maxZ]
21
+ */
22
+ setFromBoundsArr(bounds: Array<number>): void;
23
+ /**
24
+ * Sets bounding box coordiantes by ellipsoid geodetic extend.
25
+ * @param {Ellipsoid} ellipsoid - Ellipsoid.
26
+ * @param {Extent} extent - Geodetic extent.
27
+ */
28
+ setFromExtent(ellipsoid: Ellipsoid, extent: Extent): void;
29
+ }
30
+ import { Vec3 } from "../math/Vec3.js";
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Bounding sphere class.
3
+ * @class
4
+ * @param {Number} [radius] - Bounding sphere radius.
5
+ * @param {Vec3} [center] - Bounding sphere coordiantes.
6
+ */
7
+ export class Sphere {
8
+ /**
9
+ *
10
+ * @param {number} radius
11
+ * @param {Vec3} center
12
+ */
13
+ constructor(radius: number, center: Vec3);
14
+ /**
15
+ * Sphere radius.
16
+ * @public
17
+ * @type {Number}
18
+ */
19
+ public radius: number;
20
+ /**
21
+ * Sphere coordiantes.
22
+ * @public
23
+ * @type {Vec3}
24
+ */
25
+ public center: Vec3;
26
+ /**
27
+ * Sets bounding sphere coordinates by the bounds array.
28
+ * @param {Array.<number>} bounds - Bounds is an array where [minX, minY, minZ, maxX, maxY, maxZ]
29
+ */
30
+ setFromBounds(bounds: Array<number>): void;
31
+ /**
32
+ * Sets bounding sphere coordiantes by ellipsoid geodetic extend.
33
+ * @param {Ellipsoid} ellipsoid - Ellipsoid.
34
+ * @param {Extent} extent - Geodetic extent.
35
+ */
36
+ setFromExtent(ellipsoid: Ellipsoid, extent: Extent): void;
37
+ }
38
+ import { Vec3 } from "../math/Vec3.js";
@@ -0,0 +1,3 @@
1
+ import { Box } from "./Box";
2
+ import { Sphere } from "./Sphere";
3
+ export { Box, Sphere };
@@ -0,0 +1,312 @@
1
+ /**
2
+ * Camera class.
3
+ * @class
4
+ * @param {Renderer} [renderer] - Renderer uses the camera instance.
5
+ * @param {Object} [options] - Camera options:
6
+ * @param {Object} [options.name] - Camera name.
7
+ * @param {number} [options.viewAngle=38] - Camera angle of view. Default is 30.0
8
+ * @param {number} [options.near=1] - Camera near plane distance. Default is 1.0
9
+ * @param {number} [options.far=og.math.MAX] - Camera far plane distance. Deafult is og.math.MAX
10
+ * @param {Vec3} [options.eye=[0,0,0]] - Camera eye position. Default (0,0,0)
11
+ * @param {Vec3} [options.look=[0,0,0]] - Camera look position. Default (0,0,0)
12
+ * @param {Vec3} [options.up=[0,1,0]] - Camera eye position. Default (0,1,0)
13
+ *
14
+ * @fires og.Camera#viewchange
15
+ */
16
+ export class Camera {
17
+ /**
18
+ * @param {Renderer} [renderer] - Renderer uses the camera instance.
19
+ * @param {Object} [options] - Camera options:
20
+ */
21
+ constructor(renderer?: Renderer, options?: any);
22
+ /**
23
+ * Assigned renderer
24
+ * @public
25
+ * @type {Renderer}
26
+ */
27
+ public renderer: Renderer;
28
+ /**
29
+ * Camera events handler
30
+ * @public
31
+ * @type {Events}
32
+ */
33
+ public events: Events;
34
+ /**
35
+ * Camera position.
36
+ * @public
37
+ * @type {Vec3}
38
+ */
39
+ public eye: Vec3;
40
+ /**
41
+ * Camera RTE high position
42
+ * @public
43
+ * @type {Vec3}
44
+ */
45
+ public eyeHigh: Vec3;
46
+ /**
47
+ * Camera RTE low position
48
+ * @public
49
+ * @type {Vec3}
50
+ */
51
+ public eyeLow: Vec3;
52
+ /**
53
+ * Aspect ratio.
54
+ * @protected
55
+ * @type {Number}
56
+ */
57
+ protected _aspect: number;
58
+ /**
59
+ * Camera view angle in degrees
60
+ * @protected
61
+ * @type {Number}
62
+ */
63
+ protected _viewAngle: number;
64
+ /**
65
+ * Camera normal matrix.
66
+ * @protected
67
+ * @type {Mat3}
68
+ */
69
+ protected _normalMatrix: Mat3;
70
+ /**
71
+ * Camera view matrix.
72
+ * @protected
73
+ * @type {Mat4}
74
+ */
75
+ protected _viewMatrix: Mat4;
76
+ /**
77
+ * Camera right vector.
78
+ * @protected
79
+ * @type {Vec3}
80
+ */
81
+ protected _r: Vec3;
82
+ /**
83
+ * Camera up vector.
84
+ * @protected
85
+ * @type {Vec3}
86
+ */
87
+ protected _u: Vec3;
88
+ /**
89
+ * Camera forward vector.
90
+ * @protected
91
+ * @type {Vec3}
92
+ */
93
+ protected _b: Vec3;
94
+ _pu: Vec3;
95
+ _pv: Vec3;
96
+ _pn: Vec3;
97
+ _peye: Vec3;
98
+ isMoved: boolean;
99
+ _tanViewAngle_hrad: number;
100
+ _tanViewAngle_hradOneByHeight: number;
101
+ frustums: Frustum[];
102
+ nearFarArr: any[];
103
+ frustumColors: any[];
104
+ FARTHEST_FRUSTUM_INDEX: number;
105
+ _currentFrustum: number;
106
+ checkMoveEnd(): void;
107
+ /**
108
+ * Camera initialization.
109
+ * @public
110
+ * @param {Renderer} renderer - OpenGlobus renderer object.
111
+ * @param {Object} [options] - Camera options:
112
+ * @param {number} [options.viewAngle] - Camera angle of view. Default is 30.0
113
+ * @param {number} [options.near] - Camera near plane distance. Default is 1.0
114
+ * @param {number} [options.far] - Camera far plane distance. Deafult is og.math.MAX
115
+ * @param {Vec3} [options.eye] - Camera eye position. Default (0,0,0)
116
+ * @param {Vec3} [options.look] - Camera look position. Default (0,0,0)
117
+ * @param {Vec3} [options.up] - Camera eye position. Default (0,1,0)
118
+ */
119
+ public _init(options?: {
120
+ viewAngle?: number;
121
+ near?: number;
122
+ far?: number;
123
+ eye?: Vec3;
124
+ look?: Vec3;
125
+ up?: Vec3;
126
+ }): void;
127
+ getUp(): Vec3;
128
+ getDown(): Vec3;
129
+ getRight(): Vec3;
130
+ getLeft(): Vec3;
131
+ getForward(): Vec3;
132
+ getBackward(): Vec3;
133
+ /**
134
+ * Updates camera view space
135
+ * @public
136
+ * @virtual
137
+ */
138
+ public update(): void;
139
+ /**
140
+ * Refresh camera matrices
141
+ * @public
142
+ */
143
+ public refresh(): void;
144
+ /**
145
+ * Sets aspect ratio
146
+ * @public
147
+ * @param {Number} aspect - Camera aspect ratio
148
+ */
149
+ public setAspectRatio(aspect: number): void;
150
+ /**
151
+ * Returns aspect ratio
152
+ * @public
153
+ * @returns {number} - Aspect ratio
154
+ */
155
+ public getAspectRatio(): number;
156
+ /**
157
+ * Sets up camera projection
158
+ * @public
159
+ * @param {nnumber} angle - Camera's view angle
160
+ * @param {number} aspect - Screen aspect ration
161
+ */
162
+ public _setProj(angle: nnumber, aspect: number): void;
163
+ _projSizeConst: number;
164
+ /**
165
+ * Sets camera view angle in degrees
166
+ * @public
167
+ * @param {number} angle - View angle
168
+ */
169
+ public setViewAngle(angle: number): void;
170
+ /**
171
+ * Gets camera view angle in degrees
172
+ * @public
173
+ * @returns {number} angle -
174
+ */
175
+ public getViewAngle(): number;
176
+ /**
177
+ * Sets camera to eye position
178
+ * @public
179
+ * @param {Vec3} eye - Camera position
180
+ * @param {Vec3} look - Look point
181
+ * @param {Vec3} up - Camera up vector
182
+ * @returns {Camera} - This camera
183
+ */
184
+ public set(eye: Vec3, look: Vec3, up: Vec3): Camera;
185
+ /**
186
+ * Sets camera look point
187
+ * @public
188
+ * @param {Vec3} look - Look point
189
+ * @param {Vec3} [up] - Camera up vector otherwise camera current up vector(this._u)
190
+ */
191
+ public look(look: Vec3, up?: Vec3): void;
192
+ /**
193
+ * Slides camera to vector d - (du, dv, dn)
194
+ * @public
195
+ * @param {number} du - delta X
196
+ * @param {number} dv - delta Y
197
+ * @param {number} dn - delta Z
198
+ */
199
+ public slide(du: number, dv: number, dn: number): void;
200
+ /**
201
+ * Roll the camera to the angle in degrees
202
+ * @public
203
+ * @param {number} angle - Delta roll angle in degrees
204
+ */
205
+ public roll(angle: number): void;
206
+ /**
207
+ * Pitch the camera to the angle in degrees
208
+ * @public
209
+ * @param {number} angle - Delta pitch angle in degrees
210
+ */
211
+ public pitch(angle: number): void;
212
+ /**
213
+ * Yaw the camera to the angle in degrees
214
+ * @public
215
+ * @param {number} angle - Delta yaw angle in degrees
216
+ */
217
+ public yaw(angle: number): void;
218
+ /**
219
+ * Returns normal vector direction to to the unprojected screen point from camera eye
220
+ * @public
221
+ * @param {number} x - Scren X coordinate
222
+ * @param {number} y - Scren Y coordinate
223
+ * @returns {Vec3} - Direction vector
224
+ */
225
+ public unproject(x: number, y: number): Vec3;
226
+ /**
227
+ * Gets projected 3d point to the 2d screen coordiantes
228
+ * @public
229
+ * @param {Vec3} v - Cartesian 3d coordiantes
230
+ * @returns {Vec2} - Screen point coordinates
231
+ */
232
+ public project(v: Vec3): Vec2;
233
+ /**
234
+ * Rotates camera around center point
235
+ * @public
236
+ * @param {number} angle - Rotation angle in radians
237
+ * @param {boolean} isArc - If true camera up vector gets from current up vector every frame,
238
+ * otherwise up is always input parameter.
239
+ * @param {Vec3} center - Point that the camera rotates around
240
+ * @param {Vecto3} [up] - Camera up vector
241
+ */
242
+ public rotateAround(angle: number, isArc: boolean, center: Vec3, up?: Vecto3): void;
243
+ /**
244
+ * Rotates camera around center point by horizontal.
245
+ * @public
246
+ * @param {number} angle - Rotation angle in radians.
247
+ * @param {boolaen} isArc - If true camera up vector gets from current up vector every frame,
248
+ * otherwise up is always input parameter.
249
+ * @param {Vec3} center - Point that the camera rotates around.
250
+ * @param {Vec3} [up] - Camera up vector.
251
+ */
252
+ public rotateHorizontal(angle: number, isArc: boolaen, center: Vec3, up?: Vec3): void;
253
+ /**
254
+ * Rotates camera around center point by vecrtical.
255
+ * @param {number} angle - Rotation angle in radians.
256
+ * @param {Vec3} center - Point that the camera rotates around.
257
+ */
258
+ rotateVertical(angle: number, center: Vec3): void;
259
+ /**
260
+ * Gets 3d size factor. Uses in LOD distance calculation.
261
+ * @public
262
+ * @param {Vec3} p - Far point.
263
+ * @param {Vec3} r - Far point.
264
+ * @returns {number} - Size factor.
265
+ */
266
+ public projectedSize(p: Vec3, r: Vec3): number;
267
+ /**
268
+ * Returns normal matrix.
269
+ * @public
270
+ * @returns {Mat3} - Normal matrix.
271
+ */
272
+ public getNormalMatrix(): Mat3;
273
+ /**
274
+ * Returns model matrix.
275
+ * @public
276
+ * @returns {Mat4} - View matrix.
277
+ */
278
+ public getViewMatrix(): Mat4;
279
+ setCurrentFrustum(k: any): void;
280
+ getCurrentFrustum(): number;
281
+ get frustum(): Frustum;
282
+ /**
283
+ * Returns projection matrix.
284
+ * @public
285
+ * @returns {Mat4} - Projection matrix.
286
+ */
287
+ public getProjectionMatrix(): Mat4;
288
+ /**
289
+ * Returns projection and model matrix product.
290
+ * @public
291
+ * @return {Mat4} - Projection-view matrix.
292
+ */
293
+ public getProjectionViewMatrix(): Mat4;
294
+ /**
295
+ * Returns inverse projection and model matrix product.
296
+ * @public
297
+ * @returns {Mat4} - Inversed projection-view matrix.
298
+ */
299
+ public getInverseProjectionViewMatrix(): Mat4;
300
+ /**
301
+ * Returns inverse projection matrix.
302
+ * @public
303
+ * @returns {Mat4} - Inversed projection-view matrix.
304
+ */
305
+ public getInverseProjectionMatrix(): Mat4;
306
+ }
307
+ import { Events } from "../Events.js";
308
+ import { Vec3 } from "../math/Vec3.js";
309
+ import { Mat3 } from "../math/Mat3.js";
310
+ import { Mat4 } from "../math/Mat4.js";
311
+ import { Frustum } from "./Frustum.js";
312
+ import { Vec2 } from "../math/Vec2.js";