@openglobus/og 0.18.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (476) hide show
  1. package/README.md +8 -8
  2. package/lib/@openglobus/og.esm.js +2 -0
  3. package/lib/@openglobus/og.esm.js.map +1 -0
  4. package/lib/@openglobus/og.umd.js +2 -0
  5. package/lib/@openglobus/og.umd.js.map +1 -0
  6. package/lib/js/Clock.d.ts +106 -0
  7. package/{src/Clock.ts → lib/js/Clock.js} +31 -126
  8. package/lib/js/Deferred.d.ts +6 -0
  9. package/lib/js/Deferred.js +13 -0
  10. package/lib/js/Events.d.ts +90 -0
  11. package/{src/Events.ts → lib/js/Events.js} +29 -84
  12. package/lib/js/Extent.d.ts +145 -0
  13. package/{src/Extent.ts → lib/js/Extent.js} +74 -120
  14. package/lib/js/Globe.d.ts +132 -0
  15. package/{src/Globe.ts → lib/js/Globe.js} +61 -159
  16. package/lib/js/ImageCanvas.d.ts +128 -0
  17. package/{src/ImageCanvas.ts → lib/js/ImageCanvas.js} +24 -65
  18. package/lib/js/Lock.d.ts +15 -0
  19. package/{src/Lock.ts → lib/js/Lock.js} +7 -21
  20. package/lib/js/LonLat.d.ts +128 -0
  21. package/{src/LonLat.ts → lib/js/LonLat.js} +44 -75
  22. package/lib/js/Object3d.d.ts +49 -0
  23. package/{src/Object3d.ts → lib/js/Object3d.js} +64 -184
  24. package/lib/js/Popup.d.ts +46 -0
  25. package/{src/Popup.ts → lib/js/Popup.js} +42 -110
  26. package/lib/js/QueueArray.d.ts +16 -0
  27. package/{src/QueueArray.ts → lib/js/QueueArray.js} +12 -25
  28. package/lib/js/Rectangle.d.ts +76 -0
  29. package/{src/Rectangle.ts → lib/js/Rectangle.js} +12 -50
  30. package/lib/js/Stack.d.ts +20 -0
  31. package/{src/Stack.ts → lib/js/Stack.js} +13 -29
  32. package/lib/js/astro/astro.d.ts +39 -0
  33. package/{src/astro/astro.ts → lib/js/astro/astro.js} +2 -8
  34. package/lib/js/astro/earth.d.ts +8 -0
  35. package/{src/astro/earth.ts → lib/js/astro/earth.js} +3 -39
  36. package/lib/js/astro/jd.d.ts +234 -0
  37. package/{src/astro/jd.ts → lib/js/astro/jd.js} +55 -134
  38. package/lib/js/astro/orbit.d.ts +5 -0
  39. package/{src/astro/orbit.ts → lib/js/astro/orbit.js} +26 -39
  40. package/lib/js/astro/rotation.d.ts +2 -0
  41. package/{src/astro/rotation.ts → lib/js/astro/rotation.js} +2 -11
  42. package/lib/js/bv/Box.d.ts +32 -0
  43. package/{src/bv/Box.ts → lib/js/bv/Box.js} +7 -35
  44. package/lib/js/bv/Sphere.d.ts +37 -0
  45. package/{src/bv/Sphere.ts → lib/js/bv/Sphere.js} +6 -34
  46. package/{src/bv/index.ts → lib/js/bv/index.d.ts} +0 -1
  47. package/lib/js/bv/index.js +3 -0
  48. package/lib/js/camera/Camera.d.ts +314 -0
  49. package/{src/camera/Camera.ts → lib/js/camera/Camera.js} +77 -326
  50. package/lib/js/camera/Frustum.d.ts +139 -0
  51. package/{src/camera/Frustum.ts → lib/js/camera/Frustum.js} +66 -185
  52. package/lib/js/camera/PlanetCamera.d.ts +234 -0
  53. package/{src/camera/PlanetCamera.ts → lib/js/camera/PlanetCamera.js} +65 -338
  54. package/{src/camera/index.ts → lib/js/camera/index.d.ts} +0 -1
  55. package/lib/js/camera/index.js +3 -0
  56. package/lib/js/cons.d.ts +40 -0
  57. package/{src/cons.ts → lib/js/cons.js} +10 -22
  58. package/lib/js/control/Atmosphere.d.ts +16 -0
  59. package/{src/control/Atmosphere.ts → lib/js/control/Atmosphere.js} +33 -86
  60. package/lib/js/control/CompassButton.d.ts +16 -0
  61. package/{src/control/CompassButton.ts → lib/js/control/CompassButton.js} +18 -43
  62. package/lib/js/control/Control.d.ts +100 -0
  63. package/{src/control/Control.ts → lib/js/control/Control.js} +22 -89
  64. package/lib/js/control/DebugInfo.d.ts +25 -0
  65. package/{src/control/DebugInfo.ts → lib/js/control/DebugInfo.js} +38 -84
  66. package/lib/js/control/DrawingSwitcher.d.ts +13 -0
  67. package/{src/control/DrawingSwitcher.ts → lib/js/control/DrawingSwitcher.js} +13 -30
  68. package/lib/js/control/EarthCoordinates.d.ts +41 -0
  69. package/{src/control/EarthCoordinates.ts → lib/js/control/EarthCoordinates.js} +58 -119
  70. package/lib/js/control/EarthNavigation.d.ts +50 -0
  71. package/{src/control/EarthNavigation.ts → lib/js/control/EarthNavigation.js} +70 -161
  72. package/lib/js/control/GeoImageDragControl.d.ts +22 -0
  73. package/{src/control/GeoImageDragControl.ts → lib/js/control/GeoImageDragControl.js} +26 -49
  74. package/lib/js/control/KeyboardNavigation.d.ts +28 -0
  75. package/{src/control/KeyboardNavigation.ts → lib/js/control/KeyboardNavigation.js} +67 -92
  76. package/lib/js/control/LayerAnimation.d.ts +71 -0
  77. package/{src/control/LayerAnimation.ts → lib/js/control/LayerAnimation.js} +82 -162
  78. package/lib/js/control/LayerSwitcher.d.ts +21 -0
  79. package/{src/control/LayerSwitcher.ts → lib/js/control/LayerSwitcher.js} +16 -41
  80. package/lib/js/control/Lighting.d.ts +49 -0
  81. package/{src/control/Lighting.ts → lib/js/control/Lighting.js} +106 -219
  82. package/lib/js/control/MouseNavigation.d.ts +62 -0
  83. package/{src/control/MouseNavigation.ts → lib/js/control/MouseNavigation.js} +105 -211
  84. package/lib/js/control/MouseWheelZoomControl.d.ts +44 -0
  85. package/lib/js/control/MouseWheelZoomControl.js +181 -0
  86. package/lib/js/control/RulerSwitcher.d.ts +17 -0
  87. package/{src/control/RulerSwitcher.ts → lib/js/control/RulerSwitcher.js} +13 -28
  88. package/lib/js/control/ScaleControl.d.ts +24 -0
  89. package/lib/js/control/ScaleControl.js +91 -0
  90. package/lib/js/control/SegmentBoundVisualization.d.ts +12 -0
  91. package/lib/js/control/SegmentBoundVisualization.js +37 -0
  92. package/lib/js/control/ShowFps.d.ts +9 -0
  93. package/lib/js/control/ShowFps.js +20 -0
  94. package/lib/js/control/SimpleNavigation.d.ts +25 -0
  95. package/{src/control/SimpleNavigation.ts → lib/js/control/SimpleNavigation.js} +29 -51
  96. package/lib/js/control/SimpleSkyBackground.d.ts +15 -0
  97. package/{src/control/SimpleSkyBackground.ts → lib/js/control/SimpleSkyBackground.js} +21 -48
  98. package/lib/js/control/Sun.d.ts +33 -0
  99. package/{src/control/Sun.ts → lib/js/control/Sun.js} +34 -85
  100. package/lib/js/control/ToggleWireframe.d.ts +14 -0
  101. package/lib/js/control/ToggleWireframe.js +28 -0
  102. package/lib/js/control/TouchNavigation.d.ts +52 -0
  103. package/{src/control/TouchNavigation.ts → lib/js/control/TouchNavigation.js} +88 -193
  104. package/lib/js/control/ZoomControl.d.ts +27 -0
  105. package/{src/control/ZoomControl.ts → lib/js/control/ZoomControl.js} +25 -50
  106. package/lib/js/control/drawing/DrawingControl.d.ts +12 -0
  107. package/{src/control/drawing/DrawingControl.ts → lib/js/control/drawing/DrawingControl.js} +10 -20
  108. package/lib/js/control/drawing/LineStringDrawingScene.d.ts +15 -0
  109. package/{src/control/drawing/LineStringDrawingScene.ts → lib/js/control/drawing/LineStringDrawingScene.js} +28 -85
  110. package/lib/js/control/drawing/PolygonDrawingScene.d.ts +98 -0
  111. package/{src/control/drawing/PolygonDrawingScene.ts → lib/js/control/drawing/PolygonDrawingScene.js} +190 -388
  112. package/lib/js/control/elevationProfile/ElevationProfile.d.ts +61 -0
  113. package/{src/control/elevationProfile/ElevationProfile.ts → lib/js/control/elevationProfile/ElevationProfile.js} +56 -148
  114. package/lib/js/control/heightRuler/HeightRuler.d.ts +7 -0
  115. package/{src/control/heightRuler/HeightRuler.ts → lib/js/control/heightRuler/HeightRuler.js} +4 -9
  116. package/lib/js/control/heightRuler/HeightRulerScene.d.ts +35 -0
  117. package/{src/control/heightRuler/HeightRulerScene.ts → lib/js/control/heightRuler/HeightRulerScene.js} +47 -99
  118. package/lib/js/control/heightRuler/HeightRulerSwitcher.d.ts +6 -0
  119. package/{src/control/heightRuler/HeightRulerSwitcher.ts → lib/js/control/heightRuler/HeightRulerSwitcher.js} +2 -4
  120. package/{src/control/index.ts → lib/js/control/index.d.ts} +1 -18
  121. package/lib/js/control/index.js +28 -0
  122. package/lib/js/control/ruler/Ruler.d.ts +13 -0
  123. package/lib/js/control/ruler/Ruler.js +23 -0
  124. package/lib/js/control/ruler/RulerScene.d.ts +88 -0
  125. package/lib/js/control/ruler/RulerScene.js +324 -0
  126. package/lib/js/control/selection/Selection.d.ts +55 -0
  127. package/{src/control/selection/Selection.ts → lib/js/control/selection/Selection.js} +15 -34
  128. package/lib/js/control/selection/SelectionScene.d.ts +44 -0
  129. package/{src/control/selection/SelectionScene.ts → lib/js/control/selection/SelectionScene.js} +26 -113
  130. package/lib/js/control/timeline/TimelineControl.d.ts +18 -0
  131. package/{src/control/timeline/TimelineControl.ts → lib/js/control/timeline/TimelineControl.js} +13 -43
  132. package/lib/js/control/timeline/TimelineModel.d.ts +41 -0
  133. package/{src/control/timeline/TimelineModel.ts → lib/js/control/timeline/TimelineModel.js} +26 -74
  134. package/lib/js/control/timeline/TimelineView.d.ts +85 -0
  135. package/{src/control/timeline/TimelineView.ts → lib/js/control/timeline/TimelineView.js} +133 -281
  136. package/lib/js/control/timeline/timelineUtils.d.ts +12 -0
  137. package/lib/js/control/timeline/timelineUtils.js +112 -0
  138. package/lib/js/control/visibleExtent/Segment.d.ts +277 -0
  139. package/{src → lib/js}/control/visibleExtent/Segment.js +145 -698
  140. package/lib/js/control/visibleExtent/VisibleExtent.d.ts +5 -0
  141. package/{src → lib/js}/control/visibleExtent/VisibleExtent.js +1 -18
  142. package/lib/js/control/visibleExtent/drawnode.d.ts +7 -0
  143. package/{src/control/visibleExtent/drawnode.ts → lib/js/control/visibleExtent/drawnode.js} +1 -28
  144. package/lib/js/ellipsoid/Ellipsoid.d.ts +187 -0
  145. package/{src/ellipsoid/Ellipsoid.ts → lib/js/ellipsoid/Ellipsoid.js} +82 -267
  146. package/lib/js/ellipsoid/index.d.ts +3 -0
  147. package/lib/js/ellipsoid/index.js +3 -0
  148. package/lib/js/ellipsoid/wgs84.d.ts +6 -0
  149. package/{src/ellipsoid/wgs84.ts → lib/js/ellipsoid/wgs84.js} +1 -2
  150. package/lib/js/entity/BaseBillboard.d.ts +222 -0
  151. package/{src/entity/BaseBillboard.ts → lib/js/entity/BaseBillboard.js} +48 -165
  152. package/lib/js/entity/BaseBillboardHandler.d.ts +81 -0
  153. package/{src/entity/BaseBillboardHandler.ts → lib/js/entity/BaseBillboardHandler.js} +139 -365
  154. package/lib/js/entity/Billboard.d.ts +113 -0
  155. package/{src/entity/Billboard.ts → lib/js/entity/Billboard.js} +19 -83
  156. package/lib/js/entity/BillboardHandler.d.ts +15 -0
  157. package/{src/entity/BillboardHandler.ts → lib/js/entity/BillboardHandler.js} +27 -59
  158. package/lib/js/entity/Entity.d.ts +354 -0
  159. package/{src/entity/Entity.ts → lib/js/entity/Entity.js} +101 -373
  160. package/lib/js/entity/EntityCollection.d.ts +364 -0
  161. package/{src/entity/EntityCollection.ts → lib/js/entity/EntityCollection.js} +51 -353
  162. package/lib/js/entity/GeoObject.d.ts +138 -0
  163. package/{src/entity/GeoObject.ts → lib/js/entity/GeoObject.js} +41 -146
  164. package/lib/js/entity/GeoObjectHandler.d.ts +99 -0
  165. package/{src/entity/GeoObjectHandler.ts → lib/js/entity/GeoObjectHandler.js} +162 -423
  166. package/lib/js/entity/Geometry.d.ts +111 -0
  167. package/lib/js/entity/Geometry.js +283 -0
  168. package/lib/js/entity/GeometryHandler.d.ts +84 -0
  169. package/{src/entity/GeometryHandler.ts → lib/js/entity/GeometryHandler.js} +162 -657
  170. package/lib/js/entity/Label.d.ts +207 -0
  171. package/{src/entity/Label.ts → lib/js/entity/Label.js} +62 -164
  172. package/lib/js/entity/LabelHandler.d.ts +65 -0
  173. package/{src/entity/LabelHandler.ts → lib/js/entity/LabelHandler.js} +175 -408
  174. package/lib/js/entity/LabelWorker.d.ts +15 -0
  175. package/{src/entity/LabelWorker.ts → lib/js/entity/LabelWorker.js} +24 -45
  176. package/lib/js/entity/PointCloud.d.ts +179 -0
  177. package/{src/entity/PointCloud.ts → lib/js/entity/PointCloud.js} +65 -265
  178. package/lib/js/entity/PointCloudHandler.d.ts +42 -0
  179. package/{src/entity/PointCloudHandler.ts → lib/js/entity/PointCloudHandler.js} +19 -62
  180. package/lib/js/entity/Polyline.d.ts +337 -0
  181. package/{src/entity/Polyline.ts → lib/js/entity/Polyline.js} +289 -924
  182. package/lib/js/entity/PolylineHandler.d.ts +22 -0
  183. package/{src/entity/PolylineHandler.ts → lib/js/entity/PolylineHandler.js} +12 -37
  184. package/lib/js/entity/Ray.d.ts +133 -0
  185. package/{src/entity/Ray.ts → lib/js/entity/Ray.js} +26 -146
  186. package/lib/js/entity/RayHandler.d.ts +70 -0
  187. package/{src/entity/RayHandler.ts → lib/js/entity/RayHandler.js} +102 -342
  188. package/lib/js/entity/Strip.d.ts +127 -0
  189. package/{src/entity/Strip.ts → lib/js/entity/Strip.js} +102 -372
  190. package/lib/js/entity/StripHandler.d.ts +42 -0
  191. package/{src/entity/StripHandler.ts → lib/js/entity/StripHandler.js} +22 -74
  192. package/{src/entity/index.ts → lib/js/entity/index.d.ts} +1 -2
  193. package/lib/js/entity/index.js +11 -0
  194. package/lib/js/index.d.ts +33 -0
  195. package/lib/js/index.js +33 -0
  196. package/lib/js/input/KeyboardHandler.d.ts +33 -0
  197. package/{src/input/KeyboardHandler.ts → lib/js/input/KeyboardHandler.js} +45 -84
  198. package/lib/js/input/MouseHandler.d.ts +16 -0
  199. package/{src/input/MouseHandler.ts → lib/js/input/MouseHandler.js} +12 -36
  200. package/lib/js/input/TouchHandler.d.ts +11 -0
  201. package/{src/input/TouchHandler.ts → lib/js/input/TouchHandler.js} +11 -23
  202. package/lib/js/input/input.d.ts +3 -0
  203. package/{src/input/input.ts → lib/js/input/input.js} +1 -1
  204. package/lib/js/layer/BaseGeoImage.d.ts +145 -0
  205. package/{src/layer/BaseGeoImage.ts → lib/js/layer/BaseGeoImage.js} +70 -235
  206. package/lib/js/layer/CanvasTiles.d.ts +103 -0
  207. package/{src/layer/CanvasTiles.ts → lib/js/layer/CanvasTiles.js} +54 -146
  208. package/lib/js/layer/GeoImage.d.ts +61 -0
  209. package/{src/layer/GeoImage.ts → lib/js/layer/GeoImage.js} +24 -54
  210. package/lib/js/layer/GeoTexture2d.d.ts +17 -0
  211. package/lib/js/layer/GeoTexture2d.js +37 -0
  212. package/lib/js/layer/GeoVideo.d.ts +68 -0
  213. package/{src/layer/GeoVideo.ts → lib/js/layer/GeoVideo.js} +31 -61
  214. package/lib/js/layer/KML.d.ts +72 -0
  215. package/{src/layer/KML.ts → lib/js/layer/KML.js} +94 -138
  216. package/lib/js/layer/Layer.d.ts +401 -0
  217. package/{src/layer/Layer.ts → lib/js/layer/Layer.js} +92 -443
  218. package/lib/js/layer/Material.d.ts +34 -0
  219. package/{src/layer/Material.ts → lib/js/layer/Material.js} +9 -43
  220. package/lib/js/layer/Vector.d.ts +244 -0
  221. package/{src/layer/Vector.ts → lib/js/layer/Vector.js} +147 -418
  222. package/lib/js/layer/WMS.d.ts +75 -0
  223. package/{src/layer/WMS.ts → lib/js/layer/WMS.js} +18 -100
  224. package/lib/js/layer/XYZ.d.ts +149 -0
  225. package/{src/layer/XYZ.ts → lib/js/layer/XYZ.js} +71 -171
  226. package/lib/js/layer/index.d.ts +11 -0
  227. package/lib/js/layer/index.js +11 -0
  228. package/lib/js/light/LightSource.d.ts +174 -0
  229. package/{src/light/LightSource.ts → lib/js/light/LightSource.js} +22 -131
  230. package/lib/js/math/Line2.d.ts +11 -0
  231. package/{src/math/Line2.ts → lib/js/math/Line2.js} +5 -15
  232. package/lib/js/math/Line3.d.ts +28 -0
  233. package/lib/js/math/Line3.js +85 -0
  234. package/lib/js/math/Mat3.d.ts +77 -0
  235. package/{src/math/Mat3.ts → lib/js/math/Mat3.js} +22 -51
  236. package/lib/js/math/Mat4.d.ts +195 -0
  237. package/{src/math/Mat4.ts → lib/js/math/Mat4.js} +53 -219
  238. package/lib/js/math/Plane.d.ts +20 -0
  239. package/{src/math/Plane.ts → lib/js/math/Plane.js} +26 -40
  240. package/lib/js/math/Quat.d.ts +373 -0
  241. package/{src/math/Quat.ts → lib/js/math/Quat.js} +106 -319
  242. package/lib/js/math/Ray.d.ts +76 -0
  243. package/{src/math/Ray.ts → lib/js/math/Ray.js} +21 -66
  244. package/lib/js/math/Vec2.d.ts +310 -0
  245. package/{src/math/Vec2.ts → lib/js/math/Vec2.js} +55 -121
  246. package/lib/js/math/Vec3.d.ts +472 -0
  247. package/{src/math/Vec3.ts → lib/js/math/Vec3.js} +103 -236
  248. package/lib/js/math/Vec4.d.ts +163 -0
  249. package/{src/math/Vec4.ts → lib/js/math/Vec4.js} +23 -79
  250. package/lib/js/math/coder.d.ts +51 -0
  251. package/{src/math/coder.ts → lib/js/math/coder.js} +14 -20
  252. package/lib/js/math/index.d.ts +11 -0
  253. package/lib/js/math/index.js +11 -0
  254. package/lib/js/math.d.ts +266 -0
  255. package/{src/math.ts → lib/js/math.js} +37 -85
  256. package/lib/js/mercator.d.ts +92 -0
  257. package/{src/mercator.ts → lib/js/mercator.js} +13 -37
  258. package/lib/js/proj/EPSG3857.d.ts +9 -0
  259. package/{src/proj/EPSG3857.ts → lib/js/proj/EPSG3857.js} +0 -2
  260. package/lib/js/proj/EPSG4326.d.ts +9 -0
  261. package/{src/proj/EPSG4326.ts → lib/js/proj/EPSG4326.js} +0 -2
  262. package/lib/js/proj/Proj.d.ts +43 -0
  263. package/{src/proj/Proj.ts → lib/js/proj/Proj.js} +4 -29
  264. package/lib/js/quadTree/EPSG4326QuadTreeStrategy.d.ts +6 -0
  265. package/lib/js/quadTree/EPSG4326QuadTreeStrategy.js +17 -0
  266. package/lib/js/quadTree/EarthQuadTreeStrategy.d.ts +6 -0
  267. package/lib/js/quadTree/EarthQuadTreeStrategy.js +19 -0
  268. package/lib/js/quadTree/EntityCollectionNode.d.ts +54 -0
  269. package/{src/quadTree/EntityCollectionNode.ts → lib/js/quadTree/EntityCollectionNode.js} +83 -150
  270. package/lib/js/quadTree/MarsQuadTreeStrategy.d.ts +6 -0
  271. package/lib/js/quadTree/MarsQuadTreeStrategy.js +17 -0
  272. package/lib/js/quadTree/Node.d.ts +61 -0
  273. package/{src/quadTree/Node.ts → lib/js/quadTree/Node.js} +140 -357
  274. package/lib/js/quadTree/QuadTreeStrategy.d.ts +25 -0
  275. package/{src/quadTree/QuadTreeStrategy.ts → lib/js/quadTree/QuadTreeStrategy.js} +13 -44
  276. package/lib/js/quadTree/Wgs84QuadTreeStrategy.d.ts +6 -0
  277. package/lib/js/quadTree/Wgs84QuadTreeStrategy.js +15 -0
  278. package/lib/js/quadTree/index.d.ts +12 -0
  279. package/lib/js/quadTree/index.js +12 -0
  280. package/lib/js/quadTree/quadTree.d.ts +40 -0
  281. package/{src/quadTree/quadTree.ts → lib/js/quadTree/quadTree.js} +0 -9
  282. package/lib/js/renderer/Renderer.d.ts +311 -0
  283. package/{src/renderer/Renderer.ts → lib/js/renderer/Renderer.js} +169 -611
  284. package/lib/js/renderer/RendererEvents.d.ts +237 -0
  285. package/{src/renderer/RendererEvents.ts → lib/js/renderer/RendererEvents.js} +134 -471
  286. package/lib/js/scene/Axes.d.ts +12 -0
  287. package/lib/js/scene/Axes.js +59 -0
  288. package/lib/js/scene/BaseNode.d.ts +61 -0
  289. package/{src/scene/BaseNode.ts → lib/js/scene/BaseNode.js} +11 -57
  290. package/lib/js/scene/Planet.d.ts +623 -0
  291. package/{src/scene/Planet.ts → lib/js/scene/Planet.js} +251 -935
  292. package/lib/js/scene/RenderNode.d.ts +150 -0
  293. package/{src/scene/RenderNode.ts → lib/js/scene/RenderNode.js} +33 -138
  294. package/lib/js/scene/SkyBox.d.ts +13 -0
  295. package/{src/scene/SkyBox.ts → lib/js/scene/SkyBox.js} +16 -37
  296. package/{src/scene/index.ts → lib/js/scene/index.d.ts} +0 -1
  297. package/lib/js/scene/index.js +5 -0
  298. package/lib/js/segment/Segment.d.ts +278 -0
  299. package/{src/segment/Segment.ts → lib/js/segment/Segment.js} +242 -913
  300. package/lib/js/segment/SegmentLonLat.d.ts +48 -0
  301. package/{src/segment/SegmentLonLat.ts → lib/js/segment/SegmentLonLat.js} +58 -132
  302. package/lib/js/segment/SegmentLonLatWgs84.d.ts +10 -0
  303. package/lib/js/segment/SegmentLonLatWgs84.js +23 -0
  304. package/lib/js/segment/Slice.d.ts +13 -0
  305. package/{src/segment/Slice.ts → lib/js/segment/Slice.js} +4 -22
  306. package/lib/js/segment/segmentHelper.d.ts +18 -0
  307. package/{src/segment/segmentHelper.ts → lib/js/segment/segmentHelper.js} +30 -88
  308. package/lib/js/shaders/atmos.d.ts +4 -0
  309. package/{src/shaders/atmos.ts → lib/js/shaders/atmos.js} +8 -26
  310. package/lib/js/shaders/billboard.d.ts +3 -0
  311. package/{src/shaders/billboard.ts → lib/js/shaders/billboard.js} +9 -18
  312. package/lib/js/shaders/bloom.d.ts +2 -0
  313. package/{src/shaders/bloom.ts → lib/js/shaders/bloom.js} +5 -8
  314. package/lib/js/shaders/blur.d.ts +3 -0
  315. package/{src/shaders/blur.ts → lib/js/shaders/blur.js} +11 -19
  316. package/lib/js/shaders/depth.d.ts +2 -0
  317. package/{src/shaders/depth.ts → lib/js/shaders/depth.js} +3 -6
  318. package/lib/js/shaders/drawnode.d.ts +8 -0
  319. package/{src/shaders/drawnode.ts → lib/js/shaders/drawnode.js} +23 -75
  320. package/lib/js/shaders/geoObject.d.ts +3 -0
  321. package/{src/shaders/geoObject.ts → lib/js/shaders/geoObject.js} +51 -63
  322. package/lib/js/shaders/label.d.ts +4 -0
  323. package/{src/shaders/label.ts → lib/js/shaders/label.js} +12 -25
  324. package/lib/js/shaders/lumFilter.d.ts +2 -0
  325. package/{src/shaders/lumFilter.ts → lib/js/shaders/lumFilter.js} +4 -7
  326. package/lib/js/shaders/pickingMask.d.ts +2 -0
  327. package/{src/shaders/pickingMask.ts → lib/js/shaders/pickingMask.js} +5 -8
  328. package/lib/js/shaders/pointCloud.d.ts +2 -0
  329. package/{src/shaders/pointCloud.ts → lib/js/shaders/pointCloud.js} +4 -7
  330. package/lib/js/shaders/polyline.d.ts +3 -0
  331. package/{src/shaders/polyline.ts → lib/js/shaders/polyline.js} +7 -22
  332. package/lib/js/shaders/ray.d.ts +2 -0
  333. package/{src/shaders/ray.ts → lib/js/shaders/ray.js} +4 -7
  334. package/lib/js/shaders/screenFrame.d.ts +2 -0
  335. package/{src/shaders/screenFrame.ts → lib/js/shaders/screenFrame.js} +5 -8
  336. package/lib/js/shaders/skybox.d.ts +2 -0
  337. package/{src/shaders/skybox.ts → lib/js/shaders/skybox.js} +10 -13
  338. package/lib/js/shaders/toneMapping.d.ts +2 -0
  339. package/{src/shaders/toneMapping.ts → lib/js/shaders/toneMapping.js} +5 -8
  340. package/lib/js/shaders/utils.d.ts +1 -0
  341. package/{src/shaders/utils.ts → lib/js/shaders/utils.js} +1 -1
  342. package/lib/js/terrain/BilTerrain.d.ts +18 -0
  343. package/{src/terrain/BilTerrain.ts → lib/js/terrain/BilTerrain.js} +21 -118
  344. package/lib/js/terrain/EmptyTerrain.d.ts +106 -0
  345. package/{src/terrain/EmptyTerrain.ts → lib/js/terrain/EmptyTerrain.js} +20 -144
  346. package/lib/js/terrain/Geoid.d.ts +33 -0
  347. package/lib/js/terrain/Geoid.js +191 -0
  348. package/lib/js/terrain/GlobusTerrain.d.ts +134 -0
  349. package/{src/terrain/GlobusTerrain.ts → lib/js/terrain/GlobusTerrain.js} +82 -239
  350. package/lib/js/terrain/MapboxTerrain.d.ts +21 -0
  351. package/{src/terrain/MapboxTerrain.ts → lib/js/terrain/MapboxTerrain.js} +46 -215
  352. package/{src/terrain/index.ts → lib/js/terrain/index.d.ts} +0 -1
  353. package/lib/js/terrain/index.js +5 -0
  354. package/lib/js/ui/Button.d.ts +32 -0
  355. package/lib/js/ui/Button.js +78 -0
  356. package/lib/js/ui/ButtonGroup.d.ts +16 -0
  357. package/lib/js/ui/ButtonGroup.js +41 -0
  358. package/lib/js/ui/Dialog.d.ts +55 -0
  359. package/lib/js/ui/Dialog.js +173 -0
  360. package/lib/js/ui/Slider.d.ts +38 -0
  361. package/lib/js/ui/Slider.js +129 -0
  362. package/lib/js/ui/ToggleButton.d.ts +20 -0
  363. package/lib/js/ui/ToggleButton.js +42 -0
  364. package/lib/js/ui/View.d.ts +37 -0
  365. package/{src/ui/View.ts → lib/js/ui/View.js} +31 -77
  366. package/lib/js/ui/icons.d.ts +1 -0
  367. package/{src/ui/icons.ts → lib/js/ui/icons.js} +1 -1
  368. package/lib/js/utils/BaseWorker.d.ts +14 -0
  369. package/{src/utils/BaseWorker.ts → lib/js/utils/BaseWorker.js} +15 -28
  370. package/lib/js/utils/FontAtlas.d.ts +82 -0
  371. package/{src/utils/FontAtlas.ts → lib/js/utils/FontAtlas.js} +45 -181
  372. package/lib/js/utils/GeoImageCreator.d.ts +34 -0
  373. package/{src/utils/GeoImageCreator.ts → lib/js/utils/GeoImageCreator.js} +34 -91
  374. package/lib/js/utils/ImagesCacheManager.d.ts +22 -0
  375. package/{src/utils/ImagesCacheManager.ts → lib/js/utils/ImagesCacheManager.js} +16 -38
  376. package/lib/js/utils/Loader.d.ts +63 -0
  377. package/lib/js/utils/Loader.js +156 -0
  378. package/lib/js/utils/NormalMapCreator.d.ts +52 -0
  379. package/{src/utils/NormalMapCreator.ts → lib/js/utils/NormalMapCreator.js} +64 -195
  380. package/lib/js/utils/PlainSegmentWorker.d.ts +24 -0
  381. package/{src/utils/PlainSegmentWorker.ts → lib/js/utils/PlainSegmentWorker.js} +24 -56
  382. package/lib/js/utils/TerrainWorker.d.ts +28 -0
  383. package/{src/utils/TerrainWorker.ts → lib/js/utils/TerrainWorker.js} +19 -56
  384. package/lib/js/utils/TextureAtlas.d.ts +113 -0
  385. package/{src/utils/TextureAtlas.ts → lib/js/utils/TextureAtlas.js} +40 -131
  386. package/lib/js/utils/VectorTileCreator.d.ts +18 -0
  387. package/{src/utils/VectorTileCreator.ts → lib/js/utils/VectorTileCreator.js} +61 -147
  388. package/lib/js/utils/colorTable.d.ts +3 -0
  389. package/{src/utils/colorTable.ts → lib/js/utils/colorTable.js} +2 -2
  390. package/lib/js/utils/earcut.d.ts +7 -0
  391. package/{src/utils/earcut.ts → lib/js/utils/earcut.js} +95 -223
  392. package/lib/js/utils/objParser.d.ts +24 -0
  393. package/{src/utils/objParser.ts → lib/js/utils/objParser.js} +38 -93
  394. package/lib/js/utils/shared.d.ts +267 -0
  395. package/{src/utils/shared.ts → lib/js/utils/shared.js} +184 -341
  396. package/lib/js/utils/units.d.ts +16 -0
  397. package/lib/js/utils/units.js +61 -0
  398. package/lib/js/webgl/BaseFramebuffer.d.ts +53 -0
  399. package/{src/webgl/BaseFramebuffer.ts → lib/js/webgl/BaseFramebuffer.js} +22 -59
  400. package/lib/js/webgl/Framebuffer.d.ts +69 -0
  401. package/{src/webgl/Framebuffer.ts → lib/js/webgl/Framebuffer.js} +30 -87
  402. package/lib/js/webgl/Handler.d.ts +473 -0
  403. package/{src/webgl/Handler.ts → lib/js/webgl/Handler.js} +175 -586
  404. package/lib/js/webgl/Multisample.d.ts +27 -0
  405. package/lib/js/webgl/Multisample.js +77 -0
  406. package/lib/js/webgl/Program.d.ts +159 -0
  407. package/{src/webgl/Program.ts → lib/js/webgl/Program.js} +73 -210
  408. package/lib/js/webgl/ProgramController.d.ts +86 -0
  409. package/{src/webgl/ProgramController.ts → lib/js/webgl/ProgramController.js} +11 -45
  410. package/{src/webgl/index.ts → lib/js/webgl/index.d.ts} +1 -8
  411. package/lib/js/webgl/index.js +6 -0
  412. package/lib/js/webgl/types.d.ts +9 -0
  413. package/{src/webgl/types.ts → lib/js/webgl/types.js} +5 -8
  414. package/lib/js/webgl/variableHandlers.d.ts +22 -0
  415. package/lib/js/webgl/variableHandlers.js +78 -0
  416. package/package.json +23 -34
  417. package/dist/@openglobus/og.esm.js +0 -2
  418. package/dist/@openglobus/og.esm.js.map +0 -1
  419. package/dist/@openglobus/og.umd.js +0 -2
  420. package/dist/@openglobus/og.umd.js.map +0 -1
  421. package/src/Deferred.ts +0 -17
  422. package/src/control/MouseWheelZoomControl.ts +0 -269
  423. package/src/control/ScaleControl.ts +0 -131
  424. package/src/control/SegmentBoundVisualization.ts +0 -50
  425. package/src/control/ShowFps.ts +0 -28
  426. package/src/control/ToggleWireframe.ts +0 -35
  427. package/src/control/ruler/Ruler.ts +0 -35
  428. package/src/control/ruler/RulerScene.ts +0 -437
  429. package/src/control/timeline/timelineUtils.ts +0 -133
  430. package/src/ellipsoid/index.ts +0 -4
  431. package/src/entity/Geometry.ts +0 -486
  432. package/src/index.ts +0 -173
  433. package/src/layer/GeoTexture2d.ts +0 -56
  434. package/src/layer/index.ts +0 -12
  435. package/src/math/Line3.ts +0 -162
  436. package/src/math/index.ts +0 -26
  437. package/src/quadTree/EPSG4326QuadTreeStrategy.ts +0 -24
  438. package/src/quadTree/EarthQuadTreeStrategy.ts +0 -28
  439. package/src/quadTree/MarsQuadTreeStrategy.ts +0 -25
  440. package/src/quadTree/Wgs84QuadTreeStrategy.ts +0 -22
  441. package/src/quadTree/index.ts +0 -14
  442. package/src/scene/Axes.ts +0 -78
  443. package/src/segment/SegmentLonLatWgs84.ts +0 -33
  444. package/src/terrain/Geoid.ts +0 -273
  445. package/src/ui/Button.ts +0 -121
  446. package/src/ui/ButtonGroup.ts +0 -63
  447. package/src/ui/Dialog.ts +0 -244
  448. package/src/ui/Slider.ts +0 -188
  449. package/src/ui/ToggleButton.ts +0 -68
  450. package/src/utils/Loader.ts +0 -247
  451. package/src/utils/units.ts +0 -78
  452. package/src/webgl/Multisample.ts +0 -153
  453. package/src/webgl/variableHandlers.ts +0 -114
  454. /package/{dist → lib}/@openglobus/og.css +0 -0
  455. /package/{dist → lib}/@openglobus/res/fonts/Karla-Bold.json +0 -0
  456. /package/{dist → lib}/@openglobus/res/fonts/Karla-Bold.ttf.cfg +0 -0
  457. /package/{dist → lib}/@openglobus/res/fonts/Karla-Bold.ttf.png +0 -0
  458. /package/{dist → lib}/@openglobus/res/fonts/Karla-Light.json +0 -0
  459. /package/{dist → lib}/@openglobus/res/fonts/Karla-Light.ttf.cfg +0 -0
  460. /package/{dist → lib}/@openglobus/res/fonts/Karla-Light.ttf.png +0 -0
  461. /package/{dist → lib}/@openglobus/res/fonts/Karla-Medium.json +0 -0
  462. /package/{dist → lib}/@openglobus/res/fonts/Karla-Medium.ttf.cfg +0 -0
  463. /package/{dist → lib}/@openglobus/res/fonts/Karla-Medium.ttf.png +0 -0
  464. /package/{dist → lib}/@openglobus/res/fonts/NotoSansArabic-Regular.json +0 -0
  465. /package/{dist → lib}/@openglobus/res/fonts/NotoSansArabic-Regular.ttf.cfg +0 -0
  466. /package/{dist → lib}/@openglobus/res/fonts/NotoSansArabic-Regular.ttf.png +0 -0
  467. /package/{dist → lib}/@openglobus/res/fonts/Roboto-Regular.json +0 -0
  468. /package/{dist → lib}/@openglobus/res/fonts/Roboto-Regular.ttf.cfg +0 -0
  469. /package/{dist → lib}/@openglobus/res/fonts/Roboto-Regular.ttf.png +0 -0
  470. /package/{dist → lib}/@openglobus/res/fonts/arial.js +0 -0
  471. /package/{dist → lib}/@openglobus/res/fonts/arial.json +0 -0
  472. /package/{dist → lib}/@openglobus/res/fonts/arial.ttf.cfg +0 -0
  473. /package/{dist → lib}/@openglobus/res/fonts/arial.ttf.png +0 -0
  474. /package/{dist → lib}/@openglobus/res/night-4326.png +0 -0
  475. /package/{dist → lib}/@openglobus/res/night.png +0 -0
  476. /package/{dist → lib}/@openglobus/res/spec.png +0 -0
