@cesium/engine 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1731) hide show
  1. package/Build/ThirdParty/Workers/basis_transcoder.js +2233 -0
  2. package/Build/ThirdParty/Workers/draco_decoder_nodejs.js +1872 -0
  3. package/Build/ThirdParty/Workers/package.json +1 -0
  4. package/Build/ThirdParty/Workers/pako_deflate.min.js +589 -0
  5. package/Build/ThirdParty/Workers/pako_inflate.min.js +798 -0
  6. package/Build/ThirdParty/Workers/z-worker-pako.js +503 -0
  7. package/Build/ThirdParty/basis_transcoder.wasm +0 -0
  8. package/Build/ThirdParty/draco_decoder.wasm +0 -0
  9. package/Build/ThirdParty/google-earth-dbroot-parser.js +8019 -0
  10. package/Build/Widget/CesiumWidget.css +120 -0
  11. package/Build/Widget/lighter.css +13 -0
  12. package/Build/Workers/ArcType-ce2e50ab.js +37 -0
  13. package/Build/Workers/AttributeCompression-4589338a.js +716 -0
  14. package/Build/Workers/AxisAlignedBoundingBox-bfb1234f.js +258 -0
  15. package/Build/Workers/BoundingRectangle-7ffc2153.js +369 -0
  16. package/Build/Workers/BoxGeometry-93f344a3.js +884 -0
  17. package/Build/Workers/Check-666ab1a0.js +290 -0
  18. package/Build/Workers/Color-0c5aaf47.js +2262 -0
  19. package/Build/Workers/ComponentDatatype-f7b11d02.js +341 -0
  20. package/Build/Workers/CoplanarPolygonGeometryLibrary-6597982a.js +132 -0
  21. package/Build/Workers/CorridorGeometryLibrary-2119580e.js +498 -0
  22. package/Build/Workers/CylinderGeometry-f9503c6d.js +467 -0
  23. package/Build/Workers/CylinderGeometryLibrary-372c07d8.js +63 -0
  24. package/Build/Workers/EllipseGeometry-fedf72d5.js +1304 -0
  25. package/Build/Workers/EllipseGeometryLibrary-4ea68687.js +366 -0
  26. package/Build/Workers/EllipseOutlineGeometry-e2ae6a35.js +443 -0
  27. package/Build/Workers/EllipsoidGeodesic-16de63ea.js +520 -0
  28. package/Build/Workers/EllipsoidGeometry-95c0330e.js +637 -0
  29. package/Build/Workers/EllipsoidOutlineGeometry-d6d2ceec.js +454 -0
  30. package/Build/Workers/EllipsoidRhumbLine-ae5e65e0.js +741 -0
  31. package/Build/Workers/EllipsoidTangentPlane-bfc674bf.js +373 -0
  32. package/Build/Workers/EncodedCartesian3-f473ea18.js +171 -0
  33. package/Build/Workers/FrustumGeometry-3bf2e4eb.js +2512 -0
  34. package/Build/Workers/GeometryAttribute-df5f473e.js +619 -0
  35. package/Build/Workers/GeometryAttributes-f06a2792.js +91 -0
  36. package/Build/Workers/GeometryInstance-aa75b4cf.js +121 -0
  37. package/Build/Workers/GeometryOffsetAttribute-04332ce7.js +16 -0
  38. package/Build/Workers/GeometryPipeline-f0e46c42.js +3690 -0
  39. package/Build/Workers/IndexDatatype-a55ceaa1.js +200 -0
  40. package/Build/Workers/IntersectionTests-9de29d51.js +1836 -0
  41. package/Build/Workers/Math-2dbd6b93.js +1330 -0
  42. package/Build/Workers/Matrix2-ce637455.js +7084 -0
  43. package/Build/Workers/Matrix3-4f4df527.js +4282 -0
  44. package/Build/Workers/OrientedBoundingBox-d3ff3d4d.js +1257 -0
  45. package/Build/Workers/Plane-b81241c2.js +309 -0
  46. package/Build/Workers/PolygonGeometryLibrary-6f4937bb.js +1074 -0
  47. package/Build/Workers/PolygonPipeline-774a8aaf.js +1341 -0
  48. package/Build/Workers/PolylinePipeline-2e2b015c.js +573 -0
  49. package/Build/Workers/PolylineVolumeGeometryLibrary-7ee1d449.js +781 -0
  50. package/Build/Workers/PrimitivePipeline-a9b7aae0.js +966 -0
  51. package/Build/Workers/RectangleGeometryLibrary-9aa6c8f6.js +280 -0
  52. package/Build/Workers/RuntimeError-06c93819.js +68 -0
  53. package/Build/Workers/TerrainEncoding-b52dcfc5.js +1227 -0
  54. package/Build/Workers/Transforms-2f755df8.js +14683 -0
  55. package/Build/Workers/VertexFormat-6b480673.js +312 -0
  56. package/Build/Workers/WallGeometryLibrary-ab19a93d.js +211 -0
  57. package/Build/Workers/WebGLConstants-a8cc3e8c.js +620 -0
  58. package/Build/Workers/WebMercatorProjection-9f25de49.js +151 -0
  59. package/Build/Workers/arrayRemoveDuplicates-c2038105.js +129 -0
  60. package/Build/Workers/cesiumWorkerBootstrapper.js +1273 -0
  61. package/Build/Workers/combine-ca22a614.js +82 -0
  62. package/Build/Workers/combineGeometry.js +17 -0
  63. package/Build/Workers/createBoxGeometry.js +12 -0
  64. package/Build/Workers/createBoxOutlineGeometry.js +313 -0
  65. package/Build/Workers/createCircleGeometry.js +213 -0
  66. package/Build/Workers/createCircleOutlineGeometry.js +160 -0
  67. package/Build/Workers/createCoplanarPolygonGeometry.js +586 -0
  68. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +236 -0
  69. package/Build/Workers/createCorridorGeometry.js +1407 -0
  70. package/Build/Workers/createCorridorOutlineGeometry.js +603 -0
  71. package/Build/Workers/createCylinderGeometry.js +12 -0
  72. package/Build/Workers/createCylinderOutlineGeometry.js +265 -0
  73. package/Build/Workers/createEllipseGeometry.js +14 -0
  74. package/Build/Workers/createEllipseOutlineGeometry.js +14 -0
  75. package/Build/Workers/createEllipsoidGeometry.js +12 -0
  76. package/Build/Workers/createEllipsoidOutlineGeometry.js +15 -0
  77. package/Build/Workers/createFrustumGeometry.js +12 -0
  78. package/Build/Workers/createFrustumOutlineGeometry.js +251 -0
  79. package/Build/Workers/createGeometry.js +55 -0
  80. package/Build/Workers/createGroundPolylineGeometry.js +2134 -0
  81. package/Build/Workers/createPlaneGeometry.js +250 -0
  82. package/Build/Workers/createPlaneOutlineGeometry.js +115 -0
  83. package/Build/Workers/createPolygonGeometry.js +1420 -0
  84. package/Build/Workers/createPolygonOutlineGeometry.js +683 -0
  85. package/Build/Workers/createPolylineGeometry.js +571 -0
  86. package/Build/Workers/createPolylineVolumeGeometry.js +411 -0
  87. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +301 -0
  88. package/Build/Workers/createRectangleGeometry.js +1476 -0
  89. package/Build/Workers/createRectangleOutlineGeometry.js +535 -0
  90. package/Build/Workers/createSimplePolylineGeometry.js +458 -0
  91. package/Build/Workers/createSphereGeometry.js +123 -0
  92. package/Build/Workers/createSphereOutlineGeometry.js +126 -0
  93. package/Build/Workers/createTaskProcessorWorker.js +127 -0
  94. package/Build/Workers/createVectorTileClampedPolylines.js +535 -0
  95. package/Build/Workers/createVectorTileGeometries.js +445 -0
  96. package/Build/Workers/createVectorTilePoints.js +79 -0
  97. package/Build/Workers/createVectorTilePolygons.js +406 -0
  98. package/Build/Workers/createVectorTilePolylines.js +254 -0
  99. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +640 -0
  100. package/Build/Workers/createVerticesFromHeightmap.js +2707 -0
  101. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +994 -0
  102. package/Build/Workers/createWallGeometry.js +623 -0
  103. package/Build/Workers/createWallOutlineGeometry.js +432 -0
  104. package/Build/Workers/decodeDraco.js +381 -0
  105. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +3668 -0
  106. package/Build/Workers/decodeI3S.js +1040 -0
  107. package/Build/Workers/defaultValue-0a909f67.js +51 -0
  108. package/Build/Workers/package.js +2 -0
  109. package/Build/Workers/transcodeKTX2.js +1516 -0
  110. package/Build/Workers/transferTypedArrayTest.js +18 -0
  111. package/Build/Workers/upsampleQuantizedTerrainMesh.js +1023 -0
  112. package/LICENSE.md +933 -0
  113. package/README.md +58 -0
  114. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
  115. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
  116. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
  117. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
  118. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
  119. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
  120. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
  121. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
  122. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
  123. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
  124. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
  125. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
  126. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
  127. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
  128. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
  129. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
  130. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
  131. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
  132. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
  133. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
  134. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
  135. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
  136. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
  137. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
  138. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
  139. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
  140. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
  141. package/Source/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
  142. package/Source/Assets/Images/bing_maps_credit.png +0 -0
  143. package/Source/Assets/Images/cesium_credit.png +0 -0
  144. package/Source/Assets/Images/google_earth_credit.png +0 -0
  145. package/Source/Assets/Images/ion-credit.png +0 -0
  146. package/Source/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
  147. package/Source/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
  148. package/Source/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
  149. package/Source/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
  150. package/Source/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
  151. package/Source/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
  152. package/Source/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
  153. package/Source/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
  154. package/Source/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
  155. package/Source/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
  156. package/Source/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
  157. package/Source/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
  158. package/Source/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
  159. package/Source/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
  160. package/Source/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
  161. package/Source/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
  162. package/Source/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
  163. package/Source/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
  164. package/Source/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
  165. package/Source/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
  166. package/Source/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
  167. package/Source/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
  168. package/Source/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
  169. package/Source/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
  170. package/Source/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
  171. package/Source/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
  172. package/Source/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
  173. package/Source/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
  174. package/Source/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
  175. package/Source/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
  176. package/Source/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
  177. package/Source/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
  178. package/Source/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
  179. package/Source/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
  180. package/Source/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
  181. package/Source/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
  182. package/Source/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
  183. package/Source/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
  184. package/Source/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
  185. package/Source/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
  186. package/Source/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
  187. package/Source/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
  188. package/Source/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
  189. package/Source/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
  190. package/Source/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
  191. package/Source/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
  192. package/Source/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
  193. package/Source/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
  194. package/Source/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
  195. package/Source/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
  196. package/Source/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
  197. package/Source/Assets/Textures/maki/airfield.png +0 -0
  198. package/Source/Assets/Textures/maki/airport.png +0 -0
  199. package/Source/Assets/Textures/maki/alcohol-shop.png +0 -0
  200. package/Source/Assets/Textures/maki/america-football.png +0 -0
  201. package/Source/Assets/Textures/maki/art-gallery.png +0 -0
  202. package/Source/Assets/Textures/maki/bakery.png +0 -0
  203. package/Source/Assets/Textures/maki/bank.png +0 -0
  204. package/Source/Assets/Textures/maki/bar.png +0 -0
  205. package/Source/Assets/Textures/maki/baseball.png +0 -0
  206. package/Source/Assets/Textures/maki/basketball.png +0 -0
  207. package/Source/Assets/Textures/maki/beer.png +0 -0
  208. package/Source/Assets/Textures/maki/bicycle.png +0 -0
  209. package/Source/Assets/Textures/maki/building.png +0 -0
  210. package/Source/Assets/Textures/maki/bus.png +0 -0
  211. package/Source/Assets/Textures/maki/cafe.png +0 -0
  212. package/Source/Assets/Textures/maki/camera.png +0 -0
  213. package/Source/Assets/Textures/maki/campsite.png +0 -0
  214. package/Source/Assets/Textures/maki/car.png +0 -0
  215. package/Source/Assets/Textures/maki/cemetery.png +0 -0
  216. package/Source/Assets/Textures/maki/cesium.png +0 -0
  217. package/Source/Assets/Textures/maki/chemist.png +0 -0
  218. package/Source/Assets/Textures/maki/cinema.png +0 -0
  219. package/Source/Assets/Textures/maki/circle-stroked.png +0 -0
  220. package/Source/Assets/Textures/maki/circle.png +0 -0
  221. package/Source/Assets/Textures/maki/city.png +0 -0
  222. package/Source/Assets/Textures/maki/clothing-store.png +0 -0
  223. package/Source/Assets/Textures/maki/college.png +0 -0
  224. package/Source/Assets/Textures/maki/commercial.png +0 -0
  225. package/Source/Assets/Textures/maki/cricket.png +0 -0
  226. package/Source/Assets/Textures/maki/cross.png +0 -0
  227. package/Source/Assets/Textures/maki/dam.png +0 -0
  228. package/Source/Assets/Textures/maki/danger.png +0 -0
  229. package/Source/Assets/Textures/maki/disability.png +0 -0
  230. package/Source/Assets/Textures/maki/dog-park.png +0 -0
  231. package/Source/Assets/Textures/maki/embassy.png +0 -0
  232. package/Source/Assets/Textures/maki/emergency-telephone.png +0 -0
  233. package/Source/Assets/Textures/maki/entrance.png +0 -0
  234. package/Source/Assets/Textures/maki/farm.png +0 -0
  235. package/Source/Assets/Textures/maki/fast-food.png +0 -0
  236. package/Source/Assets/Textures/maki/ferry.png +0 -0
  237. package/Source/Assets/Textures/maki/fire-station.png +0 -0
  238. package/Source/Assets/Textures/maki/fuel.png +0 -0
  239. package/Source/Assets/Textures/maki/garden.png +0 -0
  240. package/Source/Assets/Textures/maki/gift.png +0 -0
  241. package/Source/Assets/Textures/maki/golf.png +0 -0
  242. package/Source/Assets/Textures/maki/grocery.png +0 -0
  243. package/Source/Assets/Textures/maki/hairdresser.png +0 -0
  244. package/Source/Assets/Textures/maki/harbor.png +0 -0
  245. package/Source/Assets/Textures/maki/heart.png +0 -0
  246. package/Source/Assets/Textures/maki/heliport.png +0 -0
  247. package/Source/Assets/Textures/maki/hospital.png +0 -0
  248. package/Source/Assets/Textures/maki/ice-cream.png +0 -0
  249. package/Source/Assets/Textures/maki/industrial.png +0 -0
  250. package/Source/Assets/Textures/maki/land-use.png +0 -0
  251. package/Source/Assets/Textures/maki/laundry.png +0 -0
  252. package/Source/Assets/Textures/maki/library.png +0 -0
  253. package/Source/Assets/Textures/maki/lighthouse.png +0 -0
  254. package/Source/Assets/Textures/maki/lodging.png +0 -0
  255. package/Source/Assets/Textures/maki/logging.png +0 -0
  256. package/Source/Assets/Textures/maki/london-underground.png +0 -0
  257. package/Source/Assets/Textures/maki/marker-stroked.png +0 -0
  258. package/Source/Assets/Textures/maki/marker.png +0 -0
  259. package/Source/Assets/Textures/maki/minefield.png +0 -0
  260. package/Source/Assets/Textures/maki/mobilephone.png +0 -0
  261. package/Source/Assets/Textures/maki/monument.png +0 -0
  262. package/Source/Assets/Textures/maki/museum.png +0 -0
  263. package/Source/Assets/Textures/maki/music.png +0 -0
  264. package/Source/Assets/Textures/maki/oil-well.png +0 -0
  265. package/Source/Assets/Textures/maki/park.png +0 -0
  266. package/Source/Assets/Textures/maki/park2.png +0 -0
  267. package/Source/Assets/Textures/maki/parking-garage.png +0 -0
  268. package/Source/Assets/Textures/maki/parking.png +0 -0
  269. package/Source/Assets/Textures/maki/pharmacy.png +0 -0
  270. package/Source/Assets/Textures/maki/pitch.png +0 -0
  271. package/Source/Assets/Textures/maki/place-of-worship.png +0 -0
  272. package/Source/Assets/Textures/maki/playground.png +0 -0
  273. package/Source/Assets/Textures/maki/police.png +0 -0
  274. package/Source/Assets/Textures/maki/polling-place.png +0 -0
  275. package/Source/Assets/Textures/maki/post.png +0 -0
  276. package/Source/Assets/Textures/maki/prison.png +0 -0
  277. package/Source/Assets/Textures/maki/rail-above.png +0 -0
  278. package/Source/Assets/Textures/maki/rail-light.png +0 -0
  279. package/Source/Assets/Textures/maki/rail-metro.png +0 -0
  280. package/Source/Assets/Textures/maki/rail-underground.png +0 -0
  281. package/Source/Assets/Textures/maki/rail.png +0 -0
  282. package/Source/Assets/Textures/maki/religious-christian.png +0 -0
  283. package/Source/Assets/Textures/maki/religious-jewish.png +0 -0
  284. package/Source/Assets/Textures/maki/religious-muslim.png +0 -0
  285. package/Source/Assets/Textures/maki/restaurant.png +0 -0
  286. package/Source/Assets/Textures/maki/roadblock.png +0 -0
  287. package/Source/Assets/Textures/maki/rocket.png +0 -0
  288. package/Source/Assets/Textures/maki/school.png +0 -0
  289. package/Source/Assets/Textures/maki/scooter.png +0 -0
  290. package/Source/Assets/Textures/maki/shop.png +0 -0
  291. package/Source/Assets/Textures/maki/skiing.png +0 -0
  292. package/Source/Assets/Textures/maki/slaughterhouse.png +0 -0
  293. package/Source/Assets/Textures/maki/soccer.png +0 -0
  294. package/Source/Assets/Textures/maki/square-stroked.png +0 -0
  295. package/Source/Assets/Textures/maki/square.png +0 -0
  296. package/Source/Assets/Textures/maki/star-stroked.png +0 -0
  297. package/Source/Assets/Textures/maki/star.png +0 -0
  298. package/Source/Assets/Textures/maki/suitcase.png +0 -0
  299. package/Source/Assets/Textures/maki/swimming.png +0 -0
  300. package/Source/Assets/Textures/maki/telephone.png +0 -0
  301. package/Source/Assets/Textures/maki/tennis.png +0 -0
  302. package/Source/Assets/Textures/maki/theatre.png +0 -0
  303. package/Source/Assets/Textures/maki/toilets.png +0 -0
  304. package/Source/Assets/Textures/maki/town-hall.png +0 -0
  305. package/Source/Assets/Textures/maki/town.png +0 -0
  306. package/Source/Assets/Textures/maki/triangle-stroked.png +0 -0
  307. package/Source/Assets/Textures/maki/triangle.png +0 -0
  308. package/Source/Assets/Textures/maki/village.png +0 -0
  309. package/Source/Assets/Textures/maki/warehouse.png +0 -0
  310. package/Source/Assets/Textures/maki/waste-basket.png +0 -0
  311. package/Source/Assets/Textures/maki/water.png +0 -0
  312. package/Source/Assets/Textures/maki/wetland.png +0 -0
  313. package/Source/Assets/Textures/maki/zoo.png +0 -0
  314. package/Source/Assets/Textures/moonSmall.jpg +0 -0
  315. package/Source/Assets/Textures/pin.svg +1 -0
  316. package/Source/Assets/Textures/waterNormals.jpg +0 -0
  317. package/Source/Assets/Textures/waterNormalsSmall.jpg +0 -0
  318. package/Source/Assets/approximateTerrainHeights.json +1 -0
  319. package/Source/Core/ApproximateTerrainHeights.js +256 -0
  320. package/Source/Core/ArcGISTiledElevationTerrainProvider.js +728 -0
  321. package/Source/Core/ArcType.js +31 -0
  322. package/Source/Core/ArticulationStageType.js +23 -0
  323. package/Source/Core/AssociativeArray.js +127 -0
  324. package/Source/Core/AttributeCompression.js +527 -0
  325. package/Source/Core/AxisAlignedBoundingBox.js +259 -0
  326. package/Source/Core/BingMapsGeocoderService.js +107 -0
  327. package/Source/Core/BoundingRectangle.js +373 -0
  328. package/Source/Core/BoundingSphere.js +1505 -0
  329. package/Source/Core/BoxGeometry.js +893 -0
  330. package/Source/Core/BoxOutlineGeometry.js +314 -0
  331. package/Source/Core/Cartesian2.js +824 -0
  332. package/Source/Core/Cartesian3.js +1218 -0
  333. package/Source/Core/Cartesian4.js +980 -0
  334. package/Source/Core/Cartographic.js +302 -0
  335. package/Source/Core/CartographicGeocoderService.js +58 -0
  336. package/Source/Core/CatmullRomSpline.js +324 -0
  337. package/Source/Core/CesiumTerrainProvider.js +1318 -0
  338. package/Source/Core/Check.js +213 -0
  339. package/Source/Core/CircleGeometry.js +203 -0
  340. package/Source/Core/CircleOutlineGeometry.js +149 -0
  341. package/Source/Core/Clock.js +319 -0
  342. package/Source/Core/ClockRange.js +39 -0
  343. package/Source/Core/ClockStep.js +38 -0
  344. package/Source/Core/Color.js +2263 -0
  345. package/Source/Core/ColorGeometryInstanceAttribute.js +182 -0
  346. package/Source/Core/ComponentDatatype.js +340 -0
  347. package/Source/Core/CompressedTextureBuffer.js +114 -0
  348. package/Source/Core/ConstantSpline.js +119 -0
  349. package/Source/Core/CoplanarPolygonGeometry.js +599 -0
  350. package/Source/Core/CoplanarPolygonGeometryLibrary.js +132 -0
  351. package/Source/Core/CoplanarPolygonOutlineGeometry.js +237 -0
  352. package/Source/Core/CornerType.js +37 -0
  353. package/Source/Core/CorridorGeometry.js +1416 -0
  354. package/Source/Core/CorridorGeometryLibrary.js +501 -0
  355. package/Source/Core/CorridorOutlineGeometry.js +604 -0
  356. package/Source/Core/Credit.js +166 -0
  357. package/Source/Core/CubicRealPolynomial.js +238 -0
  358. package/Source/Core/CullingVolume.js +217 -0
  359. package/Source/Core/CustomHeightmapTerrainProvider.js +299 -0
  360. package/Source/Core/CylinderGeometry.js +479 -0
  361. package/Source/Core/CylinderGeometryLibrary.js +59 -0
  362. package/Source/Core/CylinderOutlineGeometry.js +269 -0
  363. package/Source/Core/DefaultProxy.js +26 -0
  364. package/Source/Core/DeveloperError.js +75 -0
  365. package/Source/Core/DistanceDisplayCondition.js +172 -0
  366. package/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js +181 -0
  367. package/Source/Core/DoubleEndedPriorityQueue.js +405 -0
  368. package/Source/Core/DoublyLinkedList.js +112 -0
  369. package/Source/Core/EarthOrientationParameters.js +431 -0
  370. package/Source/Core/EarthOrientationParametersSample.js +52 -0
  371. package/Source/Core/EasingFunction.js +257 -0
  372. package/Source/Core/EllipseGeometry.js +1325 -0
  373. package/Source/Core/EllipseGeometryLibrary.js +365 -0
  374. package/Source/Core/EllipseOutlineGeometry.js +454 -0
  375. package/Source/Core/Ellipsoid.js +804 -0
  376. package/Source/Core/EllipsoidGeodesic.js +523 -0
  377. package/Source/Core/EllipsoidGeometry.js +649 -0
  378. package/Source/Core/EllipsoidOutlineGeometry.js +464 -0
  379. package/Source/Core/EllipsoidRhumbLine.js +745 -0
  380. package/Source/Core/EllipsoidTangentPlane.js +383 -0
  381. package/Source/Core/EllipsoidTerrainProvider.js +230 -0
  382. package/Source/Core/EllipsoidalOccluder.js +559 -0
  383. package/Source/Core/EncodedCartesian3.js +170 -0
  384. package/Source/Core/Event.js +164 -0
  385. package/Source/Core/EventHelper.js +74 -0
  386. package/Source/Core/ExtrapolationType.js +34 -0
  387. package/Source/Core/FeatureDetection.js +411 -0
  388. package/Source/Core/FrustumGeometry.js +583 -0
  389. package/Source/Core/FrustumOutlineGeometry.js +254 -0
  390. package/Source/Core/Fullscreen.js +249 -0
  391. package/Source/Core/GeocodeType.js +24 -0
  392. package/Source/Core/GeocoderService.js +29 -0
  393. package/Source/Core/GeographicProjection.js +105 -0
  394. package/Source/Core/GeographicTilingScheme.js +251 -0
  395. package/Source/Core/Geometry.js +376 -0
  396. package/Source/Core/GeometryAttribute.js +138 -0
  397. package/Source/Core/GeometryAttributes.js +88 -0
  398. package/Source/Core/GeometryFactory.js +25 -0
  399. package/Source/Core/GeometryInstance.js +121 -0
  400. package/Source/Core/GeometryInstanceAttribute.js +138 -0
  401. package/Source/Core/GeometryOffsetAttribute.js +10 -0
  402. package/Source/Core/GeometryPipeline.js +3296 -0
  403. package/Source/Core/GeometryType.js +10 -0
  404. package/Source/Core/GoogleEarthEnterpriseMetadata.js +597 -0
  405. package/Source/Core/GoogleEarthEnterpriseTerrainData.js +607 -0
  406. package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +641 -0
  407. package/Source/Core/GoogleEarthEnterpriseTileInformation.js +136 -0
  408. package/Source/Core/GregorianDate.js +69 -0
  409. package/Source/Core/GroundPolylineGeometry.js +1658 -0
  410. package/Source/Core/HeadingPitchRange.js +60 -0
  411. package/Source/Core/HeadingPitchRoll.js +236 -0
  412. package/Source/Core/Heap.js +234 -0
  413. package/Source/Core/HeightmapEncoding.js +25 -0
  414. package/Source/Core/HeightmapTerrainData.js +925 -0
  415. package/Source/Core/HeightmapTessellator.js +535 -0
  416. package/Source/Core/HermitePolynomialApproximation.js +342 -0
  417. package/Source/Core/HermiteSpline.js +620 -0
  418. package/Source/Core/HilbertOrder.js +118 -0
  419. package/Source/Core/Iau2000Orientation.js +167 -0
  420. package/Source/Core/Iau2006XysData.js +277 -0
  421. package/Source/Core/Iau2006XysSample.js +32 -0
  422. package/Source/Core/IauOrientationAxes.js +105 -0
  423. package/Source/Core/IauOrientationParameters.js +54 -0
  424. package/Source/Core/IndexDatatype.js +199 -0
  425. package/Source/Core/InterpolationAlgorithm.js +65 -0
  426. package/Source/Core/InterpolationType.js +14 -0
  427. package/Source/Core/Intersect.js +34 -0
  428. package/Source/Core/IntersectionTests.js +1047 -0
  429. package/Source/Core/Intersections2D.js +358 -0
  430. package/Source/Core/Interval.js +25 -0
  431. package/Source/Core/Ion.js +57 -0
  432. package/Source/Core/IonGeocoderService.js +64 -0
  433. package/Source/Core/IonResource.js +270 -0
  434. package/Source/Core/Iso8601.js +54 -0
  435. package/Source/Core/JulianDate.js +1233 -0
  436. package/Source/Core/KTX2Transcoder.js +95 -0
  437. package/Source/Core/KeyboardEventModifier.js +32 -0
  438. package/Source/Core/LagrangePolynomialApproximation.js +71 -0
  439. package/Source/Core/LeapSecond.js +24 -0
  440. package/Source/Core/LinearApproximation.js +83 -0
  441. package/Source/Core/LinearSpline.js +166 -0
  442. package/Source/Core/ManagedArray.js +163 -0
  443. package/Source/Core/MapProjection.js +62 -0
  444. package/Source/Core/Math.js +1119 -0
  445. package/Source/Core/Matrix2.js +1092 -0
  446. package/Source/Core/Matrix3.js +1838 -0
  447. package/Source/Core/Matrix4.js +3232 -0
  448. package/Source/Core/MorphWeightSpline.js +161 -0
  449. package/Source/Core/MortonOrder.js +214 -0
  450. package/Source/Core/NearFarScalar.js +174 -0
  451. package/Source/Core/Occluder.js +732 -0
  452. package/Source/Core/OffsetGeometryInstanceAttribute.js +126 -0
  453. package/Source/Core/OpenCageGeocoderService.js +118 -0
  454. package/Source/Core/OrientedBoundingBox.js +1270 -0
  455. package/Source/Core/OrthographicFrustum.js +338 -0
  456. package/Source/Core/OrthographicOffCenterFrustum.js +463 -0
  457. package/Source/Core/Packable.js +40 -0
  458. package/Source/Core/PackableForInterpolation.js +43 -0
  459. package/Source/Core/PeliasGeocoderService.js +93 -0
  460. package/Source/Core/PerspectiveFrustum.js +439 -0
  461. package/Source/Core/PerspectiveOffCenterFrustum.js +523 -0
  462. package/Source/Core/PinBuilder.js +234 -0
  463. package/Source/Core/PixelFormat.js +493 -0
  464. package/Source/Core/Plane.js +312 -0
  465. package/Source/Core/PlaneGeometry.js +250 -0
  466. package/Source/Core/PlaneOutlineGeometry.js +113 -0
  467. package/Source/Core/PolygonGeometry.js +1436 -0
  468. package/Source/Core/PolygonGeometryLibrary.js +981 -0
  469. package/Source/Core/PolygonHierarchy.js +25 -0
  470. package/Source/Core/PolygonOutlineGeometry.js +692 -0
  471. package/Source/Core/PolygonPipeline.js +633 -0
  472. package/Source/Core/PolylineGeometry.js +578 -0
  473. package/Source/Core/PolylinePipeline.js +580 -0
  474. package/Source/Core/PolylineVolumeGeometry.js +417 -0
  475. package/Source/Core/PolylineVolumeGeometryLibrary.js +701 -0
  476. package/Source/Core/PolylineVolumeOutlineGeometry.js +299 -0
  477. package/Source/Core/PrimitiveType.js +107 -0
  478. package/Source/Core/Proxy.js +24 -0
  479. package/Source/Core/QuadraticRealPolynomial.js +147 -0
  480. package/Source/Core/QuantizedMeshTerrainData.js +772 -0
  481. package/Source/Core/QuarticRealPolynomial.js +342 -0
  482. package/Source/Core/Quaternion.js +1142 -0
  483. package/Source/Core/QuaternionSpline.js +155 -0
  484. package/Source/Core/Queue.js +126 -0
  485. package/Source/Core/Ray.js +80 -0
  486. package/Source/Core/Rectangle.js +982 -0
  487. package/Source/Core/RectangleCollisionChecker.js +95 -0
  488. package/Source/Core/RectangleGeometry.js +1489 -0
  489. package/Source/Core/RectangleGeometryLibrary.js +283 -0
  490. package/Source/Core/RectangleOutlineGeometry.js +537 -0
  491. package/Source/Core/ReferenceFrame.js +23 -0
  492. package/Source/Core/Request.js +192 -0
  493. package/Source/Core/RequestErrorEvent.js +58 -0
  494. package/Source/Core/RequestScheduler.js +520 -0
  495. package/Source/Core/RequestState.js +55 -0
  496. package/Source/Core/RequestType.js +39 -0
  497. package/Source/Core/Resource.js +2307 -0
  498. package/Source/Core/RuntimeError.js +65 -0
  499. package/Source/Core/S2Cell.js +811 -0
  500. package/Source/Core/ScreenSpaceEventHandler.js +1140 -0
  501. package/Source/Core/ScreenSpaceEventType.js +127 -0
  502. package/Source/Core/ShowGeometryInstanceAttribute.js +123 -0
  503. package/Source/Core/Simon1994PlanetaryPositions.js +682 -0
  504. package/Source/Core/SimplePolylineGeometry.js +457 -0
  505. package/Source/Core/SphereGeometry.js +118 -0
  506. package/Source/Core/SphereOutlineGeometry.js +120 -0
  507. package/Source/Core/Spherical.js +184 -0
  508. package/Source/Core/Spline.js +189 -0
  509. package/Source/Core/SteppedSpline.js +160 -0
  510. package/Source/Core/TaskProcessor.js +377 -0
  511. package/Source/Core/TerrainData.js +125 -0
  512. package/Source/Core/TerrainEncoding.js +607 -0
  513. package/Source/Core/TerrainExaggeration.js +49 -0
  514. package/Source/Core/TerrainMesh.js +156 -0
  515. package/Source/Core/TerrainProvider.js +461 -0
  516. package/Source/Core/TerrainQuantization.js +25 -0
  517. package/Source/Core/TileAvailability.js +564 -0
  518. package/Source/Core/TileEdge.js +14 -0
  519. package/Source/Core/TileProviderError.js +171 -0
  520. package/Source/Core/TilingScheme.js +132 -0
  521. package/Source/Core/TimeConstants.js +83 -0
  522. package/Source/Core/TimeInterval.js +438 -0
  523. package/Source/Core/TimeIntervalCollection.js +1136 -0
  524. package/Source/Core/TimeStandard.js +30 -0
  525. package/Source/Core/Tipsify.js +314 -0
  526. package/Source/Core/Transforms.js +1132 -0
  527. package/Source/Core/TranslationRotationScale.js +60 -0
  528. package/Source/Core/TridiagonalSystemSolver.js +113 -0
  529. package/Source/Core/TrustedServers.js +146 -0
  530. package/Source/Core/VRTheWorldTerrainProvider.js +450 -0
  531. package/Source/Core/VertexFormat.js +311 -0
  532. package/Source/Core/VideoSynchronizer.js +222 -0
  533. package/Source/Core/Visibility.js +34 -0
  534. package/Source/Core/VulkanConstants.js +286 -0
  535. package/Source/Core/WallGeometry.js +626 -0
  536. package/Source/Core/WallGeometryLibrary.js +212 -0
  537. package/Source/Core/WallOutlineGeometry.js +434 -0
  538. package/Source/Core/WebGLConstants.js +614 -0
  539. package/Source/Core/WebMercatorProjection.js +154 -0
  540. package/Source/Core/WebMercatorTilingScheme.js +297 -0
  541. package/Source/Core/WindingOrder.js +36 -0
  542. package/Source/Core/WireframeIndexGenerator.js +238 -0
  543. package/Source/Core/appendForwardSlash.js +10 -0
  544. package/Source/Core/arrayRemoveDuplicates.js +130 -0
  545. package/Source/Core/barycentricCoordinates.js +109 -0
  546. package/Source/Core/binarySearch.js +67 -0
  547. package/Source/Core/buildModuleUrl.js +151 -0
  548. package/Source/Core/cancelAnimationFrame.js +53 -0
  549. package/Source/Core/clone.js +32 -0
  550. package/Source/Core/combine.js +80 -0
  551. package/Source/Core/createGuid.js +22 -0
  552. package/Source/Core/createWorldTerrain.js +42 -0
  553. package/Source/Core/decodeGoogleEarthEnterpriseData.js +93 -0
  554. package/Source/Core/decodeVectorPolylinePositions.js +51 -0
  555. package/Source/Core/defaultValue.js +29 -0
  556. package/Source/Core/defer.js +44 -0
  557. package/Source/Core/defined.js +17 -0
  558. package/Source/Core/deprecationWarning.js +53 -0
  559. package/Source/Core/destroyObject.js +57 -0
  560. package/Source/Core/formatError.js +30 -0
  561. package/Source/Core/getAbsoluteUri.js +47 -0
  562. package/Source/Core/getBaseUri.js +47 -0
  563. package/Source/Core/getExtensionFromUri.js +38 -0
  564. package/Source/Core/getFilenameFromUri.js +32 -0
  565. package/Source/Core/getImageFromTypedArray.js +24 -0
  566. package/Source/Core/getImagePixels.js +43 -0
  567. package/Source/Core/getJsonFromTypedArray.js +21 -0
  568. package/Source/Core/getMagic.js +15 -0
  569. package/Source/Core/getStringFromTypedArray.js +166 -0
  570. package/Source/Core/getTimestamp.js +26 -0
  571. package/Source/Core/isBitSet.js +7 -0
  572. package/Source/Core/isBlobUri.js +22 -0
  573. package/Source/Core/isCrossOriginUrl.js +30 -0
  574. package/Source/Core/isDataUri.js +22 -0
  575. package/Source/Core/isLeapYear.js +23 -0
  576. package/Source/Core/loadAndExecuteScript.js +27 -0
  577. package/Source/Core/loadImageFromTypedArray.js +64 -0
  578. package/Source/Core/loadKTX2.js +104 -0
  579. package/Source/Core/mergeSort.js +111 -0
  580. package/Source/Core/objectToQuery.js +57 -0
  581. package/Source/Core/oneTimeWarning.js +52 -0
  582. package/Source/Core/parseResponseHeaders.js +37 -0
  583. package/Source/Core/pointInsideTriangle.js +39 -0
  584. package/Source/Core/queryToObject.js +60 -0
  585. package/Source/Core/requestAnimationFrame.js +83 -0
  586. package/Source/Core/resizeImageToNextPowerOfTwo.js +31 -0
  587. package/Source/Core/sampleTerrain.js +257 -0
  588. package/Source/Core/sampleTerrainMostDetailed.js +117 -0
  589. package/Source/Core/scaleToGeodeticSurface.js +147 -0
  590. package/Source/Core/subdivideArray.js +35 -0
  591. package/Source/Core/webGLConstantToGlslType.js +25 -0
  592. package/Source/Core/wrapFunction.js +26 -0
  593. package/Source/Core/writeTextToCanvas.js +222 -0
  594. package/Source/DataSources/BillboardGraphics.js +429 -0
  595. package/Source/DataSources/BillboardVisualizer.js +341 -0
  596. package/Source/DataSources/BoundingSphereState.js +26 -0
  597. package/Source/DataSources/BoxGeometryUpdater.js +325 -0
  598. package/Source/DataSources/BoxGraphics.js +213 -0
  599. package/Source/DataSources/CallbackProperty.js +111 -0
  600. package/Source/DataSources/Cesium3DTilesetGraphics.js +113 -0
  601. package/Source/DataSources/Cesium3DTilesetVisualizer.js +249 -0
  602. package/Source/DataSources/CheckerboardMaterialProperty.js +151 -0
  603. package/Source/DataSources/ColorMaterialProperty.js +106 -0
  604. package/Source/DataSources/CompositeEntityCollection.js +592 -0
  605. package/Source/DataSources/CompositeMaterialProperty.js +129 -0
  606. package/Source/DataSources/CompositePositionProperty.js +149 -0
  607. package/Source/DataSources/CompositeProperty.js +154 -0
  608. package/Source/DataSources/ConstantPositionProperty.js +146 -0
  609. package/Source/DataSources/ConstantProperty.js +116 -0
  610. package/Source/DataSources/CorridorGeometryUpdater.js +404 -0
  611. package/Source/DataSources/CorridorGraphics.js +328 -0
  612. package/Source/DataSources/CustomDataSource.js +173 -0
  613. package/Source/DataSources/CylinderGeometryUpdater.js +373 -0
  614. package/Source/DataSources/CylinderGraphics.js +265 -0
  615. package/Source/DataSources/CzmlDataSource.js +5141 -0
  616. package/Source/DataSources/DataSource.js +121 -0
  617. package/Source/DataSources/DataSourceClock.js +165 -0
  618. package/Source/DataSources/DataSourceCollection.js +336 -0
  619. package/Source/DataSources/DataSourceDisplay.js +510 -0
  620. package/Source/DataSources/DynamicGeometryBatch.js +56 -0
  621. package/Source/DataSources/DynamicGeometryUpdater.js +274 -0
  622. package/Source/DataSources/EllipseGeometryUpdater.js +430 -0
  623. package/Source/DataSources/EllipseGraphics.js +357 -0
  624. package/Source/DataSources/EllipsoidGeometryUpdater.js +710 -0
  625. package/Source/DataSources/EllipsoidGraphics.js +323 -0
  626. package/Source/DataSources/Entity.js +752 -0
  627. package/Source/DataSources/EntityCluster.js +997 -0
  628. package/Source/DataSources/EntityCollection.js +440 -0
  629. package/Source/DataSources/EntityView.js +426 -0
  630. package/Source/DataSources/GeoJsonDataSource.js +1064 -0
  631. package/Source/DataSources/GeometryUpdater.js +545 -0
  632. package/Source/DataSources/GeometryVisualizer.js +620 -0
  633. package/Source/DataSources/GpxDataSource.js +1023 -0
  634. package/Source/DataSources/GridMaterialProperty.js +198 -0
  635. package/Source/DataSources/GroundGeometryUpdater.js +232 -0
  636. package/Source/DataSources/ImageMaterialProperty.js +166 -0
  637. package/Source/DataSources/KmlCamera.js +13 -0
  638. package/Source/DataSources/KmlDataSource.js +4326 -0
  639. package/Source/DataSources/KmlLookAt.js +12 -0
  640. package/Source/DataSources/KmlTour.js +176 -0
  641. package/Source/DataSources/KmlTourFlyTo.js +109 -0
  642. package/Source/DataSources/KmlTourWait.js +52 -0
  643. package/Source/DataSources/LabelGraphics.js +430 -0
  644. package/Source/DataSources/LabelVisualizer.js +360 -0
  645. package/Source/DataSources/MaterialProperty.js +105 -0
  646. package/Source/DataSources/ModelGraphics.js +447 -0
  647. package/Source/DataSources/ModelVisualizer.js +548 -0
  648. package/Source/DataSources/NodeTransformationProperty.js +144 -0
  649. package/Source/DataSources/PathGraphics.js +163 -0
  650. package/Source/DataSources/PathVisualizer.js +759 -0
  651. package/Source/DataSources/PlaneGeometryUpdater.js +384 -0
  652. package/Source/DataSources/PlaneGraphics.js +210 -0
  653. package/Source/DataSources/PointGraphics.js +221 -0
  654. package/Source/DataSources/PointVisualizer.js +426 -0
  655. package/Source/DataSources/PolygonGeometryUpdater.js +575 -0
  656. package/Source/DataSources/PolygonGraphics.js +400 -0
  657. package/Source/DataSources/PolylineArrowMaterialProperty.js +104 -0
  658. package/Source/DataSources/PolylineDashMaterialProperty.js +168 -0
  659. package/Source/DataSources/PolylineGeometryUpdater.js +886 -0
  660. package/Source/DataSources/PolylineGlowMaterialProperty.js +146 -0
  661. package/Source/DataSources/PolylineGraphics.js +248 -0
  662. package/Source/DataSources/PolylineOutlineMaterialProperty.js +152 -0
  663. package/Source/DataSources/PolylineVisualizer.js +414 -0
  664. package/Source/DataSources/PolylineVolumeGeometryUpdater.js +304 -0
  665. package/Source/DataSources/PolylineVolumeGraphics.js +237 -0
  666. package/Source/DataSources/PositionProperty.js +133 -0
  667. package/Source/DataSources/PositionPropertyArray.js +187 -0
  668. package/Source/DataSources/Property.js +138 -0
  669. package/Source/DataSources/PropertyArray.js +147 -0
  670. package/Source/DataSources/PropertyBag.js +275 -0
  671. package/Source/DataSources/RectangleGeometryUpdater.js +422 -0
  672. package/Source/DataSources/RectangleGraphics.js +329 -0
  673. package/Source/DataSources/ReferenceProperty.js +365 -0
  674. package/Source/DataSources/Rotation.js +156 -0
  675. package/Source/DataSources/SampledPositionProperty.js +325 -0
  676. package/Source/DataSources/SampledProperty.js +834 -0
  677. package/Source/DataSources/ScaledPositionProperty.js +97 -0
  678. package/Source/DataSources/StaticGeometryColorBatch.js +570 -0
  679. package/Source/DataSources/StaticGeometryPerMaterialBatch.js +488 -0
  680. package/Source/DataSources/StaticGroundGeometryColorBatch.js +395 -0
  681. package/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js +426 -0
  682. package/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js +434 -0
  683. package/Source/DataSources/StaticOutlineGeometryBatch.js +466 -0
  684. package/Source/DataSources/StripeMaterialProperty.js +187 -0
  685. package/Source/DataSources/StripeOrientation.js +19 -0
  686. package/Source/DataSources/TerrainOffsetProperty.js +246 -0
  687. package/Source/DataSources/TimeIntervalCollectionPositionProperty.js +152 -0
  688. package/Source/DataSources/TimeIntervalCollectionProperty.js +136 -0
  689. package/Source/DataSources/VelocityOrientationProperty.js +154 -0
  690. package/Source/DataSources/VelocityVectorProperty.js +216 -0
  691. package/Source/DataSources/Visualizer.js +61 -0
  692. package/Source/DataSources/WallGeometryUpdater.js +275 -0
  693. package/Source/DataSources/WallGraphics.js +244 -0
  694. package/Source/DataSources/createMaterialPropertyDescriptor.js +35 -0
  695. package/Source/DataSources/createPropertyDescriptor.js +72 -0
  696. package/Source/DataSources/createRawPropertyDescriptor.js +13 -0
  697. package/Source/DataSources/exportKml.js +1519 -0
  698. package/Source/DataSources/getElement.js +26 -0
  699. package/Source/DataSources/heightReferenceOnEntityPropertyChanged.js +47 -0
  700. package/Source/Renderer/AutomaticUniforms.js +1625 -0
  701. package/Source/Renderer/Buffer.js +420 -0
  702. package/Source/Renderer/BufferUsage.js +19 -0
  703. package/Source/Renderer/ClearCommand.js +102 -0
  704. package/Source/Renderer/ComputeCommand.js +119 -0
  705. package/Source/Renderer/ComputeEngine.js +135 -0
  706. package/Source/Renderer/Context.js +1601 -0
  707. package/Source/Renderer/ContextLimits.js +297 -0
  708. package/Source/Renderer/CubeMap.js +631 -0
  709. package/Source/Renderer/CubeMapFace.js +361 -0
  710. package/Source/Renderer/DrawCommand.js +610 -0
  711. package/Source/Renderer/Framebuffer.js +448 -0
  712. package/Source/Renderer/FramebufferManager.js +497 -0
  713. package/Source/Renderer/MipmapHint.js +19 -0
  714. package/Source/Renderer/MultisampleFramebuffer.js +115 -0
  715. package/Source/Renderer/Pass.js +26 -0
  716. package/Source/Renderer/PassState.js +57 -0
  717. package/Source/Renderer/PixelDatatype.js +98 -0
  718. package/Source/Renderer/RenderState.js +996 -0
  719. package/Source/Renderer/Renderbuffer.js +103 -0
  720. package/Source/Renderer/RenderbufferFormat.js +42 -0
  721. package/Source/Renderer/Sampler.js +109 -0
  722. package/Source/Renderer/ShaderBuilder.js +593 -0
  723. package/Source/Renderer/ShaderCache.js +291 -0
  724. package/Source/Renderer/ShaderDestination.js +51 -0
  725. package/Source/Renderer/ShaderFunction.js +66 -0
  726. package/Source/Renderer/ShaderProgram.js +612 -0
  727. package/Source/Renderer/ShaderSource.js +519 -0
  728. package/Source/Renderer/ShaderStruct.js +55 -0
  729. package/Source/Renderer/Texture.js +1035 -0
  730. package/Source/Renderer/TextureCache.js +81 -0
  731. package/Source/Renderer/TextureMagnificationFilter.js +41 -0
  732. package/Source/Renderer/TextureMinificationFilter.js +94 -0
  733. package/Source/Renderer/TextureWrap.js +19 -0
  734. package/Source/Renderer/UniformState.js +1710 -0
  735. package/Source/Renderer/VertexArray.js +853 -0
  736. package/Source/Renderer/VertexArrayFacade.js +514 -0
  737. package/Source/Renderer/createUniform.js +419 -0
  738. package/Source/Renderer/createUniformArray.js +637 -0
  739. package/Source/Renderer/freezeRenderState.js +30 -0
  740. package/Source/Renderer/loadCubeMap.js +93 -0
  741. package/Source/Renderer/modernizeShader.js +242 -0
  742. package/Source/Scene/AlphaMode.js +33 -0
  743. package/Source/Scene/Appearance.js +204 -0
  744. package/Source/Scene/ArcGisMapServerImageryProvider.js +905 -0
  745. package/Source/Scene/AttributeType.js +200 -0
  746. package/Source/Scene/AutoExposure.js +387 -0
  747. package/Source/Scene/Axis.js +111 -0
  748. package/Source/Scene/B3dmParser.js +174 -0
  749. package/Source/Scene/BatchTable.js +636 -0
  750. package/Source/Scene/BatchTableHierarchy.js +556 -0
  751. package/Source/Scene/BatchTexture.js +574 -0
  752. package/Source/Scene/Billboard.js +1552 -0
  753. package/Source/Scene/BillboardCollection.js +2417 -0
  754. package/Source/Scene/BingMapsImageryProvider.js +855 -0
  755. package/Source/Scene/BingMapsStyle.js +93 -0
  756. package/Source/Scene/BlendEquation.js +53 -0
  757. package/Source/Scene/BlendFunction.js +129 -0
  758. package/Source/Scene/BlendOption.js +28 -0
  759. package/Source/Scene/BlendingState.js +73 -0
  760. package/Source/Scene/BoxEmitter.js +75 -0
  761. package/Source/Scene/BrdfLutGenerator.js +75 -0
  762. package/Source/Scene/BufferLoader.js +146 -0
  763. package/Source/Scene/Camera.js +3951 -0
  764. package/Source/Scene/CameraEventAggregator.js +565 -0
  765. package/Source/Scene/CameraEventType.js +47 -0
  766. package/Source/Scene/CameraFlightPath.js +576 -0
  767. package/Source/Scene/Cesium3DContentGroup.js +44 -0
  768. package/Source/Scene/Cesium3DTile.js +2115 -0
  769. package/Source/Scene/Cesium3DTileBatchTable.js +1176 -0
  770. package/Source/Scene/Cesium3DTileColorBlendMode.js +52 -0
  771. package/Source/Scene/Cesium3DTileContent.js +397 -0
  772. package/Source/Scene/Cesium3DTileContentFactory.js +104 -0
  773. package/Source/Scene/Cesium3DTileContentState.js +12 -0
  774. package/Source/Scene/Cesium3DTileContentType.js +160 -0
  775. package/Source/Scene/Cesium3DTileFeature.js +444 -0
  776. package/Source/Scene/Cesium3DTileFeatureTable.js +132 -0
  777. package/Source/Scene/Cesium3DTileOptimizationHint.js +13 -0
  778. package/Source/Scene/Cesium3DTileOptimizations.js +115 -0
  779. package/Source/Scene/Cesium3DTilePass.js +82 -0
  780. package/Source/Scene/Cesium3DTilePassState.js +52 -0
  781. package/Source/Scene/Cesium3DTilePointFeature.js +864 -0
  782. package/Source/Scene/Cesium3DTileRefine.js +29 -0
  783. package/Source/Scene/Cesium3DTileStyle.js +1475 -0
  784. package/Source/Scene/Cesium3DTileStyleEngine.js +78 -0
  785. package/Source/Scene/Cesium3DTileset.js +3158 -0
  786. package/Source/Scene/Cesium3DTilesetCache.js +82 -0
  787. package/Source/Scene/Cesium3DTilesetHeatmap.js +165 -0
  788. package/Source/Scene/Cesium3DTilesetMetadata.js +199 -0
  789. package/Source/Scene/Cesium3DTilesetMostDetailedTraversal.js +144 -0
  790. package/Source/Scene/Cesium3DTilesetStatistics.js +129 -0
  791. package/Source/Scene/Cesium3DTilesetTraversal.js +773 -0
  792. package/Source/Scene/CircleEmitter.js +62 -0
  793. package/Source/Scene/ClassificationPrimitive.js +1433 -0
  794. package/Source/Scene/ClassificationType.js +35 -0
  795. package/Source/Scene/ClippingPlane.js +184 -0
  796. package/Source/Scene/ClippingPlaneCollection.js +771 -0
  797. package/Source/Scene/CloudCollection.js +1050 -0
  798. package/Source/Scene/CloudType.js +33 -0
  799. package/Source/Scene/ColorBlendMode.js +33 -0
  800. package/Source/Scene/Composite3DTileContent.js +346 -0
  801. package/Source/Scene/ConditionsExpression.js +218 -0
  802. package/Source/Scene/ConeEmitter.js +62 -0
  803. package/Source/Scene/ContentMetadata.js +184 -0
  804. package/Source/Scene/CreditDisplay.js +610 -0
  805. package/Source/Scene/CullFace.js +33 -0
  806. package/Source/Scene/CumulusCloud.js +353 -0
  807. package/Source/Scene/DebugAppearance.js +268 -0
  808. package/Source/Scene/DebugCameraPrimitive.js +257 -0
  809. package/Source/Scene/DebugInspector.js +151 -0
  810. package/Source/Scene/DebugModelMatrixPrimitive.js +222 -0
  811. package/Source/Scene/DepthFunction.js +73 -0
  812. package/Source/Scene/DepthPlane.js +245 -0
  813. package/Source/Scene/DerivedCommand.js +433 -0
  814. package/Source/Scene/DeviceOrientationCameraController.js +120 -0
  815. package/Source/Scene/DirectionalLight.js +50 -0
  816. package/Source/Scene/DiscardEmptyTileImagePolicy.js +54 -0
  817. package/Source/Scene/DiscardMissingTileImagePolicy.js +148 -0
  818. package/Source/Scene/DracoLoader.js +76 -0
  819. package/Source/Scene/EllipsoidPrimitive.js +511 -0
  820. package/Source/Scene/EllipsoidSurfaceAppearance.js +282 -0
  821. package/Source/Scene/Empty3DTileContent.js +151 -0
  822. package/Source/Scene/Expression.js +2232 -0
  823. package/Source/Scene/ExpressionNodeType.js +25 -0
  824. package/Source/Scene/Fog.js +205 -0
  825. package/Source/Scene/FrameRateMonitor.js +384 -0
  826. package/Source/Scene/FrameState.js +419 -0
  827. package/Source/Scene/FrustumCommands.js +30 -0
  828. package/Source/Scene/Geometry3DTileContent.js +526 -0
  829. package/Source/Scene/GetFeatureInfoFormat.js +395 -0
  830. package/Source/Scene/Globe.js +1121 -0
  831. package/Source/Scene/GlobeDepth.js +378 -0
  832. package/Source/Scene/GlobeSurfaceShaderSet.js +413 -0
  833. package/Source/Scene/GlobeSurfaceTile.js +997 -0
  834. package/Source/Scene/GlobeSurfaceTileProvider.js +2818 -0
  835. package/Source/Scene/GlobeTranslucency.js +239 -0
  836. package/Source/Scene/GlobeTranslucencyFramebuffer.js +201 -0
  837. package/Source/Scene/GlobeTranslucencyState.js +1117 -0
  838. package/Source/Scene/GltfBufferViewLoader.js +268 -0
  839. package/Source/Scene/GltfDracoLoader.js +250 -0
  840. package/Source/Scene/GltfImageLoader.js +327 -0
  841. package/Source/Scene/GltfIndexBufferLoader.js +429 -0
  842. package/Source/Scene/GltfJsonLoader.js +301 -0
  843. package/Source/Scene/GltfLoader.js +2663 -0
  844. package/Source/Scene/GltfLoaderUtil.js +201 -0
  845. package/Source/Scene/GltfPipeline/ForEach.js +424 -0
  846. package/Source/Scene/GltfPipeline/addBuffer.js +30 -0
  847. package/Source/Scene/GltfPipeline/addDefaults.js +236 -0
  848. package/Source/Scene/GltfPipeline/addExtensionsRequired.js +24 -0
  849. package/Source/Scene/GltfPipeline/addExtensionsUsed.js +22 -0
  850. package/Source/Scene/GltfPipeline/addPipelineExtras.js +36 -0
  851. package/Source/Scene/GltfPipeline/addToArray.js +25 -0
  852. package/Source/Scene/GltfPipeline/findAccessorMinMax.js +71 -0
  853. package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +139 -0
  854. package/Source/Scene/GltfPipeline/getAccessorByteStride.js +29 -0
  855. package/Source/Scene/GltfPipeline/getComponentReader.js +147 -0
  856. package/Source/Scene/GltfPipeline/moveTechniqueRenderStates.js +138 -0
  857. package/Source/Scene/GltfPipeline/moveTechniquesToExtension.js +145 -0
  858. package/Source/Scene/GltfPipeline/numberOfComponentsForType.js +29 -0
  859. package/Source/Scene/GltfPipeline/parseGlb.js +122 -0
  860. package/Source/Scene/GltfPipeline/readAccessorPacked.js +54 -0
  861. package/Source/Scene/GltfPipeline/removeExtension.js +64 -0
  862. package/Source/Scene/GltfPipeline/removeExtensionsRequired.js +24 -0
  863. package/Source/Scene/GltfPipeline/removeExtensionsUsed.js +26 -0
  864. package/Source/Scene/GltfPipeline/removePipelineExtras.js +42 -0
  865. package/Source/Scene/GltfPipeline/removeUnusedElements.js +881 -0
  866. package/Source/Scene/GltfPipeline/updateAccessorComponentTypes.js +53 -0
  867. package/Source/Scene/GltfPipeline/updateVersion.js +1151 -0
  868. package/Source/Scene/GltfPipeline/usesExtension.js +18 -0
  869. package/Source/Scene/GltfStructuralMetadataLoader.js +504 -0
  870. package/Source/Scene/GltfTextureLoader.js +383 -0
  871. package/Source/Scene/GltfVertexBufferLoader.js +470 -0
  872. package/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +758 -0
  873. package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +756 -0
  874. package/Source/Scene/GridImageryProvider.js +436 -0
  875. package/Source/Scene/GroundPolylinePrimitive.js +926 -0
  876. package/Source/Scene/GroundPrimitive.js +1040 -0
  877. package/Source/Scene/GroupMetadata.js +203 -0
  878. package/Source/Scene/HeightReference.js +28 -0
  879. package/Source/Scene/HorizontalOrigin.js +41 -0
  880. package/Source/Scene/I3SDataProvider.js +668 -0
  881. package/Source/Scene/I3SFeature.js +63 -0
  882. package/Source/Scene/I3SField.js +255 -0
  883. package/Source/Scene/I3SGeometry.js +409 -0
  884. package/Source/Scene/I3SLayer.js +365 -0
  885. package/Source/Scene/I3SNode.js +816 -0
  886. package/Source/Scene/I3dmParser.js +141 -0
  887. package/Source/Scene/ImageBasedLighting.js +510 -0
  888. package/Source/Scene/Imagery.js +120 -0
  889. package/Source/Scene/ImageryLayer.js +1541 -0
  890. package/Source/Scene/ImageryLayerCollection.js +621 -0
  891. package/Source/Scene/ImageryLayerFeatureInfo.js +112 -0
  892. package/Source/Scene/ImageryProvider.js +387 -0
  893. package/Source/Scene/ImageryState.js +14 -0
  894. package/Source/Scene/Implicit3DTileContent.js +1154 -0
  895. package/Source/Scene/ImplicitAvailabilityBitstream.js +137 -0
  896. package/Source/Scene/ImplicitMetadataView.js +178 -0
  897. package/Source/Scene/ImplicitSubdivisionScheme.js +48 -0
  898. package/Source/Scene/ImplicitSubtree.js +1146 -0
  899. package/Source/Scene/ImplicitSubtreeMetadata.js +191 -0
  900. package/Source/Scene/ImplicitTileCoordinates.js +647 -0
  901. package/Source/Scene/ImplicitTileset.js +263 -0
  902. package/Source/Scene/InstanceAttributeSemantic.js +79 -0
  903. package/Source/Scene/InvertClassification.js +382 -0
  904. package/Source/Scene/IonImageryProvider.js +555 -0
  905. package/Source/Scene/IonWorldImageryStyle.js +33 -0
  906. package/Source/Scene/JobScheduler.js +199 -0
  907. package/Source/Scene/JobType.js +10 -0
  908. package/Source/Scene/JsonMetadataTable.js +114 -0
  909. package/Source/Scene/Label.js +1588 -0
  910. package/Source/Scene/LabelCollection.js +994 -0
  911. package/Source/Scene/LabelStyle.js +33 -0
  912. package/Source/Scene/Light.js +34 -0
  913. package/Source/Scene/MapMode2D.js +23 -0
  914. package/Source/Scene/MapboxImageryProvider.js +448 -0
  915. package/Source/Scene/MapboxStyleImageryProvider.js +457 -0
  916. package/Source/Scene/Material.js +1742 -0
  917. package/Source/Scene/MaterialAppearance.js +334 -0
  918. package/Source/Scene/MetadataClass.js +167 -0
  919. package/Source/Scene/MetadataClassProperty.js +1104 -0
  920. package/Source/Scene/MetadataComponentType.js +448 -0
  921. package/Source/Scene/MetadataEntity.js +425 -0
  922. package/Source/Scene/MetadataEnum.js +186 -0
  923. package/Source/Scene/MetadataEnumValue.js +97 -0
  924. package/Source/Scene/MetadataSchema.js +173 -0
  925. package/Source/Scene/MetadataSchemaLoader.js +145 -0
  926. package/Source/Scene/MetadataSemantic.js +145 -0
  927. package/Source/Scene/MetadataTable.js +357 -0
  928. package/Source/Scene/MetadataTableProperty.js +859 -0
  929. package/Source/Scene/MetadataType.js +208 -0
  930. package/Source/Scene/Model/AlphaPipelineStage.js +52 -0
  931. package/Source/Scene/Model/B3dmLoader.js +379 -0
  932. package/Source/Scene/Model/BatchTexturePipelineStage.js +72 -0
  933. package/Source/Scene/Model/CPUStylingPipelineStage.js +77 -0
  934. package/Source/Scene/Model/ClassificationModelDrawCommand.js +533 -0
  935. package/Source/Scene/Model/ClassificationPipelineStage.js +132 -0
  936. package/Source/Scene/Model/CustomShader.js +473 -0
  937. package/Source/Scene/Model/CustomShaderMode.js +40 -0
  938. package/Source/Scene/Model/CustomShaderPipelineStage.js +654 -0
  939. package/Source/Scene/Model/CustomShaderTranslucencyMode.js +35 -0
  940. package/Source/Scene/Model/DequantizationPipelineStage.js +178 -0
  941. package/Source/Scene/Model/FeatureIdPipelineStage.js +504 -0
  942. package/Source/Scene/Model/GeoJsonLoader.js +722 -0
  943. package/Source/Scene/Model/GeometryPipelineStage.js +558 -0
  944. package/Source/Scene/Model/I3dmLoader.js +909 -0
  945. package/Source/Scene/Model/ImageBasedLightingPipelineStage.js +147 -0
  946. package/Source/Scene/Model/InstancingPipelineStage.js +1043 -0
  947. package/Source/Scene/Model/LightingModel.js +30 -0
  948. package/Source/Scene/Model/LightingPipelineStage.js +75 -0
  949. package/Source/Scene/Model/MaterialPipelineStage.js +510 -0
  950. package/Source/Scene/Model/MetadataPipelineStage.js +638 -0
  951. package/Source/Scene/Model/Model.js +2847 -0
  952. package/Source/Scene/Model/Model3DTileContent.js +451 -0
  953. package/Source/Scene/Model/ModelAlphaOptions.js +26 -0
  954. package/Source/Scene/Model/ModelAnimation.js +422 -0
  955. package/Source/Scene/Model/ModelAnimationChannel.js +293 -0
  956. package/Source/Scene/Model/ModelAnimationCollection.js +553 -0
  957. package/Source/Scene/Model/ModelArticulation.js +214 -0
  958. package/Source/Scene/Model/ModelArticulationStage.js +261 -0
  959. package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +126 -0
  960. package/Source/Scene/Model/ModelColorPipelineStage.js +99 -0
  961. package/Source/Scene/Model/ModelDrawCommand.js +864 -0
  962. package/Source/Scene/Model/ModelFeature.js +229 -0
  963. package/Source/Scene/Model/ModelFeatureTable.js +322 -0
  964. package/Source/Scene/Model/ModelLightingOptions.js +29 -0
  965. package/Source/Scene/Model/ModelMatrixUpdateStage.js +108 -0
  966. package/Source/Scene/Model/ModelNode.js +125 -0
  967. package/Source/Scene/Model/ModelRenderResources.js +106 -0
  968. package/Source/Scene/Model/ModelRuntimeNode.js +648 -0
  969. package/Source/Scene/Model/ModelRuntimePrimitive.js +340 -0
  970. package/Source/Scene/Model/ModelSceneGraph.js +968 -0
  971. package/Source/Scene/Model/ModelSilhouettePipelineStage.js +109 -0
  972. package/Source/Scene/Model/ModelSkin.js +180 -0
  973. package/Source/Scene/Model/ModelSplitterPipelineStage.js +66 -0
  974. package/Source/Scene/Model/ModelStatistics.js +197 -0
  975. package/Source/Scene/Model/ModelType.js +94 -0
  976. package/Source/Scene/Model/ModelUtility.js +386 -0
  977. package/Source/Scene/Model/MorphTargetsPipelineStage.js +249 -0
  978. package/Source/Scene/Model/NodeRenderResources.js +160 -0
  979. package/Source/Scene/Model/NodeStatisticsPipelineStage.js +75 -0
  980. package/Source/Scene/Model/PickingPipelineStage.js +219 -0
  981. package/Source/Scene/Model/PntsLoader.js +717 -0
  982. package/Source/Scene/Model/PointCloudStylingPipelineStage.js +396 -0
  983. package/Source/Scene/Model/PrimitiveOutlineGenerator.js +689 -0
  984. package/Source/Scene/Model/PrimitiveOutlinePipelineStage.js +99 -0
  985. package/Source/Scene/Model/PrimitiveRenderResources.js +297 -0
  986. package/Source/Scene/Model/PrimitiveStatisticsPipelineStage.js +253 -0
  987. package/Source/Scene/Model/SceneMode2DPipelineStage.js +301 -0
  988. package/Source/Scene/Model/SelectedFeatureIdPipelineStage.js +185 -0
  989. package/Source/Scene/Model/SkinningPipelineStage.js +118 -0
  990. package/Source/Scene/Model/StyleCommandsNeeded.js +29 -0
  991. package/Source/Scene/Model/TextureManager.js +244 -0
  992. package/Source/Scene/Model/TextureUniform.js +74 -0
  993. package/Source/Scene/Model/TilesetPipelineStage.js +73 -0
  994. package/Source/Scene/Model/UniformType.js +124 -0
  995. package/Source/Scene/Model/VaryingType.js +61 -0
  996. package/Source/Scene/Model/WireframePipelineStage.js +118 -0
  997. package/Source/Scene/Model/buildDrawCommand.js +153 -0
  998. package/Source/Scene/ModelAnimationLoop.js +33 -0
  999. package/Source/Scene/ModelAnimationState.js +9 -0
  1000. package/Source/Scene/ModelComponents.js +1466 -0
  1001. package/Source/Scene/Moon.js +174 -0
  1002. package/Source/Scene/Multiple3DTileContent.js +674 -0
  1003. package/Source/Scene/NeverTileDiscardPolicy.js +28 -0
  1004. package/Source/Scene/OIT.js +893 -0
  1005. package/Source/Scene/OctahedralProjectedCubeMap.js +456 -0
  1006. package/Source/Scene/OpenStreetMapImageryProvider.js +124 -0
  1007. package/Source/Scene/OrderedGroundPrimitiveCollection.js +219 -0
  1008. package/Source/Scene/Particle.js +155 -0
  1009. package/Source/Scene/ParticleBurst.js +51 -0
  1010. package/Source/Scene/ParticleEmitter.js +36 -0
  1011. package/Source/Scene/ParticleSystem.js +910 -0
  1012. package/Source/Scene/PerInstanceColorAppearance.js +296 -0
  1013. package/Source/Scene/PerformanceDisplay.js +120 -0
  1014. package/Source/Scene/PickDepth.js +105 -0
  1015. package/Source/Scene/PickDepthFramebuffer.js +79 -0
  1016. package/Source/Scene/PickFramebuffer.js +125 -0
  1017. package/Source/Scene/Picking.js +1316 -0
  1018. package/Source/Scene/PntsParser.js +480 -0
  1019. package/Source/Scene/PointCloud.js +1425 -0
  1020. package/Source/Scene/PointCloudEyeDomeLighting.js +279 -0
  1021. package/Source/Scene/PointCloudShading.js +113 -0
  1022. package/Source/Scene/PointPrimitive.js +668 -0
  1023. package/Source/Scene/PointPrimitiveCollection.js +1217 -0
  1024. package/Source/Scene/Polyline.js +431 -0
  1025. package/Source/Scene/PolylineCollection.js +1962 -0
  1026. package/Source/Scene/PolylineColorAppearance.js +224 -0
  1027. package/Source/Scene/PolylineMaterialAppearance.js +236 -0
  1028. package/Source/Scene/PostProcessStage.js +1023 -0
  1029. package/Source/Scene/PostProcessStageCollection.js +888 -0
  1030. package/Source/Scene/PostProcessStageComposite.js +362 -0
  1031. package/Source/Scene/PostProcessStageLibrary.js +838 -0
  1032. package/Source/Scene/PostProcessStageSampleMode.js +22 -0
  1033. package/Source/Scene/PostProcessStageTextureCache.js +454 -0
  1034. package/Source/Scene/Primitive.js +2536 -0
  1035. package/Source/Scene/PrimitiveCollection.js +467 -0
  1036. package/Source/Scene/PrimitiveLoadPlan.js +280 -0
  1037. package/Source/Scene/PrimitivePipeline.js +855 -0
  1038. package/Source/Scene/PrimitiveState.js +13 -0
  1039. package/Source/Scene/PropertyAttribute.js +160 -0
  1040. package/Source/Scene/PropertyAttributeProperty.js +165 -0
  1041. package/Source/Scene/PropertyTable.js +541 -0
  1042. package/Source/Scene/PropertyTexture.js +162 -0
  1043. package/Source/Scene/PropertyTextureProperty.js +263 -0
  1044. package/Source/Scene/QuadtreeOccluders.js +30 -0
  1045. package/Source/Scene/QuadtreePrimitive.js +1546 -0
  1046. package/Source/Scene/QuadtreeTile.js +539 -0
  1047. package/Source/Scene/QuadtreeTileLoadState.js +39 -0
  1048. package/Source/Scene/QuadtreeTileProvider.js +226 -0
  1049. package/Source/Scene/ResourceCache.js +810 -0
  1050. package/Source/Scene/ResourceCacheKey.js +567 -0
  1051. package/Source/Scene/ResourceCacheStatistics.js +183 -0
  1052. package/Source/Scene/ResourceLoader.js +139 -0
  1053. package/Source/Scene/ResourceLoaderState.js +48 -0
  1054. package/Source/Scene/SDFSettings.js +39 -0
  1055. package/Source/Scene/Scene.js +4498 -0
  1056. package/Source/Scene/SceneFramebuffer.js +106 -0
  1057. package/Source/Scene/SceneMode.js +56 -0
  1058. package/Source/Scene/SceneTransforms.js +466 -0
  1059. package/Source/Scene/SceneTransitioner.js +1111 -0
  1060. package/Source/Scene/ScreenSpaceCameraController.js +2933 -0
  1061. package/Source/Scene/ShadowMap.js +1958 -0
  1062. package/Source/Scene/ShadowMapShader.js +395 -0
  1063. package/Source/Scene/ShadowMode.js +78 -0
  1064. package/Source/Scene/ShadowVolumeAppearance.js +937 -0
  1065. package/Source/Scene/SingleTileImageryProvider.js +501 -0
  1066. package/Source/Scene/SkyAtmosphere.js +402 -0
  1067. package/Source/Scene/SkyBox.js +252 -0
  1068. package/Source/Scene/SphereEmitter.js +66 -0
  1069. package/Source/Scene/SplitDirection.js +34 -0
  1070. package/Source/Scene/Splitter.js +49 -0
  1071. package/Source/Scene/StencilConstants.js +37 -0
  1072. package/Source/Scene/StencilFunction.js +73 -0
  1073. package/Source/Scene/StencilOperation.js +73 -0
  1074. package/Source/Scene/StructuralMetadata.js +243 -0
  1075. package/Source/Scene/StyleExpression.js +86 -0
  1076. package/Source/Scene/Sun.js +359 -0
  1077. package/Source/Scene/SunLight.js +31 -0
  1078. package/Source/Scene/SunPostProcess.js +288 -0
  1079. package/Source/Scene/SupportedImageFormats.js +18 -0
  1080. package/Source/Scene/TerrainFillMesh.js +2220 -0
  1081. package/Source/Scene/TerrainState.js +13 -0
  1082. package/Source/Scene/TextureAtlas.js +556 -0
  1083. package/Source/Scene/TileBoundingRegion.js +490 -0
  1084. package/Source/Scene/TileBoundingS2Cell.js +703 -0
  1085. package/Source/Scene/TileBoundingSphere.js +167 -0
  1086. package/Source/Scene/TileBoundingVolume.js +68 -0
  1087. package/Source/Scene/TileCoordinatesImageryProvider.js +379 -0
  1088. package/Source/Scene/TileDiscardPolicy.js +34 -0
  1089. package/Source/Scene/TileImagery.js +130 -0
  1090. package/Source/Scene/TileMapServiceImageryProvider.js +403 -0
  1091. package/Source/Scene/TileMetadata.js +184 -0
  1092. package/Source/Scene/TileOrientedBoundingBox.js +219 -0
  1093. package/Source/Scene/TileReplacementQueue.js +119 -0
  1094. package/Source/Scene/TileSelectionResult.js +80 -0
  1095. package/Source/Scene/TileState.js +10 -0
  1096. package/Source/Scene/Tileset3DTileContent.js +158 -0
  1097. package/Source/Scene/TilesetMetadata.js +186 -0
  1098. package/Source/Scene/TimeDynamicImagery.js +308 -0
  1099. package/Source/Scene/TimeDynamicPointCloud.js +819 -0
  1100. package/Source/Scene/Tonemapper.js +52 -0
  1101. package/Source/Scene/TranslucentTileClassification.js +524 -0
  1102. package/Source/Scene/TweenCollection.js +588 -0
  1103. package/Source/Scene/UrlTemplateImageryProvider.js +1240 -0
  1104. package/Source/Scene/Vector3DTileBatch.js +37 -0
  1105. package/Source/Scene/Vector3DTileClampedPolylines.js +772 -0
  1106. package/Source/Scene/Vector3DTileContent.js +774 -0
  1107. package/Source/Scene/Vector3DTileGeometry.js +490 -0
  1108. package/Source/Scene/Vector3DTilePoints.js +529 -0
  1109. package/Source/Scene/Vector3DTilePolygons.js +479 -0
  1110. package/Source/Scene/Vector3DTilePolylines.js +676 -0
  1111. package/Source/Scene/Vector3DTilePrimitive.js +1282 -0
  1112. package/Source/Scene/VertexAttributeSemantic.js +273 -0
  1113. package/Source/Scene/VerticalOrigin.js +49 -0
  1114. package/Source/Scene/View.js +431 -0
  1115. package/Source/Scene/ViewportQuad.js +182 -0
  1116. package/Source/Scene/WebMapServiceImageryProvider.js +768 -0
  1117. package/Source/Scene/WebMapTileServiceImageryProvider.js +711 -0
  1118. package/Source/Scene/computeFlyToLocationForRectangle.js +69 -0
  1119. package/Source/Scene/createBillboardPointCallback.js +70 -0
  1120. package/Source/Scene/createElevationBandMaterial.js +585 -0
  1121. package/Source/Scene/createOsmBuildings.js +75 -0
  1122. package/Source/Scene/createTangentSpaceDebugPrimitive.js +116 -0
  1123. package/Source/Scene/createWorldImagery.js +38 -0
  1124. package/Source/Scene/findContentMetadata.js +54 -0
  1125. package/Source/Scene/findGroupMetadata.js +39 -0
  1126. package/Source/Scene/findTileMetadata.js +56 -0
  1127. package/Source/Scene/getBinaryAccessor.js +56 -0
  1128. package/Source/Scene/getClipAndStyleCode.js +34 -0
  1129. package/Source/Scene/getClippingFunction.js +163 -0
  1130. package/Source/Scene/hasExtension.js +19 -0
  1131. package/Source/Scene/parseBatchTable.js +439 -0
  1132. package/Source/Scene/parseBoundingVolumeSemantics.js +121 -0
  1133. package/Source/Scene/parseFeatureMetadataLegacy.js +139 -0
  1134. package/Source/Scene/parseStructuralMetadata.js +102 -0
  1135. package/Source/Scene/preprocess3DTileContent.js +94 -0
  1136. package/Source/Shaders/AdjustTranslucentFS.glsl +24 -0
  1137. package/Source/Shaders/AdjustTranslucentFS.js +26 -0
  1138. package/Source/Shaders/Appearances/AllMaterialAppearanceFS.glsl +29 -0
  1139. package/Source/Shaders/Appearances/AllMaterialAppearanceFS.js +31 -0
  1140. package/Source/Shaders/Appearances/AllMaterialAppearanceVS.glsl +26 -0
  1141. package/Source/Shaders/Appearances/AllMaterialAppearanceVS.js +28 -0
  1142. package/Source/Shaders/Appearances/BasicMaterialAppearanceFS.glsl +23 -0
  1143. package/Source/Shaders/Appearances/BasicMaterialAppearanceFS.js +25 -0
  1144. package/Source/Shaders/Appearances/BasicMaterialAppearanceVS.glsl +17 -0
  1145. package/Source/Shaders/Appearances/BasicMaterialAppearanceVS.js +19 -0
  1146. package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.glsl +33 -0
  1147. package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.js +35 -0
  1148. package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.glsl +19 -0
  1149. package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.js +21 -0
  1150. package/Source/Shaders/Appearances/PerInstanceColorAppearanceFS.glsl +24 -0
  1151. package/Source/Shaders/Appearances/PerInstanceColorAppearanceFS.js +26 -0
  1152. package/Source/Shaders/Appearances/PerInstanceColorAppearanceVS.glsl +20 -0
  1153. package/Source/Shaders/Appearances/PerInstanceColorAppearanceVS.js +22 -0
  1154. package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.glsl +6 -0
  1155. package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js +8 -0
  1156. package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.glsl +15 -0
  1157. package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.js +17 -0
  1158. package/Source/Shaders/Appearances/PolylineColorAppearanceVS.glsl +28 -0
  1159. package/Source/Shaders/Appearances/PolylineColorAppearanceVS.js +30 -0
  1160. package/Source/Shaders/Appearances/PolylineMaterialAppearanceVS.glsl +33 -0
  1161. package/Source/Shaders/Appearances/PolylineMaterialAppearanceVS.js +35 -0
  1162. package/Source/Shaders/Appearances/TexturedMaterialAppearanceFS.glsl +25 -0
  1163. package/Source/Shaders/Appearances/TexturedMaterialAppearanceFS.js +27 -0
  1164. package/Source/Shaders/Appearances/TexturedMaterialAppearanceVS.glsl +20 -0
  1165. package/Source/Shaders/Appearances/TexturedMaterialAppearanceVS.js +22 -0
  1166. package/Source/Shaders/AtmosphereCommon.glsl +152 -0
  1167. package/Source/Shaders/AtmosphereCommon.js +154 -0
  1168. package/Source/Shaders/BillboardCollectionFS.glsl +208 -0
  1169. package/Source/Shaders/BillboardCollectionFS.js +210 -0
  1170. package/Source/Shaders/BillboardCollectionVS.glsl +434 -0
  1171. package/Source/Shaders/BillboardCollectionVS.js +436 -0
  1172. package/Source/Shaders/BrdfLutGeneratorFS.glsl +83 -0
  1173. package/Source/Shaders/BrdfLutGeneratorFS.js +85 -0
  1174. package/Source/Shaders/Builtin/Constants/degreesPerRadian.glsl +16 -0
  1175. package/Source/Shaders/Builtin/Constants/degreesPerRadian.js +18 -0
  1176. package/Source/Shaders/Builtin/Constants/depthRange.glsl +14 -0
  1177. package/Source/Shaders/Builtin/Constants/depthRange.js +16 -0
  1178. package/Source/Shaders/Builtin/Constants/epsilon1.glsl +7 -0
  1179. package/Source/Shaders/Builtin/Constants/epsilon1.js +9 -0
  1180. package/Source/Shaders/Builtin/Constants/epsilon2.glsl +7 -0
  1181. package/Source/Shaders/Builtin/Constants/epsilon2.js +9 -0
  1182. package/Source/Shaders/Builtin/Constants/epsilon3.glsl +7 -0
  1183. package/Source/Shaders/Builtin/Constants/epsilon3.js +9 -0
  1184. package/Source/Shaders/Builtin/Constants/epsilon4.glsl +7 -0
  1185. package/Source/Shaders/Builtin/Constants/epsilon4.js +9 -0
  1186. package/Source/Shaders/Builtin/Constants/epsilon5.glsl +7 -0
  1187. package/Source/Shaders/Builtin/Constants/epsilon5.js +9 -0
  1188. package/Source/Shaders/Builtin/Constants/epsilon6.glsl +7 -0
  1189. package/Source/Shaders/Builtin/Constants/epsilon6.js +9 -0
  1190. package/Source/Shaders/Builtin/Constants/epsilon7.glsl +7 -0
  1191. package/Source/Shaders/Builtin/Constants/epsilon7.js +9 -0
  1192. package/Source/Shaders/Builtin/Constants/infinity.glsl +7 -0
  1193. package/Source/Shaders/Builtin/Constants/infinity.js +9 -0
  1194. package/Source/Shaders/Builtin/Constants/oneOverPi.glsl +16 -0
  1195. package/Source/Shaders/Builtin/Constants/oneOverPi.js +18 -0
  1196. package/Source/Shaders/Builtin/Constants/oneOverTwoPi.glsl +16 -0
  1197. package/Source/Shaders/Builtin/Constants/oneOverTwoPi.js +18 -0
  1198. package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +9 -0
  1199. package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +11 -0
  1200. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +9 -0
  1201. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +11 -0
  1202. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +9 -0
  1203. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +11 -0
  1204. package/Source/Shaders/Builtin/Constants/passClassification.glsl +9 -0
  1205. package/Source/Shaders/Builtin/Constants/passClassification.js +11 -0
  1206. package/Source/Shaders/Builtin/Constants/passCompute.glsl +9 -0
  1207. package/Source/Shaders/Builtin/Constants/passCompute.js +11 -0
  1208. package/Source/Shaders/Builtin/Constants/passEnvironment.glsl +9 -0
  1209. package/Source/Shaders/Builtin/Constants/passEnvironment.js +11 -0
  1210. package/Source/Shaders/Builtin/Constants/passGlobe.glsl +9 -0
  1211. package/Source/Shaders/Builtin/Constants/passGlobe.js +11 -0
  1212. package/Source/Shaders/Builtin/Constants/passOpaque.glsl +9 -0
  1213. package/Source/Shaders/Builtin/Constants/passOpaque.js +11 -0
  1214. package/Source/Shaders/Builtin/Constants/passOverlay.glsl +9 -0
  1215. package/Source/Shaders/Builtin/Constants/passOverlay.js +11 -0
  1216. package/Source/Shaders/Builtin/Constants/passTerrainClassification.glsl +9 -0
  1217. package/Source/Shaders/Builtin/Constants/passTerrainClassification.js +11 -0
  1218. package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +9 -0
  1219. package/Source/Shaders/Builtin/Constants/passTranslucent.js +11 -0
  1220. package/Source/Shaders/Builtin/Constants/pi.glsl +16 -0
  1221. package/Source/Shaders/Builtin/Constants/pi.js +18 -0
  1222. package/Source/Shaders/Builtin/Constants/piOverFour.glsl +16 -0
  1223. package/Source/Shaders/Builtin/Constants/piOverFour.js +18 -0
  1224. package/Source/Shaders/Builtin/Constants/piOverSix.glsl +16 -0
  1225. package/Source/Shaders/Builtin/Constants/piOverSix.js +18 -0
  1226. package/Source/Shaders/Builtin/Constants/piOverThree.glsl +16 -0
  1227. package/Source/Shaders/Builtin/Constants/piOverThree.js +18 -0
  1228. package/Source/Shaders/Builtin/Constants/piOverTwo.glsl +16 -0
  1229. package/Source/Shaders/Builtin/Constants/piOverTwo.js +18 -0
  1230. package/Source/Shaders/Builtin/Constants/radiansPerDegree.glsl +16 -0
  1231. package/Source/Shaders/Builtin/Constants/radiansPerDegree.js +18 -0
  1232. package/Source/Shaders/Builtin/Constants/sceneMode2D.glsl +11 -0
  1233. package/Source/Shaders/Builtin/Constants/sceneMode2D.js +13 -0
  1234. package/Source/Shaders/Builtin/Constants/sceneMode3D.glsl +11 -0
  1235. package/Source/Shaders/Builtin/Constants/sceneMode3D.js +13 -0
  1236. package/Source/Shaders/Builtin/Constants/sceneModeColumbusView.glsl +11 -0
  1237. package/Source/Shaders/Builtin/Constants/sceneModeColumbusView.js +13 -0
  1238. package/Source/Shaders/Builtin/Constants/sceneModeMorphing.glsl +11 -0
  1239. package/Source/Shaders/Builtin/Constants/sceneModeMorphing.js +13 -0
  1240. package/Source/Shaders/Builtin/Constants/solarRadius.glsl +13 -0
  1241. package/Source/Shaders/Builtin/Constants/solarRadius.js +15 -0
  1242. package/Source/Shaders/Builtin/Constants/threePiOver2.glsl +16 -0
  1243. package/Source/Shaders/Builtin/Constants/threePiOver2.js +18 -0
  1244. package/Source/Shaders/Builtin/Constants/twoPi.glsl +16 -0
  1245. package/Source/Shaders/Builtin/Constants/twoPi.js +18 -0
  1246. package/Source/Shaders/Builtin/Constants/webMercatorMaxLatitude.glsl +16 -0
  1247. package/Source/Shaders/Builtin/Constants/webMercatorMaxLatitude.js +18 -0
  1248. package/Source/Shaders/Builtin/CzmBuiltins.js +262 -0
  1249. package/Source/Shaders/Builtin/Functions/HSBToRGB.glsl +24 -0
  1250. package/Source/Shaders/Builtin/Functions/HSBToRGB.js +26 -0
  1251. package/Source/Shaders/Builtin/Functions/HSLToRGB.glsl +31 -0
  1252. package/Source/Shaders/Builtin/Functions/HSLToRGB.js +33 -0
  1253. package/Source/Shaders/Builtin/Functions/RGBToHSB.glsl +27 -0
  1254. package/Source/Shaders/Builtin/Functions/RGBToHSB.js +29 -0
  1255. package/Source/Shaders/Builtin/Functions/RGBToHSL.glsl +34 -0
  1256. package/Source/Shaders/Builtin/Functions/RGBToHSL.js +36 -0
  1257. package/Source/Shaders/Builtin/Functions/RGBToXYZ.glsl +30 -0
  1258. package/Source/Shaders/Builtin/Functions/RGBToXYZ.js +32 -0
  1259. package/Source/Shaders/Builtin/Functions/XYZToRGB.glsl +30 -0
  1260. package/Source/Shaders/Builtin/Functions/XYZToRGB.js +32 -0
  1261. package/Source/Shaders/Builtin/Functions/acesTonemapping.glsl +16 -0
  1262. package/Source/Shaders/Builtin/Functions/acesTonemapping.js +18 -0
  1263. package/Source/Shaders/Builtin/Functions/alphaWeight.glsl +11 -0
  1264. package/Source/Shaders/Builtin/Functions/alphaWeight.js +13 -0
  1265. package/Source/Shaders/Builtin/Functions/antialias.glsl +39 -0
  1266. package/Source/Shaders/Builtin/Functions/antialias.js +41 -0
  1267. package/Source/Shaders/Builtin/Functions/approximateSphericalCoordinates.glsl +18 -0
  1268. package/Source/Shaders/Builtin/Functions/approximateSphericalCoordinates.js +20 -0
  1269. package/Source/Shaders/Builtin/Functions/backFacing.glsl +13 -0
  1270. package/Source/Shaders/Builtin/Functions/backFacing.js +15 -0
  1271. package/Source/Shaders/Builtin/Functions/branchFreeTernary.glsl +71 -0
  1272. package/Source/Shaders/Builtin/Functions/branchFreeTernary.js +73 -0
  1273. package/Source/Shaders/Builtin/Functions/cascadeColor.glsl +8 -0
  1274. package/Source/Shaders/Builtin/Functions/cascadeColor.js +10 -0
  1275. package/Source/Shaders/Builtin/Functions/cascadeDistance.glsl +7 -0
  1276. package/Source/Shaders/Builtin/Functions/cascadeDistance.js +9 -0
  1277. package/Source/Shaders/Builtin/Functions/cascadeMatrix.glsl +10 -0
  1278. package/Source/Shaders/Builtin/Functions/cascadeMatrix.js +12 -0
  1279. package/Source/Shaders/Builtin/Functions/cascadeWeights.glsl +10 -0
  1280. package/Source/Shaders/Builtin/Functions/cascadeWeights.js +12 -0
  1281. package/Source/Shaders/Builtin/Functions/columbusViewMorph.glsl +12 -0
  1282. package/Source/Shaders/Builtin/Functions/columbusViewMorph.js +14 -0
  1283. package/Source/Shaders/Builtin/Functions/computePosition.glsl +22 -0
  1284. package/Source/Shaders/Builtin/Functions/computePosition.js +24 -0
  1285. package/Source/Shaders/Builtin/Functions/cosineAndSine.glsl +211 -0
  1286. package/Source/Shaders/Builtin/Functions/cosineAndSine.js +213 -0
  1287. package/Source/Shaders/Builtin/Functions/decompressTextureCoordinates.glsl +17 -0
  1288. package/Source/Shaders/Builtin/Functions/decompressTextureCoordinates.js +19 -0
  1289. package/Source/Shaders/Builtin/Functions/defaultPbrMaterial.glsl +16 -0
  1290. package/Source/Shaders/Builtin/Functions/defaultPbrMaterial.js +18 -0
  1291. package/Source/Shaders/Builtin/Functions/depthClamp.glsl +47 -0
  1292. package/Source/Shaders/Builtin/Functions/depthClamp.js +49 -0
  1293. package/Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.glsl +33 -0
  1294. package/Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.js +35 -0
  1295. package/Source/Shaders/Builtin/Functions/ellipsoidContainsPoint.glsl +12 -0
  1296. package/Source/Shaders/Builtin/Functions/ellipsoidContainsPoint.js +14 -0
  1297. package/Source/Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates.glsl +10 -0
  1298. package/Source/Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates.js +12 -0
  1299. package/Source/Shaders/Builtin/Functions/equalsEpsilon.glsl +36 -0
  1300. package/Source/Shaders/Builtin/Functions/equalsEpsilon.js +38 -0
  1301. package/Source/Shaders/Builtin/Functions/eyeOffset.glsl +20 -0
  1302. package/Source/Shaders/Builtin/Functions/eyeOffset.js +22 -0
  1303. package/Source/Shaders/Builtin/Functions/eyeToWindowCoordinates.glsl +32 -0
  1304. package/Source/Shaders/Builtin/Functions/eyeToWindowCoordinates.js +34 -0
  1305. package/Source/Shaders/Builtin/Functions/fastApproximateAtan.glsl +55 -0
  1306. package/Source/Shaders/Builtin/Functions/fastApproximateAtan.js +57 -0
  1307. package/Source/Shaders/Builtin/Functions/fog.glsl +38 -0
  1308. package/Source/Shaders/Builtin/Functions/fog.js +40 -0
  1309. package/Source/Shaders/Builtin/Functions/gammaCorrect.glsl +22 -0
  1310. package/Source/Shaders/Builtin/Functions/gammaCorrect.js +24 -0
  1311. package/Source/Shaders/Builtin/Functions/geodeticSurfaceNormal.glsl +16 -0
  1312. package/Source/Shaders/Builtin/Functions/geodeticSurfaceNormal.js +18 -0
  1313. package/Source/Shaders/Builtin/Functions/getDefaultMaterial.glsl +27 -0
  1314. package/Source/Shaders/Builtin/Functions/getDefaultMaterial.js +29 -0
  1315. package/Source/Shaders/Builtin/Functions/getLambertDiffuse.glsl +22 -0
  1316. package/Source/Shaders/Builtin/Functions/getLambertDiffuse.js +24 -0
  1317. package/Source/Shaders/Builtin/Functions/getSpecular.glsl +29 -0
  1318. package/Source/Shaders/Builtin/Functions/getSpecular.js +31 -0
  1319. package/Source/Shaders/Builtin/Functions/getWaterNoise.glsl +37 -0
  1320. package/Source/Shaders/Builtin/Functions/getWaterNoise.js +39 -0
  1321. package/Source/Shaders/Builtin/Functions/hue.glsl +30 -0
  1322. package/Source/Shaders/Builtin/Functions/hue.js +32 -0
  1323. package/Source/Shaders/Builtin/Functions/inverseGamma.glsl +12 -0
  1324. package/Source/Shaders/Builtin/Functions/inverseGamma.js +14 -0
  1325. package/Source/Shaders/Builtin/Functions/isEmpty.glsl +19 -0
  1326. package/Source/Shaders/Builtin/Functions/isEmpty.js +21 -0
  1327. package/Source/Shaders/Builtin/Functions/isFull.glsl +19 -0
  1328. package/Source/Shaders/Builtin/Functions/isFull.js +21 -0
  1329. package/Source/Shaders/Builtin/Functions/latitudeToWebMercatorFraction.glsl +21 -0
  1330. package/Source/Shaders/Builtin/Functions/latitudeToWebMercatorFraction.js +23 -0
  1331. package/Source/Shaders/Builtin/Functions/lineDistance.glsl +14 -0
  1332. package/Source/Shaders/Builtin/Functions/lineDistance.js +16 -0
  1333. package/Source/Shaders/Builtin/Functions/linearToSrgb.glsl +16 -0
  1334. package/Source/Shaders/Builtin/Functions/linearToSrgb.js +18 -0
  1335. package/Source/Shaders/Builtin/Functions/luminance.glsl +20 -0
  1336. package/Source/Shaders/Builtin/Functions/luminance.js +22 -0
  1337. package/Source/Shaders/Builtin/Functions/metersPerPixel.glsl +61 -0
  1338. package/Source/Shaders/Builtin/Functions/metersPerPixel.js +63 -0
  1339. package/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.glsl +37 -0
  1340. package/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.js +39 -0
  1341. package/Source/Shaders/Builtin/Functions/multiplyWithColorBalance.glsl +18 -0
  1342. package/Source/Shaders/Builtin/Functions/multiplyWithColorBalance.js +20 -0
  1343. package/Source/Shaders/Builtin/Functions/nearFarScalar.glsl +26 -0
  1344. package/Source/Shaders/Builtin/Functions/nearFarScalar.js +28 -0
  1345. package/Source/Shaders/Builtin/Functions/octDecode.glsl +83 -0
  1346. package/Source/Shaders/Builtin/Functions/octDecode.js +85 -0
  1347. package/Source/Shaders/Builtin/Functions/packDepth.glsl +18 -0
  1348. package/Source/Shaders/Builtin/Functions/packDepth.js +20 -0
  1349. package/Source/Shaders/Builtin/Functions/pbrLighting.glsl +99 -0
  1350. package/Source/Shaders/Builtin/Functions/pbrLighting.js +101 -0
  1351. package/Source/Shaders/Builtin/Functions/pbrMetallicRoughnessMaterial.glsl +37 -0
  1352. package/Source/Shaders/Builtin/Functions/pbrMetallicRoughnessMaterial.js +39 -0
  1353. package/Source/Shaders/Builtin/Functions/pbrSpecularGlossinessMaterial.glsl +30 -0
  1354. package/Source/Shaders/Builtin/Functions/pbrSpecularGlossinessMaterial.js +32 -0
  1355. package/Source/Shaders/Builtin/Functions/phong.glsl +63 -0
  1356. package/Source/Shaders/Builtin/Functions/phong.js +65 -0
  1357. package/Source/Shaders/Builtin/Functions/planeDistance.glsl +28 -0
  1358. package/Source/Shaders/Builtin/Functions/planeDistance.js +30 -0
  1359. package/Source/Shaders/Builtin/Functions/pointAlongRay.glsl +19 -0
  1360. package/Source/Shaders/Builtin/Functions/pointAlongRay.js +21 -0
  1361. package/Source/Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval.glsl +83 -0
  1362. package/Source/Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval.js +85 -0
  1363. package/Source/Shaders/Builtin/Functions/raySphereIntersectionInterval.glsl +36 -0
  1364. package/Source/Shaders/Builtin/Functions/raySphereIntersectionInterval.js +38 -0
  1365. package/Source/Shaders/Builtin/Functions/readDepth.glsl +4 -0
  1366. package/Source/Shaders/Builtin/Functions/readDepth.js +6 -0
  1367. package/Source/Shaders/Builtin/Functions/readNonPerspective.glsl +31 -0
  1368. package/Source/Shaders/Builtin/Functions/readNonPerspective.js +33 -0
  1369. package/Source/Shaders/Builtin/Functions/reverseLogDepth.glsl +11 -0
  1370. package/Source/Shaders/Builtin/Functions/reverseLogDepth.js +13 -0
  1371. package/Source/Shaders/Builtin/Functions/round.glsl +22 -0
  1372. package/Source/Shaders/Builtin/Functions/round.js +24 -0
  1373. package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.glsl +78 -0
  1374. package/Source/Shaders/Builtin/Functions/sampleOctahedralProjection.js +80 -0
  1375. package/Source/Shaders/Builtin/Functions/saturation.glsl +22 -0
  1376. package/Source/Shaders/Builtin/Functions/saturation.js +24 -0
  1377. package/Source/Shaders/Builtin/Functions/shadowDepthCompare.glsl +24 -0
  1378. package/Source/Shaders/Builtin/Functions/shadowDepthCompare.js +26 -0
  1379. package/Source/Shaders/Builtin/Functions/shadowVisibility.glsl +66 -0
  1380. package/Source/Shaders/Builtin/Functions/shadowVisibility.js +68 -0
  1381. package/Source/Shaders/Builtin/Functions/signNotZero.glsl +29 -0
  1382. package/Source/Shaders/Builtin/Functions/signNotZero.js +31 -0
  1383. package/Source/Shaders/Builtin/Functions/sphericalHarmonics.glsl +42 -0
  1384. package/Source/Shaders/Builtin/Functions/sphericalHarmonics.js +44 -0
  1385. package/Source/Shaders/Builtin/Functions/srgbToLinear.glsl +16 -0
  1386. package/Source/Shaders/Builtin/Functions/srgbToLinear.js +18 -0
  1387. package/Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl +25 -0
  1388. package/Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.js +27 -0
  1389. package/Source/Shaders/Builtin/Functions/transformPlane.glsl +15 -0
  1390. package/Source/Shaders/Builtin/Functions/transformPlane.js +17 -0
  1391. package/Source/Shaders/Builtin/Functions/translateRelativeToEye.glsl +40 -0
  1392. package/Source/Shaders/Builtin/Functions/translateRelativeToEye.js +42 -0
  1393. package/Source/Shaders/Builtin/Functions/translucentPhong.glsl +27 -0
  1394. package/Source/Shaders/Builtin/Functions/translucentPhong.js +29 -0
  1395. package/Source/Shaders/Builtin/Functions/transpose.glsl +45 -0
  1396. package/Source/Shaders/Builtin/Functions/transpose.js +47 -0
  1397. package/Source/Shaders/Builtin/Functions/unpackDepth.glsl +16 -0
  1398. package/Source/Shaders/Builtin/Functions/unpackDepth.js +18 -0
  1399. package/Source/Shaders/Builtin/Functions/unpackFloat.glsl +24 -0
  1400. package/Source/Shaders/Builtin/Functions/unpackFloat.js +26 -0
  1401. package/Source/Shaders/Builtin/Functions/unpackUint.glsl +31 -0
  1402. package/Source/Shaders/Builtin/Functions/unpackUint.js +33 -0
  1403. package/Source/Shaders/Builtin/Functions/valueTransform.glsl +38 -0
  1404. package/Source/Shaders/Builtin/Functions/valueTransform.js +40 -0
  1405. package/Source/Shaders/Builtin/Functions/vertexLogDepth.glsl +64 -0
  1406. package/Source/Shaders/Builtin/Functions/vertexLogDepth.js +66 -0
  1407. package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.glsl +99 -0
  1408. package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js +101 -0
  1409. package/Source/Shaders/Builtin/Functions/writeDepthClamp.glsl +27 -0
  1410. package/Source/Shaders/Builtin/Functions/writeDepthClamp.js +29 -0
  1411. package/Source/Shaders/Builtin/Functions/writeLogDepth.glsl +82 -0
  1412. package/Source/Shaders/Builtin/Functions/writeLogDepth.js +84 -0
  1413. package/Source/Shaders/Builtin/Functions/writeNonPerspective.glsl +32 -0
  1414. package/Source/Shaders/Builtin/Functions/writeNonPerspective.js +34 -0
  1415. package/Source/Shaders/Builtin/Structs/depthRangeStruct.glsl +9 -0
  1416. package/Source/Shaders/Builtin/Structs/depthRangeStruct.js +11 -0
  1417. package/Source/Shaders/Builtin/Structs/material.glsl +22 -0
  1418. package/Source/Shaders/Builtin/Structs/material.js +24 -0
  1419. package/Source/Shaders/Builtin/Structs/materialInput.glsl +28 -0
  1420. package/Source/Shaders/Builtin/Structs/materialInput.js +30 -0
  1421. package/Source/Shaders/Builtin/Structs/modelMaterial.glsl +29 -0
  1422. package/Source/Shaders/Builtin/Structs/modelMaterial.js +31 -0
  1423. package/Source/Shaders/Builtin/Structs/modelVertexOutput.glsl +16 -0
  1424. package/Source/Shaders/Builtin/Structs/modelVertexOutput.js +18 -0
  1425. package/Source/Shaders/Builtin/Structs/pbrParameters.glsl +16 -0
  1426. package/Source/Shaders/Builtin/Structs/pbrParameters.js +18 -0
  1427. package/Source/Shaders/Builtin/Structs/ray.glsl +11 -0
  1428. package/Source/Shaders/Builtin/Structs/ray.js +13 -0
  1429. package/Source/Shaders/Builtin/Structs/raySegment.glsl +27 -0
  1430. package/Source/Shaders/Builtin/Structs/raySegment.js +29 -0
  1431. package/Source/Shaders/Builtin/Structs/shadowParameters.glsl +15 -0
  1432. package/Source/Shaders/Builtin/Structs/shadowParameters.js +17 -0
  1433. package/Source/Shaders/CloudCollectionFS.glsl +263 -0
  1434. package/Source/Shaders/CloudCollectionFS.js +265 -0
  1435. package/Source/Shaders/CloudCollectionVS.glsl +48 -0
  1436. package/Source/Shaders/CloudCollectionVS.js +50 -0
  1437. package/Source/Shaders/CloudNoiseFS.glsl +92 -0
  1438. package/Source/Shaders/CloudNoiseFS.js +94 -0
  1439. package/Source/Shaders/CloudNoiseVS.glsl +18 -0
  1440. package/Source/Shaders/CloudNoiseVS.js +20 -0
  1441. package/Source/Shaders/CompareAndPackTranslucentDepth.glsl +12 -0
  1442. package/Source/Shaders/CompareAndPackTranslucentDepth.js +14 -0
  1443. package/Source/Shaders/CompositeOITFS.glsl +31 -0
  1444. package/Source/Shaders/CompositeOITFS.js +33 -0
  1445. package/Source/Shaders/DepthPlaneFS.glsl +36 -0
  1446. package/Source/Shaders/DepthPlaneFS.js +38 -0
  1447. package/Source/Shaders/DepthPlaneVS.glsl +11 -0
  1448. package/Source/Shaders/DepthPlaneVS.js +13 -0
  1449. package/Source/Shaders/EllipsoidFS.glsl +112 -0
  1450. package/Source/Shaders/EllipsoidFS.js +114 -0
  1451. package/Source/Shaders/EllipsoidVS.glsl +28 -0
  1452. package/Source/Shaders/EllipsoidVS.js +30 -0
  1453. package/Source/Shaders/FXAA3_11.glsl +648 -0
  1454. package/Source/Shaders/FXAA3_11.js +678 -0
  1455. package/Source/Shaders/GlobeFS.glsl +652 -0
  1456. package/Source/Shaders/GlobeFS.js +654 -0
  1457. package/Source/Shaders/GlobeVS.glsl +253 -0
  1458. package/Source/Shaders/GlobeVS.js +255 -0
  1459. package/Source/Shaders/GroundAtmosphere.glsl +18 -0
  1460. package/Source/Shaders/GroundAtmosphere.js +20 -0
  1461. package/Source/Shaders/Materials/AspectRampMaterial.glsl +11 -0
  1462. package/Source/Shaders/Materials/AspectRampMaterial.js +13 -0
  1463. package/Source/Shaders/Materials/BumpMapMaterial.glsl +29 -0
  1464. package/Source/Shaders/Materials/BumpMapMaterial.js +31 -0
  1465. package/Source/Shaders/Materials/CheckerboardMaterial.glsl +29 -0
  1466. package/Source/Shaders/Materials/CheckerboardMaterial.js +31 -0
  1467. package/Source/Shaders/Materials/DotMaterial.glsl +18 -0
  1468. package/Source/Shaders/Materials/DotMaterial.js +20 -0
  1469. package/Source/Shaders/Materials/ElevationBandMaterial.glsl +74 -0
  1470. package/Source/Shaders/Materials/ElevationBandMaterial.js +76 -0
  1471. package/Source/Shaders/Materials/ElevationContourMaterial.glsl +29 -0
  1472. package/Source/Shaders/Materials/ElevationContourMaterial.js +31 -0
  1473. package/Source/Shaders/Materials/ElevationRampMaterial.glsl +14 -0
  1474. package/Source/Shaders/Materials/ElevationRampMaterial.js +16 -0
  1475. package/Source/Shaders/Materials/FadeMaterial.glsl +37 -0
  1476. package/Source/Shaders/Materials/FadeMaterial.js +39 -0
  1477. package/Source/Shaders/Materials/GridMaterial.glsl +60 -0
  1478. package/Source/Shaders/Materials/GridMaterial.js +62 -0
  1479. package/Source/Shaders/Materials/NormalMapMaterial.glsl +19 -0
  1480. package/Source/Shaders/Materials/NormalMapMaterial.js +21 -0
  1481. package/Source/Shaders/Materials/PolylineArrowMaterial.glsl +66 -0
  1482. package/Source/Shaders/Materials/PolylineArrowMaterial.js +68 -0
  1483. package/Source/Shaders/Materials/PolylineDashMaterial.glsl +39 -0
  1484. package/Source/Shaders/Materials/PolylineDashMaterial.js +41 -0
  1485. package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +25 -0
  1486. package/Source/Shaders/Materials/PolylineGlowMaterial.js +27 -0
  1487. package/Source/Shaders/Materials/PolylineOutlineMaterial.glsl +29 -0
  1488. package/Source/Shaders/Materials/PolylineOutlineMaterial.js +31 -0
  1489. package/Source/Shaders/Materials/RimLightingMaterial.glsl +21 -0
  1490. package/Source/Shaders/Materials/RimLightingMaterial.js +23 -0
  1491. package/Source/Shaders/Materials/SlopeRampMaterial.glsl +11 -0
  1492. package/Source/Shaders/Materials/SlopeRampMaterial.js +13 -0
  1493. package/Source/Shaders/Materials/StripeMaterial.glsl +24 -0
  1494. package/Source/Shaders/Materials/StripeMaterial.js +26 -0
  1495. package/Source/Shaders/Materials/Water.glsl +58 -0
  1496. package/Source/Shaders/Materials/Water.js +60 -0
  1497. package/Source/Shaders/Model/CPUStylingStageFS.glsl +49 -0
  1498. package/Source/Shaders/Model/CPUStylingStageFS.js +51 -0
  1499. package/Source/Shaders/Model/CPUStylingStageVS.glsl +30 -0
  1500. package/Source/Shaders/Model/CPUStylingStageVS.js +32 -0
  1501. package/Source/Shaders/Model/CustomShaderStageFS.glsl +18 -0
  1502. package/Source/Shaders/Model/CustomShaderStageFS.js +20 -0
  1503. package/Source/Shaders/Model/CustomShaderStageVS.glsl +19 -0
  1504. package/Source/Shaders/Model/CustomShaderStageVS.js +21 -0
  1505. package/Source/Shaders/Model/FeatureIdStageFS.glsl +4 -0
  1506. package/Source/Shaders/Model/FeatureIdStageFS.js +6 -0
  1507. package/Source/Shaders/Model/FeatureIdStageVS.glsl +6 -0
  1508. package/Source/Shaders/Model/FeatureIdStageVS.js +8 -0
  1509. package/Source/Shaders/Model/GeometryStageFS.glsl +25 -0
  1510. package/Source/Shaders/Model/GeometryStageFS.js +27 -0
  1511. package/Source/Shaders/Model/GeometryStageVS.glsl +42 -0
  1512. package/Source/Shaders/Model/GeometryStageVS.js +44 -0
  1513. package/Source/Shaders/Model/ImageBasedLightingStageFS.glsl +165 -0
  1514. package/Source/Shaders/Model/ImageBasedLightingStageFS.js +166 -0
  1515. package/Source/Shaders/Model/InstancingStageCommon.glsl +67 -0
  1516. package/Source/Shaders/Model/InstancingStageCommon.js +69 -0
  1517. package/Source/Shaders/Model/InstancingStageVS.glsl +18 -0
  1518. package/Source/Shaders/Model/InstancingStageVS.js +20 -0
  1519. package/Source/Shaders/Model/LegacyInstancingStageVS.glsl +20 -0
  1520. package/Source/Shaders/Model/LegacyInstancingStageVS.js +22 -0
  1521. package/Source/Shaders/Model/LightingStageFS.glsl +73 -0
  1522. package/Source/Shaders/Model/LightingStageFS.js +75 -0
  1523. package/Source/Shaders/Model/MaterialStageFS.glsl +226 -0
  1524. package/Source/Shaders/Model/MaterialStageFS.js +228 -0
  1525. package/Source/Shaders/Model/MetadataStageFS.glsl +9 -0
  1526. package/Source/Shaders/Model/MetadataStageFS.js +11 -0
  1527. package/Source/Shaders/Model/MetadataStageVS.glsl +10 -0
  1528. package/Source/Shaders/Model/MetadataStageVS.js +12 -0
  1529. package/Source/Shaders/Model/ModelClippingPlanesStageFS.glsl +88 -0
  1530. package/Source/Shaders/Model/ModelClippingPlanesStageFS.js +90 -0
  1531. package/Source/Shaders/Model/ModelColorStageFS.glsl +7 -0
  1532. package/Source/Shaders/Model/ModelColorStageFS.js +8 -0
  1533. package/Source/Shaders/Model/ModelFS.glsl +89 -0
  1534. package/Source/Shaders/Model/ModelFS.js +91 -0
  1535. package/Source/Shaders/Model/ModelSilhouetteStageFS.glsl +5 -0
  1536. package/Source/Shaders/Model/ModelSilhouetteStageFS.js +6 -0
  1537. package/Source/Shaders/Model/ModelSilhouetteStageVS.glsl +10 -0
  1538. package/Source/Shaders/Model/ModelSilhouetteStageVS.js +12 -0
  1539. package/Source/Shaders/Model/ModelSplitterStageFS.glsl +9 -0
  1540. package/Source/Shaders/Model/ModelSplitterStageFS.js +11 -0
  1541. package/Source/Shaders/Model/ModelVS.glsl +136 -0
  1542. package/Source/Shaders/Model/ModelVS.js +138 -0
  1543. package/Source/Shaders/Model/MorphTargetsStageVS.glsl +15 -0
  1544. package/Source/Shaders/Model/MorphTargetsStageVS.js +16 -0
  1545. package/Source/Shaders/Model/PointCloudStylingStageVS.glsl +45 -0
  1546. package/Source/Shaders/Model/PointCloudStylingStageVS.js +46 -0
  1547. package/Source/Shaders/Model/PrimitiveOutlineStageFS.glsl +16 -0
  1548. package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +18 -0
  1549. package/Source/Shaders/Model/PrimitiveOutlineStageVS.glsl +3 -0
  1550. package/Source/Shaders/Model/PrimitiveOutlineStageVS.js +5 -0
  1551. package/Source/Shaders/Model/SelectedFeatureIdStageCommon.glsl +51 -0
  1552. package/Source/Shaders/Model/SelectedFeatureIdStageCommon.js +53 -0
  1553. package/Source/Shaders/Model/SkinningStageVS.glsl +18 -0
  1554. package/Source/Shaders/Model/SkinningStageVS.js +19 -0
  1555. package/Source/Shaders/OctahedralProjectionAtlasFS.glsl +89 -0
  1556. package/Source/Shaders/OctahedralProjectionAtlasFS.js +91 -0
  1557. package/Source/Shaders/OctahedralProjectionFS.glsl +14 -0
  1558. package/Source/Shaders/OctahedralProjectionFS.js +16 -0
  1559. package/Source/Shaders/OctahedralProjectionVS.glsl +10 -0
  1560. package/Source/Shaders/OctahedralProjectionVS.js +12 -0
  1561. package/Source/Shaders/PointPrimitiveCollectionFS.glsl +43 -0
  1562. package/Source/Shaders/PointPrimitiveCollectionFS.js +45 -0
  1563. package/Source/Shaders/PointPrimitiveCollectionVS.glsl +180 -0
  1564. package/Source/Shaders/PointPrimitiveCollectionVS.js +182 -0
  1565. package/Source/Shaders/PolylineCommon.glsl +176 -0
  1566. package/Source/Shaders/PolylineCommon.js +178 -0
  1567. package/Source/Shaders/PolylineFS.glsl +25 -0
  1568. package/Source/Shaders/PolylineFS.js +27 -0
  1569. package/Source/Shaders/PolylineShadowVolumeFS.glsl +90 -0
  1570. package/Source/Shaders/PolylineShadowVolumeFS.js +92 -0
  1571. package/Source/Shaders/PolylineShadowVolumeMorphFS.glsl +45 -0
  1572. package/Source/Shaders/PolylineShadowVolumeMorphFS.js +47 -0
  1573. package/Source/Shaders/PolylineShadowVolumeMorphVS.glsl +177 -0
  1574. package/Source/Shaders/PolylineShadowVolumeMorphVS.js +179 -0
  1575. package/Source/Shaders/PolylineShadowVolumeVS.glsl +168 -0
  1576. package/Source/Shaders/PolylineShadowVolumeVS.js +170 -0
  1577. package/Source/Shaders/PolylineVS.glsl +103 -0
  1578. package/Source/Shaders/PolylineVS.js +105 -0
  1579. package/Source/Shaders/PostProcessStages/AcesTonemappingStage.glsl +21 -0
  1580. package/Source/Shaders/PostProcessStages/AcesTonemappingStage.js +23 -0
  1581. package/Source/Shaders/PostProcessStages/AdditiveBlend.glsl +17 -0
  1582. package/Source/Shaders/PostProcessStages/AdditiveBlend.js +19 -0
  1583. package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.glsl +115 -0
  1584. package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js +117 -0
  1585. package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.glsl +11 -0
  1586. package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.js +13 -0
  1587. package/Source/Shaders/PostProcessStages/BlackAndWhite.glsl +19 -0
  1588. package/Source/Shaders/PostProcessStages/BlackAndWhite.js +21 -0
  1589. package/Source/Shaders/PostProcessStages/BloomComposite.glsl +20 -0
  1590. package/Source/Shaders/PostProcessStages/BloomComposite.js +22 -0
  1591. package/Source/Shaders/PostProcessStages/BrightPass.glsl +30 -0
  1592. package/Source/Shaders/PostProcessStages/BrightPass.js +32 -0
  1593. package/Source/Shaders/PostProcessStages/Brightness.glsl +11 -0
  1594. package/Source/Shaders/PostProcessStages/Brightness.js +13 -0
  1595. package/Source/Shaders/PostProcessStages/CompositeTranslucentClassification.glsl +31 -0
  1596. package/Source/Shaders/PostProcessStages/CompositeTranslucentClassification.js +33 -0
  1597. package/Source/Shaders/PostProcessStages/ContrastBias.glsl +17 -0
  1598. package/Source/Shaders/PostProcessStages/ContrastBias.js +19 -0
  1599. package/Source/Shaders/PostProcessStages/DepthOfField.glsl +39 -0
  1600. package/Source/Shaders/PostProcessStages/DepthOfField.js +41 -0
  1601. package/Source/Shaders/PostProcessStages/DepthView.glsl +9 -0
  1602. package/Source/Shaders/PostProcessStages/DepthView.js +11 -0
  1603. package/Source/Shaders/PostProcessStages/DepthViewPacked.glsl +14 -0
  1604. package/Source/Shaders/PostProcessStages/DepthViewPacked.js +16 -0
  1605. package/Source/Shaders/PostProcessStages/EdgeDetection.glsl +60 -0
  1606. package/Source/Shaders/PostProcessStages/EdgeDetection.js +62 -0
  1607. package/Source/Shaders/PostProcessStages/FXAA.glsl +21 -0
  1608. package/Source/Shaders/PostProcessStages/FXAA.js +23 -0
  1609. package/Source/Shaders/PostProcessStages/FilmicTonemapping.glsl +36 -0
  1610. package/Source/Shaders/PostProcessStages/FilmicTonemapping.js +38 -0
  1611. package/Source/Shaders/PostProcessStages/GaussianBlur1D.glsl +47 -0
  1612. package/Source/Shaders/PostProcessStages/GaussianBlur1D.js +49 -0
  1613. package/Source/Shaders/PostProcessStages/LensFlare.glsl +153 -0
  1614. package/Source/Shaders/PostProcessStages/LensFlare.js +155 -0
  1615. package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.glsl +24 -0
  1616. package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.js +26 -0
  1617. package/Source/Shaders/PostProcessStages/NightVision.glsl +16 -0
  1618. package/Source/Shaders/PostProcessStages/NightVision.js +18 -0
  1619. package/Source/Shaders/PostProcessStages/PassThrough.glsl +8 -0
  1620. package/Source/Shaders/PostProcessStages/PassThrough.js +10 -0
  1621. package/Source/Shaders/PostProcessStages/PassThroughDepth.glsl +8 -0
  1622. package/Source/Shaders/PostProcessStages/PassThroughDepth.js +10 -0
  1623. package/Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.glsl +63 -0
  1624. package/Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.js +65 -0
  1625. package/Source/Shaders/PostProcessStages/ReinhardTonemapping.glsl +23 -0
  1626. package/Source/Shaders/PostProcessStages/ReinhardTonemapping.js +25 -0
  1627. package/Source/Shaders/PostProcessStages/Silhouette.glsl +11 -0
  1628. package/Source/Shaders/PostProcessStages/Silhouette.js +13 -0
  1629. package/Source/Shaders/ReprojectWebMercatorFS.glsl +8 -0
  1630. package/Source/Shaders/ReprojectWebMercatorFS.js +10 -0
  1631. package/Source/Shaders/ReprojectWebMercatorVS.glsl +12 -0
  1632. package/Source/Shaders/ReprojectWebMercatorVS.js +14 -0
  1633. package/Source/Shaders/ShadowVolumeAppearanceFS.glsl +165 -0
  1634. package/Source/Shaders/ShadowVolumeAppearanceFS.js +167 -0
  1635. package/Source/Shaders/ShadowVolumeAppearanceVS.glsl +101 -0
  1636. package/Source/Shaders/ShadowVolumeAppearanceVS.js +103 -0
  1637. package/Source/Shaders/ShadowVolumeFS.glsl +17 -0
  1638. package/Source/Shaders/ShadowVolumeFS.js +19 -0
  1639. package/Source/Shaders/SkyAtmosphereCommon.glsl +91 -0
  1640. package/Source/Shaders/SkyAtmosphereCommon.js +93 -0
  1641. package/Source/Shaders/SkyAtmosphereFS.glsl +64 -0
  1642. package/Source/Shaders/SkyAtmosphereFS.js +66 -0
  1643. package/Source/Shaders/SkyAtmosphereVS.glsl +30 -0
  1644. package/Source/Shaders/SkyAtmosphereVS.js +32 -0
  1645. package/Source/Shaders/SkyBoxFS.glsl +9 -0
  1646. package/Source/Shaders/SkyBoxFS.js +11 -0
  1647. package/Source/Shaders/SkyBoxVS.glsl +10 -0
  1648. package/Source/Shaders/SkyBoxVS.js +12 -0
  1649. package/Source/Shaders/SunFS.glsl +9 -0
  1650. package/Source/Shaders/SunFS.js +11 -0
  1651. package/Source/Shaders/SunTextureFS.glsl +55 -0
  1652. package/Source/Shaders/SunTextureFS.js +57 -0
  1653. package/Source/Shaders/SunVS.glsl +28 -0
  1654. package/Source/Shaders/SunVS.js +30 -0
  1655. package/Source/Shaders/Vector3DTileClampedPolylinesFS.glsl +52 -0
  1656. package/Source/Shaders/Vector3DTileClampedPolylinesFS.js +54 -0
  1657. package/Source/Shaders/Vector3DTileClampedPolylinesVS.glsl +85 -0
  1658. package/Source/Shaders/Vector3DTileClampedPolylinesVS.js +87 -0
  1659. package/Source/Shaders/Vector3DTilePolylinesVS.glsl +22 -0
  1660. package/Source/Shaders/Vector3DTilePolylinesVS.js +24 -0
  1661. package/Source/Shaders/VectorTileVS.glsl +9 -0
  1662. package/Source/Shaders/VectorTileVS.js +11 -0
  1663. package/Source/Shaders/ViewportQuadFS.glsl +16 -0
  1664. package/Source/Shaders/ViewportQuadFS.js +18 -0
  1665. package/Source/Shaders/ViewportQuadVS.glsl +10 -0
  1666. package/Source/Shaders/ViewportQuadVS.js +12 -0
  1667. package/Source/ThirdParty/Workers/basis_transcoder.js +21 -0
  1668. package/Source/ThirdParty/Workers/draco_decoder_nodejs.js +118 -0
  1669. package/Source/ThirdParty/Workers/package.json +1 -0
  1670. package/Source/ThirdParty/Workers/pako_deflate.min.js +2 -0
  1671. package/Source/ThirdParty/Workers/pako_inflate.min.js +2 -0
  1672. package/Source/ThirdParty/Workers/z-worker-pako.js +1 -0
  1673. package/Source/ThirdParty/basis_transcoder.wasm +0 -0
  1674. package/Source/ThirdParty/draco_decoder.wasm +0 -0
  1675. package/Source/ThirdParty/google-earth-dbroot-parser.js +8337 -0
  1676. package/Source/Widget/CesiumWidget.css +124 -0
  1677. package/Source/Widget/CesiumWidget.js +807 -0
  1678. package/Source/Widget/lighter.css +14 -0
  1679. package/Source/Workers/cesiumWorkerBootstrapper.js +2290 -0
  1680. package/Source/Workers/package.json +1 -0
  1681. package/Source/Workers/transferTypedArrayTest.js +22 -0
  1682. package/Source/WorkersES6/combineGeometry.js +14 -0
  1683. package/Source/WorkersES6/createBoxGeometry.js +10 -0
  1684. package/Source/WorkersES6/createBoxOutlineGeometry.js +10 -0
  1685. package/Source/WorkersES6/createCircleGeometry.js +18 -0
  1686. package/Source/WorkersES6/createCircleOutlineGeometry.js +18 -0
  1687. package/Source/WorkersES6/createCoplanarPolygonGeometry.js +10 -0
  1688. package/Source/WorkersES6/createCoplanarPolygonOutlineGeometry.js +15 -0
  1689. package/Source/WorkersES6/createCorridorGeometry.js +12 -0
  1690. package/Source/WorkersES6/createCorridorOutlineGeometry.js +17 -0
  1691. package/Source/WorkersES6/createCylinderGeometry.js +10 -0
  1692. package/Source/WorkersES6/createCylinderOutlineGeometry.js +10 -0
  1693. package/Source/WorkersES6/createEllipseGeometry.js +14 -0
  1694. package/Source/WorkersES6/createEllipseOutlineGeometry.js +14 -0
  1695. package/Source/WorkersES6/createEllipsoidGeometry.js +10 -0
  1696. package/Source/WorkersES6/createEllipsoidOutlineGeometry.js +13 -0
  1697. package/Source/WorkersES6/createFrustumGeometry.js +10 -0
  1698. package/Source/WorkersES6/createFrustumOutlineGeometry.js +10 -0
  1699. package/Source/WorkersES6/createGeometry.js +52 -0
  1700. package/Source/WorkersES6/createGroundPolylineGeometry.js +16 -0
  1701. package/Source/WorkersES6/createPlaneGeometry.js +10 -0
  1702. package/Source/WorkersES6/createPlaneOutlineGeometry.js +10 -0
  1703. package/Source/WorkersES6/createPolygonGeometry.js +12 -0
  1704. package/Source/WorkersES6/createPolygonOutlineGeometry.js +12 -0
  1705. package/Source/WorkersES6/createPolylineGeometry.js +12 -0
  1706. package/Source/WorkersES6/createPolylineVolumeGeometry.js +17 -0
  1707. package/Source/WorkersES6/createPolylineVolumeOutlineGeometry.js +22 -0
  1708. package/Source/WorkersES6/createRectangleGeometry.js +14 -0
  1709. package/Source/WorkersES6/createRectangleOutlineGeometry.js +17 -0
  1710. package/Source/WorkersES6/createSimplePolylineGeometry.js +17 -0
  1711. package/Source/WorkersES6/createSphereGeometry.js +10 -0
  1712. package/Source/WorkersES6/createSphereOutlineGeometry.js +10 -0
  1713. package/Source/WorkersES6/createTaskProcessorWorker.js +129 -0
  1714. package/Source/WorkersES6/createVectorTileClampedPolylines.js +541 -0
  1715. package/Source/WorkersES6/createVectorTileGeometries.js +414 -0
  1716. package/Source/WorkersES6/createVectorTilePoints.js +81 -0
  1717. package/Source/WorkersES6/createVectorTilePolygons.js +412 -0
  1718. package/Source/WorkersES6/createVectorTilePolylines.js +210 -0
  1719. package/Source/WorkersES6/createVerticesFromGoogleEarthEnterpriseBuffer.js +653 -0
  1720. package/Source/WorkersES6/createVerticesFromHeightmap.js +53 -0
  1721. package/Source/WorkersES6/createVerticesFromQuantizedTerrainMesh.js +549 -0
  1722. package/Source/WorkersES6/createWallGeometry.js +12 -0
  1723. package/Source/WorkersES6/createWallOutlineGeometry.js +12 -0
  1724. package/Source/WorkersES6/decodeDraco.js +381 -0
  1725. package/Source/WorkersES6/decodeGoogleEarthEnterprisePacket.js +268 -0
  1726. package/Source/WorkersES6/decodeI3S.js +1044 -0
  1727. package/Source/WorkersES6/transcodeKTX2.js +316 -0
  1728. package/Source/WorkersES6/upsampleQuantizedTerrainMesh.js +680 -0
  1729. package/index.d.ts +41767 -0
  1730. package/index.js +1085 -0
  1731. package/package.json +73 -0
