@openglobus/og 0.11.2 → 0.11.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (273) hide show
  1. package/package.json +13 -13
  2. package/src/og/Clock.js +10 -10
  3. package/src/og/Events.js +8 -6
  4. package/src/og/Extent.js +82 -41
  5. package/src/og/Globe.js +25 -13
  6. package/src/og/ImageCanvas.js +22 -16
  7. package/src/og/LonLat.js +16 -13
  8. package/src/og/Popup.js +21 -14
  9. package/src/og/QueueArray.js +6 -2
  10. package/src/og/Rectangle.js +11 -6
  11. package/src/og/Stack.js +5 -2
  12. package/src/og/ajax.js +21 -33
  13. package/src/og/astro/astro.js +5 -5
  14. package/src/og/astro/earth.js +22 -16
  15. package/src/og/astro/jd.js +23 -18
  16. package/src/og/astro/orbit.js +13 -11
  17. package/src/og/astro/rotation.js +17 -8
  18. package/src/og/bv/Box.js +7 -3
  19. package/src/og/bv/Sphere.js +14 -11
  20. package/src/og/camera/Camera.js +51 -54
  21. package/src/og/camera/Frustum.js +29 -18
  22. package/src/og/camera/PlanetCamera.js +32 -23
  23. package/src/og/control/CompassButton.js +5 -1
  24. package/src/og/control/Control.js +12 -10
  25. package/src/og/control/DebugInfo.js +4 -1
  26. package/src/og/control/EarthCoordinates.js +54 -33
  27. package/src/og/control/KeyboardNavigation.js +10 -10
  28. package/src/og/control/LayerSwitcher.js +22 -21
  29. package/src/og/control/Lighting.js +34 -3
  30. package/src/og/control/MouseNavigation.js +1 -1
  31. package/src/og/control/ScaleControl.js +1 -1
  32. package/src/og/control/SegmentBoundVisualization.js +6 -7
  33. package/src/og/control/ShowFps.js +13 -8
  34. package/src/og/control/SimpleNavigation.js +6 -8
  35. package/src/og/control/Sun.js +25 -15
  36. package/src/og/control/ToggleWireframe.js +4 -4
  37. package/src/og/control/TouchNavigation.js +44 -33
  38. package/src/og/control/ZoomControl.js +41 -25
  39. package/src/og/ellipsoid/Ellipsoid.js +162 -66
  40. package/src/og/ellipsoid/wgs84.js +4 -4
  41. package/src/og/entity/BaseBillboard.js +100 -56
  42. package/src/og/entity/Billboard.js +14 -10
  43. package/src/og/entity/BillboardHandler.js +317 -60
  44. package/src/og/entity/Entity.js +100 -68
  45. package/src/og/entity/EntityCollection.js +70 -47
  46. package/src/og/entity/GeoObject.js +228 -0
  47. package/src/og/entity/GeoObjectHandler.js +910 -0
  48. package/src/og/entity/Geometry.js +27 -24
  49. package/src/og/entity/GeometryHandler.js +596 -124
  50. package/src/og/entity/Label.js +80 -49
  51. package/src/og/entity/LabelHandler.js +45 -244
  52. package/src/og/entity/LabelWorker.js +218 -0
  53. package/src/og/entity/Object3d.js +504 -0
  54. package/src/og/entity/PointCloud.js +80 -32
  55. package/src/og/entity/PointCloudHandler.js +8 -8
  56. package/src/og/entity/Polyline.js +16 -16
  57. package/src/og/entity/Ray.js +60 -27
  58. package/src/og/entity/Strip.js +77 -48
  59. package/src/og/entity/StripHandler.js +26 -26
  60. package/src/og/entity/index.js +8 -16
  61. package/src/og/layer/BaseGeoImage.js +54 -23
  62. package/src/og/layer/CanvasTiles.js +24 -24
  63. package/src/og/layer/GeoImage.js +9 -9
  64. package/src/og/layer/GeoVideo.js +3 -3
  65. package/src/og/layer/KML.js +63 -37
  66. package/src/og/layer/Layer.js +44 -21
  67. package/src/og/layer/Material.js +23 -20
  68. package/src/og/layer/Vector.js +114 -68
  69. package/src/og/layer/WMS.js +34 -17
  70. package/src/og/layer/XYZ.js +48 -46
  71. package/src/og/light/LightSource.js +46 -39
  72. package/src/og/math/Mat3.js +34 -22
  73. package/src/og/math/Mat4.js +603 -459
  74. package/src/og/math/Plane.js +21 -20
  75. package/src/og/math/Quat.js +182 -139
  76. package/src/og/math/Ray.js +38 -33
  77. package/src/og/math/Vec2.js +85 -75
  78. package/src/og/math/Vec3.js +142 -112
  79. package/src/og/math/Vec4.js +27 -31
  80. package/src/og/math/coder.js +10 -10
  81. package/src/og/math.js +12 -12
  82. package/src/og/proj/EPSG3857.js +4 -4
  83. package/src/og/proj/EPSG4326.js +4 -4
  84. package/src/og/proj/Proj.js +4 -6
  85. package/src/og/quadTree/Node.js +8 -8
  86. package/src/og/renderer/Renderer.js +59 -52
  87. package/src/og/renderer/RendererEvents.js +50 -27
  88. package/src/og/scene/BaseNode.js +7 -8
  89. package/src/og/scene/Planet.js +102 -103
  90. package/src/og/scene/RenderNode.js +28 -21
  91. package/src/og/segment/Segment.js +26 -21
  92. package/src/og/segment/SegmentLonLat.js +5 -5
  93. package/src/og/shaders/drawnode.js +135 -142
  94. package/src/og/shaders/geoObject.js +211 -0
  95. package/src/og/shaders/pointCloud.js +41 -41
  96. package/src/og/shaders/shape.js +12 -18
  97. package/src/og/shaders/skybox.js +36 -36
  98. package/src/og/shaders/toneMapping.js +1 -0
  99. package/src/og/shapes/BaseShape.js +126 -54
  100. package/src/og/shapes/Icosphere.js +29 -14
  101. package/src/og/shapes/Sphere.js +12 -15
  102. package/src/og/terrain/BilTerrain.js +1 -0
  103. package/src/og/terrain/EmptyTerrain.js +2 -2
  104. package/src/og/terrain/GlobusTerrain.js +9 -9
  105. package/src/og/utils/FontAtlas.js +6 -2
  106. package/src/og/utils/TextureAtlas.js +22 -24
  107. package/src/og/utils/VectorTileCreator.js +1 -3
  108. package/src/og/utils/shared.js +16 -16
  109. package/src/og/webgl/Framebuffer.js +88 -40
  110. package/src/og/webgl/Handler.js +243 -169
  111. package/src/og/webgl/Multisample.js +47 -19
  112. package/src/og/webgl/Program.js +79 -34
  113. package/src/og/webgl/ProgramController.js +17 -13
  114. package/src/og/webgl/callbacks.js +8 -8
  115. package/src/og/inherits.js +0 -8
  116. package/src/og/utils/polylabel.js +0 -176
  117. package/types/Clock.d.ts +0 -90
  118. package/types/Deferred.d.ts +0 -6
  119. package/types/Events.d.ts +0 -73
  120. package/types/Extent.d.ts +0 -166
  121. package/types/Globe.d.ts +0 -75
  122. package/types/ImageCanvas.d.ts +0 -121
  123. package/types/Lock.d.ts +0 -12
  124. package/types/LonLat.d.ts +0 -108
  125. package/types/Popup.d.ts +0 -38
  126. package/types/QueueArray.d.ts +0 -15
  127. package/types/Rectangle.d.ts +0 -74
  128. package/types/Stack.d.ts +0 -15
  129. package/types/ajax.d.ts +0 -24
  130. package/types/arial.d.ts +0 -48
  131. package/types/astro/astro.d.ts +0 -38
  132. package/types/astro/earth.d.ts +0 -6
  133. package/types/astro/jd.d.ts +0 -254
  134. package/types/bv/Box.d.ts +0 -25
  135. package/types/bv/Sphere.d.ts +0 -38
  136. package/types/bv/index.d.ts +0 -3
  137. package/types/camera/Camera.d.ts +0 -303
  138. package/types/camera/Frustum.d.ts +0 -129
  139. package/types/camera/PlanetCamera.d.ts +0 -223
  140. package/types/camera/index.d.ts +0 -3
  141. package/types/cons.d.ts +0 -40
  142. package/types/control/CompassButton.d.ts +0 -18
  143. package/types/control/Control.d.ts +0 -101
  144. package/types/control/DebugInfo.d.ts +0 -16
  145. package/types/control/EarthCoordinates.d.ts +0 -47
  146. package/types/control/EarthNavigation.d.ts +0 -42
  147. package/types/control/GeoImageDragControl.d.ts +0 -6
  148. package/types/control/KeyboardNavigation.d.ts +0 -22
  149. package/types/control/LayerSwitcher.d.ts +0 -23
  150. package/types/control/Lighting.d.ts +0 -16
  151. package/types/control/MouseNavigation.d.ts +0 -51
  152. package/types/control/ScaleControl.d.ts +0 -22
  153. package/types/control/ShowFps.d.ts +0 -12
  154. package/types/control/SimpleNavigation.d.ts +0 -28
  155. package/types/control/Sun.d.ts +0 -52
  156. package/types/control/ToggleWireframe.d.ts +0 -12
  157. package/types/control/TouchNavigation.d.ts +0 -50
  158. package/types/control/ZoomControl.d.ts +0 -28
  159. package/types/control/index.d.ts +0 -17
  160. package/types/ellipsoid/Ellipsoid.d.ts +0 -142
  161. package/types/ellipsoid/index.d.ts +0 -3
  162. package/types/ellipsoid/wgs84.d.ts +0 -5
  163. package/types/entity/BaseBillboard.d.ts +0 -208
  164. package/types/entity/Billboard.d.ts +0 -94
  165. package/types/entity/BillboardHandler.d.ts +0 -74
  166. package/types/entity/Entity.d.ts +0 -331
  167. package/types/entity/EntityCollection.d.ts +0 -303
  168. package/types/entity/Geometry.d.ts +0 -73
  169. package/types/entity/GeometryHandler.d.ts +0 -76
  170. package/types/entity/Label.d.ts +0 -194
  171. package/types/entity/LabelHandler.d.ts +0 -24
  172. package/types/entity/PointCloud.d.ts +0 -174
  173. package/types/entity/PointCloudHandler.d.ts +0 -38
  174. package/types/entity/Polyline.d.ts +0 -304
  175. package/types/entity/PolylineHandler.d.ts +0 -18
  176. package/types/entity/Ray.d.ts +0 -123
  177. package/types/entity/RayHandler.d.ts +0 -67
  178. package/types/entity/ShapeHandler.d.ts +0 -22
  179. package/types/entity/Strip.d.ts +0 -118
  180. package/types/entity/StripHandler.d.ts +0 -38
  181. package/types/entity/index.d.ts +0 -8
  182. package/types/index.core.d.ts +0 -65
  183. package/types/index.d.ts +0 -45
  184. package/types/index.webgl.d.ts +0 -7
  185. package/types/inherits.d.ts +0 -4
  186. package/types/input/KeyboardHandler.d.ts +0 -10
  187. package/types/input/MouseHandler.d.ts +0 -5
  188. package/types/input/TouchHandler.d.ts +0 -5
  189. package/types/input/input.d.ts +0 -34
  190. package/types/layer/BaseGeoImage.d.ts +0 -107
  191. package/types/layer/CanvasTiles.d.ts +0 -75
  192. package/types/layer/GeoImage.d.ts +0 -65
  193. package/types/layer/GeoTexture2d.d.ts +0 -8
  194. package/types/layer/GeoVideo.d.ts +0 -80
  195. package/types/layer/KML.d.ts +0 -58
  196. package/types/layer/Layer.d.ts +0 -321
  197. package/types/layer/Material.d.ts +0 -48
  198. package/types/layer/Vector.d.ts +0 -228
  199. package/types/layer/WMS.d.ts +0 -66
  200. package/types/layer/XYZ.d.ts +0 -130
  201. package/types/layer/index.d.ts +0 -10
  202. package/types/light/LightSource.d.ts +0 -177
  203. package/types/math/Line2.d.ts +0 -11
  204. package/types/math/Line3.d.ts +0 -10
  205. package/types/math/Mat3.d.ts +0 -63
  206. package/types/math/Mat4.d.ts +0 -173
  207. package/types/math/Plane.d.ts +0 -17
  208. package/types/math/Quat.d.ts +0 -376
  209. package/types/math/Ray.d.ts +0 -81
  210. package/types/math/Vec2.d.ts +0 -308
  211. package/types/math/Vec3.d.ts +0 -459
  212. package/types/math/Vec4.d.ts +0 -161
  213. package/types/math/coder.d.ts +0 -42
  214. package/types/math/index.d.ts +0 -11
  215. package/types/math.d.ts +0 -261
  216. package/types/mercator.d.ts +0 -92
  217. package/types/proj/EPSG3857.d.ts +0 -5
  218. package/types/proj/EPSG4326.d.ts +0 -5
  219. package/types/proj/Proj.d.ts +0 -42
  220. package/types/quadTree/EntityCollectionNode.d.ts +0 -34
  221. package/types/quadTree/Node.d.ts +0 -61
  222. package/types/quadTree/quadTree.d.ts +0 -40
  223. package/types/renderer/Renderer.d.ts +0 -296
  224. package/types/renderer/RendererEvents.d.ts +0 -230
  225. package/types/res/images.d.ts +0 -3
  226. package/types/scene/Axes.d.ts +0 -11
  227. package/types/scene/BaseNode.d.ts +0 -60
  228. package/types/scene/Planet.d.ts +0 -574
  229. package/types/scene/RenderNode.d.ts +0 -143
  230. package/types/scene/SkyBox.d.ts +0 -10
  231. package/types/scene/index.d.ts +0 -4
  232. package/types/segment/Segment.d.ts +0 -271
  233. package/types/segment/SegmentLonLat.d.ts +0 -62
  234. package/types/segment/segmentHelper.d.ts +0 -13
  235. package/types/shaders/billboard.d.ts +0 -3
  236. package/types/shaders/depth.d.ts +0 -2
  237. package/types/shaders/drawnode.d.ts +0 -7
  238. package/types/shaders/label.d.ts +0 -4
  239. package/types/shaders/pointCloud.d.ts +0 -2
  240. package/types/shaders/polyline.d.ts +0 -3
  241. package/types/shaders/ray.d.ts +0 -2
  242. package/types/shaders/screenFrame.d.ts +0 -2
  243. package/types/shaders/shape.d.ts +0 -4
  244. package/types/shaders/skybox.d.ts +0 -2
  245. package/types/shaders/toneMapping.d.ts +0 -2
  246. package/types/shapes/BaseShape.d.ts +0 -247
  247. package/types/shapes/Sphere.d.ts +0 -41
  248. package/types/terrain/BilTerrain.d.ts +0 -8
  249. package/types/terrain/EmptyTerrain.d.ts +0 -72
  250. package/types/terrain/Geoid.d.ts +0 -26
  251. package/types/terrain/GlobusTerrain.d.ts +0 -153
  252. package/types/terrain/MapboxTerrain.d.ts +0 -8
  253. package/types/terrain/index.d.ts +0 -5
  254. package/types/utils/FontAtlas.d.ts +0 -14
  255. package/types/utils/GeoImageCreator.d.ts +0 -30
  256. package/types/utils/ImagesCacheManager.d.ts +0 -10
  257. package/types/utils/Loader.d.ts +0 -25
  258. package/types/utils/NormalMapCreator.d.ts +0 -39
  259. package/types/utils/PlainSegmentWorker.d.ts +0 -10
  260. package/types/utils/TerrainWorker.d.ts +0 -9
  261. package/types/utils/TextureAtlas.d.ts +0 -111
  262. package/types/utils/VectorTileCreator.d.ts +0 -16
  263. package/types/utils/colorTable.d.ts +0 -143
  264. package/types/utils/earcut.d.ts +0 -6
  265. package/types/utils/shared.d.ts +0 -230
  266. package/types/webgl/Framebuffer.d.ts +0 -135
  267. package/types/webgl/Handler.d.ts +0 -372
  268. package/types/webgl/Multisample.d.ts +0 -89
  269. package/types/webgl/Program.d.ts +0 -155
  270. package/types/webgl/ProgramController.d.ts +0 -84
  271. package/types/webgl/callbacks.d.ts +0 -1
  272. package/types/webgl/index.d.ts +0 -6
  273. package/types/webgl/types.d.ts +0 -2