@@ -1,8 +1,7 @@
1
1
  import * as math from "../math";
2
- import {Vec3} from "./Vec3";
3
- import {Mat4} from "./Mat4";
4
- import {Mat3} from "./Mat3";
5
-
2
+ import { Vec3 } from "./Vec3";
3
+ import { Mat4 } from "./Mat4";
4
+ import { Mat3 } from "./Mat3";
6
5
  /**
7
6
  * A set of 4-dimensional coordinates used to represent rotation in 3-dimensional space.
8
7
  * @constructor
@@ -12,87 +11,50 @@ import {Mat3} from "./Mat3";
12
11
  * @param {Number} [w=0.0] The W component.
13
12
  */
14
13
  export class Quat {
15
- /**
16
- * The X component.
17
- * @public
18
- * @type {Number}
19
- * @default 0.0
20
- */
21
- public x: number;
22
-
23
- /**
24
- * The Y component.
25
- * @public
26
- * @type {Number}
27
- * @default 0.0
28
- */
29
- public y: number;
30
-
31
- /**
32
- * The Z component.
33
- * @public
34
- * @type {Number}
35
- * @default 0.0
36
- */
37
- public z: number;
38
-
39
- /**
40
- * The W component.
41
- * @public
42
- * @type {Number}
43
- * @default 0.0
44
- */
45
- public w: number;
46
-
47
- constructor(x: number = 0.0, y: number = 0.0, z: number = 0.0, w: number = 0.0) {
14
+ constructor(x = 0.0, y = 0.0, z = 0.0, w = 0.0) {
48
15
  this.x = x;
49
16
  this.y = y;
50
17
  this.z = z;
51
18
  this.w = w;
52
19
  }
53
-
54
20
  /**
55
21
  * Identity Quat.
56
22
  * @const
57
23
  * @type {Quat}
58
24
  */
59
- static get IDENTITY(): Quat {
25
+ static get IDENTITY() {
60
26
  return new Quat(0.0, 0.0, 0.0, 1.0);
61
27
  }
62
-
63
28
  /**
64
29
  * Returns a Quat represents rotation around X axis.
65
30
  * @static
66
31
  * @param {number} a - The angle in radians to rotate around the axis.
67
32
  * @returns {Quat} -
68
33
  */
69
- static xRotation(a: number): Quat {
34
+ static xRotation(a) {
70
35
  a *= 0.5;
71
36
  return new Quat(Math.sin(a), 0.0, 0.0, Math.cos(a));
72
37
  }
73
-
74
38
  /**
75
39
  * Returns a Quat represents rotation around Y axis.
76
40
  * @static
77
41
  * @param {number} a - The angle in radians to rotate around the axis.
78
42
  * @returns {Quat} -
79
43
  */
80
- static yRotation(a: number): Quat {
44
+ static yRotation(a) {
81
45
  a *= 0.5;
82
46
  return new Quat(0.0, Math.sin(a), 0.0, Math.cos(a));
83
47
  }
84
-
85
48
  /**
86
49
  * Returns a Quat represents rotation around Z axis.
87
50
  * @static
88
51
  * @param {number} a - The angle in radians to rotate around the axis.
89
52
  * @returns {Quat} -
90
53
  */
91
- static zRotation(a: number): Quat {
54
+ static zRotation(a) {
92
55
  a *= 0.5;
93
56
  return new Quat(0.0, 0.0, Math.sin(a), Math.cos(a));
94
57
  }
95
-
96
58
  /**
97
59
  * Computes a Quat representing a rotation around an axis.
98
60
  * @static
@@ -100,13 +62,12 @@ export class Quat {
100
62
  * @param {number} [angle=0.0] The angle in radians to rotate around the axis.
101
63
  * @returns {Quat} -
102
64
  */
103
- static axisAngleToQuat(axis: Vec3, angle: number = 0): Quat {
65
+ static axisAngleToQuat(axis, angle = 0) {
104
66
  let v = axis.getNormal();
105
67
  let half_angle = angle * 0.5;
106
68
  let sin_a = Math.sin(half_angle);
107
69
  return new Quat(v.x * sin_a, v.y * sin_a, v.z * sin_a, Math.cos(half_angle));
108
70
  }
109
-
110
71
  /**
111
72
  * Computes a rotation from the given heading and up vector.
112
73
  * @static
@@ -114,31 +75,26 @@ export class Quat {
114
75
  * @param {Vec3} up - Up vector.
115
76
  * @returns {Quat} -
116
77
  */
117
- static getLookRotation(forward: Vec3, up: Vec3): Quat {
78
+ static getLookRotation(forward, up) {
118
79
  let f = forward.getNormal().negate();
119
80
  let s = up.cross(f).normalize();
120
81
  let u = f.cross(s);
121
82
  let z = 1.0 + s.x + u.y + f.z;
122
-
123
83
  if (z > 0.000001) {
124
84
  let fd = 1.0 / (2.0 * Math.sqrt(z));
125
85
  return new Quat((f.y - u.z) * fd, (s.z - f.x) * fd, (u.x - s.y) * fd, 0.25 / fd);
126
86
  }
127
-
128
87
  if (s.x > u.y && s.x > f.z) {
129
88
  let fd = 1.0 / (2.0 * Math.sqrt(1.0 + s.x - u.y - f.z));
130
89
  return new Quat(0.25 / fd, (u.x + s.y) * fd, (s.z + f.x) * fd, (f.y - u.z) * fd);
131
90
  }
132
-
133
91
  if (u.y > f.z) {
134
92
  let fd = 1.0 / (2.0 * Math.sqrt(1.0 + u.y - s.x - f.z));
135
93
  return new Quat((u.x + s.y) * fd, 0.25 / fd, (f.y + u.z) * fd, (s.z - f.x) * fd);
136
94
  }
137
-
138
95
  let fd = 1.0 / (2.0 * Math.sqrt(1.0 + f.z - s.x - u.y));
139
96
  return new Quat((s.z + f.x) * fd, (f.y + u.z) * fd, 0.25 / fd, (u.x - s.y) * fd);
140
97
  }
141
-
142
98
  /**
143
99
  * Computes a Quat from source point heading to the destination point.
144
100
  * @static
@@ -146,7 +102,7 @@ export class Quat {
146
102
  * @param {Vec3} destPoint - Destination coordinate.
147
103
  * @returns {Quat} -
148
104
  */
149
- static getLookAtSourceDest(sourcePoint: Vec3, destPoint: Vec3): Quat {
105
+ static getLookAtSourceDest(sourcePoint, destPoint) {
150
106
  let forwardVector = destPoint.subA(sourcePoint).normalize();
151
107
  let dot = Vec3.FORWARD.dot(forwardVector);
152
108
  if (Math.abs(dot - -1.0) < 0.000001) {
@@ -159,7 +115,6 @@ export class Quat {
159
115
  let rotAxis = Vec3.FORWARD.cross(forwardVector).normalize();
160
116
  return Quat.axisAngleToQuat(rotAxis, rotAngle);
161
117
  }
162
-
163
118
  /**
164
119
  * Compute rotation between two vectors.
165
120
  * @static
@@ -167,12 +122,11 @@ export class Quat {
167
122
  * @param {Vec3} v - Second vector.
168
123
  * @returns {Quat} -
169
124
  */
170
- static getRotationBetweenVectors(u: Vec3, v: Vec3): Quat {
125
+ static getRotationBetweenVectors(u, v) {
171
126
  let w = u.cross(v);
172
127
  let q = new Quat(w.x, w.y, w.z, 1.0 + u.dot(v));
173
128
  return q.normalize();
174
129
  }
175
-
176
130
  /**
177
131
  * Compute rotation between two vectors.
178
132
  * @static
@@ -181,12 +135,11 @@ export class Quat {
181
135
  * @param {Quat} res
182
136
  * @returns {Quat} -
183
137
  */
184
- static getRotationBetweenVectorsRes(u: Vec3, v: Vec3, res: Quat): Quat {
138
+ static getRotationBetweenVectorsRes(u, v, res) {
185
139
  let w = u.cross(v);
186
140
  res.set(w.x, w.y, w.z, 1.0 + u.dot(v));
187
141
  return res.normalize();
188
142
  }
189
-
190
143
  /**
191
144
  * Compute rotation between two vectors with around vector up
192
145
  * for exactly opposite vectors. If vectors exactly in the same
@@ -197,7 +150,7 @@ export class Quat {
197
150
  * @param {Vec3} up - Up vector.
198
151
  * @returns {Quat} -
199
152
  */
200
- static getRotationBetweenVectorsUp(source: Vec3, dest: Vec3, up: Vec3): Quat {
153
+ static getRotationBetweenVectorsUp(source, dest, up) {
201
154
  let dot = source.dot(dest);
202
155
  if (Math.abs(dot + 1.0) < 0.000001) {
203
156
  // vector source and dest point exactly in the opposite direction,
@@ -213,26 +166,23 @@ export class Quat {
213
166
  let rotAxis = source.cross(dest).normalize();
214
167
  return Quat.axisAngleToQuat(rotAxis, rotAngle);
215
168
  }
216
-
217
169
  /**
218
170
  * Returns true if the components are zero.
219
171
  * @public
220
172
  * @returns {boolean} -
221
173
  */
222
- public isZero(): boolean {
174
+ isZero() {
223
175
  return this.x === 0.0 && this.y === 0.0 && this.z === 0.0 && this.w === 0.0;
224
176
  }
225
-
226
177
  /**
227
178
  * Clear Quat. Sets zeroes.
228
179
  * @public
229
180
  * @returns {Quat} -
230
181
  */
231
- public clear(): Quat {
182
+ clear() {
232
183
  this.x = this.y = this.z = this.w = 0;
233
184
  return this;
234
185
  }
235
-
236
186
  /**
237
187
  * Sets Quat values.
238
188
  * @public
@@ -242,103 +192,94 @@ export class Quat {
242
192
  * @param {Number} [w=0.0] The W component.
243
193
  * @returns {Quat} -
244
194
  */
245
- public set(x: number, y: number, z: number, w: number): Quat {
195
+ set(x, y, z, w) {
246
196
  this.x = x;
247
197
  this.y = y;
248
198
  this.z = z;
249
199
  this.w = w;
250
200
  return this;
251
201
  }
252
-
253
202
  /**
254
203
  * Copy Quat values.
255
204
  * @public
256
205
  * @param {Quat} q - Copy Quat.
257
206
  * @returns {Quat} -
258
207
  */
259
- public copy(q: Quat): Quat {
208
+ copy(q) {
260
209
  this.x = q.x;
261
210
  this.y = q.y;
262
211
  this.z = q.z;
263
212
  this.w = q.w;
264
213
  return this;
265
214
  }
266
-
267
215
  /**
268
216
  * Set current Quat instance to identity Quat.
269
217
  * @public
270
218
  * @returns {Quat} -
271
219
  */
272
- public setIdentity(): Quat {
220
+ setIdentity() {
273
221
  this.x = 0.0;
274
222
  this.y = 0.0;
275
223
  this.z = 0.0;
276
224
  this.w = 1.0;
277
225
  return this;
278
226
  }
279
-
280
227
  /**
281
228
  * Duplicates a Quat instance.
282
229
  * @public
283
230
  * @returns {Quat} -
284
231
  */
285
- public clone(): Quat {
232
+ clone() {
286
233
  return new Quat(this.x, this.y, this.z, this.w);
287
234
  }
288
-
289
235
  /**
290
236
  * Computes the componentwise sum of two Quats.
291
237
  * @public
292
238
  * @param {Quat} q - Quat to add.
293
239
  * @returns {Quat} -
294
240
  */
295
- public add(q: Quat): Quat {
241
+ add(q) {
296
242
  return new Quat(this.x + q.x, this.y + q.y, this.z + q.z, this.w + q.w);
297
243
  }
298
-
299
244
  /**
300
245
  * Computes the componentwise difference of two Quats.
301
246
  * @public
302
247
  * @param {Quat} q - Quat to subtract.
303
248
  * @returns {Quat} -
304
249
  */
305
- public sub(q: Quat): Quat {
250
+ sub(q) {
306
251
  return new Quat(this.x - q.x, this.y - q.y, this.z - q.z, this.w - q.w);
307
252
  }
308
-
309
253
  /**
310
254
  * Multiplies the provided Quat componentwise by the provided scalar.
311
255
  * @public
312
256
  * @param {Number} scale - The scalar to multiply with.
313
257
  * @returns {Quat} -
314
258
  */
315
- public scaleTo(scale: number): Quat {
259
+ scaleTo(scale) {
316
260
  return new Quat(this.x * scale, this.y * scale, this.z * scale, this.w * scale);
317
261
  }
318
-
319
262
  /**
320
263
  * Multiplies the provided Quat componentwise.
321
264
  * @public
322
265
  * @param {Number} scale - The scalar to multiply with.
323
266
  * @returns {Quat} -
324
267
  */
325
- public scale(scale: number): Quat {
268
+ scale(scale) {
326
269
  this.x *= scale;
327
270
  this.y *= scale;
328
271
  this.z *= scale;
329
272
  this.w *= scale;
330
273
  return this;
331
274
  }
332
-
333
275
  /**
334
276
  * Converts Quat values to array.
335
277
  * @public
336
278
  * @returns {Array.<number>} - (exactly 4 entries)
337
279
  */
338
- public toVec(): [number, number, number, number] {
280
+ toVec() {
339
281
  return [this.x, this.y, this.z, this.w];
340
282
  }
341
-
342
283
  /**
343
284
  * Sets current quaternion by spherical coordinates.
344
285
  * @public
@@ -347,22 +288,19 @@ export class Quat {
347
288
  * @param {number} angle - Angle in radians.
348
289
  * @returns {Quat} -
349
290
  */
350
- public setFromSphericalCoords(lat: number, lon: number, angle: number): Quat {
291
+ setFromSphericalCoords(lat, lon, angle) {
351
292
  let sin_a = Math.sin(angle / 2);
352
293
  let cos_a = Math.cos(angle / 2);
353
294
  let sin_lat = Math.sin(lat);
354
295
  let cos_lat = Math.cos(lat);
355
296
  let sin_long = Math.sin(lon);
356
297
  let cos_long = Math.cos(lon);
357
-
358
298
  this.x = sin_a * cos_lat * sin_long;
359
299
  this.y = sin_a * sin_lat;
360
300
  this.z = sin_a * sin_lat * cos_long;
361
301
  this.w = cos_a;
362
-
363
302
  return this;
364
303
  }
365
-
366
304
  /**
367
305
  * Sets rotation with the given heading and up vectors.
368
306
  * @static
@@ -370,79 +308,72 @@ export class Quat {
370
308
  * @param {Vec3} up - Up vector.
371
309
  * @returns {Quat} -
372
310
  */
373
- public setLookRotation(forward: Vec3, up: Vec3): Quat {
311
+ setLookRotation(forward, up) {
374
312
  let f = forward.getNormal().negate();
375
313
  let s = up.cross(f).normalize();
376
314
  let u = f.cross(s);
377
315
  let z = 1.0 + s.x + u.y + f.z;
378
-
379
316
  if (z > 0.000001) {
380
317
  let fd = 1.0 / (2.0 * Math.sqrt(z));
381
318
  this.x = (f.y - u.z) * fd;
382
319
  this.y = (s.z - f.x) * fd;
383
320
  this.z = (u.x - s.y) * fd;
384
321
  this.w = 0.25 / fd;
385
- } else if (s.x > u.y && s.x > f.z) {
322
+ }
323
+ else if (s.x > u.y && s.x > f.z) {
386
324
  let fd = 1.0 / (2.0 * Math.sqrt(1.0 + s.x - u.y - f.z));
387
325
  this.x = 0.25 / fd;
388
326
  this.y = (u.x + s.y) * fd;
389
327
  this.z = (s.z + f.x) * fd;
390
328
  this.w = (f.y - u.z) * fd;
391
- } else if (u.y > f.z) {
329
+ }
330
+ else if (u.y > f.z) {
392
331
  let fd = 1.0 / (2.0 * Math.sqrt(1.0 + u.y - s.x - f.z));
393
332
  this.x = (u.x + s.y) * fd;
394
333
  this.y = 0.25 / fd;
395
334
  this.z = (f.y + u.z) * fd;
396
335
  this.w = (s.z - f.x) * fd;
397
- } else {
336
+ }
337
+ else {
398
338
  let fd = 1.0 / (2.0 * Math.sqrt(1.0 + f.z - s.x - u.y));
399
339
  this.x = (s.z + f.x) * fd;
400
340
  this.y = (f.y + u.z) * fd;
401
341
  this.z = 0.25 / fd;
402
342
  this.w = (u.x - s.y) * fd;
403
343
  }
404
-
405
344
  return this;
406
345
  }
407
-
408
346
  /**
409
347
  * Gets spherical coordinates.
410
348
  * @public
411
349
  * @returns {Object} Returns object with latitude, longitude and alpha.
412
350
  */
413
- public toSphericalCoords(): any {
414
-
351
+ toSphericalCoords() {
415
352
  let cos_a = this.w;
416
353
  let sin_a = Math.sqrt(1.0 - cos_a * cos_a);
417
-
418
354
  // var angle = Math.acos(cos_a) * 2;
419
355
  if (Math.abs(sin_a) < 0.0005) {
420
356
  sin_a = 1;
421
357
  }
422
-
423
358
  let tx = this.x / sin_a;
424
359
  let ty = this.y / sin_a;
425
360
  let tz = this.z / sin_a;
426
-
427
361
  let lon, lat = -Math.asin(ty);
428
-
429
362
  if (tx * tx + tz * tz < 0.0005) {
430
363
  lon = 0;
431
- } else {
364
+ }
365
+ else {
432
366
  lon = Math.atan2(tx, tz);
433
367
  }
434
-
435
368
  if (lon < 0) {
436
369
  lon += 360.0;
437
370
  }
438
-
439
371
  return {
440
372
  lat: lat,
441
373
  lon: lon,
442
374
  alpha: Math.acos(cos_a)
443
375
  };
444
376
  }
445
-
446
377
  /**
447
378
  * Sets current Quat representing a rotation around an axis.
448
379
  * @public
@@ -450,24 +381,20 @@ export class Quat {
450
381
  * @param {number} angle The angle in radians to rotate around the axis.
451
382
  * @returns {Quat} -
452
383
  */
453
- public setFromAxisAngle(axis: Vec3, angle: number): Quat {
384
+ setFromAxisAngle(axis, angle) {
454
385
  let v = axis.getNormal();
455
386
  let half_angle = angle * 0.5;
456
387
  let sin_a = Math.sin(half_angle);
457
388
  this.set(v.x * sin_a, v.y * sin_a, v.z * sin_a, Math.cos(half_angle));
458
389
  return this;
459
390
  }
460
-
461
391
  /**
462
392
  * Returns axis and angle of the current Quat.
463
393
  * @public
464
394
  * @returns {Object} -
465
395
  */
466
- public getAxisAngle(): any {
467
- let x = this.x,
468
- y = this.y,
469
- z = this.z,
470
- w = this.w;
396
+ getAxisAngle() {
397
+ let x = this.x, y = this.y, z = this.z, w = this.w;
471
398
  let vl = Math.sqrt(x * x + y * y + z * z);
472
399
  let axis, angle;
473
400
  if (vl > 0.0000001) {
@@ -475,20 +402,20 @@ export class Quat {
475
402
  axis = new Vec3(x * ivl, y * ivl, z * ivl);
476
403
  if (w < 0) {
477
404
  angle = 2.0 * Math.atan2(-vl, -w); // -PI,0
478
- } else {
405
+ }
406
+ else {
479
407
  angle = 2.0 * Math.atan2(vl, w); // 0,PI
480
408
  }
481
- } else {
409
+ }
410
+ else {
482
411
  axis = new Vec3(0, 0, 0);
483
412
  angle = 0;
484
413
  }
485
-
486
414
  return {
487
415
  axis: axis,
488
416
  angle: angle
489
417
  };
490
418
  }
491
-
492
419
  /**
493
420
  * Sets current Quat by Euler's angles.
494
421
  * @public
@@ -497,80 +424,53 @@ export class Quat {
497
424
  * @param {number} roll - Roll angle in degrees.
498
425
  * @returns {Quat} -
499
426
  */
500
- public setFromEulerAngles(pitch: number, yaw: number, roll: number): Quat {
501
- let ex = pitch * math.RADIANS_HALF,
502
- ey = yaw * math.RADIANS_HALF,
503
- ez = roll * math.RADIANS_HALF;
504
-
505
- let cr = Math.cos(ex),
506
- cp = Math.cos(ey),
507
- cy = Math.cos(ez);
508
-
509
- let sr = Math.sin(ex),
510
- sp = Math.sin(ey),
511
- sy = Math.sin(ez);
512
-
513
- let cpcy = cp * cy,
514
- spsy = sp * sy;
515
-
427
+ setFromEulerAngles(pitch, yaw, roll) {
428
+ let ex = pitch * math.RADIANS_HALF, ey = yaw * math.RADIANS_HALF, ez = roll * math.RADIANS_HALF;
429
+ let cr = Math.cos(ex), cp = Math.cos(ey), cy = Math.cos(ez);
430
+ let sr = Math.sin(ex), sp = Math.sin(ey), sy = Math.sin(ez);
431
+ let cpcy = cp * cy, spsy = sp * sy;
516
432
  this.w = cr * cpcy + sr * spsy;
517
433
  this.x = sr * cpcy - cr * spsy;
518
434
  this.y = cr * sp * cy + sr * cp * sy;
519
435
  this.z = cr * cp * sy - sr * sp * cy;
520
-
521
436
  return this.normalize();
522
437
  }
523
-
524
438
  /**
525
439
  * Returns Euler's angles of the current Quat.
526
440
  * @public
527
441
  * @returns {Object} -
528
442
  */
529
- public getEulerAngles(): any {
530
- let x = this.x,
531
- y = this.y,
532
- z = this.z,
533
- w = this.w;
534
-
443
+ getEulerAngles() {
444
+ let x = this.x, y = this.y, z = this.z, w = this.w;
535
445
  let sqy = y * y;
536
-
537
446
  let roll = Math.atan2(2.0 * (w * x + y * z), 1.0 - 2.0 * (x * x + sqy));
538
-
539
447
  let a = w * y - z * x;
540
-
541
448
  if (a < -1.0) {
542
449
  a = -1.0;
543
- } else if (a > 1.0) {
450
+ }
451
+ else if (a > 1.0) {
544
452
  a = 1.0;
545
453
  }
546
454
  let pitch = Math.asin(2.0 * a);
547
-
548
455
  let yaw = Math.atan2(2.0 * (w * z + x * y), 1.0 - 2.0 * (sqy + z * z));
549
-
550
456
  return {
551
457
  roll,
552
458
  pitch,
553
459
  yaw
554
460
  };
555
461
  }
556
-
557
462
  /**
558
463
  * Computes a Quat from the provided 4x4 matrix instance.
559
464
  * @public
560
465
  * @param {Mat4} mx - The rotation matrix.
561
466
  * @returns {Quat} -
562
467
  */
563
- public setFromMatrix4(mx: Mat4): Quat {
564
- let tr,
565
- s,
566
- q = [];
468
+ setFromMatrix4(mx) {
469
+ let tr, s, q = [];
567
470
  let i, j, k;
568
471
  let m = mx._m;
569
-
570
472
  let nxt = [1, 2, 0];
571
-
572
473
  tr = m[0] + m[5] + m[10];
573
-
574
474
  if (tr > 0.0) {
575
475
  s = Math.sqrt(tr + 1.0);
576
476
  this.w = s / 2.0;
@@ -578,23 +478,22 @@ export class Quat {
578
478
  this.x = (m[6] - m[9]) * s;
579
479
  this.y = (m[8] - m[2]) * s;
580
480
  this.z = (m[1] - m[4]) * s;
581
- } else {
481
+ }
482
+ else {
582
483
  i = 0;
583
- if (m[5] > m[0]) i = 1;
584
- if (m[10] > m[i * 5]) i = 2;
484
+ if (m[5] > m[0])
485
+ i = 1;
486
+ if (m[10] > m[i * 5])
487
+ i = 2;
585
488
  j = nxt[i];
586
489
  k = nxt[j];
587
-
588
490
  s = Math.sqrt(m[i * 5] - (m[j * 5] + m[k * 5]) + 1.0);
589
-
590
491
  q[i] = s * 0.5;
591
-
592
- if (s !== 0.0) s = 0.5 / s;
593
-
492
+ if (s !== 0.0)
493
+ s = 0.5 / s;
594
494
  q[3] = (m[j * 4 + k] - m[k * 4 + j]) * s;
595
495
  q[j] = (m[i * 4 + j] + m[j * 4 + i]) * s;
596
496
  q[k] = (m[i * 4 + k] + m[k * 4 + i]) * s;
597
-
598
497
  this.x = q[0];
599
498
  this.y = q[1];
600
499
  this.z = q[2];
@@ -602,14 +501,13 @@ export class Quat {
602
501
  }
603
502
  return this;
604
503
  }
605
-
606
504
  /**
607
505
  * Converts current Quat to the rotation 4x4 matrix.
608
506
  * @public
609
507
  * @params {Mat4} [out] - Output matrix
610
508
  * @returns {Mat4} -
611
509
  */
612
- public getMat4(out: Mat4 = new Mat4()): Mat4 {
510
+ getMat4(out = new Mat4()) {
613
511
  let xs = this.x + this.x;
614
512
  let ys = this.y + this.y;
615
513
  let zs = this.z + this.z;
@@ -622,7 +520,6 @@ export class Quat {
622
520
  let yy = this.y * ys;
623
521
  let yz = this.y * zs;
624
522
  let zz = this.z * zs;
625
-
626
523
  return out.set([
627
524
  1 - (yy + zz), xy - wz, xz + wy, 0,
628
525
  xy + wz, 1 - (xx + zz), yz - wx, 0,
@@ -630,36 +527,23 @@ export class Quat {
630
527
  0, 0, 0, 1
631
528
  ]);
632
529
  }
633
-
634
530
  /**
635
531
  * Converts current Quat to the rotation 3x3 matrix.
636
532
  * @public
637
533
  * @returns {Mat3} -
638
534
  * @todo NOT TESTED
639
535
  */
640
- public getMat3(): Mat3 {
536
+ getMat3() {
641
537
  let m = new Mat3();
642
538
  let mx = m._m;
643
- let c = this.x,
644
- d = this.y,
645
- e = this.z,
646
- g = this.w,
647
- f = c + c,
648
- h = d + d,
649
- i = e + e,
650
- j = c * f,
651
- k = c * h;
652
-
539
+ let c = this.x, d = this.y, e = this.z, g = this.w, f = c + c, h = d + d, i = e + e, j = c * f, k = c * h;
653
540
  c = c * i;
654
-
655
541
  let l = d * h;
656
-
657
542
  d = d * i;
658
543
  e = e * i;
659
544
  f = g * f;
660
545
  h = g * h;
661
546
  g = g * i;
662
-
663
547
  mx[0] = 1 - (l + e);
664
548
  mx[1] = k - g;
665
549
  mx[2] = c + h;
@@ -669,160 +553,100 @@ export class Quat {
669
553
  mx[6] = c - h;
670
554
  mx[7] = d + f;
671
555
  mx[8] = 1 - (j + l);
672
-
673
556
  return m;
674
557
  }
675
-
676
558
  /**
677
559
  * Returns quaternion and vector production.
678
560
  * @public
679
561
  * @param {Vec3} v - 3d Vector.
680
562
  * @returns {Vec3} -
681
563
  */
682
- public mulVec3(v: Vec3): Vec3 {
564
+ mulVec3(v) {
683
565
  // t = 2 * cross(q.xyz, v)
684
566
  // v' = v + q.w * t + cross(q.xyz, t)
685
-
686
- let d = v.x,
687
- e = v.y,
688
- g = v.z;
689
-
690
- let b = this.x,
691
- f = this.y,
692
- h = this.z,
693
- a = this.w;
694
-
695
- let i = a * d + f * g - h * e,
696
- j = a * e + h * d - b * g,
697
- k = a * g + b * e - f * d;
698
-
567
+ let d = v.x, e = v.y, g = v.z;
568
+ let b = this.x, f = this.y, h = this.z, a = this.w;
569
+ let i = a * d + f * g - h * e, j = a * e + h * d - b * g, k = a * g + b * e - f * d;
699
570
  d = -b * d - f * e - h * g;
700
-
701
- return new Vec3(
702
- i * a + d * -b + j * -h - k * -f,
703
- j * a + d * -f + k * -b - i * -h,
704
- k * a + d * -h + i * -f - j * -b
705
- );
571
+ return new Vec3(i * a + d * -b + j * -h - k * -f, j * a + d * -f + k * -b - i * -h, k * a + d * -h + i * -f - j * -b);
706
572
  }
707
-
708
573
  /**
709
574
  * Computes the product of two Quats.
710
575
  * @public
711
576
  * @param {Quat} q - Quat to multiply.
712
577
  * @returns {Quat} -
713
578
  */
714
- public mul(q: Quat): Quat {
715
- let d = this.x,
716
- e = this.y,
717
- g = this.z,
718
- a = this.w;
719
-
720
- let f = q.x,
721
- h = q.y,
722
- i = q.z,
723
- b = q.w;
724
-
725
- return new Quat(
726
- d * b + a * f + e * i - g * h,
727
- e * b + a * h + g * f - d * i,
728
- g * b + a * i + d * h - e * f,
729
- a * b - d * f - e * h - g * i
730
- );
731
- }
732
-
579
+ mul(q) {
580
+ let d = this.x, e = this.y, g = this.z, a = this.w;
581
+ let f = q.x, h = q.y, i = q.z, b = q.w;
582
+ return new Quat(d * b + a * f + e * i - g * h, e * b + a * h + g * f - d * i, g * b + a * i + d * h - e * f, a * b - d * f - e * h - g * i);
583
+ }
733
584
  /**
734
585
  * Computes the product of two Quats.
735
586
  * @public
736
587
  * @param {Quat} q - Quat to multiply.
737
588
  * @returns {Quat} -
738
589
  */
739
- public mulA(q: Quat): Quat {
740
- let d = this.x,
741
- e = this.y,
742
- g = this.z,
743
- a = this.w;
744
-
745
- let f = q.x,
746
- h = q.y,
747
- i = q.z,
748
- b = q.w;
749
-
590
+ mulA(q) {
591
+ let d = this.x, e = this.y, g = this.z, a = this.w;
592
+ let f = q.x, h = q.y, i = q.z, b = q.w;
750
593
  this.x = d * b + a * f + e * i - g * h;
751
594
  this.y = e * b + a * h + g * f - d * i;
752
595
  this.z = g * b + a * i + d * h - e * f;
753
596
  this.w = a * b - d * f - e * h - g * i;
754
-
755
597
  return this;
756
598
  }
757
-
758
599
  /**
759
600
  * Gets the conjugate of the Quat.
760
601
  * @public
761
602
  * @returns {Quat} -
762
603
  */
763
- public conjugate(): Quat {
604
+ conjugate() {
764
605
  return new Quat(-this.x, -this.y, -this.z, this.w);
765
606
  }
766
-
767
607
  /**
768
608
  * Computes the inverse of the Quat.
769
609
  * @public
770
610
  * @returns {Quat} -
771
611
  */
772
- public inverse(): Quat {
612
+ inverse() {
773
613
  let n = 1.0 / this.magnitude2();
774
614
  return new Quat(-this.x * n, -this.y * n, -this.z * n, this.w * n);
775
615
  }
776
-
777
616
  /**
778
617
  * Computes a magnitude of the Quat.
779
618
  * @public
780
619
  * @returns {number} -
781
620
  */
782
- public magnitude(): number {
783
- let b = this.x,
784
- c = this.y,
785
- d = this.z,
786
- a = this.w;
621
+ magnitude() {
622
+ let b = this.x, c = this.y, d = this.z, a = this.w;
787
623
  return Math.sqrt(b * b + c * c + d * d + a * a);
788
624
  }
789
-
790
625
  /**
791
626
  * Computes a squared magnitude of the Quat.
792
627
  * @public
793
628
  * @returns {number} -
794
629
  */
795
- public magnitude2(): number {
796
- let b = this.x,
797
- c = this.y,
798
- d = this.z,
799
- a = this.w;
630
+ magnitude2() {
631
+ let b = this.x, c = this.y, d = this.z, a = this.w;
800
632
  return b * b + c * c + d * d + a * a;
801
633
  }
802
-
803
634
  /**
804
635
  * Computes the dot (scalar) product of two Quats.
805
636
  * @public
806
637
  * @param {Quat} q - Second quaternion.
807
638
  * @returns {number} -
808
639
  */
809
- public dot(q: Quat): number {
640
+ dot(q) {
810
641
  return this.x * q.x + this.y * q.y + this.z * q.z;
811
642
  }
812
-
813
643
  /**
814
644
  * Current Quat normalization.
815
645
  * @public
816
646
  * @returns {Quat} -
817
647
  */
818
- public normalize(): Quat {
819
-
820
- let c = this.x,
821
- d = this.y,
822
- e = this.z,
823
- g = this.w,
824
- f = Math.sqrt(c * c + d * d + e * e + g * g);
825
-
648
+ normalize() {
649
+ let c = this.x, d = this.y, e = this.z, g = this.w, f = Math.sqrt(c * c + d * d + e * e + g * g);
826
650
  if (f === 0.0) {
827
651
  this.x = 0;
828
652
  this.y = 0;
@@ -830,30 +654,26 @@ export class Quat {
830
654
  this.w = 0;
831
655
  return this;
832
656
  }
833
-
834
657
  f = 1 / f;
835
658
  this.x = c * f;
836
659
  this.y = d * f;
837
660
  this.z = e * f;
838
661
  this.w = g * f;
839
-
840
662
  return this;
841
663
  }
842
-
843
664
  /**
844
665
  * Compares two Quats.
845
666
  * @public
846
667
  * @param {Quat} q - Second quaternion.
847
668
  * @returns {Boolean} -
848
669
  */
849
- public isEqual(q: Quat): boolean {
670
+ isEqual(q) {
850
671
  let matching = this.dot(q);
851
672
  if (Math.abs(matching - 1.0) < 0.001) {
852
673
  return true;
853
674
  }
854
675
  return false;
855
676
  }
856
-
857
677
  /**
858
678
  * Performs a spherical linear interpolation between two Quats.
859
679
  * @public
@@ -861,21 +681,10 @@ export class Quat {
861
681
  * @param {number} t - interpolation amount between the two Quats.
862
682
  * @returns {Quat} -
863
683
  */
864
- public slerp(b: Quat, t: number): Quat {
865
-
866
- let ax = this.x,
867
- ay = this.y,
868
- az = this.z,
869
- aw = this.w,
870
- bx = b.x,
871
- by = b.y,
872
- bz = b.z,
873
- bw = b.w;
874
-
684
+ slerp(b, t) {
685
+ let ax = this.x, ay = this.y, az = this.z, aw = this.w, bx = b.x, by = b.y, bz = b.z, bw = b.w;
875
686
  let omega, cosom, sinom, scale0, scale1;
876
-
877
687
  cosom = ax * bx + ay * by + az * bz + aw * bw;
878
-
879
688
  if (cosom < 0.0) {
880
689
  cosom = -cosom;
881
690
  bx = -bx;
@@ -883,38 +692,26 @@ export class Quat {
883
692
  bz = -bz;
884
693
  bw = -bw;
885
694
  }
886
-
887
695
  if (1.0 - cosom > 0.000001) {
888
696
  omega = Math.acos(cosom);
889
697
  sinom = Math.sin(omega);
890
698
  scale0 = Math.sin((1.0 - t) * omega) / sinom;
891
699
  scale1 = Math.sin(t * omega) / sinom;
892
- } else {
700
+ }
701
+ else {
893
702
  scale0 = 1.0 - t;
894
703
  scale1 = t;
895
704
  }
896
-
897
- return new Quat(
898
- scale0 * ax + scale1 * bx,
899
- scale0 * ay + scale1 * by,
900
- scale0 * az + scale1 * bz,
901
- scale0 * aw + scale1 * bw
902
- );
705
+ return new Quat(scale0 * ax + scale1 * bx, scale0 * ay + scale1 * by, scale0 * az + scale1 * bz, scale0 * aw + scale1 * bw);
903
706
  }
904
-
905
707
  /**
906
708
  * Returns a roll angle in radians.
907
709
  * @public
908
710
  * @param {Boolean} [reprojectAxis] -
909
711
  * @returns {Number} -
910
712
  */
911
- public getRoll(reprojectAxis: boolean = false): number {
912
-
913
- let x = this.x,
914
- y = this.y,
915
- z = this.z,
916
- w = this.w;
917
-
713
+ getRoll(reprojectAxis = false) {
714
+ let x = this.x, y = this.y, z = this.z, w = this.w;
918
715
  if (reprojectAxis) {
919
716
  let fTy = 2.0 * y;
920
717
  let fTz = 2.0 * z;
@@ -923,24 +720,19 @@ export class Quat {
923
720
  let fTyy = fTy * y;
924
721
  let fTzz = fTz * z;
925
722
  return Math.atan2(fTxy + fTwz, 1.0 - (fTyy + fTzz));
926
- } else {
723
+ }
724
+ else {
927
725
  return Math.atan2(2 * (x * y + w * z), w * w + x * x - y * y - z * z);
928
726
  }
929
727
  }
930
-
931
728
  /**
932
729
  * Returns a pitch angle in radians.
933
730
  * @public
934
731
  * @param {Boolean} [reprojectAxis] -
935
732
  * @returns {number} -
936
733
  */
937
- public getPitch(reprojectAxis: boolean = false): number {
938
-
939
- let x = this.x,
940
- y = this.y,
941
- z = this.z,
942
- w = this.w;
943
-
734
+ getPitch(reprojectAxis = false) {
735
+ let x = this.x, y = this.y, z = this.z, w = this.w;
944
736
  if (reprojectAxis) {
945
737
  let fTx = 2.0 * x;
946
738
  let fTz = 2.0 * z;
@@ -949,24 +741,19 @@ export class Quat {
949
741
  let fTyz = fTz * y;
950
742
  let fTzz = fTz * z;
951
743
  return Math.atan2(fTyz + fTwx, 1.0 - (fTxx + fTzz));
952
- } else {
744
+ }
745
+ else {
953
746
  return Math.atan2(2 * (y * z + w * x), w * w - x * x - y * y + z * z);
954
747
  }
955
748
  }
956
-
957
749
  /**
958
750
  * Returns a yaw angle in radians.
959
751
  * @public
960
752
  * @param {Boolean} [reprojectAxis] -
961
753
  * @returns {number} -
962
754
  */
963
- public getYaw(reprojectAxis: boolean = false): number {
964
-
965
- let x = this.x,
966
- y = this.y,
967
- z = this.z,
968
- w = this.w;
969
-
755
+ getYaw(reprojectAxis = false) {
756
+ let x = this.x, y = this.y, z = this.z, w = this.w;
970
757
  if (reprojectAxis) {
971
758
  let fTx = 2.0 * x;
972
759
  let fTy = 2.0 * y;
@@ -976,12 +763,12 @@ export class Quat {
976
763
  let fTxz = fTz * x;
977
764
  let fTyy = fTy * y;
978
765
  return Math.atan2(fTxz + fTwy, 1.0 - (fTxx + fTyy));
979
- } else {
766
+ }
767
+ else {
980
768
  return Math.asin(-2 * (x * z - w * y));
981
769
  }
982
770
  }
983
771
  }
984
-
985
772
  /**
986
773
  * Creates Quat instance.
987
774
  * @function
@@ -991,6 +778,6 @@ export class Quat {
991
778
  * @param {Number} [w=0.0] The W component.
992
779
  * @returns {Quat} -
993
780
  */
994
- export function quat(x: number = 0, y: number = 0, z: number = 0, w: number = 0): Quat {
781
+ export function quat(x = 0, y = 0, z = 0, w = 0) {
995
782
  return new Quat(x, y, z, w);
996
783
  }