@@ -0,0 +1,3951 @@
1
+ import BoundingSphere from "../Core/BoundingSphere.js";
2
+ import Cartesian2 from "../Core/Cartesian2.js";
3
+ import Cartesian3 from "../Core/Cartesian3.js";
4
+ import Cartesian4 from "../Core/Cartesian4.js";
5
+ import Cartographic from "../Core/Cartographic.js";
6
+ import defaultValue from "../Core/defaultValue.js";
7
+ import defined from "../Core/defined.js";
8
+ import DeveloperError from "../Core/DeveloperError.js";
9
+ import EasingFunction from "../Core/EasingFunction.js";
10
+ import Ellipsoid from "../Core/Ellipsoid.js";
11
+ import EllipsoidGeodesic from "../Core/EllipsoidGeodesic.js";
12
+ import Event from "../Core/Event.js";
13
+ import getTimestamp from "../Core/getTimestamp.js";
14
+ import HeadingPitchRange from "../Core/HeadingPitchRange.js";
15
+ import HeadingPitchRoll from "../Core/HeadingPitchRoll.js";
16
+ import Intersect from "../Core/Intersect.js";
17
+ import IntersectionTests from "../Core/IntersectionTests.js";
18
+ import CesiumMath from "../Core/Math.js";
19
+ import Matrix3 from "../Core/Matrix3.js";
20
+ import Matrix4 from "../Core/Matrix4.js";
21
+ import OrthographicFrustum from "../Core/OrthographicFrustum.js";
22
+ import OrthographicOffCenterFrustum from "../Core/OrthographicOffCenterFrustum.js";
23
+ import PerspectiveFrustum from "../Core/PerspectiveFrustum.js";
24
+ import Quaternion from "../Core/Quaternion.js";
25
+ import Ray from "../Core/Ray.js";
26
+ import Rectangle from "../Core/Rectangle.js";
27
+ import Transforms from "../Core/Transforms.js";
28
+ import CameraFlightPath from "./CameraFlightPath.js";
29
+ import MapMode2D from "./MapMode2D.js";
30
+ import SceneMode from "./SceneMode.js";
31
+
32
+ /**
33
+ * @typedef {Object} DirectionUp
34
+ *
35
+ * An orientation given by a pair of unit vectors
36
+ *
37
+ * @property {Cartesian3} direction The unit "direction" vector
38
+ * @property {Cartesian3} up The unit "up" vector
39
+ **/
40
+ /**
41
+ * @typedef {Object} HeadingPitchRollValues
42
+ *
43
+ * An orientation given by numeric heading, pitch, and roll
44
+ *
45
+ * @property {number} [heading=0.0] The heading in radians
46
+ * @property {number} [pitch=-CesiumMath.PI_OVER_TWO] The pitch in radians
47
+ * @property {number} [roll=0.0] The roll in meters
48
+ **/
49
+
50
+ /**
51
+ * The camera is defined by a position, orientation, and view frustum.
52
+ * <br /><br />
53
+ * The orientation forms an orthonormal basis with a view, up and right = view x up unit vectors.
54
+ * <br /><br />
55
+ * The viewing frustum is defined by 6 planes.
56
+ * Each plane is represented by a {@link Cartesian4} object, where the x, y, and z components
57
+ * define the unit vector normal to the plane, and the w component is the distance of the
58
+ * plane from the origin/camera position.
59
+ *
60
+ * @alias Camera
61
+ *
62
+ * @constructor
63
+ *
64
+ * @param {Scene} scene The scene.
65
+ *
66
+ * @demo {@link https://sandcastle.cesium.com/index.html?src=Camera.html|Cesium Sandcastle Camera Demo}
67
+ * @demo {@link https://sandcastle.cesium.com/index.html?src=Camera%20Tutorial.html|Cesium Sandcastle Camera Tutorial Example}
68
+ * @demo {@link https://cesium.com/learn/cesiumjs-learn/cesiumjs-camera|Camera Tutorial}
69
+ *
70
+ * @example
71
+ * // Create a camera looking down the negative z-axis, positioned at the origin,
72
+ * // with a field of view of 60 degrees, and 1:1 aspect ratio.
73
+ * const camera = new Cesium.Camera(scene);
74
+ * camera.position = new Cesium.Cartesian3();
75
+ * camera.direction = Cesium.Cartesian3.negate(Cesium.Cartesian3.UNIT_Z, new Cesium.Cartesian3());
76
+ * camera.up = Cesium.Cartesian3.clone(Cesium.Cartesian3.UNIT_Y);
77
+ * camera.frustum.fov = Cesium.Math.PI_OVER_THREE;
78
+ * camera.frustum.near = 1.0;
79
+ * camera.frustum.far = 2.0;
80
+ */
81
+ function Camera(scene) {
82
+ //>>includeStart('debug', pragmas.debug);
83
+ if (!defined(scene)) {
84
+ throw new DeveloperError("scene is required.");
85
+ }
86
+ //>>includeEnd('debug');
87
+ this._scene = scene;
88
+
89
+ this._transform = Matrix4.clone(Matrix4.IDENTITY);
90
+ this._invTransform = Matrix4.clone(Matrix4.IDENTITY);
91
+ this._actualTransform = Matrix4.clone(Matrix4.IDENTITY);
92
+ this._actualInvTransform = Matrix4.clone(Matrix4.IDENTITY);
93
+ this._transformChanged = false;
94
+
95
+ /**
96
+ * The position of the camera.
97
+ *
98
+ * @type {Cartesian3}
99
+ */
100
+ this.position = new Cartesian3();
101
+ this._position = new Cartesian3();
102
+ this._positionWC = new Cartesian3();
103
+ this._positionCartographic = new Cartographic();
104
+ this._oldPositionWC = undefined;
105
+
106
+ /**
107
+ * The position delta magnitude.
108
+ *
109
+ * @private
110
+ */
111
+ this.positionWCDeltaMagnitude = 0.0;
112
+
113
+ /**
114
+ * The position delta magnitude last frame.
115
+ *
116
+ * @private
117
+ */
118
+ this.positionWCDeltaMagnitudeLastFrame = 0.0;
119
+
120
+ /**
121
+ * How long in seconds since the camera has stopped moving
122
+ *
123
+ * @private
124
+ */
125
+ this.timeSinceMoved = 0.0;
126
+ this._lastMovedTimestamp = 0.0;
127
+
128
+ /**
129
+ * The view direction of the camera.
130
+ *
131
+ * @type {Cartesian3}
132
+ */
133
+ this.direction = new Cartesian3();
134
+ this._direction = new Cartesian3();
135
+ this._directionWC = new Cartesian3();
136
+
137
+ /**
138
+ * The up direction of the camera.
139
+ *
140
+ * @type {Cartesian3}
141
+ */
142
+ this.up = new Cartesian3();
143
+ this._up = new Cartesian3();
144
+ this._upWC = new Cartesian3();
145
+
146
+ /**
147
+ * The right direction of the camera.
148
+ *
149
+ * @type {Cartesian3}
150
+ */
151
+ this.right = new Cartesian3();
152
+ this._right = new Cartesian3();
153
+ this._rightWC = new Cartesian3();
154
+
155
+ /**
156
+ * The region of space in view.
157
+ *
158
+ * @type {PerspectiveFrustum|PerspectiveOffCenterFrustum|OrthographicFrustum}
159
+ * @default PerspectiveFrustum()
160
+ *
161
+ * @see PerspectiveFrustum
162
+ * @see PerspectiveOffCenterFrustum
163
+ * @see OrthographicFrustum
164
+ */
165
+ this.frustum = new PerspectiveFrustum();
166
+ this.frustum.aspectRatio =
167
+ scene.drawingBufferWidth / scene.drawingBufferHeight;
168
+ this.frustum.fov = CesiumMath.toRadians(60.0);
169
+
170
+ /**
171
+ * The default amount to move the camera when an argument is not
172
+ * provided to the move methods.
173
+ * @type {Number}
174
+ * @default 100000.0;
175
+ */
176
+ this.defaultMoveAmount = 100000.0;
177
+ /**
178
+ * The default amount to rotate the camera when an argument is not
179
+ * provided to the look methods.
180
+ * @type {Number}
181
+ * @default Math.PI / 60.0
182
+ */
183
+ this.defaultLookAmount = Math.PI / 60.0;
184
+ /**
185
+ * The default amount to rotate the camera when an argument is not
186
+ * provided to the rotate methods.
187
+ * @type {Number}
188
+ * @default Math.PI / 3600.0
189
+ */
190
+ this.defaultRotateAmount = Math.PI / 3600.0;
191
+ /**
192
+ * The default amount to move the camera when an argument is not
193
+ * provided to the zoom methods.
194
+ * @type {Number}
195
+ * @default 100000.0;
196
+ */
197
+ this.defaultZoomAmount = 100000.0;
198
+ /**
199
+ * If set, the camera will not be able to rotate past this axis in either direction.
200
+ * @type {Cartesian3}
201
+ * @default undefined
202
+ */
203
+ this.constrainedAxis = undefined;
204
+ /**
205
+ * The factor multiplied by the the map size used to determine where to clamp the camera position
206
+ * when zooming out from the surface. The default is 1.5. Only valid for 2D and the map is rotatable.
207
+ * @type {Number}
208
+ * @default 1.5
209
+ */
210
+ this.maximumZoomFactor = 1.5;
211
+
212
+ this._moveStart = new Event();
213
+ this._moveEnd = new Event();
214
+
215
+ this._changed = new Event();
216
+ this._changedPosition = undefined;
217
+ this._changedDirection = undefined;
218
+ this._changedFrustum = undefined;
219
+ this._changedHeading = undefined;
220
+
221
+ /**
222
+ * The amount the camera has to change before the <code>changed</code> event is raised. The value is a percentage in the [0, 1] range.
223
+ * @type {number}
224
+ * @default 0.5
225
+ */
226
+ this.percentageChanged = 0.5;
227
+
228
+ this._viewMatrix = new Matrix4();
229
+ this._invViewMatrix = new Matrix4();
230
+ updateViewMatrix(this);
231
+
232
+ this._mode = SceneMode.SCENE3D;
233
+ this._modeChanged = true;
234
+ const projection = scene.mapProjection;
235
+ this._projection = projection;
236
+ this._maxCoord = projection.project(
237
+ new Cartographic(Math.PI, CesiumMath.PI_OVER_TWO)
238
+ );
239
+ this._max2Dfrustum = undefined;
240
+
241
+ // set default view
242
+ rectangleCameraPosition3D(
243
+ this,
244
+ Camera.DEFAULT_VIEW_RECTANGLE,
245
+ this.position,
246
+ true
247
+ );
248
+
249
+ let mag = Cartesian3.magnitude(this.position);
250
+ mag += mag * Camera.DEFAULT_VIEW_FACTOR;
251
+ Cartesian3.normalize(this.position, this.position);
252
+ Cartesian3.multiplyByScalar(this.position, mag, this.position);
253
+ }
254
+
255
+ /**
256
+ * @private
257
+ */
258
+ Camera.TRANSFORM_2D = new Matrix4(
259
+ 0.0,
260
+ 0.0,
261
+ 1.0,
262
+ 0.0,
263
+ 1.0,
264
+ 0.0,
265
+ 0.0,
266
+ 0.0,
267
+ 0.0,
268
+ 1.0,
269
+ 0.0,
270
+ 0.0,
271
+ 0.0,
272
+ 0.0,
273
+ 0.0,
274
+ 1.0
275
+ );
276
+
277
+ /**
278
+ * @private
279
+ */
280
+ Camera.TRANSFORM_2D_INVERSE = Matrix4.inverseTransformation(
281
+ Camera.TRANSFORM_2D,
282
+ new Matrix4()
283
+ );
284
+
285
+ /**
286
+ * The default rectangle the camera will view on creation.
287
+ * @type Rectangle
288
+ */
289
+ Camera.DEFAULT_VIEW_RECTANGLE = Rectangle.fromDegrees(
290
+ -95.0,
291
+ -20.0,
292
+ -70.0,
293
+ 90.0
294
+ );
295
+
296
+ /**
297
+ * A scalar to multiply to the camera position and add it back after setting the camera to view the rectangle.
298
+ * A value of zero means the camera will view the entire {@link Camera#DEFAULT_VIEW_RECTANGLE}, a value greater than zero
299
+ * will move it further away from the extent, and a value less than zero will move it close to the extent.
300
+ * @type Number
301
+ */
302
+ Camera.DEFAULT_VIEW_FACTOR = 0.5;
303
+
304
+ /**
305
+ * The default heading/pitch/range that is used when the camera flies to a location that contains a bounding sphere.
306
+ * @type HeadingPitchRange
307
+ */
308
+ Camera.DEFAULT_OFFSET = new HeadingPitchRange(
309
+ 0.0,
310
+ -CesiumMath.PI_OVER_FOUR,
311
+ 0.0
312
+ );
313
+
314
+ function updateViewMatrix(camera) {
315
+ Matrix4.computeView(
316
+ camera._position,
317
+ camera._direction,
318
+ camera._up,
319
+ camera._right,
320
+ camera._viewMatrix
321
+ );
322
+ Matrix4.multiply(
323
+ camera._viewMatrix,
324
+ camera._actualInvTransform,
325
+ camera._viewMatrix
326
+ );
327
+ Matrix4.inverseTransformation(camera._viewMatrix, camera._invViewMatrix);
328
+ }
329
+
330
+ function updateCameraDeltas(camera) {
331
+ if (!defined(camera._oldPositionWC)) {
332
+ camera._oldPositionWC = Cartesian3.clone(
333
+ camera.positionWC,
334
+ camera._oldPositionWC
335
+ );
336
+ } else {
337
+ camera.positionWCDeltaMagnitudeLastFrame = camera.positionWCDeltaMagnitude;
338
+ const delta = Cartesian3.subtract(
339
+ camera.positionWC,
340
+ camera._oldPositionWC,
341
+ camera._oldPositionWC
342
+ );
343
+ camera.positionWCDeltaMagnitude = Cartesian3.magnitude(delta);
344
+ camera._oldPositionWC = Cartesian3.clone(
345
+ camera.positionWC,
346
+ camera._oldPositionWC
347
+ );
348
+
349
+ // Update move timers
350
+ if (camera.positionWCDeltaMagnitude > 0.0) {
351
+ camera.timeSinceMoved = 0.0;
352
+ camera._lastMovedTimestamp = getTimestamp();
353
+ } else {
354
+ camera.timeSinceMoved =
355
+ Math.max(getTimestamp() - camera._lastMovedTimestamp, 0.0) / 1000.0;
356
+ }
357
+ }
358
+ }
359
+
360
+ /**
361
+ * Checks if there's a camera flight with preload for this camera.
362
+ *
363
+ * @returns {Boolean} Whether or not this camera has a current flight with a valid preloadFlightCamera in scene.
364
+ *
365
+ * @private
366
+ *
367
+ */
368
+ Camera.prototype.canPreloadFlight = function () {
369
+ return defined(this._currentFlight) && this._mode !== SceneMode.SCENE2D;
370
+ };
371
+
372
+ Camera.prototype._updateCameraChanged = function () {
373
+ const camera = this;
374
+
375
+ updateCameraDeltas(camera);
376
+
377
+ if (camera._changed.numberOfListeners === 0) {
378
+ return;
379
+ }
380
+
381
+ const percentageChanged = camera.percentageChanged;
382
+
383
+ const currentHeading = camera.heading;
384
+
385
+ if (!defined(camera._changedHeading)) {
386
+ camera._changedHeading = currentHeading;
387
+ }
388
+
389
+ let delta =
390
+ Math.abs(camera._changedHeading - currentHeading) % CesiumMath.TWO_PI;
391
+ delta = delta > CesiumMath.PI ? CesiumMath.TWO_PI - delta : delta;
392
+
393
+ // Since delta is computed as the shortest distance between two angles
394
+ // the percentage is relative to the half circle.
395
+ const headingChangedPercentage = delta / Math.PI;
396
+
397
+ if (headingChangedPercentage > percentageChanged) {
398
+ camera._changed.raiseEvent(headingChangedPercentage);
399
+ camera._changedHeading = currentHeading;
400
+ }
401
+
402
+ if (camera._mode === SceneMode.SCENE2D) {
403
+ if (!defined(camera._changedFrustum)) {
404
+ camera._changedPosition = Cartesian3.clone(
405
+ camera.position,
406
+ camera._changedPosition
407
+ );
408
+ camera._changedFrustum = camera.frustum.clone();
409
+ return;
410
+ }
411
+
412
+ const position = camera.position;
413
+ const lastPosition = camera._changedPosition;
414
+
415
+ const frustum = camera.frustum;
416
+ const lastFrustum = camera._changedFrustum;
417
+
418
+ const x0 = position.x + frustum.left;
419
+ const x1 = position.x + frustum.right;
420
+ const x2 = lastPosition.x + lastFrustum.left;
421
+ const x3 = lastPosition.x + lastFrustum.right;
422
+
423
+ const y0 = position.y + frustum.bottom;
424
+ const y1 = position.y + frustum.top;
425
+ const y2 = lastPosition.y + lastFrustum.bottom;
426
+ const y3 = lastPosition.y + lastFrustum.top;
427
+
428
+ const leftX = Math.max(x0, x2);
429
+ const rightX = Math.min(x1, x3);
430
+ const bottomY = Math.max(y0, y2);
431
+ const topY = Math.min(y1, y3);
432
+
433
+ let areaPercentage;
434
+ if (leftX >= rightX || bottomY >= y1) {
435
+ areaPercentage = 1.0;
436
+ } else {
437
+ let areaRef = lastFrustum;
438
+ if (x0 < x2 && x1 > x3 && y0 < y2 && y1 > y3) {
439
+ areaRef = frustum;
440
+ }
441
+ areaPercentage =
442
+ 1.0 -
443
+ ((rightX - leftX) * (topY - bottomY)) /
444
+ ((areaRef.right - areaRef.left) * (areaRef.top - areaRef.bottom));
445
+ }
446
+
447
+ if (areaPercentage > percentageChanged) {
448
+ camera._changed.raiseEvent(areaPercentage);
449
+ camera._changedPosition = Cartesian3.clone(
450
+ camera.position,
451
+ camera._changedPosition
452
+ );
453
+ camera._changedFrustum = camera.frustum.clone(camera._changedFrustum);
454
+ }
455
+ return;
456
+ }
457
+
458
+ if (!defined(camera._changedDirection)) {
459
+ camera._changedPosition = Cartesian3.clone(
460
+ camera.positionWC,
461
+ camera._changedPosition
462
+ );
463
+ camera._changedDirection = Cartesian3.clone(
464
+ camera.directionWC,
465
+ camera._changedDirection
466
+ );
467
+ return;
468
+ }
469
+
470
+ const dirAngle = CesiumMath.acosClamped(
471
+ Cartesian3.dot(camera.directionWC, camera._changedDirection)
472
+ );
473
+
474
+ let dirPercentage;
475
+ if (defined(camera.frustum.fovy)) {
476
+ dirPercentage = dirAngle / (camera.frustum.fovy * 0.5);
477
+ } else {
478
+ dirPercentage = dirAngle;
479
+ }
480
+
481
+ const distance = Cartesian3.distance(
482
+ camera.positionWC,
483
+ camera._changedPosition
484
+ );
485
+ const heightPercentage = distance / camera.positionCartographic.height;
486
+
487
+ if (
488
+ dirPercentage > percentageChanged ||
489
+ heightPercentage > percentageChanged
490
+ ) {
491
+ camera._changed.raiseEvent(Math.max(dirPercentage, heightPercentage));
492
+ camera._changedPosition = Cartesian3.clone(
493
+ camera.positionWC,
494
+ camera._changedPosition
495
+ );
496
+ camera._changedDirection = Cartesian3.clone(
497
+ camera.directionWC,
498
+ camera._changedDirection
499
+ );
500
+ }
501
+ };
502
+
503
+ function convertTransformForColumbusView(camera) {
504
+ Transforms.basisTo2D(
505
+ camera._projection,
506
+ camera._transform,
507
+ camera._actualTransform
508
+ );
509
+ }
510
+
511
+ const scratchCartographic = new Cartographic();
512
+ const scratchCartesian3Projection = new Cartesian3();
513
+ const scratchCartesian3 = new Cartesian3();
514
+ const scratchCartesian4Origin = new Cartesian4();
515
+ const scratchCartesian4NewOrigin = new Cartesian4();
516
+ const scratchCartesian4NewXAxis = new Cartesian4();
517
+ const scratchCartesian4NewYAxis = new Cartesian4();
518
+ const scratchCartesian4NewZAxis = new Cartesian4();
519
+
520
+ function convertTransformFor2D(camera) {
521
+ const projection = camera._projection;
522
+ const ellipsoid = projection.ellipsoid;
523
+
524
+ const origin = Matrix4.getColumn(
525
+ camera._transform,
526
+ 3,
527
+ scratchCartesian4Origin
528
+ );
529
+ const cartographic = ellipsoid.cartesianToCartographic(
530
+ origin,
531
+ scratchCartographic
532
+ );
533
+
534
+ const projectedPosition = projection.project(
535
+ cartographic,
536
+ scratchCartesian3Projection
537
+ );
538
+ const newOrigin = scratchCartesian4NewOrigin;
539
+ newOrigin.x = projectedPosition.z;
540
+ newOrigin.y = projectedPosition.x;
541
+ newOrigin.z = projectedPosition.y;
542
+ newOrigin.w = 1.0;
543
+
544
+ const newZAxis = Cartesian4.clone(
545
+ Cartesian4.UNIT_X,
546
+ scratchCartesian4NewZAxis
547
+ );
548
+
549
+ const xAxis = Cartesian4.add(
550
+ Matrix4.getColumn(camera._transform, 0, scratchCartesian3),
551
+ origin,
552
+ scratchCartesian3
553
+ );
554
+ ellipsoid.cartesianToCartographic(xAxis, cartographic);
555
+
556
+ projection.project(cartographic, projectedPosition);
557
+ const newXAxis = scratchCartesian4NewXAxis;
558
+ newXAxis.x = projectedPosition.z;
559
+ newXAxis.y = projectedPosition.x;
560
+ newXAxis.z = projectedPosition.y;
561
+ newXAxis.w = 0.0;
562
+
563
+ Cartesian3.subtract(newXAxis, newOrigin, newXAxis);
564
+ newXAxis.x = 0.0;
565
+
566
+ const newYAxis = scratchCartesian4NewYAxis;
567
+ if (Cartesian3.magnitudeSquared(newXAxis) > CesiumMath.EPSILON10) {
568
+ Cartesian3.cross(newZAxis, newXAxis, newYAxis);
569
+ } else {
570
+ const yAxis = Cartesian4.add(
571
+ Matrix4.getColumn(camera._transform, 1, scratchCartesian3),
572
+ origin,
573
+ scratchCartesian3
574
+ );
575
+ ellipsoid.cartesianToCartographic(yAxis, cartographic);
576
+
577
+ projection.project(cartographic, projectedPosition);
578
+ newYAxis.x = projectedPosition.z;
579
+ newYAxis.y = projectedPosition.x;
580
+ newYAxis.z = projectedPosition.y;
581
+ newYAxis.w = 0.0;
582
+
583
+ Cartesian3.subtract(newYAxis, newOrigin, newYAxis);
584
+ newYAxis.x = 0.0;
585
+
586
+ if (Cartesian3.magnitudeSquared(newYAxis) < CesiumMath.EPSILON10) {
587
+ Cartesian4.clone(Cartesian4.UNIT_Y, newXAxis);
588
+ Cartesian4.clone(Cartesian4.UNIT_Z, newYAxis);
589
+ }
590
+ }
591
+
592
+ Cartesian3.cross(newYAxis, newZAxis, newXAxis);
593
+ Cartesian3.normalize(newXAxis, newXAxis);
594
+ Cartesian3.cross(newZAxis, newXAxis, newYAxis);
595
+ Cartesian3.normalize(newYAxis, newYAxis);
596
+
597
+ Matrix4.setColumn(
598
+ camera._actualTransform,
599
+ 0,
600
+ newXAxis,
601
+ camera._actualTransform
602
+ );
603
+ Matrix4.setColumn(
604
+ camera._actualTransform,
605
+ 1,
606
+ newYAxis,
607
+ camera._actualTransform
608
+ );
609
+ Matrix4.setColumn(
610
+ camera._actualTransform,
611
+ 2,
612
+ newZAxis,
613
+ camera._actualTransform
614
+ );
615
+ Matrix4.setColumn(
616
+ camera._actualTransform,
617
+ 3,
618
+ newOrigin,
619
+ camera._actualTransform
620
+ );
621
+ }
622
+
623
+ const scratchCartesian = new Cartesian3();
624
+
625
+ function updateMembers(camera) {
626
+ const mode = camera._mode;
627
+
628
+ let heightChanged = false;
629
+ let height = 0.0;
630
+ if (mode === SceneMode.SCENE2D) {
631
+ height = camera.frustum.right - camera.frustum.left;
632
+ heightChanged = height !== camera._positionCartographic.height;
633
+ }
634
+
635
+ let position = camera._position;
636
+ const positionChanged =
637
+ !Cartesian3.equals(position, camera.position) || heightChanged;
638
+ if (positionChanged) {
639
+ position = Cartesian3.clone(camera.position, camera._position);
640
+ }
641
+
642
+ let direction = camera._direction;
643
+ const directionChanged = !Cartesian3.equals(direction, camera.direction);
644
+ if (directionChanged) {
645
+ Cartesian3.normalize(camera.direction, camera.direction);
646
+ direction = Cartesian3.clone(camera.direction, camera._direction);
647
+ }
648
+
649
+ let up = camera._up;
650
+ const upChanged = !Cartesian3.equals(up, camera.up);
651
+ if (upChanged) {
652
+ Cartesian3.normalize(camera.up, camera.up);
653
+ up = Cartesian3.clone(camera.up, camera._up);
654
+ }
655
+
656
+ let right = camera._right;
657
+ const rightChanged = !Cartesian3.equals(right, camera.right);
658
+ if (rightChanged) {
659
+ Cartesian3.normalize(camera.right, camera.right);
660
+ right = Cartesian3.clone(camera.right, camera._right);
661
+ }
662
+
663
+ const transformChanged = camera._transformChanged || camera._modeChanged;
664
+ camera._transformChanged = false;
665
+
666
+ if (transformChanged) {
667
+ Matrix4.inverseTransformation(camera._transform, camera._invTransform);
668
+
669
+ if (
670
+ camera._mode === SceneMode.COLUMBUS_VIEW ||
671
+ camera._mode === SceneMode.SCENE2D
672
+ ) {
673
+ if (Matrix4.equals(Matrix4.IDENTITY, camera._transform)) {
674
+ Matrix4.clone(Camera.TRANSFORM_2D, camera._actualTransform);
675
+ } else if (camera._mode === SceneMode.COLUMBUS_VIEW) {
676
+ convertTransformForColumbusView(camera);
677
+ } else {
678
+ convertTransformFor2D(camera);
679
+ }
680
+ } else {
681
+ Matrix4.clone(camera._transform, camera._actualTransform);
682
+ }
683
+
684
+ Matrix4.inverseTransformation(
685
+ camera._actualTransform,
686
+ camera._actualInvTransform
687
+ );
688
+
689
+ camera._modeChanged = false;
690
+ }
691
+
692
+ const transform = camera._actualTransform;
693
+
694
+ if (positionChanged || transformChanged) {
695
+ camera._positionWC = Matrix4.multiplyByPoint(
696
+ transform,
697
+ position,
698
+ camera._positionWC
699
+ );
700
+
701
+ // Compute the Cartographic position of the camera.
702
+ if (mode === SceneMode.SCENE3D || mode === SceneMode.MORPHING) {
703
+ camera._positionCartographic = camera._projection.ellipsoid.cartesianToCartographic(
704
+ camera._positionWC,
705
+ camera._positionCartographic
706
+ );
707
+ } else {
708
+ // The camera position is expressed in the 2D coordinate system where the Y axis is to the East,
709
+ // the Z axis is to the North, and the X axis is out of the map. Express them instead in the ENU axes where
710
+ // X is to the East, Y is to the North, and Z is out of the local horizontal plane.
711
+ const positionENU = scratchCartesian;
712
+ positionENU.x = camera._positionWC.y;
713
+ positionENU.y = camera._positionWC.z;
714
+ positionENU.z = camera._positionWC.x;
715
+
716
+ // In 2D, the camera height is always 12.7 million meters.
717
+ // The apparent height is equal to half the frustum width.
718
+ if (mode === SceneMode.SCENE2D) {
719
+ positionENU.z = height;
720
+ }
721
+
722
+ camera._projection.unproject(positionENU, camera._positionCartographic);
723
+ }
724
+ }
725
+
726
+ if (directionChanged || upChanged || rightChanged) {
727
+ const det = Cartesian3.dot(
728
+ direction,
729
+ Cartesian3.cross(up, right, scratchCartesian)
730
+ );
731
+ if (Math.abs(1.0 - det) > CesiumMath.EPSILON2) {
732
+ //orthonormalize axes
733
+ const invUpMag = 1.0 / Cartesian3.magnitudeSquared(up);
734
+ const scalar = Cartesian3.dot(up, direction) * invUpMag;
735
+ const w0 = Cartesian3.multiplyByScalar(
736
+ direction,
737
+ scalar,
738
+ scratchCartesian
739
+ );
740
+ up = Cartesian3.normalize(
741
+ Cartesian3.subtract(up, w0, camera._up),
742
+ camera._up
743
+ );
744
+ Cartesian3.clone(up, camera.up);
745
+
746
+ right = Cartesian3.cross(direction, up, camera._right);
747
+ Cartesian3.clone(right, camera.right);
748
+ }
749
+ }
750
+
751
+ if (directionChanged || transformChanged) {
752
+ camera._directionWC = Matrix4.multiplyByPointAsVector(
753
+ transform,
754
+ direction,
755
+ camera._directionWC
756
+ );
757
+ Cartesian3.normalize(camera._directionWC, camera._directionWC);
758
+ }
759
+
760
+ if (upChanged || transformChanged) {
761
+ camera._upWC = Matrix4.multiplyByPointAsVector(transform, up, camera._upWC);
762
+ Cartesian3.normalize(camera._upWC, camera._upWC);
763
+ }
764
+
765
+ if (rightChanged || transformChanged) {
766
+ camera._rightWC = Matrix4.multiplyByPointAsVector(
767
+ transform,
768
+ right,
769
+ camera._rightWC
770
+ );
771
+ Cartesian3.normalize(camera._rightWC, camera._rightWC);
772
+ }
773
+
774
+ if (
775
+ positionChanged ||
776
+ directionChanged ||
777
+ upChanged ||
778
+ rightChanged ||
779
+ transformChanged
780
+ ) {
781
+ updateViewMatrix(camera);
782
+ }
783
+ }
784
+
785
+ function getHeading(direction, up) {
786
+ let heading;
787
+ if (
788
+ !CesiumMath.equalsEpsilon(Math.abs(direction.z), 1.0, CesiumMath.EPSILON3)
789
+ ) {
790
+ heading = Math.atan2(direction.y, direction.x) - CesiumMath.PI_OVER_TWO;
791
+ } else {
792
+ heading = Math.atan2(up.y, up.x) - CesiumMath.PI_OVER_TWO;
793
+ }
794
+
795
+ return CesiumMath.TWO_PI - CesiumMath.zeroToTwoPi(heading);
796
+ }
797
+
798
+ function getPitch(direction) {
799
+ return CesiumMath.PI_OVER_TWO - CesiumMath.acosClamped(direction.z);
800
+ }
801
+
802
+ function getRoll(direction, up, right) {
803
+ let roll = 0.0;
804
+ if (
805
+ !CesiumMath.equalsEpsilon(Math.abs(direction.z), 1.0, CesiumMath.EPSILON3)
806
+ ) {
807
+ roll = Math.atan2(-right.z, up.z);
808
+ roll = CesiumMath.zeroToTwoPi(roll + CesiumMath.TWO_PI);
809
+ }
810
+
811
+ return roll;
812
+ }
813
+
814
+ const scratchHPRMatrix1 = new Matrix4();
815
+ const scratchHPRMatrix2 = new Matrix4();
816
+
817
+ Object.defineProperties(Camera.prototype, {
818
+ /**
819
+ * Gets the camera's reference frame. The inverse of this transformation is appended to the view matrix.
820
+ * @memberof Camera.prototype
821
+ *
822
+ * @type {Matrix4}
823
+ * @readonly
824
+ *
825
+ * @default {@link Matrix4.IDENTITY}
826
+ */
827
+ transform: {
828
+ get: function () {
829
+ return this._transform;
830
+ },
831
+ },
832
+
833
+ /**
834
+ * Gets the inverse camera transform.
835
+ * @memberof Camera.prototype
836
+ *
837
+ * @type {Matrix4}
838
+ * @readonly
839
+ *
840
+ * @default {@link Matrix4.IDENTITY}
841
+ */
842
+ inverseTransform: {
843
+ get: function () {
844
+ updateMembers(this);
845
+ return this._invTransform;
846
+ },
847
+ },
848
+
849
+ /**
850
+ * Gets the view matrix.
851
+ * @memberof Camera.prototype
852
+ *
853
+ * @type {Matrix4}
854
+ * @readonly
855
+ *
856
+ * @see Camera#inverseViewMatrix
857
+ */
858
+ viewMatrix: {
859
+ get: function () {
860
+ updateMembers(this);
861
+ return this._viewMatrix;
862
+ },
863
+ },
864
+
865
+ /**
866
+ * Gets the inverse view matrix.
867
+ * @memberof Camera.prototype
868
+ *
869
+ * @type {Matrix4}
870
+ * @readonly
871
+ *
872
+ * @see Camera#viewMatrix
873
+ */
874
+ inverseViewMatrix: {
875
+ get: function () {
876
+ updateMembers(this);
877
+ return this._invViewMatrix;
878
+ },
879
+ },
880
+
881
+ /**
882
+ * Gets the {@link Cartographic} position of the camera, with longitude and latitude
883
+ * expressed in radians and height in meters. In 2D and Columbus View, it is possible
884
+ * for the returned longitude and latitude to be outside the range of valid longitudes
885
+ * and latitudes when the camera is outside the map.
886
+ * @memberof Camera.prototype
887
+ *
888
+ * @type {Cartographic}
889
+ * @readonly
890
+ */
891
+ positionCartographic: {
892
+ get: function () {
893
+ updateMembers(this);
894
+ return this._positionCartographic;
895
+ },
896
+ },
897
+
898
+ /**
899
+ * Gets the position of the camera in world coordinates.
900
+ * @memberof Camera.prototype
901
+ *
902
+ * @type {Cartesian3}
903
+ * @readonly
904
+ */
905
+ positionWC: {
906
+ get: function () {
907
+ updateMembers(this);
908
+ return this._positionWC;
909
+ },
910
+ },
911
+
912
+ /**
913
+ * Gets the view direction of the camera in world coordinates.
914
+ * @memberof Camera.prototype
915
+ *
916
+ * @type {Cartesian3}
917
+ * @readonly
918
+ */
919
+ directionWC: {
920
+ get: function () {
921
+ updateMembers(this);
922
+ return this._directionWC;
923
+ },
924
+ },
925
+
926
+ /**
927
+ * Gets the up direction of the camera in world coordinates.
928
+ * @memberof Camera.prototype
929
+ *
930
+ * @type {Cartesian3}
931
+ * @readonly
932
+ */
933
+ upWC: {
934
+ get: function () {
935
+ updateMembers(this);
936
+ return this._upWC;
937
+ },
938
+ },
939
+
940
+ /**
941
+ * Gets the right direction of the camera in world coordinates.
942
+ * @memberof Camera.prototype
943
+ *
944
+ * @type {Cartesian3}
945
+ * @readonly
946
+ */
947
+ rightWC: {
948
+ get: function () {
949
+ updateMembers(this);
950
+ return this._rightWC;
951
+ },
952
+ },
953
+
954
+ /**
955
+ * Gets the camera heading in radians.
956
+ * @memberof Camera.prototype
957
+ *
958
+ * @type {Number}
959
+ * @readonly
960
+ */
961
+ heading: {
962
+ get: function () {
963
+ if (this._mode !== SceneMode.MORPHING) {
964
+ const ellipsoid = this._projection.ellipsoid;
965
+
966
+ const oldTransform = Matrix4.clone(this._transform, scratchHPRMatrix1);
967
+ const transform = Transforms.eastNorthUpToFixedFrame(
968
+ this.positionWC,
969
+ ellipsoid,
970
+ scratchHPRMatrix2
971
+ );
972
+ this._setTransform(transform);
973
+
974
+ const heading = getHeading(this.direction, this.up);
975
+
976
+ this._setTransform(oldTransform);
977
+
978
+ return heading;
979
+ }
980
+
981
+ return undefined;
982
+ },
983
+ },
984
+
985
+ /**
986
+ * Gets the camera pitch in radians.
987
+ * @memberof Camera.prototype
988
+ *
989
+ * @type {Number}
990
+ * @readonly
991
+ */
992
+ pitch: {
993
+ get: function () {
994
+ if (this._mode !== SceneMode.MORPHING) {
995
+ const ellipsoid = this._projection.ellipsoid;
996
+
997
+ const oldTransform = Matrix4.clone(this._transform, scratchHPRMatrix1);
998
+ const transform = Transforms.eastNorthUpToFixedFrame(
999
+ this.positionWC,
1000
+ ellipsoid,
1001
+ scratchHPRMatrix2
1002
+ );
1003
+ this._setTransform(transform);
1004
+
1005
+ const pitch = getPitch(this.direction);
1006
+
1007
+ this._setTransform(oldTransform);
1008
+
1009
+ return pitch;
1010
+ }
1011
+
1012
+ return undefined;
1013
+ },
1014
+ },
1015
+
1016
+ /**
1017
+ * Gets the camera roll in radians.
1018
+ * @memberof Camera.prototype
1019
+ *
1020
+ * @type {Number}
1021
+ * @readonly
1022
+ */
1023
+ roll: {
1024
+ get: function () {
1025
+ if (this._mode !== SceneMode.MORPHING) {
1026
+ const ellipsoid = this._projection.ellipsoid;
1027
+
1028
+ const oldTransform = Matrix4.clone(this._transform, scratchHPRMatrix1);
1029
+ const transform = Transforms.eastNorthUpToFixedFrame(
1030
+ this.positionWC,
1031
+ ellipsoid,
1032
+ scratchHPRMatrix2
1033
+ );
1034
+ this._setTransform(transform);
1035
+
1036
+ const roll = getRoll(this.direction, this.up, this.right);
1037
+
1038
+ this._setTransform(oldTransform);
1039
+
1040
+ return roll;
1041
+ }
1042
+
1043
+ return undefined;
1044
+ },
1045
+ },
1046
+
1047
+ /**
1048
+ * Gets the event that will be raised at when the camera starts to move.
1049
+ * @memberof Camera.prototype
1050
+ * @type {Event}
1051
+ * @readonly
1052
+ */
1053
+ moveStart: {
1054
+ get: function () {
1055
+ return this._moveStart;
1056
+ },
1057
+ },
1058
+
1059
+ /**
1060
+ * Gets the event that will be raised when the camera has stopped moving.
1061
+ * @memberof Camera.prototype
1062
+ * @type {Event}
1063
+ * @readonly
1064
+ */
1065
+ moveEnd: {
1066
+ get: function () {
1067
+ return this._moveEnd;
1068
+ },
1069
+ },
1070
+
1071
+ /**
1072
+ * Gets the event that will be raised when the camera has changed by <code>percentageChanged</code>.
1073
+ * @memberof Camera.prototype
1074
+ * @type {Event}
1075
+ * @readonly
1076
+ */
1077
+ changed: {
1078
+ get: function () {
1079
+ return this._changed;
1080
+ },
1081
+ },
1082
+ });
1083
+
1084
+ /**
1085
+ * @private
1086
+ */
1087
+ Camera.prototype.update = function (mode) {
1088
+ //>>includeStart('debug', pragmas.debug);
1089
+ if (!defined(mode)) {
1090
+ throw new DeveloperError("mode is required.");
1091
+ }
1092
+ if (
1093
+ mode === SceneMode.SCENE2D &&
1094
+ !(this.frustum instanceof OrthographicOffCenterFrustum)
1095
+ ) {
1096
+ throw new DeveloperError(
1097
+ "An OrthographicOffCenterFrustum is required in 2D."
1098
+ );
1099
+ }
1100
+ if (
1101
+ (mode === SceneMode.SCENE3D || mode === SceneMode.COLUMBUS_VIEW) &&
1102
+ !(this.frustum instanceof PerspectiveFrustum) &&
1103
+ !(this.frustum instanceof OrthographicFrustum)
1104
+ ) {
1105
+ throw new DeveloperError(
1106
+ "A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view"
1107
+ );
1108
+ }
1109
+ //>>includeEnd('debug');
1110
+
1111
+ let updateFrustum = false;
1112
+ if (mode !== this._mode) {
1113
+ this._mode = mode;
1114
+ this._modeChanged = mode !== SceneMode.MORPHING;
1115
+ updateFrustum = this._mode === SceneMode.SCENE2D;
1116
+ }
1117
+
1118
+ if (updateFrustum) {
1119
+ const frustum = (this._max2Dfrustum = this.frustum.clone());
1120
+
1121
+ //>>includeStart('debug', pragmas.debug);
1122
+ if (!(frustum instanceof OrthographicOffCenterFrustum)) {
1123
+ throw new DeveloperError(
1124
+ "The camera frustum is expected to be orthographic for 2D camera control."
1125
+ );
1126
+ }
1127
+ //>>includeEnd('debug');
1128
+
1129
+ const maxZoomOut = 2.0;
1130
+ const ratio = frustum.top / frustum.right;
1131
+ frustum.right = this._maxCoord.x * maxZoomOut;
1132
+ frustum.left = -frustum.right;
1133
+ frustum.top = ratio * frustum.right;
1134
+ frustum.bottom = -frustum.top;
1135
+ }
1136
+
1137
+ if (this._mode === SceneMode.SCENE2D) {
1138
+ clampMove2D(this, this.position);
1139
+ }
1140
+ };
1141
+
1142
+ const setTransformPosition = new Cartesian3();
1143
+ const setTransformUp = new Cartesian3();
1144
+ const setTransformDirection = new Cartesian3();
1145
+
1146
+ Camera.prototype._setTransform = function (transform) {
1147
+ const position = Cartesian3.clone(this.positionWC, setTransformPosition);
1148
+ const up = Cartesian3.clone(this.upWC, setTransformUp);
1149
+ const direction = Cartesian3.clone(this.directionWC, setTransformDirection);
1150
+
1151
+ Matrix4.clone(transform, this._transform);
1152
+ this._transformChanged = true;
1153
+ updateMembers(this);
1154
+ const inverse = this._actualInvTransform;
1155
+
1156
+ Matrix4.multiplyByPoint(inverse, position, this.position);
1157
+ Matrix4.multiplyByPointAsVector(inverse, direction, this.direction);
1158
+ Matrix4.multiplyByPointAsVector(inverse, up, this.up);
1159
+ Cartesian3.cross(this.direction, this.up, this.right);
1160
+
1161
+ updateMembers(this);
1162
+ };
1163
+
1164
+ const scratchAdjustOrthographicFrustumMousePosition = new Cartesian2();
1165
+ const scratchPickRay = new Ray();
1166
+ const scratchRayIntersection = new Cartesian3();
1167
+ const scratchDepthIntersection = new Cartesian3();
1168
+
1169
+ function calculateOrthographicFrustumWidth(camera) {
1170
+ // Camera is fixed to an object, so keep frustum width constant.
1171
+ if (!Matrix4.equals(Matrix4.IDENTITY, camera.transform)) {
1172
+ return Cartesian3.magnitude(camera.position);
1173
+ }
1174
+
1175
+ const scene = camera._scene;
1176
+ const globe = scene.globe;
1177
+
1178
+ const mousePosition = scratchAdjustOrthographicFrustumMousePosition;
1179
+ mousePosition.x = scene.drawingBufferWidth / 2.0;
1180
+ mousePosition.y = scene.drawingBufferHeight / 2.0;
1181
+
1182
+ let rayIntersection;
1183
+ if (defined(globe)) {
1184
+ const ray = camera.getPickRay(mousePosition, scratchPickRay);
1185
+ rayIntersection = globe.pickWorldCoordinates(
1186
+ ray,
1187
+ scene,
1188
+ true,
1189
+ scratchRayIntersection
1190
+ );
1191
+ }
1192
+
1193
+ let depthIntersection;
1194
+ if (scene.pickPositionSupported) {
1195
+ depthIntersection = scene.pickPositionWorldCoordinates(
1196
+ mousePosition,
1197
+ scratchDepthIntersection
1198
+ );
1199
+ }
1200
+
1201
+ let distance;
1202
+ if (defined(rayIntersection) || defined(depthIntersection)) {
1203
+ const depthDistance = defined(depthIntersection)
1204
+ ? Cartesian3.distance(depthIntersection, camera.positionWC)
1205
+ : Number.POSITIVE_INFINITY;
1206
+ const rayDistance = defined(rayIntersection)
1207
+ ? Cartesian3.distance(rayIntersection, camera.positionWC)
1208
+ : Number.POSITIVE_INFINITY;
1209
+ distance = Math.min(depthDistance, rayDistance);
1210
+ } else {
1211
+ distance = Math.max(camera.positionCartographic.height, 0.0);
1212
+ }
1213
+ return distance;
1214
+ }
1215
+
1216
+ Camera.prototype._adjustOrthographicFrustum = function (zooming) {
1217
+ if (!(this.frustum instanceof OrthographicFrustum)) {
1218
+ return;
1219
+ }
1220
+
1221
+ if (!zooming && this._positionCartographic.height < 150000.0) {
1222
+ return;
1223
+ }
1224
+
1225
+ this.frustum.width = calculateOrthographicFrustumWidth(this);
1226
+ };
1227
+
1228
+ const scratchSetViewCartesian = new Cartesian3();
1229
+ const scratchSetViewTransform1 = new Matrix4();
1230
+ const scratchSetViewTransform2 = new Matrix4();
1231
+ const scratchSetViewQuaternion = new Quaternion();
1232
+ const scratchSetViewMatrix3 = new Matrix3();
1233
+ const scratchSetViewCartographic = new Cartographic();
1234
+
1235
+ function setView3D(camera, position, hpr) {
1236
+ const currentTransform = Matrix4.clone(
1237
+ camera.transform,
1238
+ scratchSetViewTransform1
1239
+ );
1240
+ const localTransform = Transforms.eastNorthUpToFixedFrame(
1241
+ position,
1242
+ camera._projection.ellipsoid,
1243
+ scratchSetViewTransform2
1244
+ );
1245
+ camera._setTransform(localTransform);
1246
+
1247
+ Cartesian3.clone(Cartesian3.ZERO, camera.position);
1248
+ hpr.heading = hpr.heading - CesiumMath.PI_OVER_TWO;
1249
+
1250
+ const rotQuat = Quaternion.fromHeadingPitchRoll(
1251
+ hpr,
1252
+ scratchSetViewQuaternion
1253
+ );
1254
+ const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3);
1255
+
1256
+ Matrix3.getColumn(rotMat, 0, camera.direction);
1257
+ Matrix3.getColumn(rotMat, 2, camera.up);
1258
+ Cartesian3.cross(camera.direction, camera.up, camera.right);
1259
+
1260
+ camera._setTransform(currentTransform);
1261
+
1262
+ camera._adjustOrthographicFrustum(true);
1263
+ }
1264
+
1265
+ function setViewCV(camera, position, hpr, convert) {
1266
+ const currentTransform = Matrix4.clone(
1267
+ camera.transform,
1268
+ scratchSetViewTransform1
1269
+ );
1270
+ camera._setTransform(Matrix4.IDENTITY);
1271
+
1272
+ if (!Cartesian3.equals(position, camera.positionWC)) {
1273
+ if (convert) {
1274
+ const projection = camera._projection;
1275
+ const cartographic = projection.ellipsoid.cartesianToCartographic(
1276
+ position,
1277
+ scratchSetViewCartographic
1278
+ );
1279
+ position = projection.project(cartographic, scratchSetViewCartesian);
1280
+ }
1281
+ Cartesian3.clone(position, camera.position);
1282
+ }
1283
+ hpr.heading = hpr.heading - CesiumMath.PI_OVER_TWO;
1284
+
1285
+ const rotQuat = Quaternion.fromHeadingPitchRoll(
1286
+ hpr,
1287
+ scratchSetViewQuaternion
1288
+ );
1289
+ const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3);
1290
+
1291
+ Matrix3.getColumn(rotMat, 0, camera.direction);
1292
+ Matrix3.getColumn(rotMat, 2, camera.up);
1293
+ Cartesian3.cross(camera.direction, camera.up, camera.right);
1294
+
1295
+ camera._setTransform(currentTransform);
1296
+
1297
+ camera._adjustOrthographicFrustum(true);
1298
+ }
1299
+
1300
+ function setView2D(camera, position, hpr, convert) {
1301
+ const currentTransform = Matrix4.clone(
1302
+ camera.transform,
1303
+ scratchSetViewTransform1
1304
+ );
1305
+ camera._setTransform(Matrix4.IDENTITY);
1306
+
1307
+ if (!Cartesian3.equals(position, camera.positionWC)) {
1308
+ if (convert) {
1309
+ const projection = camera._projection;
1310
+ const cartographic = projection.ellipsoid.cartesianToCartographic(
1311
+ position,
1312
+ scratchSetViewCartographic
1313
+ );
1314
+ position = projection.project(cartographic, scratchSetViewCartesian);
1315
+ }
1316
+
1317
+ Cartesian2.clone(position, camera.position);
1318
+
1319
+ const newLeft = -position.z * 0.5;
1320
+ const newRight = -newLeft;
1321
+
1322
+ const frustum = camera.frustum;
1323
+ if (newRight > newLeft) {
1324
+ const ratio = frustum.top / frustum.right;
1325
+ frustum.right = newRight;
1326
+ frustum.left = newLeft;
1327
+ frustum.top = frustum.right * ratio;
1328
+ frustum.bottom = -frustum.top;
1329
+ }
1330
+ }
1331
+
1332
+ if (camera._scene.mapMode2D === MapMode2D.ROTATE) {
1333
+ hpr.heading = hpr.heading - CesiumMath.PI_OVER_TWO;
1334
+ hpr.pitch = -CesiumMath.PI_OVER_TWO;
1335
+ hpr.roll = 0.0;
1336
+ const rotQuat = Quaternion.fromHeadingPitchRoll(
1337
+ hpr,
1338
+ scratchSetViewQuaternion
1339
+ );
1340
+ const rotMat = Matrix3.fromQuaternion(rotQuat, scratchSetViewMatrix3);
1341
+
1342
+ Matrix3.getColumn(rotMat, 2, camera.up);
1343
+ Cartesian3.cross(camera.direction, camera.up, camera.right);
1344
+ }
1345
+
1346
+ camera._setTransform(currentTransform);
1347
+ }
1348
+
1349
+ const scratchToHPRDirection = new Cartesian3();
1350
+ const scratchToHPRUp = new Cartesian3();
1351
+ const scratchToHPRRight = new Cartesian3();
1352
+
1353
+ function directionUpToHeadingPitchRoll(camera, position, orientation, result) {
1354
+ const direction = Cartesian3.clone(
1355
+ orientation.direction,
1356
+ scratchToHPRDirection
1357
+ );
1358
+ const up = Cartesian3.clone(orientation.up, scratchToHPRUp);
1359
+
1360
+ if (camera._scene.mode === SceneMode.SCENE3D) {
1361
+ const ellipsoid = camera._projection.ellipsoid;
1362
+ const transform = Transforms.eastNorthUpToFixedFrame(
1363
+ position,
1364
+ ellipsoid,
1365
+ scratchHPRMatrix1
1366
+ );
1367
+ const invTransform = Matrix4.inverseTransformation(
1368
+ transform,
1369
+ scratchHPRMatrix2
1370
+ );
1371
+
1372
+ Matrix4.multiplyByPointAsVector(invTransform, direction, direction);
1373
+ Matrix4.multiplyByPointAsVector(invTransform, up, up);
1374
+ }
1375
+
1376
+ const right = Cartesian3.cross(direction, up, scratchToHPRRight);
1377
+
1378
+ result.heading = getHeading(direction, up);
1379
+ result.pitch = getPitch(direction);
1380
+ result.roll = getRoll(direction, up, right);
1381
+
1382
+ return result;
1383
+ }
1384
+
1385
+ const scratchSetViewOptions = {
1386
+ destination: undefined,
1387
+ orientation: {
1388
+ direction: undefined,
1389
+ up: undefined,
1390
+ heading: undefined,
1391
+ pitch: undefined,
1392
+ roll: undefined,
1393
+ },
1394
+ convert: undefined,
1395
+ endTransform: undefined,
1396
+ };
1397
+
1398
+ const scratchHpr = new HeadingPitchRoll();
1399
+ /**
1400
+ * Sets the camera position, orientation and transform.
1401
+ *
1402
+ * @param {Object} options Object with the following properties:
1403
+ * @param {Cartesian3|Rectangle} [options.destination] The final position of the camera in WGS84 (world) coordinates or a rectangle that would be visible from a top-down view.
1404
+ * @param {HeadingPitchRollValues|DirectionUp} [options.orientation] An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
1405
+ * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive
1406
+ * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
1407
+ * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame of the camera.
1408
+ * @param {Boolean} [options.convert] Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to <code>true</code>.
1409
+ *
1410
+ * @example
1411
+ * // 1. Set position with a top-down view
1412
+ * viewer.camera.setView({
1413
+ * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
1414
+ * });
1415
+ *
1416
+ * // 2 Set view with heading, pitch and roll
1417
+ * viewer.camera.setView({
1418
+ * destination : cartesianPosition,
1419
+ * orientation: {
1420
+ * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
1421
+ * pitch : Cesium.Math.toRadians(-90), // default value (looking down)
1422
+ * roll : 0.0 // default value
1423
+ * }
1424
+ * });
1425
+ *
1426
+ * // 3. Change heading, pitch and roll with the camera position remaining the same.
1427
+ * viewer.camera.setView({
1428
+ * orientation: {
1429
+ * heading : Cesium.Math.toRadians(90.0), // east, default value is 0.0 (north)
1430
+ * pitch : Cesium.Math.toRadians(-90), // default value (looking down)
1431
+ * roll : 0.0 // default value
1432
+ * }
1433
+ * });
1434
+ *
1435
+ *
1436
+ * // 4. View rectangle with a top-down view
1437
+ * viewer.camera.setView({
1438
+ * destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
1439
+ * });
1440
+ *
1441
+ * // 5. Set position with an orientation using unit vectors.
1442
+ * viewer.camera.setView({
1443
+ * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
1444
+ * orientation : {
1445
+ * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
1446
+ * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
1447
+ * }
1448
+ * });
1449
+ */
1450
+ Camera.prototype.setView = function (options) {
1451
+ options = defaultValue(options, defaultValue.EMPTY_OBJECT);
1452
+ let orientation = defaultValue(
1453
+ options.orientation,
1454
+ defaultValue.EMPTY_OBJECT
1455
+ );
1456
+
1457
+ const mode = this._mode;
1458
+ if (mode === SceneMode.MORPHING) {
1459
+ return;
1460
+ }
1461
+
1462
+ if (defined(options.endTransform)) {
1463
+ this._setTransform(options.endTransform);
1464
+ }
1465
+
1466
+ let convert = defaultValue(options.convert, true);
1467
+ let destination = defaultValue(
1468
+ options.destination,
1469
+ Cartesian3.clone(this.positionWC, scratchSetViewCartesian)
1470
+ );
1471
+ if (defined(destination) && defined(destination.west)) {
1472
+ destination = this.getRectangleCameraCoordinates(
1473
+ destination,
1474
+ scratchSetViewCartesian
1475
+ );
1476
+ convert = false;
1477
+ }
1478
+
1479
+ if (defined(orientation.direction)) {
1480
+ orientation = directionUpToHeadingPitchRoll(
1481
+ this,
1482
+ destination,
1483
+ orientation,
1484
+ scratchSetViewOptions.orientation
1485
+ );
1486
+ }
1487
+
1488
+ scratchHpr.heading = defaultValue(orientation.heading, 0.0);
1489
+ scratchHpr.pitch = defaultValue(orientation.pitch, -CesiumMath.PI_OVER_TWO);
1490
+ scratchHpr.roll = defaultValue(orientation.roll, 0.0);
1491
+
1492
+ if (mode === SceneMode.SCENE3D) {
1493
+ setView3D(this, destination, scratchHpr);
1494
+ } else if (mode === SceneMode.SCENE2D) {
1495
+ setView2D(this, destination, scratchHpr, convert);
1496
+ } else {
1497
+ setViewCV(this, destination, scratchHpr, convert);
1498
+ }
1499
+ };
1500
+
1501
+ const pitchScratch = new Cartesian3();
1502
+ /**
1503
+ * Fly the camera to the home view. Use {@link Camera#.DEFAULT_VIEW_RECTANGLE} to set
1504
+ * the default view for the 3D scene. The home view for 2D and columbus view shows the
1505
+ * entire map.
1506
+ *
1507
+ * @param {Number} [duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight. See {@link Camera#flyTo}
1508
+ */
1509
+ Camera.prototype.flyHome = function (duration) {
1510
+ const mode = this._mode;
1511
+
1512
+ if (mode === SceneMode.MORPHING) {
1513
+ this._scene.completeMorph();
1514
+ }
1515
+
1516
+ if (mode === SceneMode.SCENE2D) {
1517
+ this.flyTo({
1518
+ destination: Camera.DEFAULT_VIEW_RECTANGLE,
1519
+ duration: duration,
1520
+ endTransform: Matrix4.IDENTITY,
1521
+ });
1522
+ } else if (mode === SceneMode.SCENE3D) {
1523
+ const destination = this.getRectangleCameraCoordinates(
1524
+ Camera.DEFAULT_VIEW_RECTANGLE
1525
+ );
1526
+
1527
+ let mag = Cartesian3.magnitude(destination);
1528
+ mag += mag * Camera.DEFAULT_VIEW_FACTOR;
1529
+ Cartesian3.normalize(destination, destination);
1530
+ Cartesian3.multiplyByScalar(destination, mag, destination);
1531
+
1532
+ this.flyTo({
1533
+ destination: destination,
1534
+ duration: duration,
1535
+ endTransform: Matrix4.IDENTITY,
1536
+ });
1537
+ } else if (mode === SceneMode.COLUMBUS_VIEW) {
1538
+ const maxRadii = this._projection.ellipsoid.maximumRadius;
1539
+ let position = new Cartesian3(0.0, -1.0, 1.0);
1540
+ position = Cartesian3.multiplyByScalar(
1541
+ Cartesian3.normalize(position, position),
1542
+ 5.0 * maxRadii,
1543
+ position
1544
+ );
1545
+ this.flyTo({
1546
+ destination: position,
1547
+ duration: duration,
1548
+ orientation: {
1549
+ heading: 0.0,
1550
+ pitch: -Math.acos(Cartesian3.normalize(position, pitchScratch).z),
1551
+ roll: 0.0,
1552
+ },
1553
+ endTransform: Matrix4.IDENTITY,
1554
+ convert: false,
1555
+ });
1556
+ }
1557
+ };
1558
+
1559
+ /**
1560
+ * Transform a vector or point from world coordinates to the camera's reference frame.
1561
+ *
1562
+ * @param {Cartesian4} cartesian The vector or point to transform.
1563
+ * @param {Cartesian4} [result] The object onto which to store the result.
1564
+ * @returns {Cartesian4} The transformed vector or point.
1565
+ */
1566
+ Camera.prototype.worldToCameraCoordinates = function (cartesian, result) {
1567
+ //>>includeStart('debug', pragmas.debug);
1568
+ if (!defined(cartesian)) {
1569
+ throw new DeveloperError("cartesian is required.");
1570
+ }
1571
+ //>>includeEnd('debug');
1572
+
1573
+ if (!defined(result)) {
1574
+ result = new Cartesian4();
1575
+ }
1576
+ updateMembers(this);
1577
+ return Matrix4.multiplyByVector(this._actualInvTransform, cartesian, result);
1578
+ };
1579
+
1580
+ /**
1581
+ * Transform a point from world coordinates to the camera's reference frame.
1582
+ *
1583
+ * @param {Cartesian3} cartesian The point to transform.
1584
+ * @param {Cartesian3} [result] The object onto which to store the result.
1585
+ * @returns {Cartesian3} The transformed point.
1586
+ */
1587
+ Camera.prototype.worldToCameraCoordinatesPoint = function (cartesian, result) {
1588
+ //>>includeStart('debug', pragmas.debug);
1589
+ if (!defined(cartesian)) {
1590
+ throw new DeveloperError("cartesian is required.");
1591
+ }
1592
+ //>>includeEnd('debug');
1593
+
1594
+ if (!defined(result)) {
1595
+ result = new Cartesian3();
1596
+ }
1597
+ updateMembers(this);
1598
+ return Matrix4.multiplyByPoint(this._actualInvTransform, cartesian, result);
1599
+ };
1600
+
1601
+ /**
1602
+ * Transform a vector from world coordinates to the camera's reference frame.
1603
+ *
1604
+ * @param {Cartesian3} cartesian The vector to transform.
1605
+ * @param {Cartesian3} [result] The object onto which to store the result.
1606
+ * @returns {Cartesian3} The transformed vector.
1607
+ */
1608
+ Camera.prototype.worldToCameraCoordinatesVector = function (cartesian, result) {
1609
+ //>>includeStart('debug', pragmas.debug);
1610
+ if (!defined(cartesian)) {
1611
+ throw new DeveloperError("cartesian is required.");
1612
+ }
1613
+ //>>includeEnd('debug');
1614
+
1615
+ if (!defined(result)) {
1616
+ result = new Cartesian3();
1617
+ }
1618
+ updateMembers(this);
1619
+ return Matrix4.multiplyByPointAsVector(
1620
+ this._actualInvTransform,
1621
+ cartesian,
1622
+ result
1623
+ );
1624
+ };
1625
+
1626
+ /**
1627
+ * Transform a vector or point from the camera's reference frame to world coordinates.
1628
+ *
1629
+ * @param {Cartesian4} cartesian The vector or point to transform.
1630
+ * @param {Cartesian4} [result] The object onto which to store the result.
1631
+ * @returns {Cartesian4} The transformed vector or point.
1632
+ */
1633
+ Camera.prototype.cameraToWorldCoordinates = function (cartesian, result) {
1634
+ //>>includeStart('debug', pragmas.debug);
1635
+ if (!defined(cartesian)) {
1636
+ throw new DeveloperError("cartesian is required.");
1637
+ }
1638
+ //>>includeEnd('debug');
1639
+
1640
+ if (!defined(result)) {
1641
+ result = new Cartesian4();
1642
+ }
1643
+ updateMembers(this);
1644
+ return Matrix4.multiplyByVector(this._actualTransform, cartesian, result);
1645
+ };
1646
+
1647
+ /**
1648
+ * Transform a point from the camera's reference frame to world coordinates.
1649
+ *
1650
+ * @param {Cartesian3} cartesian The point to transform.
1651
+ * @param {Cartesian3} [result] The object onto which to store the result.
1652
+ * @returns {Cartesian3} The transformed point.
1653
+ */
1654
+ Camera.prototype.cameraToWorldCoordinatesPoint = function (cartesian, result) {
1655
+ //>>includeStart('debug', pragmas.debug);
1656
+ if (!defined(cartesian)) {
1657
+ throw new DeveloperError("cartesian is required.");
1658
+ }
1659
+ //>>includeEnd('debug');
1660
+
1661
+ if (!defined(result)) {
1662
+ result = new Cartesian3();
1663
+ }
1664
+ updateMembers(this);
1665
+ return Matrix4.multiplyByPoint(this._actualTransform, cartesian, result);
1666
+ };
1667
+
1668
+ /**
1669
+ * Transform a vector from the camera's reference frame to world coordinates.
1670
+ *
1671
+ * @param {Cartesian3} cartesian The vector to transform.
1672
+ * @param {Cartesian3} [result] The object onto which to store the result.
1673
+ * @returns {Cartesian3} The transformed vector.
1674
+ */
1675
+ Camera.prototype.cameraToWorldCoordinatesVector = function (cartesian, result) {
1676
+ //>>includeStart('debug', pragmas.debug);
1677
+ if (!defined(cartesian)) {
1678
+ throw new DeveloperError("cartesian is required.");
1679
+ }
1680
+ //>>includeEnd('debug');
1681
+
1682
+ if (!defined(result)) {
1683
+ result = new Cartesian3();
1684
+ }
1685
+ updateMembers(this);
1686
+ return Matrix4.multiplyByPointAsVector(
1687
+ this._actualTransform,
1688
+ cartesian,
1689
+ result
1690
+ );
1691
+ };
1692
+
1693
+ function clampMove2D(camera, position) {
1694
+ const rotatable2D = camera._scene.mapMode2D === MapMode2D.ROTATE;
1695
+ const maxProjectedX = camera._maxCoord.x;
1696
+ const maxProjectedY = camera._maxCoord.y;
1697
+
1698
+ let minX;
1699
+ let maxX;
1700
+ if (rotatable2D) {
1701
+ maxX = maxProjectedX;
1702
+ minX = -maxX;
1703
+ } else {
1704
+ maxX = position.x - maxProjectedX * 2.0;
1705
+ minX = position.x + maxProjectedX * 2.0;
1706
+ }
1707
+
1708
+ if (position.x > maxProjectedX) {
1709
+ position.x = maxX;
1710
+ }
1711
+ if (position.x < -maxProjectedX) {
1712
+ position.x = minX;
1713
+ }
1714
+
1715
+ if (position.y > maxProjectedY) {
1716
+ position.y = maxProjectedY;
1717
+ }
1718
+ if (position.y < -maxProjectedY) {
1719
+ position.y = -maxProjectedY;
1720
+ }
1721
+ }
1722
+
1723
+ const moveScratch = new Cartesian3();
1724
+ /**
1725
+ * Translates the camera's position by <code>amount</code> along <code>direction</code>.
1726
+ *
1727
+ * @param {Cartesian3} direction The direction to move.
1728
+ * @param {Number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
1729
+ *
1730
+ * @see Camera#moveBackward
1731
+ * @see Camera#moveForward
1732
+ * @see Camera#moveLeft
1733
+ * @see Camera#moveRight
1734
+ * @see Camera#moveUp
1735
+ * @see Camera#moveDown
1736
+ */
1737
+ Camera.prototype.move = function (direction, amount) {
1738
+ //>>includeStart('debug', pragmas.debug);
1739
+ if (!defined(direction)) {
1740
+ throw new DeveloperError("direction is required.");
1741
+ }
1742
+ //>>includeEnd('debug');
1743
+
1744
+ const cameraPosition = this.position;
1745
+ Cartesian3.multiplyByScalar(direction, amount, moveScratch);
1746
+ Cartesian3.add(cameraPosition, moveScratch, cameraPosition);
1747
+
1748
+ if (this._mode === SceneMode.SCENE2D) {
1749
+ clampMove2D(this, cameraPosition);
1750
+ }
1751
+ this._adjustOrthographicFrustum(true);
1752
+ };
1753
+
1754
+ /**
1755
+ * Translates the camera's position by <code>amount</code> along the camera's view vector.
1756
+ * When in 2D mode, this will zoom in the camera instead of translating the camera's position.
1757
+ *
1758
+ * @param {Number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
1759
+ *
1760
+ * @see Camera#moveBackward
1761
+ */
1762
+ Camera.prototype.moveForward = function (amount) {
1763
+ amount = defaultValue(amount, this.defaultMoveAmount);
1764
+
1765
+ if (this._mode === SceneMode.SCENE2D) {
1766
+ // 2D mode
1767
+ zoom2D(this, amount);
1768
+ } else {
1769
+ // 3D or Columbus view mode
1770
+ this.move(this.direction, amount);
1771
+ }
1772
+ };
1773
+
1774
+ /**
1775
+ * Translates the camera's position by <code>amount</code> along the opposite direction
1776
+ * of the camera's view vector.
1777
+ * When in 2D mode, this will zoom out the camera instead of translating the camera's position.
1778
+ *
1779
+ * @param {Number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
1780
+ *
1781
+ * @see Camera#moveForward
1782
+ */
1783
+ Camera.prototype.moveBackward = function (amount) {
1784
+ amount = defaultValue(amount, this.defaultMoveAmount);
1785
+
1786
+ if (this._mode === SceneMode.SCENE2D) {
1787
+ // 2D mode
1788
+ zoom2D(this, -amount);
1789
+ } else {
1790
+ // 3D or Columbus view mode
1791
+ this.move(this.direction, -amount);
1792
+ }
1793
+ };
1794
+
1795
+ /**
1796
+ * Translates the camera's position by <code>amount</code> along the camera's up vector.
1797
+ *
1798
+ * @param {Number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
1799
+ *
1800
+ * @see Camera#moveDown
1801
+ */
1802
+ Camera.prototype.moveUp = function (amount) {
1803
+ amount = defaultValue(amount, this.defaultMoveAmount);
1804
+ this.move(this.up, amount);
1805
+ };
1806
+
1807
+ /**
1808
+ * Translates the camera's position by <code>amount</code> along the opposite direction
1809
+ * of the camera's up vector.
1810
+ *
1811
+ * @param {Number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
1812
+ *
1813
+ * @see Camera#moveUp
1814
+ */
1815
+ Camera.prototype.moveDown = function (amount) {
1816
+ amount = defaultValue(amount, this.defaultMoveAmount);
1817
+ this.move(this.up, -amount);
1818
+ };
1819
+
1820
+ /**
1821
+ * Translates the camera's position by <code>amount</code> along the camera's right vector.
1822
+ *
1823
+ * @param {Number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
1824
+ *
1825
+ * @see Camera#moveLeft
1826
+ */
1827
+ Camera.prototype.moveRight = function (amount) {
1828
+ amount = defaultValue(amount, this.defaultMoveAmount);
1829
+ this.move(this.right, amount);
1830
+ };
1831
+
1832
+ /**
1833
+ * Translates the camera's position by <code>amount</code> along the opposite direction
1834
+ * of the camera's right vector.
1835
+ *
1836
+ * @param {Number} [amount] The amount, in meters, to move. Defaults to <code>defaultMoveAmount</code>.
1837
+ *
1838
+ * @see Camera#moveRight
1839
+ */
1840
+ Camera.prototype.moveLeft = function (amount) {
1841
+ amount = defaultValue(amount, this.defaultMoveAmount);
1842
+ this.move(this.right, -amount);
1843
+ };
1844
+
1845
+ /**
1846
+ * Rotates the camera around its up vector by amount, in radians, in the opposite direction
1847
+ * of its right vector if not in 2D mode.
1848
+ *
1849
+ * @param {Number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
1850
+ *
1851
+ * @see Camera#lookRight
1852
+ */
1853
+ Camera.prototype.lookLeft = function (amount) {
1854
+ amount = defaultValue(amount, this.defaultLookAmount);
1855
+
1856
+ // only want view of map to change in 3D mode, 2D visual is incorrect when look changes
1857
+ if (this._mode !== SceneMode.SCENE2D) {
1858
+ this.look(this.up, -amount);
1859
+ }
1860
+ };
1861
+
1862
+ /**
1863
+ * Rotates the camera around its up vector by amount, in radians, in the direction
1864
+ * of its right vector if not in 2D mode.
1865
+ *
1866
+ * @param {Number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
1867
+ *
1868
+ * @see Camera#lookLeft
1869
+ */
1870
+ Camera.prototype.lookRight = function (amount) {
1871
+ amount = defaultValue(amount, this.defaultLookAmount);
1872
+
1873
+ // only want view of map to change in 3D mode, 2D visual is incorrect when look changes
1874
+ if (this._mode !== SceneMode.SCENE2D) {
1875
+ this.look(this.up, amount);
1876
+ }
1877
+ };
1878
+
1879
+ /**
1880
+ * Rotates the camera around its right vector by amount, in radians, in the direction
1881
+ * of its up vector if not in 2D mode.
1882
+ *
1883
+ * @param {Number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
1884
+ *
1885
+ * @see Camera#lookDown
1886
+ */
1887
+ Camera.prototype.lookUp = function (amount) {
1888
+ amount = defaultValue(amount, this.defaultLookAmount);
1889
+
1890
+ // only want view of map to change in 3D mode, 2D visual is incorrect when look changes
1891
+ if (this._mode !== SceneMode.SCENE2D) {
1892
+ this.look(this.right, -amount);
1893
+ }
1894
+ };
1895
+
1896
+ /**
1897
+ * Rotates the camera around its right vector by amount, in radians, in the opposite direction
1898
+ * of its up vector if not in 2D mode.
1899
+ *
1900
+ * @param {Number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
1901
+ *
1902
+ * @see Camera#lookUp
1903
+ */
1904
+ Camera.prototype.lookDown = function (amount) {
1905
+ amount = defaultValue(amount, this.defaultLookAmount);
1906
+
1907
+ // only want view of map to change in 3D mode, 2D visual is incorrect when look changes
1908
+ if (this._mode !== SceneMode.SCENE2D) {
1909
+ this.look(this.right, amount);
1910
+ }
1911
+ };
1912
+
1913
+ const lookScratchQuaternion = new Quaternion();
1914
+ const lookScratchMatrix = new Matrix3();
1915
+ /**
1916
+ * Rotate each of the camera's orientation vectors around <code>axis</code> by <code>angle</code>
1917
+ *
1918
+ * @param {Cartesian3} axis The axis to rotate around.
1919
+ * @param {Number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
1920
+ *
1921
+ * @see Camera#lookUp
1922
+ * @see Camera#lookDown
1923
+ * @see Camera#lookLeft
1924
+ * @see Camera#lookRight
1925
+ */
1926
+ Camera.prototype.look = function (axis, angle) {
1927
+ //>>includeStart('debug', pragmas.debug);
1928
+ if (!defined(axis)) {
1929
+ throw new DeveloperError("axis is required.");
1930
+ }
1931
+ //>>includeEnd('debug');
1932
+
1933
+ const turnAngle = defaultValue(angle, this.defaultLookAmount);
1934
+ const quaternion = Quaternion.fromAxisAngle(
1935
+ axis,
1936
+ -turnAngle,
1937
+ lookScratchQuaternion
1938
+ );
1939
+ const rotation = Matrix3.fromQuaternion(quaternion, lookScratchMatrix);
1940
+
1941
+ const direction = this.direction;
1942
+ const up = this.up;
1943
+ const right = this.right;
1944
+
1945
+ Matrix3.multiplyByVector(rotation, direction, direction);
1946
+ Matrix3.multiplyByVector(rotation, up, up);
1947
+ Matrix3.multiplyByVector(rotation, right, right);
1948
+ };
1949
+
1950
+ /**
1951
+ * Rotate the camera counter-clockwise around its direction vector by amount, in radians.
1952
+ *
1953
+ * @param {Number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
1954
+ *
1955
+ * @see Camera#twistRight
1956
+ */
1957
+ Camera.prototype.twistLeft = function (amount) {
1958
+ amount = defaultValue(amount, this.defaultLookAmount);
1959
+ this.look(this.direction, amount);
1960
+ };
1961
+
1962
+ /**
1963
+ * Rotate the camera clockwise around its direction vector by amount, in radians.
1964
+ *
1965
+ * @param {Number} [amount] The amount, in radians, to rotate by. Defaults to <code>defaultLookAmount</code>.
1966
+ *
1967
+ * @see Camera#twistLeft
1968
+ */
1969
+ Camera.prototype.twistRight = function (amount) {
1970
+ amount = defaultValue(amount, this.defaultLookAmount);
1971
+ this.look(this.direction, -amount);
1972
+ };
1973
+
1974
+ const rotateScratchQuaternion = new Quaternion();
1975
+ const rotateScratchMatrix = new Matrix3();
1976
+ /**
1977
+ * Rotates the camera around <code>axis</code> by <code>angle</code>. The distance
1978
+ * of the camera's position to the center of the camera's reference frame remains the same.
1979
+ *
1980
+ * @param {Cartesian3} axis The axis to rotate around given in world coordinates.
1981
+ * @param {Number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
1982
+ *
1983
+ * @see Camera#rotateUp
1984
+ * @see Camera#rotateDown
1985
+ * @see Camera#rotateLeft
1986
+ * @see Camera#rotateRight
1987
+ */
1988
+ Camera.prototype.rotate = function (axis, angle) {
1989
+ //>>includeStart('debug', pragmas.debug);
1990
+ if (!defined(axis)) {
1991
+ throw new DeveloperError("axis is required.");
1992
+ }
1993
+ //>>includeEnd('debug');
1994
+
1995
+ const turnAngle = defaultValue(angle, this.defaultRotateAmount);
1996
+ const quaternion = Quaternion.fromAxisAngle(
1997
+ axis,
1998
+ -turnAngle,
1999
+ rotateScratchQuaternion
2000
+ );
2001
+ const rotation = Matrix3.fromQuaternion(quaternion, rotateScratchMatrix);
2002
+ Matrix3.multiplyByVector(rotation, this.position, this.position);
2003
+ Matrix3.multiplyByVector(rotation, this.direction, this.direction);
2004
+ Matrix3.multiplyByVector(rotation, this.up, this.up);
2005
+ Cartesian3.cross(this.direction, this.up, this.right);
2006
+ Cartesian3.cross(this.right, this.direction, this.up);
2007
+
2008
+ this._adjustOrthographicFrustum(false);
2009
+ };
2010
+
2011
+ /**
2012
+ * Rotates the camera around the center of the camera's reference frame by angle downwards.
2013
+ *
2014
+ * @param {Number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
2015
+ *
2016
+ * @see Camera#rotateUp
2017
+ * @see Camera#rotate
2018
+ */
2019
+ Camera.prototype.rotateDown = function (angle) {
2020
+ angle = defaultValue(angle, this.defaultRotateAmount);
2021
+ rotateVertical(this, angle);
2022
+ };
2023
+
2024
+ /**
2025
+ * Rotates the camera around the center of the camera's reference frame by angle upwards.
2026
+ *
2027
+ * @param {Number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
2028
+ *
2029
+ * @see Camera#rotateDown
2030
+ * @see Camera#rotate
2031
+ */
2032
+ Camera.prototype.rotateUp = function (angle) {
2033
+ angle = defaultValue(angle, this.defaultRotateAmount);
2034
+ rotateVertical(this, -angle);
2035
+ };
2036
+
2037
+ const rotateVertScratchP = new Cartesian3();
2038
+ const rotateVertScratchA = new Cartesian3();
2039
+ const rotateVertScratchTan = new Cartesian3();
2040
+ const rotateVertScratchNegate = new Cartesian3();
2041
+ function rotateVertical(camera, angle) {
2042
+ const position = camera.position;
2043
+ if (
2044
+ defined(camera.constrainedAxis) &&
2045
+ !Cartesian3.equalsEpsilon(
2046
+ camera.position,
2047
+ Cartesian3.ZERO,
2048
+ CesiumMath.EPSILON2
2049
+ )
2050
+ ) {
2051
+ const p = Cartesian3.normalize(position, rotateVertScratchP);
2052
+ const northParallel = Cartesian3.equalsEpsilon(
2053
+ p,
2054
+ camera.constrainedAxis,
2055
+ CesiumMath.EPSILON2
2056
+ );
2057
+ const southParallel = Cartesian3.equalsEpsilon(
2058
+ p,
2059
+ Cartesian3.negate(camera.constrainedAxis, rotateVertScratchNegate),
2060
+ CesiumMath.EPSILON2
2061
+ );
2062
+ if (!northParallel && !southParallel) {
2063
+ const constrainedAxis = Cartesian3.normalize(
2064
+ camera.constrainedAxis,
2065
+ rotateVertScratchA
2066
+ );
2067
+
2068
+ let dot = Cartesian3.dot(p, constrainedAxis);
2069
+ let angleToAxis = CesiumMath.acosClamped(dot);
2070
+ if (angle > 0 && angle > angleToAxis) {
2071
+ angle = angleToAxis - CesiumMath.EPSILON4;
2072
+ }
2073
+
2074
+ dot = Cartesian3.dot(
2075
+ p,
2076
+ Cartesian3.negate(constrainedAxis, rotateVertScratchNegate)
2077
+ );
2078
+ angleToAxis = CesiumMath.acosClamped(dot);
2079
+ if (angle < 0 && -angle > angleToAxis) {
2080
+ angle = -angleToAxis + CesiumMath.EPSILON4;
2081
+ }
2082
+
2083
+ const tangent = Cartesian3.cross(
2084
+ constrainedAxis,
2085
+ p,
2086
+ rotateVertScratchTan
2087
+ );
2088
+ camera.rotate(tangent, angle);
2089
+ } else if ((northParallel && angle < 0) || (southParallel && angle > 0)) {
2090
+ camera.rotate(camera.right, angle);
2091
+ }
2092
+ } else {
2093
+ camera.rotate(camera.right, angle);
2094
+ }
2095
+ }
2096
+
2097
+ /**
2098
+ * Rotates the camera around the center of the camera's reference frame by angle to the right.
2099
+ *
2100
+ * @param {Number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
2101
+ *
2102
+ * @see Camera#rotateLeft
2103
+ * @see Camera#rotate
2104
+ */
2105
+ Camera.prototype.rotateRight = function (angle) {
2106
+ angle = defaultValue(angle, this.defaultRotateAmount);
2107
+ rotateHorizontal(this, -angle);
2108
+ };
2109
+
2110
+ /**
2111
+ * Rotates the camera around the center of the camera's reference frame by angle to the left.
2112
+ *
2113
+ * @param {Number} [angle] The angle, in radians, to rotate by. Defaults to <code>defaultRotateAmount</code>.
2114
+ *
2115
+ * @see Camera#rotateRight
2116
+ * @see Camera#rotate
2117
+ */
2118
+ Camera.prototype.rotateLeft = function (angle) {
2119
+ angle = defaultValue(angle, this.defaultRotateAmount);
2120
+ rotateHorizontal(this, angle);
2121
+ };
2122
+
2123
+ function rotateHorizontal(camera, angle) {
2124
+ if (defined(camera.constrainedAxis)) {
2125
+ camera.rotate(camera.constrainedAxis, angle);
2126
+ } else {
2127
+ camera.rotate(camera.up, angle);
2128
+ }
2129
+ }
2130
+
2131
+ function zoom2D(camera, amount) {
2132
+ const frustum = camera.frustum;
2133
+
2134
+ //>>includeStart('debug', pragmas.debug);
2135
+ if (
2136
+ !(frustum instanceof OrthographicOffCenterFrustum) ||
2137
+ !defined(frustum.left) ||
2138
+ !defined(frustum.right) ||
2139
+ !defined(frustum.bottom) ||
2140
+ !defined(frustum.top)
2141
+ ) {
2142
+ throw new DeveloperError(
2143
+ "The camera frustum is expected to be orthographic for 2D camera control."
2144
+ );
2145
+ }
2146
+ //>>includeEnd('debug');
2147
+
2148
+ let ratio;
2149
+ amount = amount * 0.5;
2150
+
2151
+ if (
2152
+ Math.abs(frustum.top) + Math.abs(frustum.bottom) >
2153
+ Math.abs(frustum.left) + Math.abs(frustum.right)
2154
+ ) {
2155
+ let newTop = frustum.top - amount;
2156
+ let newBottom = frustum.bottom + amount;
2157
+
2158
+ let maxBottom = camera._maxCoord.y;
2159
+ if (camera._scene.mapMode2D === MapMode2D.ROTATE) {
2160
+ maxBottom *= camera.maximumZoomFactor;
2161
+ }
2162
+
2163
+ if (newBottom > maxBottom) {
2164
+ newBottom = maxBottom;
2165
+ newTop = -maxBottom;
2166
+ }
2167
+
2168
+ if (newTop <= newBottom) {
2169
+ newTop = 1.0;
2170
+ newBottom = -1.0;
2171
+ }
2172
+
2173
+ ratio = frustum.right / frustum.top;
2174
+ frustum.top = newTop;
2175
+ frustum.bottom = newBottom;
2176
+ frustum.right = frustum.top * ratio;
2177
+ frustum.left = -frustum.right;
2178
+ } else {
2179
+ let newRight = frustum.right - amount;
2180
+ let newLeft = frustum.left + amount;
2181
+
2182
+ let maxRight = camera._maxCoord.x;
2183
+ if (camera._scene.mapMode2D === MapMode2D.ROTATE) {
2184
+ maxRight *= camera.maximumZoomFactor;
2185
+ }
2186
+
2187
+ if (newRight > maxRight) {
2188
+ newRight = maxRight;
2189
+ newLeft = -maxRight;
2190
+ }
2191
+
2192
+ if (newRight <= newLeft) {
2193
+ newRight = 1.0;
2194
+ newLeft = -1.0;
2195
+ }
2196
+ ratio = frustum.top / frustum.right;
2197
+ frustum.right = newRight;
2198
+ frustum.left = newLeft;
2199
+ frustum.top = frustum.right * ratio;
2200
+ frustum.bottom = -frustum.top;
2201
+ }
2202
+ }
2203
+
2204
+ function zoom3D(camera, amount) {
2205
+ camera.move(camera.direction, amount);
2206
+ }
2207
+
2208
+ /**
2209
+ * Zooms <code>amount</code> along the camera's view vector.
2210
+ *
2211
+ * @param {Number} [amount] The amount to move. Defaults to <code>defaultZoomAmount</code>.
2212
+ *
2213
+ * @see Camera#zoomOut
2214
+ */
2215
+ Camera.prototype.zoomIn = function (amount) {
2216
+ amount = defaultValue(amount, this.defaultZoomAmount);
2217
+ if (this._mode === SceneMode.SCENE2D) {
2218
+ zoom2D(this, amount);
2219
+ } else {
2220
+ zoom3D(this, amount);
2221
+ }
2222
+ };
2223
+
2224
+ /**
2225
+ * Zooms <code>amount</code> along the opposite direction of
2226
+ * the camera's view vector.
2227
+ *
2228
+ * @param {Number} [amount] The amount to move. Defaults to <code>defaultZoomAmount</code>.
2229
+ *
2230
+ * @see Camera#zoomIn
2231
+ */
2232
+ Camera.prototype.zoomOut = function (amount) {
2233
+ amount = defaultValue(amount, this.defaultZoomAmount);
2234
+ if (this._mode === SceneMode.SCENE2D) {
2235
+ zoom2D(this, -amount);
2236
+ } else {
2237
+ zoom3D(this, -amount);
2238
+ }
2239
+ };
2240
+
2241
+ /**
2242
+ * Gets the magnitude of the camera position. In 3D, this is the vector magnitude. In 2D and
2243
+ * Columbus view, this is the distance to the map.
2244
+ *
2245
+ * @returns {Number} The magnitude of the position.
2246
+ */
2247
+ Camera.prototype.getMagnitude = function () {
2248
+ if (this._mode === SceneMode.SCENE3D) {
2249
+ return Cartesian3.magnitude(this.position);
2250
+ } else if (this._mode === SceneMode.COLUMBUS_VIEW) {
2251
+ return Math.abs(this.position.z);
2252
+ } else if (this._mode === SceneMode.SCENE2D) {
2253
+ return Math.max(
2254
+ this.frustum.right - this.frustum.left,
2255
+ this.frustum.top - this.frustum.bottom
2256
+ );
2257
+ }
2258
+ };
2259
+
2260
+ const scratchLookAtMatrix4 = new Matrix4();
2261
+
2262
+ /**
2263
+ * Sets the camera position and orientation using a target and offset. The target must be given in
2264
+ * world coordinates. The offset can be either a cartesian or heading/pitch/range in the local east-north-up reference frame centered at the target.
2265
+ * If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset
2266
+ * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
2267
+ * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
2268
+ * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
2269
+ *
2270
+ * In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
2271
+ * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
2272
+ * determined from the offset, the heading will be north.
2273
+ *
2274
+ * @param {Cartesian3} target The target position in world coordinates.
2275
+ * @param {Cartesian3|HeadingPitchRange} offset The offset from the target in the local east-north-up reference frame centered at the target.
2276
+ *
2277
+ * @exception {DeveloperError} lookAt is not supported while morphing.
2278
+ *
2279
+ * @example
2280
+ * // 1. Using a cartesian offset
2281
+ * const center = Cesium.Cartesian3.fromDegrees(-98.0, 40.0);
2282
+ * viewer.camera.lookAt(center, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
2283
+ *
2284
+ * // 2. Using a HeadingPitchRange offset
2285
+ * const center = Cesium.Cartesian3.fromDegrees(-72.0, 40.0);
2286
+ * const heading = Cesium.Math.toRadians(50.0);
2287
+ * const pitch = Cesium.Math.toRadians(-20.0);
2288
+ * const range = 5000.0;
2289
+ * viewer.camera.lookAt(center, new Cesium.HeadingPitchRange(heading, pitch, range));
2290
+ */
2291
+ Camera.prototype.lookAt = function (target, offset) {
2292
+ //>>includeStart('debug', pragmas.debug);
2293
+ if (!defined(target)) {
2294
+ throw new DeveloperError("target is required");
2295
+ }
2296
+ if (!defined(offset)) {
2297
+ throw new DeveloperError("offset is required");
2298
+ }
2299
+ if (this._mode === SceneMode.MORPHING) {
2300
+ throw new DeveloperError("lookAt is not supported while morphing.");
2301
+ }
2302
+ //>>includeEnd('debug');
2303
+
2304
+ const transform = Transforms.eastNorthUpToFixedFrame(
2305
+ target,
2306
+ Ellipsoid.WGS84,
2307
+ scratchLookAtMatrix4
2308
+ );
2309
+ this.lookAtTransform(transform, offset);
2310
+ };
2311
+
2312
+ const scratchLookAtHeadingPitchRangeOffset = new Cartesian3();
2313
+ const scratchLookAtHeadingPitchRangeQuaternion1 = new Quaternion();
2314
+ const scratchLookAtHeadingPitchRangeQuaternion2 = new Quaternion();
2315
+ const scratchHeadingPitchRangeMatrix3 = new Matrix3();
2316
+
2317
+ function offsetFromHeadingPitchRange(heading, pitch, range) {
2318
+ pitch = CesiumMath.clamp(
2319
+ pitch,
2320
+ -CesiumMath.PI_OVER_TWO,
2321
+ CesiumMath.PI_OVER_TWO
2322
+ );
2323
+ heading = CesiumMath.zeroToTwoPi(heading) - CesiumMath.PI_OVER_TWO;
2324
+
2325
+ const pitchQuat = Quaternion.fromAxisAngle(
2326
+ Cartesian3.UNIT_Y,
2327
+ -pitch,
2328
+ scratchLookAtHeadingPitchRangeQuaternion1
2329
+ );
2330
+ const headingQuat = Quaternion.fromAxisAngle(
2331
+ Cartesian3.UNIT_Z,
2332
+ -heading,
2333
+ scratchLookAtHeadingPitchRangeQuaternion2
2334
+ );
2335
+ const rotQuat = Quaternion.multiply(headingQuat, pitchQuat, headingQuat);
2336
+ const rotMatrix = Matrix3.fromQuaternion(
2337
+ rotQuat,
2338
+ scratchHeadingPitchRangeMatrix3
2339
+ );
2340
+
2341
+ const offset = Cartesian3.clone(
2342
+ Cartesian3.UNIT_X,
2343
+ scratchLookAtHeadingPitchRangeOffset
2344
+ );
2345
+ Matrix3.multiplyByVector(rotMatrix, offset, offset);
2346
+ Cartesian3.negate(offset, offset);
2347
+ Cartesian3.multiplyByScalar(offset, range, offset);
2348
+ return offset;
2349
+ }
2350
+
2351
+ /**
2352
+ * Sets the camera position and orientation using a target and transformation matrix. The offset can be either a cartesian or heading/pitch/range.
2353
+ * If the offset is a cartesian, then it is an offset from the center of the reference frame defined by the transformation matrix. If the offset
2354
+ * is heading/pitch/range, then the heading and the pitch angles are defined in the reference frame defined by the transformation matrix.
2355
+ * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
2356
+ * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center.
2357
+ *
2358
+ * In 2D, there must be a top down view. The camera will be placed above the center of the reference frame. The height above the
2359
+ * target will be the magnitude of the offset. The heading will be determined from the offset. If the heading cannot be
2360
+ * determined from the offset, the heading will be north.
2361
+ *
2362
+ * @param {Matrix4} transform The transformation matrix defining the reference frame.
2363
+ * @param {Cartesian3|HeadingPitchRange} [offset] The offset from the target in a reference frame centered at the target.
2364
+ *
2365
+ * @exception {DeveloperError} lookAtTransform is not supported while morphing.
2366
+ *
2367
+ * @example
2368
+ * // 1. Using a cartesian offset
2369
+ * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-98.0, 40.0));
2370
+ * viewer.camera.lookAtTransform(transform, new Cesium.Cartesian3(0.0, -4790000.0, 3930000.0));
2371
+ *
2372
+ * // 2. Using a HeadingPitchRange offset
2373
+ * const transform = Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.fromDegrees(-72.0, 40.0));
2374
+ * const heading = Cesium.Math.toRadians(50.0);
2375
+ * const pitch = Cesium.Math.toRadians(-20.0);
2376
+ * const range = 5000.0;
2377
+ * viewer.camera.lookAtTransform(transform, new Cesium.HeadingPitchRange(heading, pitch, range));
2378
+ */
2379
+ Camera.prototype.lookAtTransform = function (transform, offset) {
2380
+ //>>includeStart('debug', pragmas.debug);
2381
+ if (!defined(transform)) {
2382
+ throw new DeveloperError("transform is required");
2383
+ }
2384
+ if (this._mode === SceneMode.MORPHING) {
2385
+ throw new DeveloperError(
2386
+ "lookAtTransform is not supported while morphing."
2387
+ );
2388
+ }
2389
+ //>>includeEnd('debug');
2390
+
2391
+ this._setTransform(transform);
2392
+ if (!defined(offset)) {
2393
+ return;
2394
+ }
2395
+
2396
+ let cartesianOffset;
2397
+ if (defined(offset.heading)) {
2398
+ cartesianOffset = offsetFromHeadingPitchRange(
2399
+ offset.heading,
2400
+ offset.pitch,
2401
+ offset.range
2402
+ );
2403
+ } else {
2404
+ cartesianOffset = offset;
2405
+ }
2406
+
2407
+ if (this._mode === SceneMode.SCENE2D) {
2408
+ Cartesian2.clone(Cartesian2.ZERO, this.position);
2409
+
2410
+ Cartesian3.negate(cartesianOffset, this.up);
2411
+ this.up.z = 0.0;
2412
+
2413
+ if (Cartesian3.magnitudeSquared(this.up) < CesiumMath.EPSILON10) {
2414
+ Cartesian3.clone(Cartesian3.UNIT_Y, this.up);
2415
+ }
2416
+
2417
+ Cartesian3.normalize(this.up, this.up);
2418
+
2419
+ this._setTransform(Matrix4.IDENTITY);
2420
+
2421
+ Cartesian3.negate(Cartesian3.UNIT_Z, this.direction);
2422
+ Cartesian3.cross(this.direction, this.up, this.right);
2423
+ Cartesian3.normalize(this.right, this.right);
2424
+
2425
+ const frustum = this.frustum;
2426
+ const ratio = frustum.top / frustum.right;
2427
+ frustum.right = Cartesian3.magnitude(cartesianOffset) * 0.5;
2428
+ frustum.left = -frustum.right;
2429
+ frustum.top = ratio * frustum.right;
2430
+ frustum.bottom = -frustum.top;
2431
+
2432
+ this._setTransform(transform);
2433
+
2434
+ return;
2435
+ }
2436
+
2437
+ Cartesian3.clone(cartesianOffset, this.position);
2438
+ Cartesian3.negate(this.position, this.direction);
2439
+ Cartesian3.normalize(this.direction, this.direction);
2440
+ Cartesian3.cross(this.direction, Cartesian3.UNIT_Z, this.right);
2441
+
2442
+ if (Cartesian3.magnitudeSquared(this.right) < CesiumMath.EPSILON10) {
2443
+ Cartesian3.clone(Cartesian3.UNIT_X, this.right);
2444
+ }
2445
+
2446
+ Cartesian3.normalize(this.right, this.right);
2447
+ Cartesian3.cross(this.right, this.direction, this.up);
2448
+ Cartesian3.normalize(this.up, this.up);
2449
+
2450
+ this._adjustOrthographicFrustum(true);
2451
+ };
2452
+
2453
+ const viewRectangle3DCartographic1 = new Cartographic();
2454
+ const viewRectangle3DCartographic2 = new Cartographic();
2455
+ const viewRectangle3DNorthEast = new Cartesian3();
2456
+ const viewRectangle3DSouthWest = new Cartesian3();
2457
+ const viewRectangle3DNorthWest = new Cartesian3();
2458
+ const viewRectangle3DSouthEast = new Cartesian3();
2459
+ const viewRectangle3DNorthCenter = new Cartesian3();
2460
+ const viewRectangle3DSouthCenter = new Cartesian3();
2461
+ const viewRectangle3DCenter = new Cartesian3();
2462
+ const viewRectangle3DEquator = new Cartesian3();
2463
+ const defaultRF = {
2464
+ direction: new Cartesian3(),
2465
+ right: new Cartesian3(),
2466
+ up: new Cartesian3(),
2467
+ };
2468
+ let viewRectangle3DEllipsoidGeodesic;
2469
+
2470
+ function computeD(direction, upOrRight, corner, tanThetaOrPhi) {
2471
+ const opposite = Math.abs(Cartesian3.dot(upOrRight, corner));
2472
+ return opposite / tanThetaOrPhi - Cartesian3.dot(direction, corner);
2473
+ }
2474
+
2475
+ function rectangleCameraPosition3D(camera, rectangle, result, updateCamera) {
2476
+ const ellipsoid = camera._projection.ellipsoid;
2477
+ const cameraRF = updateCamera ? camera : defaultRF;
2478
+
2479
+ const north = rectangle.north;
2480
+ const south = rectangle.south;
2481
+ let east = rectangle.east;
2482
+ const west = rectangle.west;
2483
+
2484
+ // If we go across the International Date Line
2485
+ if (west > east) {
2486
+ east += CesiumMath.TWO_PI;
2487
+ }
2488
+
2489
+ // Find the midpoint latitude.
2490
+ //
2491
+ // EllipsoidGeodesic will fail if the north and south edges are very close to being on opposite sides of the ellipsoid.
2492
+ // Ideally we'd just call EllipsoidGeodesic.setEndPoints and let it throw when it detects this case, but sadly it doesn't
2493
+ // even look for this case in optimized builds, so we have to test for it here instead.
2494
+ //
2495
+ // Fortunately, this case can only happen (here) when north is very close to the north pole and south is very close to the south pole,
2496
+ // so handle it just by using 0 latitude as the center. It's certainliy possible to use a smaller tolerance
2497
+ // than one degree here, but one degree is safe and putting the center at 0 latitude should be good enough for any
2498
+ // rectangle that spans 178+ of the 180 degrees of latitude.
2499
+ const longitude = (west + east) * 0.5;
2500
+ let latitude;
2501
+ if (
2502
+ south < -CesiumMath.PI_OVER_TWO + CesiumMath.RADIANS_PER_DEGREE &&
2503
+ north > CesiumMath.PI_OVER_TWO - CesiumMath.RADIANS_PER_DEGREE
2504
+ ) {
2505
+ latitude = 0.0;
2506
+ } else {
2507
+ const northCartographic = viewRectangle3DCartographic1;
2508
+ northCartographic.longitude = longitude;
2509
+ northCartographic.latitude = north;
2510
+ northCartographic.height = 0.0;
2511
+
2512
+ const southCartographic = viewRectangle3DCartographic2;
2513
+ southCartographic.longitude = longitude;
2514
+ southCartographic.latitude = south;
2515
+ southCartographic.height = 0.0;
2516
+
2517
+ let ellipsoidGeodesic = viewRectangle3DEllipsoidGeodesic;
2518
+ if (
2519
+ !defined(ellipsoidGeodesic) ||
2520
+ ellipsoidGeodesic.ellipsoid !== ellipsoid
2521
+ ) {
2522
+ viewRectangle3DEllipsoidGeodesic = ellipsoidGeodesic = new EllipsoidGeodesic(
2523
+ undefined,
2524
+ undefined,
2525
+ ellipsoid
2526
+ );
2527
+ }
2528
+
2529
+ ellipsoidGeodesic.setEndPoints(northCartographic, southCartographic);
2530
+ latitude = ellipsoidGeodesic.interpolateUsingFraction(
2531
+ 0.5,
2532
+ viewRectangle3DCartographic1
2533
+ ).latitude;
2534
+ }
2535
+
2536
+ const centerCartographic = viewRectangle3DCartographic1;
2537
+ centerCartographic.longitude = longitude;
2538
+ centerCartographic.latitude = latitude;
2539
+ centerCartographic.height = 0.0;
2540
+
2541
+ const center = ellipsoid.cartographicToCartesian(
2542
+ centerCartographic,
2543
+ viewRectangle3DCenter
2544
+ );
2545
+
2546
+ const cart = viewRectangle3DCartographic1;
2547
+ cart.longitude = east;
2548
+ cart.latitude = north;
2549
+ const northEast = ellipsoid.cartographicToCartesian(
2550
+ cart,
2551
+ viewRectangle3DNorthEast
2552
+ );
2553
+ cart.longitude = west;
2554
+ const northWest = ellipsoid.cartographicToCartesian(
2555
+ cart,
2556
+ viewRectangle3DNorthWest
2557
+ );
2558
+ cart.longitude = longitude;
2559
+ const northCenter = ellipsoid.cartographicToCartesian(
2560
+ cart,
2561
+ viewRectangle3DNorthCenter
2562
+ );
2563
+ cart.latitude = south;
2564
+ const southCenter = ellipsoid.cartographicToCartesian(
2565
+ cart,
2566
+ viewRectangle3DSouthCenter
2567
+ );
2568
+ cart.longitude = east;
2569
+ const southEast = ellipsoid.cartographicToCartesian(
2570
+ cart,
2571
+ viewRectangle3DSouthEast
2572
+ );
2573
+ cart.longitude = west;
2574
+ const southWest = ellipsoid.cartographicToCartesian(
2575
+ cart,
2576
+ viewRectangle3DSouthWest
2577
+ );
2578
+
2579
+ Cartesian3.subtract(northWest, center, northWest);
2580
+ Cartesian3.subtract(southEast, center, southEast);
2581
+ Cartesian3.subtract(northEast, center, northEast);
2582
+ Cartesian3.subtract(southWest, center, southWest);
2583
+ Cartesian3.subtract(northCenter, center, northCenter);
2584
+ Cartesian3.subtract(southCenter, center, southCenter);
2585
+
2586
+ const direction = ellipsoid.geodeticSurfaceNormal(center, cameraRF.direction);
2587
+ Cartesian3.negate(direction, direction);
2588
+ const right = Cartesian3.cross(direction, Cartesian3.UNIT_Z, cameraRF.right);
2589
+ Cartesian3.normalize(right, right);
2590
+ const up = Cartesian3.cross(right, direction, cameraRF.up);
2591
+
2592
+ let d;
2593
+ if (camera.frustum instanceof OrthographicFrustum) {
2594
+ const width = Math.max(
2595
+ Cartesian3.distance(northEast, northWest),
2596
+ Cartesian3.distance(southEast, southWest)
2597
+ );
2598
+ const height = Math.max(
2599
+ Cartesian3.distance(northEast, southEast),
2600
+ Cartesian3.distance(northWest, southWest)
2601
+ );
2602
+
2603
+ let rightScalar;
2604
+ let topScalar;
2605
+ const ratio =
2606
+ camera.frustum._offCenterFrustum.right /
2607
+ camera.frustum._offCenterFrustum.top;
2608
+ const heightRatio = height * ratio;
2609
+ if (width > heightRatio) {
2610
+ rightScalar = width;
2611
+ topScalar = rightScalar / ratio;
2612
+ } else {
2613
+ topScalar = height;
2614
+ rightScalar = heightRatio;
2615
+ }
2616
+
2617
+ d = Math.max(rightScalar, topScalar);
2618
+ } else {
2619
+ const tanPhi = Math.tan(camera.frustum.fovy * 0.5);
2620
+ const tanTheta = camera.frustum.aspectRatio * tanPhi;
2621
+
2622
+ d = Math.max(
2623
+ computeD(direction, up, northWest, tanPhi),
2624
+ computeD(direction, up, southEast, tanPhi),
2625
+ computeD(direction, up, northEast, tanPhi),
2626
+ computeD(direction, up, southWest, tanPhi),
2627
+ computeD(direction, up, northCenter, tanPhi),
2628
+ computeD(direction, up, southCenter, tanPhi),
2629
+ computeD(direction, right, northWest, tanTheta),
2630
+ computeD(direction, right, southEast, tanTheta),
2631
+ computeD(direction, right, northEast, tanTheta),
2632
+ computeD(direction, right, southWest, tanTheta),
2633
+ computeD(direction, right, northCenter, tanTheta),
2634
+ computeD(direction, right, southCenter, tanTheta)
2635
+ );
2636
+
2637
+ // If the rectangle crosses the equator, compute D at the equator, too, because that's the
2638
+ // widest part of the rectangle when projected onto the globe.
2639
+ if (south < 0 && north > 0) {
2640
+ const equatorCartographic = viewRectangle3DCartographic1;
2641
+ equatorCartographic.longitude = west;
2642
+ equatorCartographic.latitude = 0.0;
2643
+ equatorCartographic.height = 0.0;
2644
+ let equatorPosition = ellipsoid.cartographicToCartesian(
2645
+ equatorCartographic,
2646
+ viewRectangle3DEquator
2647
+ );
2648
+ Cartesian3.subtract(equatorPosition, center, equatorPosition);
2649
+ d = Math.max(
2650
+ d,
2651
+ computeD(direction, up, equatorPosition, tanPhi),
2652
+ computeD(direction, right, equatorPosition, tanTheta)
2653
+ );
2654
+
2655
+ equatorCartographic.longitude = east;
2656
+ equatorPosition = ellipsoid.cartographicToCartesian(
2657
+ equatorCartographic,
2658
+ viewRectangle3DEquator
2659
+ );
2660
+ Cartesian3.subtract(equatorPosition, center, equatorPosition);
2661
+ d = Math.max(
2662
+ d,
2663
+ computeD(direction, up, equatorPosition, tanPhi),
2664
+ computeD(direction, right, equatorPosition, tanTheta)
2665
+ );
2666
+ }
2667
+ }
2668
+
2669
+ return Cartesian3.add(
2670
+ center,
2671
+ Cartesian3.multiplyByScalar(direction, -d, viewRectangle3DEquator),
2672
+ result
2673
+ );
2674
+ }
2675
+
2676
+ const viewRectangleCVCartographic = new Cartographic();
2677
+ const viewRectangleCVNorthEast = new Cartesian3();
2678
+ const viewRectangleCVSouthWest = new Cartesian3();
2679
+ function rectangleCameraPositionColumbusView(camera, rectangle, result) {
2680
+ const projection = camera._projection;
2681
+ if (rectangle.west > rectangle.east) {
2682
+ rectangle = Rectangle.MAX_VALUE;
2683
+ }
2684
+ const transform = camera._actualTransform;
2685
+ const invTransform = camera._actualInvTransform;
2686
+
2687
+ const cart = viewRectangleCVCartographic;
2688
+ cart.longitude = rectangle.east;
2689
+ cart.latitude = rectangle.north;
2690
+ const northEast = projection.project(cart, viewRectangleCVNorthEast);
2691
+ Matrix4.multiplyByPoint(transform, northEast, northEast);
2692
+ Matrix4.multiplyByPoint(invTransform, northEast, northEast);
2693
+
2694
+ cart.longitude = rectangle.west;
2695
+ cart.latitude = rectangle.south;
2696
+ const southWest = projection.project(cart, viewRectangleCVSouthWest);
2697
+ Matrix4.multiplyByPoint(transform, southWest, southWest);
2698
+ Matrix4.multiplyByPoint(invTransform, southWest, southWest);
2699
+
2700
+ result.x = (northEast.x - southWest.x) * 0.5 + southWest.x;
2701
+ result.y = (northEast.y - southWest.y) * 0.5 + southWest.y;
2702
+
2703
+ if (defined(camera.frustum.fovy)) {
2704
+ const tanPhi = Math.tan(camera.frustum.fovy * 0.5);
2705
+ const tanTheta = camera.frustum.aspectRatio * tanPhi;
2706
+ result.z =
2707
+ Math.max(
2708
+ (northEast.x - southWest.x) / tanTheta,
2709
+ (northEast.y - southWest.y) / tanPhi
2710
+ ) * 0.5;
2711
+ } else {
2712
+ const width = northEast.x - southWest.x;
2713
+ const height = northEast.y - southWest.y;
2714
+ result.z = Math.max(width, height);
2715
+ }
2716
+
2717
+ return result;
2718
+ }
2719
+
2720
+ const viewRectangle2DCartographic = new Cartographic();
2721
+ const viewRectangle2DNorthEast = new Cartesian3();
2722
+ const viewRectangle2DSouthWest = new Cartesian3();
2723
+ function rectangleCameraPosition2D(camera, rectangle, result) {
2724
+ const projection = camera._projection;
2725
+
2726
+ // Account for the rectangle crossing the International Date Line in 2D mode
2727
+ let east = rectangle.east;
2728
+ if (rectangle.west > rectangle.east) {
2729
+ if (camera._scene.mapMode2D === MapMode2D.INFINITE_SCROLL) {
2730
+ east += CesiumMath.TWO_PI;
2731
+ } else {
2732
+ rectangle = Rectangle.MAX_VALUE;
2733
+ east = rectangle.east;
2734
+ }
2735
+ }
2736
+
2737
+ let cart = viewRectangle2DCartographic;
2738
+ cart.longitude = east;
2739
+ cart.latitude = rectangle.north;
2740
+ const northEast = projection.project(cart, viewRectangle2DNorthEast);
2741
+ cart.longitude = rectangle.west;
2742
+ cart.latitude = rectangle.south;
2743
+ const southWest = projection.project(cart, viewRectangle2DSouthWest);
2744
+
2745
+ const width = Math.abs(northEast.x - southWest.x) * 0.5;
2746
+ let height = Math.abs(northEast.y - southWest.y) * 0.5;
2747
+
2748
+ let right, top;
2749
+ const ratio = camera.frustum.right / camera.frustum.top;
2750
+ const heightRatio = height * ratio;
2751
+ if (width > heightRatio) {
2752
+ right = width;
2753
+ top = right / ratio;
2754
+ } else {
2755
+ top = height;
2756
+ right = heightRatio;
2757
+ }
2758
+
2759
+ height = Math.max(2.0 * right, 2.0 * top);
2760
+
2761
+ result.x = (northEast.x - southWest.x) * 0.5 + southWest.x;
2762
+ result.y = (northEast.y - southWest.y) * 0.5 + southWest.y;
2763
+
2764
+ cart = projection.unproject(result, cart);
2765
+ cart.height = height;
2766
+ result = projection.project(cart, result);
2767
+
2768
+ return result;
2769
+ }
2770
+
2771
+ /**
2772
+ * Get the camera position needed to view a rectangle on an ellipsoid or map
2773
+ *
2774
+ * @param {Rectangle} rectangle The rectangle to view.
2775
+ * @param {Cartesian3} [result] The camera position needed to view the rectangle
2776
+ * @returns {Cartesian3} The camera position needed to view the rectangle
2777
+ */
2778
+ Camera.prototype.getRectangleCameraCoordinates = function (rectangle, result) {
2779
+ //>>includeStart('debug', pragmas.debug);
2780
+ if (!defined(rectangle)) {
2781
+ throw new DeveloperError("rectangle is required");
2782
+ }
2783
+ //>>includeEnd('debug');
2784
+ const mode = this._mode;
2785
+
2786
+ if (!defined(result)) {
2787
+ result = new Cartesian3();
2788
+ }
2789
+
2790
+ if (mode === SceneMode.SCENE3D) {
2791
+ return rectangleCameraPosition3D(this, rectangle, result);
2792
+ } else if (mode === SceneMode.COLUMBUS_VIEW) {
2793
+ return rectangleCameraPositionColumbusView(this, rectangle, result);
2794
+ } else if (mode === SceneMode.SCENE2D) {
2795
+ return rectangleCameraPosition2D(this, rectangle, result);
2796
+ }
2797
+
2798
+ return undefined;
2799
+ };
2800
+
2801
+ const pickEllipsoid3DRay = new Ray();
2802
+ function pickEllipsoid3D(camera, windowPosition, ellipsoid, result) {
2803
+ ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);
2804
+ const ray = camera.getPickRay(windowPosition, pickEllipsoid3DRay);
2805
+ const intersection = IntersectionTests.rayEllipsoid(ray, ellipsoid);
2806
+ if (!intersection) {
2807
+ return undefined;
2808
+ }
2809
+
2810
+ const t = intersection.start > 0.0 ? intersection.start : intersection.stop;
2811
+ return Ray.getPoint(ray, t, result);
2812
+ }
2813
+
2814
+ const pickEllipsoid2DRay = new Ray();
2815
+ function pickMap2D(camera, windowPosition, projection, result) {
2816
+ const ray = camera.getPickRay(windowPosition, pickEllipsoid2DRay);
2817
+ let position = ray.origin;
2818
+ position = Cartesian3.fromElements(position.y, position.z, 0.0, position);
2819
+ const cart = projection.unproject(position);
2820
+
2821
+ if (
2822
+ cart.latitude < -CesiumMath.PI_OVER_TWO ||
2823
+ cart.latitude > CesiumMath.PI_OVER_TWO
2824
+ ) {
2825
+ return undefined;
2826
+ }
2827
+
2828
+ return projection.ellipsoid.cartographicToCartesian(cart, result);
2829
+ }
2830
+
2831
+ const pickEllipsoidCVRay = new Ray();
2832
+ function pickMapColumbusView(camera, windowPosition, projection, result) {
2833
+ const ray = camera.getPickRay(windowPosition, pickEllipsoidCVRay);
2834
+ const scalar = -ray.origin.x / ray.direction.x;
2835
+ Ray.getPoint(ray, scalar, result);
2836
+
2837
+ const cart = projection.unproject(new Cartesian3(result.y, result.z, 0.0));
2838
+
2839
+ if (
2840
+ cart.latitude < -CesiumMath.PI_OVER_TWO ||
2841
+ cart.latitude > CesiumMath.PI_OVER_TWO ||
2842
+ cart.longitude < -Math.PI ||
2843
+ cart.longitude > Math.PI
2844
+ ) {
2845
+ return undefined;
2846
+ }
2847
+
2848
+ return projection.ellipsoid.cartographicToCartesian(cart, result);
2849
+ }
2850
+
2851
+ /**
2852
+ * Pick an ellipsoid or map.
2853
+ *
2854
+ * @param {Cartesian2} windowPosition The x and y coordinates of a pixel.
2855
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid to pick.
2856
+ * @param {Cartesian3} [result] The object onto which to store the result.
2857
+ * @returns {Cartesian3 | undefined} If the ellipsoid or map was picked,
2858
+ * returns the point on the surface of the ellipsoid or map in world
2859
+ * coordinates. If the ellipsoid or map was not picked, returns undefined.
2860
+ *
2861
+ * @example
2862
+ * const canvas = viewer.scene.canvas;
2863
+ * const center = new Cesium.Cartesian2(canvas.clientWidth / 2.0, canvas.clientHeight / 2.0);
2864
+ * const ellipsoid = viewer.scene.globe.ellipsoid;
2865
+ * const result = viewer.camera.pickEllipsoid(center, ellipsoid);
2866
+ */
2867
+ Camera.prototype.pickEllipsoid = function (windowPosition, ellipsoid, result) {
2868
+ //>>includeStart('debug', pragmas.debug);
2869
+ if (!defined(windowPosition)) {
2870
+ throw new DeveloperError("windowPosition is required.");
2871
+ }
2872
+ //>>includeEnd('debug');
2873
+
2874
+ const canvas = this._scene.canvas;
2875
+ if (canvas.clientWidth === 0 || canvas.clientHeight === 0) {
2876
+ return undefined;
2877
+ }
2878
+
2879
+ if (!defined(result)) {
2880
+ result = new Cartesian3();
2881
+ }
2882
+
2883
+ ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);
2884
+
2885
+ if (this._mode === SceneMode.SCENE3D) {
2886
+ result = pickEllipsoid3D(this, windowPosition, ellipsoid, result);
2887
+ } else if (this._mode === SceneMode.SCENE2D) {
2888
+ result = pickMap2D(this, windowPosition, this._projection, result);
2889
+ } else if (this._mode === SceneMode.COLUMBUS_VIEW) {
2890
+ result = pickMapColumbusView(
2891
+ this,
2892
+ windowPosition,
2893
+ this._projection,
2894
+ result
2895
+ );
2896
+ } else {
2897
+ return undefined;
2898
+ }
2899
+
2900
+ return result;
2901
+ };
2902
+
2903
+ const pickPerspCenter = new Cartesian3();
2904
+ const pickPerspXDir = new Cartesian3();
2905
+ const pickPerspYDir = new Cartesian3();
2906
+ function getPickRayPerspective(camera, windowPosition, result) {
2907
+ const canvas = camera._scene.canvas;
2908
+ const width = canvas.clientWidth;
2909
+ const height = canvas.clientHeight;
2910
+
2911
+ const tanPhi = Math.tan(camera.frustum.fovy * 0.5);
2912
+ const tanTheta = camera.frustum.aspectRatio * tanPhi;
2913
+ const near = camera.frustum.near;
2914
+
2915
+ const x = (2.0 / width) * windowPosition.x - 1.0;
2916
+ const y = (2.0 / height) * (height - windowPosition.y) - 1.0;
2917
+
2918
+ const position = camera.positionWC;
2919
+ Cartesian3.clone(position, result.origin);
2920
+
2921
+ const nearCenter = Cartesian3.multiplyByScalar(
2922
+ camera.directionWC,
2923
+ near,
2924
+ pickPerspCenter
2925
+ );
2926
+ Cartesian3.add(position, nearCenter, nearCenter);
2927
+ const xDir = Cartesian3.multiplyByScalar(
2928
+ camera.rightWC,
2929
+ x * near * tanTheta,
2930
+ pickPerspXDir
2931
+ );
2932
+ const yDir = Cartesian3.multiplyByScalar(
2933
+ camera.upWC,
2934
+ y * near * tanPhi,
2935
+ pickPerspYDir
2936
+ );
2937
+ const direction = Cartesian3.add(nearCenter, xDir, result.direction);
2938
+ Cartesian3.add(direction, yDir, direction);
2939
+ Cartesian3.subtract(direction, position, direction);
2940
+ Cartesian3.normalize(direction, direction);
2941
+
2942
+ return result;
2943
+ }
2944
+
2945
+ const scratchDirection = new Cartesian3();
2946
+
2947
+ function getPickRayOrthographic(camera, windowPosition, result) {
2948
+ const canvas = camera._scene.canvas;
2949
+ const width = canvas.clientWidth;
2950
+ const height = canvas.clientHeight;
2951
+
2952
+ let frustum = camera.frustum;
2953
+ if (defined(frustum._offCenterFrustum)) {
2954
+ frustum = frustum._offCenterFrustum;
2955
+ }
2956
+ let x = (2.0 / width) * windowPosition.x - 1.0;
2957
+ x *= (frustum.right - frustum.left) * 0.5;
2958
+ let y = (2.0 / height) * (height - windowPosition.y) - 1.0;
2959
+ y *= (frustum.top - frustum.bottom) * 0.5;
2960
+
2961
+ const origin = result.origin;
2962
+ Cartesian3.clone(camera.position, origin);
2963
+
2964
+ Cartesian3.multiplyByScalar(camera.right, x, scratchDirection);
2965
+ Cartesian3.add(scratchDirection, origin, origin);
2966
+ Cartesian3.multiplyByScalar(camera.up, y, scratchDirection);
2967
+ Cartesian3.add(scratchDirection, origin, origin);
2968
+
2969
+ Cartesian3.clone(camera.directionWC, result.direction);
2970
+
2971
+ if (
2972
+ camera._mode === SceneMode.COLUMBUS_VIEW ||
2973
+ camera._mode === SceneMode.SCENE2D
2974
+ ) {
2975
+ Cartesian3.fromElements(
2976
+ result.origin.z,
2977
+ result.origin.x,
2978
+ result.origin.y,
2979
+ result.origin
2980
+ );
2981
+ }
2982
+
2983
+ return result;
2984
+ }
2985
+
2986
+ /**
2987
+ * Create a ray from the camera position through the pixel at <code>windowPosition</code>
2988
+ * in world coordinates.
2989
+ *
2990
+ * @param {Cartesian2} windowPosition The x and y coordinates of a pixel.
2991
+ * @param {Ray} [result] The object onto which to store the result.
2992
+ * @returns {Ray|undefined} Returns the {@link Cartesian3} position and direction of the ray, or undefined if the pick ray cannot be determined.
2993
+ */
2994
+ Camera.prototype.getPickRay = function (windowPosition, result) {
2995
+ //>>includeStart('debug', pragmas.debug);
2996
+ if (!defined(windowPosition)) {
2997
+ throw new DeveloperError("windowPosition is required.");
2998
+ }
2999
+ //>>includeEnd('debug');
3000
+
3001
+ if (!defined(result)) {
3002
+ result = new Ray();
3003
+ }
3004
+
3005
+ const canvas = this._scene.canvas;
3006
+ if (canvas.clientWidth <= 0 || canvas.clientHeight <= 0) {
3007
+ return undefined;
3008
+ }
3009
+
3010
+ const frustum = this.frustum;
3011
+ if (
3012
+ defined(frustum.aspectRatio) &&
3013
+ defined(frustum.fov) &&
3014
+ defined(frustum.near)
3015
+ ) {
3016
+ return getPickRayPerspective(this, windowPosition, result);
3017
+ }
3018
+
3019
+ return getPickRayOrthographic(this, windowPosition, result);
3020
+ };
3021
+
3022
+ const scratchToCenter = new Cartesian3();
3023
+ const scratchProj = new Cartesian3();
3024
+
3025
+ /**
3026
+ * Return the distance from the camera to the front of the bounding sphere.
3027
+ *
3028
+ * @param {BoundingSphere} boundingSphere The bounding sphere in world coordinates.
3029
+ * @returns {Number} The distance to the bounding sphere.
3030
+ */
3031
+ Camera.prototype.distanceToBoundingSphere = function (boundingSphere) {
3032
+ //>>includeStart('debug', pragmas.debug);
3033
+ if (!defined(boundingSphere)) {
3034
+ throw new DeveloperError("boundingSphere is required.");
3035
+ }
3036
+ //>>includeEnd('debug');
3037
+
3038
+ const toCenter = Cartesian3.subtract(
3039
+ this.positionWC,
3040
+ boundingSphere.center,
3041
+ scratchToCenter
3042
+ );
3043
+ const proj = Cartesian3.multiplyByScalar(
3044
+ this.directionWC,
3045
+ Cartesian3.dot(toCenter, this.directionWC),
3046
+ scratchProj
3047
+ );
3048
+ return Math.max(0.0, Cartesian3.magnitude(proj) - boundingSphere.radius);
3049
+ };
3050
+
3051
+ const scratchPixelSize = new Cartesian2();
3052
+
3053
+ /**
3054
+ * Return the pixel size in meters.
3055
+ *
3056
+ * @param {BoundingSphere} boundingSphere The bounding sphere in world coordinates.
3057
+ * @param {Number} drawingBufferWidth The drawing buffer width.
3058
+ * @param {Number} drawingBufferHeight The drawing buffer height.
3059
+ * @returns {Number} The pixel size in meters.
3060
+ */
3061
+ Camera.prototype.getPixelSize = function (
3062
+ boundingSphere,
3063
+ drawingBufferWidth,
3064
+ drawingBufferHeight
3065
+ ) {
3066
+ //>>includeStart('debug', pragmas.debug);
3067
+ if (!defined(boundingSphere)) {
3068
+ throw new DeveloperError("boundingSphere is required.");
3069
+ }
3070
+ if (!defined(drawingBufferWidth)) {
3071
+ throw new DeveloperError("drawingBufferWidth is required.");
3072
+ }
3073
+ if (!defined(drawingBufferHeight)) {
3074
+ throw new DeveloperError("drawingBufferHeight is required.");
3075
+ }
3076
+ //>>includeEnd('debug');
3077
+
3078
+ const distance = this.distanceToBoundingSphere(boundingSphere);
3079
+ const pixelSize = this.frustum.getPixelDimensions(
3080
+ drawingBufferWidth,
3081
+ drawingBufferHeight,
3082
+ distance,
3083
+ this._scene.pixelRatio,
3084
+ scratchPixelSize
3085
+ );
3086
+ return Math.max(pixelSize.x, pixelSize.y);
3087
+ };
3088
+
3089
+ function createAnimationTemplateCV(
3090
+ camera,
3091
+ position,
3092
+ center,
3093
+ maxX,
3094
+ maxY,
3095
+ duration
3096
+ ) {
3097
+ const newPosition = Cartesian3.clone(position);
3098
+
3099
+ if (center.y > maxX) {
3100
+ newPosition.y -= center.y - maxX;
3101
+ } else if (center.y < -maxX) {
3102
+ newPosition.y += -maxX - center.y;
3103
+ }
3104
+
3105
+ if (center.z > maxY) {
3106
+ newPosition.z -= center.z - maxY;
3107
+ } else if (center.z < -maxY) {
3108
+ newPosition.z += -maxY - center.z;
3109
+ }
3110
+
3111
+ function updateCV(value) {
3112
+ const interp = Cartesian3.lerp(
3113
+ position,
3114
+ newPosition,
3115
+ value.time,
3116
+ new Cartesian3()
3117
+ );
3118
+ camera.worldToCameraCoordinatesPoint(interp, camera.position);
3119
+ }
3120
+ return {
3121
+ easingFunction: EasingFunction.EXPONENTIAL_OUT,
3122
+ startObject: {
3123
+ time: 0.0,
3124
+ },
3125
+ stopObject: {
3126
+ time: 1.0,
3127
+ },
3128
+ duration: duration,
3129
+ update: updateCV,
3130
+ };
3131
+ }
3132
+
3133
+ const normalScratch = new Cartesian3();
3134
+ const centerScratch = new Cartesian3();
3135
+ const posScratch = new Cartesian3();
3136
+ const scratchCartesian3Subtract = new Cartesian3();
3137
+
3138
+ function createAnimationCV(camera, duration) {
3139
+ let position = camera.position;
3140
+ const direction = camera.direction;
3141
+
3142
+ const normal = camera.worldToCameraCoordinatesVector(
3143
+ Cartesian3.UNIT_X,
3144
+ normalScratch
3145
+ );
3146
+ const scalar =
3147
+ -Cartesian3.dot(normal, position) / Cartesian3.dot(normal, direction);
3148
+ const center = Cartesian3.add(
3149
+ position,
3150
+ Cartesian3.multiplyByScalar(direction, scalar, centerScratch),
3151
+ centerScratch
3152
+ );
3153
+ camera.cameraToWorldCoordinatesPoint(center, center);
3154
+
3155
+ position = camera.cameraToWorldCoordinatesPoint(camera.position, posScratch);
3156
+
3157
+ const tanPhi = Math.tan(camera.frustum.fovy * 0.5);
3158
+ const tanTheta = camera.frustum.aspectRatio * tanPhi;
3159
+ const distToC = Cartesian3.magnitude(
3160
+ Cartesian3.subtract(position, center, scratchCartesian3Subtract)
3161
+ );
3162
+ const dWidth = tanTheta * distToC;
3163
+ const dHeight = tanPhi * distToC;
3164
+
3165
+ const mapWidth = camera._maxCoord.x;
3166
+ const mapHeight = camera._maxCoord.y;
3167
+
3168
+ const maxX = Math.max(dWidth - mapWidth, mapWidth);
3169
+ const maxY = Math.max(dHeight - mapHeight, mapHeight);
3170
+
3171
+ if (
3172
+ position.z < -maxX ||
3173
+ position.z > maxX ||
3174
+ position.y < -maxY ||
3175
+ position.y > maxY
3176
+ ) {
3177
+ const translateX = center.y < -maxX || center.y > maxX;
3178
+ const translateY = center.z < -maxY || center.z > maxY;
3179
+ if (translateX || translateY) {
3180
+ return createAnimationTemplateCV(
3181
+ camera,
3182
+ position,
3183
+ center,
3184
+ maxX,
3185
+ maxY,
3186
+ duration
3187
+ );
3188
+ }
3189
+ }
3190
+
3191
+ return undefined;
3192
+ }
3193
+
3194
+ /**
3195
+ * Create an animation to move the map into view. This method is only valid for 2D and Columbus modes.
3196
+ *
3197
+ * @param {Number} duration The duration, in seconds, of the animation.
3198
+ * @returns {Object} The animation or undefined if the scene mode is 3D or the map is already ion view.
3199
+ *
3200
+ * @private
3201
+ */
3202
+ Camera.prototype.createCorrectPositionTween = function (duration) {
3203
+ //>>includeStart('debug', pragmas.debug);
3204
+ if (!defined(duration)) {
3205
+ throw new DeveloperError("duration is required.");
3206
+ }
3207
+ //>>includeEnd('debug');
3208
+
3209
+ if (this._mode === SceneMode.COLUMBUS_VIEW) {
3210
+ return createAnimationCV(this, duration);
3211
+ }
3212
+
3213
+ return undefined;
3214
+ };
3215
+
3216
+ const scratchFlyToDestination = new Cartesian3();
3217
+ const newOptions = {
3218
+ destination: undefined,
3219
+ heading: undefined,
3220
+ pitch: undefined,
3221
+ roll: undefined,
3222
+ duration: undefined,
3223
+ complete: undefined,
3224
+ cancel: undefined,
3225
+ endTransform: undefined,
3226
+ maximumHeight: undefined,
3227
+ easingFunction: undefined,
3228
+ };
3229
+
3230
+ /**
3231
+ * Cancels the current camera flight and leaves the camera at its current location.
3232
+ * If no flight is in progress, this this function does nothing.
3233
+ */
3234
+ Camera.prototype.cancelFlight = function () {
3235
+ if (defined(this._currentFlight)) {
3236
+ this._currentFlight.cancelTween();
3237
+ this._currentFlight = undefined;
3238
+ }
3239
+ };
3240
+
3241
+ /**
3242
+ * Completes the current camera flight and moves the camera immediately to its final destination.
3243
+ * If no flight is in progress, this this function does nothing.
3244
+ */
3245
+ Camera.prototype.completeFlight = function () {
3246
+ if (defined(this._currentFlight)) {
3247
+ this._currentFlight.cancelTween();
3248
+
3249
+ const options = {
3250
+ destination: undefined,
3251
+ orientation: {
3252
+ heading: undefined,
3253
+ pitch: undefined,
3254
+ roll: undefined,
3255
+ },
3256
+ };
3257
+
3258
+ options.destination = newOptions.destination;
3259
+ options.orientation.heading = newOptions.heading;
3260
+ options.orientation.pitch = newOptions.pitch;
3261
+ options.orientation.roll = newOptions.roll;
3262
+
3263
+ this.setView(options);
3264
+
3265
+ if (defined(this._currentFlight.complete)) {
3266
+ this._currentFlight.complete();
3267
+ }
3268
+
3269
+ this._currentFlight = undefined;
3270
+ }
3271
+ };
3272
+
3273
+ /**
3274
+ * Flies the camera from its current position to a new position.
3275
+ *
3276
+ * @param {Object} options Object with the following properties:
3277
+ * @param {Cartesian3|Rectangle} options.destination The final position of the camera in WGS84 (world) coordinates or a rectangle that would be visible from a top-down view.
3278
+ * @param {Object} [options.orientation] An object that contains either direction and up properties or heading, pitch and roll properties. By default, the direction will point
3279
+ * towards the center of the frame in 3D and in the negative z direction in Columbus view. The up direction will point towards local north in 3D and in the positive
3280
+ * y direction in Columbus view. Orientation is not used in 2D when in infinite scrolling mode.
3281
+ * @param {Number} [options.duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight.
3282
+ * @param {Camera.FlightCompleteCallback} [options.complete] The function to execute when the flight is complete.
3283
+ * @param {Camera.FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled.
3284
+ * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame the camera will be in when the flight is completed.
3285
+ * @param {Number} [options.maximumHeight] The maximum height at the peak of the flight.
3286
+ * @param {Number} [options.pitchAdjustHeight] If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
3287
+ * @param {Number} [options.flyOverLongitude] There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude.
3288
+ * @param {Number} [options.flyOverLongitudeWeight] Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
3289
+ * @param {Boolean} [options.convert] Whether to convert the destination from world coordinates to scene coordinates (only relevant when not using 3D). Defaults to <code>true</code>.
3290
+ * @param {EasingFunction.Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight.
3291
+ *
3292
+ * @exception {DeveloperError} If either direction or up is given, then both are required.
3293
+ *
3294
+ * @example
3295
+ * // 1. Fly to a position with a top-down view
3296
+ * viewer.camera.flyTo({
3297
+ * destination : Cesium.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
3298
+ * });
3299
+ *
3300
+ * // 2. Fly to a Rectangle with a top-down view
3301
+ * viewer.camera.flyTo({
3302
+ * destination : Cesium.Rectangle.fromDegrees(west, south, east, north)
3303
+ * });
3304
+ *
3305
+ * // 3. Fly to a position with an orientation using unit vectors.
3306
+ * viewer.camera.flyTo({
3307
+ * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
3308
+ * orientation : {
3309
+ * direction : new Cesium.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
3310
+ * up : new Cesium.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
3311
+ * }
3312
+ * });
3313
+ *
3314
+ * // 4. Fly to a position with an orientation using heading, pitch and roll.
3315
+ * viewer.camera.flyTo({
3316
+ * destination : Cesium.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
3317
+ * orientation : {
3318
+ * heading : Cesium.Math.toRadians(175.0),
3319
+ * pitch : Cesium.Math.toRadians(-35.0),
3320
+ * roll : 0.0
3321
+ * }
3322
+ * });
3323
+ */
3324
+ Camera.prototype.flyTo = function (options) {
3325
+ options = defaultValue(options, defaultValue.EMPTY_OBJECT);
3326
+ let destination = options.destination;
3327
+ //>>includeStart('debug', pragmas.debug);
3328
+ if (!defined(destination)) {
3329
+ throw new DeveloperError("destination is required.");
3330
+ }
3331
+ //>>includeEnd('debug');
3332
+
3333
+ const mode = this._mode;
3334
+ if (mode === SceneMode.MORPHING) {
3335
+ return;
3336
+ }
3337
+
3338
+ this.cancelFlight();
3339
+
3340
+ const isRectangle = destination instanceof Rectangle;
3341
+ if (isRectangle) {
3342
+ destination = this.getRectangleCameraCoordinates(
3343
+ destination,
3344
+ scratchFlyToDestination
3345
+ );
3346
+ }
3347
+
3348
+ let orientation = defaultValue(
3349
+ options.orientation,
3350
+ defaultValue.EMPTY_OBJECT
3351
+ );
3352
+ if (defined(orientation.direction)) {
3353
+ orientation = directionUpToHeadingPitchRoll(
3354
+ this,
3355
+ destination,
3356
+ orientation,
3357
+ scratchSetViewOptions.orientation
3358
+ );
3359
+ }
3360
+
3361
+ if (defined(options.duration) && options.duration <= 0.0) {
3362
+ const setViewOptions = scratchSetViewOptions;
3363
+ setViewOptions.destination = options.destination;
3364
+ setViewOptions.orientation.heading = orientation.heading;
3365
+ setViewOptions.orientation.pitch = orientation.pitch;
3366
+ setViewOptions.orientation.roll = orientation.roll;
3367
+ setViewOptions.convert = options.convert;
3368
+ setViewOptions.endTransform = options.endTransform;
3369
+ this.setView(setViewOptions);
3370
+ if (typeof options.complete === "function") {
3371
+ options.complete();
3372
+ }
3373
+ return;
3374
+ }
3375
+
3376
+ const that = this;
3377
+ /* eslint-disable-next-line prefer-const */
3378
+ let flightTween;
3379
+
3380
+ newOptions.destination = destination;
3381
+ newOptions.heading = orientation.heading;
3382
+ newOptions.pitch = orientation.pitch;
3383
+ newOptions.roll = orientation.roll;
3384
+ newOptions.duration = options.duration;
3385
+ newOptions.complete = function () {
3386
+ if (flightTween === that._currentFlight) {
3387
+ that._currentFlight = undefined;
3388
+ }
3389
+ if (defined(options.complete)) {
3390
+ options.complete();
3391
+ }
3392
+ };
3393
+ newOptions.cancel = options.cancel;
3394
+ newOptions.endTransform = options.endTransform;
3395
+ newOptions.convert = isRectangle ? false : options.convert;
3396
+ newOptions.maximumHeight = options.maximumHeight;
3397
+ newOptions.pitchAdjustHeight = options.pitchAdjustHeight;
3398
+ newOptions.flyOverLongitude = options.flyOverLongitude;
3399
+ newOptions.flyOverLongitudeWeight = options.flyOverLongitudeWeight;
3400
+ newOptions.easingFunction = options.easingFunction;
3401
+
3402
+ const scene = this._scene;
3403
+ const tweenOptions = CameraFlightPath.createTween(scene, newOptions);
3404
+ // If the camera doesn't actually need to go anywhere, duration
3405
+ // will be 0 and we can just complete the current flight.
3406
+ if (tweenOptions.duration === 0) {
3407
+ if (typeof tweenOptions.complete === "function") {
3408
+ tweenOptions.complete();
3409
+ }
3410
+ return;
3411
+ }
3412
+ flightTween = scene.tweens.add(tweenOptions);
3413
+ this._currentFlight = flightTween;
3414
+
3415
+ // Save the final destination view information for the PRELOAD_FLIGHT pass.
3416
+ let preloadFlightCamera = this._scene.preloadFlightCamera;
3417
+ if (this._mode !== SceneMode.SCENE2D) {
3418
+ if (!defined(preloadFlightCamera)) {
3419
+ preloadFlightCamera = Camera.clone(this);
3420
+ }
3421
+ preloadFlightCamera.setView({
3422
+ destination: destination,
3423
+ orientation: orientation,
3424
+ });
3425
+
3426
+ this._scene.preloadFlightCullingVolume = preloadFlightCamera.frustum.computeCullingVolume(
3427
+ preloadFlightCamera.positionWC,
3428
+ preloadFlightCamera.directionWC,
3429
+ preloadFlightCamera.upWC
3430
+ );
3431
+ }
3432
+ };
3433
+
3434
+ function distanceToBoundingSphere3D(camera, radius) {
3435
+ const frustum = camera.frustum;
3436
+ const tanPhi = Math.tan(frustum.fovy * 0.5);
3437
+ const tanTheta = frustum.aspectRatio * tanPhi;
3438
+ return Math.max(radius / tanTheta, radius / tanPhi);
3439
+ }
3440
+
3441
+ function distanceToBoundingSphere2D(camera, radius) {
3442
+ let frustum = camera.frustum;
3443
+ if (defined(frustum._offCenterFrustum)) {
3444
+ frustum = frustum._offCenterFrustum;
3445
+ }
3446
+
3447
+ let right, top;
3448
+ const ratio = frustum.right / frustum.top;
3449
+ const heightRatio = radius * ratio;
3450
+ if (radius > heightRatio) {
3451
+ right = radius;
3452
+ top = right / ratio;
3453
+ } else {
3454
+ top = radius;
3455
+ right = heightRatio;
3456
+ }
3457
+
3458
+ return Math.max(right, top) * 1.5;
3459
+ }
3460
+
3461
+ const MINIMUM_ZOOM = 100.0;
3462
+
3463
+ function adjustBoundingSphereOffset(camera, boundingSphere, offset) {
3464
+ offset = HeadingPitchRange.clone(
3465
+ defined(offset) ? offset : Camera.DEFAULT_OFFSET
3466
+ );
3467
+
3468
+ const minimumZoom =
3469
+ camera._scene.screenSpaceCameraController.minimumZoomDistance;
3470
+ const maximumZoom =
3471
+ camera._scene.screenSpaceCameraController.maximumZoomDistance;
3472
+ const range = offset.range;
3473
+ if (!defined(range) || range === 0.0) {
3474
+ const radius = boundingSphere.radius;
3475
+ if (radius === 0.0) {
3476
+ offset.range = MINIMUM_ZOOM;
3477
+ } else if (
3478
+ camera.frustum instanceof OrthographicFrustum ||
3479
+ camera._mode === SceneMode.SCENE2D
3480
+ ) {
3481
+ offset.range = distanceToBoundingSphere2D(camera, radius);
3482
+ } else {
3483
+ offset.range = distanceToBoundingSphere3D(camera, radius);
3484
+ }
3485
+ offset.range = CesiumMath.clamp(offset.range, minimumZoom, maximumZoom);
3486
+ }
3487
+
3488
+ return offset;
3489
+ }
3490
+
3491
+ /**
3492
+ * Sets the camera so that the current view contains the provided bounding sphere.
3493
+ *
3494
+ * <p>The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
3495
+ * The heading and the pitch angles are defined in the local east-north-up reference frame.
3496
+ * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
3497
+ * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
3498
+ * zero, a range will be computed such that the whole bounding sphere is visible.</p>
3499
+ *
3500
+ * <p>In 2D, there must be a top down view. The camera will be placed above the target looking down. The height above the
3501
+ * target will be the range. The heading will be determined from the offset. If the heading cannot be
3502
+ * determined from the offset, the heading will be north.</p>
3503
+ *
3504
+ * @param {BoundingSphere} boundingSphere The bounding sphere to view, in world coordinates.
3505
+ * @param {HeadingPitchRange} [offset] The offset from the target in the local east-north-up reference frame centered at the target.
3506
+ *
3507
+ * @exception {DeveloperError} viewBoundingSphere is not supported while morphing.
3508
+ */
3509
+ Camera.prototype.viewBoundingSphere = function (boundingSphere, offset) {
3510
+ //>>includeStart('debug', pragmas.debug);
3511
+ if (!defined(boundingSphere)) {
3512
+ throw new DeveloperError("boundingSphere is required.");
3513
+ }
3514
+
3515
+ if (this._mode === SceneMode.MORPHING) {
3516
+ throw new DeveloperError(
3517
+ "viewBoundingSphere is not supported while morphing."
3518
+ );
3519
+ }
3520
+ //>>includeEnd('debug');
3521
+
3522
+ offset = adjustBoundingSphereOffset(this, boundingSphere, offset);
3523
+ this.lookAt(boundingSphere.center, offset);
3524
+ };
3525
+
3526
+ const scratchflyToBoundingSphereTransform = new Matrix4();
3527
+ const scratchflyToBoundingSphereDestination = new Cartesian3();
3528
+ const scratchflyToBoundingSphereDirection = new Cartesian3();
3529
+ const scratchflyToBoundingSphereUp = new Cartesian3();
3530
+ const scratchflyToBoundingSphereRight = new Cartesian3();
3531
+ const scratchFlyToBoundingSphereCart4 = new Cartesian4();
3532
+ const scratchFlyToBoundingSphereQuaternion = new Quaternion();
3533
+ const scratchFlyToBoundingSphereMatrix3 = new Matrix3();
3534
+
3535
+ /**
3536
+ * Flies the camera to a location where the current view contains the provided bounding sphere.
3537
+ *
3538
+ * <p> The offset is heading/pitch/range in the local east-north-up reference frame centered at the center of the bounding sphere.
3539
+ * The heading and the pitch angles are defined in the local east-north-up reference frame.
3540
+ * The heading is the angle from y axis and increasing towards the x axis. Pitch is the rotation from the xy-plane. Positive pitch
3541
+ * angles are below the plane. Negative pitch angles are above the plane. The range is the distance from the center. If the range is
3542
+ * zero, a range will be computed such that the whole bounding sphere is visible.</p>
3543
+ *
3544
+ * <p>In 2D and Columbus View, there must be a top down view. The camera will be placed above the target looking down. The height above the
3545
+ * target will be the range. The heading will be aligned to local north.</p>
3546
+ *
3547
+ * @param {BoundingSphere} boundingSphere The bounding sphere to view, in world coordinates.
3548
+ * @param {Object} [options] Object with the following properties:
3549
+ * @param {Number} [options.duration] The duration of the flight in seconds. If omitted, Cesium attempts to calculate an ideal duration based on the distance to be traveled by the flight.
3550
+ * @param {HeadingPitchRange} [options.offset] The offset from the target in the local east-north-up reference frame centered at the target.
3551
+ * @param {Camera.FlightCompleteCallback} [options.complete] The function to execute when the flight is complete.
3552
+ * @param {Camera.FlightCancelledCallback} [options.cancel] The function to execute if the flight is cancelled.
3553
+ * @param {Matrix4} [options.endTransform] Transform matrix representing the reference frame the camera will be in when the flight is completed.
3554
+ * @param {Number} [options.maximumHeight] The maximum height at the peak of the flight.
3555
+ * @param {Number} [options.pitchAdjustHeight] If camera flyes higher than that value, adjust pitch duiring the flight to look down, and keep Earth in viewport.
3556
+ * @param {Number} [options.flyOverLongitude] There are always two ways between 2 points on globe. This option force camera to choose fight direction to fly over that longitude.
3557
+ * @param {Number} [options.flyOverLongitudeWeight] Fly over the lon specifyed via flyOverLongitude only if that way is not longer than short way times flyOverLongitudeWeight.
3558
+ * @param {EasingFunction.Callback} [options.easingFunction] Controls how the time is interpolated over the duration of the flight.
3559
+ */
3560
+ Camera.prototype.flyToBoundingSphere = function (boundingSphere, options) {
3561
+ //>>includeStart('debug', pragmas.debug);
3562
+ if (!defined(boundingSphere)) {
3563
+ throw new DeveloperError("boundingSphere is required.");
3564
+ }
3565
+ //>>includeEnd('debug');
3566
+
3567
+ options = defaultValue(options, defaultValue.EMPTY_OBJECT);
3568
+ const scene2D =
3569
+ this._mode === SceneMode.SCENE2D || this._mode === SceneMode.COLUMBUS_VIEW;
3570
+ this._setTransform(Matrix4.IDENTITY);
3571
+ const offset = adjustBoundingSphereOffset(
3572
+ this,
3573
+ boundingSphere,
3574
+ options.offset
3575
+ );
3576
+
3577
+ let position;
3578
+ if (scene2D) {
3579
+ position = Cartesian3.multiplyByScalar(
3580
+ Cartesian3.UNIT_Z,
3581
+ offset.range,
3582
+ scratchflyToBoundingSphereDestination
3583
+ );
3584
+ } else {
3585
+ position = offsetFromHeadingPitchRange(
3586
+ offset.heading,
3587
+ offset.pitch,
3588
+ offset.range
3589
+ );
3590
+ }
3591
+
3592
+ const transform = Transforms.eastNorthUpToFixedFrame(
3593
+ boundingSphere.center,
3594
+ Ellipsoid.WGS84,
3595
+ scratchflyToBoundingSphereTransform
3596
+ );
3597
+ Matrix4.multiplyByPoint(transform, position, position);
3598
+
3599
+ let direction;
3600
+ let up;
3601
+
3602
+ if (!scene2D) {
3603
+ direction = Cartesian3.subtract(
3604
+ boundingSphere.center,
3605
+ position,
3606
+ scratchflyToBoundingSphereDirection
3607
+ );
3608
+ Cartesian3.normalize(direction, direction);
3609
+
3610
+ up = Matrix4.multiplyByPointAsVector(
3611
+ transform,
3612
+ Cartesian3.UNIT_Z,
3613
+ scratchflyToBoundingSphereUp
3614
+ );
3615
+ if (1.0 - Math.abs(Cartesian3.dot(direction, up)) < CesiumMath.EPSILON6) {
3616
+ const rotateQuat = Quaternion.fromAxisAngle(
3617
+ direction,
3618
+ offset.heading,
3619
+ scratchFlyToBoundingSphereQuaternion
3620
+ );
3621
+ const rotation = Matrix3.fromQuaternion(
3622
+ rotateQuat,
3623
+ scratchFlyToBoundingSphereMatrix3
3624
+ );
3625
+
3626
+ Cartesian3.fromCartesian4(
3627
+ Matrix4.getColumn(transform, 1, scratchFlyToBoundingSphereCart4),
3628
+ up
3629
+ );
3630
+ Matrix3.multiplyByVector(rotation, up, up);
3631
+ }
3632
+
3633
+ const right = Cartesian3.cross(
3634
+ direction,
3635
+ up,
3636
+ scratchflyToBoundingSphereRight
3637
+ );
3638
+ Cartesian3.cross(right, direction, up);
3639
+ Cartesian3.normalize(up, up);
3640
+ }
3641
+
3642
+ this.flyTo({
3643
+ destination: position,
3644
+ orientation: {
3645
+ direction: direction,
3646
+ up: up,
3647
+ },
3648
+ duration: options.duration,
3649
+ complete: options.complete,
3650
+ cancel: options.cancel,
3651
+ endTransform: options.endTransform,
3652
+ maximumHeight: options.maximumHeight,
3653
+ easingFunction: options.easingFunction,
3654
+ flyOverLongitude: options.flyOverLongitude,
3655
+ flyOverLongitudeWeight: options.flyOverLongitudeWeight,
3656
+ pitchAdjustHeight: options.pitchAdjustHeight,
3657
+ });
3658
+ };
3659
+
3660
+ const scratchCartesian3_1 = new Cartesian3();
3661
+ const scratchCartesian3_2 = new Cartesian3();
3662
+ const scratchCartesian3_3 = new Cartesian3();
3663
+ const scratchCartesian3_4 = new Cartesian3();
3664
+ const horizonPoints = [
3665
+ new Cartesian3(),
3666
+ new Cartesian3(),
3667
+ new Cartesian3(),
3668
+ new Cartesian3(),
3669
+ ];
3670
+
3671
+ function computeHorizonQuad(camera, ellipsoid) {
3672
+ const radii = ellipsoid.radii;
3673
+ const p = camera.positionWC;
3674
+
3675
+ // Find the corresponding position in the scaled space of the ellipsoid.
3676
+ const q = Cartesian3.multiplyComponents(
3677
+ ellipsoid.oneOverRadii,
3678
+ p,
3679
+ scratchCartesian3_1
3680
+ );
3681
+
3682
+ const qMagnitude = Cartesian3.magnitude(q);
3683
+ const qUnit = Cartesian3.normalize(q, scratchCartesian3_2);
3684
+
3685
+ // Determine the east and north directions at q.
3686
+ let eUnit;
3687
+ let nUnit;
3688
+ if (
3689
+ Cartesian3.equalsEpsilon(qUnit, Cartesian3.UNIT_Z, CesiumMath.EPSILON10)
3690
+ ) {
3691
+ eUnit = new Cartesian3(0, 1, 0);
3692
+ nUnit = new Cartesian3(0, 0, 1);
3693
+ } else {
3694
+ eUnit = Cartesian3.normalize(
3695
+ Cartesian3.cross(Cartesian3.UNIT_Z, qUnit, scratchCartesian3_3),
3696
+ scratchCartesian3_3
3697
+ );
3698
+ nUnit = Cartesian3.normalize(
3699
+ Cartesian3.cross(qUnit, eUnit, scratchCartesian3_4),
3700
+ scratchCartesian3_4
3701
+ );
3702
+ }
3703
+
3704
+ // Determine the radius of the 'limb' of the ellipsoid.
3705
+ const wMagnitude = Math.sqrt(Cartesian3.magnitudeSquared(q) - 1.0);
3706
+
3707
+ // Compute the center and offsets.
3708
+ const center = Cartesian3.multiplyByScalar(
3709
+ qUnit,
3710
+ 1.0 / qMagnitude,
3711
+ scratchCartesian3_1
3712
+ );
3713
+ const scalar = wMagnitude / qMagnitude;
3714
+ const eastOffset = Cartesian3.multiplyByScalar(
3715
+ eUnit,
3716
+ scalar,
3717
+ scratchCartesian3_2
3718
+ );
3719
+ const northOffset = Cartesian3.multiplyByScalar(
3720
+ nUnit,
3721
+ scalar,
3722
+ scratchCartesian3_3
3723
+ );
3724
+
3725
+ // A conservative measure for the longitudes would be to use the min/max longitudes of the bounding frustum.
3726
+ const upperLeft = Cartesian3.add(center, northOffset, horizonPoints[0]);
3727
+ Cartesian3.subtract(upperLeft, eastOffset, upperLeft);
3728
+ Cartesian3.multiplyComponents(radii, upperLeft, upperLeft);
3729
+
3730
+ const lowerLeft = Cartesian3.subtract(center, northOffset, horizonPoints[1]);
3731
+ Cartesian3.subtract(lowerLeft, eastOffset, lowerLeft);
3732
+ Cartesian3.multiplyComponents(radii, lowerLeft, lowerLeft);
3733
+
3734
+ const lowerRight = Cartesian3.subtract(center, northOffset, horizonPoints[2]);
3735
+ Cartesian3.add(lowerRight, eastOffset, lowerRight);
3736
+ Cartesian3.multiplyComponents(radii, lowerRight, lowerRight);
3737
+
3738
+ const upperRight = Cartesian3.add(center, northOffset, horizonPoints[3]);
3739
+ Cartesian3.add(upperRight, eastOffset, upperRight);
3740
+ Cartesian3.multiplyComponents(radii, upperRight, upperRight);
3741
+
3742
+ return horizonPoints;
3743
+ }
3744
+
3745
+ const scratchPickCartesian2 = new Cartesian2();
3746
+ const scratchRectCartesian = new Cartesian3();
3747
+ const cartoArray = [
3748
+ new Cartographic(),
3749
+ new Cartographic(),
3750
+ new Cartographic(),
3751
+ new Cartographic(),
3752
+ ];
3753
+ function addToResult(x, y, index, camera, ellipsoid, computedHorizonQuad) {
3754
+ scratchPickCartesian2.x = x;
3755
+ scratchPickCartesian2.y = y;
3756
+ const r = camera.pickEllipsoid(
3757
+ scratchPickCartesian2,
3758
+ ellipsoid,
3759
+ scratchRectCartesian
3760
+ );
3761
+ if (defined(r)) {
3762
+ cartoArray[index] = ellipsoid.cartesianToCartographic(r, cartoArray[index]);
3763
+ return 1;
3764
+ }
3765
+ cartoArray[index] = ellipsoid.cartesianToCartographic(
3766
+ computedHorizonQuad[index],
3767
+ cartoArray[index]
3768
+ );
3769
+ return 0;
3770
+ }
3771
+ /**
3772
+ * Computes the approximate visible rectangle on the ellipsoid.
3773
+ *
3774
+ * @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid that you want to know the visible region.
3775
+ * @param {Rectangle} [result] The rectangle in which to store the result
3776
+ *
3777
+ * @returns {Rectangle|undefined} The visible rectangle or undefined if the ellipsoid isn't visible at all.
3778
+ */
3779
+ Camera.prototype.computeViewRectangle = function (ellipsoid, result) {
3780
+ ellipsoid = defaultValue(ellipsoid, Ellipsoid.WGS84);
3781
+ const cullingVolume = this.frustum.computeCullingVolume(
3782
+ this.positionWC,
3783
+ this.directionWC,
3784
+ this.upWC
3785
+ );
3786
+ const boundingSphere = new BoundingSphere(
3787
+ Cartesian3.ZERO,
3788
+ ellipsoid.maximumRadius
3789
+ );
3790
+ const visibility = cullingVolume.computeVisibility(boundingSphere);
3791
+ if (visibility === Intersect.OUTSIDE) {
3792
+ return undefined;
3793
+ }
3794
+
3795
+ const canvas = this._scene.canvas;
3796
+ const width = canvas.clientWidth;
3797
+ const height = canvas.clientHeight;
3798
+
3799
+ let successfulPickCount = 0;
3800
+
3801
+ const computedHorizonQuad = computeHorizonQuad(this, ellipsoid);
3802
+
3803
+ successfulPickCount += addToResult(
3804
+ 0,
3805
+ 0,
3806
+ 0,
3807
+ this,
3808
+ ellipsoid,
3809
+ computedHorizonQuad
3810
+ );
3811
+ successfulPickCount += addToResult(
3812
+ 0,
3813
+ height,
3814
+ 1,
3815
+ this,
3816
+ ellipsoid,
3817
+ computedHorizonQuad
3818
+ );
3819
+ successfulPickCount += addToResult(
3820
+ width,
3821
+ height,
3822
+ 2,
3823
+ this,
3824
+ ellipsoid,
3825
+ computedHorizonQuad
3826
+ );
3827
+ successfulPickCount += addToResult(
3828
+ width,
3829
+ 0,
3830
+ 3,
3831
+ this,
3832
+ ellipsoid,
3833
+ computedHorizonQuad
3834
+ );
3835
+
3836
+ if (successfulPickCount < 2) {
3837
+ // If we have space non-globe in 3 or 4 corners then return the whole globe
3838
+ return Rectangle.MAX_VALUE;
3839
+ }
3840
+
3841
+ result = Rectangle.fromCartographicArray(cartoArray, result);
3842
+
3843
+ // Detect if we go over the poles
3844
+ let distance = 0;
3845
+ let lastLon = cartoArray[3].longitude;
3846
+ for (let i = 0; i < 4; ++i) {
3847
+ const lon = cartoArray[i].longitude;
3848
+ const diff = Math.abs(lon - lastLon);
3849
+ if (diff > CesiumMath.PI) {
3850
+ // Crossed the dateline
3851
+ distance += CesiumMath.TWO_PI - diff;
3852
+ } else {
3853
+ distance += diff;
3854
+ }
3855
+
3856
+ lastLon = lon;
3857
+ }
3858
+
3859
+ // We are over one of the poles so adjust the rectangle accordingly
3860
+ if (
3861
+ CesiumMath.equalsEpsilon(
3862
+ Math.abs(distance),
3863
+ CesiumMath.TWO_PI,
3864
+ CesiumMath.EPSILON9
3865
+ )
3866
+ ) {
3867
+ result.west = -CesiumMath.PI;
3868
+ result.east = CesiumMath.PI;
3869
+ if (cartoArray[0].latitude >= 0.0) {
3870
+ result.north = CesiumMath.PI_OVER_TWO;
3871
+ } else {
3872
+ result.south = -CesiumMath.PI_OVER_TWO;
3873
+ }
3874
+ }
3875
+
3876
+ return result;
3877
+ };
3878
+
3879
+ /**
3880
+ * Switches the frustum/projection to perspective.
3881
+ *
3882
+ * This function is a no-op in 2D which must always be orthographic.
3883
+ */
3884
+ Camera.prototype.switchToPerspectiveFrustum = function () {
3885
+ if (
3886
+ this._mode === SceneMode.SCENE2D ||
3887
+ this.frustum instanceof PerspectiveFrustum
3888
+ ) {
3889
+ return;
3890
+ }
3891
+
3892
+ const scene = this._scene;
3893
+ this.frustum = new PerspectiveFrustum();
3894
+ this.frustum.aspectRatio =
3895
+ scene.drawingBufferWidth / scene.drawingBufferHeight;
3896
+ this.frustum.fov = CesiumMath.toRadians(60.0);
3897
+ };
3898
+
3899
+ /**
3900
+ * Switches the frustum/projection to orthographic.
3901
+ *
3902
+ * This function is a no-op in 2D which will always be orthographic.
3903
+ */
3904
+ Camera.prototype.switchToOrthographicFrustum = function () {
3905
+ if (
3906
+ this._mode === SceneMode.SCENE2D ||
3907
+ this.frustum instanceof OrthographicFrustum
3908
+ ) {
3909
+ return;
3910
+ }
3911
+
3912
+ // This must be called before changing the frustum because it uses the previous
3913
+ // frustum to reconstruct the world space position from the depth buffer.
3914
+ const frustumWidth = calculateOrthographicFrustumWidth(this);
3915
+
3916
+ const scene = this._scene;
3917
+ this.frustum = new OrthographicFrustum();
3918
+ this.frustum.aspectRatio =
3919
+ scene.drawingBufferWidth / scene.drawingBufferHeight;
3920
+ this.frustum.width = frustumWidth;
3921
+ };
3922
+
3923
+ /**
3924
+ * @private
3925
+ */
3926
+ Camera.clone = function (camera, result) {
3927
+ if (!defined(result)) {
3928
+ result = new Camera(camera._scene);
3929
+ }
3930
+
3931
+ Cartesian3.clone(camera.position, result.position);
3932
+ Cartesian3.clone(camera.direction, result.direction);
3933
+ Cartesian3.clone(camera.up, result.up);
3934
+ Cartesian3.clone(camera.right, result.right);
3935
+ Matrix4.clone(camera._transform, result.transform);
3936
+ result._transformChanged = true;
3937
+ result.frustum = camera.frustum.clone();
3938
+
3939
+ return result;
3940
+ };
3941
+
3942
+ /**
3943
+ * A function that will execute when a flight completes.
3944
+ * @callback Camera.FlightCompleteCallback
3945
+ */
3946
+
3947
+ /**
3948
+ * A function that will execute when a flight is cancelled.
3949
+ * @callback Camera.FlightCancelledCallback
3950
+ */
3951
+ export default Camera;