@@ -2,10 +2,10 @@
2
2
  * @module og/math/Vec3
3
3
  */
4
4
 
5
- 'use strict';
5
+ "use strict";
6
6
 
7
- import { Vec4 } from './Vec4.js';
8
- import { Quat } from './Quat.js';
7
+ import { Vec4 } from "./Vec4.js";
8
+ import { Quat } from "./Quat.js";
9
9
 
10
10
  /**
11
11
  * Class represents a 3d vector.
@@ -15,9 +15,7 @@ import { Quat } from './Quat.js';
15
15
  * @param {number} [z] - Third value.
16
16
  */
17
17
  export class Vec3 {
18
-
19
18
  constructor(x, y, z) {
20
-
21
19
  /**
22
20
  * @public
23
21
  * @type {number}
@@ -38,25 +36,45 @@ export class Vec3 {
38
36
  }
39
37
 
40
38
  /** @const */
41
- static get UP() { return new Vec3(0, 1, 0) }
39
+ static get UP() {
40
+ return new Vec3(0, 1, 0);
41
+ }
42
42
  /** @const */
43
- static get DOWN() { return new Vec3(0, -1, 0) }
43
+ static get DOWN() {
44
+ return new Vec3(0, -1, 0);
45
+ }
44
46
  /** @const */
45
- static get RIGHT() { return new Vec3(1, 0, 0) }
47
+ static get RIGHT() {
48
+ return new Vec3(1, 0, 0);
49
+ }
46
50
  /** @const */
47
- static get LEFT() { return new Vec3(-1, 0, 0) }
51
+ static get LEFT() {
52
+ return new Vec3(-1, 0, 0);
53
+ }
48
54
  /** @const */
49
- static get FORWARD() { return new Vec3(0, 0, -1) }
55
+ static get FORWARD() {
56
+ return new Vec3(0, 0, -1);
57
+ }
50
58
  /** @const */
51
- static get BACKWARD() { return new Vec3(0, 0, 1) }
59
+ static get BACKWARD() {
60
+ return new Vec3(0, 0, 1);
61
+ }
52
62
  /** @const */
53
- static get ZERO() { return new Vec3() }
63
+ static get ZERO() {
64
+ return new Vec3();
65
+ }
54
66
  /** @const */
55
- static get UNIT_X() { return new Vec3(1, 0, 0) }
67
+ static get UNIT_X() {
68
+ return new Vec3(1, 0, 0);
69
+ }
56
70
  /** @const */
57
- static get UNIT_Y() { return new Vec3(0, 1, 0) }
71
+ static get UNIT_Y() {
72
+ return new Vec3(0, 1, 0);
73
+ }
58
74
  /** @const */
59
- static get UNIT_Z() { return new Vec3(0, 0, 1) }
75
+ static get UNIT_Z() {
76
+ return new Vec3(0, 0, 1);
77
+ }
60
78
 
61
79
  /**
62
80
  * Separate 63 bit Vec3 to two Vec3 32 bit float values.
@@ -67,8 +85,9 @@ export class Vec3 {
67
85
  * @returns {Array.<number>} Encoded array. (exactly 2 entries)
68
86
  */
69
87
  static doubleToTwoFloats(v, high, low) {
70
-
71
- let x = v.x, y = v.y, z = v.z;
88
+ let x = v.x,
89
+ y = v.y,
90
+ z = v.z;
72
91
 
73
92
  if (x >= 0.0) {
74
93
  let doubleHigh = Math.floor(x / 65536.0) * 65536.0;
@@ -110,8 +129,9 @@ export class Vec3 {
110
129
  * @returns {Array.<number>} Encoded array. (exactly 2 entries)
111
130
  */
112
131
  static doubleToTwoFloat32Array(v, high, low) {
113
-
114
- let x = v.x, y = v.y, z = v.z;
132
+ let x = v.x,
133
+ y = v.y,
134
+ z = v.z;
115
135
 
116
136
  if (x >= 0.0) {
117
137
  let doubleHigh = Math.floor(x / 65536.0) * 65536.0;
@@ -148,7 +168,7 @@ export class Vec3 {
148
168
  * Creates 3d vector from array.
149
169
  * @function
150
170
  * @param {Array.<number>} arr - Input array (exactly 3 entries)
151
- * @returns {og.Vec3} -
171
+ * @returns {Vec3} -
152
172
  */
153
173
  static fromVec(arr) {
154
174
  return new Vec3(arr[0], arr[1], arr[2]);
@@ -157,8 +177,8 @@ export class Vec3 {
157
177
  /**
158
178
  * Gets angle between two vectors.
159
179
  * @static
160
- * @param {og.Vec3} a - First vector.
161
- * @param {og.Vec3} b - Second vector.
180
+ * @param {Vec3} a - First vector.
181
+ * @param {Vec3} b - Second vector.
162
182
  * @returns {number} -
163
183
  */
164
184
  static angle(a, b) {
@@ -168,10 +188,10 @@ export class Vec3 {
168
188
  /**
169
189
  * Returns two vectors linear interpolation.
170
190
  * @static
171
- * @param {og.Vec3} v1 - Start vector.
172
- * @param {og.Vec3} v2 - End vector.
191
+ * @param {Vec3} v1 - Start vector.
192
+ * @param {Vec3} v2 - End vector.
173
193
  * @param {number} l - Interpolate value.
174
- * @returns {og.Vec3} -
194
+ * @returns {Vec3} -
175
195
  */
176
196
  static lerp(v1, v2, l) {
177
197
  return Vec3(v1.x + (v2.x - v1.x) * l, v1.y + (v2.y - v1.y) * l, v1.z + (v2.z - v1.z) * l);
@@ -180,9 +200,9 @@ export class Vec3 {
180
200
  /**
181
201
  * Returns summary vector.
182
202
  * @static
183
- * @param {og.Vec3} a - First vector.
184
- * @param {og.Vec3} b - Second vector.
185
- * @returns {og.Vec3} - Summary vector.
203
+ * @param {Vec3} a - First vector.
204
+ * @param {Vec3} b - Second vector.
205
+ * @returns {Vec3} - Summary vector.
186
206
  */
187
207
  static add(a, b) {
188
208
  var res = new Vec3(a.x, a.y, a.z);
@@ -193,9 +213,9 @@ export class Vec3 {
193
213
  /**
194
214
  * Returns two vectors subtraction.
195
215
  * @static
196
- * @param {og.Vec3} a - First vector.
197
- * @param {og.Vec3} b - Second vector.
198
- * @returns {og.Vec3} - Vectors subtraction.
216
+ * @param {Vec3} a - First vector.
217
+ * @param {Vec3} b - Second vector.
218
+ * @returns {Vec3} - Vectors subtraction.
199
219
  */
200
220
  static sub(a, b) {
201
221
  var res = new Vec3(a.x, a.y, a.z);
@@ -206,9 +226,9 @@ export class Vec3 {
206
226
  /**
207
227
  * Returns scaled vector.
208
228
  * @static
209
- * @param {og.Vec3} a - Input vector.
229
+ * @param {Vec3} a - Input vector.
210
230
  * @param {number} scale - Scale value.
211
- * @returns {og.Vec3} -
231
+ * @returns {Vec3} -
212
232
  */
213
233
  static scale(a, scale) {
214
234
  var res = new Vec3(a.x, a.y, a.z);
@@ -219,9 +239,9 @@ export class Vec3 {
219
239
  /**
220
240
  * Returns two vectors production.
221
241
  * @static
222
- * @param {og.Vec3} a - First vector.
223
- * @param {og.Vec3} b - Second vector.
224
- * @returns {og.Vec3} -
242
+ * @param {Vec3} a - First vector.
243
+ * @param {Vec3} b - Second vector.
244
+ * @returns {Vec3} -
225
245
  */
226
246
  static mul(a, b) {
227
247
  var res = new Vec3(a.x, a.y, a.z);
@@ -232,9 +252,9 @@ export class Vec3 {
232
252
  /**
233
253
  * Returns true if two vectors are non collinear.
234
254
  * @public
235
- * @param {og.Vec3} a - First vector.
236
- * @param {og.Vec3} b - Second vector.
237
- * @returns {og.Vec3} -
255
+ * @param {Vec3} a - First vector.
256
+ * @param {Vec3} b - Second vector.
257
+ * @returns {Vec3} -
238
258
  */
239
259
  static noncollinear(a, b) {
240
260
  return a.y * b.z - a.z * b.y || a.z * b.x - a.x * b.z || a.x * b.y - a.y * b.z;
@@ -243,10 +263,10 @@ export class Vec3 {
243
263
  /**
244
264
  * Get projection of the vector to plane where n - normal to the plane.
245
265
  * @static
246
- * @param {og.Vec3} b - Vector to project.
247
- * @param {og.Vec3} n - Plane normal.
248
- * @param {og.Vec3} [def] - Default value for non existed result.
249
- * @returns {og.Vec3} -
266
+ * @param {Vec3} b - Vector to project.
267
+ * @param {Vec3} n - Plane normal.
268
+ * @param {Vec3} [def] - Default value for non existed result.
269
+ * @returns {Vec3} -
250
270
  */
251
271
  static proj_b_to_plane(b, n, def) {
252
272
  var res = b.sub(n.scaleTo(n.dot(b) / n.dot(n)));
@@ -259,9 +279,9 @@ export class Vec3 {
259
279
  /**
260
280
  * Get projection of the first vector to the second.
261
281
  * @static
262
- * @param {og.Vec3} b - First vector.
263
- * @param {og.Vec3} a - Second vector.
264
- * @returns {og.Vec3} -
282
+ * @param {Vec3} b - First vector.
283
+ * @param {Vec3} a - Second vector.
284
+ * @returns {Vec3} -
265
285
  */
266
286
  static proj_b_to_a(b, a) {
267
287
  return a.scaleTo(a.dot(b) / a.dot(a));
@@ -271,9 +291,9 @@ export class Vec3 {
271
291
  * Makes vectors normalized and orthogonal to each other.
272
292
  * Normalizes normal. Normalizes tangent and makes sure it is orthogonal to normal (that is, angle between them is 90 degrees).
273
293
  * @static
274
- * @param {og.Vec3} normal - Normal vector.
275
- * @param {og.Vec3} tangent - Tangent vector.
276
- * @returns {og.Vec3} -
294
+ * @param {Vec3} normal - Normal vector.
295
+ * @param {Vec3} tangent - Tangent vector.
296
+ * @returns {Vec3} -
277
297
  */
278
298
  static orthoNormalize(normal, tangent) {
279
299
  normal = normal.normal();
@@ -284,9 +304,9 @@ export class Vec3 {
284
304
  /**
285
305
  * Returns vector components division product one to another.
286
306
  * @static
287
- * @param {og.Vec3} a - First vector.
288
- * @param {og.Vec3} b - Second vector.
289
- * @returns {og.Vec3} -
307
+ * @param {Vec3} a - First vector.
308
+ * @param {Vec3} b - Second vector.
309
+ * @returns {Vec3} -
290
310
  */
291
311
  static div(a, b) {
292
312
  var res = new Vec3(a.x, a.y, a.z);
@@ -297,7 +317,7 @@ export class Vec3 {
297
317
  /**
298
318
  * Converts to 4d vector, Fourth value is 1.0.
299
319
  * @public
300
- * @returns {og.Vec4} -
320
+ * @returns {Vec4} -
301
321
  */
302
322
  toVec4() {
303
323
  return new Vec4(this.x, this.y, this.z, 1.0);
@@ -306,7 +326,7 @@ export class Vec3 {
306
326
  /**
307
327
  * Returns clone vector.
308
328
  * @public
309
- * @returns {og.Vec3} -
329
+ * @returns {Vec3} -
310
330
  */
311
331
  clone() {
312
332
  return new Vec3(this.x, this.y, this.z);
@@ -333,8 +353,8 @@ export class Vec3 {
333
353
  /**
334
354
  * Get projection of the first vector to the second.
335
355
  * @static
336
- * @param {og.Vec3} a - Project vector.
337
- * @returns {og.Vec3} -
356
+ * @param {Vec3} a - Project vector.
357
+ * @returns {Vec3} -
338
358
  */
339
359
  projToVec(a) {
340
360
  return a.scaleTo(a.dot(this) / a.dot(a));
@@ -343,7 +363,7 @@ export class Vec3 {
343
363
  /**
344
364
  * Compares with vector. Returns true if it equals another.
345
365
  * @public
346
- * @param {og.Vec3} p - Vector to compare.
366
+ * @param {Vec3} p - Vector to compare.
347
367
  * @returns {boolean} -
348
368
  */
349
369
  equal(p) {
@@ -352,8 +372,8 @@ export class Vec3 {
352
372
 
353
373
  /**
354
374
  * Copy input vector's values.
355
- * @param {og.Vec3} point3 - Vector to copy.
356
- * @returns {og.Vec3} -
375
+ * @param {Vec3} point3 - Vector to copy.
376
+ * @returns {Vec3} -
357
377
  */
358
378
  copy(point3) {
359
379
  this.x = point3.x;
@@ -383,7 +403,7 @@ export class Vec3 {
383
403
  /**
384
404
  * Converts vector's values to a quaternion object.
385
405
  * @public
386
- * @returns {og.Quat} -
406
+ * @returns {Quat} -
387
407
  */
388
408
  getQuat() {
389
409
  return new Quat(this.x, this.y, this.z);
@@ -392,8 +412,8 @@ export class Vec3 {
392
412
  /**
393
413
  * Adds vector to the current.
394
414
  * @public
395
- * @param {og.Vec3} point3 - Point to add.
396
- * @returns {og.Vec3} -
415
+ * @param {Vec3} point3 - Point to add.
416
+ * @returns {Vec3} -
397
417
  */
398
418
  addA(point3) {
399
419
  this.x += point3.x;
@@ -405,8 +425,8 @@ export class Vec3 {
405
425
  /**
406
426
  * Gets two vectors summarization.
407
427
  * @public
408
- * @param {og.Vec3} point3 - Vector to add.
409
- * @returns {og.Vec3} Returns a sum vector.
428
+ * @param {Vec3} point3 - Vector to add.
429
+ * @returns {Vec3} Returns a sum vector.
410
430
  */
411
431
  add(point3) {
412
432
  return new Vec3(this.x + point3.x, this.y + point3.y, this.z + point3.z);
@@ -415,8 +435,8 @@ export class Vec3 {
415
435
  /**
416
436
  * Subtract vector from the current.
417
437
  * @public
418
- * @param {og.Vec3} point3 - Subtract vector.
419
- * @returns {og.Vec3} -
438
+ * @param {Vec3} point3 - Subtract vector.
439
+ * @returns {Vec3} -
420
440
  */
421
441
  subA(point3) {
422
442
  this.x -= point3.x;
@@ -428,8 +448,8 @@ export class Vec3 {
428
448
  /**
429
449
  * Gets vector subtraction.
430
450
  * @public
431
- * @param {og.Vec3} point3 - Subtract vector.
432
- * @return {og.Vec3} Returns new instance of a subtraction
451
+ * @param {Vec3} point3 - Subtract vector.
452
+ * @return {Vec3} Returns new instance of a subtraction
433
453
  */
434
454
  sub(point3) {
435
455
  return new Vec3(this.x - point3.x, this.y - point3.y, this.z - point3.z);
@@ -439,7 +459,7 @@ export class Vec3 {
439
459
  * Scale current vector.
440
460
  * @public
441
461
  * @param {number} scale - Scale value.
442
- * @returns {og.Vec3} -
462
+ * @returns {Vec3} -
443
463
  */
444
464
  scale(scale) {
445
465
  this.x *= scale;
@@ -452,7 +472,7 @@ export class Vec3 {
452
472
  * Scale current vector to another instance.
453
473
  * @public
454
474
  * @param {number} scale - Scale value.
455
- * @returns {og.Vec3} -
475
+ * @returns {Vec3} -
456
476
  */
457
477
  scaleTo(scale) {
458
478
  return new Vec3(this.x * scale, this.y * scale, this.z * scale);
@@ -461,8 +481,8 @@ export class Vec3 {
461
481
  /**
462
482
  * Multiply current vector object to another and store result in the current instance.
463
483
  * @public
464
- * @param {og.Vec3} vec - Multiply vector.
465
- * @returns {og.Vec3} -
484
+ * @param {Vec3} vec - Multiply vector.
485
+ * @returns {Vec3} -
466
486
  */
467
487
  mulA(vec) {
468
488
  this.x *= vec.x;
@@ -474,8 +494,8 @@ export class Vec3 {
474
494
  /**
475
495
  * Multiply current vector object to another and returns new vector instance.
476
496
  * @public
477
- * @param {og.Vec3} vec - Multiply vector.
478
- * @returns {og.Vec3} -
497
+ * @param {Vec3} vec - Multiply vector.
498
+ * @returns {Vec3} -
479
499
  */
480
500
  mul(vec) {
481
501
  return new Vec3(this.x * vec.x, this.y * vec.y, this.z * vec.z);
@@ -484,8 +504,8 @@ export class Vec3 {
484
504
  /**
485
505
  * Divide current vector's components to another. Results stores in the current vector object.
486
506
  * @public
487
- * @param {og.Vec3} vec - Div vector.
488
- * @returns {og.Vec3} -
507
+ * @param {Vec3} vec - Div vector.
508
+ * @returns {Vec3} -
489
509
  */
490
510
  divA(vec) {
491
511
  this.x /= vec.x;
@@ -497,8 +517,8 @@ export class Vec3 {
497
517
  /**
498
518
  * Divide current vector's components to another and returns new vector instance.
499
519
  * @public
500
- * @param {og.Vec3} vec - Div vector.
501
- * @returns {og.Vec3} -
520
+ * @param {Vec3} vec - Div vector.
521
+ * @returns {Vec3} -
502
522
  */
503
523
  div(vec) {
504
524
  return new Vec3(this.x / vec.x, this.y / vec.y, this.z / vec.z);
@@ -507,7 +527,7 @@ export class Vec3 {
507
527
  /**
508
528
  * Gets vectors dot production.
509
529
  * @public
510
- * @param {og.Vec3} point3 - Another vector.
530
+ * @param {Vec3} point3 - Another vector.
511
531
  * @returns {number} -
512
532
  */
513
533
  dot(point3) {
@@ -527,8 +547,8 @@ export class Vec3 {
527
547
  /**
528
548
  * Gets vectors cross production.
529
549
  * @public
530
- * @param {og.Vec3} point3 - Another vector.
531
- * @returns {og.Vec3} -
550
+ * @param {Vec3} point3 - Another vector.
551
+ * @returns {Vec3} -
532
552
  */
533
553
  cross(point3) {
534
554
  return new Vec3(
@@ -541,7 +561,7 @@ export class Vec3 {
541
561
  /**
542
562
  * Sets vector to zero.
543
563
  * @public
544
- * @returns {og.Vec3} -
564
+ * @returns {Vec3} -
545
565
  */
546
566
  clear() {
547
567
  this.x = this.y = this.z = 0;
@@ -551,7 +571,7 @@ export class Vec3 {
551
571
  /**
552
572
  * Returns normalized vector.
553
573
  * @public
554
- * @returns {og.Vec3} -
574
+ * @returns {Vec3} -
555
575
  */
556
576
  getNormal() {
557
577
  var res = new Vec3();
@@ -570,7 +590,7 @@ export class Vec3 {
570
590
  * Returns normalized vector.
571
591
  * @deprecated
572
592
  * @public
573
- * @returns {og.Vec3} -
593
+ * @returns {Vec3} -
574
594
  */
575
595
  normal() {
576
596
  var res = new Vec3();
@@ -588,7 +608,7 @@ export class Vec3 {
588
608
  /**
589
609
  * Returns normalized negate vector.
590
610
  * @public
591
- * @returns {og.Vec3} -
611
+ * @returns {Vec3} -
592
612
  */
593
613
  normalNegate() {
594
614
  var res = new Vec3();
@@ -606,7 +626,7 @@ export class Vec3 {
606
626
  /**
607
627
  * Returns normalized negate scale vector.
608
628
  * @public
609
- * @returns {og.Vec3} -
629
+ * @returns {Vec3} -
610
630
  */
611
631
  normalNegateScale(scale) {
612
632
  var res = new Vec3();
@@ -624,7 +644,7 @@ export class Vec3 {
624
644
  /**
625
645
  * Returns normalized scale vector.
626
646
  * @public
627
- * @returns {og.Vec3} -
647
+ * @returns {Vec3} -
628
648
  */
629
649
  normalScale(scale) {
630
650
  var res = new Vec3();
@@ -642,7 +662,7 @@ export class Vec3 {
642
662
  /**
643
663
  * Normalize current vector.
644
664
  * @public
645
- * @returns {og.Vec3} -
665
+ * @returns {Vec3} -
646
666
  */
647
667
  normalize() {
648
668
  var length = 1.0 / this.length();
@@ -676,7 +696,7 @@ export class Vec3 {
676
696
  /**
677
697
  * Gets distance to point.
678
698
  * @public
679
- * @param {og.Vec3} point3 - Distant point.
699
+ * @param {Vec3} point3 - Distant point.
680
700
  * @returns {number} -
681
701
  */
682
702
  distance(point3) {
@@ -689,7 +709,7 @@ export class Vec3 {
689
709
  * @param {number} x - Value X.
690
710
  * @param {number} y - Value Y.
691
711
  * @param {number} z - Value Z.
692
- * @returns {og.Vec3} -
712
+ * @returns {Vec3} -
693
713
  */
694
714
  set(x, y, z) {
695
715
  this.x = x;
@@ -701,7 +721,7 @@ export class Vec3 {
701
721
  /**
702
722
  * Negate current vector.
703
723
  * @public
704
- * @returns {og.Vec3} -
724
+ * @returns {Vec3} -
705
725
  */
706
726
  negate() {
707
727
  this.x = -this.x;
@@ -713,7 +733,7 @@ export class Vec3 {
713
733
  /**
714
734
  * Negate current vector to another instance.
715
735
  * @public
716
- * @returns {og.Vec3} -
736
+ * @returns {Vec3} -
717
737
  */
718
738
  negateTo() {
719
739
  return new Vec3(-this.x, -this.y, -this.z);
@@ -722,9 +742,9 @@ export class Vec3 {
722
742
  /**
723
743
  * Gets projected point coordinates of the current vector on the ray.
724
744
  * @public
725
- * @param {og.Vec3} pos - Ray position.
726
- * @param {og.Vec3} direction - Ray direction.
727
- * @returns {og.Vec3} -
745
+ * @param {Vec3} pos - Ray position.
746
+ * @param {Vec3} direction - Ray direction.
747
+ * @returns {Vec3} -
728
748
  */
729
749
  projToRay(pos, direction) {
730
750
  var v = Vec3.proj_b_to_a(Vec3.sub(this, pos), direction);
@@ -735,7 +755,7 @@ export class Vec3 {
735
755
  /**
736
756
  * Gets angle between two vectors.
737
757
  * @public
738
- * @param {og.Vec3} a - Another vector.
758
+ * @param {Vec3} a - Another vector.
739
759
  * @returns {number} -
740
760
  */
741
761
  angle(a) {
@@ -745,37 +765,47 @@ export class Vec3 {
745
765
  /**
746
766
  * Returns two vectors linear interpolation.
747
767
  * @public
748
- * @param {og.Vec3} v2 - End vector.
768
+ * @param {Vec3} v2 - End vector.
749
769
  * @param {number} l - Interpolate value.
750
- * @returns {og.Vec3} -
770
+ * @returns {Vec3} -
751
771
  */
752
772
  lerp(v2, l) {
753
- return new Vec3(this.x + (v2.x - this.x) * l, this.y + (v2.y - this.y) * l, this.z + (v2.z - this.z) * l);
773
+ return new Vec3(
774
+ this.x + (v2.x - this.x) * l,
775
+ this.y + (v2.y - this.y) * l,
776
+ this.z + (v2.z - this.z) * l
777
+ );
754
778
  }
755
779
 
756
780
  /**
757
781
  * Returns vector interpolation by v(t) = v1 * t + v2 * (1 - t)
758
782
  * @public
759
- * @param {og.Vec3} v2 - End vector.
783
+ * @param {Vec3} v2 - End vector.
760
784
  * @param {number} t - Interpolate value.
761
- * @returns {og.Vec3} -
785
+ * @returns {Vec3} -
762
786
  */
763
787
  smerp(v2, t) {
764
788
  var one_d = 1 - t;
765
- return new Vec3(this.x * t + v2.x * one_d, this.y * t + v2.y * one_d, this.z * t + v2.z * one_d);
789
+ return new Vec3(
790
+ this.x * t + v2.x * one_d,
791
+ this.y * t + v2.y * one_d,
792
+ this.z * t + v2.z * one_d
793
+ );
766
794
  }
767
795
 
768
- static get LERP_DELTA() { return 1e-6 }
796
+ static get LERP_DELTA() {
797
+ return 1e-6;
798
+ }
769
799
 
770
800
  /**
771
801
  * Spherically interpolates between two vectors.
772
- * Interpolates between current and v2 vector by amount t. The difference between this and linear interpolation (aka, "lerp") is that
773
- * the vectors are treated as directions rather than points in space. The direction of the returned vector is interpolated
802
+ * Interpolates between current and v2 vector by amount t. The difference between this and linear interpolation (aka, "lerp") is that
803
+ * the vectors are treated as directions rather than points in space. The direction of the returned vector is interpolated
774
804
  * by the angle and its magnitude is interpolated between the magnitudes of from and to.
775
805
  * @public
776
- * @param {og.Vec3} v2 -
806
+ * @param {Vec3} v2 -
777
807
  * @param {number} t - The parameter t is clamped to the range [0, 1].
778
- * @returns {og.Vec3} -
808
+ * @returns {Vec3} -
779
809
  */
780
810
  slerp(v2, t) {
781
811
  var res = new Vec3();
@@ -791,7 +821,7 @@ export class Vec3 {
791
821
  var omega, sinom, scale0, scale1;
792
822
  var cosom = this.dot(v2);
793
823
 
794
- if ((1.0 - cosom) > Vec3.LERP_DELTA) {
824
+ if (1.0 - cosom > Vec3.LERP_DELTA) {
795
825
  omega = Math.acos(cosom);
796
826
  sinom = Math.sin(omega);
797
827
  scale0 = Math.sin((1.0 - t) * omega) / sinom;
@@ -825,14 +855,15 @@ export class Vec3 {
825
855
  return Quat.IDENTITY.clone();
826
856
  }
827
857
 
828
- if (d < (1e-6 - 1.0)) {
858
+ if (d < 1e-6 - 1.0) {
829
859
  if (!fallbackAxis.isEqual(Vec3.ZERO)) {
830
860
  // rotate 180 degrees about the fallback axis
831
861
  return Quat.axisAngleToQuat(Math.PI, fallbackAxis);
832
862
  } else {
833
863
  // Generate an axis
834
864
  let axis = Vec3.UNIT_X.cross(v0);
835
- if (axis.isZero()) { // pick another if colinear
865
+ if (axis.isZero()) {
866
+ // pick another if colinear
836
867
  axis = Vec3.UNIT_Y.cross(v0);
837
868
  }
838
869
  axis.normalize();
@@ -857,9 +888,8 @@ export class Vec3 {
857
888
  * @param {number} [x] - First cvalue.
858
889
  * @param {number} [y] - Second value.
859
890
  * @param {number} [z] - Third value.
860
- * @returns {og.Vec3} -
891
+ * @returns {Vec3} -
861
892
  */
862
893
  export function vec3(x, y, z) {
863
894
  return new Vec3(x, y, z);
864
895
  }
865
-