@baidumap/mapv-three 1.3.2 → 1.4.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.
- package/dist/assets/textures/cloud/stbn.bin +0 -0
- package/dist/assets/wasm/lanelet.js +3296 -165
- package/dist/assets/wasm/lanelet.wasm +0 -0
- package/dist/assets/workers/{BaiduVectorParser.worker-d550338e.js → BaiduVectorParser.worker-f7fcc351.js} +915 -865
- package/dist/assets/workers/{CesiumTerrainParser.worker-20119751.js → CesiumTerrainParser.worker-fcae0cc9.js} +1081 -998
- package/dist/assets/workers/{MVTParser.worker-7dc8b0e4.js → MVTParser.worker-0dd27c39.js} +746 -685
- package/dist/devtool/panel.js +99 -29
- package/dist/mapvthree.module.js +26026 -44996
- package/dist/mapvthree.umd.js +13 -7
- package/dist/types/Internal.d.ts +1 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.open.d.ts +4 -0
- package/dist/types/threejs/controls/PointerLockControls.d.ts +2 -0
- package/dist/types/threejs/loaders/utilities/BatchTableHierarchyExtension.d.ts +4 -4
- package/dist/types/threejs/loaders/utilities/FeatureTable.d.ts +1 -1
- package/dist/types/threejs/materials/effects/LightningMaterial.d.ts +9 -0
- package/dist/types/threejs/materials/extend/ExtendMeshStandardMaterial.d.ts +1 -0
- package/dist/types/threejs/materials/natural/DynamicSkyMaterial.d.ts +1 -0
- package/dist/types/threejs/materials/natural/StaticSkyMaterial.d.ts +1 -0
- package/dist/types/threejs/materials/natural/VerticalGradientSkyMaterial.d.ts +1 -0
- package/dist/types/threejs/materials/polygon/PolygonMaterial.d.ts +1 -0
- package/dist/types/threejs/objects/GeoInstancedMesh.d.ts +1 -0
- package/dist/types/threejs/objects/line/Polyline.d.ts +1 -1
- package/dist/types/threejs/objects/point/Icon.d.ts +1 -0
- package/dist/types/threejs/objects/point/Label.d.ts +5 -1
- package/dist/types/threejs/objects/point/label/GeometryBufferBuilder.d.ts +3 -0
- package/dist/types/threejs/objects/point/label/TextBoxCalculator.d.ts +5 -3
- package/dist/types/threejs/objects/text/utils.d.ts +1 -1
- package/dist/types/threemap/3dtiles/HDMap3DTiles.d.ts +26 -0
- package/dist/types/threemap/3dtiles/materials/Default3DTilesMaterialManager.d.ts +51 -3
- package/dist/types/threemap/Engine.d.ts +6 -0
- package/dist/types/threemap/animations/ObjectTracker.d.ts +82 -43
- package/dist/types/threemap/animations/ObjectTracker_deprecated.d.ts +56 -0
- package/dist/types/threemap/animations/PathTracker.d.ts +92 -29
- package/dist/types/threemap/animations/RotateTracker.d.ts +123 -0
- package/dist/types/threemap/animations/TrackerAbstract.d.ts +26 -8
- package/dist/types/threemap/controls/PointerLockControls.d.ts +8 -2
- package/dist/types/threemap/controls/controller/ColumbusController.d.ts +10 -0
- package/dist/types/threemap/controls/controller/Scene3DController.d.ts +9 -0
- package/dist/types/threemap/controls/editors/Editor.d.ts +3 -0
- package/dist/types/threemap/engine/Clock.d.ts +156 -0
- package/dist/types/threemap/engine/Map.d.ts +20 -2
- package/dist/types/threemap/engine/Rendering.d.ts +15 -0
- package/dist/types/threemap/engine/rendering/Label.d.ts +2 -0
- package/dist/types/threemap/engine/rendering/MainNew.d.ts +1 -1
- package/dist/types/threemap/engine/rendering/postprocessing/OpaquePostprocessings.d.ts +1 -1
- package/dist/types/threemap/engine/rendering/postprocessing/SkyAtmospherePass.d.ts +1 -0
- package/dist/types/threemap/engine/rendering/scene/DirectSceneRendering.d.ts +5 -0
- package/dist/types/threemap/mapView/geo/terrainData/QuantizedMeshTerrainData.d.ts +1 -1
- package/dist/types/threemap/mapView/grid/BaiduVectorOfflineGrid.d.ts +5 -0
- package/dist/types/threemap/mapView/map/MapView.d.ts +3 -0
- package/dist/types/threemap/mapView/parser/baidulane/ElementParser.d.ts +86 -0
- package/dist/types/threemap/mapView/parser/baidulane/StyleParser.d.ts +28 -0
- package/dist/types/threemap/mapView/parser/baidulane/constants/index.d.ts +25 -0
- package/dist/types/threemap/mapView/parser/baidulane/constants/types.d.ts +47 -0
- package/dist/types/threemap/mapView/parser/baidulane/core/GeometryBuilder.d.ts +40 -0
- package/dist/types/threemap/mapView/parser/baidulane/core/LayerManager.d.ts +41 -0
- package/dist/types/threemap/mapView/parser/baidulane/core/MaterialFactory.d.ts +71 -0
- package/dist/types/threemap/mapView/parser/baidulane/core/StyleManager.d.ts +50 -0
- package/dist/types/threemap/mapView/parser/baidulane/core/TextureManager.d.ts +65 -0
- package/dist/types/threemap/mapView/parser/baidulane/core/wasmManager.d.ts +18 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Base.d.ts +46 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Building3d.d.ts +15 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/FlatSymbol.d.ts +15 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/LabelLine.d.ts +29 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Line.d.ts +15 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Line3d.d.ts +15 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Line3dTexture.d.ts +3 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/LineDash.d.ts +7 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/LineTexture.d.ts +7 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Poi.d.ts +26 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Polygon.d.ts +15 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/Polygon3d.d.ts +40 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/PolygonExtrude.d.ts +15 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/PolygonExtrudeTexture.d.ts +18 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/PolygonOpacity.d.ts +7 -0
- package/dist/types/threemap/mapView/parser/baidulane/generators/SimplePoint.d.ts +39 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/Background.d.ts +11 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/Base.d.ts +27 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/BridgePier.d.ts +20 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/DebugLine.d.ts +16 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/DebugPoint.d.ts +5 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/DebugPolygon.d.ts +20 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingGradient.d.ts +16 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingGuide.d.ts +11 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingLine.d.ts +11 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingPoly.d.ts +15 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/GaoqingRoad.d.ts +13 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/HRegion.d.ts +11 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/LineName.d.ts +48 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/Link.d.ts +10 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/Poi.d.ts +7 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/Poly.d.ts +11 -0
- package/dist/types/threemap/mapView/parser/baidulane/processors/Texture.d.ts +10 -0
- package/dist/types/threemap/mapView/parser/baidulane/utils/color.d.ts +13 -0
- package/dist/types/threemap/mapView/parser/baidulane/utils/coordinate.d.ts +18 -0
- package/dist/types/threemap/mapView/parser/baidulane/utils/geometry.d.ts +3 -0
- package/dist/types/threemap/mapView/parser/baidulane/utils/icon.d.ts +8 -0
- package/dist/types/threemap/mapView/parser/baidulane/utils/merge.d.ts +7 -0
- package/dist/types/threemap/mapView/parser/baidulane/utils/tracer.d.ts +7 -0
- package/dist/types/{util/mapbox.d.ts → threemap/mapView/parser/mapbox/util.d.ts} +1 -1
- package/dist/types/threemap/mapView/surface/GroundSceneRenderer.d.ts +7 -2
- package/dist/types/threemap/mapView/surface/MapSurface.d.ts +2 -0
- package/dist/types/threemap/mapView/tileProvider/terrain/CesiumTerrainTileProvider.d.ts +3 -0
- package/dist/types/threemap/mapView/tileProvider/vector/BaiduLaneVectorTileProvider.d.ts +7 -0
- package/dist/types/threemap/mapView/tileProvider/vector/MapboxVectorTileProvider.d.ts +6 -10
- package/dist/types/threemap/mapView/utils/createGroundTileMesh.d.ts +2 -1
- package/dist/types/threemap/mapView/utils/projectVertices.d.ts +1 -1
- package/dist/types/threemap/materials/BatchBuildingMaterial.d.ts +9 -11
- package/dist/types/threemap/materials/RoadMarkingMaterial.d.ts +2 -11
- package/dist/types/threemap/materials/TerrainClassificationMaterial.d.ts +9 -7
- package/dist/types/threemap/natural/DynamicSky.d.ts +68 -22
- package/dist/types/threemap/natural/DynamicWeather.d.ts +15 -105
- package/dist/types/threemap/natural/EmptySky.d.ts +48 -62
- package/dist/types/threemap/natural/PhysicalSky.d.ts +220 -0
- package/dist/types/threemap/natural/Rain.d.ts +5 -2
- package/dist/types/threemap/natural/Snow.d.ts +5 -2
- package/dist/types/threemap/natural/StaticSky.d.ts +1 -0
- package/dist/types/threemap/natural/Thunderstorm.d.ts +31 -0
- package/dist/types/threemap/natural/clouds/CascadedShadowMaps.d.ts +31 -0
- package/dist/types/threemap/natural/clouds/CloudLayer.d.ts +19 -0
- package/dist/types/threemap/natural/clouds/CloudLayers.d.ts +13 -0
- package/dist/types/threemap/natural/clouds/CloudShape.d.ts +4 -0
- package/dist/types/threemap/natural/clouds/CloudShapeDetail.d.ts +4 -0
- package/dist/types/threemap/natural/clouds/CloudsEffect.d.ts +173 -0
- package/dist/types/threemap/natural/clouds/CloudsMaterial.d.ts +35 -0
- package/dist/types/threemap/natural/clouds/CloudsPass.d.ts +39 -0
- package/dist/types/threemap/natural/clouds/CloudsPostPass.d.ts +10 -0
- package/dist/types/threemap/natural/clouds/CloudsResolveMaterial.d.ts +13 -0
- package/dist/types/threemap/natural/clouds/DensityProfile.d.ts +10 -0
- package/dist/types/threemap/natural/clouds/LocalWeather.d.ts +4 -0
- package/dist/types/threemap/natural/clouds/PassBase.d.ts +7 -0
- package/dist/types/threemap/natural/clouds/Procedural3DTexture.d.ts +15 -0
- package/dist/types/threemap/natural/clouds/ProceduralTexture.d.ts +15 -0
- package/dist/types/threemap/natural/clouds/ShaderArrayPass.d.ts +3 -0
- package/dist/types/threemap/natural/clouds/ShadowMaterial.d.ts +14 -0
- package/dist/types/threemap/natural/clouds/ShadowPass.d.ts +31 -0
- package/dist/types/threemap/natural/clouds/ShadowResolveMaterial.d.ts +8 -0
- package/dist/types/threemap/natural/clouds/Turbulence.d.ts +4 -0
- package/dist/types/threemap/natural/clouds/bayer.d.ts +2 -0
- package/dist/types/threemap/natural/clouds/constants.d.ts +6 -0
- package/dist/types/threemap/natural/clouds/helpers/FrustumCorners.d.ts +10 -0
- package/dist/types/threemap/natural/clouds/helpers/setArrayRenderTargetLayers.d.ts +1 -0
- package/dist/types/threemap/natural/clouds/helpers/splitFrustum.d.ts +6 -0
- package/dist/types/threemap/natural/clouds/qualityPresets.d.ts +130 -0
- package/dist/types/threemap/natural/clouds/uniforms.d.ts +44 -0
- package/dist/types/threemap/natural/core/ArrayBufferLoader.d.ts +3 -0
- package/dist/types/threemap/natural/core/DataTextureLoader.d.ts +11 -0
- package/dist/types/threemap/natural/core/Ellipsoid.d.ts +17 -0
- package/dist/types/threemap/natural/core/Geodetic.d.ts +23 -0
- package/dist/types/threemap/natural/core/TypedArrayLoader.d.ts +5 -0
- package/dist/types/threemap/natural/core/capabilities.d.ts +1 -0
- package/dist/types/threemap/natural/core/celestialDirections.d.ts +5 -0
- package/dist/types/threemap/natural/core/decorators.d.ts +61 -0
- package/dist/types/threemap/natural/core/defineShorthand.d.ts +2 -0
- package/dist/types/threemap/natural/core/helpers/projectOnEllipsoidSurface.d.ts +1 -0
- package/dist/types/threemap/natural/core/math.d.ts +15 -0
- package/dist/types/threemap/natural/core/requestIdleCallback.d.ts +2 -0
- package/dist/types/threemap/natural/core/resolveIncludes.d.ts +1 -0
- package/dist/types/threemap/natural/core/shaders/index.d.ts +10 -0
- package/dist/types/threemap/natural/core/unrollLoops.d.ts +1 -0
- package/dist/types/threemap/natural/effects/DepthEffect.d.ts +15 -0
- package/dist/types/threemap/natural/effects/DitheringEffect.d.ts +6 -0
- package/dist/types/threemap/natural/effects/DownsampleThresholdMaterial.d.ts +14 -0
- package/dist/types/threemap/natural/effects/GeometryEffect.d.ts +11 -0
- package/dist/types/threemap/natural/effects/GeometryPass.d.ts +6 -0
- package/dist/types/threemap/natural/effects/LensFlareEffect.d.ts +31 -0
- package/dist/types/threemap/natural/effects/LensFlareFeaturesMaterial.d.ts +17 -0
- package/dist/types/threemap/natural/effects/NormalEffect.d.ts +16 -0
- package/dist/types/threemap/natural/effects/createHaldLookupTexture.d.ts +1 -0
- package/dist/types/threemap/natural/effects/index.d.ts +7 -0
- package/dist/types/threemap/natural/effects/setupMaterialsForGeometryPass.d.ts +1 -0
- package/dist/types/threemap/natural/sky/AerialPerspectiveEffect.d.ts +95 -0
- package/dist/types/threemap/natural/sky/AtmosphereMaterialBase.d.ts +40 -0
- package/dist/types/threemap/natural/sky/AtmosphereParameters.d.ts +32 -0
- package/dist/types/threemap/natural/sky/AtmospherePostPass.d.ts +10 -0
- package/dist/types/threemap/natural/sky/PrecomputedTexturesGenerator.d.ts +66 -0
- package/dist/types/threemap/natural/sky/SkyMaterial.d.ts +26 -0
- package/dist/types/threemap/natural/sky/constants.d.ts +14 -0
- package/dist/types/threemap/natural/sky/getAltitudeCorrectionOffset.d.ts +1 -0
- package/dist/types/threemap/video/VideoConfig.d.ts +2 -2
- package/dist/types/util/graphics/line.d.ts +2 -2
- package/dist/types/util/request.d.ts +1 -1
- package/package.json +6 -3
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/color.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/background.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/fill-extrusion.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/fill.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/index.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/line.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/executer/symbol.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/compound_expression.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/assertion.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/at.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/case.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/coalesce.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/coercion.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/collator.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/comparison.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/format.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/image.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/in.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/index.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/index_of.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/interpolate.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/length.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/let.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/literal.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/match.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/number_format.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/slice.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/step.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/var.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/definitions/within.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/evaluation_context.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/expression.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/index.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/is_constant.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/parsing_context.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/parsing_error.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/scope.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/stops.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types/collator.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types/formatted.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types/resolved_image.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/types.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/expression/values.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/feature_filter/index.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/function/convert.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/function/index.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/sourceLayer.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/sprite.d.ts +0 -0
- /package/dist/types/threemap/mapView/{mapbox → parser/mapbox}/style.d.ts +0 -0
|
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
|
-
* Copyright 2010-
|
|
9
|
+
* Copyright 2010-2025 Three.js Authors
|
|
10
10
|
* SPDX-License-Identifier: MIT
|
|
11
11
|
*/
|
|
12
12
|
const t = 2e3, s = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
|
|
@@ -220,14 +220,14 @@ class c {
|
|
|
220
220
|
return this.x = Math.max(this.x, t2.x), this.y = Math.max(this.y, t2.y), this;
|
|
221
221
|
}
|
|
222
222
|
clamp(t2, s2) {
|
|
223
|
-
return this.x =
|
|
223
|
+
return this.x = n(this.x, t2.x, s2.x), this.y = n(this.y, t2.y, s2.y), this;
|
|
224
224
|
}
|
|
225
225
|
clampScalar(t2, s2) {
|
|
226
|
-
return this.x =
|
|
226
|
+
return this.x = n(this.x, t2, s2), this.y = n(this.y, t2, s2), this;
|
|
227
227
|
}
|
|
228
228
|
clampLength(t2, s2) {
|
|
229
229
|
const i2 = this.length();
|
|
230
|
-
return this.divideScalar(i2 || 1).multiplyScalar(
|
|
230
|
+
return this.divideScalar(i2 || 1).multiplyScalar(n(i2, t2, s2));
|
|
231
231
|
}
|
|
232
232
|
floor() {
|
|
233
233
|
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this;
|
|
@@ -315,129 +315,218 @@ class c {
|
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
class l {
|
|
318
|
-
constructor(t2, s2, i2
|
|
319
|
-
|
|
318
|
+
constructor(t2 = 0, s2 = 0, i2 = 0, e2 = 1) {
|
|
319
|
+
this.isQuaternion = true, this._x = t2, this._y = s2, this._z = i2, this._w = e2;
|
|
320
320
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
321
|
+
static slerpFlat(t2, s2, i2, e2, a2, n2, r2) {
|
|
322
|
+
let h2 = i2[e2 + 0], o2 = i2[e2 + 1], c2 = i2[e2 + 2], l2 = i2[e2 + 3];
|
|
323
|
+
const u2 = a2[n2 + 0], d2 = a2[n2 + 1], m2 = a2[n2 + 2], _2 = a2[n2 + 3];
|
|
324
|
+
if (0 === r2)
|
|
325
|
+
return t2[s2 + 0] = h2, t2[s2 + 1] = o2, t2[s2 + 2] = c2, void (t2[s2 + 3] = l2);
|
|
326
|
+
if (1 === r2)
|
|
327
|
+
return t2[s2 + 0] = u2, t2[s2 + 1] = d2, t2[s2 + 2] = m2, void (t2[s2 + 3] = _2);
|
|
328
|
+
if (l2 !== _2 || h2 !== u2 || o2 !== d2 || c2 !== m2) {
|
|
329
|
+
let t3 = 1 - r2;
|
|
330
|
+
const s3 = h2 * u2 + o2 * d2 + c2 * m2 + l2 * _2, i3 = s3 >= 0 ? 1 : -1, e3 = 1 - s3 * s3;
|
|
331
|
+
if (e3 > Number.EPSILON) {
|
|
332
|
+
const a4 = Math.sqrt(e3), n3 = Math.atan2(a4, s3 * i3);
|
|
333
|
+
t3 = Math.sin(t3 * n3) / a4, r2 = Math.sin(r2 * n3) / a4;
|
|
334
|
+
}
|
|
335
|
+
const a3 = r2 * i3;
|
|
336
|
+
if (h2 = h2 * t3 + u2 * a3, o2 = o2 * t3 + d2 * a3, c2 = c2 * t3 + m2 * a3, l2 = l2 * t3 + _2 * a3, t3 === 1 - r2) {
|
|
337
|
+
const t4 = 1 / Math.sqrt(h2 * h2 + o2 * o2 + c2 * c2 + l2 * l2);
|
|
338
|
+
h2 *= t4, o2 *= t4, c2 *= t4, l2 *= t4;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
t2[s2] = h2, t2[s2 + 1] = o2, t2[s2 + 2] = c2, t2[s2 + 3] = l2;
|
|
324
342
|
}
|
|
325
|
-
|
|
326
|
-
|
|
343
|
+
static multiplyQuaternionsFlat(t2, s2, i2, e2, a2, n2) {
|
|
344
|
+
const r2 = i2[e2], h2 = i2[e2 + 1], o2 = i2[e2 + 2], c2 = i2[e2 + 3], l2 = a2[n2], u2 = a2[n2 + 1], d2 = a2[n2 + 2], m2 = a2[n2 + 3];
|
|
345
|
+
return t2[s2] = r2 * m2 + c2 * l2 + h2 * d2 - o2 * u2, t2[s2 + 1] = h2 * m2 + c2 * u2 + o2 * l2 - r2 * d2, t2[s2 + 2] = o2 * m2 + c2 * d2 + r2 * u2 - h2 * l2, t2[s2 + 3] = c2 * m2 - r2 * l2 - h2 * u2 - o2 * d2, t2;
|
|
346
|
+
}
|
|
347
|
+
get x() {
|
|
348
|
+
return this._x;
|
|
349
|
+
}
|
|
350
|
+
set x(t2) {
|
|
351
|
+
this._x = t2, this._onChangeCallback();
|
|
352
|
+
}
|
|
353
|
+
get y() {
|
|
354
|
+
return this._y;
|
|
355
|
+
}
|
|
356
|
+
set y(t2) {
|
|
357
|
+
this._y = t2, this._onChangeCallback();
|
|
358
|
+
}
|
|
359
|
+
get z() {
|
|
360
|
+
return this._z;
|
|
361
|
+
}
|
|
362
|
+
set z(t2) {
|
|
363
|
+
this._z = t2, this._onChangeCallback();
|
|
364
|
+
}
|
|
365
|
+
get w() {
|
|
366
|
+
return this._w;
|
|
367
|
+
}
|
|
368
|
+
set w(t2) {
|
|
369
|
+
this._w = t2, this._onChangeCallback();
|
|
370
|
+
}
|
|
371
|
+
set(t2, s2, i2, e2) {
|
|
372
|
+
return this._x = t2, this._y = s2, this._z = i2, this._w = e2, this._onChangeCallback(), this;
|
|
373
|
+
}
|
|
374
|
+
clone() {
|
|
375
|
+
return new this.constructor(this._x, this._y, this._z, this._w);
|
|
327
376
|
}
|
|
328
377
|
copy(t2) {
|
|
329
|
-
|
|
330
|
-
return s2[0] = i2[0], s2[1] = i2[1], s2[2] = i2[2], s2[3] = i2[3], s2[4] = i2[4], s2[5] = i2[5], s2[6] = i2[6], s2[7] = i2[7], s2[8] = i2[8], this;
|
|
378
|
+
return this._x = t2.x, this._y = t2.y, this._z = t2.z, this._w = t2.w, this._onChangeCallback(), this;
|
|
331
379
|
}
|
|
332
|
-
|
|
333
|
-
|
|
380
|
+
setFromEuler(t2, s2 = true) {
|
|
381
|
+
const i2 = t2._x, e2 = t2._y, a2 = t2._z, n2 = t2._order, r2 = Math.cos, h2 = Math.sin, o2 = r2(i2 / 2), c2 = r2(e2 / 2), l2 = r2(a2 / 2), u2 = h2(i2 / 2), d2 = h2(e2 / 2), m2 = h2(a2 / 2);
|
|
382
|
+
switch (n2) {
|
|
383
|
+
case "XYZ":
|
|
384
|
+
this._x = u2 * c2 * l2 + o2 * d2 * m2, this._y = o2 * d2 * l2 - u2 * c2 * m2, this._z = o2 * c2 * m2 + u2 * d2 * l2, this._w = o2 * c2 * l2 - u2 * d2 * m2;
|
|
385
|
+
break;
|
|
386
|
+
case "YXZ":
|
|
387
|
+
this._x = u2 * c2 * l2 + o2 * d2 * m2, this._y = o2 * d2 * l2 - u2 * c2 * m2, this._z = o2 * c2 * m2 - u2 * d2 * l2, this._w = o2 * c2 * l2 + u2 * d2 * m2;
|
|
388
|
+
break;
|
|
389
|
+
case "ZXY":
|
|
390
|
+
this._x = u2 * c2 * l2 - o2 * d2 * m2, this._y = o2 * d2 * l2 + u2 * c2 * m2, this._z = o2 * c2 * m2 + u2 * d2 * l2, this._w = o2 * c2 * l2 - u2 * d2 * m2;
|
|
391
|
+
break;
|
|
392
|
+
case "ZYX":
|
|
393
|
+
this._x = u2 * c2 * l2 - o2 * d2 * m2, this._y = o2 * d2 * l2 + u2 * c2 * m2, this._z = o2 * c2 * m2 - u2 * d2 * l2, this._w = o2 * c2 * l2 + u2 * d2 * m2;
|
|
394
|
+
break;
|
|
395
|
+
case "YZX":
|
|
396
|
+
this._x = u2 * c2 * l2 + o2 * d2 * m2, this._y = o2 * d2 * l2 + u2 * c2 * m2, this._z = o2 * c2 * m2 - u2 * d2 * l2, this._w = o2 * c2 * l2 - u2 * d2 * m2;
|
|
397
|
+
break;
|
|
398
|
+
case "XZY":
|
|
399
|
+
this._x = u2 * c2 * l2 - o2 * d2 * m2, this._y = o2 * d2 * l2 - u2 * c2 * m2, this._z = o2 * c2 * m2 + u2 * d2 * l2, this._w = o2 * c2 * l2 + u2 * d2 * m2;
|
|
400
|
+
break;
|
|
401
|
+
default:
|
|
402
|
+
console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + n2);
|
|
403
|
+
}
|
|
404
|
+
return true === s2 && this._onChangeCallback(), this;
|
|
334
405
|
}
|
|
335
|
-
|
|
336
|
-
const s2 =
|
|
337
|
-
return this.
|
|
406
|
+
setFromAxisAngle(t2, s2) {
|
|
407
|
+
const i2 = s2 / 2, e2 = Math.sin(i2);
|
|
408
|
+
return this._x = t2.x * e2, this._y = t2.y * e2, this._z = t2.z * e2, this._w = Math.cos(i2), this._onChangeCallback(), this;
|
|
338
409
|
}
|
|
339
|
-
|
|
340
|
-
|
|
410
|
+
setFromRotationMatrix(t2) {
|
|
411
|
+
const s2 = t2.elements, i2 = s2[0], e2 = s2[4], a2 = s2[8], n2 = s2[1], r2 = s2[5], h2 = s2[9], o2 = s2[2], c2 = s2[6], l2 = s2[10], u2 = i2 + r2 + l2;
|
|
412
|
+
if (u2 > 0) {
|
|
413
|
+
const t3 = 0.5 / Math.sqrt(u2 + 1);
|
|
414
|
+
this._w = 0.25 / t3, this._x = (c2 - h2) * t3, this._y = (a2 - o2) * t3, this._z = (n2 - e2) * t3;
|
|
415
|
+
} else if (i2 > r2 && i2 > l2) {
|
|
416
|
+
const t3 = 2 * Math.sqrt(1 + i2 - r2 - l2);
|
|
417
|
+
this._w = (c2 - h2) / t3, this._x = 0.25 * t3, this._y = (e2 + n2) / t3, this._z = (a2 + o2) / t3;
|
|
418
|
+
} else if (r2 > l2) {
|
|
419
|
+
const t3 = 2 * Math.sqrt(1 + r2 - i2 - l2);
|
|
420
|
+
this._w = (a2 - o2) / t3, this._x = (e2 + n2) / t3, this._y = 0.25 * t3, this._z = (h2 + c2) / t3;
|
|
421
|
+
} else {
|
|
422
|
+
const t3 = 2 * Math.sqrt(1 + l2 - i2 - r2);
|
|
423
|
+
this._w = (n2 - e2) / t3, this._x = (a2 + o2) / t3, this._y = (h2 + c2) / t3, this._z = 0.25 * t3;
|
|
424
|
+
}
|
|
425
|
+
return this._onChangeCallback(), this;
|
|
341
426
|
}
|
|
342
|
-
|
|
343
|
-
|
|
427
|
+
setFromUnitVectors(t2, s2) {
|
|
428
|
+
let i2 = t2.dot(s2) + 1;
|
|
429
|
+
return i2 < 1e-8 ? (i2 = 0, Math.abs(t2.x) > Math.abs(t2.z) ? (this._x = -t2.y, this._y = t2.x, this._z = 0, this._w = i2) : (this._x = 0, this._y = -t2.z, this._z = t2.y, this._w = i2)) : (this._x = t2.y * s2.z - t2.z * s2.y, this._y = t2.z * s2.x - t2.x * s2.z, this._z = t2.x * s2.y - t2.y * s2.x, this._w = i2), this.normalize();
|
|
344
430
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
return a2[0] = n2 * _2 + r2 * p2 + h2 * x2, a2[3] = n2 * f2 + r2 * M2 + h2 * w2, a2[6] = n2 * y2 + r2 * g2 + h2 * S2, a2[1] = o2 * _2 + c2 * p2 + l2 * x2, a2[4] = o2 * f2 + c2 * M2 + l2 * w2, a2[7] = o2 * y2 + c2 * g2 + l2 * S2, a2[2] = u2 * _2 + d2 * p2 + m2 * x2, a2[5] = u2 * f2 + d2 * M2 + m2 * w2, a2[8] = u2 * y2 + d2 * g2 + m2 * S2, this;
|
|
431
|
+
angleTo(t2) {
|
|
432
|
+
return 2 * Math.acos(Math.abs(n(this.dot(t2), -1, 1)));
|
|
348
433
|
}
|
|
349
|
-
|
|
350
|
-
const
|
|
351
|
-
|
|
434
|
+
rotateTowards(t2, s2) {
|
|
435
|
+
const i2 = this.angleTo(t2);
|
|
436
|
+
if (0 === i2)
|
|
437
|
+
return this;
|
|
438
|
+
const e2 = Math.min(1, s2 / i2);
|
|
439
|
+
return this.slerp(t2, e2), this;
|
|
352
440
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
return s2 * n2 * c2 - s2 * r2 * o2 - i2 * a2 * c2 + i2 * r2 * h2 + e2 * a2 * o2 - e2 * n2 * h2;
|
|
441
|
+
identity() {
|
|
442
|
+
return this.set(0, 0, 0, 1);
|
|
356
443
|
}
|
|
357
444
|
invert() {
|
|
358
|
-
|
|
359
|
-
if (0 === m2)
|
|
360
|
-
return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
361
|
-
const _2 = 1 / m2;
|
|
362
|
-
return t2[0] = l2 * _2, t2[1] = (e2 * o2 - c2 * i2) * _2, t2[2] = (r2 * i2 - e2 * n2) * _2, t2[3] = u2 * _2, t2[4] = (c2 * s2 - e2 * h2) * _2, t2[5] = (e2 * a2 - r2 * s2) * _2, t2[6] = d2 * _2, t2[7] = (i2 * h2 - o2 * s2) * _2, t2[8] = (n2 * s2 - i2 * a2) * _2, this;
|
|
445
|
+
return this.conjugate();
|
|
363
446
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
const s2 = this.elements;
|
|
367
|
-
return t2 = s2[1], s2[1] = s2[3], s2[3] = t2, t2 = s2[2], s2[2] = s2[6], s2[6] = t2, t2 = s2[5], s2[5] = s2[7], s2[7] = t2, this;
|
|
447
|
+
conjugate() {
|
|
448
|
+
return this._x *= -1, this._y *= -1, this._z *= -1, this._onChangeCallback(), this;
|
|
368
449
|
}
|
|
369
|
-
|
|
370
|
-
return this.
|
|
450
|
+
dot(t2) {
|
|
451
|
+
return this._x * t2._x + this._y * t2._y + this._z * t2._z + this._w * t2._w;
|
|
371
452
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
return t2[0] = s2[0], t2[1] = s2[3], t2[2] = s2[6], t2[3] = s2[1], t2[4] = s2[4], t2[5] = s2[7], t2[6] = s2[2], t2[7] = s2[5], t2[8] = s2[8], this;
|
|
453
|
+
lengthSq() {
|
|
454
|
+
return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
|
|
375
455
|
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
return this.set(i2 * h2, i2 * o2, -i2 * (h2 * n2 + o2 * r2) + n2 + t2, -e2 * o2, e2 * h2, -e2 * (-o2 * n2 + h2 * r2) + r2 + s2, 0, 0, 1), this;
|
|
456
|
+
length() {
|
|
457
|
+
return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);
|
|
379
458
|
}
|
|
380
|
-
|
|
381
|
-
|
|
459
|
+
normalize() {
|
|
460
|
+
let t2 = this.length();
|
|
461
|
+
return 0 === t2 ? (this._x = 0, this._y = 0, this._z = 0, this._w = 1) : (t2 = 1 / t2, this._x = this._x * t2, this._y = this._y * t2, this._z = this._z * t2, this._w = this._w * t2), this._onChangeCallback(), this;
|
|
382
462
|
}
|
|
383
|
-
|
|
384
|
-
return this.
|
|
463
|
+
multiply(t2) {
|
|
464
|
+
return this.multiplyQuaternions(this, t2);
|
|
385
465
|
}
|
|
386
|
-
|
|
387
|
-
return this.
|
|
466
|
+
premultiply(t2) {
|
|
467
|
+
return this.multiplyQuaternions(t2, this);
|
|
388
468
|
}
|
|
389
|
-
|
|
390
|
-
|
|
469
|
+
multiplyQuaternions(t2, s2) {
|
|
470
|
+
const i2 = t2._x, e2 = t2._y, a2 = t2._z, n2 = t2._w, r2 = s2._x, h2 = s2._y, o2 = s2._z, c2 = s2._w;
|
|
471
|
+
return this._x = i2 * c2 + n2 * r2 + e2 * o2 - a2 * h2, this._y = e2 * c2 + n2 * h2 + a2 * r2 - i2 * o2, this._z = a2 * c2 + n2 * o2 + i2 * h2 - e2 * r2, this._w = n2 * c2 - i2 * r2 - e2 * h2 - a2 * o2, this._onChangeCallback(), this;
|
|
391
472
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
473
|
+
slerp(t2, s2) {
|
|
474
|
+
if (0 === s2)
|
|
475
|
+
return this;
|
|
476
|
+
if (1 === s2)
|
|
477
|
+
return this.copy(t2);
|
|
478
|
+
const i2 = this._x, e2 = this._y, a2 = this._z, n2 = this._w;
|
|
479
|
+
let r2 = n2 * t2._w + i2 * t2._x + e2 * t2._y + a2 * t2._z;
|
|
480
|
+
if (r2 < 0 ? (this._w = -t2._w, this._x = -t2._x, this._y = -t2._y, this._z = -t2._z, r2 = -r2) : this.copy(t2), r2 >= 1)
|
|
481
|
+
return this._w = n2, this._x = i2, this._y = e2, this._z = a2, this;
|
|
482
|
+
const h2 = 1 - r2 * r2;
|
|
483
|
+
if (h2 <= Number.EPSILON) {
|
|
484
|
+
const t3 = 1 - s2;
|
|
485
|
+
return this._w = t3 * n2 + s2 * this._w, this._x = t3 * i2 + s2 * this._x, this._y = t3 * e2 + s2 * this._y, this._z = t3 * a2 + s2 * this._z, this.normalize(), this;
|
|
486
|
+
}
|
|
487
|
+
const o2 = Math.sqrt(h2), c2 = Math.atan2(o2, r2), l2 = Math.sin((1 - s2) * c2) / o2, u2 = Math.sin(s2 * c2) / o2;
|
|
488
|
+
return this._w = n2 * l2 + this._w * u2, this._x = i2 * l2 + this._x * u2, this._y = e2 * l2 + this._y * u2, this._z = a2 * l2 + this._z * u2, this._onChangeCallback(), this;
|
|
395
489
|
}
|
|
396
|
-
|
|
397
|
-
return this.
|
|
490
|
+
slerpQuaternions(t2, s2, i2) {
|
|
491
|
+
return this.copy(t2).slerp(s2, i2);
|
|
492
|
+
}
|
|
493
|
+
random() {
|
|
494
|
+
const t2 = 2 * Math.PI * Math.random(), s2 = 2 * Math.PI * Math.random(), i2 = Math.random(), e2 = Math.sqrt(1 - i2), a2 = Math.sqrt(i2);
|
|
495
|
+
return this.set(e2 * Math.sin(t2), e2 * Math.cos(t2), a2 * Math.sin(s2), a2 * Math.cos(s2));
|
|
398
496
|
}
|
|
399
497
|
equals(t2) {
|
|
400
|
-
|
|
401
|
-
for (let t3 = 0; t3 < 9; t3++)
|
|
402
|
-
if (s2[t3] !== i2[t3])
|
|
403
|
-
return false;
|
|
404
|
-
return true;
|
|
498
|
+
return t2._x === this._x && t2._y === this._y && t2._z === this._z && t2._w === this._w;
|
|
405
499
|
}
|
|
406
500
|
fromArray(t2, s2 = 0) {
|
|
407
|
-
|
|
408
|
-
this.elements[i2] = t2[i2 + s2];
|
|
409
|
-
return this;
|
|
501
|
+
return this._x = t2[s2], this._y = t2[s2 + 1], this._z = t2[s2 + 2], this._w = t2[s2 + 3], this._onChangeCallback(), this;
|
|
410
502
|
}
|
|
411
503
|
toArray(t2 = [], s2 = 0) {
|
|
412
|
-
|
|
413
|
-
return t2[s2] = i2[0], t2[s2 + 1] = i2[1], t2[s2 + 2] = i2[2], t2[s2 + 3] = i2[3], t2[s2 + 4] = i2[4], t2[s2 + 5] = i2[5], t2[s2 + 6] = i2[6], t2[s2 + 7] = i2[7], t2[s2 + 8] = i2[8], t2;
|
|
504
|
+
return t2[s2] = this._x, t2[s2 + 1] = this._y, t2[s2 + 2] = this._z, t2[s2 + 3] = this._w, t2;
|
|
414
505
|
}
|
|
415
|
-
|
|
416
|
-
return
|
|
506
|
+
fromBufferAttribute(t2, s2) {
|
|
507
|
+
return this._x = t2.getX(s2), this._y = t2.getY(s2), this._z = t2.getZ(s2), this._w = t2.getW(s2), this._onChangeCallback(), this;
|
|
417
508
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
class d {
|
|
421
|
-
constructor(t2 = 0, s2 = 0, i2 = 0, e2 = 1) {
|
|
422
|
-
d.prototype.isVector4 = true, this.x = t2, this.y = s2, this.z = i2, this.w = e2;
|
|
509
|
+
toJSON() {
|
|
510
|
+
return this.toArray();
|
|
423
511
|
}
|
|
424
|
-
|
|
425
|
-
return this.
|
|
512
|
+
_onChange(t2) {
|
|
513
|
+
return this._onChangeCallback = t2, this;
|
|
426
514
|
}
|
|
427
|
-
|
|
428
|
-
this.z = t2;
|
|
515
|
+
_onChangeCallback() {
|
|
429
516
|
}
|
|
430
|
-
|
|
431
|
-
|
|
517
|
+
*[Symbol.iterator]() {
|
|
518
|
+
yield this._x, yield this._y, yield this._z, yield this._w;
|
|
432
519
|
}
|
|
433
|
-
|
|
434
|
-
|
|
520
|
+
}
|
|
521
|
+
class u {
|
|
522
|
+
constructor(t2 = 0, s2 = 0, i2 = 0) {
|
|
523
|
+
u.prototype.isVector3 = true, this.x = t2, this.y = s2, this.z = i2;
|
|
435
524
|
}
|
|
436
|
-
set(t2, s2, i2
|
|
437
|
-
return this.x = t2, this.y = s2, this.z = i2, this
|
|
525
|
+
set(t2, s2, i2) {
|
|
526
|
+
return void 0 === i2 && (i2 = this.z), this.x = t2, this.y = s2, this.z = i2, this;
|
|
438
527
|
}
|
|
439
528
|
setScalar(t2) {
|
|
440
|
-
return this.x = t2, this.y = t2, this.z = t2, this
|
|
529
|
+
return this.x = t2, this.y = t2, this.z = t2, this;
|
|
441
530
|
}
|
|
442
531
|
setX(t2) {
|
|
443
532
|
return this.x = t2, this;
|
|
@@ -448,9 +537,6 @@ class d {
|
|
|
448
537
|
setZ(t2) {
|
|
449
538
|
return this.z = t2, this;
|
|
450
539
|
}
|
|
451
|
-
setW(t2) {
|
|
452
|
-
return this.w = t2, this;
|
|
453
|
-
}
|
|
454
540
|
setComponent(t2, s2) {
|
|
455
541
|
switch (t2) {
|
|
456
542
|
case 0:
|
|
@@ -462,9 +548,6 @@ class d {
|
|
|
462
548
|
case 2:
|
|
463
549
|
this.z = s2;
|
|
464
550
|
break;
|
|
465
|
-
case 3:
|
|
466
|
-
this.w = s2;
|
|
467
|
-
break;
|
|
468
551
|
default:
|
|
469
552
|
throw new Error("index is out of range: " + t2);
|
|
470
553
|
}
|
|
@@ -478,112 +561,125 @@ class d {
|
|
|
478
561
|
return this.y;
|
|
479
562
|
case 2:
|
|
480
563
|
return this.z;
|
|
481
|
-
case 3:
|
|
482
|
-
return this.w;
|
|
483
564
|
default:
|
|
484
565
|
throw new Error("index is out of range: " + t2);
|
|
485
566
|
}
|
|
486
567
|
}
|
|
487
568
|
clone() {
|
|
488
|
-
return new this.constructor(this.x, this.y, this.z
|
|
569
|
+
return new this.constructor(this.x, this.y, this.z);
|
|
489
570
|
}
|
|
490
571
|
copy(t2) {
|
|
491
|
-
return this.x = t2.x, this.y = t2.y, this.z = t2.z, this
|
|
572
|
+
return this.x = t2.x, this.y = t2.y, this.z = t2.z, this;
|
|
492
573
|
}
|
|
493
574
|
add(t2) {
|
|
494
|
-
return this.x += t2.x, this.y += t2.y, this.z += t2.z, this
|
|
575
|
+
return this.x += t2.x, this.y += t2.y, this.z += t2.z, this;
|
|
495
576
|
}
|
|
496
577
|
addScalar(t2) {
|
|
497
|
-
return this.x += t2, this.y += t2, this.z += t2, this
|
|
578
|
+
return this.x += t2, this.y += t2, this.z += t2, this;
|
|
498
579
|
}
|
|
499
580
|
addVectors(t2, s2) {
|
|
500
|
-
return this.x = t2.x + s2.x, this.y = t2.y + s2.y, this.z = t2.z + s2.z, this
|
|
581
|
+
return this.x = t2.x + s2.x, this.y = t2.y + s2.y, this.z = t2.z + s2.z, this;
|
|
501
582
|
}
|
|
502
583
|
addScaledVector(t2, s2) {
|
|
503
|
-
return this.x += t2.x * s2, this.y += t2.y * s2, this.z += t2.z * s2, this
|
|
584
|
+
return this.x += t2.x * s2, this.y += t2.y * s2, this.z += t2.z * s2, this;
|
|
504
585
|
}
|
|
505
586
|
sub(t2) {
|
|
506
|
-
return this.x -= t2.x, this.y -= t2.y, this.z -= t2.z, this
|
|
587
|
+
return this.x -= t2.x, this.y -= t2.y, this.z -= t2.z, this;
|
|
507
588
|
}
|
|
508
589
|
subScalar(t2) {
|
|
509
|
-
return this.x -= t2, this.y -= t2, this.z -= t2, this
|
|
590
|
+
return this.x -= t2, this.y -= t2, this.z -= t2, this;
|
|
510
591
|
}
|
|
511
592
|
subVectors(t2, s2) {
|
|
512
|
-
return this.x = t2.x - s2.x, this.y = t2.y - s2.y, this.z = t2.z - s2.z, this
|
|
593
|
+
return this.x = t2.x - s2.x, this.y = t2.y - s2.y, this.z = t2.z - s2.z, this;
|
|
513
594
|
}
|
|
514
595
|
multiply(t2) {
|
|
515
|
-
return this.x *= t2.x, this.y *= t2.y, this.z *= t2.z, this
|
|
596
|
+
return this.x *= t2.x, this.y *= t2.y, this.z *= t2.z, this;
|
|
516
597
|
}
|
|
517
598
|
multiplyScalar(t2) {
|
|
518
|
-
return this.x *= t2, this.y *= t2, this.z *= t2, this
|
|
599
|
+
return this.x *= t2, this.y *= t2, this.z *= t2, this;
|
|
600
|
+
}
|
|
601
|
+
multiplyVectors(t2, s2) {
|
|
602
|
+
return this.x = t2.x * s2.x, this.y = t2.y * s2.y, this.z = t2.z * s2.z, this;
|
|
603
|
+
}
|
|
604
|
+
applyEuler(t2) {
|
|
605
|
+
return this.applyQuaternion(m.setFromEuler(t2));
|
|
606
|
+
}
|
|
607
|
+
applyAxisAngle(t2, s2) {
|
|
608
|
+
return this.applyQuaternion(m.setFromAxisAngle(t2, s2));
|
|
609
|
+
}
|
|
610
|
+
applyMatrix3(t2) {
|
|
611
|
+
const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.elements;
|
|
612
|
+
return this.x = a2[0] * s2 + a2[3] * i2 + a2[6] * e2, this.y = a2[1] * s2 + a2[4] * i2 + a2[7] * e2, this.z = a2[2] * s2 + a2[5] * i2 + a2[8] * e2, this;
|
|
613
|
+
}
|
|
614
|
+
applyNormalMatrix(t2) {
|
|
615
|
+
return this.applyMatrix3(t2).normalize();
|
|
519
616
|
}
|
|
520
617
|
applyMatrix4(t2) {
|
|
521
|
-
const s2 = this.x, i2 = this.y, e2 = this.z, a2 =
|
|
522
|
-
return this.x =
|
|
618
|
+
const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.elements, n2 = 1 / (a2[3] * s2 + a2[7] * i2 + a2[11] * e2 + a2[15]);
|
|
619
|
+
return this.x = (a2[0] * s2 + a2[4] * i2 + a2[8] * e2 + a2[12]) * n2, this.y = (a2[1] * s2 + a2[5] * i2 + a2[9] * e2 + a2[13]) * n2, this.z = (a2[2] * s2 + a2[6] * i2 + a2[10] * e2 + a2[14]) * n2, this;
|
|
523
620
|
}
|
|
524
|
-
|
|
525
|
-
|
|
621
|
+
applyQuaternion(t2) {
|
|
622
|
+
const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.x, n2 = t2.y, r2 = t2.z, h2 = t2.w, o2 = 2 * (n2 * e2 - r2 * i2), c2 = 2 * (r2 * s2 - a2 * e2), l2 = 2 * (a2 * i2 - n2 * s2);
|
|
623
|
+
return this.x = s2 + h2 * o2 + n2 * l2 - r2 * c2, this.y = i2 + h2 * c2 + r2 * o2 - a2 * l2, this.z = e2 + h2 * l2 + a2 * c2 - n2 * o2, this;
|
|
526
624
|
}
|
|
527
|
-
|
|
528
|
-
this.
|
|
529
|
-
const s2 = Math.sqrt(1 - t2.w * t2.w);
|
|
530
|
-
return s2 < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = t2.x / s2, this.y = t2.y / s2, this.z = t2.z / s2), this;
|
|
625
|
+
project(t2) {
|
|
626
|
+
return this.applyMatrix4(t2.matrixWorldInverse).applyMatrix4(t2.projectionMatrix);
|
|
531
627
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
return
|
|
628
|
+
unproject(t2) {
|
|
629
|
+
return this.applyMatrix4(t2.projectionMatrixInverse).applyMatrix4(t2.matrixWorld);
|
|
630
|
+
}
|
|
631
|
+
transformDirection(t2) {
|
|
632
|
+
const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.elements;
|
|
633
|
+
return this.x = a2[0] * s2 + a2[4] * i2 + a2[8] * e2, this.y = a2[1] * s2 + a2[5] * i2 + a2[9] * e2, this.z = a2[2] * s2 + a2[6] * i2 + a2[10] * e2, this.normalize();
|
|
634
|
+
}
|
|
635
|
+
divide(t2) {
|
|
636
|
+
return this.x /= t2.x, this.y /= t2.y, this.z /= t2.z, this;
|
|
637
|
+
}
|
|
638
|
+
divideScalar(t2) {
|
|
639
|
+
return this.multiplyScalar(1 / t2);
|
|
544
640
|
}
|
|
545
641
|
min(t2) {
|
|
546
|
-
return this.x = Math.min(this.x, t2.x), this.y = Math.min(this.y, t2.y), this.z = Math.min(this.z, t2.z), this
|
|
642
|
+
return this.x = Math.min(this.x, t2.x), this.y = Math.min(this.y, t2.y), this.z = Math.min(this.z, t2.z), this;
|
|
547
643
|
}
|
|
548
644
|
max(t2) {
|
|
549
|
-
return this.x = Math.max(this.x, t2.x), this.y = Math.max(this.y, t2.y), this.z = Math.max(this.z, t2.z), this
|
|
645
|
+
return this.x = Math.max(this.x, t2.x), this.y = Math.max(this.y, t2.y), this.z = Math.max(this.z, t2.z), this;
|
|
550
646
|
}
|
|
551
647
|
clamp(t2, s2) {
|
|
552
|
-
return this.x =
|
|
648
|
+
return this.x = n(this.x, t2.x, s2.x), this.y = n(this.y, t2.y, s2.y), this.z = n(this.z, t2.z, s2.z), this;
|
|
553
649
|
}
|
|
554
650
|
clampScalar(t2, s2) {
|
|
555
|
-
return this.x =
|
|
651
|
+
return this.x = n(this.x, t2, s2), this.y = n(this.y, t2, s2), this.z = n(this.z, t2, s2), this;
|
|
556
652
|
}
|
|
557
653
|
clampLength(t2, s2) {
|
|
558
654
|
const i2 = this.length();
|
|
559
|
-
return this.divideScalar(i2 || 1).multiplyScalar(
|
|
655
|
+
return this.divideScalar(i2 || 1).multiplyScalar(n(i2, t2, s2));
|
|
560
656
|
}
|
|
561
657
|
floor() {
|
|
562
|
-
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this
|
|
658
|
+
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;
|
|
563
659
|
}
|
|
564
660
|
ceil() {
|
|
565
|
-
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this
|
|
661
|
+
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this;
|
|
566
662
|
}
|
|
567
663
|
round() {
|
|
568
|
-
return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this
|
|
664
|
+
return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;
|
|
569
665
|
}
|
|
570
666
|
roundToZero() {
|
|
571
|
-
return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this
|
|
667
|
+
return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this;
|
|
572
668
|
}
|
|
573
669
|
negate() {
|
|
574
|
-
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this
|
|
670
|
+
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this;
|
|
575
671
|
}
|
|
576
672
|
dot(t2) {
|
|
577
|
-
return this.x * t2.x + this.y * t2.y + this.z * t2.z
|
|
673
|
+
return this.x * t2.x + this.y * t2.y + this.z * t2.z;
|
|
578
674
|
}
|
|
579
675
|
lengthSq() {
|
|
580
|
-
return this.x * this.x + this.y * this.y + this.z * this.z
|
|
676
|
+
return this.x * this.x + this.y * this.y + this.z * this.z;
|
|
581
677
|
}
|
|
582
678
|
length() {
|
|
583
|
-
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z
|
|
679
|
+
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
|
|
584
680
|
}
|
|
585
681
|
manhattanLength() {
|
|
586
|
-
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
|
|
682
|
+
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
|
|
587
683
|
}
|
|
588
684
|
normalize() {
|
|
589
685
|
return this.divideScalar(this.length() || 1);
|
|
@@ -592,243 +688,229 @@ class d {
|
|
|
592
688
|
return this.normalize().multiplyScalar(t2);
|
|
593
689
|
}
|
|
594
690
|
lerp(t2, s2) {
|
|
595
|
-
return this.x += (t2.x - this.x) * s2, this.y += (t2.y - this.y) * s2, this.z += (t2.z - this.z) * s2, this
|
|
691
|
+
return this.x += (t2.x - this.x) * s2, this.y += (t2.y - this.y) * s2, this.z += (t2.z - this.z) * s2, this;
|
|
596
692
|
}
|
|
597
693
|
lerpVectors(t2, s2, i2) {
|
|
598
|
-
return this.x = t2.x + (s2.x - t2.x) * i2, this.y = t2.y + (s2.y - t2.y) * i2, this.z = t2.z + (s2.z - t2.z) * i2, this
|
|
599
|
-
}
|
|
600
|
-
equals(t2) {
|
|
601
|
-
return t2.x === this.x && t2.y === this.y && t2.z === this.z && t2.w === this.w;
|
|
694
|
+
return this.x = t2.x + (s2.x - t2.x) * i2, this.y = t2.y + (s2.y - t2.y) * i2, this.z = t2.z + (s2.z - t2.z) * i2, this;
|
|
602
695
|
}
|
|
603
|
-
|
|
604
|
-
return this.
|
|
696
|
+
cross(t2) {
|
|
697
|
+
return this.crossVectors(this, t2);
|
|
605
698
|
}
|
|
606
|
-
|
|
607
|
-
|
|
699
|
+
crossVectors(t2, s2) {
|
|
700
|
+
const i2 = t2.x, e2 = t2.y, a2 = t2.z, n2 = s2.x, r2 = s2.y, h2 = s2.z;
|
|
701
|
+
return this.x = e2 * h2 - a2 * r2, this.y = a2 * n2 - i2 * h2, this.z = i2 * r2 - e2 * n2, this;
|
|
608
702
|
}
|
|
609
|
-
|
|
610
|
-
|
|
703
|
+
projectOnVector(t2) {
|
|
704
|
+
const s2 = t2.lengthSq();
|
|
705
|
+
if (0 === s2)
|
|
706
|
+
return this.set(0, 0, 0);
|
|
707
|
+
const i2 = t2.dot(this) / s2;
|
|
708
|
+
return this.copy(t2).multiplyScalar(i2);
|
|
611
709
|
}
|
|
612
|
-
|
|
613
|
-
return
|
|
710
|
+
projectOnPlane(t2) {
|
|
711
|
+
return d.copy(this).projectOnVector(t2), this.sub(d);
|
|
614
712
|
}
|
|
615
|
-
|
|
616
|
-
|
|
713
|
+
reflect(t2) {
|
|
714
|
+
return this.sub(d.copy(t2).multiplyScalar(2 * this.dot(t2)));
|
|
617
715
|
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
716
|
+
angleTo(t2) {
|
|
717
|
+
const s2 = Math.sqrt(this.lengthSq() * t2.lengthSq());
|
|
718
|
+
if (0 === s2)
|
|
719
|
+
return Math.PI / 2;
|
|
720
|
+
const i2 = this.dot(t2) / s2;
|
|
721
|
+
return Math.acos(n(i2, -1, 1));
|
|
622
722
|
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
const u2 = a2[n2 + 0], d2 = a2[n2 + 1], m2 = a2[n2 + 2], _2 = a2[n2 + 3];
|
|
626
|
-
if (0 === r2)
|
|
627
|
-
return t2[s2 + 0] = h2, t2[s2 + 1] = o2, t2[s2 + 2] = c2, void (t2[s2 + 3] = l2);
|
|
628
|
-
if (1 === r2)
|
|
629
|
-
return t2[s2 + 0] = u2, t2[s2 + 1] = d2, t2[s2 + 2] = m2, void (t2[s2 + 3] = _2);
|
|
630
|
-
if (l2 !== _2 || h2 !== u2 || o2 !== d2 || c2 !== m2) {
|
|
631
|
-
let t3 = 1 - r2;
|
|
632
|
-
const s3 = h2 * u2 + o2 * d2 + c2 * m2 + l2 * _2, i3 = s3 >= 0 ? 1 : -1, e3 = 1 - s3 * s3;
|
|
633
|
-
if (e3 > Number.EPSILON) {
|
|
634
|
-
const a4 = Math.sqrt(e3), n3 = Math.atan2(a4, s3 * i3);
|
|
635
|
-
t3 = Math.sin(t3 * n3) / a4, r2 = Math.sin(r2 * n3) / a4;
|
|
636
|
-
}
|
|
637
|
-
const a3 = r2 * i3;
|
|
638
|
-
if (h2 = h2 * t3 + u2 * a3, o2 = o2 * t3 + d2 * a3, c2 = c2 * t3 + m2 * a3, l2 = l2 * t3 + _2 * a3, t3 === 1 - r2) {
|
|
639
|
-
const t4 = 1 / Math.sqrt(h2 * h2 + o2 * o2 + c2 * c2 + l2 * l2);
|
|
640
|
-
h2 *= t4, o2 *= t4, c2 *= t4, l2 *= t4;
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
t2[s2] = h2, t2[s2 + 1] = o2, t2[s2 + 2] = c2, t2[s2 + 3] = l2;
|
|
723
|
+
distanceTo(t2) {
|
|
724
|
+
return Math.sqrt(this.distanceToSquared(t2));
|
|
644
725
|
}
|
|
645
|
-
|
|
646
|
-
const
|
|
647
|
-
return
|
|
726
|
+
distanceToSquared(t2) {
|
|
727
|
+
const s2 = this.x - t2.x, i2 = this.y - t2.y, e2 = this.z - t2.z;
|
|
728
|
+
return s2 * s2 + i2 * i2 + e2 * e2;
|
|
648
729
|
}
|
|
649
|
-
|
|
650
|
-
return this.
|
|
730
|
+
manhattanDistanceTo(t2) {
|
|
731
|
+
return Math.abs(this.x - t2.x) + Math.abs(this.y - t2.y) + Math.abs(this.z - t2.z);
|
|
651
732
|
}
|
|
652
|
-
|
|
653
|
-
this.
|
|
733
|
+
setFromSpherical(t2) {
|
|
734
|
+
return this.setFromSphericalCoords(t2.radius, t2.phi, t2.theta);
|
|
654
735
|
}
|
|
655
|
-
|
|
656
|
-
|
|
736
|
+
setFromSphericalCoords(t2, s2, i2) {
|
|
737
|
+
const e2 = Math.sin(s2) * t2;
|
|
738
|
+
return this.x = e2 * Math.sin(i2), this.y = Math.cos(s2) * t2, this.z = e2 * Math.cos(i2), this;
|
|
657
739
|
}
|
|
658
|
-
|
|
659
|
-
this.
|
|
740
|
+
setFromCylindrical(t2) {
|
|
741
|
+
return this.setFromCylindricalCoords(t2.radius, t2.theta, t2.y);
|
|
660
742
|
}
|
|
661
|
-
|
|
662
|
-
return this.
|
|
743
|
+
setFromCylindricalCoords(t2, s2, i2) {
|
|
744
|
+
return this.x = t2 * Math.sin(s2), this.y = i2, this.z = t2 * Math.cos(s2), this;
|
|
663
745
|
}
|
|
664
|
-
|
|
665
|
-
|
|
746
|
+
setFromMatrixPosition(t2) {
|
|
747
|
+
const s2 = t2.elements;
|
|
748
|
+
return this.x = s2[12], this.y = s2[13], this.z = s2[14], this;
|
|
666
749
|
}
|
|
667
|
-
|
|
668
|
-
|
|
750
|
+
setFromMatrixScale(t2) {
|
|
751
|
+
const s2 = this.setFromMatrixColumn(t2, 0).length(), i2 = this.setFromMatrixColumn(t2, 1).length(), e2 = this.setFromMatrixColumn(t2, 2).length();
|
|
752
|
+
return this.x = s2, this.y = i2, this.z = e2, this;
|
|
669
753
|
}
|
|
670
|
-
|
|
671
|
-
this.
|
|
754
|
+
setFromMatrixColumn(t2, s2) {
|
|
755
|
+
return this.fromArray(t2.elements, 4 * s2);
|
|
672
756
|
}
|
|
673
|
-
|
|
674
|
-
return this.
|
|
757
|
+
setFromMatrix3Column(t2, s2) {
|
|
758
|
+
return this.fromArray(t2.elements, 3 * s2);
|
|
675
759
|
}
|
|
676
|
-
|
|
677
|
-
return
|
|
760
|
+
setFromEuler(t2) {
|
|
761
|
+
return this.x = t2._x, this.y = t2._y, this.z = t2._z, this;
|
|
678
762
|
}
|
|
679
|
-
|
|
680
|
-
return this.
|
|
763
|
+
setFromColor(t2) {
|
|
764
|
+
return this.x = t2.r, this.y = t2.g, this.z = t2.b, this;
|
|
681
765
|
}
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
switch (n2) {
|
|
685
|
-
case "XYZ":
|
|
686
|
-
this._x = u2 * c2 * l2 + o2 * d2 * m2, this._y = o2 * d2 * l2 - u2 * c2 * m2, this._z = o2 * c2 * m2 + u2 * d2 * l2, this._w = o2 * c2 * l2 - u2 * d2 * m2;
|
|
687
|
-
break;
|
|
688
|
-
case "YXZ":
|
|
689
|
-
this._x = u2 * c2 * l2 + o2 * d2 * m2, this._y = o2 * d2 * l2 - u2 * c2 * m2, this._z = o2 * c2 * m2 - u2 * d2 * l2, this._w = o2 * c2 * l2 + u2 * d2 * m2;
|
|
690
|
-
break;
|
|
691
|
-
case "ZXY":
|
|
692
|
-
this._x = u2 * c2 * l2 - o2 * d2 * m2, this._y = o2 * d2 * l2 + u2 * c2 * m2, this._z = o2 * c2 * m2 + u2 * d2 * l2, this._w = o2 * c2 * l2 - u2 * d2 * m2;
|
|
693
|
-
break;
|
|
694
|
-
case "ZYX":
|
|
695
|
-
this._x = u2 * c2 * l2 - o2 * d2 * m2, this._y = o2 * d2 * l2 + u2 * c2 * m2, this._z = o2 * c2 * m2 - u2 * d2 * l2, this._w = o2 * c2 * l2 + u2 * d2 * m2;
|
|
696
|
-
break;
|
|
697
|
-
case "YZX":
|
|
698
|
-
this._x = u2 * c2 * l2 + o2 * d2 * m2, this._y = o2 * d2 * l2 + u2 * c2 * m2, this._z = o2 * c2 * m2 - u2 * d2 * l2, this._w = o2 * c2 * l2 - u2 * d2 * m2;
|
|
699
|
-
break;
|
|
700
|
-
case "XZY":
|
|
701
|
-
this._x = u2 * c2 * l2 - o2 * d2 * m2, this._y = o2 * d2 * l2 - u2 * c2 * m2, this._z = o2 * c2 * m2 + u2 * d2 * l2, this._w = o2 * c2 * l2 + u2 * d2 * m2;
|
|
702
|
-
break;
|
|
703
|
-
default:
|
|
704
|
-
console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: " + n2);
|
|
705
|
-
}
|
|
706
|
-
return false !== s2 && this._onChangeCallback(), this;
|
|
766
|
+
equals(t2) {
|
|
767
|
+
return t2.x === this.x && t2.y === this.y && t2.z === this.z;
|
|
707
768
|
}
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
return this._x = t2.x * e2, this._y = t2.y * e2, this._z = t2.z * e2, this._w = Math.cos(i2), this._onChangeCallback(), this;
|
|
769
|
+
fromArray(t2, s2 = 0) {
|
|
770
|
+
return this.x = t2[s2], this.y = t2[s2 + 1], this.z = t2[s2 + 2], this;
|
|
711
771
|
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
if (u2 > 0) {
|
|
715
|
-
const t3 = 0.5 / Math.sqrt(u2 + 1);
|
|
716
|
-
this._w = 0.25 / t3, this._x = (c2 - h2) * t3, this._y = (a2 - o2) * t3, this._z = (n2 - e2) * t3;
|
|
717
|
-
} else if (i2 > r2 && i2 > l2) {
|
|
718
|
-
const t3 = 2 * Math.sqrt(1 + i2 - r2 - l2);
|
|
719
|
-
this._w = (c2 - h2) / t3, this._x = 0.25 * t3, this._y = (e2 + n2) / t3, this._z = (a2 + o2) / t3;
|
|
720
|
-
} else if (r2 > l2) {
|
|
721
|
-
const t3 = 2 * Math.sqrt(1 + r2 - i2 - l2);
|
|
722
|
-
this._w = (a2 - o2) / t3, this._x = (e2 + n2) / t3, this._y = 0.25 * t3, this._z = (h2 + c2) / t3;
|
|
723
|
-
} else {
|
|
724
|
-
const t3 = 2 * Math.sqrt(1 + l2 - i2 - r2);
|
|
725
|
-
this._w = (n2 - e2) / t3, this._x = (a2 + o2) / t3, this._y = (h2 + c2) / t3, this._z = 0.25 * t3;
|
|
726
|
-
}
|
|
727
|
-
return this._onChangeCallback(), this;
|
|
772
|
+
toArray(t2 = [], s2 = 0) {
|
|
773
|
+
return t2[s2] = this.x, t2[s2 + 1] = this.y, t2[s2 + 2] = this.z, t2;
|
|
728
774
|
}
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
return i2 < Number.EPSILON ? (i2 = 0, Math.abs(t2.x) > Math.abs(t2.z) ? (this._x = -t2.y, this._y = t2.x, this._z = 0, this._w = i2) : (this._x = 0, this._y = -t2.z, this._z = t2.y, this._w = i2)) : (this._x = t2.y * s2.z - t2.z * s2.y, this._y = t2.z * s2.x - t2.x * s2.z, this._z = t2.x * s2.y - t2.y * s2.x, this._w = i2), this.normalize();
|
|
775
|
+
fromBufferAttribute(t2, s2) {
|
|
776
|
+
return this.x = t2.getX(s2), this.y = t2.getY(s2), this.z = t2.getZ(s2), this;
|
|
732
777
|
}
|
|
733
|
-
|
|
734
|
-
return
|
|
778
|
+
random() {
|
|
779
|
+
return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;
|
|
735
780
|
}
|
|
736
|
-
|
|
737
|
-
const i2 =
|
|
738
|
-
|
|
739
|
-
return this;
|
|
740
|
-
const e2 = Math.min(1, s2 / i2);
|
|
741
|
-
return this.slerp(t2, e2), this;
|
|
781
|
+
randomDirection() {
|
|
782
|
+
const t2 = Math.random() * Math.PI * 2, s2 = 2 * Math.random() - 1, i2 = Math.sqrt(1 - s2 * s2);
|
|
783
|
+
return this.x = i2 * Math.cos(t2), this.y = s2, this.z = i2 * Math.sin(t2), this;
|
|
742
784
|
}
|
|
743
|
-
|
|
744
|
-
|
|
785
|
+
*[Symbol.iterator]() {
|
|
786
|
+
yield this.x, yield this.y, yield this.z;
|
|
745
787
|
}
|
|
746
|
-
|
|
747
|
-
|
|
788
|
+
}
|
|
789
|
+
const d = new u(), m = new l();
|
|
790
|
+
class _ {
|
|
791
|
+
constructor(t2, s2, i2, e2, a2, n2, r2, h2, o2) {
|
|
792
|
+
_.prototype.isMatrix3 = true, this.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1], void 0 !== t2 && this.set(t2, s2, i2, e2, a2, n2, r2, h2, o2);
|
|
748
793
|
}
|
|
749
|
-
|
|
750
|
-
|
|
794
|
+
set(t2, s2, i2, e2, a2, n2, r2, h2, o2) {
|
|
795
|
+
const c2 = this.elements;
|
|
796
|
+
return c2[0] = t2, c2[1] = e2, c2[2] = r2, c2[3] = s2, c2[4] = a2, c2[5] = h2, c2[6] = i2, c2[7] = n2, c2[8] = o2, this;
|
|
751
797
|
}
|
|
752
|
-
|
|
753
|
-
return this.
|
|
798
|
+
identity() {
|
|
799
|
+
return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;
|
|
754
800
|
}
|
|
755
|
-
|
|
756
|
-
|
|
801
|
+
copy(t2) {
|
|
802
|
+
const s2 = this.elements, i2 = t2.elements;
|
|
803
|
+
return s2[0] = i2[0], s2[1] = i2[1], s2[2] = i2[2], s2[3] = i2[3], s2[4] = i2[4], s2[5] = i2[5], s2[6] = i2[6], s2[7] = i2[7], s2[8] = i2[8], this;
|
|
757
804
|
}
|
|
758
|
-
|
|
759
|
-
return
|
|
805
|
+
extractBasis(t2, s2, i2) {
|
|
806
|
+
return t2.setFromMatrix3Column(this, 0), s2.setFromMatrix3Column(this, 1), i2.setFromMatrix3Column(this, 2), this;
|
|
760
807
|
}
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
return
|
|
808
|
+
setFromMatrix4(t2) {
|
|
809
|
+
const s2 = t2.elements;
|
|
810
|
+
return this.set(s2[0], s2[4], s2[8], s2[1], s2[5], s2[9], s2[2], s2[6], s2[10]), this;
|
|
764
811
|
}
|
|
765
812
|
multiply(t2) {
|
|
766
|
-
return this.
|
|
813
|
+
return this.multiplyMatrices(this, t2);
|
|
767
814
|
}
|
|
768
815
|
premultiply(t2) {
|
|
769
|
-
return this.
|
|
816
|
+
return this.multiplyMatrices(t2, this);
|
|
770
817
|
}
|
|
771
|
-
|
|
772
|
-
const i2 = t2.
|
|
773
|
-
return
|
|
818
|
+
multiplyMatrices(t2, s2) {
|
|
819
|
+
const i2 = t2.elements, e2 = s2.elements, a2 = this.elements, n2 = i2[0], r2 = i2[3], h2 = i2[6], o2 = i2[1], c2 = i2[4], l2 = i2[7], u2 = i2[2], d2 = i2[5], m2 = i2[8], _2 = e2[0], f2 = e2[3], y2 = e2[6], p2 = e2[1], g2 = e2[4], M2 = e2[7], x2 = e2[2], w2 = e2[5], S2 = e2[8];
|
|
820
|
+
return a2[0] = n2 * _2 + r2 * p2 + h2 * x2, a2[3] = n2 * f2 + r2 * g2 + h2 * w2, a2[6] = n2 * y2 + r2 * M2 + h2 * S2, a2[1] = o2 * _2 + c2 * p2 + l2 * x2, a2[4] = o2 * f2 + c2 * g2 + l2 * w2, a2[7] = o2 * y2 + c2 * M2 + l2 * S2, a2[2] = u2 * _2 + d2 * p2 + m2 * x2, a2[5] = u2 * f2 + d2 * g2 + m2 * w2, a2[8] = u2 * y2 + d2 * M2 + m2 * S2, this;
|
|
774
821
|
}
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
if (1 === s2)
|
|
779
|
-
return this.copy(t2);
|
|
780
|
-
const i2 = this._x, e2 = this._y, a2 = this._z, n2 = this._w;
|
|
781
|
-
let r2 = n2 * t2._w + i2 * t2._x + e2 * t2._y + a2 * t2._z;
|
|
782
|
-
if (r2 < 0 ? (this._w = -t2._w, this._x = -t2._x, this._y = -t2._y, this._z = -t2._z, r2 = -r2) : this.copy(t2), r2 >= 1)
|
|
783
|
-
return this._w = n2, this._x = i2, this._y = e2, this._z = a2, this;
|
|
784
|
-
const h2 = 1 - r2 * r2;
|
|
785
|
-
if (h2 <= Number.EPSILON) {
|
|
786
|
-
const t3 = 1 - s2;
|
|
787
|
-
return this._w = t3 * n2 + s2 * this._w, this._x = t3 * i2 + s2 * this._x, this._y = t3 * e2 + s2 * this._y, this._z = t3 * a2 + s2 * this._z, this.normalize(), this._onChangeCallback(), this;
|
|
788
|
-
}
|
|
789
|
-
const o2 = Math.sqrt(h2), c2 = Math.atan2(o2, r2), l2 = Math.sin((1 - s2) * c2) / o2, u2 = Math.sin(s2 * c2) / o2;
|
|
790
|
-
return this._w = n2 * l2 + this._w * u2, this._x = i2 * l2 + this._x * u2, this._y = e2 * l2 + this._y * u2, this._z = a2 * l2 + this._z * u2, this._onChangeCallback(), this;
|
|
822
|
+
multiplyScalar(t2) {
|
|
823
|
+
const s2 = this.elements;
|
|
824
|
+
return s2[0] *= t2, s2[3] *= t2, s2[6] *= t2, s2[1] *= t2, s2[4] *= t2, s2[7] *= t2, s2[2] *= t2, s2[5] *= t2, s2[8] *= t2, this;
|
|
791
825
|
}
|
|
792
|
-
|
|
793
|
-
|
|
826
|
+
determinant() {
|
|
827
|
+
const t2 = this.elements, s2 = t2[0], i2 = t2[1], e2 = t2[2], a2 = t2[3], n2 = t2[4], r2 = t2[5], h2 = t2[6], o2 = t2[7], c2 = t2[8];
|
|
828
|
+
return s2 * n2 * c2 - s2 * r2 * o2 - i2 * a2 * c2 + i2 * r2 * h2 + e2 * a2 * o2 - e2 * n2 * h2;
|
|
794
829
|
}
|
|
795
|
-
|
|
796
|
-
const t2 =
|
|
797
|
-
|
|
830
|
+
invert() {
|
|
831
|
+
const t2 = this.elements, s2 = t2[0], i2 = t2[1], e2 = t2[2], a2 = t2[3], n2 = t2[4], r2 = t2[5], h2 = t2[6], o2 = t2[7], c2 = t2[8], l2 = c2 * n2 - r2 * o2, u2 = r2 * h2 - c2 * a2, d2 = o2 * a2 - n2 * h2, m2 = s2 * l2 + i2 * u2 + e2 * d2;
|
|
832
|
+
if (0 === m2)
|
|
833
|
+
return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
834
|
+
const _2 = 1 / m2;
|
|
835
|
+
return t2[0] = l2 * _2, t2[1] = (e2 * o2 - c2 * i2) * _2, t2[2] = (r2 * i2 - e2 * n2) * _2, t2[3] = u2 * _2, t2[4] = (c2 * s2 - e2 * h2) * _2, t2[5] = (e2 * a2 - r2 * s2) * _2, t2[6] = d2 * _2, t2[7] = (i2 * h2 - o2 * s2) * _2, t2[8] = (n2 * s2 - i2 * a2) * _2, this;
|
|
836
|
+
}
|
|
837
|
+
transpose() {
|
|
838
|
+
let t2;
|
|
839
|
+
const s2 = this.elements;
|
|
840
|
+
return t2 = s2[1], s2[1] = s2[3], s2[3] = t2, t2 = s2[2], s2[2] = s2[6], s2[6] = t2, t2 = s2[5], s2[5] = s2[7], s2[7] = t2, this;
|
|
841
|
+
}
|
|
842
|
+
getNormalMatrix(t2) {
|
|
843
|
+
return this.setFromMatrix4(t2).invert().transpose();
|
|
844
|
+
}
|
|
845
|
+
transposeIntoArray(t2) {
|
|
846
|
+
const s2 = this.elements;
|
|
847
|
+
return t2[0] = s2[0], t2[1] = s2[3], t2[2] = s2[6], t2[3] = s2[1], t2[4] = s2[4], t2[5] = s2[7], t2[6] = s2[2], t2[7] = s2[5], t2[8] = s2[8], this;
|
|
848
|
+
}
|
|
849
|
+
setUvTransform(t2, s2, i2, e2, a2, n2, r2) {
|
|
850
|
+
const h2 = Math.cos(a2), o2 = Math.sin(a2);
|
|
851
|
+
return this.set(i2 * h2, i2 * o2, -i2 * (h2 * n2 + o2 * r2) + n2 + t2, -e2 * o2, e2 * h2, -e2 * (-o2 * n2 + h2 * r2) + r2 + s2, 0, 0, 1), this;
|
|
852
|
+
}
|
|
853
|
+
scale(t2, s2) {
|
|
854
|
+
return this.premultiply(f.makeScale(t2, s2)), this;
|
|
855
|
+
}
|
|
856
|
+
rotate(t2) {
|
|
857
|
+
return this.premultiply(f.makeRotation(-t2)), this;
|
|
858
|
+
}
|
|
859
|
+
translate(t2, s2) {
|
|
860
|
+
return this.premultiply(f.makeTranslation(t2, s2)), this;
|
|
861
|
+
}
|
|
862
|
+
makeTranslation(t2, s2) {
|
|
863
|
+
return t2.isVector2 ? this.set(1, 0, t2.x, 0, 1, t2.y, 0, 0, 1) : this.set(1, 0, t2, 0, 1, s2, 0, 0, 1), this;
|
|
864
|
+
}
|
|
865
|
+
makeRotation(t2) {
|
|
866
|
+
const s2 = Math.cos(t2), i2 = Math.sin(t2);
|
|
867
|
+
return this.set(s2, -i2, 0, i2, s2, 0, 0, 0, 1), this;
|
|
868
|
+
}
|
|
869
|
+
makeScale(t2, s2) {
|
|
870
|
+
return this.set(t2, 0, 0, 0, s2, 0, 0, 0, 1), this;
|
|
798
871
|
}
|
|
799
872
|
equals(t2) {
|
|
800
|
-
|
|
873
|
+
const s2 = this.elements, i2 = t2.elements;
|
|
874
|
+
for (let t3 = 0; t3 < 9; t3++)
|
|
875
|
+
if (s2[t3] !== i2[t3])
|
|
876
|
+
return false;
|
|
877
|
+
return true;
|
|
801
878
|
}
|
|
802
879
|
fromArray(t2, s2 = 0) {
|
|
803
|
-
|
|
880
|
+
for (let i2 = 0; i2 < 9; i2++)
|
|
881
|
+
this.elements[i2] = t2[i2 + s2];
|
|
882
|
+
return this;
|
|
804
883
|
}
|
|
805
884
|
toArray(t2 = [], s2 = 0) {
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
fromBufferAttribute(t2, s2) {
|
|
809
|
-
return this._x = t2.getX(s2), this._y = t2.getY(s2), this._z = t2.getZ(s2), this._w = t2.getW(s2), this;
|
|
885
|
+
const i2 = this.elements;
|
|
886
|
+
return t2[s2] = i2[0], t2[s2 + 1] = i2[1], t2[s2 + 2] = i2[2], t2[s2 + 3] = i2[3], t2[s2 + 4] = i2[4], t2[s2 + 5] = i2[5], t2[s2 + 6] = i2[6], t2[s2 + 7] = i2[7], t2[s2 + 8] = i2[8], t2;
|
|
810
887
|
}
|
|
811
|
-
|
|
812
|
-
return this.
|
|
888
|
+
clone() {
|
|
889
|
+
return new this.constructor().fromArray(this.elements);
|
|
813
890
|
}
|
|
814
|
-
|
|
815
|
-
|
|
891
|
+
}
|
|
892
|
+
const f = new _();
|
|
893
|
+
class y {
|
|
894
|
+
constructor(t2 = 0, s2 = 0, i2 = 0, e2 = 1) {
|
|
895
|
+
y.prototype.isVector4 = true, this.x = t2, this.y = s2, this.z = i2, this.w = e2;
|
|
816
896
|
}
|
|
817
|
-
|
|
897
|
+
get width() {
|
|
898
|
+
return this.z;
|
|
818
899
|
}
|
|
819
|
-
|
|
820
|
-
|
|
900
|
+
set width(t2) {
|
|
901
|
+
this.z = t2;
|
|
821
902
|
}
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
constructor(t2 = 0, s2 = 0, i2 = 0) {
|
|
825
|
-
_.prototype.isVector3 = true, this.x = t2, this.y = s2, this.z = i2;
|
|
903
|
+
get height() {
|
|
904
|
+
return this.w;
|
|
826
905
|
}
|
|
827
|
-
set(t2
|
|
828
|
-
|
|
906
|
+
set height(t2) {
|
|
907
|
+
this.w = t2;
|
|
908
|
+
}
|
|
909
|
+
set(t2, s2, i2, e2) {
|
|
910
|
+
return this.x = t2, this.y = s2, this.z = i2, this.w = e2, this;
|
|
829
911
|
}
|
|
830
912
|
setScalar(t2) {
|
|
831
|
-
return this.x = t2, this.y = t2, this.z = t2, this;
|
|
913
|
+
return this.x = t2, this.y = t2, this.z = t2, this.w = t2, this;
|
|
832
914
|
}
|
|
833
915
|
setX(t2) {
|
|
834
916
|
return this.x = t2, this;
|
|
@@ -839,6 +921,9 @@ class _ {
|
|
|
839
921
|
setZ(t2) {
|
|
840
922
|
return this.z = t2, this;
|
|
841
923
|
}
|
|
924
|
+
setW(t2) {
|
|
925
|
+
return this.w = t2, this;
|
|
926
|
+
}
|
|
842
927
|
setComponent(t2, s2) {
|
|
843
928
|
switch (t2) {
|
|
844
929
|
case 0:
|
|
@@ -850,6 +935,9 @@ class _ {
|
|
|
850
935
|
case 2:
|
|
851
936
|
this.z = s2;
|
|
852
937
|
break;
|
|
938
|
+
case 3:
|
|
939
|
+
this.w = s2;
|
|
940
|
+
break;
|
|
853
941
|
default:
|
|
854
942
|
throw new Error("index is out of range: " + t2);
|
|
855
943
|
}
|
|
@@ -863,125 +951,119 @@ class _ {
|
|
|
863
951
|
return this.y;
|
|
864
952
|
case 2:
|
|
865
953
|
return this.z;
|
|
954
|
+
case 3:
|
|
955
|
+
return this.w;
|
|
866
956
|
default:
|
|
867
957
|
throw new Error("index is out of range: " + t2);
|
|
868
958
|
}
|
|
869
959
|
}
|
|
870
960
|
clone() {
|
|
871
|
-
return new this.constructor(this.x, this.y, this.z);
|
|
961
|
+
return new this.constructor(this.x, this.y, this.z, this.w);
|
|
872
962
|
}
|
|
873
963
|
copy(t2) {
|
|
874
|
-
return this.x = t2.x, this.y = t2.y, this.z = t2.z, this;
|
|
964
|
+
return this.x = t2.x, this.y = t2.y, this.z = t2.z, this.w = void 0 !== t2.w ? t2.w : 1, this;
|
|
875
965
|
}
|
|
876
966
|
add(t2) {
|
|
877
|
-
return this.x += t2.x, this.y += t2.y, this.z += t2.z, this;
|
|
967
|
+
return this.x += t2.x, this.y += t2.y, this.z += t2.z, this.w += t2.w, this;
|
|
878
968
|
}
|
|
879
969
|
addScalar(t2) {
|
|
880
|
-
return this.x += t2, this.y += t2, this.z += t2, this;
|
|
970
|
+
return this.x += t2, this.y += t2, this.z += t2, this.w += t2, this;
|
|
881
971
|
}
|
|
882
972
|
addVectors(t2, s2) {
|
|
883
|
-
return this.x = t2.x + s2.x, this.y = t2.y + s2.y, this.z = t2.z + s2.z, this;
|
|
973
|
+
return this.x = t2.x + s2.x, this.y = t2.y + s2.y, this.z = t2.z + s2.z, this.w = t2.w + s2.w, this;
|
|
884
974
|
}
|
|
885
975
|
addScaledVector(t2, s2) {
|
|
886
|
-
return this.x += t2.x * s2, this.y += t2.y * s2, this.z += t2.z * s2, this;
|
|
976
|
+
return this.x += t2.x * s2, this.y += t2.y * s2, this.z += t2.z * s2, this.w += t2.w * s2, this;
|
|
887
977
|
}
|
|
888
978
|
sub(t2) {
|
|
889
|
-
return this.x -= t2.x, this.y -= t2.y, this.z -= t2.z, this;
|
|
979
|
+
return this.x -= t2.x, this.y -= t2.y, this.z -= t2.z, this.w -= t2.w, this;
|
|
890
980
|
}
|
|
891
981
|
subScalar(t2) {
|
|
892
|
-
return this.x -= t2, this.y -= t2, this.z -= t2, this;
|
|
982
|
+
return this.x -= t2, this.y -= t2, this.z -= t2, this.w -= t2, this;
|
|
893
983
|
}
|
|
894
984
|
subVectors(t2, s2) {
|
|
895
|
-
return this.x = t2.x - s2.x, this.y = t2.y - s2.y, this.z = t2.z - s2.z, this;
|
|
985
|
+
return this.x = t2.x - s2.x, this.y = t2.y - s2.y, this.z = t2.z - s2.z, this.w = t2.w - s2.w, this;
|
|
896
986
|
}
|
|
897
987
|
multiply(t2) {
|
|
898
|
-
return this.x *= t2.x, this.y *= t2.y, this.z *= t2.z, this;
|
|
988
|
+
return this.x *= t2.x, this.y *= t2.y, this.z *= t2.z, this.w *= t2.w, this;
|
|
899
989
|
}
|
|
900
990
|
multiplyScalar(t2) {
|
|
901
|
-
return this.x *= t2, this.y *= t2, this.z *= t2, this;
|
|
902
|
-
}
|
|
903
|
-
multiplyVectors(t2, s2) {
|
|
904
|
-
return this.x = t2.x * s2.x, this.y = t2.y * s2.y, this.z = t2.z * s2.z, this;
|
|
905
|
-
}
|
|
906
|
-
applyEuler(t2) {
|
|
907
|
-
return this.applyQuaternion(y.setFromEuler(t2));
|
|
908
|
-
}
|
|
909
|
-
applyAxisAngle(t2, s2) {
|
|
910
|
-
return this.applyQuaternion(y.setFromAxisAngle(t2, s2));
|
|
911
|
-
}
|
|
912
|
-
applyMatrix3(t2) {
|
|
913
|
-
const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.elements;
|
|
914
|
-
return this.x = a2[0] * s2 + a2[3] * i2 + a2[6] * e2, this.y = a2[1] * s2 + a2[4] * i2 + a2[7] * e2, this.z = a2[2] * s2 + a2[5] * i2 + a2[8] * e2, this;
|
|
915
|
-
}
|
|
916
|
-
applyNormalMatrix(t2) {
|
|
917
|
-
return this.applyMatrix3(t2).normalize();
|
|
991
|
+
return this.x *= t2, this.y *= t2, this.z *= t2, this.w *= t2, this;
|
|
918
992
|
}
|
|
919
993
|
applyMatrix4(t2) {
|
|
920
|
-
const s2 = this.x, i2 = this.y, e2 = this.z, a2 =
|
|
921
|
-
return this.x =
|
|
922
|
-
}
|
|
923
|
-
applyQuaternion(t2) {
|
|
924
|
-
const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.x, n2 = t2.y, r2 = t2.z, h2 = t2.w, o2 = 2 * (n2 * e2 - r2 * i2), c2 = 2 * (r2 * s2 - a2 * e2), l2 = 2 * (a2 * i2 - n2 * s2);
|
|
925
|
-
return this.x = s2 + h2 * o2 + n2 * l2 - r2 * c2, this.y = i2 + h2 * c2 + r2 * o2 - a2 * l2, this.z = e2 + h2 * l2 + a2 * c2 - n2 * o2, this;
|
|
926
|
-
}
|
|
927
|
-
project(t2) {
|
|
928
|
-
return this.applyMatrix4(t2.matrixWorldInverse).applyMatrix4(t2.projectionMatrix);
|
|
929
|
-
}
|
|
930
|
-
unproject(t2) {
|
|
931
|
-
return this.applyMatrix4(t2.projectionMatrixInverse).applyMatrix4(t2.matrixWorld);
|
|
932
|
-
}
|
|
933
|
-
transformDirection(t2) {
|
|
934
|
-
const s2 = this.x, i2 = this.y, e2 = this.z, a2 = t2.elements;
|
|
935
|
-
return this.x = a2[0] * s2 + a2[4] * i2 + a2[8] * e2, this.y = a2[1] * s2 + a2[5] * i2 + a2[9] * e2, this.z = a2[2] * s2 + a2[6] * i2 + a2[10] * e2, this.normalize();
|
|
994
|
+
const s2 = this.x, i2 = this.y, e2 = this.z, a2 = this.w, n2 = t2.elements;
|
|
995
|
+
return this.x = n2[0] * s2 + n2[4] * i2 + n2[8] * e2 + n2[12] * a2, this.y = n2[1] * s2 + n2[5] * i2 + n2[9] * e2 + n2[13] * a2, this.z = n2[2] * s2 + n2[6] * i2 + n2[10] * e2 + n2[14] * a2, this.w = n2[3] * s2 + n2[7] * i2 + n2[11] * e2 + n2[15] * a2, this;
|
|
936
996
|
}
|
|
937
997
|
divide(t2) {
|
|
938
|
-
return this.x /= t2.x, this.y /= t2.y, this.z /= t2.z, this;
|
|
998
|
+
return this.x /= t2.x, this.y /= t2.y, this.z /= t2.z, this.w /= t2.w, this;
|
|
939
999
|
}
|
|
940
1000
|
divideScalar(t2) {
|
|
941
1001
|
return this.multiplyScalar(1 / t2);
|
|
942
1002
|
}
|
|
1003
|
+
setAxisAngleFromQuaternion(t2) {
|
|
1004
|
+
this.w = 2 * Math.acos(t2.w);
|
|
1005
|
+
const s2 = Math.sqrt(1 - t2.w * t2.w);
|
|
1006
|
+
return s2 < 1e-4 ? (this.x = 1, this.y = 0, this.z = 0) : (this.x = t2.x / s2, this.y = t2.y / s2, this.z = t2.z / s2), this;
|
|
1007
|
+
}
|
|
1008
|
+
setAxisAngleFromRotationMatrix(t2) {
|
|
1009
|
+
let s2, i2, e2, a2;
|
|
1010
|
+
const n2 = 0.01, r2 = 0.1, h2 = t2.elements, o2 = h2[0], c2 = h2[4], l2 = h2[8], u2 = h2[1], d2 = h2[5], m2 = h2[9], _2 = h2[2], f2 = h2[6], y2 = h2[10];
|
|
1011
|
+
if (Math.abs(c2 - u2) < n2 && Math.abs(l2 - _2) < n2 && Math.abs(m2 - f2) < n2) {
|
|
1012
|
+
if (Math.abs(c2 + u2) < r2 && Math.abs(l2 + _2) < r2 && Math.abs(m2 + f2) < r2 && Math.abs(o2 + d2 + y2 - 3) < r2)
|
|
1013
|
+
return this.set(1, 0, 0, 0), this;
|
|
1014
|
+
s2 = Math.PI;
|
|
1015
|
+
const t3 = (o2 + 1) / 2, h3 = (d2 + 1) / 2, p3 = (y2 + 1) / 2, g2 = (c2 + u2) / 4, M2 = (l2 + _2) / 4, x2 = (m2 + f2) / 4;
|
|
1016
|
+
return t3 > h3 && t3 > p3 ? t3 < n2 ? (i2 = 0, e2 = 0.707106781, a2 = 0.707106781) : (i2 = Math.sqrt(t3), e2 = g2 / i2, a2 = M2 / i2) : h3 > p3 ? h3 < n2 ? (i2 = 0.707106781, e2 = 0, a2 = 0.707106781) : (e2 = Math.sqrt(h3), i2 = g2 / e2, a2 = x2 / e2) : p3 < n2 ? (i2 = 0.707106781, e2 = 0.707106781, a2 = 0) : (a2 = Math.sqrt(p3), i2 = M2 / a2, e2 = x2 / a2), this.set(i2, e2, a2, s2), this;
|
|
1017
|
+
}
|
|
1018
|
+
let p2 = Math.sqrt((f2 - m2) * (f2 - m2) + (l2 - _2) * (l2 - _2) + (u2 - c2) * (u2 - c2));
|
|
1019
|
+
return Math.abs(p2) < 1e-3 && (p2 = 1), this.x = (f2 - m2) / p2, this.y = (l2 - _2) / p2, this.z = (u2 - c2) / p2, this.w = Math.acos((o2 + d2 + y2 - 1) / 2), this;
|
|
1020
|
+
}
|
|
1021
|
+
setFromMatrixPosition(t2) {
|
|
1022
|
+
const s2 = t2.elements;
|
|
1023
|
+
return this.x = s2[12], this.y = s2[13], this.z = s2[14], this.w = s2[15], this;
|
|
1024
|
+
}
|
|
943
1025
|
min(t2) {
|
|
944
|
-
return this.x = Math.min(this.x, t2.x), this.y = Math.min(this.y, t2.y), this.z = Math.min(this.z, t2.z), this;
|
|
1026
|
+
return this.x = Math.min(this.x, t2.x), this.y = Math.min(this.y, t2.y), this.z = Math.min(this.z, t2.z), this.w = Math.min(this.w, t2.w), this;
|
|
945
1027
|
}
|
|
946
1028
|
max(t2) {
|
|
947
|
-
return this.x = Math.max(this.x, t2.x), this.y = Math.max(this.y, t2.y), this.z = Math.max(this.z, t2.z), this;
|
|
1029
|
+
return this.x = Math.max(this.x, t2.x), this.y = Math.max(this.y, t2.y), this.z = Math.max(this.z, t2.z), this.w = Math.max(this.w, t2.w), this;
|
|
948
1030
|
}
|
|
949
1031
|
clamp(t2, s2) {
|
|
950
|
-
return this.x =
|
|
1032
|
+
return this.x = n(this.x, t2.x, s2.x), this.y = n(this.y, t2.y, s2.y), this.z = n(this.z, t2.z, s2.z), this.w = n(this.w, t2.w, s2.w), this;
|
|
951
1033
|
}
|
|
952
1034
|
clampScalar(t2, s2) {
|
|
953
|
-
return this.x =
|
|
1035
|
+
return this.x = n(this.x, t2, s2), this.y = n(this.y, t2, s2), this.z = n(this.z, t2, s2), this.w = n(this.w, t2, s2), this;
|
|
954
1036
|
}
|
|
955
1037
|
clampLength(t2, s2) {
|
|
956
1038
|
const i2 = this.length();
|
|
957
|
-
return this.divideScalar(i2 || 1).multiplyScalar(
|
|
1039
|
+
return this.divideScalar(i2 || 1).multiplyScalar(n(i2, t2, s2));
|
|
958
1040
|
}
|
|
959
1041
|
floor() {
|
|
960
|
-
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this;
|
|
1042
|
+
return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this.z = Math.floor(this.z), this.w = Math.floor(this.w), this;
|
|
961
1043
|
}
|
|
962
1044
|
ceil() {
|
|
963
|
-
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this;
|
|
1045
|
+
return this.x = Math.ceil(this.x), this.y = Math.ceil(this.y), this.z = Math.ceil(this.z), this.w = Math.ceil(this.w), this;
|
|
964
1046
|
}
|
|
965
1047
|
round() {
|
|
966
|
-
return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this;
|
|
1048
|
+
return this.x = Math.round(this.x), this.y = Math.round(this.y), this.z = Math.round(this.z), this.w = Math.round(this.w), this;
|
|
967
1049
|
}
|
|
968
1050
|
roundToZero() {
|
|
969
|
-
return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this;
|
|
1051
|
+
return this.x = Math.trunc(this.x), this.y = Math.trunc(this.y), this.z = Math.trunc(this.z), this.w = Math.trunc(this.w), this;
|
|
970
1052
|
}
|
|
971
1053
|
negate() {
|
|
972
|
-
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this;
|
|
1054
|
+
return this.x = -this.x, this.y = -this.y, this.z = -this.z, this.w = -this.w, this;
|
|
973
1055
|
}
|
|
974
1056
|
dot(t2) {
|
|
975
|
-
return this.x * t2.x + this.y * t2.y + this.z * t2.z;
|
|
1057
|
+
return this.x * t2.x + this.y * t2.y + this.z * t2.z + this.w * t2.w;
|
|
976
1058
|
}
|
|
977
1059
|
lengthSq() {
|
|
978
|
-
return this.x * this.x + this.y * this.y + this.z * this.z;
|
|
1060
|
+
return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
|
|
979
1061
|
}
|
|
980
1062
|
length() {
|
|
981
|
-
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);
|
|
1063
|
+
return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
|
|
982
1064
|
}
|
|
983
1065
|
manhattanLength() {
|
|
984
|
-
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);
|
|
1066
|
+
return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);
|
|
985
1067
|
}
|
|
986
1068
|
normalize() {
|
|
987
1069
|
return this.divideScalar(this.length() || 1);
|
|
@@ -990,107 +1072,32 @@ class _ {
|
|
|
990
1072
|
return this.normalize().multiplyScalar(t2);
|
|
991
1073
|
}
|
|
992
1074
|
lerp(t2, s2) {
|
|
993
|
-
return this.x += (t2.x - this.x) * s2, this.y += (t2.y - this.y) * s2, this.z += (t2.z - this.z) * s2, this;
|
|
1075
|
+
return this.x += (t2.x - this.x) * s2, this.y += (t2.y - this.y) * s2, this.z += (t2.z - this.z) * s2, this.w += (t2.w - this.w) * s2, this;
|
|
994
1076
|
}
|
|
995
1077
|
lerpVectors(t2, s2, i2) {
|
|
996
|
-
return this.x = t2.x + (s2.x - t2.x) * i2, this.y = t2.y + (s2.y - t2.y) * i2, this.z = t2.z + (s2.z - t2.z) * i2, this;
|
|
997
|
-
}
|
|
998
|
-
cross(t2) {
|
|
999
|
-
return this.crossVectors(this, t2);
|
|
1000
|
-
}
|
|
1001
|
-
crossVectors(t2, s2) {
|
|
1002
|
-
const i2 = t2.x, e2 = t2.y, a2 = t2.z, n2 = s2.x, r2 = s2.y, h2 = s2.z;
|
|
1003
|
-
return this.x = e2 * h2 - a2 * r2, this.y = a2 * n2 - i2 * h2, this.z = i2 * r2 - e2 * n2, this;
|
|
1004
|
-
}
|
|
1005
|
-
projectOnVector(t2) {
|
|
1006
|
-
const s2 = t2.lengthSq();
|
|
1007
|
-
if (0 === s2)
|
|
1008
|
-
return this.set(0, 0, 0);
|
|
1009
|
-
const i2 = t2.dot(this) / s2;
|
|
1010
|
-
return this.copy(t2).multiplyScalar(i2);
|
|
1011
|
-
}
|
|
1012
|
-
projectOnPlane(t2) {
|
|
1013
|
-
return f.copy(this).projectOnVector(t2), this.sub(f);
|
|
1014
|
-
}
|
|
1015
|
-
reflect(t2) {
|
|
1016
|
-
return this.sub(f.copy(t2).multiplyScalar(2 * this.dot(t2)));
|
|
1017
|
-
}
|
|
1018
|
-
angleTo(t2) {
|
|
1019
|
-
const s2 = Math.sqrt(this.lengthSq() * t2.lengthSq());
|
|
1020
|
-
if (0 === s2)
|
|
1021
|
-
return Math.PI / 2;
|
|
1022
|
-
const i2 = this.dot(t2) / s2;
|
|
1023
|
-
return Math.acos(n(i2, -1, 1));
|
|
1024
|
-
}
|
|
1025
|
-
distanceTo(t2) {
|
|
1026
|
-
return Math.sqrt(this.distanceToSquared(t2));
|
|
1027
|
-
}
|
|
1028
|
-
distanceToSquared(t2) {
|
|
1029
|
-
const s2 = this.x - t2.x, i2 = this.y - t2.y, e2 = this.z - t2.z;
|
|
1030
|
-
return s2 * s2 + i2 * i2 + e2 * e2;
|
|
1031
|
-
}
|
|
1032
|
-
manhattanDistanceTo(t2) {
|
|
1033
|
-
return Math.abs(this.x - t2.x) + Math.abs(this.y - t2.y) + Math.abs(this.z - t2.z);
|
|
1034
|
-
}
|
|
1035
|
-
setFromSpherical(t2) {
|
|
1036
|
-
return this.setFromSphericalCoords(t2.radius, t2.phi, t2.theta);
|
|
1037
|
-
}
|
|
1038
|
-
setFromSphericalCoords(t2, s2, i2) {
|
|
1039
|
-
const e2 = Math.sin(s2) * t2;
|
|
1040
|
-
return this.x = e2 * Math.sin(i2), this.y = Math.cos(s2) * t2, this.z = e2 * Math.cos(i2), this;
|
|
1041
|
-
}
|
|
1042
|
-
setFromCylindrical(t2) {
|
|
1043
|
-
return this.setFromCylindricalCoords(t2.radius, t2.theta, t2.y);
|
|
1044
|
-
}
|
|
1045
|
-
setFromCylindricalCoords(t2, s2, i2) {
|
|
1046
|
-
return this.x = t2 * Math.sin(s2), this.y = i2, this.z = t2 * Math.cos(s2), this;
|
|
1047
|
-
}
|
|
1048
|
-
setFromMatrixPosition(t2) {
|
|
1049
|
-
const s2 = t2.elements;
|
|
1050
|
-
return this.x = s2[12], this.y = s2[13], this.z = s2[14], this;
|
|
1051
|
-
}
|
|
1052
|
-
setFromMatrixScale(t2) {
|
|
1053
|
-
const s2 = this.setFromMatrixColumn(t2, 0).length(), i2 = this.setFromMatrixColumn(t2, 1).length(), e2 = this.setFromMatrixColumn(t2, 2).length();
|
|
1054
|
-
return this.x = s2, this.y = i2, this.z = e2, this;
|
|
1055
|
-
}
|
|
1056
|
-
setFromMatrixColumn(t2, s2) {
|
|
1057
|
-
return this.fromArray(t2.elements, 4 * s2);
|
|
1058
|
-
}
|
|
1059
|
-
setFromMatrix3Column(t2, s2) {
|
|
1060
|
-
return this.fromArray(t2.elements, 3 * s2);
|
|
1061
|
-
}
|
|
1062
|
-
setFromEuler(t2) {
|
|
1063
|
-
return this.x = t2._x, this.y = t2._y, this.z = t2._z, this;
|
|
1064
|
-
}
|
|
1065
|
-
setFromColor(t2) {
|
|
1066
|
-
return this.x = t2.r, this.y = t2.g, this.z = t2.b, this;
|
|
1078
|
+
return this.x = t2.x + (s2.x - t2.x) * i2, this.y = t2.y + (s2.y - t2.y) * i2, this.z = t2.z + (s2.z - t2.z) * i2, this.w = t2.w + (s2.w - t2.w) * i2, this;
|
|
1067
1079
|
}
|
|
1068
1080
|
equals(t2) {
|
|
1069
|
-
return t2.x === this.x && t2.y === this.y && t2.z === this.z;
|
|
1081
|
+
return t2.x === this.x && t2.y === this.y && t2.z === this.z && t2.w === this.w;
|
|
1070
1082
|
}
|
|
1071
1083
|
fromArray(t2, s2 = 0) {
|
|
1072
|
-
return this.x = t2[s2], this.y = t2[s2 + 1], this.z = t2[s2 + 2], this;
|
|
1084
|
+
return this.x = t2[s2], this.y = t2[s2 + 1], this.z = t2[s2 + 2], this.w = t2[s2 + 3], this;
|
|
1073
1085
|
}
|
|
1074
1086
|
toArray(t2 = [], s2 = 0) {
|
|
1075
|
-
return t2[s2] = this.x, t2[s2 + 1] = this.y, t2[s2 + 2] = this.z, t2;
|
|
1087
|
+
return t2[s2] = this.x, t2[s2 + 1] = this.y, t2[s2 + 2] = this.z, t2[s2 + 3] = this.w, t2;
|
|
1076
1088
|
}
|
|
1077
1089
|
fromBufferAttribute(t2, s2) {
|
|
1078
|
-
return this.x = t2.getX(s2), this.y = t2.getY(s2), this.z = t2.getZ(s2), this;
|
|
1090
|
+
return this.x = t2.getX(s2), this.y = t2.getY(s2), this.z = t2.getZ(s2), this.w = t2.getW(s2), this;
|
|
1079
1091
|
}
|
|
1080
1092
|
random() {
|
|
1081
|
-
return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this;
|
|
1082
|
-
}
|
|
1083
|
-
randomDirection() {
|
|
1084
|
-
const t2 = 2 * (Math.random() - 0.5), s2 = Math.random() * Math.PI * 2, i2 = Math.sqrt(1 - t2 ** 2);
|
|
1085
|
-
return this.x = i2 * Math.cos(s2), this.y = i2 * Math.sin(s2), this.z = t2, this;
|
|
1093
|
+
return this.x = Math.random(), this.y = Math.random(), this.z = Math.random(), this.w = Math.random(), this;
|
|
1086
1094
|
}
|
|
1087
1095
|
*[Symbol.iterator]() {
|
|
1088
|
-
yield this.x, yield this.y, yield this.z;
|
|
1096
|
+
yield this.x, yield this.y, yield this.z, yield this.w;
|
|
1089
1097
|
}
|
|
1090
1098
|
}
|
|
1091
|
-
const f = new _(), y = new m();
|
|
1092
1099
|
class p {
|
|
1093
|
-
constructor(t2 = new
|
|
1100
|
+
constructor(t2 = new u(1 / 0, 1 / 0, 1 / 0), s2 = new u(-1 / 0, -1 / 0, -1 / 0)) {
|
|
1094
1101
|
this.isBox3 = true, this.min = t2, this.max = s2;
|
|
1095
1102
|
}
|
|
1096
1103
|
set(t2, s2) {
|
|
@@ -1099,13 +1106,13 @@ class p {
|
|
|
1099
1106
|
setFromArray(t2) {
|
|
1100
1107
|
this.makeEmpty();
|
|
1101
1108
|
for (let s2 = 0, i2 = t2.length; s2 < i2; s2 += 3)
|
|
1102
|
-
this.expandByPoint(
|
|
1109
|
+
this.expandByPoint(M.fromArray(t2, s2));
|
|
1103
1110
|
return this;
|
|
1104
1111
|
}
|
|
1105
1112
|
setFromBufferAttribute(t2) {
|
|
1106
1113
|
this.makeEmpty();
|
|
1107
1114
|
for (let s2 = 0, i2 = t2.count; s2 < i2; s2++)
|
|
1108
|
-
this.expandByPoint(
|
|
1115
|
+
this.expandByPoint(M.fromBufferAttribute(t2, s2));
|
|
1109
1116
|
return this;
|
|
1110
1117
|
}
|
|
1111
1118
|
setFromPoints(t2) {
|
|
@@ -1115,7 +1122,7 @@ class p {
|
|
|
1115
1122
|
return this;
|
|
1116
1123
|
}
|
|
1117
1124
|
setFromCenterAndSize(t2, s2) {
|
|
1118
|
-
const i2 =
|
|
1125
|
+
const i2 = M.copy(s2).multiplyScalar(0.5);
|
|
1119
1126
|
return this.min.copy(t2).sub(i2), this.max.copy(t2).add(i2), this;
|
|
1120
1127
|
}
|
|
1121
1128
|
setFromObject(t2, s2 = false) {
|
|
@@ -1155,7 +1162,7 @@ class p {
|
|
|
1155
1162
|
const e3 = i2.getAttribute("position");
|
|
1156
1163
|
if (true === s2 && void 0 !== e3 && true !== t2.isInstancedMesh)
|
|
1157
1164
|
for (let s3 = 0, i3 = e3.count; s3 < i3; s3++)
|
|
1158
|
-
true === t2.isMesh ? t2.getVertexPosition(s3,
|
|
1165
|
+
true === t2.isMesh ? t2.getVertexPosition(s3, M) : M.fromBufferAttribute(e3, s3), M.applyMatrix4(t2.matrixWorld), this.expandByPoint(M);
|
|
1159
1166
|
else
|
|
1160
1167
|
void 0 !== t2.boundingBox ? (null === t2.boundingBox && t2.computeBoundingBox(), x.copy(t2.boundingBox)) : (null === i2.boundingBox && i2.computeBoundingBox(), x.copy(i2.boundingBox)), x.applyMatrix4(t2.matrixWorld), this.union(x);
|
|
1161
1168
|
}
|
|
@@ -1165,7 +1172,7 @@ class p {
|
|
|
1165
1172
|
return this;
|
|
1166
1173
|
}
|
|
1167
1174
|
containsPoint(t2) {
|
|
1168
|
-
return
|
|
1175
|
+
return t2.x >= this.min.x && t2.x <= this.max.x && t2.y >= this.min.y && t2.y <= this.max.y && t2.z >= this.min.z && t2.z <= this.max.z;
|
|
1169
1176
|
}
|
|
1170
1177
|
containsBox(t2) {
|
|
1171
1178
|
return this.min.x <= t2.min.x && t2.max.x <= this.max.x && this.min.y <= t2.min.y && t2.max.y <= this.max.y && this.min.z <= t2.min.z && t2.max.z <= this.max.z;
|
|
@@ -1174,10 +1181,10 @@ class p {
|
|
|
1174
1181
|
return s2.set((t2.x - this.min.x) / (this.max.x - this.min.x), (t2.y - this.min.y) / (this.max.y - this.min.y), (t2.z - this.min.z) / (this.max.z - this.min.z));
|
|
1175
1182
|
}
|
|
1176
1183
|
intersectsBox(t2) {
|
|
1177
|
-
return
|
|
1184
|
+
return t2.max.x >= this.min.x && t2.min.x <= this.max.x && t2.max.y >= this.min.y && t2.min.y <= this.max.y && t2.max.z >= this.min.z && t2.min.z <= this.max.z;
|
|
1178
1185
|
}
|
|
1179
1186
|
intersectsSphere(t2) {
|
|
1180
|
-
return this.clampPoint(t2.center,
|
|
1187
|
+
return this.clampPoint(t2.center, M), M.distanceToSquared(t2.center) <= t2.radius * t2.radius;
|
|
1181
1188
|
}
|
|
1182
1189
|
intersectsPlane(t2) {
|
|
1183
1190
|
let s2, i2;
|
|
@@ -1188,16 +1195,16 @@ class p {
|
|
|
1188
1195
|
return false;
|
|
1189
1196
|
this.getCenter(A), G.subVectors(this.max, A), w.subVectors(t2.a, A), S.subVectors(t2.b, A), E.subVectors(t2.c, A), b.subVectors(S, w), P.subVectors(E, S), v.subVectors(w, E);
|
|
1190
1197
|
let s2 = [0, -b.z, b.y, 0, -P.z, P.y, 0, -v.z, v.y, b.z, 0, -b.x, P.z, 0, -P.x, v.z, 0, -v.x, -b.y, b.x, 0, -P.y, P.x, 0, -v.y, v.x, 0];
|
|
1191
|
-
return !!I(s2, w, S, E, G) && (s2 = [1, 0, 0, 0, 1, 0, 0, 0, 1], !!I(s2, w, S, E, G) && (
|
|
1198
|
+
return !!I(s2, w, S, E, G) && (s2 = [1, 0, 0, 0, 1, 0, 0, 0, 1], !!I(s2, w, S, E, G) && (N.crossVectors(b, P), s2 = [N.x, N.y, N.z], I(s2, w, S, E, G)));
|
|
1192
1199
|
}
|
|
1193
1200
|
clampPoint(t2, s2) {
|
|
1194
1201
|
return s2.copy(t2).clamp(this.min, this.max);
|
|
1195
1202
|
}
|
|
1196
1203
|
distanceToPoint(t2) {
|
|
1197
|
-
return this.clampPoint(t2,
|
|
1204
|
+
return this.clampPoint(t2, M).distanceTo(t2);
|
|
1198
1205
|
}
|
|
1199
1206
|
getBoundingSphere(t2) {
|
|
1200
|
-
return this.isEmpty() ? t2.makeEmpty() : (this.getCenter(t2.center), t2.radius = 0.5 * this.getSize(
|
|
1207
|
+
return this.isEmpty() ? t2.makeEmpty() : (this.getCenter(t2.center), t2.radius = 0.5 * this.getSize(M).length()), t2;
|
|
1201
1208
|
}
|
|
1202
1209
|
intersect(t2) {
|
|
1203
1210
|
return this.min.max(t2.min), this.max.min(t2.max), this.isEmpty() && this.makeEmpty(), this;
|
|
@@ -1206,7 +1213,7 @@ class p {
|
|
|
1206
1213
|
return this.min.min(t2.min), this.max.max(t2.max), this;
|
|
1207
1214
|
}
|
|
1208
1215
|
applyMatrix4(t2) {
|
|
1209
|
-
return this.isEmpty() || (
|
|
1216
|
+
return this.isEmpty() || (g[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t2), g[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t2), g[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t2), g[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t2), g[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t2), g[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t2), g[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t2), g[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t2), this.setFromPoints(g)), this;
|
|
1210
1217
|
}
|
|
1211
1218
|
translate(t2) {
|
|
1212
1219
|
return this.min.add(t2), this.max.add(t2), this;
|
|
@@ -1214,20 +1221,26 @@ class p {
|
|
|
1214
1221
|
equals(t2) {
|
|
1215
1222
|
return t2.min.equals(this.min) && t2.max.equals(this.max);
|
|
1216
1223
|
}
|
|
1224
|
+
toJSON() {
|
|
1225
|
+
return { min: this.min.toArray(), max: this.max.toArray() };
|
|
1226
|
+
}
|
|
1227
|
+
fromJSON(t2) {
|
|
1228
|
+
return this.min.fromArray(t2.min), this.max.fromArray(t2.max), this;
|
|
1229
|
+
}
|
|
1217
1230
|
}
|
|
1218
|
-
const
|
|
1231
|
+
const g = [new u(), new u(), new u(), new u(), new u(), new u(), new u(), new u()], M = new u(), x = new p(), w = new u(), S = new u(), E = new u(), b = new u(), P = new u(), v = new u(), A = new u(), G = new u(), N = new u(), C = new u();
|
|
1219
1232
|
function I(t2, s2, i2, e2, a2) {
|
|
1220
1233
|
for (let n2 = 0, r2 = t2.length - 3; n2 <= r2; n2 += 3) {
|
|
1221
|
-
|
|
1222
|
-
const r3 = a2.x * Math.abs(
|
|
1234
|
+
C.fromArray(t2, n2);
|
|
1235
|
+
const r3 = a2.x * Math.abs(C.x) + a2.y * Math.abs(C.y) + a2.z * Math.abs(C.z), h2 = s2.dot(C), o2 = i2.dot(C), c2 = e2.dot(C);
|
|
1223
1236
|
if (Math.max(-Math.max(h2, o2, c2), Math.min(h2, o2, c2)) > r3)
|
|
1224
1237
|
return false;
|
|
1225
1238
|
}
|
|
1226
1239
|
return true;
|
|
1227
1240
|
}
|
|
1228
|
-
const z = new
|
|
1241
|
+
const z = new u(), T = new u(), O = new u(), R = new u(), q = new u(), L = new u(), B = new u();
|
|
1229
1242
|
class k {
|
|
1230
|
-
constructor(t2 = new
|
|
1243
|
+
constructor(t2 = new u(), s2 = new u(0, 0, -1)) {
|
|
1231
1244
|
this.origin = t2, this.direction = s2;
|
|
1232
1245
|
}
|
|
1233
1246
|
set(t2, s2) {
|
|
@@ -1286,7 +1299,7 @@ class k {
|
|
|
1286
1299
|
return h2 < 0 ? null : r2 < 0 ? this.at(h2, s2) : this.at(r2, s2);
|
|
1287
1300
|
}
|
|
1288
1301
|
intersectsSphere(t2) {
|
|
1289
|
-
return this.distanceSqToPoint(t2.center) <= t2.radius * t2.radius;
|
|
1302
|
+
return !(t2.radius < 0) && this.distanceSqToPoint(t2.center) <= t2.radius * t2.radius;
|
|
1290
1303
|
}
|
|
1291
1304
|
distanceToPlane(t2) {
|
|
1292
1305
|
const s2 = t2.normal.dot(this.direction);
|
|
@@ -1411,7 +1424,7 @@ class D {
|
|
|
1411
1424
|
}
|
|
1412
1425
|
lookAt(t2, s2, i2) {
|
|
1413
1426
|
const e2 = this.elements;
|
|
1414
|
-
return
|
|
1427
|
+
return X.subVectors(t2, s2), 0 === X.lengthSq() && (X.z = 1), X.normalize(), W.crossVectors(i2, X), 0 === W.lengthSq() && (1 === Math.abs(i2.z) ? X.x += 1e-4 : X.z += 1e-4, X.normalize(), W.crossVectors(i2, X)), W.normalize(), H.crossVectors(X, W), e2[0] = W.x, e2[4] = H.x, e2[8] = X.x, e2[1] = W.y, e2[5] = H.y, e2[9] = X.y, e2[2] = W.z, e2[6] = H.z, e2[10] = X.z, this;
|
|
1415
1428
|
}
|
|
1416
1429
|
multiply(t2) {
|
|
1417
1430
|
return this.multiplyMatrices(this, t2);
|
|
@@ -1420,8 +1433,8 @@ class D {
|
|
|
1420
1433
|
return this.multiplyMatrices(t2, this);
|
|
1421
1434
|
}
|
|
1422
1435
|
multiplyMatrices(t2, s2) {
|
|
1423
|
-
const i2 = t2.elements, e2 = s2.elements, a2 = this.elements, n2 = i2[0], r2 = i2[4], h2 = i2[8], o2 = i2[12], c2 = i2[1], l2 = i2[5], u2 = i2[9], d2 = i2[13], m2 = i2[2], _2 = i2[6], f2 = i2[10], y2 = i2[14], p2 = i2[3],
|
|
1424
|
-
return a2[0] = n2 * w2 + r2 * P2 + h2 *
|
|
1436
|
+
const i2 = t2.elements, e2 = s2.elements, a2 = this.elements, n2 = i2[0], r2 = i2[4], h2 = i2[8], o2 = i2[12], c2 = i2[1], l2 = i2[5], u2 = i2[9], d2 = i2[13], m2 = i2[2], _2 = i2[6], f2 = i2[10], y2 = i2[14], p2 = i2[3], g2 = i2[7], M2 = i2[11], x2 = i2[15], w2 = e2[0], S2 = e2[4], E2 = e2[8], b2 = e2[12], P2 = e2[1], v2 = e2[5], A2 = e2[9], G2 = e2[13], N2 = e2[2], C2 = e2[6], I2 = e2[10], z2 = e2[14], T2 = e2[3], O2 = e2[7], R2 = e2[11], q2 = e2[15];
|
|
1437
|
+
return a2[0] = n2 * w2 + r2 * P2 + h2 * N2 + o2 * T2, a2[4] = n2 * S2 + r2 * v2 + h2 * C2 + o2 * O2, a2[8] = n2 * E2 + r2 * A2 + h2 * I2 + o2 * R2, a2[12] = n2 * b2 + r2 * G2 + h2 * z2 + o2 * q2, a2[1] = c2 * w2 + l2 * P2 + u2 * N2 + d2 * T2, a2[5] = c2 * S2 + l2 * v2 + u2 * C2 + d2 * O2, a2[9] = c2 * E2 + l2 * A2 + u2 * I2 + d2 * R2, a2[13] = c2 * b2 + l2 * G2 + u2 * z2 + d2 * q2, a2[2] = m2 * w2 + _2 * P2 + f2 * N2 + y2 * T2, a2[6] = m2 * S2 + _2 * v2 + f2 * C2 + y2 * O2, a2[10] = m2 * E2 + _2 * A2 + f2 * I2 + y2 * R2, a2[14] = m2 * b2 + _2 * G2 + f2 * z2 + y2 * q2, a2[3] = p2 * w2 + g2 * P2 + M2 * N2 + x2 * T2, a2[7] = p2 * S2 + g2 * v2 + M2 * C2 + x2 * O2, a2[11] = p2 * E2 + g2 * A2 + M2 * I2 + x2 * R2, a2[15] = p2 * b2 + g2 * G2 + M2 * z2 + x2 * q2, this;
|
|
1425
1438
|
}
|
|
1426
1439
|
multiplyScalar(t2) {
|
|
1427
1440
|
const s2 = this.elements;
|
|
@@ -1441,11 +1454,11 @@ class D {
|
|
|
1441
1454
|
return t2.isVector3 ? (e2[12] = t2.x, e2[13] = t2.y, e2[14] = t2.z) : (e2[12] = t2, e2[13] = s2, e2[14] = i2), this;
|
|
1442
1455
|
}
|
|
1443
1456
|
invert() {
|
|
1444
|
-
const t2 = this.elements, s2 = t2[0], i2 = t2[1], e2 = t2[2], a2 = t2[3], n2 = t2[4], r2 = t2[5], h2 = t2[6], o2 = t2[7], c2 = t2[8], l2 = t2[9], u2 = t2[10], d2 = t2[11], m2 = t2[12], _2 = t2[13], f2 = t2[14], y2 = t2[15], p2 = l2 * f2 * o2 - _2 * u2 * o2 + _2 * h2 * d2 - r2 * f2 * d2 - l2 * h2 * y2 + r2 * u2 * y2,
|
|
1457
|
+
const t2 = this.elements, s2 = t2[0], i2 = t2[1], e2 = t2[2], a2 = t2[3], n2 = t2[4], r2 = t2[5], h2 = t2[6], o2 = t2[7], c2 = t2[8], l2 = t2[9], u2 = t2[10], d2 = t2[11], m2 = t2[12], _2 = t2[13], f2 = t2[14], y2 = t2[15], p2 = l2 * f2 * o2 - _2 * u2 * o2 + _2 * h2 * d2 - r2 * f2 * d2 - l2 * h2 * y2 + r2 * u2 * y2, g2 = m2 * u2 * o2 - c2 * f2 * o2 - m2 * h2 * d2 + n2 * f2 * d2 + c2 * h2 * y2 - n2 * u2 * y2, M2 = c2 * _2 * o2 - m2 * l2 * o2 + m2 * r2 * d2 - n2 * _2 * d2 - c2 * r2 * y2 + n2 * l2 * y2, x2 = m2 * l2 * h2 - c2 * _2 * h2 - m2 * r2 * u2 + n2 * _2 * u2 + c2 * r2 * f2 - n2 * l2 * f2, w2 = s2 * p2 + i2 * g2 + e2 * M2 + a2 * x2;
|
|
1445
1458
|
if (0 === w2)
|
|
1446
1459
|
return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
|
|
1447
1460
|
const S2 = 1 / w2;
|
|
1448
|
-
return t2[0] = p2 * S2, t2[1] = (_2 * u2 * a2 - l2 * f2 * a2 - _2 * e2 * d2 + i2 * f2 * d2 + l2 * e2 * y2 - i2 * u2 * y2) * S2, t2[2] = (r2 * f2 * a2 - _2 * h2 * a2 + _2 * e2 * o2 - i2 * f2 * o2 - r2 * e2 * y2 + i2 * h2 * y2) * S2, t2[3] = (l2 * h2 * a2 - r2 * u2 * a2 - l2 * e2 * o2 + i2 * u2 * o2 + r2 * e2 * d2 - i2 * h2 * d2) * S2, t2[4] =
|
|
1461
|
+
return t2[0] = p2 * S2, t2[1] = (_2 * u2 * a2 - l2 * f2 * a2 - _2 * e2 * d2 + i2 * f2 * d2 + l2 * e2 * y2 - i2 * u2 * y2) * S2, t2[2] = (r2 * f2 * a2 - _2 * h2 * a2 + _2 * e2 * o2 - i2 * f2 * o2 - r2 * e2 * y2 + i2 * h2 * y2) * S2, t2[3] = (l2 * h2 * a2 - r2 * u2 * a2 - l2 * e2 * o2 + i2 * u2 * o2 + r2 * e2 * d2 - i2 * h2 * d2) * S2, t2[4] = g2 * S2, t2[5] = (c2 * f2 * a2 - m2 * u2 * a2 + m2 * e2 * d2 - s2 * f2 * d2 - c2 * e2 * y2 + s2 * u2 * y2) * S2, t2[6] = (m2 * h2 * a2 - n2 * f2 * a2 - m2 * e2 * o2 + s2 * f2 * o2 + n2 * e2 * y2 - s2 * h2 * y2) * S2, t2[7] = (n2 * u2 * a2 - c2 * h2 * a2 + c2 * e2 * o2 - s2 * u2 * o2 - n2 * e2 * d2 + s2 * h2 * d2) * S2, t2[8] = M2 * S2, t2[9] = (m2 * l2 * a2 - c2 * _2 * a2 - m2 * i2 * d2 + s2 * _2 * d2 + c2 * i2 * y2 - s2 * l2 * y2) * S2, t2[10] = (n2 * _2 * a2 - m2 * r2 * a2 + m2 * i2 * o2 - s2 * _2 * o2 - n2 * i2 * y2 + s2 * r2 * y2) * S2, t2[11] = (c2 * r2 * a2 - n2 * l2 * a2 - c2 * i2 * o2 + s2 * l2 * o2 + n2 * i2 * d2 - s2 * r2 * d2) * S2, t2[12] = x2 * S2, t2[13] = (c2 * _2 * e2 - m2 * l2 * e2 + m2 * i2 * u2 - s2 * _2 * u2 - c2 * i2 * f2 + s2 * l2 * f2) * S2, t2[14] = (m2 * r2 * e2 - n2 * _2 * e2 - m2 * i2 * h2 + s2 * _2 * h2 + n2 * i2 * f2 - s2 * r2 * f2) * S2, t2[15] = (n2 * l2 * e2 - c2 * r2 * e2 + c2 * i2 * h2 - s2 * l2 * h2 - n2 * i2 * u2 + s2 * r2 * u2) * S2, this;
|
|
1449
1462
|
}
|
|
1450
1463
|
scale(t2) {
|
|
1451
1464
|
const s2 = this.elements, i2 = t2.x, e2 = t2.y, a2 = t2.z;
|
|
@@ -1481,8 +1494,8 @@ class D {
|
|
|
1481
1494
|
return this.set(1, i2, a2, 0, t2, 1, n2, 0, s2, e2, 1, 0, 0, 0, 0, 1), this;
|
|
1482
1495
|
}
|
|
1483
1496
|
compose(t2, s2, i2) {
|
|
1484
|
-
const e2 = this.elements, a2 = s2._x, n2 = s2._y, r2 = s2._z, h2 = s2._w, o2 = a2 + a2, c2 = n2 + n2, l2 = r2 + r2, u2 = a2 * o2, d2 = a2 * c2, m2 = a2 * l2, _2 = n2 * c2, f2 = n2 * l2, y2 = r2 * l2, p2 = h2 * o2,
|
|
1485
|
-
return e2[0] = (1 - (_2 + y2)) * x2, e2[1] = (d2 +
|
|
1497
|
+
const e2 = this.elements, a2 = s2._x, n2 = s2._y, r2 = s2._z, h2 = s2._w, o2 = a2 + a2, c2 = n2 + n2, l2 = r2 + r2, u2 = a2 * o2, d2 = a2 * c2, m2 = a2 * l2, _2 = n2 * c2, f2 = n2 * l2, y2 = r2 * l2, p2 = h2 * o2, g2 = h2 * c2, M2 = h2 * l2, x2 = i2.x, w2 = i2.y, S2 = i2.z;
|
|
1498
|
+
return e2[0] = (1 - (_2 + y2)) * x2, e2[1] = (d2 + M2) * x2, e2[2] = (m2 - g2) * x2, e2[3] = 0, e2[4] = (d2 - M2) * w2, e2[5] = (1 - (u2 + y2)) * w2, e2[6] = (f2 + p2) * w2, e2[7] = 0, e2[8] = (m2 + g2) * S2, e2[9] = (f2 - p2) * S2, e2[10] = (1 - (u2 + _2)) * S2, e2[11] = 0, e2[12] = t2.x, e2[13] = t2.y, e2[14] = t2.z, e2[15] = 1, this;
|
|
1486
1499
|
}
|
|
1487
1500
|
decompose(t2, s2, i2) {
|
|
1488
1501
|
const e2 = this.elements;
|
|
@@ -1492,29 +1505,33 @@ class D {
|
|
|
1492
1505
|
const h2 = 1 / a2, o2 = 1 / n2, c2 = 1 / r2;
|
|
1493
1506
|
return j.elements[0] *= h2, j.elements[1] *= h2, j.elements[2] *= h2, j.elements[4] *= o2, j.elements[5] *= o2, j.elements[6] *= o2, j.elements[8] *= c2, j.elements[9] *= c2, j.elements[10] *= c2, s2.setFromRotationMatrix(j), i2.x = a2, i2.y = n2, i2.z = r2, this;
|
|
1494
1507
|
}
|
|
1495
|
-
makePerspective(s2, i2, e2, a2, n2, r2, h2 = 2e3) {
|
|
1496
|
-
const
|
|
1497
|
-
let
|
|
1498
|
-
if (
|
|
1499
|
-
|
|
1508
|
+
makePerspective(s2, i2, e2, a2, n2, r2, h2 = 2e3, o2 = false) {
|
|
1509
|
+
const c2 = this.elements, l2 = 2 * n2 / (i2 - s2), u2 = 2 * n2 / (e2 - a2), d2 = (i2 + s2) / (i2 - s2), m2 = (e2 + a2) / (e2 - a2);
|
|
1510
|
+
let _2, f2;
|
|
1511
|
+
if (o2)
|
|
1512
|
+
_2 = n2 / (r2 - n2), f2 = r2 * n2 / (r2 - n2);
|
|
1513
|
+
else if (h2 === t)
|
|
1514
|
+
_2 = -(r2 + n2) / (r2 - n2), f2 = -2 * r2 * n2 / (r2 - n2);
|
|
1500
1515
|
else {
|
|
1501
1516
|
if (2001 !== h2)
|
|
1502
1517
|
throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + h2);
|
|
1503
|
-
|
|
1518
|
+
_2 = -r2 / (r2 - n2), f2 = -r2 * n2 / (r2 - n2);
|
|
1504
1519
|
}
|
|
1505
|
-
return
|
|
1520
|
+
return c2[0] = l2, c2[4] = 0, c2[8] = d2, c2[12] = 0, c2[1] = 0, c2[5] = u2, c2[9] = m2, c2[13] = 0, c2[2] = 0, c2[6] = 0, c2[10] = _2, c2[14] = f2, c2[3] = 0, c2[7] = 0, c2[11] = -1, c2[15] = 0, this;
|
|
1506
1521
|
}
|
|
1507
|
-
makeOrthographic(s2, i2, e2, a2, n2, r2, h2 = 2e3) {
|
|
1508
|
-
const
|
|
1522
|
+
makeOrthographic(s2, i2, e2, a2, n2, r2, h2 = 2e3, o2 = false) {
|
|
1523
|
+
const c2 = this.elements, l2 = 2 / (i2 - s2), u2 = 2 / (e2 - a2), d2 = -(i2 + s2) / (i2 - s2), m2 = -(e2 + a2) / (e2 - a2);
|
|
1509
1524
|
let _2, f2;
|
|
1510
|
-
if (
|
|
1511
|
-
_2 = (r2
|
|
1525
|
+
if (o2)
|
|
1526
|
+
_2 = 1 / (r2 - n2), f2 = r2 / (r2 - n2);
|
|
1527
|
+
else if (h2 === t)
|
|
1528
|
+
_2 = -2 / (r2 - n2), f2 = -(r2 + n2) / (r2 - n2);
|
|
1512
1529
|
else {
|
|
1513
1530
|
if (2001 !== h2)
|
|
1514
1531
|
throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: " + h2);
|
|
1515
|
-
_2 =
|
|
1532
|
+
_2 = -1 / (r2 - n2), f2 = -n2 / (r2 - n2);
|
|
1516
1533
|
}
|
|
1517
|
-
return
|
|
1534
|
+
return c2[0] = l2, c2[4] = 0, c2[8] = 0, c2[12] = d2, c2[1] = 0, c2[5] = u2, c2[9] = 0, c2[13] = m2, c2[2] = 0, c2[6] = 0, c2[10] = _2, c2[14] = f2, c2[3] = 0, c2[7] = 0, c2[11] = 0, c2[15] = 1, this;
|
|
1518
1535
|
}
|
|
1519
1536
|
equals(t2) {
|
|
1520
1537
|
const s2 = this.elements, i2 = t2.elements;
|
|
@@ -1533,9 +1550,9 @@ class D {
|
|
|
1533
1550
|
return t2[s2] = i2[0], t2[s2 + 1] = i2[1], t2[s2 + 2] = i2[2], t2[s2 + 3] = i2[3], t2[s2 + 4] = i2[4], t2[s2 + 5] = i2[5], t2[s2 + 6] = i2[6], t2[s2 + 7] = i2[7], t2[s2 + 8] = i2[8], t2[s2 + 9] = i2[9], t2[s2 + 10] = i2[10], t2[s2 + 11] = i2[11], t2[s2 + 12] = i2[12], t2[s2 + 13] = i2[13], t2[s2 + 14] = i2[14], t2[s2 + 15] = i2[15], t2;
|
|
1534
1551
|
}
|
|
1535
1552
|
}
|
|
1536
|
-
const U = new
|
|
1553
|
+
const U = new u(), j = new D(), F = new u(0, 0, 0), V = new u(1, 1, 1), W = new u(), H = new u(), X = new u(), Y = new u(), Z = new u(), Q = new _();
|
|
1537
1554
|
class K {
|
|
1538
|
-
constructor(t2 = new
|
|
1555
|
+
constructor(t2 = new u(1, 0, 0), s2 = 0) {
|
|
1539
1556
|
this.isPlane = true, this.normal = t2, this.constant = s2;
|
|
1540
1557
|
}
|
|
1541
1558
|
set(t2, s2) {
|
|
@@ -1548,7 +1565,7 @@ class K {
|
|
|
1548
1565
|
return this.normal.copy(t2), this.constant = -s2.dot(this.normal), this;
|
|
1549
1566
|
}
|
|
1550
1567
|
setFromCoplanarPoints(t2, s2, i2) {
|
|
1551
|
-
const e2 =
|
|
1568
|
+
const e2 = Y.subVectors(i2, s2).cross(Z.subVectors(t2, s2)).normalize();
|
|
1552
1569
|
return this.setFromNormalAndCoplanarPoint(e2, t2), this;
|
|
1553
1570
|
}
|
|
1554
1571
|
copy(t2) {
|
|
@@ -1571,7 +1588,7 @@ class K {
|
|
|
1571
1588
|
return s2.copy(t2).addScaledVector(this.normal, -this.distanceToPoint(t2));
|
|
1572
1589
|
}
|
|
1573
1590
|
intersectLine(t2, s2) {
|
|
1574
|
-
const i2 = t2.delta(
|
|
1591
|
+
const i2 = t2.delta(Y), e2 = this.normal.dot(i2);
|
|
1575
1592
|
if (0 === e2)
|
|
1576
1593
|
return 0 === this.distanceToPoint(t2.start) ? s2.copy(t2.start) : null;
|
|
1577
1594
|
const a2 = -(t2.start.dot(this.normal) + this.constant) / e2;
|
|
@@ -1591,7 +1608,7 @@ class K {
|
|
|
1591
1608
|
return t2.copy(this.normal).multiplyScalar(-this.constant);
|
|
1592
1609
|
}
|
|
1593
1610
|
applyMatrix4(t2, s2) {
|
|
1594
|
-
const i2 = s2 ||
|
|
1611
|
+
const i2 = s2 || Q.getNormalMatrix(t2), e2 = this.coplanarPoint(Y).applyMatrix4(t2), a2 = this.normal.applyMatrix3(i2).normalize();
|
|
1595
1612
|
return this.constant = -e2.dot(a2), this;
|
|
1596
1613
|
}
|
|
1597
1614
|
translate(t2) {
|
|
@@ -1620,7 +1637,7 @@ function tt(t2) {
|
|
|
1620
1637
|
}
|
|
1621
1638
|
this.stack = s2;
|
|
1622
1639
|
}
|
|
1623
|
-
"undefined" != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { revision: "
|
|
1640
|
+
"undefined" != typeof __THREE_DEVTOOLS__ && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { revision: "179" } })), "undefined" != typeof window && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = "179"), $.EMPTY_OBJECT = Object.freeze({}), J(Object.create) && (tt.prototype = Object.create(Error.prototype), tt.prototype.constructor = tt), tt.prototype.toString = function() {
|
|
1624
1641
|
let t2 = this.name + ": " + this.message;
|
|
1625
1642
|
return J(this.stack) && (t2 += "\n" + this.stack.toString()), t2;
|
|
1626
1643
|
}, tt.throwInstantiationError = function() {
|
|
@@ -1723,19 +1740,19 @@ it.fromDegrees = function(t2, s2, i2, e2, a2) {
|
|
|
1723
1740
|
if (J(t2))
|
|
1724
1741
|
return J(s2) ? (s2.west = t2.west, s2.south = t2.south, s2.east = t2.east, s2.north = t2.north, s2) : new it(t2.west, t2.south, t2.east, t2.north);
|
|
1725
1742
|
}, it.southwest = function(t2, s2) {
|
|
1726
|
-
return J(s2) ? (s2.x = t2.west, s2.y = t2.south, s2.z = 0, s2) : new
|
|
1743
|
+
return J(s2) ? (s2.x = t2.west, s2.y = t2.south, s2.z = 0, s2) : new u(t2.west, t2.south);
|
|
1727
1744
|
}, it.northeast = function(t2, s2) {
|
|
1728
|
-
return J(s2) ? (s2.x = t2.east, s2.y = t2.north, s2.z = 0, s2) : new
|
|
1745
|
+
return J(s2) ? (s2.x = t2.east, s2.y = t2.north, s2.z = 0, s2) : new u(t2.east, t2.north);
|
|
1729
1746
|
}, it.southeast = function(t2, s2) {
|
|
1730
|
-
return J(s2) ? (s2.x = t2.east, s2.y = t2.south, s2.z = 0, s2) : new
|
|
1747
|
+
return J(s2) ? (s2.x = t2.east, s2.y = t2.south, s2.z = 0, s2) : new u(t2.east, t2.south);
|
|
1731
1748
|
}, it.northwest = function(t2, s2) {
|
|
1732
|
-
return J(s2) ? (s2.x = t2.west, s2.y = t2.north, s2.z = 0, s2) : new
|
|
1749
|
+
return J(s2) ? (s2.x = t2.west, s2.y = t2.north, s2.z = 0, s2) : new u(t2.west, t2.north);
|
|
1733
1750
|
}, it.center = function(t2, s2) {
|
|
1734
1751
|
let i2 = t2.east;
|
|
1735
1752
|
const e2 = t2.west;
|
|
1736
1753
|
i2 < e2 && (i2 += st.TWO_PI);
|
|
1737
1754
|
const a2 = st.negativePiToPi(0.5 * (e2 + i2)), n2 = 0.5 * (t2.south + t2.north);
|
|
1738
|
-
return J(s2) ? (s2.x = a2, s2.y = n2, s2.z = 0, s2) : new
|
|
1755
|
+
return J(s2) ? (s2.x = a2, s2.y = n2, s2.z = 0, s2) : new u(a2, n2);
|
|
1739
1756
|
}, it.contains = function(t2, s2) {
|
|
1740
1757
|
let i2 = s2.x;
|
|
1741
1758
|
const e2 = s2.y, a2 = t2.west;
|
|
@@ -1751,9 +1768,9 @@ it.fromBox = function(t2, s2, i2 = false) {
|
|
|
1751
1768
|
let n2 = e2.x / 180 * Math.PI, r2 = e2.y / 180 * Math.PI, h2 = a2.x / 180 * Math.PI, o2 = a2.y / 180 * Math.PI;
|
|
1752
1769
|
return i2 && (n2 < at && (n2 = -Math.PI), n2 > et && (n2 = Math.PI), r2 < rt && (r2 = -st.PI_OVER_TWO), r2 > nt && (r2 = st.PI_OVER_TWO), h2 > et && (h2 = Math.PI), h2 < at && (h2 = -Math.PI), o2 > nt && (o2 = st.PI_OVER_TWO), o2 < rt && (o2 = -st.PI_OVER_TWO)), J(s2) ? (s2.west = n2, s2.south = r2, s2.east = h2, s2.north = o2, s2) : new it(n2, r2, h2, o2);
|
|
1753
1770
|
}, it.MAX_VALUE = Object.freeze(new it(-Math.PI, -st.PI_OVER_TWO, Math.PI, st.PI_OVER_TWO)), Object.freeze({}), Object.freeze(new D());
|
|
1754
|
-
const ot = new
|
|
1755
|
-
let ct = new
|
|
1756
|
-
const ut = new
|
|
1771
|
+
const ot = new u();
|
|
1772
|
+
let ct = new u(), lt = new u();
|
|
1773
|
+
const ut = new u(40680631590769, 40680631590769, 40408299984661445e-3), dt = new u(), mt = new u();
|
|
1757
1774
|
const __t = class {
|
|
1758
1775
|
constructor() {
|
|
1759
1776
|
__publicField(this, "COLUMN0ROW0", 0);
|
|
@@ -1777,34 +1794,34 @@ const __t = class {
|
|
|
1777
1794
|
return t2 === s2 ? (t2.normalize(), t2) : (s2.copy(t2), s2.normalize(), s2);
|
|
1778
1795
|
}
|
|
1779
1796
|
static add(t2, s2, i2) {
|
|
1780
|
-
return i2 || (i2 = new
|
|
1797
|
+
return i2 || (i2 = new u()), i2.addVectors(t2, s2);
|
|
1781
1798
|
}
|
|
1782
1799
|
static dot(t2, s2) {
|
|
1783
1800
|
return t2.dot(s2);
|
|
1784
1801
|
}
|
|
1785
1802
|
static cross(t2, s2, i2) {
|
|
1786
|
-
return i2 || (i2 = new
|
|
1803
|
+
return i2 || (i2 = new u()), i2.crossVectors(t2, s2), i2;
|
|
1787
1804
|
}
|
|
1788
1805
|
static magnitudeSquared(t2) {
|
|
1789
1806
|
return t2.lengthSq();
|
|
1790
1807
|
}
|
|
1791
1808
|
static multiplyByScalar(t2, s2, i2) {
|
|
1792
|
-
return i2 || (i2 = new
|
|
1809
|
+
return i2 || (i2 = new u()), i2.copy(t2).multiplyScalar(s2), i2;
|
|
1793
1810
|
}
|
|
1794
1811
|
static divideByScalar(t2, s2, i2) {
|
|
1795
|
-
return i2 || (i2 = new
|
|
1812
|
+
return i2 || (i2 = new u()), i2.x = t2.x / s2, i2.y = t2.y / s2, i2.z = t2.z / s2, i2;
|
|
1796
1813
|
}
|
|
1797
1814
|
static subtract(t2, s2, i2) {
|
|
1798
|
-
return i2 || (i2 = new
|
|
1815
|
+
return i2 || (i2 = new u()), i2.subVectors(t2, s2), i2;
|
|
1799
1816
|
}
|
|
1800
1817
|
static distance(t2, s2) {
|
|
1801
1818
|
return t2.distanceTo(s2);
|
|
1802
1819
|
}
|
|
1803
1820
|
static negate(t2, s2) {
|
|
1804
|
-
return s2 || (s2 = new
|
|
1821
|
+
return s2 || (s2 = new u()), s2.copy(t2), s2.negate(), s2;
|
|
1805
1822
|
}
|
|
1806
1823
|
static multiplyComponents(t2, s2, i2) {
|
|
1807
|
-
return i2 || (i2 = new
|
|
1824
|
+
return i2 || (i2 = new u()), i2.multiplyVectors(t2, s2), i2;
|
|
1808
1825
|
}
|
|
1809
1826
|
static magnitude(t2) {
|
|
1810
1827
|
return t2.length();
|
|
@@ -1813,17 +1830,17 @@ const __t = class {
|
|
|
1813
1830
|
return t2 === s2 || J(t2) && J(s2) && st.equalsEpsilon(t2.x, s2.x, i2, e2) && st.equalsEpsilon(t2.y, s2.y, i2, e2) && st.equalsEpsilon(t2.z, s2.z, i2, e2);
|
|
1814
1831
|
}
|
|
1815
1832
|
static fromCartesian4(t2, s2) {
|
|
1816
|
-
return s2 || (s2 = new
|
|
1833
|
+
return s2 || (s2 = new u()), s2.set(t2.x, t2.y, t2.z), s2;
|
|
1817
1834
|
}
|
|
1818
1835
|
static fromElements(t2, s2, i2, e2) {
|
|
1819
|
-
return e2 || (e2 = new
|
|
1836
|
+
return e2 || (e2 = new u()), e2.set(t2, s2, i2), e2;
|
|
1820
1837
|
}
|
|
1821
1838
|
static fromRadians(t2, s2, i2, e2, a2) {
|
|
1822
1839
|
i2 = $(i2, 0);
|
|
1823
1840
|
const n2 = J(e2) ? e2.radiiSquared : ut, r2 = Math.cos(s2);
|
|
1824
1841
|
ct.x = r2 * Math.cos(t2), ct.y = r2 * Math.sin(t2), ct.z = Math.sin(s2), ct = __t.normalize(ct, ct), __t.multiplyComponents(n2, ct, lt);
|
|
1825
1842
|
const h2 = Math.sqrt(__t.dot(ct, lt));
|
|
1826
|
-
return lt = __t.divideByScalar(lt, h2, lt), ct = __t.multiplyByScalar(ct, i2, ct), J(a2) || (a2 = new
|
|
1843
|
+
return lt = __t.divideByScalar(lt, h2, lt), ct = __t.multiplyByScalar(ct, i2, ct), J(a2) || (a2 = new u()), __t.add(lt, ct, a2);
|
|
1827
1844
|
}
|
|
1828
1845
|
static angleBetween(t2, s2) {
|
|
1829
1846
|
__t.normalize(t2, dt), __t.normalize(s2, mt);
|
|
@@ -1835,10 +1852,10 @@ const __t = class {
|
|
|
1835
1852
|
}
|
|
1836
1853
|
};
|
|
1837
1854
|
let _t = __t;
|
|
1838
|
-
__publicField(_t, "ZERO", Object.freeze(new
|
|
1839
|
-
__publicField(_t, "UNIT_X", Object.freeze(new
|
|
1840
|
-
__publicField(_t, "UNIT_Y", Object.freeze(new
|
|
1841
|
-
__publicField(_t, "UNIT_Z", Object.freeze(new
|
|
1855
|
+
__publicField(_t, "ZERO", Object.freeze(new u()));
|
|
1856
|
+
__publicField(_t, "UNIT_X", Object.freeze(new u(1, 0, 0)));
|
|
1857
|
+
__publicField(_t, "UNIT_Y", Object.freeze(new u(0, 1, 0)));
|
|
1858
|
+
__publicField(_t, "UNIT_Z", Object.freeze(new u(0, 0, 1)));
|
|
1842
1859
|
__publicField(_t, "abs", function(t2, s2) {
|
|
1843
1860
|
return s2.x = Math.abs(t2.x), s2.y = Math.abs(t2.y), s2.z = Math.abs(t2.z), s2;
|
|
1844
1861
|
});
|
|
@@ -1879,8 +1896,8 @@ const ft = { clipTriangleAtAxisAlignedThreshold: function(t2, s2, i2, e2, a2, n2
|
|
|
1879
1896
|
throw new tt("x3 is required.");
|
|
1880
1897
|
if (!ht(h2))
|
|
1881
1898
|
throw new tt("y3 is required.");
|
|
1882
|
-
const c2 = i2 - r2, l2 = r2 - a2,
|
|
1883
|
-
return ht(o2) ? (o2.x = p2, o2.y =
|
|
1899
|
+
const c2 = i2 - r2, l2 = r2 - a2, d2 = n2 - h2, m2 = e2 - h2, _2 = 1 / (d2 * c2 + l2 * m2), f2 = s2 - h2, y2 = t2 - r2, p2 = (d2 * y2 + l2 * f2) * _2, g2 = (-m2 * y2 + c2 * f2) * _2, M2 = 1 - p2 - g2;
|
|
1900
|
+
return ht(o2) ? (o2.x = p2, o2.y = g2, o2.z = M2, o2) : new u(p2, g2, M2);
|
|
1884
1901
|
}, computeLineSegmentLineSegmentIntersection: function(t2, s2, i2, e2, a2, n2, r2, h2, o2) {
|
|
1885
1902
|
const l2 = (h2 - n2) * (i2 - t2) - (r2 - a2) * (e2 - s2);
|
|
1886
1903
|
if (0 === l2)
|
|
@@ -1932,10 +1949,10 @@ const ft = { clipTriangleAtAxisAlignedThreshold: function(t2, s2, i2, e2, a2, n2
|
|
|
1932
1949
|
throw new tt("array must be a Uint8Array, Uint16Array, or Uint32Array.");
|
|
1933
1950
|
} };
|
|
1934
1951
|
var pt = Object.freeze(yt);
|
|
1935
|
-
const
|
|
1952
|
+
const gt = "EPSG:4326", Mt = "EPSG:3857", xt = "EPSG:4978", wt = "BD:MERCATOR", St = "SCREEN_PIXEL", Et = new p(new u(-180, -90, -100), new u(180, 90, 100));
|
|
1936
1953
|
Et.isDefault = true, Object.freeze(Et), Object.freeze(Et.min), Object.freeze(Et.max);
|
|
1937
|
-
const bt = new
|
|
1938
|
-
class
|
|
1954
|
+
const bt = new u(), Pt = new u(), vt = 1, At = 2, Gt = 3;
|
|
1955
|
+
class Nt {
|
|
1939
1956
|
constructor() {
|
|
1940
1957
|
__publicField(this, "isProjection", true);
|
|
1941
1958
|
__publicField(this, "isGeo", false);
|
|
@@ -1958,10 +1975,10 @@ class Ct {
|
|
|
1958
1975
|
return s2;
|
|
1959
1976
|
}
|
|
1960
1977
|
getGeodeticSurfaceNormal(t2, s2) {
|
|
1961
|
-
return s2 || (s2 = new
|
|
1978
|
+
return s2 || (s2 = new u()), s2.set(0, 0, 1), s2;
|
|
1962
1979
|
}
|
|
1963
1980
|
getProjectedSurfaceNormal(t2, s2) {
|
|
1964
|
-
return s2 || (s2 = new
|
|
1981
|
+
return s2 || (s2 = new u()), s2.set(0, 0, 1), s2;
|
|
1965
1982
|
}
|
|
1966
1983
|
projectedBoxToGeoBox(t2, s2, i2 = true) {
|
|
1967
1984
|
return s2 || (s2 = new p()), this.unprojectCoordinate(t2.min, s2.min, i2), this.unprojectCoordinate(t2.max, s2.max, i2), s2;
|
|
@@ -1983,7 +2000,7 @@ class Ct {
|
|
|
1983
2000
|
return this._projectedBoundingBox;
|
|
1984
2001
|
}
|
|
1985
2002
|
}
|
|
1986
|
-
const
|
|
2003
|
+
const Ct = (t2, s2, i2, e2, a2 = false) => {
|
|
1987
2004
|
if (Math.abs(t2) < e2)
|
|
1988
2005
|
return s2;
|
|
1989
2006
|
const n2 = t2 > 0 ? 1 : -1;
|
|
@@ -1999,10 +2016,10 @@ const Nt = (t2, s2, i2, e2, a2 = false) => {
|
|
|
1999
2016
|
return n2 * (e2 * (1 + (Math.abs(t2) - i2) / i2));
|
|
2000
2017
|
}, zt = Math.PI / 180, Tt = 6378137, Ot = 20037508, Rt = 180 / Math.PI, qt = 85.0511287798;
|
|
2001
2018
|
const Lt = [0, 0], Bt = [0, 0];
|
|
2002
|
-
class kt extends
|
|
2019
|
+
class kt extends Nt {
|
|
2003
2020
|
constructor() {
|
|
2004
2021
|
super(...arguments);
|
|
2005
|
-
__publicField(this, "name",
|
|
2022
|
+
__publicField(this, "name", Mt);
|
|
2006
2023
|
__publicField(this, "isAxisAligned", true);
|
|
2007
2024
|
}
|
|
2008
2025
|
projectCoordinate(t2, s2, i2 = false) {
|
|
@@ -2012,39 +2029,39 @@ class kt extends Ct {
|
|
|
2012
2029
|
const n2 = s3 || [0, 0];
|
|
2013
2030
|
return n2[0] = Tt * a2 * zt, n2[1] = Tt * Math.log(Math.tan(0.25 * Math.PI + 0.5 * t3[1] * zt)), i3 ? (n2[0] = It(t3[0], n2[0], 180, Ot), n2[1] = It(t3[1], n2[1], qt, Ot)) : (n2[0] > Ot && (n2[0] = Ot), n2[0] < -20037508 && (n2[0] = -20037508), n2[1] > Ot && (n2[1] = Ot), n2[1] < -20037508 && (n2[1] = -20037508)), n2;
|
|
2014
2031
|
}(Bt, Lt, i2);
|
|
2015
|
-
return s2 || (s2 = new
|
|
2032
|
+
return s2 || (s2 = new u()), s2.x = e2[0], s2.y = e2[1], s2.z = t2.z, s2;
|
|
2016
2033
|
}
|
|
2017
2034
|
unprojectCoordinate(t2, s2, i2 = false) {
|
|
2018
2035
|
const e2 = function(t3, s3, i3 = false) {
|
|
2019
2036
|
const e3 = s3 || [0, 0];
|
|
2020
|
-
return e3[0] = t3[0] * Rt / Tt, e3[1] = (0.5 * Math.PI - 2 * Math.atan(Math.exp(-t3[1] / Tt))) * Rt, i3 && (e3[0] =
|
|
2037
|
+
return e3[0] = t3[0] * Rt / Tt, e3[1] = (0.5 * Math.PI - 2 * Math.atan(Math.exp(-t3[1] / Tt))) * Rt, i3 && (e3[0] = Ct(t3[0], e3[0], 180, Ot), e3[1] = Ct(t3[1], e3[1], qt, Ot)), e3;
|
|
2021
2038
|
}([t2.x, t2.y], Lt, i2);
|
|
2022
|
-
return s2 || (s2 = new
|
|
2039
|
+
return s2 || (s2 = new u()), s2.x = e2[0], s2.y = e2[1], s2.z = t2.z, s2;
|
|
2023
2040
|
}
|
|
2024
2041
|
}
|
|
2025
|
-
const Dt = new
|
|
2042
|
+
const Dt = new u(), Ut = new u();
|
|
2026
2043
|
function jt(t2, s2, i2, e2, a2) {
|
|
2027
|
-
const n2 = t2.x, r2 = t2.y, h2 = t2.z, o2 = s2.x, c2 = s2.y, l2 = s2.z,
|
|
2044
|
+
const n2 = t2.x, r2 = t2.y, h2 = t2.z, o2 = s2.x, c2 = s2.y, l2 = s2.z, d2 = n2 * n2 * o2 * o2, m2 = r2 * r2 * c2 * c2, _2 = h2 * h2 * l2 * l2, f2 = d2 + m2 + _2, y2 = Math.sqrt(1 / f2), p2 = Dt.copy(t2).multiplyScalar(y2);
|
|
2028
2045
|
if (f2 < e2)
|
|
2029
|
-
return a2 || (a2 = new
|
|
2030
|
-
const
|
|
2031
|
-
w2.x = p2.x *
|
|
2032
|
-
let S2, E2, b2, P2, v2, A2, G2,
|
|
2046
|
+
return a2 || (a2 = new u()), isFinite(y2) ? a2.copy(p2) : void 0;
|
|
2047
|
+
const g2 = i2.x, M2 = i2.y, x2 = i2.z, w2 = Ut;
|
|
2048
|
+
w2.x = p2.x * g2 * 2, w2.y = p2.y * M2 * 2, w2.z = p2.z * x2 * 2;
|
|
2049
|
+
let S2, E2, b2, P2, v2, A2, G2, N2, C2, I2, z2, T2 = (1 - y2) * t2.length() / (0.5 * w2.length()), O2 = 0;
|
|
2033
2050
|
do {
|
|
2034
|
-
T2 -= O2, b2 = 1 / (1 + T2 *
|
|
2051
|
+
T2 -= O2, b2 = 1 / (1 + T2 * g2), P2 = 1 / (1 + T2 * M2), v2 = 1 / (1 + T2 * x2), A2 = b2 * b2, G2 = P2 * P2, N2 = v2 * v2, C2 = A2 * b2, I2 = G2 * P2, z2 = N2 * v2, S2 = d2 * A2 + m2 * G2 + _2 * N2 - 1, E2 = d2 * C2 * g2 + m2 * I2 * M2 + _2 * z2 * x2, O2 = S2 / (-2 * E2);
|
|
2035
2052
|
} while (Math.abs(S2) > 1e-12);
|
|
2036
|
-
return a2 ? (a2.x = n2 * b2, a2.y = r2 * P2, a2.z = h2 * v2, a2) : new
|
|
2053
|
+
return a2 ? (a2.x = n2 * b2, a2.y = r2 * P2, a2.z = h2 * v2, a2) : new u(n2 * b2, r2 * P2, h2 * v2);
|
|
2037
2054
|
}
|
|
2038
|
-
const Ft = new
|
|
2055
|
+
const Ft = new u(), Vt = new u();
|
|
2039
2056
|
class Wt {
|
|
2040
2057
|
constructor(t2, s2, i2) {
|
|
2041
|
-
this._radii = new
|
|
2058
|
+
this._radii = new u(t2, s2, i2), this._radiiSquared = new u(t2 * t2, s2 * s2, i2 * i2), this._radiiToTheFourth = new u(t2 * t2 * t2 * t2, s2 * s2 * s2 * s2, i2 * i2 * i2 * i2), this._oneOverRadii = new u(0 === t2 ? 0 : 1 / t2, 0 === s2 ? 0 : 1 / s2, 0 === i2 ? 0 : 1 / i2), this._oneOverRadiiSquared = new u(0 === t2 ? 0 : 1 / (t2 * t2), 0 === s2 ? 0 : 1 / (s2 * s2), 0 === i2 ? 0 : 1 / (i2 * i2)), this._minimumRadius = Math.min(t2, s2, i2), this._maximumRadius = Math.max(t2, s2, i2), this._centerToleranceSquared = 0.1, 0 !== this._radiiSquared.z && (this._squaredXOverSquaredZ = this._radiiSquared.x / this._radiiSquared.z);
|
|
2042
2059
|
}
|
|
2043
2060
|
static fromCartesian3(t2) {
|
|
2044
2061
|
return new Wt(t2.x, t2.y, t2.z);
|
|
2045
2062
|
}
|
|
2046
2063
|
geodeticSurfaceNormalCartographic(t2, s2) {
|
|
2047
|
-
s2 || (s2 = new
|
|
2064
|
+
s2 || (s2 = new u());
|
|
2048
2065
|
const i2 = t2.x, e2 = t2.y, a2 = Math.cos(e2), n2 = a2 * Math.cos(i2), r2 = a2 * Math.sin(i2), h2 = Math.sin(e2);
|
|
2049
2066
|
return s2.set(n2, r2, h2), s2.normalize(), s2;
|
|
2050
2067
|
}
|
|
@@ -2053,7 +2070,7 @@ class Wt {
|
|
|
2053
2070
|
}
|
|
2054
2071
|
cartographicToCartesian(t2, s2) {
|
|
2055
2072
|
const i2 = this.geodeticSurfaceNormalCartographic(t2);
|
|
2056
|
-
s2 || (s2 = new
|
|
2073
|
+
s2 || (s2 = new u()), s2.multiplyVectors(this._radiiSquared, i2);
|
|
2057
2074
|
const e2 = Math.sqrt(i2.clone().dot(s2));
|
|
2058
2075
|
return s2.divideScalar(e2), i2.multiplyScalar(t2.z), s2.add(i2), s2;
|
|
2059
2076
|
}
|
|
@@ -2066,7 +2083,7 @@ class Wt {
|
|
|
2066
2083
|
return jt(t2, this._oneOverRadii, this._oneOverRadiiSquared, this._centerToleranceSquared, s2);
|
|
2067
2084
|
}
|
|
2068
2085
|
scaleToGeocentricSurface(t2, s2) {
|
|
2069
|
-
s2 || (s2 = new
|
|
2086
|
+
s2 || (s2 = new u());
|
|
2070
2087
|
const i2 = t2.x, e2 = t2.y, a2 = t2.z, n2 = this._oneOverRadiiSquared, r2 = 1 / Math.sqrt(i2 * i2 * n2.x + e2 * e2 * n2.y + a2 * a2 * n2.z);
|
|
2071
2088
|
return s2.copy(t2).multiplyScalar(r2);
|
|
2072
2089
|
}
|
|
@@ -2077,15 +2094,15 @@ class Wt {
|
|
|
2077
2094
|
const e2 = this.geodeticSurfaceNormal(i2), a2 = t2.clone();
|
|
2078
2095
|
a2.sub(i2);
|
|
2079
2096
|
const n2 = Math.atan2(e2.y, e2.x), r2 = Math.asin(e2.z), h2 = Math.sign(a2.dot(t2)) * a2.length();
|
|
2080
|
-
return s2 || (s2 = new
|
|
2097
|
+
return s2 || (s2 = new u()), s2.set(n2, r2, h2), s2;
|
|
2081
2098
|
}
|
|
2082
2099
|
geodeticSurfaceNormal(t2, s2) {
|
|
2083
|
-
return J(s2) || (s2 = new
|
|
2100
|
+
return J(s2) || (s2 = new u()), s2.multiplyVectors(t2, this._oneOverRadiiSquared), s2.normalize(), s2;
|
|
2084
2101
|
}
|
|
2085
2102
|
getSurfaceNormalIntersectionWithZAxis(t2, s2, i2) {
|
|
2086
2103
|
s2 = $(s2, 0);
|
|
2087
2104
|
const e2 = this._squaredXOverSquaredZ;
|
|
2088
|
-
if (J(i2) || (i2 = new
|
|
2105
|
+
if (J(i2) || (i2 = new u()), i2.x = 0, i2.y = 0, i2.z = t2.z * (1 - e2), !(Math.abs(i2.z) >= this._radii.z - s2))
|
|
2089
2106
|
return i2;
|
|
2090
2107
|
}
|
|
2091
2108
|
transformPositionToScaledSpace(t2, s2) {
|
|
@@ -2122,67 +2139,67 @@ class Wt {
|
|
|
2122
2139
|
Wt.WGS84 = Object.freeze(new Wt(6378137, 6378137, 6356752314245179e-9));
|
|
2123
2140
|
class Ht {
|
|
2124
2141
|
static fromQuaternion(t2, s2) {
|
|
2125
|
-
const i2 = t2.x * t2.x, e2 = t2.x * t2.y, a2 = t2.x * t2.z, n2 = t2.x * t2.w, r2 = t2.y * t2.y, h2 = t2.y * t2.z, o2 = t2.y * t2.w, c2 = t2.z * t2.z,
|
|
2126
|
-
return s2 || (s2 = new
|
|
2142
|
+
const i2 = t2.x * t2.x, e2 = t2.x * t2.y, a2 = t2.x * t2.z, n2 = t2.x * t2.w, r2 = t2.y * t2.y, h2 = t2.y * t2.z, o2 = t2.y * t2.w, c2 = t2.z * t2.z, l2 = t2.z * t2.w, u2 = t2.w * t2.w, d2 = i2 - r2 - c2 + u2, m2 = 2 * (e2 - l2), f2 = 2 * (a2 + o2), y2 = 2 * (e2 + l2), p2 = -i2 + r2 - c2 + u2, g2 = 2 * (h2 - n2), M2 = 2 * (a2 - o2), x2 = 2 * (h2 + n2), w2 = -i2 - r2 + c2 + u2;
|
|
2143
|
+
return s2 || (s2 = new _()), s2.set(d2, m2, f2, y2, p2, g2, M2, x2, w2), s2;
|
|
2127
2144
|
}
|
|
2128
2145
|
static getColumn(t2, s2, i2) {
|
|
2129
2146
|
const e2 = t2.elements, a2 = 3 * s2, n2 = e2[a2], r2 = e2[a2 + 1], h2 = e2[a2 + 2];
|
|
2130
2147
|
return i2.x = n2, i2.y = r2, i2.z = h2, i2;
|
|
2131
2148
|
}
|
|
2132
2149
|
static multiplyByVector(t2, s2, i2) {
|
|
2133
|
-
return i2 || (i2 = new
|
|
2150
|
+
return i2 || (i2 = new u()), i2.copy(s2), i2.applyMatrix3(t2), i2;
|
|
2134
2151
|
}
|
|
2135
2152
|
static multiplyByScale(t2, s2, i2) {
|
|
2136
|
-
i2 || (i2 = new
|
|
2153
|
+
i2 || (i2 = new _());
|
|
2137
2154
|
const e2 = i2.elements, a2 = t2.elements;
|
|
2138
2155
|
return e2[0] = a2[0] * s2.x, e2[1] = a2[1] * s2.x, e2[2] = a2[2] * s2.x, e2[3] = a2[3] * s2.y, e2[4] = a2[4] * s2.y, e2[5] = a2[5] * s2.y, e2[6] = a2[6] * s2.z, e2[7] = a2[7] * s2.z, e2[8] = a2[8] * s2.z, i2;
|
|
2139
2156
|
}
|
|
2140
2157
|
static transpose(t2, s2) {
|
|
2141
|
-
return s2 || (s2 = new
|
|
2158
|
+
return s2 || (s2 = new _()), s2.copy(t2).transpose(), s2;
|
|
2142
2159
|
}
|
|
2143
2160
|
static fromScale(t2, s2) {
|
|
2144
|
-
s2 || (s2 = new
|
|
2161
|
+
s2 || (s2 = new _());
|
|
2145
2162
|
const i2 = s2.elements;
|
|
2146
2163
|
return i2[0] = t2.x, i2[1] = 0, i2[2] = 0, i2[3] = 0, i2[4] = t2.y, i2[5] = 0, i2[6] = 0, i2[7] = 0, i2[8] = t2.z, s2;
|
|
2147
2164
|
}
|
|
2148
2165
|
static multiply(t2, s2, i2) {
|
|
2149
|
-
i2 || (i2 = new
|
|
2150
|
-
const e2 = t2.elements, a2 = s2.elements, n2 = i2.elements, r2 = e2[0], h2 = e2[3], o2 = e2[6], c2 = e2[1],
|
|
2151
|
-
return n2[0] = r2 * y2 + h2 *
|
|
2166
|
+
i2 || (i2 = new _());
|
|
2167
|
+
const e2 = t2.elements, a2 = s2.elements, n2 = i2.elements, r2 = e2[0], h2 = e2[3], o2 = e2[6], c2 = e2[1], l2 = e2[4], u2 = e2[7], d2 = e2[2], m2 = e2[5], f2 = e2[8], y2 = a2[0], p2 = a2[3], g2 = a2[6], M2 = a2[1], x2 = a2[4], w2 = a2[7], S2 = a2[2], E2 = a2[5], b2 = a2[8];
|
|
2168
|
+
return n2[0] = r2 * y2 + h2 * M2 + o2 * S2, n2[3] = r2 * p2 + h2 * x2 + o2 * E2, n2[6] = r2 * g2 + h2 * w2 + o2 * b2, n2[1] = c2 * y2 + l2 * M2 + u2 * S2, n2[4] = c2 * p2 + l2 * x2 + u2 * E2, n2[7] = c2 * g2 + l2 * w2 + u2 * b2, n2[2] = d2 * y2 + m2 * M2 + f2 * S2, n2[5] = d2 * p2 + m2 * x2 + f2 * E2, n2[8] = d2 * g2 + m2 * w2 + f2 * b2, i2;
|
|
2152
2169
|
}
|
|
2153
2170
|
static clone(t2, s2) {
|
|
2154
2171
|
if (J(t2))
|
|
2155
|
-
return J(s2) ? (s2.clone(t2), s2) : new
|
|
2172
|
+
return J(s2) ? (s2.clone(t2), s2) : new _(t2[0], t2[3], t2[6], t2[1], t2[4], t2[7], t2[2], t2[5], t2[8]);
|
|
2156
2173
|
}
|
|
2157
2174
|
static setColumn(t2, s2, i2, e2) {
|
|
2158
2175
|
const a2 = (e2 = Ht.clone(t2, e2)).elements, n2 = 3 * s2;
|
|
2159
2176
|
return a2[n2] = i2.x, a2[n2 + 1] = i2.y, a2[n2 + 2] = i2.z, e2;
|
|
2160
2177
|
}
|
|
2161
2178
|
}
|
|
2162
|
-
Ht.ZERO =
|
|
2163
|
-
const
|
|
2179
|
+
Ht.ZERO = _.ZERO = Object.freeze(new _(0, 0, 0, 0, 0, 0, 0, 0, 0)), Ht.COLUMN0ROW0 = 0, Ht.COLUMN0ROW1 = 1, Ht.COLUMN0ROW2 = 2, Ht.COLUMN1ROW0 = 3, Ht.COLUMN1ROW1 = 4, Ht.COLUMN1ROW2 = 5, Ht.COLUMN2ROW0 = 6, Ht.COLUMN2ROW1 = 7, Ht.COLUMN2ROW2 = 8;
|
|
2180
|
+
const Xt = new u(), Yt = new u(), Zt = new u(), Qt = new u(1 / 6378137, 1 / 6378137, 1 / 6356752314245179e-9), Kt = new u(1 / 40680631590769, 1 / 40680631590769, 1 / 40408299984661445e-3), Jt = st.EPSILON1;
|
|
2164
2181
|
const _$t = class {
|
|
2165
2182
|
static fromRadians(t2, s2, i2, e2) {
|
|
2166
|
-
return i2 = $(i2, 0), J(e2) ? (e2.x = t2, e2.y = s2, e2.z = i2, e2) : new
|
|
2183
|
+
return i2 = $(i2, 0), J(e2) ? (e2.x = t2, e2.y = s2, e2.z = i2, e2) : new u(t2, s2, i2);
|
|
2167
2184
|
}
|
|
2168
2185
|
static fromDegrees(t2, s2, i2, e2) {
|
|
2169
2186
|
return t2 = st.toRadians(t2), s2 = st.toRadians(s2), _$t.fromRadians(t2, s2, i2, e2);
|
|
2170
2187
|
}
|
|
2171
2188
|
static fromCartesian(t2, s2, i2) {
|
|
2172
|
-
const e2 = J(s2) ? s2.oneOverRadii :
|
|
2189
|
+
const e2 = J(s2) ? s2.oneOverRadii : Qt, a2 = J(s2) ? s2.oneOverRadiiSquared : Kt, n2 = jt(t2, e2, a2, J(s2) ? s2._centerToleranceSquared : Jt, Yt);
|
|
2173
2190
|
if (!J(n2))
|
|
2174
2191
|
return;
|
|
2175
|
-
let r2 = _t.multiplyComponents(n2, a2,
|
|
2192
|
+
let r2 = _t.multiplyComponents(n2, a2, Xt);
|
|
2176
2193
|
r2 = _t.normalize(r2, r2);
|
|
2177
|
-
const h2 = _t.subtract(t2, n2,
|
|
2178
|
-
return J(i2) ? (i2.x = o2, i2.y = c2, i2.z = l2, i2) : new
|
|
2194
|
+
const h2 = _t.subtract(t2, n2, Zt), o2 = Math.atan2(r2.y, r2.x), c2 = Math.asin(r2.z), l2 = st.sign(_t.dot(h2, t2)) * _t.magnitude(h2);
|
|
2195
|
+
return J(i2) ? (i2.x = o2, i2.y = c2, i2.z = l2, i2) : new u(o2, c2, l2);
|
|
2179
2196
|
}
|
|
2180
2197
|
static toCartesian(t2, s2, i2) {
|
|
2181
2198
|
return _t.fromRadians(t2.x, t2.y, t2.z, s2, i2);
|
|
2182
2199
|
}
|
|
2183
2200
|
static clone(t2, s2) {
|
|
2184
2201
|
if (J(t2))
|
|
2185
|
-
return J(s2) ? (s2.x = t2.x, s2.y = t2.y, s2.z = t2.z, s2) : new
|
|
2202
|
+
return J(s2) ? (s2.x = t2.x, s2.y = t2.y, s2.z = t2.z, s2) : new u(t2.x, t2.y, t2.z);
|
|
2186
2203
|
}
|
|
2187
2204
|
static equals(t2, s2) {
|
|
2188
2205
|
return t2 === s2 || J(t2) && J(s2) && t2.x === s2.x && t2.y === s2.y && t2.z === s2.z;
|
|
@@ -2193,12 +2210,12 @@ const _$t = class {
|
|
|
2193
2210
|
};
|
|
2194
2211
|
let $t = _$t;
|
|
2195
2212
|
__publicField($t, "fromRadians", function(t2, s2, i2, e2) {
|
|
2196
|
-
return i2 = $(i2, 0), J(e2) ? (e2.x = t2, e2.y = s2, e2.z = i2, e2) : new
|
|
2213
|
+
return i2 = $(i2, 0), J(e2) ? (e2.x = t2, e2.y = s2, e2.z = i2, e2) : new u(t2, s2, i2);
|
|
2197
2214
|
});
|
|
2198
2215
|
__publicField($t, "fromDegrees", function(t2, s2, i2, e2) {
|
|
2199
2216
|
return t2 = st.toRadians(t2), s2 = st.toRadians(s2), _$t.fromRadians(t2, s2, i2, e2);
|
|
2200
2217
|
});
|
|
2201
|
-
__publicField($t, "ZERO", Object.freeze(new
|
|
2218
|
+
__publicField($t, "ZERO", Object.freeze(new u(0, 0, 0)));
|
|
2202
2219
|
const ts = new c(), ss = new c();
|
|
2203
2220
|
const _is = class {
|
|
2204
2221
|
static clone(t2, s2) {
|
|
@@ -2241,13 +2258,13 @@ const _is = class {
|
|
|
2241
2258
|
let is = _is;
|
|
2242
2259
|
__publicField(is, "ZERO", new c());
|
|
2243
2260
|
is.fromCartesian3 = is.clone, is.fromCartesian4 = is.clone;
|
|
2244
|
-
let es = new
|
|
2261
|
+
let es = new l(), as = new l(), ns = new l(), rs = new l(), hs = new u();
|
|
2245
2262
|
class os {
|
|
2246
2263
|
static fromAxisAngle(t2, s2, i2) {
|
|
2247
|
-
return i2 || (i2 = new
|
|
2264
|
+
return i2 || (i2 = new l()), hs.copy(t2), hs.normalize(), i2.setFromAxisAngle(hs, s2), i2;
|
|
2248
2265
|
}
|
|
2249
2266
|
static multiply(t2, s2, i2) {
|
|
2250
|
-
return i2 || (i2 = new
|
|
2267
|
+
return i2 || (i2 = new l()), i2.multiplyQuaternions(t2, s2), i2;
|
|
2251
2268
|
}
|
|
2252
2269
|
static fromHeadingPitchRoll(t2, s2) {
|
|
2253
2270
|
return rs = os.fromAxisAngle(_t.UNIT_X, t2.roll, es), ns = os.fromAxisAngle(_t.UNIT_Y, -t2.pitch, s2), s2 = os.multiply(ns, rs, ns), as = os.fromAxisAngle(_t.UNIT_Z, -t2.heading, es), os.multiply(as, s2, s2);
|
|
@@ -2279,7 +2296,7 @@ class cs {
|
|
|
2279
2296
|
return t2.equals(s2);
|
|
2280
2297
|
}
|
|
2281
2298
|
static multiplyByVector(t2, s2, i2) {
|
|
2282
|
-
return i2 || (i2 = new
|
|
2299
|
+
return i2 || (i2 = new y()), i2.copy(s2), i2.applyMatrix4(t2), i2;
|
|
2283
2300
|
}
|
|
2284
2301
|
static getColumn(t2, s2, i2) {
|
|
2285
2302
|
const e2 = t2.elements, a2 = 4 * s2, n2 = e2[a2], r2 = e2[a2 + 1], h2 = e2[a2 + 2], o2 = e2[a2 + 3];
|
|
@@ -2287,19 +2304,19 @@ class cs {
|
|
|
2287
2304
|
}
|
|
2288
2305
|
static fromTranslationQuaternionRotationScale(t2, s2, i2, e2) {
|
|
2289
2306
|
e2 || (e2 = new D());
|
|
2290
|
-
const a2 = i2.x, n2 = i2.y, r2 = i2.z, h2 = s2.x * s2.x, o2 = s2.x * s2.y, c2 = s2.x * s2.z, l2 = s2.x * s2.w, u2 = s2.y * s2.y, d2 = s2.y * s2.z, m2 = s2.y * s2.w, _2 = s2.z * s2.z, f2 = s2.z * s2.w, y2 = s2.w * s2.w, p2 = h2 - u2 - _2 + y2,
|
|
2291
|
-
return v2[0] = p2 * a2, v2[1] = x2 * a2, v2[2] = E2 * a2, v2[3] = 0, v2[4] =
|
|
2307
|
+
const a2 = i2.x, n2 = i2.y, r2 = i2.z, h2 = s2.x * s2.x, o2 = s2.x * s2.y, c2 = s2.x * s2.z, l2 = s2.x * s2.w, u2 = s2.y * s2.y, d2 = s2.y * s2.z, m2 = s2.y * s2.w, _2 = s2.z * s2.z, f2 = s2.z * s2.w, y2 = s2.w * s2.w, p2 = h2 - u2 - _2 + y2, g2 = 2 * (o2 - f2), M2 = 2 * (c2 + m2), x2 = 2 * (o2 + f2), w2 = -h2 + u2 - _2 + y2, S2 = 2 * (d2 - l2), E2 = 2 * (c2 - m2), b2 = 2 * (d2 + l2), P2 = -h2 - u2 + _2 + y2, v2 = e2.elements;
|
|
2308
|
+
return v2[0] = p2 * a2, v2[1] = x2 * a2, v2[2] = E2 * a2, v2[3] = 0, v2[4] = g2 * n2, v2[5] = w2 * n2, v2[6] = b2 * n2, v2[7] = 0, v2[8] = M2 * r2, v2[9] = S2 * r2, v2[10] = P2 * r2, v2[11] = 0, v2[12] = t2.x, v2[13] = t2.y, v2[14] = t2.z, v2[15] = 1, e2;
|
|
2292
2309
|
}
|
|
2293
2310
|
}
|
|
2294
2311
|
__publicField(cs, "IDENTITY", Object.freeze(new D()));
|
|
2295
2312
|
cs.ZERO = Object.freeze(new D(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
|
|
2296
|
-
const ls = {}, us = new
|
|
2297
|
-
let fs = { north: [-1, 0, 0], east: [0, 1, 0], up: [0, 0, 1], south: [1, 0, 0], west: [0, -1, 0], down: [0, 0, -1] }, ys = {}, ps = { east: new
|
|
2298
|
-
const ws = (t2) => void 0 !== t2, Ss = new
|
|
2299
|
-
const a2 = new
|
|
2313
|
+
const ls = {}, us = new l(), ds = new u(1, 1, 1), ms = new D(), _s = { up: { south: "east", north: "west", west: "south", east: "north" }, down: { south: "west", north: "east", west: "north", east: "south" }, south: { up: "west", down: "east", west: "down", east: "up" }, north: { up: "east", down: "west", west: "up", east: "down" }, west: { up: "north", down: "south", north: "down", south: "up" }, east: { up: "south", down: "north", north: "up", south: "down" } };
|
|
2314
|
+
let fs = { north: [-1, 0, 0], east: [0, 1, 0], up: [0, 0, 1], south: [1, 0, 0], west: [0, -1, 0], down: [0, 0, -1] }, ys = {}, ps = { east: new u(), north: new u(), up: new u(), west: new u(), south: new u(), down: new u() }, gs = new u(), Ms = new u(), xs = new u();
|
|
2315
|
+
const ws = (t2) => void 0 !== t2, Ss = new u(), Es = new u(), bs = new u(), Ps = function(t2, s2, i2 = 0, e2) {
|
|
2316
|
+
const a2 = new u(40680631590769, 40680631590769, 40408299984661445e-3), n2 = Math.cos(s2);
|
|
2300
2317
|
Es.x = n2 * Math.cos(t2), Es.y = n2 * Math.sin(t2), Es.z = Math.sin(s2), Es.normalize(), bs.multiplyVectors(a2, Es);
|
|
2301
2318
|
const r2 = Math.sqrt(Es.dot(bs));
|
|
2302
|
-
return bs.divideScalar(r2), Es.multiplyScalar(i2), ws(e2) || (e2 = new
|
|
2319
|
+
return bs.divideScalar(r2), Es.multiplyScalar(i2), ws(e2) || (e2 = new u()), e2.addVectors(bs, Es);
|
|
2303
2320
|
};
|
|
2304
2321
|
function vs(t2, s2) {
|
|
2305
2322
|
this.start = $(t2, 0), this.stop = $(s2, 0);
|
|
@@ -2312,18 +2329,18 @@ ls.lnglatToEcef = (t2, s2, i2 = 0, e2) => Ps(t2 * Math.PI / 180, s2 * Math.PI /
|
|
|
2312
2329
|
if (!ws(i3))
|
|
2313
2330
|
throw new Error("origin is required.");
|
|
2314
2331
|
if (ws(n2) || (n2 = new D()), i3.equals(Ss))
|
|
2315
|
-
|
|
2332
|
+
gs.fromArray(fs[t2]), Ms.fromArray(fs[s2]), xs.fromArray(fs[e2]);
|
|
2316
2333
|
else if (Math.abs(i3.x) < 1e-14 && Math.abs(i3.y) < 1e-14) {
|
|
2317
2334
|
let a4 = 0 === (r2 = +(r2 = i3.z)) ? r2 : r2 > 0 ? 1 : -1;
|
|
2318
|
-
|
|
2335
|
+
gs.fromArray(fs[t2]), "east" !== t2 && "west" !== t2 && gs.multiplyScalar(a4), Ms.fromArray(fs[s2]), "east" !== s2 && "west" !== s2 && Ms.multiplyScalar(a4), xs.fromArray(fs[e2]), "east" !== e2 && "west" !== e2 && xs.multiplyScalar(a4);
|
|
2319
2336
|
} else {
|
|
2320
2337
|
(a3 = a3 || Wt.WGS84).geodeticSurfaceNormal(i3, ps.up);
|
|
2321
2338
|
let n3 = ps.up, r3 = ps.east;
|
|
2322
|
-
r3.x = -i3.y, r3.y = i3.x, r3.z = 0, ps.east.copy(r3).normalize(), ps.north.crossVectors(n3, r3), ps.down.copy(ps.up).multiplyScalar(-1), ps.west.copy(ps.east).multiplyScalar(-1), ps.south.copy(ps.north).multiplyScalar(-1),
|
|
2339
|
+
r3.x = -i3.y, r3.y = i3.x, r3.z = 0, ps.east.copy(r3).normalize(), ps.north.crossVectors(n3, r3), ps.down.copy(ps.up).multiplyScalar(-1), ps.west.copy(ps.east).multiplyScalar(-1), ps.south.copy(ps.north).multiplyScalar(-1), gs = ps[t2], Ms = ps[s2], xs = ps[e2];
|
|
2323
2340
|
}
|
|
2324
2341
|
var r2;
|
|
2325
2342
|
const h2 = n2.elements;
|
|
2326
|
-
return h2[0] =
|
|
2343
|
+
return h2[0] = gs.x, h2[1] = gs.y, h2[2] = gs.z, h2[3] = 0, h2[4] = Ms.x, h2[5] = Ms.y, h2[6] = Ms.z, h2[7] = 0, h2[8] = xs.x, h2[9] = xs.y, h2[10] = xs.z, h2[11] = 0, h2[12] = i3.x, h2[13] = i3.y, h2[14] = i3.z, h2[15] = 1, n2;
|
|
2327
2344
|
}, ys[a2] = i2), i2;
|
|
2328
2345
|
}, ls.eastNorthUpToFixedFrame = ls.localFrameToFixedFrameGenerator("east", "north"), ls.headingPitchRollToFixedFrame = function(t2, s2, i2, e2, a2) {
|
|
2329
2346
|
e2 = e2 || ls.eastNorthUpToFixedFrame;
|
|
@@ -2374,25 +2391,25 @@ As.computeDiscriminant = function(t2, s2, i2) {
|
|
|
2374
2391
|
var o2 = -0.5 * Gs(s2, st.sign(s2) * Math.sqrt(h2), st.EPSILON14);
|
|
2375
2392
|
return s2 > 0 ? [o2 / t2, i2 / o2] : [i2 / o2, o2 / t2];
|
|
2376
2393
|
};
|
|
2377
|
-
var
|
|
2378
|
-
function
|
|
2394
|
+
var Ns = {};
|
|
2395
|
+
function Cs(t2, s2, i2, e2) {
|
|
2379
2396
|
var a2, n2, r2 = t2, h2 = s2 / 3, o2 = i2 / 3, c2 = e2, l2 = r2 * o2, u2 = h2 * c2, d2 = h2 * h2, m2 = o2 * o2, _2 = r2 * o2 - d2, f2 = r2 * c2 - h2 * o2, y2 = h2 * c2 - m2, p2 = 4 * _2 * y2 - f2 * f2;
|
|
2380
2397
|
if (p2 < 0) {
|
|
2381
|
-
var
|
|
2382
|
-
d2 * u2 >= l2 * m2 ? (
|
|
2383
|
-
var w2 = -(x2 < 0 ? -1 : 1) * Math.abs(
|
|
2384
|
-
return a2 =
|
|
2398
|
+
var g2, M2, x2;
|
|
2399
|
+
d2 * u2 >= l2 * m2 ? (g2 = r2, M2 = _2, x2 = -2 * h2 * _2 + r2 * f2) : (g2 = c2, M2 = y2, x2 = -c2 * f2 + 2 * o2 * y2);
|
|
2400
|
+
var w2 = -(x2 < 0 ? -1 : 1) * Math.abs(g2) * Math.sqrt(-p2), S2 = (n2 = -x2 + w2) / 2, E2 = S2 < 0 ? -Math.pow(-S2, 1 / 3) : Math.pow(S2, 1 / 3), b2 = n2 === w2 ? -E2 : -M2 / E2;
|
|
2401
|
+
return a2 = M2 <= 0 ? E2 + b2 : -x2 / (E2 * E2 + b2 * b2 + M2), d2 * u2 >= l2 * m2 ? [(a2 - h2) / r2] : [-c2 / (a2 + o2)];
|
|
2385
2402
|
}
|
|
2386
|
-
var P2 = _2, v2 = -2 * h2 * _2 + r2 * f2, A2 = y2, G2 = -c2 * f2 + 2 * o2 * y2,
|
|
2403
|
+
var P2 = _2, v2 = -2 * h2 * _2 + r2 * f2, A2 = y2, G2 = -c2 * f2 + 2 * o2 * y2, N2 = Math.sqrt(p2), C2 = Math.sqrt(3) / 2, I2 = Math.abs(Math.atan2(r2 * N2, -v2) / 3);
|
|
2387
2404
|
a2 = 2 * Math.sqrt(-P2);
|
|
2388
2405
|
var z2 = Math.cos(I2);
|
|
2389
2406
|
n2 = a2 * z2;
|
|
2390
|
-
var T2 = a2 * (-z2 / 2 -
|
|
2391
|
-
I2 = Math.abs(Math.atan2(c2 *
|
|
2392
|
-
var L2 = -c2, B2 = (n2 = (a2 = 2 * Math.sqrt(-A2)) * (z2 = Math.cos(I2))) + (T2 = a2 * (-z2 / 2 -
|
|
2407
|
+
var T2 = a2 * (-z2 / 2 - C2 * Math.sin(I2)), O2 = n2 + T2 > 2 * h2 ? n2 - h2 : T2 - h2, R2 = r2, q2 = O2 / R2;
|
|
2408
|
+
I2 = Math.abs(Math.atan2(c2 * N2, -G2) / 3);
|
|
2409
|
+
var L2 = -c2, B2 = (n2 = (a2 = 2 * Math.sqrt(-A2)) * (z2 = Math.cos(I2))) + (T2 = a2 * (-z2 / 2 - C2 * Math.sin(I2))) < 2 * o2 ? n2 + o2 : T2 + o2, k2 = L2 / B2, D2 = -O2 * B2 - R2 * L2, U2 = (o2 * D2 - h2 * (O2 * L2)) / (-h2 * D2 + o2 * (R2 * B2));
|
|
2393
2410
|
return q2 <= U2 ? q2 <= k2 ? U2 <= k2 ? [q2, U2, k2] : [q2, k2, U2] : [k2, q2, U2] : q2 <= k2 ? [U2, q2, k2] : U2 <= k2 ? [U2, k2, q2] : [k2, U2, q2];
|
|
2394
2411
|
}
|
|
2395
|
-
|
|
2412
|
+
Ns.computeDiscriminant = function(t2, s2, i2, e2) {
|
|
2396
2413
|
if ("number" != typeof t2)
|
|
2397
2414
|
throw new tt("a is a required number.");
|
|
2398
2415
|
if ("number" != typeof s2)
|
|
@@ -2403,7 +2420,7 @@ Cs.computeDiscriminant = function(t2, s2, i2, e2) {
|
|
|
2403
2420
|
throw new tt("d is a required number.");
|
|
2404
2421
|
var a2 = s2 * s2, n2 = i2 * i2;
|
|
2405
2422
|
return 18 * t2 * s2 * i2 * e2 + a2 * n2 - 27 * (t2 * t2) * (e2 * e2) - 4 * (t2 * n2 * i2 + a2 * s2 * e2);
|
|
2406
|
-
},
|
|
2423
|
+
}, Ns.computeRealRoots = function(t2, s2, i2, e2) {
|
|
2407
2424
|
if ("number" != typeof t2)
|
|
2408
2425
|
throw new tt("a is a required number.");
|
|
2409
2426
|
if ("number" != typeof s2)
|
|
@@ -2422,13 +2439,13 @@ Cs.computeDiscriminant = function(t2, s2, i2, e2) {
|
|
|
2422
2439
|
var r2 = (n2 = -e2 / t2) < 0 ? -Math.pow(-n2, 1 / 3) : Math.pow(n2, 1 / 3);
|
|
2423
2440
|
return [r2, r2, r2];
|
|
2424
2441
|
}
|
|
2425
|
-
return 0 === e2 ? 0 === (a2 = As.computeRealRoots(t2, 0, i2)).Length ? [0] : [a2[0], 0, a2[1]] :
|
|
2442
|
+
return 0 === e2 ? 0 === (a2 = As.computeRealRoots(t2, 0, i2)).Length ? [0] : [a2[0], 0, a2[1]] : Cs(t2, 0, i2, e2);
|
|
2426
2443
|
}
|
|
2427
|
-
return 0 === i2 ? 0 === e2 ? (n2 = -s2 / t2) < 0 ? [n2, 0, 0] : [0, 0, n2] :
|
|
2444
|
+
return 0 === i2 ? 0 === e2 ? (n2 = -s2 / t2) < 0 ? [n2, 0, 0] : [0, 0, n2] : Cs(t2, s2, 0, e2) : 0 === e2 ? 0 === (a2 = As.computeRealRoots(t2, s2, i2)).length ? [0] : a2[1] <= 0 ? [a2[0], a2[1], 0] : a2[0] >= 0 ? [0, a2[0], a2[1]] : [a2[0], 0, a2[1]] : Cs(t2, s2, i2, e2);
|
|
2428
2445
|
};
|
|
2429
2446
|
var Is = {};
|
|
2430
2447
|
function zs(t2, s2, i2, e2) {
|
|
2431
|
-
var a2 = t2 * t2, n2 = s2 - 3 * a2 / 8, r2 = i2 - s2 * t2 / 2 + a2 * t2 / 8, h2 = e2 - i2 * t2 / 4 + s2 * a2 / 16 - 3 * a2 * a2 / 256, o2 =
|
|
2448
|
+
var a2 = t2 * t2, n2 = s2 - 3 * a2 / 8, r2 = i2 - s2 * t2 / 2 + a2 * t2 / 8, h2 = e2 - i2 * t2 / 4 + s2 * a2 / 16 - 3 * a2 * a2 / 256, o2 = Ns.computeRealRoots(1, 2 * n2, n2 * n2 - 4 * h2, -r2 * r2);
|
|
2432
2449
|
if (o2.length > 0) {
|
|
2433
2450
|
var c2 = -t2 / 4, l2 = o2[o2.length - 1];
|
|
2434
2451
|
if (Math.abs(l2) < st.EPSILON14) {
|
|
@@ -2447,24 +2464,24 @@ function zs(t2, s2, i2, e2) {
|
|
|
2447
2464
|
return [];
|
|
2448
2465
|
}
|
|
2449
2466
|
if (l2 > 0) {
|
|
2450
|
-
var p2 = Math.sqrt(l2),
|
|
2467
|
+
var p2 = Math.sqrt(l2), g2 = (n2 + l2 - r2 / p2) / 2, M2 = (n2 + l2 + r2 / p2) / 2, x2 = As.computeRealRoots(1, p2, g2), w2 = As.computeRealRoots(1, -p2, M2);
|
|
2451
2468
|
return 0 !== x2.length ? (x2[0] += c2, x2[1] += c2, 0 !== w2.length ? (w2[0] += c2, w2[1] += c2, x2[1] <= w2[0] ? [x2[0], x2[1], w2[0], w2[1]] : w2[1] <= x2[0] ? [w2[0], w2[1], x2[0], x2[1]] : x2[0] >= w2[0] && x2[1] <= w2[1] ? [w2[0], x2[0], x2[1], w2[1]] : w2[0] >= x2[0] && w2[1] <= x2[1] ? [x2[0], w2[0], w2[1], x2[1]] : x2[0] > w2[0] && x2[0] < w2[1] ? [w2[0], x2[0], w2[1], x2[1]] : [x2[0], w2[0], x2[1], w2[1]]) : x2) : 0 !== w2.length ? (w2[0] += c2, w2[1] += c2, w2) : [];
|
|
2452
2469
|
}
|
|
2453
2470
|
}
|
|
2454
2471
|
return [];
|
|
2455
2472
|
}
|
|
2456
2473
|
function Ts(t2, s2, i2, e2) {
|
|
2457
|
-
var a2 = t2 * t2, n2 = -2 * s2, r2 = i2 * t2 + s2 * s2 - 4 * e2, h2 = a2 * e2 - i2 * s2 * t2 + i2 * i2, o2 =
|
|
2474
|
+
var a2 = t2 * t2, n2 = -2 * s2, r2 = i2 * t2 + s2 * s2 - 4 * e2, h2 = a2 * e2 - i2 * s2 * t2 + i2 * i2, o2 = Ns.computeRealRoots(1, n2, r2, h2);
|
|
2458
2475
|
if (o2.length > 0) {
|
|
2459
|
-
var c2, l2, u2, d2, m2, _2, f2 = o2[0], y2 = s2 - f2, p2 = y2 * y2,
|
|
2476
|
+
var c2, l2, u2, d2, m2, _2, f2 = o2[0], y2 = s2 - f2, p2 = y2 * y2, g2 = t2 / 2, M2 = y2 / 2, x2 = p2 - 4 * e2, w2 = p2 + 4 * Math.abs(e2), S2 = a2 - 4 * f2, E2 = a2 + 4 * Math.abs(f2);
|
|
2460
2477
|
if (f2 < 0 || x2 * E2 < S2 * w2) {
|
|
2461
2478
|
var b2 = Math.sqrt(S2);
|
|
2462
|
-
c2 = b2 / 2, l2 = 0 === b2 ? 0 : (t2 *
|
|
2479
|
+
c2 = b2 / 2, l2 = 0 === b2 ? 0 : (t2 * M2 - i2) / b2;
|
|
2463
2480
|
} else {
|
|
2464
2481
|
var P2 = Math.sqrt(x2);
|
|
2465
|
-
c2 = 0 === P2 ? 0 : (t2 *
|
|
2482
|
+
c2 = 0 === P2 ? 0 : (t2 * M2 - i2) / P2, l2 = P2 / 2;
|
|
2466
2483
|
}
|
|
2467
|
-
0 ===
|
|
2484
|
+
0 === g2 && 0 === c2 ? (u2 = 0, d2 = 0) : st.sign(g2) === st.sign(c2) ? d2 = f2 / (u2 = g2 + c2) : u2 = f2 / (d2 = g2 - c2), 0 === M2 && 0 === l2 ? (m2 = 0, _2 = 0) : st.sign(M2) === st.sign(l2) ? _2 = e2 / (m2 = M2 + l2) : m2 = e2 / (_2 = M2 - l2);
|
|
2468
2485
|
var v2 = As.computeRealRoots(1, u2, m2), A2 = As.computeRealRoots(1, d2, _2);
|
|
2469
2486
|
if (0 !== v2.length)
|
|
2470
2487
|
return 0 !== A2.length ? v2[1] <= A2[0] ? [v2[0], v2[1], A2[0], A2[1]] : A2[1] <= v2[0] ? [A2[0], A2[1], v2[0], v2[1]] : v2[0] >= A2[0] && v2[1] <= A2[1] ? [A2[0], v2[0], v2[1], A2[1]] : A2[0] >= v2[0] && A2[1] <= v2[1] ? [v2[0], A2[0], A2[1], v2[1]] : v2[0] > A2[0] && v2[0] < A2[1] ? [A2[0], v2[0], A2[1], v2[1]] : [v2[0], A2[0], v2[1], A2[1]] : v2;
|
|
@@ -2498,7 +2515,7 @@ Is.computeDiscriminant = function(t2, s2, i2, e2, a2) {
|
|
|
2498
2515
|
if ("number" != typeof a2)
|
|
2499
2516
|
throw new tt("e is a required number.");
|
|
2500
2517
|
if (Math.abs(t2) < st.EPSILON15)
|
|
2501
|
-
return
|
|
2518
|
+
return Ns.computeRealRoots(s2, i2, e2, a2);
|
|
2502
2519
|
var n2 = s2 / t2, r2 = i2 / t2, h2 = e2 / t2, o2 = a2 / t2, c2 = n2 < 0 ? 1 : 0;
|
|
2503
2520
|
switch (c2 += r2 < 0 ? c2 + 1 : c2, c2 += h2 < 0 ? c2 + 1 : c2, c2 += o2 < 0 ? c2 + 1 : c2) {
|
|
2504
2521
|
case 0:
|
|
@@ -2528,14 +2545,14 @@ var Os = { rayPlane: function(t2, s2, i2) {
|
|
|
2528
2545
|
throw new tt("ray is required.");
|
|
2529
2546
|
if (!J(s2))
|
|
2530
2547
|
throw new tt("plane is required.");
|
|
2531
|
-
J(i2) || (i2 = new
|
|
2548
|
+
J(i2) || (i2 = new u());
|
|
2532
2549
|
var e2 = t2.origin, a2 = t2.direction, n2 = s2.normal, r2 = _t.dot(n2, a2);
|
|
2533
2550
|
if (!(Math.abs(r2) < st.EPSILON15)) {
|
|
2534
2551
|
var h2 = (-s2.constant - _t.dot(n2, e2)) / r2;
|
|
2535
2552
|
if (!(h2 < 0))
|
|
2536
2553
|
return i2 = _t.multiplyByScalar(a2, h2, i2), _t.add(e2, i2, i2);
|
|
2537
2554
|
}
|
|
2538
|
-
} }, Rs = new
|
|
2555
|
+
} }, Rs = new u(), qs = new u(), Ls = new u(), Bs = new u(), ks = new u();
|
|
2539
2556
|
Os.rayTriangleParametric = function(t2, s2, i2, e2, a2) {
|
|
2540
2557
|
if (!J(t2))
|
|
2541
2558
|
throw new tt("ray is required.");
|
|
@@ -2569,7 +2586,7 @@ Os.rayTriangleParametric = function(t2, s2, i2, e2, a2) {
|
|
|
2569
2586
|
}, Os.rayTriangle = function(t2, s2, i2, e2, a2, n2) {
|
|
2570
2587
|
var r2 = Os.rayTriangleParametric(t2, s2, i2, e2, a2);
|
|
2571
2588
|
if (J(r2) && !(r2 < 0))
|
|
2572
|
-
return J(n2) || (n2 = new
|
|
2589
|
+
return J(n2) || (n2 = new u()), _t.multiplyByScalar(t2.direction, r2, n2), _t.add(t2.origin, n2, n2);
|
|
2573
2590
|
};
|
|
2574
2591
|
var Ds = new k();
|
|
2575
2592
|
Os.lineSegmentTriangle = function(t2, s2, i2, e2, a2, n2, r2) {
|
|
@@ -2587,7 +2604,7 @@ Os.lineSegmentTriangle = function(t2, s2, i2, e2, a2, n2, r2) {
|
|
|
2587
2604
|
_t.clone(t2, h2.origin), _t.subtract(s2, t2, h2.direction), _t.normalize(h2.direction, h2.direction);
|
|
2588
2605
|
var o2 = Os.rayTriangleParametric(h2, i2, e2, a2, n2);
|
|
2589
2606
|
if (!(!J(o2) || o2 < 0 || o2 > _t.distance(t2, s2)))
|
|
2590
|
-
return J(r2) || (r2 = new
|
|
2607
|
+
return J(r2) || (r2 = new u()), _t.multiplyByScalar(h2.direction, o2, r2), _t.add(h2.origin, r2, r2);
|
|
2591
2608
|
};
|
|
2592
2609
|
var Us = { root0: 0, root1: 0 };
|
|
2593
2610
|
function js(t2, s2, i2) {
|
|
@@ -2629,7 +2646,7 @@ Os.lineSegmentSphere = function(t2, s2, i2, e2) {
|
|
|
2629
2646
|
if (_t.normalize(n2, n2), !(!J(e2 = js(a2, i2, e2)) || e2.stop < 0 || e2.start > r2))
|
|
2630
2647
|
return e2.start = Math.max(e2.start, 0), e2.stop = Math.min(e2.stop, r2), e2;
|
|
2631
2648
|
};
|
|
2632
|
-
var Vs = new
|
|
2649
|
+
var Vs = new u(), Ws = new u();
|
|
2633
2650
|
function Hs(t2, s2, i2) {
|
|
2634
2651
|
var e2 = t2 + s2;
|
|
2635
2652
|
return st.sign(t2) !== st.sign(s2) && Math.abs(e2 / Math.max(Math.abs(t2), Math.abs(s2))) < i2 ? 0 : e2;
|
|
@@ -2656,7 +2673,7 @@ Os.rayEllipsoid = function(t2, s2) {
|
|
|
2656
2673
|
}
|
|
2657
2674
|
return l2 < 1 ? (i2 = l2 - 1, n2 = u2 * u2 - (a2 = (e2 = _t.magnitudeSquared(c2)) * i2), new vs(0, (r2 = -u2 + Math.sqrt(n2)) / e2)) : u2 < 0 ? new vs(0, -u2 / (e2 = _t.magnitudeSquared(c2))) : void 0;
|
|
2658
2675
|
};
|
|
2659
|
-
var
|
|
2676
|
+
var Xs = new u(), Ys = new u(), Zs = new u(), Qs = new u(), Ks = new u(), Js = new _(), $s = new _(), ti = new _(), si = new _(), ii = new _(), ei = new _(), ai = new _(), ni = new u(), ri = new u(), hi = new u();
|
|
2660
2677
|
Os.grazingAltitudeLocation = function(t2, s2) {
|
|
2661
2678
|
if (!J(t2))
|
|
2662
2679
|
throw new tt("ray is required.");
|
|
@@ -2664,49 +2681,49 @@ Os.grazingAltitudeLocation = function(t2, s2) {
|
|
|
2664
2681
|
throw new tt("ellipsoid is required.");
|
|
2665
2682
|
var i2 = t2.origin, e2 = t2.direction;
|
|
2666
2683
|
if (!_t.equals(i2, _t.ZERO)) {
|
|
2667
|
-
var a2 = s2.geodeticSurfaceNormal(i2,
|
|
2684
|
+
var a2 = s2.geodeticSurfaceNormal(i2, Xs);
|
|
2668
2685
|
if (_t.dot(e2, a2) >= 0)
|
|
2669
2686
|
return i2;
|
|
2670
2687
|
}
|
|
2671
|
-
var n2 = J(this.rayEllipsoid(t2, s2)), r2 = s2.transformPositionToScaledSpace(e2,
|
|
2672
|
-
|
|
2673
|
-
var
|
|
2688
|
+
var n2 = J(this.rayEllipsoid(t2, s2)), r2 = s2.transformPositionToScaledSpace(e2, Xs), h2 = _t.normalize(r2, r2), o2 = _t.mostOrthogonalAxis(r2, Qs), c2 = _t.normalize(_t.cross(o2, h2, Ys), Ys), l2 = _t.normalize(_t.cross(h2, c2, Zs), Zs), d2 = Js;
|
|
2689
|
+
d2[0] = h2.x, d2[1] = h2.y, d2[2] = h2.z, d2[3] = c2.x, d2[4] = c2.y, d2[5] = c2.z, d2[6] = l2.x, d2[7] = l2.y, d2[8] = l2.z;
|
|
2690
|
+
var m2 = Ht.transpose(d2, $s), _2 = Ht.fromScale(s2.radii, ti), f2 = Ht.fromScale(s2.oneOverRadii, si), y2 = ii;
|
|
2674
2691
|
y2[0] = 0, y2[1] = -e2.z, y2[2] = e2.y, y2[3] = e2.z, y2[4] = 0, y2[5] = -e2.x, y2[6] = -e2.y, y2[7] = e2.x, y2[8] = 0;
|
|
2675
|
-
var p2,
|
|
2676
|
-
var n3, r3 = e3 * e3, h3 = a3 * a3, o3 = (t3[Ht.COLUMN1ROW1] - t3[Ht.COLUMN2ROW2]) * h3, c3 = a3 * (e3 * Hs(t3[Ht.COLUMN1ROW0], t3[Ht.COLUMN0ROW1], st.EPSILON15) + s3.y), l3 = t3[Ht.COLUMN0ROW0] * r3 + t3[Ht.COLUMN2ROW2] * h3 + e3 * s3.x + i3,
|
|
2677
|
-
if (0 ===
|
|
2692
|
+
var p2, g2, M2 = Ht.multiply(Ht.multiply(m2, f2, ei), y2, ei), x2 = Ht.multiply(Ht.multiply(M2, _2, ai), d2, ai), w2 = Ht.multiplyByVector(M2, i2, Ks), S2 = function(t3, s3, i3, e3, a3) {
|
|
2693
|
+
var n3, r3 = e3 * e3, h3 = a3 * a3, o3 = (t3[Ht.COLUMN1ROW1] - t3[Ht.COLUMN2ROW2]) * h3, c3 = a3 * (e3 * Hs(t3[Ht.COLUMN1ROW0], t3[Ht.COLUMN0ROW1], st.EPSILON15) + s3.y), l3 = t3[Ht.COLUMN0ROW0] * r3 + t3[Ht.COLUMN2ROW2] * h3 + e3 * s3.x + i3, d3 = h3 * Hs(t3[Ht.COLUMN2ROW1], t3[Ht.COLUMN1ROW2], st.EPSILON15), m3 = a3 * (e3 * Hs(t3[Ht.COLUMN2ROW0], t3[Ht.COLUMN0ROW2]) + s3.z), _3 = [];
|
|
2694
|
+
if (0 === m3 && 0 === d3) {
|
|
2678
2695
|
if (0 === (n3 = As.computeRealRoots(o3, c3, l3)).length)
|
|
2679
|
-
return
|
|
2696
|
+
return _3;
|
|
2680
2697
|
var f3 = n3[0], y3 = Math.sqrt(Math.max(1 - f3 * f3, 0));
|
|
2681
|
-
if (
|
|
2682
|
-
var p3 = n3[1],
|
|
2683
|
-
|
|
2698
|
+
if (_3.push(new u(e3, a3 * f3, a3 * -y3)), _3.push(new u(e3, a3 * f3, a3 * y3)), 2 === n3.length) {
|
|
2699
|
+
var p3 = n3[1], g3 = Math.sqrt(Math.max(1 - p3 * p3, 0));
|
|
2700
|
+
_3.push(new u(e3, a3 * p3, a3 * -g3)), _3.push(new u(e3, a3 * p3, a3 * g3));
|
|
2684
2701
|
}
|
|
2685
|
-
return
|
|
2702
|
+
return _3;
|
|
2686
2703
|
}
|
|
2687
|
-
var
|
|
2704
|
+
var M3 = m3 * m3, x3 = d3 * d3, w3 = m3 * d3, S3 = o3 * o3 + x3, E3 = 2 * (c3 * o3 + w3), b3 = 2 * l3 * o3 + c3 * c3 - x3 + M3, P3 = 2 * (l3 * c3 - w3), v3 = l3 * l3 - M3;
|
|
2688
2705
|
if (0 === S3 && 0 === E3 && 0 === b3 && 0 === P3)
|
|
2689
|
-
return
|
|
2706
|
+
return _3;
|
|
2690
2707
|
var A3 = (n3 = Is.computeRealRoots(S3, E3, b3, P3, v3)).length;
|
|
2691
2708
|
if (0 === A3)
|
|
2692
|
-
return
|
|
2709
|
+
return _3;
|
|
2693
2710
|
for (var G3 = 0; G3 < A3; ++G3) {
|
|
2694
|
-
var
|
|
2695
|
-
T2 < 0 ?
|
|
2711
|
+
var N3 = n3[G3], C2 = N3 * N3, I2 = Math.max(1 - C2, 0), z2 = Math.sqrt(I2), T2 = (st.sign(o3) === st.sign(l3) ? Hs(o3 * C2 + l3, c3 * N3, st.EPSILON12) : st.sign(l3) === st.sign(c3 * N3) ? Hs(o3 * C2, c3 * N3 + l3, st.EPSILON12) : Hs(o3 * C2 + c3 * N3, l3, st.EPSILON12)) * Hs(d3 * N3, m3, st.EPSILON15);
|
|
2712
|
+
T2 < 0 ? _3.push(new u(e3, a3 * N3, a3 * z2)) : T2 > 0 ? _3.push(new u(e3, a3 * N3, a3 * -z2)) : 0 !== z2 ? (_3.push(new u(e3, a3 * N3, a3 * -z2)), _3.push(new u(e3, a3 * N3, a3 * z2)), ++G3) : _3.push(new u(e3, a3 * N3, a3 * z2));
|
|
2696
2713
|
}
|
|
2697
|
-
return
|
|
2698
|
-
}(x2, _t.negate(w2,
|
|
2714
|
+
return _3;
|
|
2715
|
+
}(x2, _t.negate(w2, Xs), 0, 0, 1), E2 = S2.length;
|
|
2699
2716
|
if (E2 > 0) {
|
|
2700
2717
|
for (var b2 = _t.clone(_t.ZERO, ri), P2 = Number.NEGATIVE_INFINITY, v2 = 0; v2 < E2; ++v2) {
|
|
2701
|
-
p2 = Ht.multiplyByVector(
|
|
2702
|
-
var A2 = _t.normalize(_t.subtract(p2, i2,
|
|
2718
|
+
p2 = Ht.multiplyByVector(_2, Ht.multiplyByVector(d2, S2[v2], ni), ni);
|
|
2719
|
+
var A2 = _t.normalize(_t.subtract(p2, i2, Qs), Qs), G2 = _t.dot(A2, e2);
|
|
2703
2720
|
G2 > P2 && (P2 = G2, b2 = _t.clone(p2, b2));
|
|
2704
2721
|
}
|
|
2705
|
-
var
|
|
2706
|
-
return P2 = st.clamp(P2, 0, 1),
|
|
2722
|
+
var N2 = s2.cartesianToCartographic(b2, hi);
|
|
2723
|
+
return P2 = st.clamp(P2, 0, 1), g2 = _t.magnitude(_t.subtract(b2, i2, Qs)) * Math.sqrt(1 - P2 * P2), g2 = n2 ? -g2 : g2, N2.z = g2, s2.cartographicToCartesian(N2, new u());
|
|
2707
2724
|
}
|
|
2708
2725
|
};
|
|
2709
|
-
var oi = new
|
|
2726
|
+
var oi = new u();
|
|
2710
2727
|
Os.lineSegmentPlane = function(t2, s2, i2, e2) {
|
|
2711
2728
|
if (!J(t2))
|
|
2712
2729
|
throw new tt("endPoint0 is required.");
|
|
@@ -2714,7 +2731,7 @@ Os.lineSegmentPlane = function(t2, s2, i2, e2) {
|
|
|
2714
2731
|
throw new tt("endPoint1 is required.");
|
|
2715
2732
|
if (!J(i2))
|
|
2716
2733
|
throw new tt("plane is required.");
|
|
2717
|
-
J(e2) || (e2 = new
|
|
2734
|
+
J(e2) || (e2 = new u());
|
|
2718
2735
|
var a2 = _t.subtract(s2, t2, oi), n2 = i2.normal, r2 = _t.dot(n2, a2);
|
|
2719
2736
|
if (!(Math.abs(r2) < st.EPSILON6)) {
|
|
2720
2737
|
var h2 = _t.dot(n2, t2), o2 = -(i2.constant + h2) / r2;
|
|
@@ -2724,15 +2741,15 @@ Os.lineSegmentPlane = function(t2, s2, i2, e2) {
|
|
|
2724
2741
|
}, Os.trianglePlaneIntersection = function(t2, s2, i2, e2) {
|
|
2725
2742
|
if (!(J(t2) && J(s2) && J(i2) && J(e2)))
|
|
2726
2743
|
throw new tt("p0, p1, p2, and plane are required.");
|
|
2727
|
-
var a2, n2, r2 = e2.normal, h2 = e2.constant, o2 = _t.dot(r2, t2) + h2 < 0, c2 = _t.dot(r2, s2) + h2 < 0, l2 = _t.dot(r2, i2) + h2 < 0,
|
|
2728
|
-
if (
|
|
2744
|
+
var a2, n2, r2 = e2.normal, h2 = e2.constant, o2 = _t.dot(r2, t2) + h2 < 0, c2 = _t.dot(r2, s2) + h2 < 0, l2 = _t.dot(r2, i2) + h2 < 0, d2 = 0;
|
|
2745
|
+
if (d2 += o2 ? 1 : 0, d2 += c2 ? 1 : 0, 1 !== (d2 += l2 ? 1 : 0) && 2 !== d2 || (a2 = new u(), n2 = new u()), 1 === d2) {
|
|
2729
2746
|
if (o2)
|
|
2730
2747
|
return Os.lineSegmentPlane(t2, s2, e2, a2), Os.lineSegmentPlane(t2, i2, e2, n2), { positions: [t2, s2, i2, a2, n2], indices: [0, 3, 4, 1, 2, 4, 1, 4, 3] };
|
|
2731
2748
|
if (c2)
|
|
2732
2749
|
return Os.lineSegmentPlane(s2, i2, e2, a2), Os.lineSegmentPlane(s2, t2, e2, n2), { positions: [t2, s2, i2, a2, n2], indices: [1, 3, 4, 2, 0, 4, 2, 4, 3] };
|
|
2733
2750
|
if (l2)
|
|
2734
2751
|
return Os.lineSegmentPlane(i2, t2, e2, a2), Os.lineSegmentPlane(i2, s2, e2, n2), { positions: [t2, s2, i2, a2, n2], indices: [2, 3, 4, 0, 1, 4, 0, 4, 3] };
|
|
2735
|
-
} else if (2 ===
|
|
2752
|
+
} else if (2 === d2) {
|
|
2736
2753
|
if (!o2)
|
|
2737
2754
|
return Os.lineSegmentPlane(s2, t2, e2, a2), Os.lineSegmentPlane(i2, t2, e2, n2), { positions: [t2, s2, i2, a2, n2], indices: [1, 2, 4, 1, 4, 3, 0, 3, 4] };
|
|
2738
2755
|
if (!c2)
|
|
@@ -2743,13 +2760,13 @@ Os.lineSegmentPlane = function(t2, s2, i2, e2) {
|
|
|
2743
2760
|
};
|
|
2744
2761
|
class ci {
|
|
2745
2762
|
static clone(t2, s2) {
|
|
2746
|
-
return s2 || (s2 = new
|
|
2763
|
+
return s2 || (s2 = new y()), s2.copy(t2), s2;
|
|
2747
2764
|
}
|
|
2748
2765
|
static fromElements(t2, s2, i2, e2, a2) {
|
|
2749
|
-
return a2 || (a2 = new
|
|
2766
|
+
return a2 || (a2 = new y()), a2.set(t2, s2, i2, e2), a2;
|
|
2750
2767
|
}
|
|
2751
2768
|
static lerp(t2, s2, i2, e2) {
|
|
2752
|
-
return e2 || (e2 = new
|
|
2769
|
+
return e2 || (e2 = new y()), e2.lerpVectors(t2, s2, i2), e2;
|
|
2753
2770
|
}
|
|
2754
2771
|
static equals(t2, s2) {
|
|
2755
2772
|
return t2.equals(s2);
|
|
@@ -2758,21 +2775,21 @@ class ci {
|
|
|
2758
2775
|
return t2 === s2 ? (t2.normalize(), t2) : (s2.copy(t2), s2.normalize(), s2);
|
|
2759
2776
|
}
|
|
2760
2777
|
static add(t2, s2, i2) {
|
|
2761
|
-
return i2 || (i2 = new
|
|
2778
|
+
return i2 || (i2 = new y()), i2.addVectors(t2, s2);
|
|
2762
2779
|
}
|
|
2763
2780
|
static multiplyByScalar(t2, s2, i2) {
|
|
2764
|
-
return i2 || (i2 = new
|
|
2781
|
+
return i2 || (i2 = new y()), i2.copy(t2).multiplyScalar(s2), i2;
|
|
2765
2782
|
}
|
|
2766
2783
|
static subtract(t2, s2, i2) {
|
|
2767
|
-
return i2 || (i2 = new
|
|
2784
|
+
return i2 || (i2 = new y()), i2.subVectors(t2, s2), i2;
|
|
2768
2785
|
}
|
|
2769
2786
|
static distance(t2, s2) {
|
|
2770
2787
|
return t2.distanceTo(s2);
|
|
2771
2788
|
}
|
|
2772
2789
|
}
|
|
2773
|
-
__publicField(ci, "ZERO", new
|
|
2774
|
-
__publicField(ci, "UNIT_W", Object.freeze(new
|
|
2775
|
-
const li = new
|
|
2790
|
+
__publicField(ci, "ZERO", new y(0, 0, 0, 0));
|
|
2791
|
+
__publicField(ci, "UNIT_W", Object.freeze(new y(0, 0, 0, 1)));
|
|
2792
|
+
const li = new u(), ui = new u(), di = new D(), mi = new y(0, 0, 0, 0), _i = new u();
|
|
2776
2793
|
class fi {
|
|
2777
2794
|
static fromPointNormal(t2, s2, i2) {
|
|
2778
2795
|
return i2 || (i2 = new K()), i2.setFromNormalAndCoplanarPoint(s2, t2), i2;
|
|
@@ -2787,7 +2804,7 @@ class fi {
|
|
|
2787
2804
|
return _t.dot(t2.normal, s2) + t2.constant;
|
|
2788
2805
|
}
|
|
2789
2806
|
static projectPointOntoPlane(t2, s2, i2) {
|
|
2790
|
-
J(i2) || (i2 = new
|
|
2807
|
+
J(i2) || (i2 = new u());
|
|
2791
2808
|
const e2 = fi.getPointDistance(t2, s2), a2 = _t.multiplyByScalar(t2.normal, e2, ui);
|
|
2792
2809
|
return _t.subtract(s2, a2, i2);
|
|
2793
2810
|
}
|
|
@@ -2806,8 +2823,8 @@ class fi {
|
|
|
2806
2823
|
}
|
|
2807
2824
|
}
|
|
2808
2825
|
K.ORIGIN_XY_PLANE = Object.freeze(new fi(_t.UNIT_Z, 0)), K.ORIGIN_YZ_PLANE = Object.freeze(new fi(_t.UNIT_X, 0)), K.ORIGIN_ZX_PLANE = Object.freeze(new fi(_t.UNIT_Y, 0));
|
|
2809
|
-
const yi = new
|
|
2810
|
-
class
|
|
2826
|
+
const yi = new y(0, 0, 0, 0), pi = new k(), gi = new u();
|
|
2827
|
+
class Mi {
|
|
2811
2828
|
constructor(t2, s2) {
|
|
2812
2829
|
if (!J(t2 = (s2 = $(s2, Wt.WGS84)).scaleToGeodeticSurface(t2)))
|
|
2813
2830
|
throw new tt("origin must not be at the center of the ellipsoid.");
|
|
@@ -2819,19 +2836,19 @@ class gi {
|
|
|
2819
2836
|
static fromPoints(t2, s2) {
|
|
2820
2837
|
let i2 = t2[0].x, e2 = t2[0].y, a2 = t2[0].z, n2 = t2[0].x, r2 = t2[0].y, h2 = t2[0].z;
|
|
2821
2838
|
for (let s3 = 0; s3 < t2.length; s3++) {
|
|
2822
|
-
const o3 = t2[s3], c3 = o3.x, l3 = o3.y,
|
|
2823
|
-
i2 = Math.min(c3, i2), n2 = Math.max(c3, n2), e2 = Math.min(l3, e2), r2 = Math.max(l3, r2), a2 = Math.min(
|
|
2839
|
+
const o3 = t2[s3], c3 = o3.x, l3 = o3.y, u2 = o3.z;
|
|
2840
|
+
i2 = Math.min(c3, i2), n2 = Math.max(c3, n2), e2 = Math.min(l3, e2), r2 = Math.max(l3, r2), a2 = Math.min(u2, a2), h2 = Math.max(u2, h2);
|
|
2824
2841
|
}
|
|
2825
|
-
const o2 = new
|
|
2826
|
-
let
|
|
2827
|
-
return
|
|
2842
|
+
const o2 = new u(i2, e2, a2), c2 = new u(n2, r2, h2), l2 = new p(o2, c2);
|
|
2843
|
+
let d2 = new u();
|
|
2844
|
+
return d2 = l2.getCenter(d2), new Mi(d2, s2);
|
|
2828
2845
|
}
|
|
2829
2846
|
projectPointToNearestOnPlane(t2, s2) {
|
|
2830
2847
|
J(s2) || (s2 = new is());
|
|
2831
2848
|
const i2 = pi;
|
|
2832
2849
|
i2.origin = t2, _t.clone(this._plane.normal, i2.direction);
|
|
2833
|
-
let e2 = Os.rayPlane(i2, this._plane,
|
|
2834
|
-
if (J(e2) || (_t.negate(i2.direction, i2.direction), e2 = Os.rayPlane(i2, this._plane,
|
|
2850
|
+
let e2 = Os.rayPlane(i2, this._plane, gi);
|
|
2851
|
+
if (J(e2) || (_t.negate(i2.direction, i2.direction), e2 = Os.rayPlane(i2, this._plane, gi)), J(e2)) {
|
|
2835
2852
|
const t3 = _t.subtract(e2, this._origin, e2), i3 = _t.dot(this._xAxis, t3), a2 = _t.dot(this._yAxis, t3);
|
|
2836
2853
|
return J(s2) ? (s2.x = i3, s2.y = a2, s2) : new c(i3, a2);
|
|
2837
2854
|
}
|
|
@@ -2849,8 +2866,8 @@ class gi {
|
|
|
2849
2866
|
projectPointOntoPlane(t2, s2) {
|
|
2850
2867
|
const i2 = pi;
|
|
2851
2868
|
i2.origin = t2, _t.normalize(t2, i2.direction);
|
|
2852
|
-
let e2 = Os.rayPlane(i2, this._plane,
|
|
2853
|
-
if (J(e2) || (_t.negate(i2.direction, i2.direction), e2 = Os.rayPlane(i2, this._plane,
|
|
2869
|
+
let e2 = Os.rayPlane(i2, this._plane, gi);
|
|
2870
|
+
if (J(e2) || (_t.negate(i2.direction, i2.direction), e2 = Os.rayPlane(i2, this._plane, gi)), J(e2)) {
|
|
2854
2871
|
const t3 = _t.subtract(e2, this._origin, e2), i3 = _t.dot(this._xAxis, t3), a2 = _t.dot(this._yAxis, t3);
|
|
2855
2872
|
return J(s2) ? (s2.x = i3, s2.y = a2, s2) : new c(i3, a2);
|
|
2856
2873
|
}
|
|
@@ -2877,7 +2894,7 @@ class gi {
|
|
|
2877
2894
|
var xi = Object.freeze({ OUTSIDE: -1, INTERSECTING: 0, INSIDE: 1 });
|
|
2878
2895
|
class wi {
|
|
2879
2896
|
constructor(t2, s2) {
|
|
2880
|
-
this.isOrientedBoundingBox = true, this.center = _t.clone($(t2, _t.ZERO), new
|
|
2897
|
+
this.isOrientedBoundingBox = true, this.center = _t.clone($(t2, _t.ZERO), new u()), this.halfAxes = Ht.clone($(s2, Ht.ZERO));
|
|
2881
2898
|
}
|
|
2882
2899
|
intersectPlane(t2) {
|
|
2883
2900
|
return wi.intersectPlane(this, t2);
|
|
@@ -2892,14 +2909,14 @@ class wi {
|
|
|
2892
2909
|
return J(t2) ? (t2.copy(this.center), t2) : this.center.clone();
|
|
2893
2910
|
}
|
|
2894
2911
|
intersectsObb(t2) {
|
|
2895
|
-
const s2 = this.center, i2 = t2.center, e2 = this.halfAxes, a2 = t2.halfAxes, n2 = new
|
|
2912
|
+
const s2 = this.center, i2 = t2.center, e2 = this.halfAxes, a2 = t2.halfAxes, n2 = new u().subVectors(i2, s2), r2 = new u(e2.elements[0], e2.elements[1], e2.elements[2]), h2 = new u(e2.elements[3], e2.elements[4], e2.elements[5]), o2 = new u(e2.elements[6], e2.elements[7], e2.elements[8]), c2 = new u(a2.elements[0], a2.elements[1], a2.elements[2]), l2 = new u(a2.elements[3], a2.elements[4], a2.elements[5]), d2 = new u(a2.elements[6], a2.elements[7], a2.elements[8]), m2 = r2.length(), _2 = h2.length(), f2 = o2.length();
|
|
2896
2913
|
r2.normalize(), h2.normalize(), o2.normalize();
|
|
2897
|
-
const y2 = c2.length(), p2 = l2.length(),
|
|
2898
|
-
let
|
|
2899
|
-
return c2.normalize(), l2.normalize(),
|
|
2914
|
+
const y2 = c2.length(), p2 = l2.length(), g2 = d2.length();
|
|
2915
|
+
let M2, x2, w2;
|
|
2916
|
+
return c2.normalize(), l2.normalize(), d2.normalize(), M2 = m2, x2 = y2 * Math.abs(r2.dot(c2)) + p2 * Math.abs(r2.dot(l2)) + g2 * Math.abs(r2.dot(d2)), w2 = Math.abs(n2.dot(r2)), !(w2 > M2 + x2) && (M2 = _2, x2 = y2 * Math.abs(h2.dot(c2)) + p2 * Math.abs(h2.dot(l2)) + g2 * Math.abs(h2.dot(d2)), w2 = Math.abs(n2.dot(h2)), !(w2 > M2 + x2) && (M2 = f2, x2 = y2 * Math.abs(o2.dot(c2)) + p2 * Math.abs(o2.dot(l2)) + g2 * Math.abs(o2.dot(d2)), w2 = Math.abs(n2.dot(o2)), !(w2 > M2 + x2) && (M2 = m2 * Math.abs(c2.dot(r2)) + _2 * Math.abs(c2.dot(h2)) + f2 * Math.abs(c2.dot(o2)), x2 = y2, w2 = Math.abs(n2.dot(c2)), !(w2 > M2 + x2) && (M2 = m2 * Math.abs(l2.dot(r2)) + _2 * Math.abs(l2.dot(h2)) + f2 * Math.abs(l2.dot(o2)), x2 = p2, w2 = Math.abs(n2.dot(l2)), !(w2 > M2 + x2) && (M2 = m2 * Math.abs(d2.dot(r2)) + _2 * Math.abs(d2.dot(h2)) + f2 * Math.abs(d2.dot(o2)), x2 = g2, w2 = Math.abs(n2.dot(d2)), !(w2 > M2 + x2))))));
|
|
2900
2917
|
}
|
|
2901
2918
|
}
|
|
2902
|
-
const Si = new
|
|
2919
|
+
const Si = new u(), Ei = new u();
|
|
2903
2920
|
function bi(t2, s2, i2, e2, a2, n2, r2, h2, o2, c2, l2) {
|
|
2904
2921
|
if (!(J(a2) && J(n2) && J(r2) && J(h2) && J(o2) && J(c2)))
|
|
2905
2922
|
throw new tt("all extents (minimum/maximum X/Y/Z) are required.");
|
|
@@ -2913,7 +2930,7 @@ function bi(t2, s2, i2, e2, a2, n2, r2, h2, o2, c2, l2) {
|
|
|
2913
2930
|
const _2 = l2.center;
|
|
2914
2931
|
return d2 = Ht.multiplyByVector(u2, d2, d2), _t.add(t2, d2, _2), Ht.multiplyByScale(u2, m2, u2), l2;
|
|
2915
2932
|
}
|
|
2916
|
-
const Pi = new
|
|
2933
|
+
const Pi = new u(), vi = new u(), Ai = new u(), Gi = new u(), Ni = new u(), Ci = new u(), Ii = new u(), zi = new u(), Ti = new u(), Oi = new u(), Ri = new u(), qi = new u(), Li = new c(), Bi = new c(), ki = new c(), Di = new c(), Ui = new c(), ji = new u(), Fi = new u(), Vi = new u(), Wi = new u(), Hi = new c(), Xi = new u(), Yi = new u(), Zi = new u(), Qi = new K(new u(1, 0, 0), 0);
|
|
2917
2934
|
wi.fromRectangle = function(t2, s2, i2, e2, a2) {
|
|
2918
2935
|
if (!J(t2))
|
|
2919
2936
|
throw new tt("rectangle is required");
|
|
@@ -2925,25 +2942,25 @@ wi.fromRectangle = function(t2, s2, i2, e2, a2) {
|
|
|
2925
2942
|
throw new tt("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");
|
|
2926
2943
|
let n2, r2, h2, o2, c2, l2, u2;
|
|
2927
2944
|
if (s2 = $(s2, 0), i2 = $(i2, 0), e2 = $(e2, Wt.WGS84), t2.width <= st.PI) {
|
|
2928
|
-
const d3 = it.center(t2, Pi), m3 = e2.cartographicToCartesian(d3, vi), _3 = new
|
|
2945
|
+
const d3 = it.center(t2, Pi), m3 = e2.cartographicToCartesian(d3, vi), _3 = new Mi(m3, e2);
|
|
2929
2946
|
u2 = _3.plane;
|
|
2930
|
-
const f3 = d3.x, y3 = t2.south < 0 && t2.north > 0 ? 0 : d3.y, p3 = $t.fromRadians(f3, t2.north, i2, Ai),
|
|
2931
|
-
let E2 = e2.cartographicToCartesian(
|
|
2932
|
-
const b2 = e2.cartographicToCartesian(
|
|
2947
|
+
const f3 = d3.x, y3 = t2.south < 0 && t2.north > 0 ? 0 : d3.y, p3 = $t.fromRadians(f3, t2.north, i2, Ai), g3 = $t.fromRadians(t2.west, t2.north, i2, Gi), M3 = $t.fromRadians(t2.west, y3, i2, Ni), x3 = $t.fromRadians(t2.west, t2.south, i2, Ci), w3 = $t.fromRadians(f3, t2.south, i2, Ii), S2 = e2.cartographicToCartesian(p3, zi);
|
|
2948
|
+
let E2 = e2.cartographicToCartesian(g3, Ti);
|
|
2949
|
+
const b2 = e2.cartographicToCartesian(M3, Oi);
|
|
2933
2950
|
let P2 = e2.cartographicToCartesian(x3, Ri);
|
|
2934
|
-
const v2 = e2.cartographicToCartesian(w3, qi), A2 = _3.projectPointToNearestOnPlane(S2, Li), G2 = _3.projectPointToNearestOnPlane(E2, Bi),
|
|
2935
|
-
return n2 = Math.min(G2.x,
|
|
2951
|
+
const v2 = e2.cartographicToCartesian(w3, qi), A2 = _3.projectPointToNearestOnPlane(S2, Li), G2 = _3.projectPointToNearestOnPlane(E2, Bi), N2 = _3.projectPointToNearestOnPlane(b2, ki), C2 = _3.projectPointToNearestOnPlane(P2, Di), I2 = _3.projectPointToNearestOnPlane(v2, Ui);
|
|
2952
|
+
return n2 = Math.min(G2.x, N2.x, C2.x), r2 = -n2, o2 = Math.max(G2.y, A2.y), h2 = Math.min(C2.y, I2.y), g3.z = x3.z = s2, E2 = e2.cartographicToCartesian(g3, Ti), P2 = e2.cartographicToCartesian(x3, Ri), c2 = Math.min(fi.getPointDistance(u2, E2), fi.getPointDistance(u2, P2)), l2 = i2, bi(_3.origin, _3.xAxis, _3.yAxis, _3.zAxis, n2, r2, h2, o2, c2, l2, a2);
|
|
2936
2953
|
}
|
|
2937
2954
|
const d2 = t2.south > 0, m2 = t2.north < 0, _2 = d2 ? t2.south : m2 ? t2.north : 0, f2 = it.center(t2, Pi).x, y2 = _t.fromRadians(f2, _2, i2, e2, ji);
|
|
2938
2955
|
y2.z = 0;
|
|
2939
|
-
const p2 = Math.abs(y2.x) < st.EPSILON10 && Math.abs(y2.y) < st.EPSILON10 ? _t.UNIT_X : _t.normalize(y2, Fi),
|
|
2940
|
-
u2 = fi.fromPointNormal(y2, p2,
|
|
2956
|
+
const p2 = Math.abs(y2.x) < st.EPSILON10 && Math.abs(y2.y) < st.EPSILON10 ? _t.UNIT_X : _t.normalize(y2, Fi), g2 = _t.UNIT_Z, M2 = _t.cross(p2, g2, Vi);
|
|
2957
|
+
u2 = fi.fromPointNormal(y2, p2, Qi);
|
|
2941
2958
|
const x2 = _t.fromRadians(f2 + st.PI_OVER_TWO, _2, i2, e2, Wi);
|
|
2942
|
-
r2 = _t.dot(fi.projectPointOntoPlane(u2, x2, Hi),
|
|
2943
|
-
const w2 = _t.fromRadians(t2.east, _2, i2, e2,
|
|
2944
|
-
return c2 = fi.getPointDistance(u2, w2), l2 = 0, bi(y2,
|
|
2959
|
+
r2 = _t.dot(fi.projectPointOntoPlane(u2, x2, Hi), M2), n2 = -r2, o2 = _t.fromRadians(0, t2.north, m2 ? s2 : i2, e2, Xi).z, h2 = _t.fromRadians(0, t2.south, d2 ? s2 : i2, e2, Yi).z;
|
|
2960
|
+
const w2 = _t.fromRadians(t2.east, _2, i2, e2, Zi);
|
|
2961
|
+
return c2 = fi.getPointDistance(u2, w2), l2 = 0, bi(y2, M2, g2, p2, n2, r2, h2, o2, c2, l2, a2);
|
|
2945
2962
|
};
|
|
2946
|
-
const Ki = new
|
|
2963
|
+
const Ki = new u(), Ji = new u(), $i = new u(), te = new u(), se = new u(), ie = new u();
|
|
2947
2964
|
wi.distanceSquaredTo = function(t2, s2) {
|
|
2948
2965
|
if (!J(t2))
|
|
2949
2966
|
throw new tt("box is required.");
|
|
@@ -2967,8 +2984,8 @@ wi.distanceSquaredTo = function(t2, s2) {
|
|
|
2967
2984
|
3 === m2 && (a2 = _t.UNIT_X, n2 = _t.UNIT_Y, r2 = _t.UNIT_Z);
|
|
2968
2985
|
const p2 = ie;
|
|
2969
2986
|
p2.x = _t.dot(i2, a2), p2.y = _t.dot(i2, n2), p2.z = _t.dot(i2, r2);
|
|
2970
|
-
let
|
|
2971
|
-
return p2.x < -h2 ? (
|
|
2987
|
+
let g2, M2 = 0;
|
|
2988
|
+
return p2.x < -h2 ? (g2 = p2.x + h2, M2 += g2 * g2) : p2.x > h2 && (g2 = p2.x - h2, M2 += g2 * g2), p2.y < -o2 ? (g2 = p2.y + o2, M2 += g2 * g2) : p2.y > o2 && (g2 = p2.y - o2, M2 += g2 * g2), p2.z < -c2 ? (g2 = p2.z + c2, M2 += g2 * g2) : p2.z > c2 && (g2 = p2.z - c2, M2 += g2 * g2), M2;
|
|
2972
2989
|
}, wi.intersectPlane = function(t2, s2) {
|
|
2973
2990
|
if (!J(t2))
|
|
2974
2991
|
throw new tt("box is required.");
|
|
@@ -2977,9 +2994,9 @@ wi.distanceSquaredTo = function(t2, s2) {
|
|
|
2977
2994
|
const i2 = t2.center, e2 = s2.normal, a2 = t2.halfAxes, n2 = e2.x, r2 = e2.y, h2 = e2.z, o2 = a2.elements, c2 = Math.abs(n2 * o2[Ht.COLUMN0ROW0] + r2 * o2[Ht.COLUMN0ROW1] + h2 * o2[Ht.COLUMN0ROW2]) + Math.abs(n2 * o2[Ht.COLUMN1ROW0] + r2 * o2[Ht.COLUMN1ROW1] + h2 * o2[Ht.COLUMN1ROW2]) + Math.abs(n2 * o2[Ht.COLUMN2ROW0] + r2 * o2[Ht.COLUMN2ROW1] + h2 * o2[Ht.COLUMN2ROW2]), l2 = _t.dot(e2.clone(), i2) + s2.constant;
|
|
2978
2995
|
return l2 <= -c2 ? xi.OUTSIDE : l2 >= c2 ? xi.INSIDE : xi.INTERSECTING;
|
|
2979
2996
|
};
|
|
2980
|
-
const ee = new
|
|
2997
|
+
const ee = new u(), ae = new u(), ne = new u();
|
|
2981
2998
|
wi.computeCorners = function(t2, s2) {
|
|
2982
|
-
J(s2) || (s2 = [new
|
|
2999
|
+
J(s2) || (s2 = [new u(), new u(), new u(), new u(), new u(), new u(), new u(), new u()]);
|
|
2983
3000
|
const i2 = t2.center, e2 = t2.halfAxes, a2 = Ht.getColumn(e2, 0, ee), n2 = Ht.getColumn(e2, 1, ae), r2 = Ht.getColumn(e2, 2, ne);
|
|
2984
3001
|
return _t.clone(i2, s2[0]), _t.subtract(s2[0], a2, s2[0]), _t.subtract(s2[0], n2, s2[0]), _t.subtract(s2[0], r2, s2[0]), _t.clone(i2, s2[1]), _t.subtract(s2[1], a2, s2[1]), _t.subtract(s2[1], n2, s2[1]), _t.add(s2[1], r2, s2[1]), _t.clone(i2, s2[2]), _t.subtract(s2[2], a2, s2[2]), _t.add(s2[2], n2, s2[2]), _t.subtract(s2[2], r2, s2[2]), _t.clone(i2, s2[3]), _t.subtract(s2[3], a2, s2[3]), _t.add(s2[3], n2, s2[3]), _t.add(s2[3], r2, s2[3]), _t.clone(i2, s2[4]), _t.add(s2[4], a2, s2[4]), _t.subtract(s2[4], n2, s2[4]), _t.subtract(s2[4], r2, s2[4]), _t.clone(i2, s2[5]), _t.add(s2[5], a2, s2[5]), _t.subtract(s2[5], n2, s2[5]), _t.add(s2[5], r2, s2[5]), _t.clone(i2, s2[6]), _t.add(s2[6], a2, s2[6]), _t.add(s2[6], n2, s2[6]), _t.subtract(s2[6], r2, s2[6]), _t.clone(i2, s2[7]), _t.add(s2[7], a2, s2[7]), _t.add(s2[7], n2, s2[7]), _t.add(s2[7], r2, s2[7]), s2;
|
|
2985
3002
|
}, wi.fromGeoBoundingBox = function(t2, s2) {
|
|
@@ -2988,7 +3005,7 @@ wi.computeCorners = function(t2, s2) {
|
|
|
2988
3005
|
const i2 = t2.min, e2 = t2.max, a2 = it.fromBox(t2, null, true);
|
|
2989
3006
|
return wi.fromRectangle(a2, i2.z, e2.z, null, s2);
|
|
2990
3007
|
};
|
|
2991
|
-
class re extends
|
|
3008
|
+
class re extends Nt {
|
|
2992
3009
|
constructor() {
|
|
2993
3010
|
super(...arguments);
|
|
2994
3011
|
__publicField(this, "name", xt);
|
|
@@ -3000,11 +3017,11 @@ class re extends Ct {
|
|
|
3000
3017
|
return Wt.WGS84.cartesianToCartographicDegree(t2, s2);
|
|
3001
3018
|
}
|
|
3002
3019
|
getGeodeticSurfaceNormal(t2, s2) {
|
|
3003
|
-
s2 || (s2 = new
|
|
3020
|
+
s2 || (s2 = new u());
|
|
3004
3021
|
return Wt.WGS84.geodeticSurfaceNormalCartographic(t2, s2);
|
|
3005
3022
|
}
|
|
3006
3023
|
getProjectedSurfaceNormal(t2, s2) {
|
|
3007
|
-
s2 || (s2 = new
|
|
3024
|
+
s2 || (s2 = new u());
|
|
3008
3025
|
return Wt.WGS84.geodeticSurfaceNormal(t2, s2);
|
|
3009
3026
|
}
|
|
3010
3027
|
geoBoxToProjectedBox(t2, s2) {
|
|
@@ -3136,62 +3153,62 @@ oe(ce.prototype, { equals: function(t2) {
|
|
|
3136
3153
|
}, getZoomUnits: function(t2) {
|
|
3137
3154
|
return Math.pow(2, 18 - t2);
|
|
3138
3155
|
} });
|
|
3139
|
-
const ue = 2003772636e-2, de = 1247410417e-2, me = new
|
|
3140
|
-
class _e extends
|
|
3156
|
+
const ue = 2003772636e-2, de = 1247410417e-2, me = new u();
|
|
3157
|
+
class _e extends Nt {
|
|
3141
3158
|
constructor() {
|
|
3142
3159
|
super(...arguments);
|
|
3143
3160
|
__publicField(this, "name", wt);
|
|
3144
3161
|
__publicField(this, "isAxisAligned", true);
|
|
3145
3162
|
__publicField(this, "unprojectCoordinate", (t2, s2, i2) => {
|
|
3146
|
-
s2 || (s2 = new
|
|
3163
|
+
s2 || (s2 = new u()), me.copy(t2), t2.x < -ue && (me.x = -ue), t2.x > ue && (me.x = ue), t2.y < -de && (me.y = -de), t2.y > de && (me.y = de);
|
|
3147
3164
|
const e2 = he.convertMC2LL({ lng: me.x, lat: me.y });
|
|
3148
|
-
return s2.set(Number(e2.lng), Number(e2.lat), me.z), i2 && (s2.x =
|
|
3165
|
+
return s2.set(Number(e2.lng), Number(e2.lat), me.z), i2 && (s2.x = Ct(t2.x, s2.x, 180, ue), s2.y = Ct(t2.y, s2.y, 74, de)), s2;
|
|
3149
3166
|
});
|
|
3150
3167
|
}
|
|
3151
3168
|
projectCoordinate(t2, s2, i2 = false) {
|
|
3152
|
-
s2 || (s2 = new
|
|
3169
|
+
s2 || (s2 = new u()), me.copy(t2), t2.x < -180 && (me.x = -180), t2.x > 180 && (me.x = 180), t2.y < -74 && (me.y = -74), t2.y > 74 && (me.y = 74);
|
|
3153
3170
|
const e2 = he.convertLL2MC({ lng: me.x, lat: me.y });
|
|
3154
3171
|
return s2.set(Number(e2.lng), Number(e2.lat), me.z), i2 && (s2.x = It(t2.x, s2.x, 180, ue), s2.y = It(t2.y, s2.y, 74, de)), s2;
|
|
3155
3172
|
}
|
|
3156
3173
|
}
|
|
3157
3174
|
const fe = 6378137 * Math.PI / 180;
|
|
3158
|
-
class ye extends
|
|
3175
|
+
class ye extends Nt {
|
|
3159
3176
|
constructor() {
|
|
3160
3177
|
super(...arguments);
|
|
3161
|
-
__publicField(this, "name",
|
|
3178
|
+
__publicField(this, "name", gt);
|
|
3162
3179
|
__publicField(this, "isGeo", true);
|
|
3163
3180
|
__publicField(this, "isAxisAligned", true);
|
|
3164
3181
|
}
|
|
3165
3182
|
projectCoordinate(t2, s2) {
|
|
3166
|
-
return s2 || (s2 = new
|
|
3183
|
+
return s2 || (s2 = new u()), s2.x = t2.x * fe, s2.y = t2.y * fe, s2.z = t2.z, s2;
|
|
3167
3184
|
}
|
|
3168
3185
|
unprojectCoordinate(t2, s2) {
|
|
3169
|
-
return s2 || (s2 = new
|
|
3186
|
+
return s2 || (s2 = new u()), s2.x = t2.x / fe, s2.y = t2.y / fe, s2.z = t2.z, s2;
|
|
3170
3187
|
}
|
|
3171
3188
|
}
|
|
3172
|
-
class pe extends
|
|
3189
|
+
class pe extends Nt {
|
|
3173
3190
|
constructor() {
|
|
3174
3191
|
super(...arguments);
|
|
3175
3192
|
__publicField(this, "name", St);
|
|
3176
3193
|
__publicField(this, "isAxisAligned", true);
|
|
3177
3194
|
}
|
|
3178
3195
|
projectCoordinate(t2, s2) {
|
|
3179
|
-
return s2 || (s2 = new
|
|
3196
|
+
return s2 || (s2 = new u()), s2.x = t2.x, s2.y = -t2.y, s2.z = t2.z, s2;
|
|
3180
3197
|
}
|
|
3181
3198
|
unprojectCoordinate(t2, s2) {
|
|
3182
|
-
return s2 || (s2 = new
|
|
3199
|
+
return s2 || (s2 = new u()), s2.x = t2.x, s2.y = -t2.y, s2.z = t2.z, s2;
|
|
3183
3200
|
}
|
|
3184
3201
|
}
|
|
3185
3202
|
"undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self && self;
|
|
3186
|
-
var
|
|
3187
|
-
|
|
3203
|
+
var ge = { exports: {} };
|
|
3204
|
+
ge.exports = function() {
|
|
3188
3205
|
function t2(t3) {
|
|
3189
3206
|
t3("EPSG:4326", "+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"), t3("EPSG:4269", "+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"), t3("EPSG:3857", "+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");
|
|
3190
3207
|
for (var s3 = 1; s3 <= 60; ++s3)
|
|
3191
3208
|
t3("EPSG:" + (32600 + s3), "+proj=utm +zone=" + s3 + " +datum=WGS84 +units=m"), t3("EPSG:" + (32700 + s3), "+proj=utm +zone=" + s3 + " +south +datum=WGS84 +units=m");
|
|
3192
3209
|
t3.WGS84 = t3["EPSG:4326"], t3["EPSG:3785"] = t3["EPSG:3857"], t3.GOOGLE = t3["EPSG:3857"], t3["EPSG:900913"] = t3["EPSG:3857"], t3["EPSG:102113"] = t3["EPSG:3857"];
|
|
3193
3210
|
}
|
|
3194
|
-
var s2 = 1, i2 = 2, e2 = 3, a2 = 4, n2 = 5, r2 = 6378137, h2 = 6356752314e-3, o2 = 0.0066943799901413165, c2 = 484813681109536e-20, l2 = Math.PI / 2, u2 = 0.16666666666666666, d2 = 0.04722222222222222, m2 = 0.022156084656084655, _2 = 1e-10, f2 = 0.017453292519943295, y2 = 57.29577951308232, p2 = Math.PI / 4,
|
|
3211
|
+
var s2 = 1, i2 = 2, e2 = 3, a2 = 4, n2 = 5, r2 = 6378137, h2 = 6356752314e-3, o2 = 0.0066943799901413165, c2 = 484813681109536e-20, l2 = Math.PI / 2, u2 = 0.16666666666666666, d2 = 0.04722222222222222, m2 = 0.022156084656084655, _2 = 1e-10, f2 = 0.017453292519943295, y2 = 57.29577951308232, p2 = Math.PI / 4, g2 = 2 * Math.PI, M2 = 3.14159265359, x2 = { greenwich: 0, lisbon: -9.131906111111, paris: 2.337229166667, bogota: -74.080916666667, madrid: -3.687938888889, rome: 12.452333333333, bern: 7.439583333333, jakarta: 106.807719444444, ferro: -17.666666666667, brussels: 4.367975, stockholm: 18.058277777778, athens: 23.7163375, oslo: 10.722916666667 }, w2 = { mm: { to_meter: 1e-3 }, cm: { to_meter: 0.01 }, ft: { to_meter: 0.3048 }, "us-ft": { to_meter: 1200 / 3937 }, fath: { to_meter: 1.8288 }, kmi: { to_meter: 1852 }, "us-ch": { to_meter: 20.1168402336805 }, "us-mi": { to_meter: 1609.34721869444 }, km: { to_meter: 1e3 }, "ind-ft": { to_meter: 0.30479841 }, "ind-yd": { to_meter: 0.91439523 }, mi: { to_meter: 1609.344 }, yd: { to_meter: 0.9144 }, ch: { to_meter: 20.1168 }, link: { to_meter: 0.201168 }, dm: { to_meter: 0.1 }, in: { to_meter: 0.0254 }, "ind-ch": { to_meter: 20.11669506 }, "us-in": { to_meter: 0.025400050800101 }, "us-yd": { to_meter: 0.914401828803658 } }, S2 = /[\s_\-\/\(\)]/g;
|
|
3195
3212
|
function E2(t3, s3) {
|
|
3196
3213
|
if (t3[s3])
|
|
3197
3214
|
return t3[s3];
|
|
@@ -3414,10 +3431,10 @@ Me.exports = function() {
|
|
|
3414
3431
|
function G2(t3) {
|
|
3415
3432
|
return t3.find((t4) => Array.isArray(t4) && "USAGE" === t4[0]) ? "2019" : (t3.find((t4) => Array.isArray(t4) && "CS" === t4[0]) || "BOUNDCRS" === t3[0] || "PROJCRS" === t3[0] || t3[0], "2015");
|
|
3416
3433
|
}
|
|
3417
|
-
function
|
|
3434
|
+
function N2(t3) {
|
|
3418
3435
|
return ("2019" === G2(t3) ? A2 : v2).convert(t3);
|
|
3419
3436
|
}
|
|
3420
|
-
function
|
|
3437
|
+
function C2(t3) {
|
|
3421
3438
|
const s3 = t3.toUpperCase();
|
|
3422
3439
|
return s3.includes("PROJCRS") || s3.includes("GEOGCRS") || s3.includes("BOUNDCRS") || s3.includes("VERTCRS") || s3.includes("LENGTHUNIT") || s3.includes("ANGLEUNIT") || s3.includes("SCALEUNIT") ? "WKT2" : (s3.includes("PROJCS") || s3.includes("GEOGCS") || s3.includes("LOCAL_CS") || s3.includes("VERT_CS") || s3.includes("UNIT"), "WKT1");
|
|
3423
3440
|
}
|
|
@@ -3560,22 +3577,22 @@ Me.exports = function() {
|
|
|
3560
3577
|
throw new Error('unable to parse string "' + this.text + '". State is ' + this.state);
|
|
3561
3578
|
};
|
|
3562
3579
|
var H2 = 0.017453292519943295;
|
|
3563
|
-
function
|
|
3580
|
+
function X2(t3) {
|
|
3564
3581
|
return t3 * H2;
|
|
3565
3582
|
}
|
|
3566
|
-
function
|
|
3583
|
+
function Y2(t3) {
|
|
3567
3584
|
const s3 = (t3.projName || "").toLowerCase().replace(/_/g, " ");
|
|
3568
|
-
t3.long0 || !t3.longc || "albers conic equal area" !== s3 && "lambert azimuthal equal area" !== s3 || (t3.long0 = t3.longc), t3.lat_ts || !t3.lat1 || "stereographic south pole" !== s3 && "polar stereographic (variant b)" !== s3 ? t3.lat_ts || !t3.lat0 || "polar stereographic" !== s3 && "polar stereographic (variant a)" !== s3 || (t3.lat_ts = t3.lat0, t3.lat0 =
|
|
3585
|
+
t3.long0 || !t3.longc || "albers conic equal area" !== s3 && "lambert azimuthal equal area" !== s3 || (t3.long0 = t3.longc), t3.lat_ts || !t3.lat1 || "stereographic south pole" !== s3 && "polar stereographic (variant b)" !== s3 ? t3.lat_ts || !t3.lat0 || "polar stereographic" !== s3 && "polar stereographic (variant a)" !== s3 || (t3.lat_ts = t3.lat0, t3.lat0 = X2(t3.lat0 > 0 ? 90 : -90), delete t3.lat1) : (t3.lat0 = X2(t3.lat1 > 0 ? 90 : -90), t3.lat_ts = t3.lat1, delete t3.lat1);
|
|
3569
3586
|
}
|
|
3570
|
-
function
|
|
3587
|
+
function Z2(t3) {
|
|
3571
3588
|
let s3 = { units: null, to_meter: void 0 };
|
|
3572
3589
|
return "string" == typeof t3 ? (s3.units = t3.toLowerCase(), "metre" === s3.units && (s3.units = "meter"), "meter" === s3.units && (s3.to_meter = 1)) : (t3 == null ? void 0 : t3.name) && (s3.units = t3.name.toLowerCase(), "metre" === s3.units && (s3.units = "meter"), s3.to_meter = t3.conversion_factor), s3;
|
|
3573
3590
|
}
|
|
3574
|
-
function
|
|
3591
|
+
function Q2(t3) {
|
|
3575
3592
|
return "object" == typeof t3 ? t3.value * t3.unit.conversion_factor : t3;
|
|
3576
3593
|
}
|
|
3577
3594
|
function K2(t3, s3) {
|
|
3578
|
-
t3.ellipsoid.radius ? (s3.a = t3.ellipsoid.radius, s3.rf = 0) : (s3.a =
|
|
3595
|
+
t3.ellipsoid.radius ? (s3.a = t3.ellipsoid.radius, s3.rf = 0) : (s3.a = Q2(t3.ellipsoid.semi_major_axis), void 0 !== t3.ellipsoid.inverse_flattening ? s3.rf = t3.ellipsoid.inverse_flattening : void 0 !== t3.ellipsoid.semi_major_axis && void 0 !== t3.ellipsoid.semi_minor_axis && (s3.rf = s3.a / (s3.a - Q2(t3.ellipsoid.semi_minor_axis))));
|
|
3579
3596
|
}
|
|
3580
3597
|
function J2(t3, s3 = {}) {
|
|
3581
3598
|
var _a2;
|
|
@@ -3616,10 +3633,10 @@ Me.exports = function() {
|
|
|
3616
3633
|
return "s";
|
|
3617
3634
|
throw new Error(`Unknown axis direction: ${s4}`);
|
|
3618
3635
|
}).join("") + "u", e3.unit) {
|
|
3619
|
-
const { units: t4, to_meter: i4 } =
|
|
3636
|
+
const { units: t4, to_meter: i4 } = Z2(e3.unit);
|
|
3620
3637
|
s3.units = t4, s3.to_meter = i4;
|
|
3621
3638
|
} else if ((_c = e3.axis[0]) == null ? void 0 : _c.unit) {
|
|
3622
|
-
const { units: t4, to_meter: i4 } =
|
|
3639
|
+
const { units: t4, to_meter: i4 } = Z2(e3.axis[0].unit);
|
|
3623
3640
|
s3.units = t4, s3.to_meter = i4;
|
|
3624
3641
|
}
|
|
3625
3642
|
}
|
|
@@ -3639,7 +3656,7 @@ Me.exports = function() {
|
|
|
3639
3656
|
case "base_crs":
|
|
3640
3657
|
J2(e3, s3), s3.datumCode = e3.id ? e3.id.authority + "_" + e3.id.code : e3.name;
|
|
3641
3658
|
}
|
|
3642
|
-
}), void 0 !== s3.latitude_of_false_origin && (s3.lat0 = s3.latitude_of_false_origin), void 0 !== s3.longitude_of_false_origin && (s3.long0 = s3.longitude_of_false_origin), void 0 !== s3.latitude_of_standard_parallel && (s3.lat0 = s3.latitude_of_standard_parallel, s3.lat1 = s3.latitude_of_standard_parallel), void 0 !== s3.latitude_of_1st_standard_parallel && (s3.lat1 = s3.latitude_of_1st_standard_parallel), void 0 !== s3.latitude_of_2nd_standard_parallel && (s3.lat2 = s3.latitude_of_2nd_standard_parallel), void 0 !== s3.latitude_of_projection_centre && (s3.lat0 = s3.latitude_of_projection_centre), void 0 !== s3.longitude_of_projection_centre && (s3.longc = s3.longitude_of_projection_centre), void 0 !== s3.easting_at_false_origin && (s3.x0 = s3.easting_at_false_origin), void 0 !== s3.northing_at_false_origin && (s3.y0 = s3.northing_at_false_origin), void 0 !== s3.latitude_of_natural_origin && (s3.lat0 = s3.latitude_of_natural_origin), void 0 !== s3.longitude_of_natural_origin && (s3.long0 = s3.longitude_of_natural_origin), void 0 !== s3.longitude_of_origin && (s3.long0 = s3.longitude_of_origin), void 0 !== s3.false_easting && (s3.x0 = s3.false_easting), s3.easting_at_projection_centre && (s3.x0 = s3.easting_at_projection_centre), void 0 !== s3.false_northing && (s3.y0 = s3.false_northing), s3.northing_at_projection_centre && (s3.y0 = s3.northing_at_projection_centre), void 0 !== s3.standard_parallel_1 && (s3.lat1 = s3.standard_parallel_1), void 0 !== s3.standard_parallel_2 && (s3.lat2 = s3.standard_parallel_2), void 0 !== s3.scale_factor_at_natural_origin && (s3.k0 = s3.scale_factor_at_natural_origin), void 0 !== s3.scale_factor_at_projection_centre && (s3.k0 = s3.scale_factor_at_projection_centre), void 0 !== s3.scale_factor_on_pseudo_standard_parallel && (s3.k0 = s3.scale_factor_on_pseudo_standard_parallel), void 0 !== s3.azimuth && (s3.alpha = s3.azimuth), void 0 !== s3.azimuth_at_projection_centre && (s3.alpha = s3.azimuth_at_projection_centre), s3.angle_from_rectified_to_skew_grid && (s3.rectified_grid_angle = s3.angle_from_rectified_to_skew_grid),
|
|
3659
|
+
}), void 0 !== s3.latitude_of_false_origin && (s3.lat0 = s3.latitude_of_false_origin), void 0 !== s3.longitude_of_false_origin && (s3.long0 = s3.longitude_of_false_origin), void 0 !== s3.latitude_of_standard_parallel && (s3.lat0 = s3.latitude_of_standard_parallel, s3.lat1 = s3.latitude_of_standard_parallel), void 0 !== s3.latitude_of_1st_standard_parallel && (s3.lat1 = s3.latitude_of_1st_standard_parallel), void 0 !== s3.latitude_of_2nd_standard_parallel && (s3.lat2 = s3.latitude_of_2nd_standard_parallel), void 0 !== s3.latitude_of_projection_centre && (s3.lat0 = s3.latitude_of_projection_centre), void 0 !== s3.longitude_of_projection_centre && (s3.longc = s3.longitude_of_projection_centre), void 0 !== s3.easting_at_false_origin && (s3.x0 = s3.easting_at_false_origin), void 0 !== s3.northing_at_false_origin && (s3.y0 = s3.northing_at_false_origin), void 0 !== s3.latitude_of_natural_origin && (s3.lat0 = s3.latitude_of_natural_origin), void 0 !== s3.longitude_of_natural_origin && (s3.long0 = s3.longitude_of_natural_origin), void 0 !== s3.longitude_of_origin && (s3.long0 = s3.longitude_of_origin), void 0 !== s3.false_easting && (s3.x0 = s3.false_easting), s3.easting_at_projection_centre && (s3.x0 = s3.easting_at_projection_centre), void 0 !== s3.false_northing && (s3.y0 = s3.false_northing), s3.northing_at_projection_centre && (s3.y0 = s3.northing_at_projection_centre), void 0 !== s3.standard_parallel_1 && (s3.lat1 = s3.standard_parallel_1), void 0 !== s3.standard_parallel_2 && (s3.lat2 = s3.standard_parallel_2), void 0 !== s3.scale_factor_at_natural_origin && (s3.k0 = s3.scale_factor_at_natural_origin), void 0 !== s3.scale_factor_at_projection_centre && (s3.k0 = s3.scale_factor_at_projection_centre), void 0 !== s3.scale_factor_on_pseudo_standard_parallel && (s3.k0 = s3.scale_factor_on_pseudo_standard_parallel), void 0 !== s3.azimuth && (s3.alpha = s3.azimuth), void 0 !== s3.azimuth_at_projection_centre && (s3.alpha = s3.azimuth_at_projection_centre), s3.angle_from_rectified_to_skew_grid && (s3.rectified_grid_angle = s3.angle_from_rectified_to_skew_grid), Y2(s3), s3) : t3;
|
|
3643
3660
|
}
|
|
3644
3661
|
var $2 = ["PROJECTEDCRS", "PROJCRS", "GEOGCS", "GEOCCS", "PROJCS", "LOCAL_CS", "GEODCRS", "GEODETICCRS", "GEODETICDATUM", "ENGCRS", "ENGINEERINGCRS"];
|
|
3645
3662
|
function tt2(t3, s3) {
|
|
@@ -3669,17 +3686,17 @@ Me.exports = function() {
|
|
|
3669
3686
|
function h3(s4) {
|
|
3670
3687
|
return s4 * (t3.to_meter || 1);
|
|
3671
3688
|
}
|
|
3672
|
-
"GEOGCS" === t3.type && (r3 = t3), r3 && (r3.DATUM ? t3.datumCode = r3.DATUM.name.toLowerCase() : t3.datumCode = r3.name.toLowerCase(), "d_" === t3.datumCode.slice(0, 2) && (t3.datumCode = t3.datumCode.slice(2)), "new_zealand_1949" === t3.datumCode && (t3.datumCode = "nzgd49"), "wgs_1984" !== t3.datumCode && "world_geodetic_system_1984" !== t3.datumCode || ("Mercator_Auxiliary_Sphere" === t3.PROJECTION && (t3.sphere = true), t3.datumCode = "wgs84"), "belge_1972" === t3.datumCode && (t3.datumCode = "rnb72"), r3.DATUM && r3.DATUM.SPHEROID && (t3.ellps = r3.DATUM.SPHEROID.name.replace("_19", "").replace(/[Cc]larke\_18/, "clrk"), "international" === t3.ellps.toLowerCase().slice(0, 13) && (t3.ellps = "intl"), t3.a = r3.DATUM.SPHEROID.a, t3.rf = parseFloat(r3.DATUM.SPHEROID.rf, 10)), r3.DATUM && r3.DATUM.TOWGS84 && (t3.datum_params = r3.DATUM.TOWGS84), ~t3.datumCode.indexOf("osgb_1936") && (t3.datumCode = "osgb36"), ~t3.datumCode.indexOf("osni_1952") && (t3.datumCode = "osni52"), (~t3.datumCode.indexOf("tm65") || ~t3.datumCode.indexOf("geodetic_datum_of_1965")) && (t3.datumCode = "ire65"), "ch1903+" === t3.datumCode && (t3.datumCode = "ch1903"), ~t3.datumCode.indexOf("israel") && (t3.datumCode = "isr93")), t3.b && !isFinite(t3.b) && (t3.b = t3.a), t3.rectified_grid_angle && (t3.rectified_grid_angle =
|
|
3689
|
+
"GEOGCS" === t3.type && (r3 = t3), r3 && (r3.DATUM ? t3.datumCode = r3.DATUM.name.toLowerCase() : t3.datumCode = r3.name.toLowerCase(), "d_" === t3.datumCode.slice(0, 2) && (t3.datumCode = t3.datumCode.slice(2)), "new_zealand_1949" === t3.datumCode && (t3.datumCode = "nzgd49"), "wgs_1984" !== t3.datumCode && "world_geodetic_system_1984" !== t3.datumCode || ("Mercator_Auxiliary_Sphere" === t3.PROJECTION && (t3.sphere = true), t3.datumCode = "wgs84"), "belge_1972" === t3.datumCode && (t3.datumCode = "rnb72"), r3.DATUM && r3.DATUM.SPHEROID && (t3.ellps = r3.DATUM.SPHEROID.name.replace("_19", "").replace(/[Cc]larke\_18/, "clrk"), "international" === t3.ellps.toLowerCase().slice(0, 13) && (t3.ellps = "intl"), t3.a = r3.DATUM.SPHEROID.a, t3.rf = parseFloat(r3.DATUM.SPHEROID.rf, 10)), r3.DATUM && r3.DATUM.TOWGS84 && (t3.datum_params = r3.DATUM.TOWGS84), ~t3.datumCode.indexOf("osgb_1936") && (t3.datumCode = "osgb36"), ~t3.datumCode.indexOf("osni_1952") && (t3.datumCode = "osni52"), (~t3.datumCode.indexOf("tm65") || ~t3.datumCode.indexOf("geodetic_datum_of_1965")) && (t3.datumCode = "ire65"), "ch1903+" === t3.datumCode && (t3.datumCode = "ch1903"), ~t3.datumCode.indexOf("israel") && (t3.datumCode = "isr93")), t3.b && !isFinite(t3.b) && (t3.b = t3.a), t3.rectified_grid_angle && (t3.rectified_grid_angle = X2(t3.rectified_grid_angle)), [["standard_parallel_1", "Standard_Parallel_1"], ["standard_parallel_1", "Latitude of 1st standard parallel"], ["standard_parallel_2", "Standard_Parallel_2"], ["standard_parallel_2", "Latitude of 2nd standard parallel"], ["false_easting", "False_Easting"], ["false_easting", "False easting"], ["false-easting", "Easting at false origin"], ["false_northing", "False_Northing"], ["false_northing", "False northing"], ["false_northing", "Northing at false origin"], ["central_meridian", "Central_Meridian"], ["central_meridian", "Longitude of natural origin"], ["central_meridian", "Longitude of false origin"], ["latitude_of_origin", "Latitude_Of_Origin"], ["latitude_of_origin", "Central_Parallel"], ["latitude_of_origin", "Latitude of natural origin"], ["latitude_of_origin", "Latitude of false origin"], ["scale_factor", "Scale_Factor"], ["k0", "scale_factor"], ["latitude_of_center", "Latitude_Of_Center"], ["latitude_of_center", "Latitude_of_center"], ["lat0", "latitude_of_center", X2], ["longitude_of_center", "Longitude_Of_Center"], ["longitude_of_center", "Longitude_of_center"], ["longc", "longitude_of_center", X2], ["x0", "false_easting", h3], ["y0", "false_northing", h3], ["long0", "central_meridian", X2], ["lat0", "latitude_of_origin", X2], ["lat0", "standard_parallel_1", X2], ["lat1", "standard_parallel_1", X2], ["lat2", "standard_parallel_2", X2], ["azimuth", "Azimuth"], ["alpha", "azimuth", X2], ["srsCode", "name"]].forEach(function(s4) {
|
|
3673
3690
|
return tt2(t3, s4);
|
|
3674
|
-
}),
|
|
3691
|
+
}), Y2(t3);
|
|
3675
3692
|
}
|
|
3676
3693
|
function et2(t3) {
|
|
3677
3694
|
if ("object" == typeof t3)
|
|
3678
3695
|
return J2(t3);
|
|
3679
|
-
const s3 =
|
|
3696
|
+
const s3 = C2(t3);
|
|
3680
3697
|
var i3 = F2(t3);
|
|
3681
3698
|
if ("WKT2" === s3)
|
|
3682
|
-
return J2(
|
|
3699
|
+
return J2(N2(i3));
|
|
3683
3700
|
var e3 = i3[0], a3 = {};
|
|
3684
3701
|
return W2(i3, a3), st2(a3), a3[e3];
|
|
3685
3702
|
}
|
|
@@ -3757,19 +3774,19 @@ Me.exports = function() {
|
|
|
3757
3774
|
return t3 < 0 ? -1 : 1;
|
|
3758
3775
|
}
|
|
3759
3776
|
function yt2(t3) {
|
|
3760
|
-
return Math.abs(t3) <=
|
|
3777
|
+
return Math.abs(t3) <= M2 ? t3 : t3 - ft2(t3) * g2;
|
|
3761
3778
|
}
|
|
3762
3779
|
function pt2(t3, s3, i3) {
|
|
3763
3780
|
var e3 = t3 * i3, a3 = 0.5 * t3;
|
|
3764
3781
|
return e3 = Math.pow((1 - e3) / (1 + e3), a3), Math.tan(0.5 * (l2 - s3)) / e3;
|
|
3765
3782
|
}
|
|
3766
|
-
function
|
|
3783
|
+
function gt2(t3, s3) {
|
|
3767
3784
|
for (var i3, e3, a3 = 0.5 * t3, n3 = l2 - 2 * Math.atan(s3), r3 = 0; r3 <= 15; r3++)
|
|
3768
3785
|
if (i3 = t3 * Math.sin(n3), n3 += e3 = l2 - 2 * Math.atan(s3 * Math.pow((1 - i3) / (1 + i3), a3)) - n3, Math.abs(e3) <= 1e-10)
|
|
3769
3786
|
return n3;
|
|
3770
3787
|
return -9999;
|
|
3771
3788
|
}
|
|
3772
|
-
function
|
|
3789
|
+
function Mt2() {
|
|
3773
3790
|
var t3 = this.b / this.a;
|
|
3774
3791
|
this.es = 1 - t3 * t3, "x0" in this || (this.x0 = 0), "y0" in this || (this.y0 = 0), this.e = Math.sqrt(this.es), this.lat_ts ? this.sphere ? this.k0 = Math.cos(this.lat_ts) : this.k0 = _t2(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) : this.k0 || (this.k ? this.k0 = this.k : this.k0 = 1);
|
|
3775
3792
|
}
|
|
@@ -3793,7 +3810,7 @@ Me.exports = function() {
|
|
|
3793
3810
|
i3 = l2 - 2 * Math.atan(Math.exp(-a3 / (this.a * this.k0)));
|
|
3794
3811
|
else {
|
|
3795
3812
|
var n3 = Math.exp(-a3 / (this.a * this.k0));
|
|
3796
|
-
if (-9999 === (i3 =
|
|
3813
|
+
if (-9999 === (i3 = gt2(this.e, n3)))
|
|
3797
3814
|
return null;
|
|
3798
3815
|
}
|
|
3799
3816
|
return s3 = yt2(this.long0 + e3 / (this.a * this.k0)), t3.x = s3, t3.y = i3, t3;
|
|
@@ -3803,7 +3820,7 @@ Me.exports = function() {
|
|
|
3803
3820
|
function Et2(t3) {
|
|
3804
3821
|
return t3;
|
|
3805
3822
|
}
|
|
3806
|
-
var bt2 = [{ init:
|
|
3823
|
+
var bt2 = [{ init: Mt2, forward: xt2, inverse: wt2, names: ["Mercator", "Popular Visualisation Pseudo Mercator", "Mercator_1SP", "Mercator_Auxiliary_Sphere", "Mercator_Variant_A", "merc"] }, { init: St2, forward: Et2, inverse: Et2, names: ["longlat", "identity"] }], Pt2 = {}, vt2 = [];
|
|
3807
3824
|
function At2(t3, s3) {
|
|
3808
3825
|
var i3 = vt2.length;
|
|
3809
3826
|
return t3.names ? (vt2[i3] = t3, t3.names.forEach(function(t4) {
|
|
@@ -3813,16 +3830,16 @@ Me.exports = function() {
|
|
|
3813
3830
|
function Gt2(t3) {
|
|
3814
3831
|
return t3.replace(/[-\(\)\s]+/g, " ").trim().replace(/ /g, "_");
|
|
3815
3832
|
}
|
|
3816
|
-
function
|
|
3833
|
+
function Nt2(t3) {
|
|
3817
3834
|
if (!t3)
|
|
3818
3835
|
return false;
|
|
3819
3836
|
var s3 = t3.toLowerCase();
|
|
3820
3837
|
return void 0 !== Pt2[s3] && vt2[Pt2[s3]] || (s3 = Gt2(s3)) in Pt2 && vt2[Pt2[s3]] ? vt2[Pt2[s3]] : void 0;
|
|
3821
3838
|
}
|
|
3822
|
-
function
|
|
3839
|
+
function Ct2() {
|
|
3823
3840
|
bt2.forEach(At2);
|
|
3824
3841
|
}
|
|
3825
|
-
var It2 = { start:
|
|
3842
|
+
var It2 = { start: Ct2, add: At2, get: Nt2 }, zt2 = { MERIT: { a: 6378137, rf: 298.257, ellipseName: "MERIT 1983" }, SGS85: { a: 6378136, rf: 298.257, ellipseName: "Soviet Geodetic System 85" }, GRS80: { a: 6378137, rf: 298.257222101, ellipseName: "GRS 1980(IUGG, 1980)" }, IAU76: { a: 6378140, rf: 298.257, ellipseName: "IAU 1976" }, airy: { a: 6377563396e-3, b: 635625691e-2, ellipseName: "Airy 1830" }, APL4: { a: 6378137, rf: 298.25, ellipseName: "Appl. Physics. 1965" }, NWL9D: { a: 6378145, rf: 298.25, ellipseName: "Naval Weapons Lab., 1965" }, mod_airy: { a: 6377340189e-3, b: 6356034446e-3, ellipseName: "Modified Airy" }, andrae: { a: 637710443e-2, rf: 300, ellipseName: "Andrae 1876 (Den., Iclnd.)" }, aust_SA: { a: 6378160, rf: 298.25, ellipseName: "Australian Natl & S. Amer. 1969" }, GRS67: { a: 6378160, rf: 298.247167427, ellipseName: "GRS 67(IUGG 1967)" }, bessel: { a: 6377397155e-3, rf: 299.1528128, ellipseName: "Bessel 1841" }, bess_nam: { a: 6377483865e-3, rf: 299.1528128, ellipseName: "Bessel 1841 (Namibia)" }, clrk66: { a: 63782064e-1, b: 63565838e-1, ellipseName: "Clarke 1866" }, clrk80: { a: 6378249145e-3, rf: 293.4663, ellipseName: "Clarke 1880 mod." }, clrk80ign: { a: 63782492e-1, b: 6356515, rf: 293.4660213, ellipseName: "Clarke 1880 (IGN)" }, clrk58: { a: 6378293645208759e-9, rf: 294.2606763692654, ellipseName: "Clarke 1858" }, CPM: { a: 63757387e-1, rf: 334.29, ellipseName: "Comm. des Poids et Mesures 1799" }, delmbr: { a: 6376428, rf: 311.5, ellipseName: "Delambre 1810 (Belgium)" }, engelis: { a: 637813605e-2, rf: 298.2566, ellipseName: "Engelis 1985" }, evrst30: { a: 6377276345e-3, rf: 300.8017, ellipseName: "Everest 1830" }, evrst48: { a: 6377304063e-3, rf: 300.8017, ellipseName: "Everest 1948" }, evrst56: { a: 6377301243e-3, rf: 300.8017, ellipseName: "Everest 1956" }, evrst69: { a: 6377295664e-3, rf: 300.8017, ellipseName: "Everest 1969" }, evrstSS: { a: 6377298556e-3, rf: 300.8017, ellipseName: "Everest (Sabah & Sarawak)" }, fschr60: { a: 6378166, rf: 298.3, ellipseName: "Fischer (Mercury Datum) 1960" }, fschr60m: { a: 6378155, rf: 298.3, ellipseName: "Fischer 1960" }, fschr68: { a: 6378150, rf: 298.3, ellipseName: "Fischer 1968" }, helmert: { a: 6378200, rf: 298.3, ellipseName: "Helmert 1906" }, hough: { a: 6378270, rf: 297, ellipseName: "Hough" }, intl: { a: 6378388, rf: 297, ellipseName: "International 1909 (Hayford)" }, kaula: { a: 6378163, rf: 298.24, ellipseName: "Kaula 1961" }, lerch: { a: 6378139, rf: 298.257, ellipseName: "Lerch 1979" }, mprts: { a: 6397300, rf: 191, ellipseName: "Maupertius 1738" }, new_intl: { a: 63781575e-1, b: 63567722e-1, ellipseName: "New International 1967" }, plessis: { a: 6376523, rf: 6355863, ellipseName: "Plessis 1817 (France)" }, krass: { a: 6378245, rf: 298.3, ellipseName: "Krassovsky, 1942" }, SEasia: { a: 6378155, b: 63567733205e-4, ellipseName: "Southeast Asia" }, walbeck: { a: 6376896, b: 63558348467e-4, ellipseName: "Walbeck" }, WGS60: { a: 6378165, rf: 298.3, ellipseName: "WGS 60" }, WGS66: { a: 6378145, rf: 298.25, ellipseName: "WGS 66" }, WGS7: { a: 6378135, rf: 298.26, ellipseName: "WGS 72" }, WGS84: { a: 6378137, rf: 298.257223563, ellipseName: "WGS 84" }, sphere: { a: 6370997, b: 6370997, ellipseName: "Normal Sphere (r=6370997)" } };
|
|
3826
3843
|
const Tt2 = zt2.WGS84;
|
|
3827
3844
|
function Ot2(t3, s3, i3, e3) {
|
|
3828
3845
|
var a3 = t3 * t3, n3 = s3 * s3, r3 = (a3 - n3) / a3, h3 = 0;
|
|
@@ -3851,7 +3868,7 @@ Me.exports = function() {
|
|
|
3851
3868
|
function jt2(t3, s3, i3) {
|
|
3852
3869
|
var e3 = true;
|
|
3853
3870
|
void 0 !== i3 && false === i3.includeErrorFields && (e3 = false);
|
|
3854
|
-
var a3 = new DataView(s3), n3 =
|
|
3871
|
+
var a3 = new DataView(s3), n3 = Yt2(a3), r3 = Zt2(a3, n3), h3 = { header: r3, subgrids: Kt2(a3, r3, n3, e3) };
|
|
3855
3872
|
return Dt2[t3] = h3, h3;
|
|
3856
3873
|
}
|
|
3857
3874
|
async function Ft2(t3, s3) {
|
|
@@ -3860,7 +3877,7 @@ Me.exports = function() {
|
|
|
3860
3877
|
for (let t4 = h3[1] - 1; t4 >= 0; t4--)
|
|
3861
3878
|
for (let s4 = h3[0] - 1; s4 >= 0; s4--) {
|
|
3862
3879
|
var f3 = t4 * h3[0] + s4;
|
|
3863
|
-
_3.push([-
|
|
3880
|
+
_3.push([-Xt2(m3[f3]), Xt2(d3[f3])]);
|
|
3864
3881
|
}
|
|
3865
3882
|
i3.push({ del: c3, lim: h3, ll: [-l3, u3], cvs: _3 });
|
|
3866
3883
|
}
|
|
@@ -3879,23 +3896,23 @@ Me.exports = function() {
|
|
|
3879
3896
|
function Ht2(t3) {
|
|
3880
3897
|
return t3 * Math.PI / 180;
|
|
3881
3898
|
}
|
|
3882
|
-
function
|
|
3899
|
+
function Xt2(t3) {
|
|
3883
3900
|
return t3 / 3600 * Math.PI / 180;
|
|
3884
3901
|
}
|
|
3885
|
-
function
|
|
3902
|
+
function Yt2(t3) {
|
|
3886
3903
|
var s3 = t3.getInt32(8, false);
|
|
3887
3904
|
return 11 !== s3 && (11 !== (s3 = t3.getInt32(8, true)) && console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"), true);
|
|
3888
3905
|
}
|
|
3889
|
-
function
|
|
3890
|
-
return { nFields: t3.getInt32(8, s3), nSubgridFields: t3.getInt32(24, s3), nSubgrids: t3.getInt32(40, s3), shiftType:
|
|
3906
|
+
function Zt2(t3, s3) {
|
|
3907
|
+
return { nFields: t3.getInt32(8, s3), nSubgridFields: t3.getInt32(24, s3), nSubgrids: t3.getInt32(40, s3), shiftType: Qt2(t3, 56, 64).trim(), fromSemiMajorAxis: t3.getFloat64(120, s3), fromSemiMinorAxis: t3.getFloat64(136, s3), toSemiMajorAxis: t3.getFloat64(152, s3), toSemiMinorAxis: t3.getFloat64(168, s3) };
|
|
3891
3908
|
}
|
|
3892
|
-
function
|
|
3909
|
+
function Qt2(t3, s3, i3) {
|
|
3893
3910
|
return String.fromCharCode.apply(null, new Uint8Array(t3.buffer.slice(s3, i3)));
|
|
3894
3911
|
}
|
|
3895
3912
|
function Kt2(t3, s3, i3, e3) {
|
|
3896
3913
|
for (var a3 = 176, n3 = [], r3 = 0; r3 < s3.nSubgrids; r3++) {
|
|
3897
3914
|
var h3 = $t2(t3, a3, i3), o3 = ts2(t3, a3, h3, i3, e3), c3 = Math.round(1 + (h3.upperLongitude - h3.lowerLongitude) / h3.longitudeInterval), l3 = Math.round(1 + (h3.upperLatitude - h3.lowerLatitude) / h3.latitudeInterval);
|
|
3898
|
-
n3.push({ ll: [
|
|
3915
|
+
n3.push({ ll: [Xt2(h3.lowerLongitude), Xt2(h3.lowerLatitude)], del: [Xt2(h3.longitudeInterval), Xt2(h3.latitudeInterval)], lim: [c3, l3], count: h3.gridNodeCount, cvs: Jt2(o3) });
|
|
3899
3916
|
var u3 = 16;
|
|
3900
3917
|
false === e3 && (u3 = 8), a3 += 176 + h3.gridNodeCount * u3;
|
|
3901
3918
|
}
|
|
@@ -3903,11 +3920,11 @@ Me.exports = function() {
|
|
|
3903
3920
|
}
|
|
3904
3921
|
function Jt2(t3) {
|
|
3905
3922
|
return t3.map(function(t4) {
|
|
3906
|
-
return [
|
|
3923
|
+
return [Xt2(t4.longitudeShift), Xt2(t4.latitudeShift)];
|
|
3907
3924
|
});
|
|
3908
3925
|
}
|
|
3909
3926
|
function $t2(t3, s3, i3) {
|
|
3910
|
-
return { name:
|
|
3927
|
+
return { name: Qt2(t3, s3 + 8, s3 + 16).trim(), parent: Qt2(t3, s3 + 24, s3 + 24 + 8).trim(), lowerLatitude: t3.getFloat64(s3 + 72, i3), upperLatitude: t3.getFloat64(s3 + 88, i3), lowerLongitude: t3.getFloat64(s3 + 104, i3), upperLongitude: t3.getFloat64(s3 + 120, i3), latitudeInterval: t3.getFloat64(s3 + 136, i3), longitudeInterval: t3.getFloat64(s3 + 152, i3), gridNodeCount: t3.getInt32(s3 + 168, i3) };
|
|
3911
3928
|
}
|
|
3912
3929
|
function ts2(t3, s3, i3, e3, a3) {
|
|
3913
3930
|
var n3 = s3 + 176, r3 = 16;
|
|
@@ -3959,17 +3976,17 @@ Me.exports = function() {
|
|
|
3959
3976
|
return h3 > Math.PI && (h3 -= 2 * Math.PI), a3 = Math.sin(o3), r3 = Math.cos(o3), n3 = a3 * a3, { x: ((e3 = i3 / Math.sqrt(1 - s3 * n3)) + c3) * r3 * Math.cos(h3), y: (e3 + c3) * r3 * Math.sin(h3), z: (e3 * (1 - s3) + c3) * a3 };
|
|
3960
3977
|
}
|
|
3961
3978
|
function as2(t3, s3, i3, e3) {
|
|
3962
|
-
var a3, n3, r3, h3, o3, c3, l3, u3, d3, m3, _3, f3, y3, p3,
|
|
3963
|
-
if (a3 = Math.sqrt(S3 * S3 + E3 * E3), n3 = Math.sqrt(S3 * S3 + E3 * E3 + b3 * b3), a3 / i3 <
|
|
3964
|
-
if (p3 = 0, n3 / i3 <
|
|
3965
|
-
return
|
|
3979
|
+
var a3, n3, r3, h3, o3, c3, l3, u3, d3, m3, _3, f3, y3, p3, g3, M3 = 1e-12, x3 = M3 * M3, w3 = 30, S3 = t3.x, E3 = t3.y, b3 = t3.z ? t3.z : 0;
|
|
3980
|
+
if (a3 = Math.sqrt(S3 * S3 + E3 * E3), n3 = Math.sqrt(S3 * S3 + E3 * E3 + b3 * b3), a3 / i3 < M3) {
|
|
3981
|
+
if (p3 = 0, n3 / i3 < M3)
|
|
3982
|
+
return g3 = -e3, { x: t3.x, y: t3.y, z: t3.z };
|
|
3966
3983
|
} else
|
|
3967
3984
|
p3 = Math.atan2(E3, S3);
|
|
3968
3985
|
r3 = b3 / n3, u3 = (h3 = a3 / n3) * (1 - s3) * (o3 = 1 / Math.sqrt(1 - s3 * (2 - s3) * h3 * h3)), d3 = r3 * o3, y3 = 0;
|
|
3969
3986
|
do {
|
|
3970
|
-
y3++, c3 = s3 * (l3 = i3 / Math.sqrt(1 - s3 * d3 * d3)) / (l3 + (
|
|
3987
|
+
y3++, c3 = s3 * (l3 = i3 / Math.sqrt(1 - s3 * d3 * d3)) / (l3 + (g3 = a3 * u3 + b3 * d3 - l3 * (1 - s3 * d3 * d3))), f3 = (_3 = r3 * (o3 = 1 / Math.sqrt(1 - c3 * (2 - c3) * h3 * h3))) * u3 - (m3 = h3 * (1 - c3) * o3) * d3, u3 = m3, d3 = _3;
|
|
3971
3988
|
} while (f3 * f3 > x3 && y3 < w3);
|
|
3972
|
-
return { x: p3, y: Math.atan(_3 / Math.abs(m3)), z:
|
|
3989
|
+
return { x: p3, y: Math.atan(_3 / Math.abs(m3)), z: g3 };
|
|
3973
3990
|
}
|
|
3974
3991
|
function ns2(t3, e3, a3) {
|
|
3975
3992
|
if (e3 === s2)
|
|
@@ -4121,8 +4138,8 @@ Me.exports = function() {
|
|
|
4121
4138
|
return s3.from_greenwich && (i3 = { x: i3.x - s3.from_greenwich, y: i3.y, z: i3.z || 0 }), "longlat" === s3.projName ? i3 = { x: i3.x * y2, y: i3.y * y2, z: i3.z || 0 } : (i3 = s3.forward(i3), s3.to_meter && (i3 = { x: i3.x / s3.to_meter, y: i3.y / s3.to_meter, z: i3.z || 0 })), e3 && "enu" !== s3.axis ? ds2(s3, true, i3) : (i3 && !n3 && delete i3.z, i3);
|
|
4122
4139
|
}
|
|
4123
4140
|
ss2.projections = It2, ss2.projections.start();
|
|
4124
|
-
var
|
|
4125
|
-
function
|
|
4141
|
+
var gs2 = ss2("WGS84");
|
|
4142
|
+
function Ms2(t3, s3, i3, e3) {
|
|
4126
4143
|
var a3, n3, r3;
|
|
4127
4144
|
return Array.isArray(i3) ? (a3 = ps2(t3, s3, i3, e3) || { x: NaN, y: NaN }, i3.length > 2 ? void 0 !== t3.name && "geocent" === t3.name || void 0 !== s3.name && "geocent" === s3.name ? "number" == typeof a3.z ? [a3.x, a3.y, a3.z].concat(i3.slice(3)) : [a3.x, a3.y, i3[2]].concat(i3.slice(3)) : [a3.x, a3.y].concat(i3.slice(2)) : [a3.x, a3.y]) : (n3 = ps2(t3, s3, i3, e3), 2 === (r3 = Object.keys(i3)).length || r3.forEach(function(e4) {
|
|
4128
4145
|
if (void 0 !== t3.name && "geocent" === t3.name || void 0 !== s3.name && "geocent" === s3.name) {
|
|
@@ -4139,13 +4156,13 @@ Me.exports = function() {
|
|
|
4139
4156
|
function ws2(t3, s3, i3) {
|
|
4140
4157
|
t3 = xs2(t3);
|
|
4141
4158
|
var e3, a3 = false;
|
|
4142
|
-
return void 0 === s3 ? (s3 = t3, t3 =
|
|
4143
|
-
return
|
|
4159
|
+
return void 0 === s3 ? (s3 = t3, t3 = gs2, a3 = true) : (void 0 !== s3.x || Array.isArray(s3)) && (i3 = s3, s3 = t3, t3 = gs2, a3 = true), s3 = xs2(s3), i3 ? Ms2(t3, s3, i3) : (e3 = { forward: function(i4, e4) {
|
|
4160
|
+
return Ms2(t3, s3, i4, e4);
|
|
4144
4161
|
}, inverse: function(i4, e4) {
|
|
4145
|
-
return
|
|
4162
|
+
return Ms2(s3, t3, i4, e4);
|
|
4146
4163
|
} }, a3 && (e3.oProj = s3), e3);
|
|
4147
4164
|
}
|
|
4148
|
-
var Ss2 = 6, Es2 = "AJSAJS", bs2 = "AFAFAF", Ps2 = 65, vs2 = 73, As2 = 79, Gs2 = 86,
|
|
4165
|
+
var Ss2 = 6, Es2 = "AJSAJS", bs2 = "AFAFAF", Ps2 = 65, vs2 = 73, As2 = 79, Gs2 = 86, Ns2 = 90, Cs2 = { forward: Is2, inverse: zs2, toPoint: Ts2 };
|
|
4149
4166
|
function Is2(t3, s3) {
|
|
4150
4167
|
return s3 = s3 || 5, ks2(qs2({ lat: t3[1], lon: t3[0] }), s3);
|
|
4151
4168
|
}
|
|
@@ -4173,8 +4190,8 @@ Me.exports = function() {
|
|
|
4173
4190
|
var s3 = t3.northing, i3 = t3.easting, e3 = t3.zoneLetter, a3 = t3.zoneNumber;
|
|
4174
4191
|
if (a3 < 0 || a3 > 60)
|
|
4175
4192
|
return null;
|
|
4176
|
-
var n3, r3, h3, o3, c3, l3, u3, d3, m3, _3 = 0.9996, f3 = 6378137, y3 = 669438e-8, p3 = (1 - Math.sqrt(1 - y3)) / (1 + Math.sqrt(1 - y3)),
|
|
4177
|
-
e3 < "N" && (
|
|
4193
|
+
var n3, r3, h3, o3, c3, l3, u3, d3, m3, _3 = 0.9996, f3 = 6378137, y3 = 669438e-8, p3 = (1 - Math.sqrt(1 - y3)) / (1 + Math.sqrt(1 - y3)), g3 = i3 - 5e5, M3 = s3;
|
|
4194
|
+
e3 < "N" && (M3 -= 1e7), u3 = 6 * (a3 - 1) - 180 + 3, n3 = y3 / (1 - y3), m3 = (d3 = M3 / _3 / (f3 * (1 - y3 / 4 - 3 * y3 * y3 / 64 - 5 * y3 * y3 * y3 / 256))) + (3 * p3 / 2 - 27 * p3 * p3 * p3 / 32) * Math.sin(2 * d3) + (21 * p3 * p3 / 16 - 55 * p3 * p3 * p3 * p3 / 32) * Math.sin(4 * d3) + 151 * p3 * p3 * p3 / 96 * Math.sin(6 * d3), r3 = f3 / Math.sqrt(1 - y3 * Math.sin(m3) * Math.sin(m3)), h3 = Math.tan(m3) * Math.tan(m3), o3 = n3 * Math.cos(m3) * Math.cos(m3), c3 = f3 * (1 - y3) / Math.pow(1 - y3 * Math.sin(m3) * Math.sin(m3), 1.5), l3 = g3 / (r3 * _3);
|
|
4178
4195
|
var x3 = m3 - r3 * Math.tan(m3) / c3 * (l3 * l3 / 2 - (5 + 3 * h3 + 10 * o3 - 4 * o3 * o3 - 9 * n3) * l3 * l3 * l3 * l3 / 24 + (61 + 90 * h3 + 298 * o3 + 45 * h3 * h3 - 252 * n3 - 3 * o3 * o3) * l3 * l3 * l3 * l3 * l3 * l3 / 720);
|
|
4179
4196
|
x3 = Rs2(x3);
|
|
4180
4197
|
var w3, S3 = (l3 - (1 + 2 * h3 + o3) * l3 * l3 * l3 / 6 + (5 - 2 * o3 + 28 * h3 - 3 * o3 * o3 + 8 * n3 + 24 * h3 * h3) * l3 * l3 * l3 * l3 * l3 / 120) / Math.cos(m3);
|
|
@@ -4203,7 +4220,7 @@ Me.exports = function() {
|
|
|
4203
4220
|
}
|
|
4204
4221
|
function js2(t3, s3, i3) {
|
|
4205
4222
|
var e3 = i3 - 1, a3 = Es2.charCodeAt(e3), n3 = bs2.charCodeAt(e3), r3 = a3 + t3 - 1, h3 = n3 + s3, o3 = false;
|
|
4206
|
-
return r3 >
|
|
4223
|
+
return r3 > Ns2 && (r3 = r3 - Ns2 + Ps2 - 1, o3 = true), (r3 === vs2 || a3 < vs2 && r3 > vs2 || (r3 > vs2 || a3 < vs2) && o3) && r3++, (r3 === As2 || a3 < As2 && r3 > As2 || (r3 > As2 || a3 < As2) && o3) && ++r3 === vs2 && r3++, r3 > Ns2 && (r3 = r3 - Ns2 + Ps2 - 1), h3 > Gs2 ? (h3 = h3 - Gs2 + Ps2 - 1, o3 = true) : o3 = false, (h3 === vs2 || n3 < vs2 && h3 > vs2 || (h3 > vs2 || n3 < vs2) && o3) && h3++, (h3 === As2 || n3 < As2 && h3 > As2 || (h3 > As2 || n3 < As2) && o3) && ++h3 === vs2 && h3++, h3 > Gs2 && (h3 = h3 - Gs2 + Ps2 - 1), String.fromCharCode(r3) + String.fromCharCode(h3);
|
|
4207
4224
|
}
|
|
4208
4225
|
function Fs2(t3) {
|
|
4209
4226
|
if (t3 && 0 === t3.length)
|
|
@@ -4230,7 +4247,7 @@ Me.exports = function() {
|
|
|
4230
4247
|
}
|
|
4231
4248
|
function Vs2(t3, s3) {
|
|
4232
4249
|
for (var i3 = Es2.charCodeAt(s3 - 1), e3 = 1e5, a3 = false; i3 !== t3.charCodeAt(0); ) {
|
|
4233
|
-
if (++i3 === vs2 && i3++, i3 === As2 && i3++, i3 >
|
|
4250
|
+
if (++i3 === vs2 && i3++, i3 === As2 && i3++, i3 > Ns2) {
|
|
4234
4251
|
if (a3)
|
|
4235
4252
|
throw "Bad character: " + t3;
|
|
4236
4253
|
i3 = Ps2, a3 = true;
|
|
@@ -4322,9 +4339,9 @@ Me.exports = function() {
|
|
|
4322
4339
|
return s3;
|
|
4323
4340
|
throw "Invalid zone letter: " + t3;
|
|
4324
4341
|
}
|
|
4325
|
-
function
|
|
4326
|
-
if (!(this instanceof
|
|
4327
|
-
return new
|
|
4342
|
+
function Xs2(t3, s3, i3) {
|
|
4343
|
+
if (!(this instanceof Xs2))
|
|
4344
|
+
return new Xs2(t3, s3, i3);
|
|
4328
4345
|
if (Array.isArray(t3))
|
|
4329
4346
|
this.x = t3[0], this.y = t3[1], this.z = t3[2] || 0;
|
|
4330
4347
|
else if ("object" == typeof t3)
|
|
@@ -4336,15 +4353,15 @@ Me.exports = function() {
|
|
|
4336
4353
|
this.x = t3, this.y = s3, this.z = i3 || 0;
|
|
4337
4354
|
console.warn("proj4.Point will be removed in version 3, use proj4.toPoint");
|
|
4338
4355
|
}
|
|
4339
|
-
|
|
4340
|
-
return new
|
|
4341
|
-
},
|
|
4356
|
+
Xs2.fromMGRS = function(t3) {
|
|
4357
|
+
return new Xs2(Ts2(t3));
|
|
4358
|
+
}, Xs2.prototype.toMGRS = function(t3) {
|
|
4342
4359
|
return Is2([this.x, this.y], t3);
|
|
4343
4360
|
};
|
|
4344
|
-
var
|
|
4361
|
+
var Ys2 = 1, Zs2 = 0.25, Qs2 = 0.046875, Ks2 = 0.01953125, Js2 = 0.01068115234375, $s2 = 0.75, ti2 = 0.46875, si2 = 0.013020833333333334, ii2 = 0.007120768229166667, ei2 = 0.3645833333333333, ai2 = 0.005696614583333333, ni2 = 0.3076171875;
|
|
4345
4362
|
function ri2(t3) {
|
|
4346
4363
|
var s3 = [];
|
|
4347
|
-
s3[0] =
|
|
4364
|
+
s3[0] = Ys2 - t3 * (Zs2 + t3 * (Qs2 + t3 * (Ks2 + t3 * Js2))), s3[1] = t3 * ($s2 - t3 * (Qs2 + t3 * (Ks2 + t3 * Js2)));
|
|
4348
4365
|
var i3 = t3 * t3;
|
|
4349
4366
|
return s3[2] = i3 * (ti2 - t3 * (si2 + t3 * ii2)), i3 *= t3, s3[3] = i3 * (ei2 - t3 * ai2), s3[4] = i3 * t3 * ni2, s3;
|
|
4350
4367
|
}
|
|
@@ -4371,11 +4388,11 @@ Me.exports = function() {
|
|
|
4371
4388
|
var p3 = hi2(n3, h3, o3, this.en);
|
|
4372
4389
|
i3 = this.a * (this.k0 * c3 * (1 + l3 / 6 * (1 - f3 + u3 + l3 / 20 * (5 - 18 * f3 + y3 + 14 * u3 - 58 * f3 * u3 + l3 / 42 * (61 + 179 * y3 - y3 * f3 - 479 * f3))))) + this.x0, e3 = this.a * (this.k0 * (p3 - this.ml0 + h3 * r3 * c3 / 2 * (1 + l3 / 12 * (5 - f3 + 9 * u3 + 4 * d3 + l3 / 30 * (61 + y3 - 58 * f3 + 270 * u3 - 330 * f3 * u3 + l3 / 56 * (1385 + 543 * y3 - y3 * f3 - 3111 * f3)))))) + this.y0;
|
|
4373
4390
|
} else {
|
|
4374
|
-
var
|
|
4375
|
-
if (Math.abs(Math.abs(
|
|
4391
|
+
var g3 = o3 * Math.sin(r3);
|
|
4392
|
+
if (Math.abs(Math.abs(g3) - 1) < _2)
|
|
4376
4393
|
return 93;
|
|
4377
|
-
if (i3 = 0.5 * this.a * this.k0 * Math.log((1 +
|
|
4378
|
-
if (
|
|
4394
|
+
if (i3 = 0.5 * this.a * this.k0 * Math.log((1 + g3) / (1 - g3)) + this.x0, e3 = o3 * Math.cos(r3) / Math.sqrt(1 - Math.pow(g3, 2)), (g3 = Math.abs(e3)) >= 1) {
|
|
4395
|
+
if (g3 - 1 > _2)
|
|
4379
4396
|
return 93;
|
|
4380
4397
|
e3 = 0;
|
|
4381
4398
|
} else
|
|
@@ -4395,8 +4412,8 @@ Me.exports = function() {
|
|
|
4395
4412
|
} else
|
|
4396
4413
|
e3 = l2 * ft2(r3), a3 = 0;
|
|
4397
4414
|
else {
|
|
4398
|
-
var
|
|
4399
|
-
s3 = Math.sqrt((1 - Math.pow(w3, 2)) / (1 + Math.pow(
|
|
4415
|
+
var g3 = Math.exp(n3 / this.k0), M3 = 0.5 * (g3 - 1 / g3), x3 = this.lat0 + r3 / this.k0, w3 = Math.cos(x3);
|
|
4416
|
+
s3 = Math.sqrt((1 - Math.pow(w3, 2)) / (1 + Math.pow(M3, 2))), e3 = Math.asin(s3), r3 < 0 && (e3 = -e3), a3 = 0 === M3 && 0 === w3 ? 0 : yt2(Math.atan2(M3, w3) + this.long0);
|
|
4400
4417
|
}
|
|
4401
4418
|
return t3.x = a3, t3.y = e3, t3;
|
|
4402
4419
|
}
|
|
@@ -4418,12 +4435,12 @@ Me.exports = function() {
|
|
|
4418
4435
|
var s3 = Math.abs(t3);
|
|
4419
4436
|
return s3 = yi2(s3 * (1 + s3 / (fi2(1, s3) + 1))), t3 < 0 ? -s3 : s3;
|
|
4420
4437
|
}
|
|
4421
|
-
function
|
|
4438
|
+
function gi2(t3, s3) {
|
|
4422
4439
|
for (var i3, e3 = 2 * Math.cos(2 * s3), a3 = t3.length - 1, n3 = t3[a3], r3 = 0; --a3 >= 0; )
|
|
4423
4440
|
i3 = e3 * n3 - r3 + t3[a3], r3 = n3, n3 = i3;
|
|
4424
4441
|
return s3 + i3 * Math.sin(2 * s3);
|
|
4425
4442
|
}
|
|
4426
|
-
function
|
|
4443
|
+
function Mi2(t3, s3) {
|
|
4427
4444
|
for (var i3, e3 = 2 * Math.cos(s3), a3 = t3.length - 1, n3 = t3[a3], r3 = 0; --a3 >= 0; )
|
|
4428
4445
|
i3 = e3 * n3 - r3 + t3[a3], r3 = n3, n3 = i3;
|
|
4429
4446
|
return Math.sin(s3) * i3;
|
|
@@ -4443,12 +4460,12 @@ Me.exports = function() {
|
|
|
4443
4460
|
this.approx && (mi2.init.apply(this), this.forward = mi2.forward, this.inverse = mi2.inverse), this.x0 = void 0 !== this.x0 ? this.x0 : 0, this.y0 = void 0 !== this.y0 ? this.y0 : 0, this.long0 = void 0 !== this.long0 ? this.long0 : 0, this.lat0 = void 0 !== this.lat0 ? this.lat0 : 0, this.cgb = [], this.cbg = [], this.utg = [], this.gtu = [];
|
|
4444
4461
|
var t3 = this.es / (1 + Math.sqrt(1 - this.es)), s3 = t3 / (2 - t3), i3 = s3;
|
|
4445
4462
|
this.cgb[0] = s3 * (2 + s3 * (-2 / 3 + s3 * (s3 * (116 / 45 + s3 * (26 / 45 + s3 * (-2854 / 675))) - 2))), this.cbg[0] = s3 * (s3 * (2 / 3 + s3 * (4 / 3 + s3 * (-82 / 45 + s3 * (32 / 45 + s3 * (4642 / 4725))))) - 2), i3 *= s3, this.cgb[1] = i3 * (7 / 3 + s3 * (s3 * (-227 / 45 + s3 * (2704 / 315 + s3 * (2323 / 945))) - 1.6)), this.cbg[1] = i3 * (5 / 3 + s3 * (-16 / 15 + s3 * (-13 / 9 + s3 * (904 / 315 + s3 * (-1522 / 945))))), i3 *= s3, this.cgb[2] = i3 * (56 / 15 + s3 * (-136 / 35 + s3 * (-1262 / 105 + s3 * (73814 / 2835)))), this.cbg[2] = i3 * (-26 / 15 + s3 * (34 / 21 + s3 * (1.6 + s3 * (-12686 / 2835)))), i3 *= s3, this.cgb[3] = i3 * (4279 / 630 + s3 * (-332 / 35 + s3 * (-399572 / 14175))), this.cbg[3] = i3 * (1237 / 630 + s3 * (s3 * (-24832 / 14175) - 2.4)), i3 *= s3, this.cgb[4] = i3 * (4174 / 315 + s3 * (-144838 / 6237)), this.cbg[4] = i3 * (-734 / 315 + s3 * (109598 / 31185)), i3 *= s3, this.cgb[5] = i3 * (601676 / 22275), this.cbg[5] = i3 * (444337 / 155925), i3 = Math.pow(s3, 2), this.Qn = this.k0 / (1 + s3) * (1 + i3 * (1 / 4 + i3 * (1 / 64 + i3 / 256))), this.utg[0] = s3 * (s3 * (2 / 3 + s3 * (-37 / 96 + s3 * (1 / 360 + s3 * (81 / 512 + s3 * (-96199 / 604800))))) - 0.5), this.gtu[0] = s3 * (0.5 + s3 * (-2 / 3 + s3 * (5 / 16 + s3 * (41 / 180 + s3 * (-127 / 288 + s3 * (7891 / 37800)))))), this.utg[1] = i3 * (-1 / 48 + s3 * (-1 / 15 + s3 * (437 / 1440 + s3 * (-46 / 105 + s3 * (1118711 / 3870720))))), this.gtu[1] = i3 * (13 / 48 + s3 * (s3 * (557 / 1440 + s3 * (281 / 630 + s3 * (-1983433 / 1935360))) - 0.6)), i3 *= s3, this.utg[2] = i3 * (-17 / 480 + s3 * (37 / 840 + s3 * (209 / 4480 + s3 * (-5569 / 90720)))), this.gtu[2] = i3 * (61 / 240 + s3 * (-103 / 140 + s3 * (15061 / 26880 + s3 * (167603 / 181440)))), i3 *= s3, this.utg[3] = i3 * (-4397 / 161280 + s3 * (11 / 504 + s3 * (830251 / 7257600))), this.gtu[3] = i3 * (49561 / 161280 + s3 * (-179 / 168 + s3 * (6601661 / 7257600))), i3 *= s3, this.utg[4] = i3 * (-4583 / 161280 + s3 * (108847 / 3991680)), this.gtu[4] = i3 * (34729 / 80640 + s3 * (-3418889 / 1995840)), i3 *= s3, this.utg[5] = i3 * (-20648693 / 638668800), this.gtu[5] = 0.6650675310896665 * i3;
|
|
4446
|
-
var e3 =
|
|
4447
|
-
this.Zb = -this.Qn * (e3 +
|
|
4463
|
+
var e3 = gi2(this.cbg, this.lat0);
|
|
4464
|
+
this.Zb = -this.Qn * (e3 + Mi2(this.gtu, 2 * e3));
|
|
4448
4465
|
}
|
|
4449
4466
|
function Ei2(t3) {
|
|
4450
4467
|
var s3 = yt2(t3.x - this.long0), i3 = t3.y;
|
|
4451
|
-
i3 =
|
|
4468
|
+
i3 = gi2(this.cbg, i3);
|
|
4452
4469
|
var e3 = Math.sin(i3), a3 = Math.cos(i3), n3 = Math.sin(s3), r3 = Math.cos(s3);
|
|
4453
4470
|
i3 = Math.atan2(e3, r3 * a3), s3 = Math.atan2(n3 * a3, fi2(e3, a3 * r3)), s3 = pi2(Math.tan(s3));
|
|
4454
4471
|
var h3, o3, c3 = wi2(this.gtu, 2 * i3, 2 * s3);
|
|
@@ -4460,7 +4477,7 @@ Me.exports = function() {
|
|
|
4460
4477
|
var n3 = wi2(this.utg, 2 * a3, 2 * e3);
|
|
4461
4478
|
a3 += n3[0], e3 += n3[1], e3 = Math.atan(_i2(e3));
|
|
4462
4479
|
var r3 = Math.sin(a3), h3 = Math.cos(a3), o3 = Math.sin(e3), c3 = Math.cos(e3);
|
|
4463
|
-
a3 = Math.atan2(r3 * c3, fi2(o3, c3 * h3)), s3 = yt2((e3 = Math.atan2(o3, c3 * h3)) + this.long0), i3 =
|
|
4480
|
+
a3 = Math.atan2(r3 * c3, fi2(o3, c3 * h3)), s3 = yt2((e3 = Math.atan2(o3, c3 * h3)) + this.long0), i3 = gi2(this.cgb, a3);
|
|
4464
4481
|
} else
|
|
4465
4482
|
s3 = 1 / 0, i3 = 1 / 0;
|
|
4466
4483
|
return t3.x = s3, t3.y = i3, t3;
|
|
@@ -4482,20 +4499,20 @@ Me.exports = function() {
|
|
|
4482
4499
|
this.lat0 = 0, this.long0 = (6 * Math.abs(t3) - 183) * f2, this.x0 = 5e5, this.y0 = this.utmSouth ? 1e7 : 0, this.k0 = 0.9996, Pi2.init.apply(this), this.forward = Pi2.forward, this.inverse = Pi2.inverse;
|
|
4483
4500
|
}
|
|
4484
4501
|
var Gi2 = { init: Ai2, names: ["Universal Transverse Mercator System", "utm"], dependsOn: "etmerc" };
|
|
4485
|
-
function
|
|
4502
|
+
function Ni2(t3, s3) {
|
|
4486
4503
|
return Math.pow((1 - t3) / (1 + t3), s3);
|
|
4487
4504
|
}
|
|
4488
|
-
var
|
|
4505
|
+
var Ci2 = 20;
|
|
4489
4506
|
function Ii2() {
|
|
4490
4507
|
var t3 = Math.sin(this.lat0), s3 = Math.cos(this.lat0);
|
|
4491
|
-
s3 *= s3, this.rc = Math.sqrt(1 - this.es) / (1 - this.es * t3 * t3), this.C = Math.sqrt(1 + this.es * s3 * s3 / (1 - this.es)), this.phic0 = Math.asin(t3 / this.C), this.ratexp = 0.5 * this.C * this.e, this.K = Math.tan(0.5 * this.phic0 + p2) / (Math.pow(Math.tan(0.5 * this.lat0 + p2), this.C) *
|
|
4508
|
+
s3 *= s3, this.rc = Math.sqrt(1 - this.es) / (1 - this.es * t3 * t3), this.C = Math.sqrt(1 + this.es * s3 * s3 / (1 - this.es)), this.phic0 = Math.asin(t3 / this.C), this.ratexp = 0.5 * this.C * this.e, this.K = Math.tan(0.5 * this.phic0 + p2) / (Math.pow(Math.tan(0.5 * this.lat0 + p2), this.C) * Ni2(this.e * t3, this.ratexp));
|
|
4492
4509
|
}
|
|
4493
4510
|
function zi2(t3) {
|
|
4494
4511
|
var s3 = t3.x, i3 = t3.y;
|
|
4495
|
-
return t3.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * i3 + p2), this.C) *
|
|
4512
|
+
return t3.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * i3 + p2), this.C) * Ni2(this.e * Math.sin(i3), this.ratexp)) - l2, t3.x = this.C * s3, t3;
|
|
4496
4513
|
}
|
|
4497
4514
|
function Ti2(t3) {
|
|
4498
|
-
for (var s3 = 1e-14, i3 = t3.x / this.C, e3 = t3.y, a3 = Math.pow(Math.tan(0.5 * e3 + p2) / this.K, 1 / this.C), n3 =
|
|
4515
|
+
for (var s3 = 1e-14, i3 = t3.x / this.C, e3 = t3.y, a3 = Math.pow(Math.tan(0.5 * e3 + p2) / this.K, 1 / this.C), n3 = Ci2; n3 > 0 && (e3 = 2 * Math.atan(a3 * Ni2(this.e * Math.sin(t3.y), -0.5 * this.e)) - l2, !(Math.abs(e3 - t3.y) < s3)); --n3)
|
|
4499
4516
|
t3.y = e3;
|
|
4500
4517
|
return n3 ? (t3.x = i3, t3.y = e3, t3) : null;
|
|
4501
4518
|
}
|
|
@@ -4538,9 +4555,9 @@ Me.exports = function() {
|
|
|
4538
4555
|
if (Math.abs(this.coslat0) <= _2) {
|
|
4539
4556
|
if (r3 <= _2)
|
|
4540
4557
|
return i3 = this.lat0, s3 = this.long0, t3.x = s3, t3.y = i3, t3;
|
|
4541
|
-
t3.x *= this.con, t3.y *= this.con, e3 = r3 * this.cons / (2 * this.a * this.k0), i3 = this.con *
|
|
4558
|
+
t3.x *= this.con, t3.y *= this.con, e3 = r3 * this.cons / (2 * this.a * this.k0), i3 = this.con * gt2(this.e, e3), s3 = this.con * yt2(this.con * this.long0 + Math.atan2(t3.x, -1 * t3.y));
|
|
4542
4559
|
} else
|
|
4543
|
-
a3 = 2 * Math.atan(r3 * this.cosX0 / (2 * this.a * this.k0 * this.ms1)), s3 = this.long0, r3 <= _2 ? n3 = this.X0 : (n3 = Math.asin(Math.cos(a3) * this.sinX0 + t3.y * Math.sin(a3) * this.cosX0 / r3), s3 = yt2(this.long0 + Math.atan2(t3.x * Math.sin(a3), r3 * this.cosX0 * Math.cos(a3) - t3.y * this.sinX0 * Math.sin(a3)))), i3 = -1 *
|
|
4560
|
+
a3 = 2 * Math.atan(r3 * this.cosX0 / (2 * this.a * this.k0 * this.ms1)), s3 = this.long0, r3 <= _2 ? n3 = this.X0 : (n3 = Math.asin(Math.cos(a3) * this.sinX0 + t3.y * Math.sin(a3) * this.cosX0 / r3), s3 = yt2(this.long0 + Math.atan2(t3.x * Math.sin(a3), r3 * this.cosX0 * Math.cos(a3) - t3.y * this.sinX0 * Math.sin(a3)))), i3 = -1 * gt2(this.e, Math.tan(0.5 * (l2 + n3)));
|
|
4544
4561
|
return t3.x = s3, t3.y = i3, t3;
|
|
4545
4562
|
}
|
|
4546
4563
|
var Fi2 = { init: Di2, forward: Ui2, inverse: ji2, names: ["stere", "Stereographic_South_Pole", "Polar_Stereographic_variant_A", "Polar_Stereographic_variant_B", "Polar_Stereographic"], ssfn_: ki2 };
|
|
@@ -4564,30 +4581,30 @@ Me.exports = function() {
|
|
|
4564
4581
|
}
|
|
4565
4582
|
return t3.x = h3, t3.y = c3, t3;
|
|
4566
4583
|
}
|
|
4567
|
-
var
|
|
4568
|
-
function
|
|
4584
|
+
var Xi2 = { init: Vi2, forward: Wi2, inverse: Hi2, names: ["somerc"] }, Yi2 = 1e-7;
|
|
4585
|
+
function Zi2(t3) {
|
|
4569
4586
|
var s3 = ["Hotine_Oblique_Mercator", "Hotine_Oblique_Mercator_variant_A", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin"], i3 = "object" == typeof t3.projName ? Object.keys(t3.projName)[0] : t3.projName;
|
|
4570
4587
|
return "no_uoff" in t3 || "no_off" in t3 || -1 !== s3.indexOf(i3) || -1 !== s3.indexOf(Gt2(i3));
|
|
4571
4588
|
}
|
|
4572
|
-
function
|
|
4573
|
-
var t3, s3, i3, e3, a3, n3, r3, h3, o3, c3, u3, d3 = 0, m3 = 0, f3 = 0, y3 = 0,
|
|
4574
|
-
this.no_off =
|
|
4589
|
+
function Qi2() {
|
|
4590
|
+
var t3, s3, i3, e3, a3, n3, r3, h3, o3, c3, u3, d3 = 0, m3 = 0, f3 = 0, y3 = 0, M3 = 0, x3 = 0, w3 = 0;
|
|
4591
|
+
this.no_off = Zi2(this), this.no_rot = "no_rot" in this;
|
|
4575
4592
|
var S3 = false;
|
|
4576
4593
|
"alpha" in this && (S3 = true);
|
|
4577
4594
|
var E3 = false;
|
|
4578
4595
|
if ("rectified_grid_angle" in this && (E3 = true), S3 && (w3 = this.alpha), E3 && (d3 = this.rectified_grid_angle), S3 || E3)
|
|
4579
4596
|
m3 = this.longc;
|
|
4580
|
-
else if (f3 = this.long1,
|
|
4597
|
+
else if (f3 = this.long1, M3 = this.lat1, y3 = this.long2, x3 = this.lat2, Math.abs(M3 - x3) <= Yi2 || (t3 = Math.abs(M3)) <= Yi2 || Math.abs(t3 - l2) <= Yi2 || Math.abs(Math.abs(this.lat0) - l2) <= Yi2 || Math.abs(Math.abs(x3) - l2) <= Yi2)
|
|
4581
4598
|
throw new Error();
|
|
4582
4599
|
var b3 = 1 - this.es;
|
|
4583
|
-
s3 = Math.sqrt(b3), Math.abs(this.lat0) > _2 ? (h3 = Math.sin(this.lat0), i3 = Math.cos(this.lat0), t3 = 1 - this.es * h3 * h3, this.B = i3 * i3, this.B = Math.sqrt(1 + this.es * this.B * this.B / b3), this.A = this.B * this.k0 * s3 / t3, (a3 = (e3 = this.B * s3 / (i3 * Math.sqrt(t3))) * e3 - 1) <= 0 ? a3 = 0 : (a3 = Math.sqrt(a3), this.lat0 < 0 && (a3 = -a3)), this.E = a3 += e3, this.E *= Math.pow(pt2(this.e, this.lat0, h3), this.B)) : (this.B = 1 / s3, this.A = this.k0, this.E = e3 = a3 = 1), S3 || E3 ? (S3 ? (u3 = Math.asin(Math.sin(w3) / e3), E3 || (d3 = w3)) : (u3 = d3, w3 = Math.asin(e3 * Math.sin(u3))), this.lam0 = m3 - Math.asin(0.5 * (a3 - 1 / a3) * Math.tan(u3)) / this.B) : (n3 = Math.pow(pt2(this.e,
|
|
4600
|
+
s3 = Math.sqrt(b3), Math.abs(this.lat0) > _2 ? (h3 = Math.sin(this.lat0), i3 = Math.cos(this.lat0), t3 = 1 - this.es * h3 * h3, this.B = i3 * i3, this.B = Math.sqrt(1 + this.es * this.B * this.B / b3), this.A = this.B * this.k0 * s3 / t3, (a3 = (e3 = this.B * s3 / (i3 * Math.sqrt(t3))) * e3 - 1) <= 0 ? a3 = 0 : (a3 = Math.sqrt(a3), this.lat0 < 0 && (a3 = -a3)), this.E = a3 += e3, this.E *= Math.pow(pt2(this.e, this.lat0, h3), this.B)) : (this.B = 1 / s3, this.A = this.k0, this.E = e3 = a3 = 1), S3 || E3 ? (S3 ? (u3 = Math.asin(Math.sin(w3) / e3), E3 || (d3 = w3)) : (u3 = d3, w3 = Math.asin(e3 * Math.sin(u3))), this.lam0 = m3 - Math.asin(0.5 * (a3 - 1 / a3) * Math.tan(u3)) / this.B) : (n3 = Math.pow(pt2(this.e, M3, Math.sin(M3)), this.B), r3 = Math.pow(pt2(this.e, x3, Math.sin(x3)), this.B), a3 = this.E / n3, o3 = (r3 - n3) / (r3 + n3), c3 = ((c3 = this.E * this.E) - r3 * n3) / (c3 + r3 * n3), (t3 = f3 - y3) < -Math.pi ? y3 -= g2 : t3 > Math.pi && (y3 += g2), this.lam0 = yt2(0.5 * (f3 + y3) - Math.atan(c3 * Math.tan(0.5 * this.B * (f3 - y3)) / o3) / this.B), u3 = Math.atan(2 * Math.sin(this.B * yt2(f3 - this.lam0)) / (a3 - 1 / a3)), d3 = w3 = Math.asin(e3 * Math.sin(u3))), this.singam = Math.sin(u3), this.cosgam = Math.cos(u3), this.sinrot = Math.sin(d3), this.cosrot = Math.cos(d3), this.rB = 1 / this.B, this.ArB = this.A * this.rB, this.BrA = 1 / this.ArB, this.no_off ? this.u_0 = 0 : (this.u_0 = Math.abs(this.ArB * Math.atan(Math.sqrt(e3 * e3 - 1) / Math.cos(w3))), this.lat0 < 0 && (this.u_0 = -this.u_0)), a3 = 0.5 * u3, this.v_pole_n = this.ArB * Math.log(Math.tan(p2 - a3)), this.v_pole_s = this.ArB * Math.log(Math.tan(p2 + a3));
|
|
4584
4601
|
}
|
|
4585
4602
|
function Ki2(t3) {
|
|
4586
4603
|
var s3, i3, e3, a3, n3, r3, h3, o3, c3 = {};
|
|
4587
4604
|
if (t3.x = t3.x - this.lam0, Math.abs(Math.abs(t3.y) - l2) > _2) {
|
|
4588
4605
|
if (s3 = 0.5 * ((n3 = this.E / Math.pow(pt2(this.e, t3.y, Math.sin(t3.y)), this.B)) - (r3 = 1 / n3)), i3 = 0.5 * (n3 + r3), a3 = Math.sin(this.B * t3.x), e3 = (s3 * this.singam - a3 * this.cosgam) / i3, Math.abs(Math.abs(e3) - 1) < _2)
|
|
4589
4606
|
throw new Error();
|
|
4590
|
-
o3 = 0.5 * this.ArB * Math.log((1 - e3) / (1 + e3)), r3 = Math.cos(this.B * t3.x), h3 = Math.abs(r3) <
|
|
4607
|
+
o3 = 0.5 * this.ArB * Math.log((1 - e3) / (1 + e3)), r3 = Math.cos(this.B * t3.x), h3 = Math.abs(r3) < Yi2 ? this.A * t3.x : this.ArB * Math.atan2(s3 * this.cosgam + a3 * this.singam, r3);
|
|
4591
4608
|
} else
|
|
4592
4609
|
o3 = t3.y > 0 ? this.v_pole_n : this.v_pole_s, h3 = this.ArB * t3.y;
|
|
4593
4610
|
return this.no_rot ? (c3.x = h3, c3.y = o3) : (h3 -= this.u_0, c3.x = o3 * this.cosrot + h3 * this.sinrot, c3.y = h3 * this.cosrot - o3 * this.sinrot), c3.x = this.a * c3.x + this.x0, c3.y = this.a * c3.y + this.y0, c3;
|
|
@@ -4597,13 +4614,13 @@ Me.exports = function() {
|
|
|
4597
4614
|
if (t3.x = (t3.x - this.x0) * (1 / this.a), t3.y = (t3.y - this.y0) * (1 / this.a), this.no_rot ? (i3 = t3.y, s3 = t3.x) : (i3 = t3.x * this.cosrot - t3.y * this.sinrot, s3 = t3.y * this.cosrot + t3.x * this.sinrot + this.u_0), a3 = 0.5 * ((e3 = Math.exp(-this.BrA * i3)) - 1 / e3), n3 = 0.5 * (e3 + 1 / e3), h3 = ((r3 = Math.sin(this.BrA * s3)) * this.cosgam + a3 * this.singam) / n3, Math.abs(Math.abs(h3) - 1) < _2)
|
|
4598
4615
|
o3.x = 0, o3.y = h3 < 0 ? -l2 : l2;
|
|
4599
4616
|
else {
|
|
4600
|
-
if (o3.y = this.E / Math.sqrt((1 + h3) / (1 - h3)), o3.y =
|
|
4617
|
+
if (o3.y = this.E / Math.sqrt((1 + h3) / (1 - h3)), o3.y = gt2(this.e, Math.pow(o3.y, 1 / this.B)), o3.y === 1 / 0)
|
|
4601
4618
|
throw new Error();
|
|
4602
4619
|
o3.x = -this.rB * Math.atan2(a3 * this.cosgam - r3 * this.singam, Math.cos(this.BrA * s3));
|
|
4603
4620
|
}
|
|
4604
4621
|
return o3.x += this.lam0, o3;
|
|
4605
4622
|
}
|
|
4606
|
-
var $i2 = { init:
|
|
4623
|
+
var $i2 = { init: Qi2, forward: Ki2, inverse: Ji2, names: ["Hotine_Oblique_Mercator", "Hotine Oblique Mercator", "Hotine_Oblique_Mercator_variant_A", "Hotine_Oblique_Mercator_Variant_B", "Hotine_Oblique_Mercator_Azimuth_Natural_Origin", "Hotine_Oblique_Mercator_Two_Point_Natural_Origin", "Hotine_Oblique_Mercator_Azimuth_Center", "Oblique_Mercator", "omerc"] };
|
|
4607
4624
|
function te2() {
|
|
4608
4625
|
if (this.lat2 || (this.lat2 = this.lat1), this.k0 || (this.k0 = 1), this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, !(Math.abs(this.lat1 + this.lat2) < _2)) {
|
|
4609
4626
|
var t3 = this.b / this.a;
|
|
@@ -4631,7 +4648,7 @@ Me.exports = function() {
|
|
|
4631
4648
|
this.ns > 0 ? (s3 = Math.sqrt(r3 * r3 + h3 * h3), i3 = 1) : (s3 = -Math.sqrt(r3 * r3 + h3 * h3), i3 = -1);
|
|
4632
4649
|
var o3 = 0;
|
|
4633
4650
|
if (0 !== s3 && (o3 = Math.atan2(i3 * r3, i3 * h3)), 0 !== s3 || this.ns > 0) {
|
|
4634
|
-
if (i3 = 1 / this.ns, e3 = Math.pow(s3 / (this.a * this.f0), i3), -9999 === (a3 =
|
|
4651
|
+
if (i3 = 1 / this.ns, e3 = Math.pow(s3 / (this.a * this.f0), i3), -9999 === (a3 = gt2(this.e, e3)))
|
|
4635
4652
|
return null;
|
|
4636
4653
|
} else
|
|
4637
4654
|
a3 = -l2;
|
|
@@ -4698,7 +4715,7 @@ Me.exports = function() {
|
|
|
4698
4715
|
}
|
|
4699
4716
|
return t3.x = s3 + this.x0, t3.y = i3 + this.y0, t3;
|
|
4700
4717
|
}
|
|
4701
|
-
function
|
|
4718
|
+
function ge2(t3) {
|
|
4702
4719
|
t3.x -= this.x0, t3.y -= this.y0;
|
|
4703
4720
|
var s3, i3, e3 = t3.x / this.a, a3 = t3.y / this.a;
|
|
4704
4721
|
if (this.sphere) {
|
|
@@ -4713,7 +4730,7 @@ Me.exports = function() {
|
|
|
4713
4730
|
}
|
|
4714
4731
|
return t3.x = yt2(i3 + this.long0), t3.y = _e2(s3), t3;
|
|
4715
4732
|
}
|
|
4716
|
-
var
|
|
4733
|
+
var Me2 = { init: ye2, forward: pe2, inverse: ge2, names: ["Cassini", "Cassini_Soldner", "cass"] };
|
|
4717
4734
|
function xe2(t3, s3) {
|
|
4718
4735
|
var i3;
|
|
4719
4736
|
return t3 > 1e-7 ? (1 - t3 * t3) * (s3 / (1 - (i3 = t3 * s3) * i3) - 0.5 / t3 * Math.log((1 - i3) / (1 + i3))) : 2 * s3;
|
|
@@ -4721,7 +4738,7 @@ Me.exports = function() {
|
|
|
4721
4738
|
function we2() {
|
|
4722
4739
|
var t3, s3 = Math.abs(this.lat0);
|
|
4723
4740
|
if (Math.abs(s3 - l2) < _2 ? this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE : Math.abs(s3) < _2 ? this.mode = this.EQUIT : this.mode = this.OBLIQ, this.es > 0)
|
|
4724
|
-
switch (this.qp = xe2(this.e, 1), this.mmf = 0.5 / (1 - this.es), this.apa =
|
|
4741
|
+
switch (this.qp = xe2(this.e, 1), this.mmf = 0.5 / (1 - this.es), this.apa = Ce2(this.es), this.mode) {
|
|
4725
4742
|
case this.N_POLE:
|
|
4726
4743
|
case this.S_POLE:
|
|
4727
4744
|
this.dd = 1;
|
|
@@ -4810,10 +4827,10 @@ Me.exports = function() {
|
|
|
4810
4827
|
}
|
|
4811
4828
|
return t3.x = yt2(this.long0 + s3), t3.y = i3, t3;
|
|
4812
4829
|
}
|
|
4813
|
-
var be2 = 0.3333333333333333, Pe2 = 0.17222222222222222, ve2 = 0.10257936507936508, Ae2 = 0.06388888888888888, Ge2 = 0.0664021164021164,
|
|
4814
|
-
function
|
|
4830
|
+
var be2 = 0.3333333333333333, Pe2 = 0.17222222222222222, ve2 = 0.10257936507936508, Ae2 = 0.06388888888888888, Ge2 = 0.0664021164021164, Ne2 = 0.016415012942191543;
|
|
4831
|
+
function Ce2(t3) {
|
|
4815
4832
|
var s3, i3 = [];
|
|
4816
|
-
return i3[0] = t3 * be2, s3 = t3 * t3, i3[0] += s3 * Pe2, i3[1] = s3 * Ae2, s3 *= t3, i3[0] += s3 * ve2, i3[1] += s3 * Ge2, i3[2] = s3 *
|
|
4833
|
+
return i3[0] = t3 * be2, s3 = t3 * t3, i3[0] += s3 * Pe2, i3[1] = s3 * Ae2, s3 *= t3, i3[0] += s3 * ve2, i3[1] += s3 * Ge2, i3[2] = s3 * Ne2, i3;
|
|
4817
4834
|
}
|
|
4818
4835
|
function Ie2(t3, s3) {
|
|
4819
4836
|
var i3 = t3 + t3;
|
|
@@ -4858,7 +4875,7 @@ Me.exports = function() {
|
|
|
4858
4875
|
return t3.x = (t3.x - this.x0) / this.a, t3.y = (t3.y - this.y0) / this.a, t3.x /= this.k0, t3.y /= this.k0, (s3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y)) ? (a3 = Math.atan2(s3, this.rc), i3 = Math.sin(a3), r3 = Te2((e3 = Math.cos(a3)) * this.sin_p14 + t3.y * i3 * this.cos_p14 / s3), n3 = Math.atan2(t3.x * i3, s3 * this.cos_p14 * e3 - t3.y * this.sin_p14 * i3), n3 = yt2(this.long0 + n3)) : (r3 = this.phic0, n3 = 0), t3.x = n3, t3.y = r3, t3;
|
|
4859
4876
|
}
|
|
4860
4877
|
var je2 = { init: ke2, forward: De2, inverse: Ue2, names: ["gnom"] };
|
|
4861
|
-
function
|
|
4878
|
+
function Fe2(t3, s3) {
|
|
4862
4879
|
var i3 = 1 - (1 - t3 * t3) / (2 * t3) * Math.log((1 - t3) / (1 + t3));
|
|
4863
4880
|
if (Math.abs(Math.abs(s3) - i3) < 1e-6)
|
|
4864
4881
|
return s3 < 0 ? -1 * l2 : l2;
|
|
@@ -4867,10 +4884,10 @@ Me.exports = function() {
|
|
|
4867
4884
|
return h3;
|
|
4868
4885
|
return NaN;
|
|
4869
4886
|
}
|
|
4870
|
-
function
|
|
4887
|
+
function Ve2() {
|
|
4871
4888
|
this.sphere || (this.k0 = _t2(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)));
|
|
4872
4889
|
}
|
|
4873
|
-
function
|
|
4890
|
+
function We2(t3) {
|
|
4874
4891
|
var s3, i3, e3 = t3.x, a3 = t3.y, n3 = yt2(e3 - this.long0);
|
|
4875
4892
|
if (this.sphere)
|
|
4876
4893
|
s3 = this.x0 + this.a * n3 * Math.cos(this.lat_ts), i3 = this.y0 + this.a * Math.sin(a3) / Math.cos(this.lat_ts);
|
|
@@ -4880,24 +4897,24 @@ Me.exports = function() {
|
|
|
4880
4897
|
}
|
|
4881
4898
|
return t3.x = s3, t3.y = i3, t3;
|
|
4882
4899
|
}
|
|
4883
|
-
function
|
|
4900
|
+
function He2(t3) {
|
|
4884
4901
|
var s3, i3;
|
|
4885
|
-
return t3.x -= this.x0, t3.y -= this.y0, this.sphere ? (s3 = yt2(this.long0 + t3.x / this.a / Math.cos(this.lat_ts)), i3 = Math.asin(t3.y / this.a * Math.cos(this.lat_ts))) : (i3 =
|
|
4902
|
+
return t3.x -= this.x0, t3.y -= this.y0, this.sphere ? (s3 = yt2(this.long0 + t3.x / this.a / Math.cos(this.lat_ts)), i3 = Math.asin(t3.y / this.a * Math.cos(this.lat_ts))) : (i3 = Fe2(this.e, 2 * t3.y * this.k0 / this.a), s3 = yt2(this.long0 + t3.x / (this.a * this.k0))), t3.x = s3, t3.y = i3, t3;
|
|
4886
4903
|
}
|
|
4887
|
-
var
|
|
4888
|
-
function
|
|
4904
|
+
var Xe2 = { init: Ve2, forward: We2, inverse: He2, names: ["cea"] };
|
|
4905
|
+
function Ye2() {
|
|
4889
4906
|
this.x0 = this.x0 || 0, this.y0 = this.y0 || 0, this.lat0 = this.lat0 || 0, this.long0 = this.long0 || 0, this.lat_ts = this.lat_ts || 0, this.title = this.title || "Equidistant Cylindrical (Plate Carre)", this.rc = Math.cos(this.lat_ts);
|
|
4890
4907
|
}
|
|
4891
|
-
function
|
|
4908
|
+
function Ze2(t3) {
|
|
4892
4909
|
var s3 = t3.x, i3 = t3.y, e3 = yt2(s3 - this.long0), a3 = _e2(i3 - this.lat0);
|
|
4893
4910
|
return t3.x = this.x0 + this.a * e3 * this.rc, t3.y = this.y0 + this.a * a3, t3;
|
|
4894
4911
|
}
|
|
4895
|
-
function
|
|
4912
|
+
function Qe2(t3) {
|
|
4896
4913
|
var s3 = t3.x, i3 = t3.y;
|
|
4897
4914
|
return t3.x = yt2(this.long0 + (s3 - this.x0) / (this.a * this.rc)), t3.y = _e2(this.lat0 + (i3 - this.y0) / this.a), t3;
|
|
4898
4915
|
}
|
|
4899
|
-
var
|
|
4900
|
-
function $
|
|
4916
|
+
var Ke2 = { init: Ye2, forward: Ze2, inverse: Qe2, names: ["Equirectangular", "Equidistant_Cylindrical", "Equidistant_Cylindrical_Spherical", "eqc"] }, Je2 = 20;
|
|
4917
|
+
function $e2() {
|
|
4901
4918
|
this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = ce2(this.es), this.e1 = le2(this.es), this.e2 = ue2(this.es), this.e3 = de2(this.es), this.ml0 = this.a * oe2(this.e0, this.e1, this.e2, this.e3, this.lat0);
|
|
4902
4919
|
}
|
|
4903
4920
|
function ta(t3) {
|
|
@@ -4919,7 +4936,7 @@ Me.exports = function() {
|
|
|
4919
4936
|
s3 = yt2(e3 / this.a + this.long0), i3 = 0;
|
|
4920
4937
|
else {
|
|
4921
4938
|
var l3;
|
|
4922
|
-
for (r3 = this.lat0 + a3 / this.a, h3 = e3 * e3 / this.a / this.a + r3 * r3, o3 = r3, n3 =
|
|
4939
|
+
for (r3 = this.lat0 + a3 / this.a, h3 = e3 * e3 / this.a / this.a + r3 * r3, o3 = r3, n3 = Je2; n3; --n3)
|
|
4923
4940
|
if (o3 += c3 = -1 * (r3 * (o3 * (l3 = Math.tan(o3)) + 1) - o3 - 0.5 * (o3 * o3 + h3) * l3) / ((o3 - r3) / l3 - 1), Math.abs(c3) <= _2) {
|
|
4924
4941
|
i3 = o3;
|
|
4925
4942
|
break;
|
|
@@ -4930,7 +4947,7 @@ Me.exports = function() {
|
|
|
4930
4947
|
i3 = 0, s3 = yt2(this.long0 + e3 / this.a);
|
|
4931
4948
|
else {
|
|
4932
4949
|
var u3, d3, m3, f3, y3;
|
|
4933
|
-
for (r3 = (this.ml0 + a3) / this.a, h3 = e3 * e3 / this.a / this.a + r3 * r3, o3 = r3, n3 =
|
|
4950
|
+
for (r3 = (this.ml0 + a3) / this.a, h3 = e3 * e3 / this.a / this.a + r3 * r3, o3 = r3, n3 = Je2; n3; --n3)
|
|
4934
4951
|
if (y3 = this.e * Math.sin(o3), u3 = Math.sqrt(1 - y3 * y3) * Math.tan(o3), d3 = this.a * oe2(this.e0, this.e1, this.e2, this.e3, o3), m3 = this.e0 - 2 * this.e1 * Math.cos(2 * o3) + 4 * this.e2 * Math.cos(4 * o3) - 6 * this.e3 * Math.cos(6 * o3), o3 -= c3 = (r3 * (u3 * (f3 = d3 / this.a) + 1) - f3 - 0.5 * u3 * (f3 * f3 + h3)) / (this.es * Math.sin(2 * o3) * (f3 * f3 + h3 - 2 * r3 * f3) / (4 * u3) + (r3 - f3) * (u3 * m3 - 2 / Math.sin(2 * o3)) - m3), Math.abs(c3) <= _2) {
|
|
4935
4952
|
i3 = o3;
|
|
4936
4953
|
break;
|
|
@@ -4939,7 +4956,7 @@ Me.exports = function() {
|
|
|
4939
4956
|
}
|
|
4940
4957
|
return t3.x = s3, t3.y = i3, t3;
|
|
4941
4958
|
}
|
|
4942
|
-
var ia = { init: $
|
|
4959
|
+
var ia = { init: $e2, forward: ta, inverse: sa, names: ["Polyconic", "American_Polyconic", "poly"] };
|
|
4943
4960
|
function ea() {
|
|
4944
4961
|
this.A = [], this.A[1] = 0.6399175073, this.A[2] = -0.1358797613, this.A[3] = 0.063294409, this.A[4] = -0.02526853, this.A[5] = 0.0117879, this.A[6] = -55161e-7, this.A[7] = 26906e-7, this.A[8] = -1333e-6, this.A[9] = 67e-5, this.A[10] = -34e-5, this.B_re = [], this.B_im = [], this.B_re[1] = 0.7557853228, this.B_im[1] = 0, this.B_re[2] = 0.249204646, this.B_im[2] = 3371507e-9, this.B_re[3] = -1541739e-9, this.B_im[3] = 0.04105856, this.B_re[4] = -0.10162907, this.B_im[4] = 0.01727609, this.B_re[5] = -0.26623489, this.B_im[5] = -0.36249218, this.B_re[6] = -0.6870983, this.B_im[6] = -1.1651967, this.C_re = [], this.C_im = [], this.C_re[1] = 1.3231270439, this.C_im[1] = 0, this.C_re[2] = -0.577245789, this.C_im[2] = -7809598e-9, this.C_re[3] = 0.508307513, this.C_im[3] = -0.112208952, this.C_re[4] = -0.15094762, this.C_im[4] = 0.18200602, this.C_re[5] = 1.01418179, this.C_im[5] = 1.64497696, this.C_re[6] = 1.9660549, this.C_im[6] = 2.5127645, this.D = [], this.D[1] = 1.5627014243, this.D[2] = 0.5185406398, this.D[3] = -0.03333098, this.D[4] = -0.1052906, this.D[5] = -0.0368594, this.D[6] = 7317e-6, this.D[7] = 0.0122, this.D[8] = 394e-5, this.D[9] = -13e-4;
|
|
4945
4962
|
}
|
|
@@ -4957,15 +4974,15 @@ Me.exports = function() {
|
|
|
4957
4974
|
for (s3 = 1; s3 <= 6; s3++)
|
|
4958
4975
|
i3 = l3 * r3 + o3 * h3, o3 = o3 * r3 - l3 * h3, l3 = i3, u3 = u3 + this.C_re[s3] * o3 - this.C_im[s3] * l3, d3 = d3 + this.C_im[s3] * o3 + this.C_re[s3] * l3;
|
|
4959
4976
|
for (var m3 = 0; m3 < this.iterations; m3++) {
|
|
4960
|
-
var _3, f3 = u3, y3 = d3, p3 = r3,
|
|
4977
|
+
var _3, f3 = u3, y3 = d3, p3 = r3, g3 = h3;
|
|
4961
4978
|
for (s3 = 2; s3 <= 6; s3++)
|
|
4962
|
-
_3 = y3 * u3 + f3 * d3, f3 = f3 * u3 - y3 * d3, y3 = _3, p3 += (s3 - 1) * (this.B_re[s3] * f3 - this.B_im[s3] * y3),
|
|
4979
|
+
_3 = y3 * u3 + f3 * d3, f3 = f3 * u3 - y3 * d3, y3 = _3, p3 += (s3 - 1) * (this.B_re[s3] * f3 - this.B_im[s3] * y3), g3 += (s3 - 1) * (this.B_im[s3] * f3 + this.B_re[s3] * y3);
|
|
4963
4980
|
f3 = 1, y3 = 0;
|
|
4964
|
-
var
|
|
4981
|
+
var M3 = this.B_re[1], x3 = this.B_im[1];
|
|
4965
4982
|
for (s3 = 2; s3 <= 6; s3++)
|
|
4966
|
-
_3 = y3 * u3 + f3 * d3, f3 = f3 * u3 - y3 * d3, y3 = _3,
|
|
4967
|
-
var w3 =
|
|
4968
|
-
u3 = (p3 *
|
|
4983
|
+
_3 = y3 * u3 + f3 * d3, f3 = f3 * u3 - y3 * d3, y3 = _3, M3 += s3 * (this.B_re[s3] * f3 - this.B_im[s3] * y3), x3 += s3 * (this.B_im[s3] * f3 + this.B_re[s3] * y3);
|
|
4984
|
+
var w3 = M3 * M3 + x3 * x3;
|
|
4985
|
+
u3 = (p3 * M3 + g3 * x3) / w3, d3 = (g3 * M3 - p3 * x3) / w3;
|
|
4969
4986
|
}
|
|
4970
4987
|
var S3 = u3, E3 = d3, b3 = 1, P3 = 0;
|
|
4971
4988
|
for (s3 = 1; s3 <= 9; s3++)
|
|
@@ -5024,7 +5041,7 @@ Me.exports = function() {
|
|
|
5024
5041
|
var h3 = 0.900316316158 * this.a * e3 * Math.cos(a3) + this.x0, o3 = 1.4142135623731 * this.a * Math.sin(a3) + this.y0;
|
|
5025
5042
|
return t3.x = h3, t3.y = o3, t3;
|
|
5026
5043
|
}
|
|
5027
|
-
function
|
|
5044
|
+
function ga(t3) {
|
|
5028
5045
|
var s3, i3;
|
|
5029
5046
|
t3.x -= this.x0, t3.y -= this.y0, i3 = t3.y / (1.4142135623731 * this.a), Math.abs(i3) > 0.999999999999 && (i3 = 0.999999999999), s3 = Math.asin(i3);
|
|
5030
5047
|
var e3 = yt2(this.long0 + t3.x / (0.900316316158 * this.a * Math.cos(s3)));
|
|
@@ -5032,7 +5049,7 @@ Me.exports = function() {
|
|
|
5032
5049
|
var a3 = Math.asin(i3);
|
|
5033
5050
|
return t3.x = e3, t3.y = a3, t3;
|
|
5034
5051
|
}
|
|
5035
|
-
var
|
|
5052
|
+
var Ma = { init: ya, forward: pa, inverse: ga, names: ["Mollweide", "moll"] };
|
|
5036
5053
|
function xa() {
|
|
5037
5054
|
Math.abs(this.lat1 + this.lat2) < _2 || (this.lat2 = this.lat2 || this.lat1, this.temp = this.b / this.a, this.es = 1 - Math.pow(this.temp, 2), this.e = Math.sqrt(this.es), this.e0 = ce2(this.es), this.e1 = le2(this.es), this.e2 = ue2(this.es), this.e3 = de2(this.es), this.sinphi = Math.sin(this.lat1), this.cosphi = Math.cos(this.lat1), this.ms1 = _t2(this.e, this.sinphi, this.cosphi), this.ml1 = oe2(this.e0, this.e1, this.e2, this.e3, this.lat1), Math.abs(this.lat1 - this.lat2) < _2 ? this.ns = this.sinphi : (this.sinphi = Math.sin(this.lat2), this.cosphi = Math.cos(this.lat2), this.ms2 = _t2(this.e, this.sinphi, this.cosphi), this.ml2 = oe2(this.e0, this.e1, this.e2, this.e3, this.lat2), this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1)), this.g = this.ml1 + this.ms1 / this.ns, this.ml0 = oe2(this.e0, this.e1, this.e2, this.e3, this.lat0), this.rh = this.a * (this.g - this.ml0));
|
|
5038
5055
|
}
|
|
@@ -5064,15 +5081,15 @@ Me.exports = function() {
|
|
|
5064
5081
|
(Math.abs(n3) <= _2 || Math.abs(Math.abs(a3) - l2) <= _2) && (s3 = this.x0, i3 = a3 >= 0 ? this.y0 + Math.PI * this.R * Math.tan(0.5 * r3) : this.y0 + Math.PI * this.R * -Math.tan(0.5 * r3));
|
|
5065
5082
|
var h3 = 0.5 * Math.abs(Math.PI / n3 - n3 / Math.PI), o3 = h3 * h3, c3 = Math.sin(r3), u3 = Math.cos(r3), d3 = u3 / (c3 + u3 - 1), m3 = d3 * d3, f3 = d3 * (2 / c3 - 1), y3 = f3 * f3, p3 = Math.PI * this.R * (h3 * (d3 - y3) + Math.sqrt(o3 * (d3 - y3) * (d3 - y3) - (y3 + o3) * (m3 - y3))) / (y3 + o3);
|
|
5066
5083
|
n3 < 0 && (p3 = -p3), s3 = this.x0 + p3;
|
|
5067
|
-
var
|
|
5068
|
-
return p3 = Math.PI * this.R * (f3 *
|
|
5084
|
+
var g3 = o3 + d3;
|
|
5085
|
+
return p3 = Math.PI * this.R * (f3 * g3 - h3 * Math.sqrt((y3 + o3) * (o3 + 1) - g3 * g3)) / (y3 + o3), i3 = a3 >= 0 ? this.y0 + p3 : this.y0 - p3, t3.x = s3, t3.y = i3, t3;
|
|
5069
5086
|
}
|
|
5070
5087
|
function va(t3) {
|
|
5071
5088
|
var s3, i3, e3, a3, n3, r3, h3, o3, c3, l3, u3, d3;
|
|
5072
5089
|
return t3.x -= this.x0, t3.y -= this.y0, u3 = Math.PI * this.R, n3 = (e3 = t3.x / u3) * e3 + (a3 = t3.y / u3) * a3, u3 = 3 * (a3 * a3 / (o3 = -2 * (r3 = -Math.abs(a3) * (1 + n3)) + 1 + 2 * a3 * a3 + n3 * n3) + (2 * (h3 = r3 - 2 * a3 * a3 + e3 * e3) * h3 * h3 / o3 / o3 / o3 - 9 * r3 * h3 / o3 / o3) / 27) / (c3 = (r3 - h3 * h3 / 3 / o3) / o3) / (l3 = 2 * Math.sqrt(-c3 / 3)), Math.abs(u3) > 1 && (u3 = u3 >= 0 ? 1 : -1), d3 = Math.acos(u3) / 3, i3 = t3.y >= 0 ? (-l3 * Math.cos(d3 + Math.PI / 3) - h3 / 3 / o3) * Math.PI : -(-l3 * Math.cos(d3 + Math.PI / 3) - h3 / 3 / o3) * Math.PI, s3 = Math.abs(e3) < _2 ? this.long0 : yt2(this.long0 + Math.PI * (n3 - 1 + Math.sqrt(1 + 2 * (e3 * e3 - a3 * a3) + n3 * n3)) / 2 / e3), t3.x = s3, t3.y = i3, t3;
|
|
5073
5090
|
}
|
|
5074
|
-
var Aa, Ga = { init: ba, forward: Pa, inverse: va, names: ["Van_der_Grinten_I", "VanDerGrinten", "Van_der_Grinten", "vandg"] },
|
|
5075
|
-
function
|
|
5091
|
+
var Aa, Ga = { init: ba, forward: Pa, inverse: va, names: ["Van_der_Grinten_I", "VanDerGrinten", "Van_der_Grinten", "vandg"] }, Na = { exports: {} };
|
|
5092
|
+
function Ca() {
|
|
5076
5093
|
return Aa || (Aa = 1, function(t3) {
|
|
5077
5094
|
var s3, i3, e3, a3;
|
|
5078
5095
|
s3 = function(s4) {
|
|
@@ -5174,8 +5191,8 @@ Me.exports = function() {
|
|
|
5174
5191
|
this._s = s4.remainder(this._s, t5), this.Add(0);
|
|
5175
5192
|
};
|
|
5176
5193
|
}(a3.Accumulator, a3.Math), a3.Geodesic = {}, a3.GeodesicLine = {}, a3.PolygonArea = {}, function(t4, s4, i4, e4, a4) {
|
|
5177
|
-
var n3, r3, h3, o3, c3, l3, u3, d3, m3, _3, f3, y3 = 6, p3 = y3,
|
|
5178
|
-
t4.tiny_ = Math.sqrt(Number.MIN_VALUE / Number.EPSILON), t4.nC1_ = y3, t4.nC1p_ = y3, t4.nC2_ = y3, t4.nC3_ = y3, t4.nC4_ = y3, n3 = t4.nC3_ * (t4.nC3_ - 1) / 2, r3 = t4.nC4_ * (t4.nC4_ + 1) / 2, t4.CAP_C1 = 1, t4.CAP_C1p = 2, t4.CAP_C2 = 4, t4.CAP_C3 = 8, t4.CAP_C4 = 16, t4.NONE = 0, t4.ARC = 64, t4.LATITUDE = 128 | G3, t4.LONGITUDE = 256 | t4.CAP_C3, t4.AZIMUTH = 512 | G3, t4.DISTANCE = 1024 | t4.CAP_C1, t4.STANDARD = t4.LATITUDE | t4.LONGITUDE | t4.AZIMUTH | t4.DISTANCE, t4.DISTANCE_IN = 2048 | t4.CAP_C1 | t4.CAP_C1p, t4.REDUCEDLENGTH = 4096 | t4.CAP_C1 | t4.CAP_C2, t4.GEODESICSCALE = 8192 | t4.CAP_C1 | t4.CAP_C2, t4.AREA = 16384 | t4.CAP_C4, t4.ALL =
|
|
5194
|
+
var n3, r3, h3, o3, c3, l3, u3, d3, m3, _3, f3, y3 = 6, p3 = y3, g3 = y3, M3 = y3, x3 = M3, w3 = 20, S3 = w3 + e4.digits + 10, E3 = e4.epsilon, b3 = 200 * E3, P3 = Math.sqrt(E3), v3 = E3, A3 = 1e3 * P3, G3 = 0, N3 = 31, C3 = 32640;
|
|
5195
|
+
t4.tiny_ = Math.sqrt(Number.MIN_VALUE / Number.EPSILON), t4.nC1_ = y3, t4.nC1p_ = y3, t4.nC2_ = y3, t4.nC3_ = y3, t4.nC4_ = y3, n3 = t4.nC3_ * (t4.nC3_ - 1) / 2, r3 = t4.nC4_ * (t4.nC4_ + 1) / 2, t4.CAP_C1 = 1, t4.CAP_C1p = 2, t4.CAP_C2 = 4, t4.CAP_C3 = 8, t4.CAP_C4 = 16, t4.NONE = 0, t4.ARC = 64, t4.LATITUDE = 128 | G3, t4.LONGITUDE = 256 | t4.CAP_C3, t4.AZIMUTH = 512 | G3, t4.DISTANCE = 1024 | t4.CAP_C1, t4.STANDARD = t4.LATITUDE | t4.LONGITUDE | t4.AZIMUTH | t4.DISTANCE, t4.DISTANCE_IN = 2048 | t4.CAP_C1 | t4.CAP_C1p, t4.REDUCEDLENGTH = 4096 | t4.CAP_C1 | t4.CAP_C2, t4.GEODESICSCALE = 8192 | t4.CAP_C1 | t4.CAP_C2, t4.AREA = 16384 | t4.CAP_C4, t4.ALL = C3 | N3, t4.LONG_UNROLL = 32768, t4.OUT_MASK = C3 | t4.LONG_UNROLL, t4.SinCosSeries = function(t5, s5, i5, e5) {
|
|
5179
5196
|
var a5 = e5.length, n4 = a5 - (t5 ? 1 : 0), r4 = 2 * (i5 - s5) * (i5 + s5), h4 = 1 & n4 ? e5[--a5] : 0, o4 = 0;
|
|
5180
5197
|
for (n4 = Math.floor(n4 / 2); n4--; )
|
|
5181
5198
|
h4 = r4 * (o4 = r4 * h4 - o4 + e5[--a5]) - h4 + e5[--a5];
|
|
@@ -5195,7 +5212,7 @@ Me.exports = function() {
|
|
|
5195
5212
|
for (a5 = 1; a5 <= t4.nC1p_; ++a5)
|
|
5196
5213
|
n4 = Math.floor((t4.nC1p_ - a5) / 2), i5[a5] = h4 * e4.polyval(n4, l3, o4, r4) / l3[o4 + n4 + 1], o4 += n4 + 2, h4 *= s5;
|
|
5197
5214
|
}, u3 = [-11, -28, -192, 0, 256], t4.A2m1f = function(t5) {
|
|
5198
|
-
var s5 = Math.floor(
|
|
5215
|
+
var s5 = Math.floor(g3 / 2);
|
|
5199
5216
|
return (e4.polyval(s5, u3, 0, e4.sq(t5)) / u3[s5 + 1] - t5) / (1 + t5);
|
|
5200
5217
|
}, d3 = [1, 2, 16, 32, 35, 64, 384, 2048, 15, 80, 768, 7, 35, 512, 63, 1280, 77, 2048], t4.C2f = function(s5, i5) {
|
|
5201
5218
|
var a5, n4, r4 = e4.sq(s5), h4 = s5, o4 = 0;
|
|
@@ -5209,8 +5226,8 @@ Me.exports = function() {
|
|
|
5209
5226
|
this._A3x = new Array(x3), this._C3x = new Array(n3), this._C4x = new Array(r3), this.A3coeff(), this.C3coeff(), this.C4coeff();
|
|
5210
5227
|
}, m3 = [-3, 128, -2, -3, 64, -1, -3, -1, 16, 3, -1, -2, 8, 1, -1, 2, 1, 1], t4.Geodesic.prototype.A3coeff = function() {
|
|
5211
5228
|
var t5, s5, i5 = 0, a5 = 0;
|
|
5212
|
-
for (t5 =
|
|
5213
|
-
s5 = Math.min(
|
|
5229
|
+
for (t5 = M3 - 1; t5 >= 0; --t5)
|
|
5230
|
+
s5 = Math.min(M3 - t5 - 1, t5), this._A3x[a5++] = e4.polyval(s5, m3, i5, this._n) / m3[i5 + s5 + 1], i5 += s5 + 2;
|
|
5214
5231
|
}, _3 = [3, 128, 2, 5, 128, -1, 3, 3, 64, -1, 0, 1, 8, -1, 1, 4, 5, 256, 1, 3, 128, -3, -2, 3, 64, 1, -3, 2, 32, 7, 512, -10, 9, 384, 5, -9, 5, 192, 7, 512, -14, 7, 512, 21, 2560], t4.Geodesic.prototype.C3coeff = function() {
|
|
5215
5232
|
var s5, i5, a5, n4 = 0, r4 = 0;
|
|
5216
5233
|
for (s5 = 1; s5 < t4.nC3_; ++s5)
|
|
@@ -5232,37 +5249,37 @@ Me.exports = function() {
|
|
|
5232
5249
|
for (a5 = 0; a5 < t4.nC4_; ++a5)
|
|
5233
5250
|
n4 = t4.nC4_ - a5 - 1, i5[a5] = r4 * e4.polyval(n4, this._C4x, h4, s5), h4 += n4 + 1, r4 *= s5;
|
|
5234
5251
|
}, t4.Geodesic.prototype.Lengths = function(s5, i5, e5, a5, n4, r4, h4, o4, c4, l4, u4, d4, m4) {
|
|
5235
|
-
var _4, f4, y4, p4,
|
|
5236
|
-
if ((u4 &= t4.OUT_MASK) & (t4.DISTANCE | t4.REDUCEDLENGTH | t4.GEODESICSCALE) && (w4 = t4.A1m1f(s5), t4.C1f(s5, d4), u4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE) && (S4 = t4.A2m1f(s5), t4.C2f(s5, m4),
|
|
5237
|
-
_4 = t4.SinCosSeries(true, r4, h4, d4) - t4.SinCosSeries(true, e5, a5, d4),
|
|
5252
|
+
var _4, f4, y4, p4, g4 = {}, M4 = 0, x4 = 0, w4 = 0, S4 = 0;
|
|
5253
|
+
if ((u4 &= t4.OUT_MASK) & (t4.DISTANCE | t4.REDUCEDLENGTH | t4.GEODESICSCALE) && (w4 = t4.A1m1f(s5), t4.C1f(s5, d4), u4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE) && (S4 = t4.A2m1f(s5), t4.C2f(s5, m4), M4 = w4 - S4, S4 = 1 + S4), w4 = 1 + w4), u4 & t4.DISTANCE)
|
|
5254
|
+
_4 = t4.SinCosSeries(true, r4, h4, d4) - t4.SinCosSeries(true, e5, a5, d4), g4.s12b = w4 * (i5 + _4), u4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE) && (x4 = M4 * i5 + (w4 * _4 - S4 * (t4.SinCosSeries(true, r4, h4, m4) - t4.SinCosSeries(true, e5, a5, m4))));
|
|
5238
5255
|
else if (u4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE)) {
|
|
5239
5256
|
for (f4 = 1; f4 <= t4.nC2_; ++f4)
|
|
5240
5257
|
m4[f4] = w4 * d4[f4] - S4 * m4[f4];
|
|
5241
|
-
x4 =
|
|
5258
|
+
x4 = M4 * i5 + (t4.SinCosSeries(true, r4, h4, m4) - t4.SinCosSeries(true, e5, a5, m4));
|
|
5242
5259
|
}
|
|
5243
|
-
return u4 & t4.REDUCEDLENGTH && (
|
|
5260
|
+
return u4 & t4.REDUCEDLENGTH && (g4.m0 = M4, g4.m12b = o4 * (a5 * r4) - n4 * (e5 * h4) - a5 * h4 * x4), u4 & t4.GEODESICSCALE && (y4 = a5 * h4 + e5 * r4, p4 = this._ep2 * (c4 - l4) * (c4 + l4) / (n4 + o4), g4.M12 = y4 + (p4 * r4 - h4 * x4) * e5 / n4, g4.M21 = y4 - (p4 * e5 - a5 * x4) * r4 / o4), g4;
|
|
5244
5261
|
}, t4.Geodesic.prototype.InverseStart = function(s5, i5, a5, n4, r4, o4, c4, l4, u4, d4, m4) {
|
|
5245
|
-
var _4, f4, y4, p4,
|
|
5246
|
-
return q3.sig12 = -1, _4 = n4 * i5, _4 += r4 * s5, (f4 = B3 >= 0 && L3 < 0.5 && r4 * c4 < 0.5) ? (p4 = e4.sq(s5 + n4), p4 /= p4 + e4.sq(i5 + r4), q3.dnm = Math.sqrt(1 + this._ep2 * p4), y4 = c4 / (this._f1 * q3.dnm),
|
|
5262
|
+
var _4, f4, y4, p4, g4, M4, x4, w4, S4, E4, P4, v4, G4, N4, C4, I3, z3, T3, O3, R3, q3 = {}, L3 = n4 * i5 - r4 * s5, B3 = r4 * i5 + n4 * s5;
|
|
5263
|
+
return q3.sig12 = -1, _4 = n4 * i5, _4 += r4 * s5, (f4 = B3 >= 0 && L3 < 0.5 && r4 * c4 < 0.5) ? (p4 = e4.sq(s5 + n4), p4 /= p4 + e4.sq(i5 + r4), q3.dnm = Math.sqrt(1 + this._ep2 * p4), y4 = c4 / (this._f1 * q3.dnm), g4 = Math.sin(y4), M4 = Math.cos(y4)) : (g4 = l4, M4 = u4), q3.salp1 = r4 * g4, q3.calp1 = M4 >= 0 ? L3 + r4 * s5 * e4.sq(g4) / (1 + M4) : _4 - r4 * s5 * e4.sq(g4) / (1 - M4), w4 = e4.hypot(q3.salp1, q3.calp1), S4 = s5 * n4 + i5 * r4 * M4, f4 && w4 < this._etol2 ? (q3.salp2 = i5 * g4, q3.calp2 = L3 - i5 * n4 * (M4 >= 0 ? e4.sq(g4) / (1 + M4) : 1 - M4), x4 = e4.hypot(q3.salp2, q3.calp2), q3.salp2 /= x4, q3.calp2 /= x4, q3.sig12 = Math.atan2(w4, S4)) : Math.abs(this._n) > 0.1 || S4 >= 0 || w4 >= 6 * Math.abs(this._n) * Math.PI * e4.sq(i5) || (R3 = Math.atan2(-l4, -u4), this.f >= 0 ? (N4 = (G4 = e4.sq(s5) * this._ep2) / (2 * (1 + Math.sqrt(1 + G4)) + G4), E4 = R3 / (v4 = this.f * i5 * this.A3f(N4) * Math.PI), P4 = _4 / (v4 * i5)) : (C4 = r4 * i5 - n4 * s5, I3 = Math.atan2(_4, C4), P4 = c4 / (v4 = ((E4 = (z3 = this.Lengths(this._n, Math.PI + I3, s5, -i5, a5, n4, r4, o4, i5, r4, t4.REDUCEDLENGTH, d4, m4)).m12b / (i5 * r4 * z3.m0 * Math.PI) - 1) < -0.01 ? _4 / E4 : -this.f * e4.sq(i5) * Math.PI) / i5)), P4 > -b3 && E4 > -1 - A3 ? this.f >= 0 ? (q3.salp1 = Math.min(1, -E4), q3.calp1 = -Math.sqrt(1 - e4.sq(q3.salp1))) : (q3.calp1 = Math.max(E4 > -b3 ? 0 : -1, E4), q3.salp1 = Math.sqrt(1 - e4.sq(q3.calp1))) : (T3 = h3(E4, P4), O3 = v4 * (this.f >= 0 ? -E4 * T3 / (1 + T3) : -P4 * (1 + T3) / T3), g4 = Math.sin(O3), M4 = -Math.cos(O3), q3.salp1 = r4 * g4, q3.calp1 = _4 - r4 * s5 * e4.sq(g4) / (1 - M4))), q3.salp1 <= 0 ? (q3.salp1 = 1, q3.calp1 = 0) : (x4 = e4.hypot(q3.salp1, q3.calp1), q3.salp1 /= x4, q3.calp1 /= x4), q3;
|
|
5247
5264
|
}, t4.Geodesic.prototype.Lambda12 = function(s5, i5, a5, n4, r4, h4, o4, c4, l4, u4, d4, m4, _4, f4) {
|
|
5248
|
-
var y4, p4,
|
|
5249
|
-
return 0 === s5 && 0 === c4 && (c4 = -t4.tiny_), p4 = o4 * i5,
|
|
5265
|
+
var y4, p4, g4, M4, x4, w4, S4, E4, b4, P4, v4, A4, G4, N4 = {};
|
|
5266
|
+
return 0 === s5 && 0 === c4 && (c4 = -t4.tiny_), p4 = o4 * i5, g4 = e4.hypot(c4, o4 * s5), N4.ssig1 = s5, M4 = p4 * s5, N4.csig1 = x4 = c4 * i5, y4 = e4.hypot(N4.ssig1, N4.csig1), N4.ssig1 /= y4, N4.csig1 /= y4, N4.salp2 = r4 !== i5 ? p4 / r4 : o4, N4.calp2 = r4 !== i5 || Math.abs(n4) !== -s5 ? Math.sqrt(e4.sq(c4 * i5) + (i5 < -s5 ? (r4 - i5) * (i5 + r4) : (s5 - n4) * (s5 + n4))) / r4 : Math.abs(c4), N4.ssig2 = n4, w4 = p4 * n4, N4.csig2 = S4 = N4.calp2 * r4, y4 = e4.hypot(N4.ssig2, N4.csig2), N4.ssig2 /= y4, N4.csig2 /= y4, N4.sig12 = Math.atan2(Math.max(0, N4.csig1 * N4.ssig2 - N4.ssig1 * N4.csig2), N4.csig1 * N4.csig2 + N4.ssig1 * N4.ssig2), E4 = Math.max(0, x4 * w4 - M4 * S4), b4 = x4 * S4 + M4 * w4, v4 = Math.atan2(E4 * u4 - b4 * l4, b4 * u4 + E4 * l4), A4 = e4.sq(g4) * this._ep2, N4.eps = A4 / (2 * (1 + Math.sqrt(1 + A4)) + A4), this.C3f(N4.eps, f4), P4 = t4.SinCosSeries(true, N4.ssig2, N4.csig2, f4) - t4.SinCosSeries(true, N4.ssig1, N4.csig1, f4), N4.domg12 = -this.f * this.A3f(N4.eps) * p4 * (N4.sig12 + P4), N4.lam12 = v4 + N4.domg12, d4 && (0 === N4.calp2 ? N4.dlam12 = -2 * this._f1 * a5 / s5 : (G4 = this.Lengths(N4.eps, N4.sig12, N4.ssig1, N4.csig1, a5, N4.ssig2, N4.csig2, h4, i5, r4, t4.REDUCEDLENGTH, m4, _4), N4.dlam12 = G4.m12b, N4.dlam12 *= this._f1 / (N4.calp2 * r4))), N4;
|
|
5250
5267
|
}, t4.Geodesic.prototype.Inverse = function(s5, i5, a5, n4, r4) {
|
|
5251
5268
|
var h4, o4;
|
|
5252
5269
|
return r4 || (r4 = t4.STANDARD), r4 === t4.LONG_UNROLL && (r4 |= t4.STANDARD), r4 &= t4.OUT_MASK, o4 = (h4 = this.InverseInt(s5, i5, a5, n4, r4)).vals, r4 & t4.AZIMUTH && (o4.azi1 = e4.atan2d(h4.salp1, h4.calp1), o4.azi2 = e4.atan2d(h4.salp2, h4.calp2)), o4;
|
|
5253
5270
|
}, t4.Geodesic.prototype.InverseInt = function(s5, i5, a5, n4, r4) {
|
|
5254
|
-
var h4, o4, c4, l4, u4, d4, m4, _4, f4, y4, p4,
|
|
5255
|
-
if (St3.lat1 = s5 = e4.LatFix(s5), St3.lat2 = a5 = e4.LatFix(a5), s5 = e4.AngRound(s5), a5 = e4.AngRound(a5), o4 = (h4 = e4.AngDiff(i5, n4)).e, h4 = h4.d, r4 & t4.LONG_UNROLL ? (St3.lon1 = i5, St3.lon2 = i5 + h4 + o4) : (St3.lon1 = e4.AngNormalize(i5), St3.lon2 = e4.AngNormalize(n4)), o4 *= c4 = e4.copysign(1, h4), b4 = (h4 *= c4) * e4.degree, P4 = (l4 = e4.sincosde(h4, o4)).s, A4 = l4.c, o4 = 180 - h4 - o4, (u4 = Math.abs(s5) < Math.abs(a5) || isNaN(a5) ? -1 : 1) < 0 && (c4 *= -1, [a5, s5] = [s5, a5]), s5 *= d4 = e4.copysign(1, -s5), a5 *= d4, l4 = e4.sincosd(s5), m4 = this._f1 * l4.s, _4 = l4.c, m4 /= l4 = e4.hypot(m4, _4), _4 /= l4, _4 = Math.max(t4.tiny_, _4), l4 = e4.sincosd(a5), f4 = this._f1 * l4.s, y4 = l4.c, f4 /= l4 = e4.hypot(f4, y4), y4 /= l4, y4 = Math.max(t4.tiny_, y4), _4 < -m4 ? y4 === _4 && (f4 = e4.copysign(m4, f4)) : Math.abs(f4) === -m4 && (y4 = _4),
|
|
5256
|
-
|
|
5271
|
+
var h4, o4, c4, l4, u4, d4, m4, _4, f4, y4, p4, g4, M4, x4, b4, P4, A4, G4, N4, C4, I3, z3, T3, O3, R3, q3, L3, B3, k3, D3, U3, j3, F3, V3, W3, H3, X3, Y3, Z3, Q3, K3, J3, $3, tt3, st3, it3, et3, at3, nt3, rt3, ht3, ot3, ct3, lt3, ut3, dt3, mt3, _t3, ft3, yt3, pt3, gt3, Mt3, xt3, wt3, St3 = {};
|
|
5272
|
+
if (St3.lat1 = s5 = e4.LatFix(s5), St3.lat2 = a5 = e4.LatFix(a5), s5 = e4.AngRound(s5), a5 = e4.AngRound(a5), o4 = (h4 = e4.AngDiff(i5, n4)).e, h4 = h4.d, r4 & t4.LONG_UNROLL ? (St3.lon1 = i5, St3.lon2 = i5 + h4 + o4) : (St3.lon1 = e4.AngNormalize(i5), St3.lon2 = e4.AngNormalize(n4)), o4 *= c4 = e4.copysign(1, h4), b4 = (h4 *= c4) * e4.degree, P4 = (l4 = e4.sincosde(h4, o4)).s, A4 = l4.c, o4 = 180 - h4 - o4, (u4 = Math.abs(s5) < Math.abs(a5) || isNaN(a5) ? -1 : 1) < 0 && (c4 *= -1, [a5, s5] = [s5, a5]), s5 *= d4 = e4.copysign(1, -s5), a5 *= d4, l4 = e4.sincosd(s5), m4 = this._f1 * l4.s, _4 = l4.c, m4 /= l4 = e4.hypot(m4, _4), _4 /= l4, _4 = Math.max(t4.tiny_, _4), l4 = e4.sincosd(a5), f4 = this._f1 * l4.s, y4 = l4.c, f4 /= l4 = e4.hypot(f4, y4), y4 /= l4, y4 = Math.max(t4.tiny_, y4), _4 < -m4 ? y4 === _4 && (f4 = e4.copysign(m4, f4)) : Math.abs(f4) === -m4 && (y4 = _4), M4 = Math.sqrt(1 + this._ep2 * e4.sq(m4)), x4 = Math.sqrt(1 + this._ep2 * e4.sq(f4)), T3 = new Array(t4.nC1_ + 1), O3 = new Array(t4.nC2_ + 1), R3 = new Array(t4.nC3_), (q3 = -90 === s5 || 0 === P4) && (C4 = P4, z3 = 0, B3 = m4, k3 = (N4 = A4) * _4, D3 = f4, U3 = (I3 = 1) * y4, G4 = Math.atan2(Math.max(0, k3 * D3 - B3 * U3), k3 * U3 + B3 * D3), p4 = (L3 = this.Lengths(this._n, G4, B3, k3, M4, D3, U3, x4, _4, y4, r4 | t4.DISTANCE | t4.REDUCEDLENGTH, T3, O3)).s12b, g4 = L3.m12b, r4 & t4.GEODESICSCALE && (St3.M12 = L3.M12, St3.M21 = L3.M21), G4 < 1 || g4 >= 0 ? ((G4 < 3 * t4.tiny_ || G4 < E3 && (p4 < 0 || g4 < 0)) && (G4 = g4 = p4 = 0), g4 *= this._b, p4 *= this._b, St3.a12 = G4 / e4.degree) : q3 = false), mt3 = 2, !q3 && 0 === m4 && (this.f <= 0 || o4 >= 180 * this.f))
|
|
5273
|
+
N4 = I3 = 0, C4 = z3 = 1, p4 = this.a * b4, G4 = F3 = b4 / this._f1, g4 = this._b * Math.sin(G4), r4 & t4.GEODESICSCALE && (St3.M12 = St3.M21 = Math.cos(G4)), St3.a12 = h4 / this._f1;
|
|
5257
5274
|
else if (!q3)
|
|
5258
|
-
if (G4 = (L3 = this.InverseStart(m4, _4,
|
|
5259
|
-
z3 = L3.salp2, I3 = L3.calp2, V3 = L3.dnm, p4 = G4 * this._b * V3,
|
|
5275
|
+
if (G4 = (L3 = this.InverseStart(m4, _4, M4, f4, y4, x4, b4, P4, A4, T3, O3)).sig12, C4 = L3.salp1, N4 = L3.calp1, G4 >= 0)
|
|
5276
|
+
z3 = L3.salp2, I3 = L3.calp2, V3 = L3.dnm, p4 = G4 * this._b * V3, g4 = e4.sq(V3) * this._b * Math.sin(G4 / V3), r4 & t4.GEODESICSCALE && (St3.M12 = St3.M21 = Math.cos(G4 / V3)), St3.a12 = G4 / e4.degree, F3 = b4 / (this._f1 * V3);
|
|
5260
5277
|
else {
|
|
5261
|
-
for (W3 = 0, H3 = t4.tiny_,
|
|
5262
|
-
J3 > 0 && (W3 < w3 ||
|
|
5263
|
-
at3 = r4 | (r4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE) ? t4.DISTANCE : t4.NONE), p4 = (L3 = this.Lengths(j3, G4, B3, k3,
|
|
5278
|
+
for (W3 = 0, H3 = t4.tiny_, X3 = 1, Y3 = t4.tiny_, Z3 = -1, Q3 = false, K3 = false; J3 = (L3 = this.Lambda12(m4, _4, M4, f4, y4, x4, C4, N4, P4, A4, W3 < w3, T3, O3, R3)).lam12, z3 = L3.salp2, I3 = L3.calp2, G4 = L3.sig12, B3 = L3.ssig1, k3 = L3.csig1, D3 = L3.ssig2, U3 = L3.csig2, j3 = L3.eps, ft3 = L3.domg12, $3 = L3.dlam12, !K3 && Math.abs(J3) >= (Q3 ? 8 : 1) * E3 && W3 != S3; ++W3)
|
|
5279
|
+
J3 > 0 && (W3 < w3 || N4 / C4 > Z3 / Y3) ? (Y3 = C4, Z3 = N4) : J3 < 0 && (W3 < w3 || N4 / C4 < X3 / H3) && (H3 = C4, X3 = N4), W3 < w3 && $3 > 0 && (tt3 = -J3 / $3, Math.abs(tt3) < Math.PI && (st3 = Math.sin(tt3), (et3 = C4 * (it3 = Math.cos(tt3)) + N4 * st3) > 0)) ? (N4 = N4 * it3 - C4 * st3, C4 = et3, C4 /= l4 = e4.hypot(C4, N4), N4 /= l4, Q3 = Math.abs(J3) <= 16 * E3) : (C4 = (H3 + Y3) / 2, N4 = (X3 + Z3) / 2, C4 /= l4 = e4.hypot(C4, N4), N4 /= l4, Q3 = false, K3 = Math.abs(H3 - C4) + (X3 - N4) < v3 || Math.abs(C4 - Y3) + (N4 - Z3) < v3);
|
|
5280
|
+
at3 = r4 | (r4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE) ? t4.DISTANCE : t4.NONE), p4 = (L3 = this.Lengths(j3, G4, B3, k3, M4, D3, U3, x4, _4, y4, at3, T3, O3)).s12b, g4 = L3.m12b, r4 & t4.GEODESICSCALE && (St3.M12 = L3.M12, St3.M21 = L3.M21), g4 *= this._b, p4 *= this._b, St3.a12 = G4 / e4.degree, r4 & t4.AREA && (xt3 = Math.sin(ft3), mt3 = P4 * (wt3 = Math.cos(ft3)) - A4 * xt3, _t3 = A4 * wt3 + P4 * xt3);
|
|
5264
5281
|
}
|
|
5265
|
-
return r4 & t4.DISTANCE && (St3.s12 = 0 + p4), r4 & t4.REDUCEDLENGTH && (St3.m12 = 0 +
|
|
5282
|
+
return r4 & t4.DISTANCE && (St3.s12 = 0 + p4), r4 & t4.REDUCEDLENGTH && (St3.m12 = 0 + g4), r4 & t4.AREA && (nt3 = C4 * _4, 0 !== (rt3 = e4.hypot(N4, C4 * m4)) && 0 !== nt3 ? (B3 = m4, k3 = N4 * _4, D3 = f4, U3 = I3 * y4, j3 = (ot3 = e4.sq(rt3) * this._ep2) / (2 * (1 + Math.sqrt(1 + ot3)) + ot3), ct3 = e4.sq(this.a) * rt3 * nt3 * this._e2, B3 /= l4 = e4.hypot(B3, k3), k3 /= l4, D3 /= l4 = e4.hypot(D3, U3), U3 /= l4, lt3 = new Array(t4.nC4_), this.C4f(j3, lt3), ut3 = t4.SinCosSeries(false, B3, k3, lt3), dt3 = t4.SinCosSeries(false, D3, U3, lt3), St3.S12 = ct3 * (dt3 - ut3)) : St3.S12 = 0, q3 || 2 != mt3 || (mt3 = Math.sin(F3), _t3 = Math.cos(F3)), !q3 && _t3 > -0.7071 && f4 - m4 < 1.75 ? (ft3 = 1 + _t3, yt3 = 1 + _4, pt3 = 1 + y4, ht3 = 2 * Math.atan2(mt3 * (m4 * pt3 + f4 * yt3), ft3 * (m4 * f4 + yt3 * pt3))) : (Mt3 = I3 * N4 + z3 * C4, 0 === (gt3 = z3 * N4 - I3 * C4) && Mt3 < 0 && (gt3 = t4.tiny_ * N4, Mt3 = -1), ht3 = Math.atan2(gt3, Mt3)), St3.S12 += this._c2 * ht3, St3.S12 *= u4 * c4 * d4, St3.S12 += 0), u4 < 0 && ([z3, C4] = [C4, z3], [I3, N4] = [N4, I3], r4 & t4.GEODESICSCALE && ([St3.M21, St3.M12] = [St3.M12, St3.M21])), { vals: St3, salp1: C4 *= u4 * c4, calp1: N4 *= u4 * d4, salp2: z3 *= u4 * c4, calp2: I3 *= u4 * d4 };
|
|
5266
5283
|
}, t4.Geodesic.prototype.GenDirect = function(i5, e5, a5, n4, r4, h4) {
|
|
5267
5284
|
return h4 ? h4 === t4.LONG_UNROLL && (h4 |= t4.STANDARD) : h4 = t4.STANDARD, n4 || (h4 |= t4.DISTANCE_IN), new s4.GeodesicLine(this, i5, e5, a5, h4).GenPosition(n4, r4, h4);
|
|
5268
5285
|
}, t4.Geodesic.prototype.Direct = function(t5, s5, i5, e5, a5) {
|
|
@@ -5289,8 +5306,8 @@ Me.exports = function() {
|
|
|
5289
5306
|
var c3, l3, u3, d3, m3, _3;
|
|
5290
5307
|
r3 || (r3 = t4.STANDARD | t4.DISTANCE_IN), this.a = s5.a, this.f = s5.f, this._b = s5._b, this._c2 = s5._c2, this._f1 = s5._f1, this.caps = r3 | t4.LATITUDE | t4.AZIMUTH | t4.LONG_UNROLL, this.lat1 = i4.LatFix(e4), this.lon1 = a4, void 0 === h3 || void 0 === o3 ? (this.azi1 = i4.AngNormalize(n3), c3 = i4.sincosd(i4.AngRound(this.azi1)), this.salp1 = c3.s, this.calp1 = c3.c) : (this.azi1 = n3, this.salp1 = h3, this.calp1 = o3), c3 = i4.sincosd(i4.AngRound(this.lat1)), u3 = this._f1 * c3.s, l3 = c3.c, u3 /= c3 = i4.hypot(u3, l3), l3 /= c3, l3 = Math.max(t4.tiny_, l3), this._dn1 = Math.sqrt(1 + s5._ep2 * i4.sq(u3)), this._salp0 = this.salp1 * l3, this._calp0 = i4.hypot(this.calp1, this.salp1 * u3), this._ssig1 = u3, this._somg1 = this._salp0 * u3, this._csig1 = this._comg1 = 0 !== u3 || 0 !== this.calp1 ? l3 * this.calp1 : 1, c3 = i4.hypot(this._ssig1, this._csig1), this._ssig1 /= c3, this._csig1 /= c3, this._k2 = i4.sq(this._calp0) * s5._ep2, d3 = this._k2 / (2 * (1 + Math.sqrt(1 + this._k2)) + this._k2), this.caps & t4.CAP_C1 && (this._A1m1 = t4.A1m1f(d3), this._C1a = new Array(t4.nC1_ + 1), t4.C1f(d3, this._C1a), this._B11 = t4.SinCosSeries(true, this._ssig1, this._csig1, this._C1a), m3 = Math.sin(this._B11), _3 = Math.cos(this._B11), this._stau1 = this._ssig1 * _3 + this._csig1 * m3, this._ctau1 = this._csig1 * _3 - this._ssig1 * m3), this.caps & t4.CAP_C1p && (this._C1pa = new Array(t4.nC1p_ + 1), t4.C1pf(d3, this._C1pa)), this.caps & t4.CAP_C2 && (this._A2m1 = t4.A2m1f(d3), this._C2a = new Array(t4.nC2_ + 1), t4.C2f(d3, this._C2a), this._B21 = t4.SinCosSeries(true, this._ssig1, this._csig1, this._C2a)), this.caps & t4.CAP_C3 && (this._C3a = new Array(t4.nC3_), s5.C3f(d3, this._C3a), this._A3c = -this.f * this._salp0 * s5.A3f(d3), this._B31 = t4.SinCosSeries(true, this._ssig1, this._csig1, this._C3a)), this.caps & t4.CAP_C4 && (this._C4a = new Array(t4.nC4_), s5.C4f(d3, this._C4a), this._A4 = i4.sq(this.a) * this._calp0 * this._salp0 * s5._e2, this._B41 = t4.SinCosSeries(false, this._ssig1, this._csig1, this._C4a)), this.a13 = this.s13 = NaN;
|
|
5291
5308
|
}, s4.GeodesicLine.prototype.GenPosition = function(s5, e4, a4) {
|
|
5292
|
-
var n3, r3, h3, o3, c3, l3, u3, d3, m3, _3, f3, y3, p3,
|
|
5293
|
-
return a4 ? a4 === t4.LONG_UNROLL && (a4 |= t4.STANDARD) : a4 = t4.STANDARD, a4 &= this.caps & t4.OUT_MASK, I3.lat1 = this.lat1, I3.azi1 = this.azi1, I3.lon1 = a4 & t4.LONG_UNROLL ? this.lon1 : i4.AngNormalize(this.lon1), s5 ? I3.a12 = e4 : I3.s12 = e4, s5 || this.caps & t4.DISTANCE_IN & t4.OUT_MASK ? (o3 = 0, c3 = 0, s5 ? (n3 = e4 * i4.degree, r3 = (A3 = i4.sincosd(e4)).s, h3 = A3.c) : (d3 = e4 / (this._b * (1 + this._A1m1)), m3 = Math.sin(d3), _3 = Math.cos(d3), n3 = d3 - ((o3 = -t4.SinCosSeries(true, this._stau1 * _3 + this._ctau1 * m3, this._ctau1 * _3 - this._stau1 * m3, this._C1pa)) - this._B11), r3 = Math.sin(n3), h3 = Math.cos(n3), Math.abs(this.f) > 0.01 && (l3 = this._ssig1 * h3 + this._csig1 * r3, u3 = this._csig1 * h3 - this._ssig1 * r3, o3 = t4.SinCosSeries(true, l3, u3, this._C1a), n3 -= ((1 + this._A1m1) * (n3 + (o3 - this._B11)) - e4 / this._b) / Math.sqrt(1 + this._k2 * i4.sq(l3)), r3 = Math.sin(n3), h3 = Math.cos(n3))), l3 = this._ssig1 * h3 + this._csig1 * r3, u3 = this._csig1 * h3 - this._ssig1 * r3, E3 = Math.sqrt(1 + this._k2 * i4.sq(l3)), a4 & (t4.DISTANCE | t4.REDUCEDLENGTH | t4.GEODESICSCALE) && ((s5 || Math.abs(this.f) > 0.01) && (o3 = t4.SinCosSeries(true, l3, u3, this._C1a)), c3 = (1 + this._A1m1) * (o3 - this._B11)), p3 = this._calp0 * l3, 0 === (
|
|
5309
|
+
var n3, r3, h3, o3, c3, l3, u3, d3, m3, _3, f3, y3, p3, g3, M3, x3, w3, S3, E3, b3, P3, v3, A3, G3, N3, C3, I3 = {};
|
|
5310
|
+
return a4 ? a4 === t4.LONG_UNROLL && (a4 |= t4.STANDARD) : a4 = t4.STANDARD, a4 &= this.caps & t4.OUT_MASK, I3.lat1 = this.lat1, I3.azi1 = this.azi1, I3.lon1 = a4 & t4.LONG_UNROLL ? this.lon1 : i4.AngNormalize(this.lon1), s5 ? I3.a12 = e4 : I3.s12 = e4, s5 || this.caps & t4.DISTANCE_IN & t4.OUT_MASK ? (o3 = 0, c3 = 0, s5 ? (n3 = e4 * i4.degree, r3 = (A3 = i4.sincosd(e4)).s, h3 = A3.c) : (d3 = e4 / (this._b * (1 + this._A1m1)), m3 = Math.sin(d3), _3 = Math.cos(d3), n3 = d3 - ((o3 = -t4.SinCosSeries(true, this._stau1 * _3 + this._ctau1 * m3, this._ctau1 * _3 - this._stau1 * m3, this._C1pa)) - this._B11), r3 = Math.sin(n3), h3 = Math.cos(n3), Math.abs(this.f) > 0.01 && (l3 = this._ssig1 * h3 + this._csig1 * r3, u3 = this._csig1 * h3 - this._ssig1 * r3, o3 = t4.SinCosSeries(true, l3, u3, this._C1a), n3 -= ((1 + this._A1m1) * (n3 + (o3 - this._B11)) - e4 / this._b) / Math.sqrt(1 + this._k2 * i4.sq(l3)), r3 = Math.sin(n3), h3 = Math.cos(n3))), l3 = this._ssig1 * h3 + this._csig1 * r3, u3 = this._csig1 * h3 - this._ssig1 * r3, E3 = Math.sqrt(1 + this._k2 * i4.sq(l3)), a4 & (t4.DISTANCE | t4.REDUCEDLENGTH | t4.GEODESICSCALE) && ((s5 || Math.abs(this.f) > 0.01) && (o3 = t4.SinCosSeries(true, l3, u3, this._C1a)), c3 = (1 + this._A1m1) * (o3 - this._B11)), p3 = this._calp0 * l3, 0 === (g3 = i4.hypot(this._salp0, this._calp0 * u3)) && (g3 = u3 = t4.tiny_), w3 = this._salp0, S3 = this._calp0 * u3, s5 && a4 & t4.DISTANCE && (I3.s12 = this._b * ((1 + this._A1m1) * n3 + c3)), a4 & t4.LONGITUDE && (M3 = this._salp0 * l3, x3 = u3, y3 = i4.copysign(1, this._salp0), f3 = ((a4 & t4.LONG_UNROLL ? y3 * (n3 - (Math.atan2(l3, u3) - Math.atan2(this._ssig1, this._csig1)) + (Math.atan2(y3 * M3, x3) - Math.atan2(y3 * this._somg1, this._comg1))) : Math.atan2(M3 * this._comg1 - x3 * this._somg1, x3 * this._comg1 + M3 * this._somg1)) + this._A3c * (n3 + (t4.SinCosSeries(true, l3, u3, this._C3a) - this._B31))) / i4.degree, I3.lon2 = a4 & t4.LONG_UNROLL ? this.lon1 + f3 : i4.AngNormalize(i4.AngNormalize(this.lon1) + i4.AngNormalize(f3))), a4 & t4.LATITUDE && (I3.lat2 = i4.atan2d(p3, this._f1 * g3)), a4 & t4.AZIMUTH && (I3.azi2 = i4.atan2d(w3, S3)), a4 & (t4.REDUCEDLENGTH | t4.GEODESICSCALE) && (b3 = t4.SinCosSeries(true, l3, u3, this._C2a), P3 = (1 + this._A2m1) * (b3 - this._B21), v3 = (this._A1m1 - this._A2m1) * n3 + (c3 - P3), a4 & t4.REDUCEDLENGTH && (I3.m12 = this._b * (E3 * (this._csig1 * l3) - this._dn1 * (this._ssig1 * u3) - this._csig1 * u3 * v3)), a4 & t4.GEODESICSCALE && (A3 = this._k2 * (l3 - this._ssig1) * (l3 + this._ssig1) / (this._dn1 + E3), I3.M12 = h3 + (A3 * l3 - u3 * v3) * this._ssig1 / this._dn1, I3.M21 = h3 - (A3 * this._ssig1 - this._csig1 * v3) * l3 / E3)), a4 & t4.AREA && (G3 = t4.SinCosSeries(false, l3, u3, this._C4a), 0 === this._calp0 || 0 === this._salp0 ? (N3 = w3 * this.calp1 - S3 * this.salp1, C3 = S3 * this.calp1 + w3 * this.salp1) : (N3 = this._calp0 * this._salp0 * (h3 <= 0 ? this._csig1 * (1 - h3) + r3 * this._ssig1 : r3 * (this._csig1 * r3 / (1 + h3) + this._ssig1)), C3 = i4.sq(this._salp0) + i4.sq(this._calp0) * this._csig1 * u3), I3.S12 = this._c2 * Math.atan2(N3, C3) + this._A4 * (G3 - this._B41)), s5 || (I3.a12 = n3 / i4.degree), I3) : (I3.a12 = NaN, I3);
|
|
5294
5311
|
}, s4.GeodesicLine.prototype.Position = function(t5, s5) {
|
|
5295
5312
|
return this.GenPosition(false, t5, s5);
|
|
5296
5313
|
}, s4.GeodesicLine.prototype.ArcPosition = function(t5, s5) {
|
|
@@ -5340,24 +5357,24 @@ Me.exports = function() {
|
|
|
5340
5357
|
return 0 === this.num || (l3.perimeter = this._perimetersum.Sum() + s5, this.polyline || (o3 = this._areasum.Sum(), c3 = this._crossings, o3 += (r4 = this._geod.Direct(this.lat, this.lon, t5, s5, this._mask)).S12, c3 += n3(this.lon, r4.lon2), c3 += a4(r4.lon2, this._lon0), r4 = this._geod.Inverse(r4.lat2, r4.lon2, this._lat0, this._lon0, this._mask), l3.perimeter += r4.s12, o3 += r4.S12, l3.area = h3(o3, this._area0, c3, i5, e5))), l3;
|
|
5341
5358
|
};
|
|
5342
5359
|
}(a3.PolygonArea, a3.Geodesic, a3.Math, a3.Accumulator), s3(a3);
|
|
5343
|
-
}(
|
|
5360
|
+
}(Na)), Na.exports;
|
|
5344
5361
|
}
|
|
5345
|
-
var Ia =
|
|
5362
|
+
var Ia = Ca();
|
|
5346
5363
|
function za() {
|
|
5347
5364
|
this.sin_p12 = Math.sin(this.lat0), this.cos_p12 = Math.cos(this.lat0), this.g = new Ia.Geodesic.Geodesic(this.a, this.es / (1 + Math.sqrt(1 - this.es)));
|
|
5348
5365
|
}
|
|
5349
5366
|
function Ta(t3) {
|
|
5350
|
-
var s3, i3, e3, a3, n3, r3, h3, o3, c3, u3, d3, m3, y3, p3,
|
|
5351
|
-
return this.sphere ? Math.abs(this.sin_p12 - 1) <= _2 ? (t3.x = this.x0 + this.a * (l2 - x3) * Math.sin(E3), t3.y = this.y0 - this.a * (l2 - x3) * Math.cos(E3), t3) : Math.abs(this.sin_p12 + 1) <= _2 ? (t3.x = this.x0 + this.a * (l2 + x3) * Math.sin(E3), t3.y = this.y0 + this.a * (l2 + x3) * Math.cos(E3), t3) : (c3 = this.sin_p12 * w3 + this.cos_p12 * S3 * Math.cos(E3), o3 = (h3 = Math.acos(c3)) ? h3 / Math.sin(h3) : 1, t3.x = this.x0 + this.a * o3 * S3 * Math.sin(E3), t3.y = this.y0 + this.a * o3 * (this.cos_p12 * w3 - this.sin_p12 * S3 * Math.cos(E3)), t3) : (s3 = ce2(this.es), i3 = le2(this.es), e3 = ue2(this.es), a3 = de2(this.es), Math.abs(this.sin_p12 - 1) <= _2 ? (n3 = this.a * oe2(s3, i3, e3, a3, l2), r3 = this.a * oe2(s3, i3, e3, a3, x3), t3.x = this.x0 + (n3 - r3) * Math.sin(E3), t3.y = this.y0 - (n3 - r3) * Math.cos(E3), t3) : Math.abs(this.sin_p12 + 1) <= _2 ? (n3 = this.a * oe2(s3, i3, e3, a3, l2), r3 = this.a * oe2(s3, i3, e3, a3, x3), t3.x = this.x0 + (n3 + r3) * Math.sin(E3), t3.y = this.y0 + (n3 + r3) * Math.cos(E3), t3) : Math.abs(
|
|
5367
|
+
var s3, i3, e3, a3, n3, r3, h3, o3, c3, u3, d3, m3, y3, p3, g3, M3 = t3.x, x3 = t3.y, w3 = Math.sin(t3.y), S3 = Math.cos(t3.y), E3 = yt2(M3 - this.long0);
|
|
5368
|
+
return this.sphere ? Math.abs(this.sin_p12 - 1) <= _2 ? (t3.x = this.x0 + this.a * (l2 - x3) * Math.sin(E3), t3.y = this.y0 - this.a * (l2 - x3) * Math.cos(E3), t3) : Math.abs(this.sin_p12 + 1) <= _2 ? (t3.x = this.x0 + this.a * (l2 + x3) * Math.sin(E3), t3.y = this.y0 + this.a * (l2 + x3) * Math.cos(E3), t3) : (c3 = this.sin_p12 * w3 + this.cos_p12 * S3 * Math.cos(E3), o3 = (h3 = Math.acos(c3)) ? h3 / Math.sin(h3) : 1, t3.x = this.x0 + this.a * o3 * S3 * Math.sin(E3), t3.y = this.y0 + this.a * o3 * (this.cos_p12 * w3 - this.sin_p12 * S3 * Math.cos(E3)), t3) : (s3 = ce2(this.es), i3 = le2(this.es), e3 = ue2(this.es), a3 = de2(this.es), Math.abs(this.sin_p12 - 1) <= _2 ? (n3 = this.a * oe2(s3, i3, e3, a3, l2), r3 = this.a * oe2(s3, i3, e3, a3, x3), t3.x = this.x0 + (n3 - r3) * Math.sin(E3), t3.y = this.y0 - (n3 - r3) * Math.cos(E3), t3) : Math.abs(this.sin_p12 + 1) <= _2 ? (n3 = this.a * oe2(s3, i3, e3, a3, l2), r3 = this.a * oe2(s3, i3, e3, a3, x3), t3.x = this.x0 + (n3 + r3) * Math.sin(E3), t3.y = this.y0 + (n3 + r3) * Math.cos(E3), t3) : Math.abs(M3) < _2 && Math.abs(x3 - this.lat0) < _2 ? (t3.x = t3.y = 0, t3) : (u3 = this.lat0 / f2, d3 = this.long0 / f2, m3 = x3 / f2, y3 = M3 / f2, g3 = (p3 = this.g.Inverse(u3, d3, m3, y3, this.g.AZIMUTH)).azi1 * f2, t3.x = p3.s12 * Math.sin(g3), t3.y = p3.s12 * Math.cos(g3), t3));
|
|
5352
5369
|
}
|
|
5353
5370
|
function Oa(t3) {
|
|
5354
|
-
var s3, i3, e3, a3, n3, r3, h3, o3, c3, u3, d3, m3, y3, p3,
|
|
5371
|
+
var s3, i3, e3, a3, n3, r3, h3, o3, c3, u3, d3, m3, y3, p3, g3, M3, x3;
|
|
5355
5372
|
if (t3.x -= this.x0, t3.y -= this.y0, this.sphere) {
|
|
5356
5373
|
if ((s3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y)) > 2 * l2 * this.a)
|
|
5357
5374
|
return;
|
|
5358
5375
|
return i3 = s3 / this.a, e3 = Math.sin(i3), a3 = Math.cos(i3), n3 = this.long0, Math.abs(s3) <= _2 ? r3 = this.lat0 : (r3 = Te2(a3 * this.sin_p12 + t3.y * e3 * this.cos_p12 / s3), h3 = Math.abs(this.lat0) - l2, n3 = Math.abs(h3) <= _2 ? this.lat0 >= 0 ? yt2(this.long0 + Math.atan2(t3.x, -t3.y)) : yt2(this.long0 - Math.atan2(-t3.x, t3.y)) : yt2(this.long0 + Math.atan2(t3.x * e3, s3 * this.cos_p12 * a3 - t3.y * this.sin_p12 * e3))), t3.x = n3, t3.y = r3, t3;
|
|
5359
5376
|
}
|
|
5360
|
-
return o3 = ce2(this.es), c3 = le2(this.es), u3 = ue2(this.es), d3 = de2(this.es), Math.abs(this.sin_p12 - 1) <= _2 ? (r3 = fe2(((m3 = this.a * oe2(o3, c3, u3, d3, l2)) - (s3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y))) / this.a, o3, c3, u3, d3), n3 = yt2(this.long0 + Math.atan2(t3.x, -1 * t3.y)), t3.x = n3, t3.y = r3, t3) : Math.abs(this.sin_p12 + 1) <= _2 ? (m3 = this.a * oe2(o3, c3, u3, d3, l2), r3 = fe2(((s3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y)) - m3) / this.a, o3, c3, u3, d3), n3 = yt2(this.long0 + Math.atan2(t3.x, t3.y)), t3.x = n3, t3.y = r3, t3) : (y3 = this.lat0 / f2, p3 = this.long0 / f2,
|
|
5377
|
+
return o3 = ce2(this.es), c3 = le2(this.es), u3 = ue2(this.es), d3 = de2(this.es), Math.abs(this.sin_p12 - 1) <= _2 ? (r3 = fe2(((m3 = this.a * oe2(o3, c3, u3, d3, l2)) - (s3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y))) / this.a, o3, c3, u3, d3), n3 = yt2(this.long0 + Math.atan2(t3.x, -1 * t3.y)), t3.x = n3, t3.y = r3, t3) : Math.abs(this.sin_p12 + 1) <= _2 ? (m3 = this.a * oe2(o3, c3, u3, d3, l2), r3 = fe2(((s3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y)) - m3) / this.a, o3, c3, u3, d3), n3 = yt2(this.long0 + Math.atan2(t3.x, t3.y)), t3.x = n3, t3.y = r3, t3) : (y3 = this.lat0 / f2, p3 = this.long0 / f2, g3 = Math.atan2(t3.x, t3.y) / f2, M3 = Math.sqrt(t3.x * t3.x + t3.y * t3.y), x3 = this.g.Direct(y3, p3, g3, M3, this.g.STANDARD), t3.x = x3.lon2 * f2, t3.y = x3.lat2 * f2, t3);
|
|
5361
5378
|
}
|
|
5362
5379
|
var Ra = { init: za, forward: Ta, inverse: Oa, names: ["Azimuthal_Equidistant", "aeqd"] };
|
|
5363
5380
|
function qa() {
|
|
@@ -5378,36 +5395,36 @@ Me.exports = function() {
|
|
|
5378
5395
|
function Fa(t3) {
|
|
5379
5396
|
var s3, i3, e3, a3, n3, r3, h3 = { x: 0, y: 0 }, o3 = { value: 0 };
|
|
5380
5397
|
if (t3.x -= this.long0, s3 = 0 !== this.es ? Math.atan(this.one_minus_f_squared * Math.tan(t3.y)) : t3.y, i3 = t3.x, this.face === Da.TOP)
|
|
5381
|
-
a3 = l2 - s3, i3 >= p2 && i3 <= l2 + p2 ? (o3.value = Ua.AREA_0, e3 = i3 - l2) : i3 > l2 + p2 || i3 <= -(l2 + p2) ? (o3.value = Ua.AREA_1, e3 = i3 > 0 ? i3 -
|
|
5398
|
+
a3 = l2 - s3, i3 >= p2 && i3 <= l2 + p2 ? (o3.value = Ua.AREA_0, e3 = i3 - l2) : i3 > l2 + p2 || i3 <= -(l2 + p2) ? (o3.value = Ua.AREA_1, e3 = i3 > 0 ? i3 - M2 : i3 + M2) : i3 > -(l2 + p2) && i3 <= -p2 ? (o3.value = Ua.AREA_2, e3 = i3 + l2) : (o3.value = Ua.AREA_3, e3 = i3);
|
|
5382
5399
|
else if (this.face === Da.BOTTOM)
|
|
5383
|
-
a3 = l2 + s3, i3 >= p2 && i3 <= l2 + p2 ? (o3.value = Ua.AREA_0, e3 = -i3 + l2) : i3 < p2 && i3 >= -p2 ? (o3.value = Ua.AREA_1, e3 = -i3) : i3 < -p2 && i3 >= -(l2 + p2) ? (o3.value = Ua.AREA_2, e3 = -i3 - l2) : (o3.value = Ua.AREA_3, e3 = i3 > 0 ? -i3 +
|
|
5400
|
+
a3 = l2 + s3, i3 >= p2 && i3 <= l2 + p2 ? (o3.value = Ua.AREA_0, e3 = -i3 + l2) : i3 < p2 && i3 >= -p2 ? (o3.value = Ua.AREA_1, e3 = -i3) : i3 < -p2 && i3 >= -(l2 + p2) ? (o3.value = Ua.AREA_2, e3 = -i3 - l2) : (o3.value = Ua.AREA_3, e3 = i3 > 0 ? -i3 + M2 : -i3 - M2);
|
|
5384
5401
|
else {
|
|
5385
5402
|
var c3, u3, d3, m3, _3, f3;
|
|
5386
5403
|
this.face === Da.RIGHT ? i3 = Ha(i3, +l2) : this.face === Da.BACK ? i3 = Ha(i3, 3.14159265359) : this.face === Da.LEFT && (i3 = Ha(i3, -l2)), m3 = Math.sin(s3), _3 = Math.cos(s3), f3 = Math.sin(i3), c3 = _3 * Math.cos(i3), u3 = _3 * f3, d3 = m3, this.face === Da.FRONT ? e3 = Wa(a3 = Math.acos(c3), d3, u3, o3) : this.face === Da.RIGHT ? e3 = Wa(a3 = Math.acos(u3), d3, -c3, o3) : this.face === Da.BACK ? e3 = Wa(a3 = Math.acos(-c3), d3, -u3, o3) : this.face === Da.LEFT ? e3 = Wa(a3 = Math.acos(-u3), d3, c3, o3) : (a3 = e3 = 0, o3.value = Ua.AREA_0);
|
|
5387
5404
|
}
|
|
5388
|
-
return r3 = Math.atan(12 /
|
|
5405
|
+
return r3 = Math.atan(12 / M2 * (e3 + Math.acos(Math.sin(e3) * Math.cos(p2)) - l2)), n3 = Math.sqrt((1 - Math.cos(a3)) / (Math.cos(r3) * Math.cos(r3)) / (1 - Math.cos(Math.atan(1 / Math.cos(e3))))), o3.value === Ua.AREA_1 ? r3 += l2 : o3.value === Ua.AREA_2 ? r3 += M2 : o3.value === Ua.AREA_3 && (r3 += 1.5 * M2), h3.x = n3 * Math.cos(r3), h3.y = n3 * Math.sin(r3), h3.x = h3.x * this.a + this.x0, h3.y = h3.y * this.a + this.y0, t3.x = h3.x, t3.y = h3.y, t3;
|
|
5389
5406
|
}
|
|
5390
5407
|
function Va(t3) {
|
|
5391
5408
|
var s3, i3, e3, a3, n3, r3, h3, o3, c3, u3, d3, m3, _3 = { lam: 0, phi: 0 }, f3 = { value: 0 };
|
|
5392
|
-
if (t3.x = (t3.x - this.x0) / this.a, t3.y = (t3.y - this.y0) / this.a, i3 = Math.atan(Math.sqrt(t3.x * t3.x + t3.y * t3.y)), s3 = Math.atan2(t3.y, t3.x), t3.x >= 0 && t3.x >= Math.abs(t3.y) ? f3.value = Ua.AREA_0 : t3.y >= 0 && t3.y >= Math.abs(t3.x) ? (f3.value = Ua.AREA_1, s3 -= l2) : t3.x < 0 && -t3.x >= Math.abs(t3.y) ? (f3.value = Ua.AREA_2, s3 = s3 < 0 ? s3 +
|
|
5393
|
-
o3 = Math.acos(h3), _3.phi = l2 - o3, f3.value === Ua.AREA_0 ? _3.lam = r3 + l2 : f3.value === Ua.AREA_1 ? _3.lam = r3 < 0 ? r3 +
|
|
5409
|
+
if (t3.x = (t3.x - this.x0) / this.a, t3.y = (t3.y - this.y0) / this.a, i3 = Math.atan(Math.sqrt(t3.x * t3.x + t3.y * t3.y)), s3 = Math.atan2(t3.y, t3.x), t3.x >= 0 && t3.x >= Math.abs(t3.y) ? f3.value = Ua.AREA_0 : t3.y >= 0 && t3.y >= Math.abs(t3.x) ? (f3.value = Ua.AREA_1, s3 -= l2) : t3.x < 0 && -t3.x >= Math.abs(t3.y) ? (f3.value = Ua.AREA_2, s3 = s3 < 0 ? s3 + M2 : s3 - M2) : (f3.value = Ua.AREA_3, s3 += l2), c3 = M2 / 12 * Math.tan(s3), n3 = Math.sin(c3) / (Math.cos(c3) - 1 / Math.sqrt(2)), r3 = Math.atan(n3), (h3 = 1 - (e3 = Math.cos(s3)) * e3 * (a3 = Math.tan(i3)) * a3 * (1 - Math.cos(Math.atan(1 / Math.cos(r3))))) < -1 ? h3 = -1 : h3 > 1 && (h3 = 1), this.face === Da.TOP)
|
|
5410
|
+
o3 = Math.acos(h3), _3.phi = l2 - o3, f3.value === Ua.AREA_0 ? _3.lam = r3 + l2 : f3.value === Ua.AREA_1 ? _3.lam = r3 < 0 ? r3 + M2 : r3 - M2 : f3.value === Ua.AREA_2 ? _3.lam = r3 - l2 : _3.lam = r3;
|
|
5394
5411
|
else if (this.face === Da.BOTTOM)
|
|
5395
|
-
o3 = Math.acos(h3), _3.phi = o3 - l2, f3.value === Ua.AREA_0 ? _3.lam = -r3 + l2 : f3.value === Ua.AREA_1 ? _3.lam = -r3 : f3.value === Ua.AREA_2 ? _3.lam = -r3 - l2 : _3.lam = r3 < 0 ? -r3 -
|
|
5412
|
+
o3 = Math.acos(h3), _3.phi = o3 - l2, f3.value === Ua.AREA_0 ? _3.lam = -r3 + l2 : f3.value === Ua.AREA_1 ? _3.lam = -r3 : f3.value === Ua.AREA_2 ? _3.lam = -r3 - l2 : _3.lam = r3 < 0 ? -r3 - M2 : -r3 + M2;
|
|
5396
5413
|
else {
|
|
5397
|
-
var y3, p3,
|
|
5398
|
-
c3 = (y3 = h3) * y3, p3 = (c3 += (
|
|
5414
|
+
var y3, p3, g3;
|
|
5415
|
+
c3 = (y3 = h3) * y3, p3 = (c3 += (g3 = c3 >= 1 ? 0 : Math.sqrt(1 - c3) * Math.sin(r3)) * g3) >= 1 ? 0 : Math.sqrt(1 - c3), f3.value === Ua.AREA_1 ? (c3 = p3, p3 = -g3, g3 = c3) : f3.value === Ua.AREA_2 ? (p3 = -p3, g3 = -g3) : f3.value === Ua.AREA_3 && (c3 = p3, p3 = g3, g3 = -c3), this.face === Da.RIGHT ? (c3 = y3, y3 = -p3, p3 = c3) : this.face === Da.BACK ? (y3 = -y3, p3 = -p3) : this.face === Da.LEFT && (c3 = y3, y3 = p3, p3 = -c3), _3.phi = Math.acos(-g3) - l2, _3.lam = Math.atan2(p3, y3), this.face === Da.RIGHT ? _3.lam = Ha(_3.lam, -l2) : this.face === Da.BACK ? _3.lam = Ha(_3.lam, -3.14159265359) : this.face === Da.LEFT && (_3.lam = Ha(_3.lam, +l2));
|
|
5399
5416
|
}
|
|
5400
5417
|
return 0 !== this.es && (u3 = _3.phi < 0 ? 1 : 0, d3 = Math.tan(_3.phi), m3 = this.b / Math.sqrt(d3 * d3 + this.one_minus_f_squared), _3.phi = Math.atan(Math.sqrt(this.a * this.a - m3 * m3) / (this.one_minus_f * m3)), u3 && (_3.phi = -_3.phi)), _3.lam += this.long0, t3.x = _3.lam, t3.y = _3.phi, t3;
|
|
5401
5418
|
}
|
|
5402
5419
|
function Wa(t3, s3, i3, e3) {
|
|
5403
5420
|
var a3;
|
|
5404
|
-
return t3 < _2 ? (e3.value = Ua.AREA_0, a3 = 0) : (a3 = Math.atan2(s3, i3), Math.abs(a3) <= p2 ? e3.value = Ua.AREA_0 : a3 > p2 && a3 <= l2 + p2 ? (e3.value = Ua.AREA_1, a3 -= l2) : a3 > l2 + p2 || a3 <= -(l2 + p2) ? (e3.value = Ua.AREA_2, a3 = a3 >= 0 ? a3 -
|
|
5421
|
+
return t3 < _2 ? (e3.value = Ua.AREA_0, a3 = 0) : (a3 = Math.atan2(s3, i3), Math.abs(a3) <= p2 ? e3.value = Ua.AREA_0 : a3 > p2 && a3 <= l2 + p2 ? (e3.value = Ua.AREA_1, a3 -= l2) : a3 > l2 + p2 || a3 <= -(l2 + p2) ? (e3.value = Ua.AREA_2, a3 = a3 >= 0 ? a3 - M2 : a3 + M2) : (e3.value = Ua.AREA_3, a3 += l2)), a3;
|
|
5405
5422
|
}
|
|
5406
5423
|
function Ha(t3, s3) {
|
|
5407
5424
|
var i3 = t3 + s3;
|
|
5408
|
-
return i3 < -3.14159265359 ? i3 +=
|
|
5425
|
+
return i3 < -3.14159265359 ? i3 += g2 : i3 > 3.14159265359 && (i3 -= g2), i3;
|
|
5409
5426
|
}
|
|
5410
|
-
var
|
|
5427
|
+
var Xa = { init: ja, forward: Fa, inverse: Va, names: ["Quadrilateralized Spherical Cube", "Quadrilateralized_Spherical_Cube", "qsc"] }, Ya = [[1, 22199e-21, -715515e-10, 31103e-10], [0.9986, -482243e-9, -24897e-9, -13309e-10], [0.9954, -83103e-8, -448605e-10, -986701e-12], [0.99, -135364e-8, -59661e-9, 36777e-10], [0.9822, -167442e-8, -449547e-11, -572411e-11], [0.973, -214868e-8, -903571e-10, 18736e-12], [0.96, -305085e-8, -900761e-10, 164917e-11], [0.9427, -382792e-8, -653386e-10, -26154e-10], [0.9216, -467746e-8, -10457e-8, 481243e-11], [0.8962, -536223e-8, -323831e-10, -543432e-11], [0.8679, -609363e-8, -113898e-9, 332484e-11], [0.835, -698325e-8, -640253e-10, 934959e-12], [0.7986, -755338e-8, -500009e-10, 935324e-12], [0.7597, -798324e-8, -35971e-9, -227626e-11], [0.7186, -851367e-8, -701149e-10, -86303e-10], [0.6732, -986209e-8, -199569e-9, 191974e-10], [0.6213, -0.010418, 883923e-10, 624051e-11], [0.5722, -906601e-8, 182e-6, 624051e-11], [0.5322, -677797e-8, 275608e-9, 624051e-11]], Za = [[-520417e-23, 0.0124, 121431e-23, -845284e-16], [0.062, 0.0124, -126793e-14, 422642e-15], [0.124, 0.0124, 507171e-14, -160604e-14], [0.186, 0.0123999, -190189e-13, 600152e-14], [0.248, 0.0124002, 710039e-13, -224e-10], [0.31, 0.0123992, -264997e-12, 835986e-13], [0.372, 0.0124029, 988983e-12, -311994e-12], [0.434, 0.0123893, -369093e-11, -435621e-12], [0.4958, 0.0123198, -102252e-10, -345523e-12], [0.5571, 0.0121916, -154081e-10, -582288e-12], [0.6176, 0.0119938, -241424e-10, -525327e-12], [0.6769, 0.011713, -320223e-10, -516405e-12], [0.7346, 0.0113541, -397684e-10, -609052e-12], [0.7903, 0.0109107, -489042e-10, -104739e-11], [0.8435, 0.0103431, -64615e-9, -140374e-14], [0.8936, 969686e-8, -64636e-9, -8547e-9], [0.9394, 840947e-8, -192841e-9, -42106e-10], [0.9761, 616527e-8, -256e-6, -42106e-10], [1, 328947e-8, -319159e-9, -42106e-10]], Qa = 0.8487, Ka = 1.3523, Ja = y2 / 5, $a = 1 / Ja, tn = 18, sn = function(t3, s3) {
|
|
5411
5428
|
return t3[0] + s3 * (t3[1] + s3 * (t3[2] + s3 * t3[3]));
|
|
5412
5429
|
}, en = function(t3, s3) {
|
|
5413
5430
|
return t3[1] + s3 * (2 * t3[2] + 3 * s3 * t3[3]);
|
|
@@ -5426,27 +5443,27 @@ Me.exports = function() {
|
|
|
5426
5443
|
function rn(t3) {
|
|
5427
5444
|
var s3 = yt2(t3.x - this.long0), i3 = Math.abs(t3.y), e3 = Math.floor(i3 * Ja);
|
|
5428
5445
|
e3 < 0 ? e3 = 0 : e3 >= tn && (e3 = tn - 1), i3 = y2 * (i3 - $a * e3);
|
|
5429
|
-
var a3 = { x: sn(
|
|
5430
|
-
return t3.y < 0 && (a3.y = -a3.y), a3.x = a3.x * this.a *
|
|
5446
|
+
var a3 = { x: sn(Ya[e3], i3) * s3, y: sn(Za[e3], i3) };
|
|
5447
|
+
return t3.y < 0 && (a3.y = -a3.y), a3.x = a3.x * this.a * Qa + this.x0, a3.y = a3.y * this.a * Ka + this.y0, a3;
|
|
5431
5448
|
}
|
|
5432
5449
|
function hn(t3) {
|
|
5433
|
-
var s3 = { x: (t3.x - this.x0) / (this.a *
|
|
5450
|
+
var s3 = { x: (t3.x - this.x0) / (this.a * Qa), y: Math.abs(t3.y - this.y0) / (this.a * Ka) };
|
|
5434
5451
|
if (s3.y >= 1)
|
|
5435
|
-
s3.x /=
|
|
5452
|
+
s3.x /= Ya[tn][0], s3.y = t3.y < 0 ? -l2 : l2;
|
|
5436
5453
|
else {
|
|
5437
5454
|
var i3 = Math.floor(s3.y * tn);
|
|
5438
5455
|
for (i3 < 0 ? i3 = 0 : i3 >= tn && (i3 = tn - 1); ; )
|
|
5439
|
-
if (
|
|
5456
|
+
if (Za[i3][0] > s3.y)
|
|
5440
5457
|
--i3;
|
|
5441
5458
|
else {
|
|
5442
|
-
if (!(
|
|
5459
|
+
if (!(Za[i3 + 1][0] <= s3.y))
|
|
5443
5460
|
break;
|
|
5444
5461
|
++i3;
|
|
5445
5462
|
}
|
|
5446
|
-
var e3 =
|
|
5463
|
+
var e3 = Za[i3], a3 = 5 * (s3.y - e3[0]) / (Za[i3 + 1][0] - e3[0]);
|
|
5447
5464
|
a3 = an(function(t4) {
|
|
5448
5465
|
return (sn(e3, t4) - s3.y) / en(e3, t4);
|
|
5449
|
-
}, a3, _2, 100), s3.x /= sn(
|
|
5466
|
+
}, a3, _2, 100), s3.x /= sn(Ya[i3], a3), s3.y = (5 * i3 + a3) * f2, t3.y < 0 && (s3.y = -s3.y);
|
|
5450
5467
|
}
|
|
5451
5468
|
return s3.x = yt2(s3.x + this.long0), s3;
|
|
5452
5469
|
}
|
|
@@ -5534,8 +5551,8 @@ Me.exports = function() {
|
|
|
5534
5551
|
}
|
|
5535
5552
|
return t3.x = a3.x + this.long0, t3.y = a3.y, t3;
|
|
5536
5553
|
}
|
|
5537
|
-
var
|
|
5538
|
-
function
|
|
5554
|
+
var gn = { init: fn, forward: yn, inverse: pn, names: ["Tilted_Perspective", "tpers"] };
|
|
5555
|
+
function Mn() {
|
|
5539
5556
|
if (this.flip_axis = "x" === this.sweep ? 1 : 0, this.h = Number(this.h), this.radius_g_1 = this.h / this.a, this.radius_g_1 <= 0 || this.radius_g_1 > 1e10)
|
|
5540
5557
|
throw new Error();
|
|
5541
5558
|
if (this.radius_g = 1 + this.radius_g_1, this.C = this.radius_g * this.radius_g - 1, 0 !== this.es) {
|
|
@@ -5572,22 +5589,22 @@ Me.exports = function() {
|
|
|
5572
5589
|
}
|
|
5573
5590
|
return t3.x = t3.x + this.long0, t3;
|
|
5574
5591
|
}
|
|
5575
|
-
var Sn = { init:
|
|
5592
|
+
var Sn = { init: Mn, forward: xn, inverse: wn, names: ["Geostationary Satellite View", "Geostationary_Satellite", "geos"] }, En = 1.340264, bn = -0.081106, Pn = 893e-6, vn = 3796e-6, An = Math.sqrt(3) / 2;
|
|
5576
5593
|
function Gn() {
|
|
5577
5594
|
this.es = 0, this.long0 = void 0 !== this.long0 ? this.long0 : 0;
|
|
5578
5595
|
}
|
|
5579
|
-
function
|
|
5596
|
+
function Nn(t3) {
|
|
5580
5597
|
var s3 = yt2(t3.x - this.long0), i3 = t3.y, e3 = Math.asin(An * Math.sin(i3)), a3 = e3 * e3, n3 = a3 * a3 * a3;
|
|
5581
5598
|
return t3.x = s3 * Math.cos(e3) / (An * (En + 3 * bn * a3 + n3 * (7 * Pn + 9 * vn * a3))), t3.y = e3 * (En + bn * a3 + n3 * (Pn + vn * a3)), t3.x = this.a * t3.x + this.x0, t3.y = this.a * t3.y + this.y0, t3;
|
|
5582
5599
|
}
|
|
5583
|
-
function
|
|
5600
|
+
function Cn(t3) {
|
|
5584
5601
|
t3.x = (t3.x - this.x0) / this.a, t3.y = (t3.y - this.y0) / this.a;
|
|
5585
5602
|
var s3, i3, e3, a3, n3 = 1e-9, r3 = 12, h3 = t3.y;
|
|
5586
5603
|
for (a3 = 0; a3 < r3 && (h3 -= e3 = (h3 * (En + bn * (s3 = h3 * h3) + (i3 = s3 * s3 * s3) * (Pn + vn * s3)) - t3.y) / (En + 3 * bn * s3 + i3 * (7 * Pn + 9 * vn * s3)), !(Math.abs(e3) < n3)); ++a3)
|
|
5587
5604
|
;
|
|
5588
5605
|
return i3 = (s3 = h3 * h3) * s3 * s3, t3.x = An * t3.x * (En + 3 * bn * s3 + i3 * (7 * Pn + 9 * vn * s3)) / Math.cos(h3), t3.y = Math.asin(Math.sin(h3) / An), t3.x = yt2(t3.x + this.long0), t3;
|
|
5589
5606
|
}
|
|
5590
|
-
var In = { init: Gn, forward:
|
|
5607
|
+
var In = { init: Gn, forward: Nn, inverse: Cn, names: ["eqearth", "Equal Earth", "Equal_Earth"] }, zn = 1e-10;
|
|
5591
5608
|
function Tn() {
|
|
5592
5609
|
var t3;
|
|
5593
5610
|
if (this.phi1 = this.lat1, Math.abs(this.phi1) < zn)
|
|
@@ -5623,23 +5640,23 @@ Me.exports = function() {
|
|
|
5623
5640
|
}
|
|
5624
5641
|
var Bn = { init: Tn, names: ["bonne", "Bonne (Werner lat_1=90)"] };
|
|
5625
5642
|
function kn(t3) {
|
|
5626
|
-
t3.Proj.projections.add(mi2), t3.Proj.projections.add(Pi2), t3.Proj.projections.add(Gi2), t3.Proj.projections.add(Bi2), t3.Proj.projections.add(Fi2), t3.Proj.projections.add(
|
|
5643
|
+
t3.Proj.projections.add(mi2), t3.Proj.projections.add(Pi2), t3.Proj.projections.add(Gi2), t3.Proj.projections.add(Bi2), t3.Proj.projections.add(Fi2), t3.Proj.projections.add(Xi2), t3.Proj.projections.add($i2), t3.Proj.projections.add(ee2), t3.Proj.projections.add(he2), t3.Proj.projections.add(Me2), t3.Proj.projections.add(ze2), t3.Proj.projections.add(Be2), t3.Proj.projections.add(je2), t3.Proj.projections.add(Xe2), t3.Proj.projections.add(Ke2), t3.Proj.projections.add(ia), t3.Proj.projections.add(ra), t3.Proj.projections.add(la), t3.Proj.projections.add(fa), t3.Proj.projections.add(Ma), t3.Proj.projections.add(Ea), t3.Proj.projections.add(Ga), t3.Proj.projections.add(Ra), t3.Proj.projections.add(ka), t3.Proj.projections.add(Xa), t3.Proj.projections.add(on), t3.Proj.projections.add(dn), t3.Proj.projections.add(gn), t3.Proj.projections.add(Sn), t3.Proj.projections.add(In), t3.Proj.projections.add(Bn);
|
|
5627
5644
|
}
|
|
5628
|
-
return ws2.defaultDatum = "WGS84", ws2.Proj = ss2, ws2.WGS84 = new ws2.Proj("WGS84"), ws2.Point =
|
|
5645
|
+
return ws2.defaultDatum = "WGS84", ws2.Proj = ss2, ws2.WGS84 = new ws2.Proj("WGS84"), ws2.Point = Xs2, ws2.toPoint = ms2, ws2.defs = at2, ws2.nadgrid = Ut2, ws2.transform = ps2, ws2.mgrs = Cs2, ws2.version = "2.17.0", kn(ws2), ws2;
|
|
5629
5646
|
}();
|
|
5630
|
-
var
|
|
5647
|
+
var Me = ge.exports;
|
|
5631
5648
|
let xe = 1;
|
|
5632
5649
|
const we = new Array(2);
|
|
5633
|
-
class Se extends
|
|
5650
|
+
class Se extends Nt {
|
|
5634
5651
|
constructor(t2, s2, i2) {
|
|
5635
|
-
super(), t2 || (t2 = "custom_" + xe++), this._name = t2, this._parameters = s2,
|
|
5652
|
+
super(), t2 || (t2 = "custom_" + xe++), this._name = t2, this._parameters = s2, Me.defs(this._name) || Me.defs(this._name, s2), i2 && i2.isBox3 && (this._geoBoundingBox = i2);
|
|
5636
5653
|
}
|
|
5637
5654
|
projectCoordinate(t2, s2, i2) {
|
|
5638
5655
|
we[0] = t2.x, we[1] = t2.y;
|
|
5639
5656
|
const e2 = this.geoBoundingBox;
|
|
5640
5657
|
we[0] < e2.min.x && (we[0] = e2.min.x), we[0] > e2.max.x && (we[0] = e2.max.x), we[1] < e2.min.y && (we[1] = e2.min.y), we[1] > e2.max.y && (we[1] = e2.max.y);
|
|
5641
|
-
const a2 =
|
|
5642
|
-
if (s2 || (s2 = new
|
|
5658
|
+
const a2 = Me("EPSG:4326", this.name, we);
|
|
5659
|
+
if (s2 || (s2 = new u()), i2) {
|
|
5643
5660
|
const i3 = this.projectedBoundingBox;
|
|
5644
5661
|
s2.x = It(t2.x, a2[0], e2.max.x, i3.max.x), s2.y = It(t2.y, a2[1], e2.max.y, i3.max.y);
|
|
5645
5662
|
} else
|
|
@@ -5649,10 +5666,10 @@ class Se extends Ct {
|
|
|
5649
5666
|
unprojectCoordinate(t2, s2, i2) {
|
|
5650
5667
|
const e2 = this.projectedBoundingBox;
|
|
5651
5668
|
we[0] = t2.x, we[1] = t2.y, we[0] < e2.min.x && (we[0] = e2.min.x), we[0] > e2.max.x && (we[0] = e2.max.x), we[1] < e2.min.y && (we[1] = e2.min.y), we[1] > e2.max.y && (we[1] = e2.max.y);
|
|
5652
|
-
const a2 =
|
|
5653
|
-
if (s2 || (s2 = new
|
|
5669
|
+
const a2 = Me(this.name, "EPSG:4326", we);
|
|
5670
|
+
if (s2 || (s2 = new u()), i2) {
|
|
5654
5671
|
const i3 = this.geoBoundingBox;
|
|
5655
|
-
s2.x =
|
|
5672
|
+
s2.x = Ct(t2.x, a2[0], i3.max.x, e2.max.x), s2.y = Ct(t2.y, a2[1], i3.max.y, e2.max.y);
|
|
5656
5673
|
} else
|
|
5657
5674
|
s2.x = a2[0], s2.y = a2[1];
|
|
5658
5675
|
return s2.z = t2.z, s2;
|
|
@@ -5671,9 +5688,9 @@ for (let t2 = 0; t2 < 11; t2++) {
|
|
|
5671
5688
|
be[`EPSG:${4491 + t2}`] = { parameters: `+proj=tmerc +lat_0=0 +lon_0=${i2} +k=1 +x_0=${e2} +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs`, projectBoundingBoxMethod: Gt, geoBoundingBox: [[i2 - 3, 3, 0], [i2 + 3, 54, 0]] }, be[`EPSG:${4502 + t2}`] = { parameters: `+proj=tmerc +lat_0=0 +lon_0=${i2} +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs`, projectBoundingBoxMethod: Gt, geoBoundingBox: [[i2 - 3, 3, 0], [i2 + 3, 54, 0]] }, s2 = 25 + 2 * t2, i2 = 3 * s2, e2 = 1e6 * s2 + 5e5, be["EPSG:" + (4513 + 2 * t2)] = { parameters: `+proj=tmerc +lat_0=0 +lon_0=${i2} +k=1 +x_0=${e2} +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs`, projectBoundingBoxMethod: Gt, geoBoundingBox: [[i2 - 1.5, 3, 0], [i2 + 1.5, 54, 0]] }, be["EPSG:" + (4534 + 2 * t2)] = { parameters: `+proj=tmerc +lat_0=0 +lon_0=${i2} +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs`, projectBoundingBoxMethod: Gt, geoBoundingBox: [[i2 - 1.5, 3, 0], [i2 + 1.5, 54, 0]] }, s2 = 25 + 2 * t2 + 1, t2 < 10 && (i2 = 3 * s2, e2 = 1e6 * s2 + 5e5, be["EPSG:" + (4513 + 2 * t2 + 1)] = { parameters: `+proj=tmerc +lat_0=0 +lon_0=${i2} +k=1 +x_0=${e2} +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs`, projectBoundingBoxMethod: Gt, geoBoundingBox: [[i2 - 1.5, 3, 0], [i2 + 1.5, 54, 0]] }, be["EPSG:" + (4534 + 2 * t2 + 1)] = { parameters: `+proj=tmerc +lat_0=0 +lon_0=${i2} +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs`, projectBoundingBoxMethod: Gt, geoBoundingBox: [[i2 - 1.5, 3, 0], [i2 + 1.5, 54, 0]] });
|
|
5672
5689
|
}
|
|
5673
5690
|
const Pe = (t2) => {
|
|
5674
|
-
if (t2 = ((t3) => "EPSG:900913" === (t3 = t3.toUpperCase().trim()) ?
|
|
5691
|
+
if (t2 = ((t3) => "EPSG:900913" === (t3 = t3.toUpperCase().trim()) ? Mt : "GLOBE" === t3 || "ECEF" === t3 ? xt : t3)(t2), !Ee[t2])
|
|
5675
5692
|
switch (t2) {
|
|
5676
|
-
case
|
|
5693
|
+
case Mt:
|
|
5677
5694
|
Ee[t2] = new kt();
|
|
5678
5695
|
break;
|
|
5679
5696
|
case xt:
|
|
@@ -5682,7 +5699,7 @@ const Pe = (t2) => {
|
|
|
5682
5699
|
case wt:
|
|
5683
5700
|
Ee[t2] = new _e();
|
|
5684
5701
|
break;
|
|
5685
|
-
case
|
|
5702
|
+
case gt:
|
|
5686
5703
|
Ee[t2] = new ye();
|
|
5687
5704
|
break;
|
|
5688
5705
|
case St:
|
|
@@ -5695,7 +5712,7 @@ const Pe = (t2) => {
|
|
|
5695
5712
|
let e2 = null;
|
|
5696
5713
|
if (i2.geoBoundingBox) {
|
|
5697
5714
|
const t3 = i2.geoBoundingBox;
|
|
5698
|
-
e2 = new p(new
|
|
5715
|
+
e2 = new p(new u(t3[0][0], t3[0][1], t3[0][2] || 0), new u(t3[1][0], t3[1][1], t3[1][2] || 0));
|
|
5699
5716
|
}
|
|
5700
5717
|
s2 = new Se(t2, i2.parameters, e2), i2.projectBoundingBoxMethod && (s2.projectBoundingBoxMethod = i2.projectBoundingBoxMethod);
|
|
5701
5718
|
}
|
|
@@ -5705,12 +5722,23 @@ const Pe = (t2) => {
|
|
|
5705
5722
|
}
|
|
5706
5723
|
return Ee[t2];
|
|
5707
5724
|
};
|
|
5708
|
-
|
|
5725
|
+
let ve = new c();
|
|
5726
|
+
function Ae(t2, s2, i2 = new c()) {
|
|
5727
|
+
const e2 = t2.lengthSq();
|
|
5728
|
+
if (Math.abs(e2 - 1) > 1e-6)
|
|
5729
|
+
throw new Error("vector must be normalized.");
|
|
5730
|
+
if (i2.x = t2.x / (Math.abs(t2.x) + Math.abs(t2.y) + Math.abs(t2.z)), i2.y = t2.y / (Math.abs(t2.x) + Math.abs(t2.y) + Math.abs(t2.z)), t2.z < 0) {
|
|
5731
|
+
const t3 = i2.x, s3 = i2.y;
|
|
5732
|
+
i2.x = (1 - Math.abs(s3)) * (t3 >= 0 ? 1 : -1), i2.y = (1 - Math.abs(t3)) * (s3 >= 0 ? 1 : -1);
|
|
5733
|
+
}
|
|
5734
|
+
return i2.x = Math.round((0.5 * i2.x + 0.5) * s2), i2.y = Math.round((0.5 * i2.y + 0.5) * s2), i2;
|
|
5735
|
+
}
|
|
5736
|
+
class Ge {
|
|
5709
5737
|
constructor() {
|
|
5710
5738
|
this.vertexBuffer = void 0, this.index = void 0, this.first = void 0, this.second = void 0, this.ratio = void 0;
|
|
5711
5739
|
}
|
|
5712
5740
|
clone(t2) {
|
|
5713
|
-
return ht(t2) || (t2 = new
|
|
5741
|
+
return ht(t2) || (t2 = new Ge()), t2.uBuffer = this.uBuffer, t2.vBuffer = this.vBuffer, t2.heightBuffer = this.heightBuffer, t2.normalBuffer = this.normalBuffer, t2.index = this.index, t2.first = this.first, t2.second = this.second, t2.ratio = this.ratio, t2;
|
|
5714
5742
|
}
|
|
5715
5743
|
initializeIndexed(t2, s2, i2, e2, a2) {
|
|
5716
5744
|
this.uBuffer = t2, this.vBuffer = s2, this.heightBuffer = i2, this.normalBuffer = e2, this.index = a2, this.first = void 0, this.second = void 0, this.ratio = void 0;
|
|
@@ -5734,9 +5762,24 @@ class ve {
|
|
|
5734
5762
|
getKey() {
|
|
5735
5763
|
return this.isIndexed() ? this.index : JSON.stringify({ first: this.first.getKey(), second: this.second.getKey(), ratio: this.ratio });
|
|
5736
5764
|
}
|
|
5765
|
+
getNormalX() {
|
|
5766
|
+
return ht(this.index) ? this.normalBuffer[2 * this.index] : (ve = Te(this, ve), ve.x);
|
|
5767
|
+
}
|
|
5768
|
+
getNormalY() {
|
|
5769
|
+
return ht(this.index) ? this.normalBuffer[2 * this.index + 1] : (ve = Te(this, ve), ve.y);
|
|
5770
|
+
}
|
|
5737
5771
|
}
|
|
5738
|
-
|
|
5739
|
-
|
|
5772
|
+
let Ne = -1;
|
|
5773
|
+
const Ce = [new u(), new u()], Ie = [new u(), new u()], ze = new u();
|
|
5774
|
+
function Te(t2, s2) {
|
|
5775
|
+
++Ne;
|
|
5776
|
+
let i2 = Ce[Ne], e2 = Ie[Ne];
|
|
5777
|
+
return i2.copy(Ke(t2.first.getNormalX(), t2.first.getNormalY())), e2.copy(Ke(t2.second.getNormalX(), t2.second.getNormalY())), ze.lerpVectors(i2, e2, t2.ratio), ze.normalize(), function(t3, s3) {
|
|
5778
|
+
Ae(t3, 255, s3);
|
|
5779
|
+
}(ze, s2), --Ne, s2;
|
|
5780
|
+
}
|
|
5781
|
+
const Oe = new c(), Re = [];
|
|
5782
|
+
Re.push(new Ge()), Re.push(new Ge()), Re.push(new Ge()), Re.push(new Ge()), self.addEventListener("message", (t2) => {
|
|
5740
5783
|
const s2 = t2.data, { type: i2 } = s2;
|
|
5741
5784
|
"createTerrainMesh" === i2 ? self.createVerticesFromQuantizedTerrainMesh(s2) : "upsampleTerrainData" === i2 ? self.upsampleQuantizedTerrainMesh(s2) : console.log(s2);
|
|
5742
5785
|
}), self.calculateUvFromPositions = (t2) => {
|
|
@@ -5751,110 +5794,150 @@ Ae.push(new ve()), Ae.push(new ve()), Ae.push(new ve()), Ae.push(new ve()), self
|
|
|
5751
5794
|
t2[i2] = s2 - e2, 0 === e2 && ++s2;
|
|
5752
5795
|
}
|
|
5753
5796
|
};
|
|
5754
|
-
const
|
|
5755
|
-
|
|
5797
|
+
const qe = 32767, Le = 16383, Be = [], ke = [], De = [], Ue = [], je = [], Fe = [], Ve = [], We = new c(), He = new u(), Xe = new u(), Ye = new u();
|
|
5798
|
+
new u(0, 0, 0);
|
|
5799
|
+
const Ze = new c();
|
|
5800
|
+
self.upsampleQuantizedTerrainMesh = (t2) => {
|
|
5801
|
+
const s2 = t2.isEastChild, i2 = t2.isNorthChild, e2 = t2.hasVertexNormals, a2 = s2 ? Le : 0, n2 = s2 ? qe : Le, r2 = i2 ? Le : 0, h2 = i2 ? qe : Le, c2 = De, l2 = Ue, u2 = je, d2 = Fe, m2 = Ve;
|
|
5802
|
+
c2.length = 0, l2.length = 0, u2.length = 0, d2.length = 0, m2.length = 0;
|
|
5803
|
+
const _2 = {}, f2 = t2.vertices;
|
|
5804
|
+
let y2 = t2.indices;
|
|
5805
|
+
y2 = y2.subarray(0, t2.indexCountWithoutSkirts);
|
|
5806
|
+
let p2 = 0;
|
|
5807
|
+
const g2 = t2.vertexCountWithoutSkirts, M2 = t2.minimumHeight, x2 = t2.maximumHeight, w2 = new Array(g2), S2 = new Array(g2), E2 = new Array(g2), b2 = e2 ? new Array(2 * g2) : void 0;
|
|
5808
|
+
let P2, v2, A2, G2, N2, C2 = 6;
|
|
5809
|
+
for (e2 && (C2 += 3), v2 = 0, A2 = 0; v2 < g2; ++v2, A2 += 2) {
|
|
5810
|
+
const t3 = self.decodeTextureCoordinates(f2, v2, C2, We);
|
|
5811
|
+
if (P2 = self.decodeHeight(f2, v2, C2), G2 = o.clamp(t3.x * qe | 0, 0, qe), N2 = o.clamp(t3.y * qe | 0, 0, qe), E2[v2] = o.clamp((P2 - M2) / (x2 - M2) * qe | 0, 0, qe), G2 < 20 && (G2 = 0), N2 < 20 && (N2 = 0), qe - G2 < 20 && (G2 = qe), qe - N2 < 20 && (N2 = qe), w2[v2] = G2, S2[v2] = N2, e2) {
|
|
5812
|
+
const t4 = self.getOctEncodedNormal(f2, v2, C2, 6, Ze);
|
|
5813
|
+
b2[A2] = t4.x, b2[A2 + 1] = t4.y;
|
|
5814
|
+
}
|
|
5815
|
+
(s2 && G2 >= Le || !s2 && G2 <= Le) && (i2 && N2 >= Le || !i2 && N2 <= Le) && (_2[v2] = p2, c2.push(G2), l2.push(N2), u2.push(E2[v2]), e2 && (d2.push(b2[A2]), d2.push(b2[A2 + 1])), ++p2);
|
|
5816
|
+
}
|
|
5817
|
+
const I2 = [];
|
|
5818
|
+
I2.push(new Ge()), I2.push(new Ge()), I2.push(new Ge());
|
|
5819
|
+
const z2 = [];
|
|
5820
|
+
let T2, O2;
|
|
5821
|
+
for (z2.push(new Ge()), z2.push(new Ge()), z2.push(new Ge()), v2 = 0; v2 < y2.length; v2 += 3) {
|
|
5822
|
+
const t3 = y2[v2], a3 = y2[v2 + 1], n3 = y2[v2 + 2], r3 = w2[t3], h3 = w2[a3], o2 = w2[n3];
|
|
5823
|
+
I2[0].initializeIndexed(w2, S2, E2, b2, t3), I2[1].initializeIndexed(w2, S2, E2, b2, a3), I2[2].initializeIndexed(w2, S2, E2, b2, n3);
|
|
5824
|
+
const f3 = ft.clipTriangleAtAxisAlignedThreshold(Le, s2, r3, h3, o2, Be);
|
|
5825
|
+
T2 = 0, T2 >= f3.length || (T2 = z2[0].initializeFromClipResult(f3, T2, I2), T2 >= f3.length || (T2 = z2[1].initializeFromClipResult(f3, T2, I2), T2 >= f3.length || (T2 = z2[2].initializeFromClipResult(f3, T2, I2), O2 = ft.clipTriangleAtAxisAlignedThreshold(Le, i2, z2[0].getV(), z2[1].getV(), z2[2].getV(), ke), $e(c2, l2, u2, d2, m2, _2, O2, z2, e2), T2 < f3.length && (z2[2].clone(z2[1]), z2[2].initializeFromClipResult(f3, T2, I2), O2 = ft.clipTriangleAtAxisAlignedThreshold(Le, i2, z2[0].getV(), z2[1].getV(), z2[2].getV(), ke), $e(c2, l2, u2, d2, m2, _2, O2, z2, e2)))));
|
|
5826
|
+
}
|
|
5827
|
+
const R2 = s2 ? -32767 : 0, q2 = i2 ? -32767 : 0, L2 = [], B2 = [], k2 = [], D2 = [];
|
|
5828
|
+
let U2 = Number.MAX_VALUE, j2 = -U2;
|
|
5829
|
+
const F2 = it.clone(t2.childRectangle);
|
|
5830
|
+
for (F2.east, F2.west, v2 = 0; v2 < c2.length; v2++)
|
|
5831
|
+
G2 = Math.round(c2[v2]), G2 <= a2 ? (L2.push(v2), G2 = 0) : G2 >= n2 ? (k2.push(v2), G2 = qe) : G2 = 2 * G2 + R2, c2[v2] = G2, N2 = Math.round(l2[v2]), N2 <= r2 ? (B2.push(v2), N2 = 0) : N2 >= h2 ? (D2.push(v2), N2 = qe) : N2 = 2 * N2 + q2, l2[v2] = N2, P2 = o.lerp(M2, x2, u2[v2] / qe), U2 = Math.min(U2, P2), j2 = Math.max(j2, P2), u2[v2] = P2;
|
|
5832
|
+
const V2 = j2 - U2, W2 = new Uint16Array(c2.length + l2.length + u2.length);
|
|
5833
|
+
for (v2 = 0; v2 < c2.length; ++v2)
|
|
5834
|
+
W2[v2] = c2[v2];
|
|
5835
|
+
let H2 = c2.length;
|
|
5836
|
+
for (v2 = 0; v2 < l2.length; ++v2)
|
|
5837
|
+
W2[H2 + v2] = l2[v2];
|
|
5838
|
+
for (H2 += l2.length, v2 = 0; v2 < u2.length; ++v2) {
|
|
5839
|
+
const t3 = qe * (u2[v2] - U2) / V2;
|
|
5840
|
+
W2[H2 + v2] = t3;
|
|
5841
|
+
}
|
|
5842
|
+
const X2 = pt.createTypedArray(c2.length, m2), Y2 = { vertices: W2.buffer, indices: X2.buffer, minimumHeight: U2, maximumHeight: j2, westIndices: L2, southIndices: B2, eastIndices: k2, northIndices: D2 }, Z2 = new Uint8Array(d2), Q2 = [W2.buffer, X2.buffer];
|
|
5843
|
+
e2 && (Y2.encodedNormals = Z2, Q2.push(Z2.buffer));
|
|
5844
|
+
const K2 = t2.type;
|
|
5845
|
+
self.postMessage({ type: "terrainDataUpsampled", tileKey: K2 + "-" + t2.tileKey, content: Y2 }, Q2);
|
|
5846
|
+
}, self.decodeTextureCoordinates = (t2, s2, i2, e2) => (e2 || (e2 = new c()), s2 *= i2, e2.x = t2[s2 + 4], e2.y = t2[s2 + 5], e2), self.decodeHeight = (t2, s2, i2) => t2[(s2 *= i2) + 3], self.createVerticesFromQuantizedTerrainMesh = (t2) => {
|
|
5847
|
+
const s2 = Pe(t2.sourceProjectionName), i2 = Pe(t2.targetProjectionName), e2 = t2.octEncodedNormals, a2 = ht(e2), n2 = t2.tileKey, r2 = t2.tileCenter, h2 = t2.quantizedVertices, l2 = h2.length / 3, d2 = t2.westIndices.length + t2.eastIndices.length + t2.southIndices.length + t2.northIndices.length, m2 = it.clone(t2.rectangle), _2 = m2.west, f2 = m2.south, y2 = m2.east, p2 = m2.north, g2 = t2.minimumHeight, M2 = t2.maximumHeight, x2 = h2.subarray(0, l2), w2 = h2.subarray(l2, 2 * l2), S2 = h2.subarray(2 * l2, 3 * l2), E2 = new Array(l2), b2 = new Array(l2), P2 = new Array(l2), v2 = He;
|
|
5848
|
+
v2.x = Number.POSITIVE_INFINITY, v2.y = Number.POSITIVE_INFINITY, v2.z = Number.POSITIVE_INFINITY;
|
|
5849
|
+
const A2 = Xe;
|
|
5850
|
+
A2.x = Number.NEGATIVE_INFINITY, A2.y = Number.NEGATIVE_INFINITY, A2.z = Number.NEGATIVE_INFINITY;
|
|
5851
|
+
let G2 = Number.POSITIVE_INFINITY, N2 = Number.NEGATIVE_INFINITY, C2 = Number.POSITIVE_INFINITY, I2 = Number.NEGATIVE_INFINITY;
|
|
5852
|
+
for (let t3 = 0; t3 < l2; t3++) {
|
|
5853
|
+
const s3 = x2[t3], e3 = w2[t3], a3 = s3 / qe, n3 = e3 / qe, r3 = o.lerp(g2, M2, S2[t3] / qe);
|
|
5854
|
+
Ye.x = o.lerp(_2, y2, a3), Ye.y = o.lerp(f2, p2, n3), Ye.z = r3, G2 = Math.min(Ye.x, G2), N2 = Math.max(Ye.x, N2), C2 = Math.min(Ye.y, C2), I2 = Math.max(Ye.y, I2), Ye.x = o.radToDeg(Ye.x), Ye.y = o.radToDeg(Ye.y);
|
|
5855
|
+
let h3 = i2.projectCoordinate(Ye, new u());
|
|
5856
|
+
E2[t3] = new c(a3, n3), b2[t3] = r3, P2[t3] = h3;
|
|
5857
|
+
}
|
|
5858
|
+
const z2 = t2.westIndices.slice().sort((t3, s3) => E2[t3].y - E2[s3].y), T2 = t2.eastIndices.slice().sort((t3, s3) => E2[s3].y - E2[t3].y), O2 = t2.southIndices.slice().sort((t3, s3) => E2[s3].x - E2[t3].x), R2 = t2.northIndices.slice().sort((t3, s3) => E2[t3].x - E2[s3].x), q2 = 637e4 / (2 << t2.level) / 2, L2 = Math.max(0, 2 * (d2 - 4)), B2 = t2.indices.length + 3 * L2, k2 = pt.createTypedArray(l2 + L2, B2);
|
|
5859
|
+
k2.set(t2.indices, 0);
|
|
5860
|
+
const D2 = 1e-4, U2 = (N2 - G2) * D2, j2 = (I2 - C2) * D2, F2 = -U2, V2 = U2, W2 = j2, H2 = -j2;
|
|
5861
|
+
let X2 = 6;
|
|
5862
|
+
a2 && (X2 += 3);
|
|
5863
|
+
let Y2 = 0;
|
|
5864
|
+
const Z2 = new Float32Array(l2 * X2 + d2 * X2);
|
|
5865
|
+
for (let t3 = 0, s3 = l2; t3 < s3; t3++) {
|
|
5866
|
+
if (a2) {
|
|
5867
|
+
const s4 = 2 * t3;
|
|
5868
|
+
Oe.x = e2[s4], Oe.y = e2[s4 + 1];
|
|
5869
|
+
}
|
|
5870
|
+
Y2 = self.encode(Z2, Y2, r2, P2[t3], E2[t3], b2[t3], Oe, a2);
|
|
5871
|
+
}
|
|
5872
|
+
let Q2 = t2.indices.length, K2 = P2.length, J2 = self.addSkirt(Z2, K2, k2, r2, Y2, E2, b2, z2, q2, Q2, F2, 0, m2, s2, i2, e2, a2);
|
|
5873
|
+
Q2 = J2.offset, Y2 = J2.bufferIndex, K2 += z2.length, J2 = self.addSkirt(Z2, K2, k2, r2, Y2, E2, b2, O2, q2, Q2, 0, H2, m2, s2, i2, e2, a2), Q2 = J2.offset, Y2 = J2.bufferIndex, K2 += O2.length, J2 = self.addSkirt(Z2, K2, k2, r2, Y2, E2, b2, T2, q2, Q2, V2, 0, m2, s2, i2, e2, a2), Q2 = J2.offset, Y2 = J2.bufferIndex, K2 += T2.length, self.addSkirt(Z2, K2, k2, r2, Y2, E2, b2, R2, q2, Q2, 0, W2, m2, s2, i2, e2, a2);
|
|
5874
|
+
const $2 = { vertices: Z2, bufferIndex: Y2, indexCountWithoutSkirts: t2.indices.length, indices: k2, westIndicesSouthToNorth: z2, southIndicesEastToWest: O2, eastIndicesNorthToSouth: T2, northIndicesWestToEast: R2, minimumHeight: g2, maximumHeight: M2 }, tt2 = [Z2.buffer, k2.buffer], st2 = t2.type;
|
|
5875
|
+
self.postMessage({ type: "terrainMeshCreated", tileKey: st2 + "-" + n2, content: $2 }, tt2);
|
|
5876
|
+
};
|
|
5877
|
+
const Qe = new u();
|
|
5878
|
+
function Ke(t2, s2, i2 = 255) {
|
|
5879
|
+
let e2 = t2 / i2 * 2 - 1, a2 = s2 / i2 * 2 - 1, n2 = 1 - Math.abs(e2) - Math.abs(a2);
|
|
5880
|
+
const r2 = Qe.set(e2, a2, n2);
|
|
5881
|
+
if (n2 < 0) {
|
|
5882
|
+
const t3 = e2, s3 = a2;
|
|
5883
|
+
r2.x = (1 - Math.abs(s3)) * (t3 >= 0 ? 1 : -1), r2.y = (1 - Math.abs(t3)) * (s3 >= 0 ? 1 : -1);
|
|
5884
|
+
}
|
|
5885
|
+
return r2;
|
|
5886
|
+
}
|
|
5887
|
+
self.encode = (t2, s2, i2, e2, a2, n2, r2, h2) => {
|
|
5888
|
+
const o2 = a2.x, c2 = a2.y;
|
|
5889
|
+
if (_t.subtract(e2, i2, ze), t2[s2++] = ze.x, t2[s2++] = ze.y, t2[s2++] = ze.z, t2[s2++] = n2, t2[s2++] = o2, t2[s2++] = c2, h2) {
|
|
5890
|
+
const i3 = Ke(r2.x, r2.y);
|
|
5891
|
+
t2[s2++] = i3.x, t2[s2++] = i3.y, t2[s2++] = i3.z;
|
|
5892
|
+
}
|
|
5893
|
+
return s2;
|
|
5894
|
+
};
|
|
5895
|
+
const Je = new u();
|
|
5896
|
+
function $e(t2, s2, i2, e2, a2, n2, r2, h2, o2) {
|
|
5756
5897
|
if (0 === r2.length)
|
|
5757
5898
|
return;
|
|
5758
5899
|
let c2 = 0, l2 = 0;
|
|
5759
5900
|
for (; l2 < r2.length; )
|
|
5760
|
-
l2 =
|
|
5761
|
-
for (let
|
|
5762
|
-
const
|
|
5763
|
-
if (
|
|
5764
|
-
|
|
5901
|
+
l2 = Re[c2++].initializeFromClipResult(r2, l2, h2);
|
|
5902
|
+
for (let a3 = 0; a3 < c2; ++a3) {
|
|
5903
|
+
const r3 = Re[a3];
|
|
5904
|
+
if (r3.isIndexed())
|
|
5905
|
+
r3.newIndex = n2[r3.index], r3.uBuffer = t2, r3.vBuffer = s2, r3.heightBuffer = i2, o2 && (r3.normalBuffer = e2);
|
|
5765
5906
|
else {
|
|
5766
|
-
const
|
|
5767
|
-
if (ht(n2[
|
|
5768
|
-
|
|
5907
|
+
const a4 = r3.getKey();
|
|
5908
|
+
if (ht(n2[a4]))
|
|
5909
|
+
r3.newIndex = n2[a4];
|
|
5769
5910
|
else {
|
|
5770
|
-
const
|
|
5771
|
-
t2.push(
|
|
5911
|
+
const h3 = t2.length;
|
|
5912
|
+
t2.push(r3.getU()), s2.push(r3.getV()), i2.push(r3.getH()), o2 && (e2.push(r3.getNormalX()), e2.push(r3.getNormalY())), r3.newIndex = h3, n2[a4] = h3;
|
|
5772
5913
|
}
|
|
5773
5914
|
}
|
|
5774
5915
|
}
|
|
5775
|
-
3 === c2 ? (a2.push(
|
|
5916
|
+
3 === c2 ? (a2.push(Re[0].newIndex), a2.push(Re[1].newIndex), a2.push(Re[2].newIndex)) : 4 === c2 && (a2.push(Re[0].newIndex), a2.push(Re[1].newIndex), a2.push(Re[2].newIndex), a2.push(Re[0].newIndex), a2.push(Re[2].newIndex), a2.push(Re[3].newIndex));
|
|
5776
5917
|
}
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
|
|
5783
|
-
let
|
|
5784
|
-
const
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
const
|
|
5796
|
-
|
|
5797
|
-
const _3 = ft.clipTriangleAtAxisAlignedThreshold(Ce, s2, n3, r3, o2, Ne);
|
|
5798
|
-
I2 = 0, I2 >= _3.length || (I2 = N2[0].initializeFromClipResult(_3, I2, C2), I2 >= _3.length || (I2 = N2[1].initializeFromClipResult(_3, I2, C2), I2 >= _3.length || (I2 = N2[2].initializeFromClipResult(_3, I2, C2), z2 = ft.clipTriangleAtAxisAlignedThreshold(Ce, i2, N2[0].getV(), N2[1].getV(), N2[2].getV(), Ie), je(h2, c2, l2, u2, d2, m2, z2, N2, false), I2 < _3.length && (N2[2].clone(N2[1]), N2[2].initializeFromClipResult(_3, I2, C2), z2 = ft.clipTriangleAtAxisAlignedThreshold(Ce, i2, N2[0].getV(), N2[1].getV(), N2[2].getV(), Ie), je(h2, c2, l2, u2, d2, m2, z2, N2, false)))));
|
|
5799
|
-
}
|
|
5800
|
-
const T2 = s2 ? -32767 : 0, O2 = i2 ? -32767 : 0, R2 = [], q2 = [], L2 = [], B2 = [];
|
|
5801
|
-
let k2 = Number.MAX_VALUE, D2 = -k2;
|
|
5802
|
-
const U2 = it.clone(t2.childRectangle);
|
|
5803
|
-
for (U2.east, U2.west, P2 = 0; P2 < h2.length; P2++)
|
|
5804
|
-
A2 = Math.round(h2[P2]), A2 <= e2 ? (R2.push(P2), A2 = 0) : A2 >= a2 ? (L2.push(P2), A2 = Ge) : A2 = 2 * A2 + T2, h2[P2] = A2, G2 = Math.round(c2[P2]), G2 <= n2 ? (q2.push(P2), G2 = 0) : G2 >= r2 ? (B2.push(P2), G2 = Ge) : G2 = 2 * G2 + O2, c2[P2] = G2, b2 = o.lerp(M2, g2, l2[P2] / Ge), k2 = Math.min(k2, b2), D2 = Math.max(D2, b2), l2[P2] = b2;
|
|
5805
|
-
const j2 = D2 - k2, F2 = new Uint16Array(h2.length + c2.length + l2.length);
|
|
5806
|
-
for (P2 = 0; P2 < h2.length; ++P2)
|
|
5807
|
-
F2[P2] = h2[P2];
|
|
5808
|
-
let V2 = h2.length;
|
|
5809
|
-
for (P2 = 0; P2 < c2.length; ++P2)
|
|
5810
|
-
F2[V2 + P2] = c2[P2];
|
|
5811
|
-
for (V2 += c2.length, P2 = 0; P2 < l2.length; ++P2) {
|
|
5812
|
-
const t3 = Ge * (l2[P2] - k2) / j2;
|
|
5813
|
-
F2[V2 + P2] = t3;
|
|
5814
|
-
}
|
|
5815
|
-
const W2 = pt.createTypedArray(h2.length, d2), H2 = { vertices: F2.buffer, indices: W2.buffer, minimumHeight: k2, maximumHeight: D2, westIndices: R2, southIndices: q2, eastIndices: L2, northIndices: B2 }, Z2 = [F2.buffer, W2.buffer], Q2 = t2.type;
|
|
5816
|
-
self.postMessage({ type: "terrainDataUpsampled", tileKey: Q2 + "-" + t2.tileKey, content: H2 }, Z2);
|
|
5817
|
-
}, self.decodeTextureCoordinates = (t2, s2, i2) => (i2 || (i2 = new c()), s2 *= 6, i2.x = t2[s2 + 4], i2.y = t2[s2 + 5], i2), self.decodeHeight = (t2, s2) => t2[(s2 *= 6) + 3], self.createVerticesFromQuantizedTerrainMesh = (t2) => {
|
|
5818
|
-
const s2 = Pe(t2.sourceProjectionName), i2 = Pe(t2.targetProjectionName), e2 = t2.tileKey, a2 = t2.tileCenter, n2 = t2.quantizedVertices, r2 = n2.length / 3, h2 = t2.westIndices.length + t2.eastIndices.length + t2.southIndices.length + t2.northIndices.length, l2 = it.clone(t2.rectangle), u2 = l2.west, d2 = l2.south, m2 = l2.east, f2 = l2.north, y2 = t2.minimumHeight, p2 = t2.maximumHeight, M2 = n2.subarray(0, r2), g2 = n2.subarray(r2, 2 * r2), x2 = n2.subarray(2 * r2, 3 * r2), w2 = new Array(r2), S2 = new Array(r2), E2 = new Array(r2), b2 = Be;
|
|
5819
|
-
b2.x = Number.POSITIVE_INFINITY, b2.y = Number.POSITIVE_INFINITY, b2.z = Number.POSITIVE_INFINITY;
|
|
5820
|
-
const P2 = ke;
|
|
5821
|
-
P2.x = Number.NEGATIVE_INFINITY, P2.y = Number.NEGATIVE_INFINITY, P2.z = Number.NEGATIVE_INFINITY;
|
|
5822
|
-
let v2 = Number.POSITIVE_INFINITY, A2 = Number.NEGATIVE_INFINITY, G2 = Number.POSITIVE_INFINITY, C2 = Number.NEGATIVE_INFINITY;
|
|
5823
|
-
for (let t3 = 0; t3 < r2; t3++) {
|
|
5824
|
-
const s3 = M2[t3], e3 = g2[t3], a3 = s3 / Ge, n3 = e3 / Ge, r3 = o.lerp(y2, p2, x2[t3] / Ge);
|
|
5825
|
-
De.x = o.lerp(u2, m2, a3), De.y = o.lerp(d2, f2, n3), De.z = r3, v2 = Math.min(De.x, v2), A2 = Math.max(De.x, A2), G2 = Math.min(De.y, G2), C2 = Math.max(De.y, C2), De.x = o.radToDeg(De.x), De.y = o.radToDeg(De.y);
|
|
5826
|
-
let h3 = i2.projectCoordinate(De, new _());
|
|
5827
|
-
w2[t3] = new c(a3, n3), S2[t3] = r3, E2[t3] = h3;
|
|
5828
|
-
}
|
|
5829
|
-
const N2 = t2.westIndices.slice().sort((t3, s3) => w2[t3].y - w2[s3].y), I2 = t2.eastIndices.slice().sort((t3, s3) => w2[s3].y - w2[t3].y), z2 = t2.southIndices.slice().sort((t3, s3) => w2[s3].x - w2[t3].x), T2 = t2.northIndices.slice().sort((t3, s3) => w2[t3].x - w2[s3].x), O2 = 637e4 / (2 << t2.level) / 2, R2 = Math.max(0, 2 * (h2 - 4)), q2 = t2.indices.length + 3 * R2, L2 = pt.createTypedArray(r2 + R2, q2);
|
|
5830
|
-
L2.set(t2.indices, 0);
|
|
5831
|
-
const B2 = 1e-4, k2 = (A2 - v2) * B2, D2 = (C2 - G2) * B2, U2 = -k2, j2 = k2, F2 = D2, V2 = -D2;
|
|
5832
|
-
let W2 = 0;
|
|
5833
|
-
const H2 = new Float32Array(6 * r2 + 6 * h2);
|
|
5834
|
-
for (let t3 = 0, s3 = r2; t3 < s3; t3++)
|
|
5835
|
-
W2 = self.encode(H2, W2, a2, E2[t3], w2[t3], S2[t3]);
|
|
5836
|
-
let Z2 = t2.indices.length, Q2 = E2.length, X2 = self.addSkirt(H2, Q2, L2, a2, W2, w2, S2, N2, O2, Z2, U2, 0, l2, s2, i2);
|
|
5837
|
-
Z2 = X2.offset, W2 = X2.bufferIndex, Q2 += N2.length, X2 = self.addSkirt(H2, Q2, L2, a2, W2, w2, S2, z2, O2, Z2, 0, V2, l2, s2, i2), Z2 = X2.offset, W2 = X2.bufferIndex, Q2 += z2.length, X2 = self.addSkirt(H2, Q2, L2, a2, W2, w2, S2, I2, O2, Z2, j2, 0, l2, s2, i2), Z2 = X2.offset, W2 = X2.bufferIndex, Q2 += I2.length, self.addSkirt(H2, Q2, L2, a2, W2, w2, S2, T2, O2, Z2, 0, F2, l2, s2, i2);
|
|
5838
|
-
const Y2 = { vertices: H2, bufferIndex: W2, indexCountWithoutSkirts: t2.indices.length, indices: L2, westIndicesSouthToNorth: N2, southIndicesEastToWest: z2, eastIndicesNorthToSouth: I2, northIndicesWestToEast: T2, minimumHeight: y2, maximumHeight: p2 }, K2 = [H2.buffer, L2.buffer], J2 = t2.type;
|
|
5839
|
-
self.postMessage({ type: "terrainMeshCreated", tileKey: J2 + "-" + e2, content: Y2 }, K2);
|
|
5840
|
-
}, self.encode = (t2, s2, i2, e2, a2, n2) => {
|
|
5841
|
-
const r2 = a2.x, h2 = a2.y;
|
|
5842
|
-
return _t.subtract(e2, i2, Ue), t2[s2++] = Ue.x, t2[s2++] = Ue.y, t2[s2++] = Ue.z, t2[s2++] = n2, t2[s2++] = r2, t2[s2++] = h2, s2;
|
|
5843
|
-
}, self.addSkirt = (t2, s2, i2, e2, a2, n2, r2, h2, c2, l2, u2, d2, m2, _2, f2) => {
|
|
5844
|
-
const y2 = m2.north, p2 = m2.south;
|
|
5845
|
-
let M2 = m2.east;
|
|
5846
|
-
const g2 = m2.west;
|
|
5847
|
-
M2 < g2 && (M2 += st.TWO_PI);
|
|
5848
|
-
const x2 = h2.length;
|
|
5849
|
-
let w2 = h2[0];
|
|
5850
|
-
for (let m3 = 0; m3 < x2; m3++) {
|
|
5851
|
-
const _3 = h2[m3], x3 = r2[_3], S2 = n2[_3];
|
|
5852
|
-
De.x = o.radToDeg(o.lerp(g2, M2, S2.x) + u2), De.y = o.radToDeg(o.lerp(p2, y2, S2.y) + d2), De.z = x3 - 2 * c2;
|
|
5853
|
-
const E2 = f2.projectCoordinate(De, Ue);
|
|
5854
|
-
if (a2 = self.encode(t2, a2, e2, E2, S2, De.z), 0 === m3)
|
|
5918
|
+
self.getOctEncodedNormal = (t2, s2, i2, e2, a2) => {
|
|
5919
|
+
ht(a2) || (a2 = new c());
|
|
5920
|
+
const n2 = s2 * i2 + e2, r2 = t2[n2], h2 = t2[n2 + 1], o2 = t2[n2 + 2];
|
|
5921
|
+
return Ae(Je.set(r2, h2, o2).normalize(), 255, a2);
|
|
5922
|
+
}, self.addSkirt = (t2, s2, i2, e2, a2, n2, r2, h2, c2, l2, u2, d2, m2, _2, f2, y2, p2) => {
|
|
5923
|
+
const g2 = m2.north, M2 = m2.south;
|
|
5924
|
+
let x2 = m2.east;
|
|
5925
|
+
const w2 = m2.west;
|
|
5926
|
+
x2 < w2 && (x2 += st.TWO_PI);
|
|
5927
|
+
const S2 = h2.length;
|
|
5928
|
+
let E2 = h2[0];
|
|
5929
|
+
for (let m3 = 0; m3 < S2; m3++) {
|
|
5930
|
+
const _3 = h2[m3], S3 = r2[_3], b2 = n2[_3];
|
|
5931
|
+
if (p2) {
|
|
5932
|
+
const t3 = 2 * _3;
|
|
5933
|
+
Oe.x = y2[t3], Oe.y = y2[t3 + 1];
|
|
5934
|
+
}
|
|
5935
|
+
Ye.x = o.radToDeg(o.lerp(w2, x2, b2.x) + u2), Ye.y = o.radToDeg(o.lerp(M2, g2, b2.y) + d2), Ye.z = S3 - 2 * c2;
|
|
5936
|
+
const P2 = f2.projectCoordinate(Ye, ze);
|
|
5937
|
+
if (a2 = self.encode(t2, a2, e2, P2, b2, Ye.z, Oe, p2), 0 === m3)
|
|
5855
5938
|
continue;
|
|
5856
|
-
const
|
|
5857
|
-
i2[l2++] =
|
|
5939
|
+
const v2 = E2, A2 = s2 + m3 - 1, G2 = _3, N2 = s2 + m3;
|
|
5940
|
+
i2[l2++] = v2, i2[l2++] = G2, i2[l2++] = A2, i2[l2++] = A2, i2[l2++] = G2, i2[l2++] = N2, E2 = _3;
|
|
5858
5941
|
}
|
|
5859
5942
|
return { offset: l2, bufferIndex: a2 };
|
|
5860
5943
|
};
|