deeptwins-cesium-engine 0.1.2 → 0.1.4
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/Build/Workers/chunk-2HWLF3FT.js +837 -0
- package/Build/Workers/chunk-2KXMJ5XS.js +3792 -0
- package/Build/Workers/chunk-2NPCLB3H.js +56 -0
- package/Build/Workers/chunk-2ZHQTIBH.js +1483 -0
- package/Build/Workers/chunk-3GLYOW63.js +352 -0
- package/Build/Workers/chunk-3L22KMPU.js +219 -0
- package/Build/Workers/chunk-3Q6V2B2I.js +73 -0
- package/Build/Workers/chunk-3QOKKRIG.js +387 -0
- package/Build/Workers/chunk-44YZFGRH.js +1800 -0
- package/Build/Workers/chunk-45VV4SBO.js +2342 -0
- package/Build/Workers/chunk-4EJ4AA2S.js +368 -0
- package/Build/Workers/chunk-4IJFHUL6.js +414 -0
- package/Build/Workers/chunk-4K3V5CGW.js +454 -0
- package/Build/Workers/chunk-4M4QL6KJ.js +305 -0
- package/Build/Workers/chunk-4YNRIEQ6.js +288 -0
- package/Build/Workers/chunk-56CVDPH5.js +352 -0
- package/Build/Workers/chunk-5CTAAPXH.js +1483 -0
- package/Build/Workers/chunk-5ISZ6NJD.js +102 -0
- package/Build/Workers/chunk-5SDHYIOS.js +56 -0
- package/Build/Workers/chunk-66TGUMCU.js +2719 -0
- package/Build/Workers/chunk-6EJMTDQJ.js +163 -0
- package/Build/Workers/chunk-6VWXYSMH.js +959 -0
- package/Build/Workers/chunk-6VZ7VB2Q.js +241 -0
- package/Build/Workers/chunk-7AMRE57Q.js +301 -0
- package/Build/Workers/chunk-7DH6C33H.js +398 -0
- package/Build/Workers/chunk-7VUS3FVE.js +38 -0
- package/Build/Workers/chunk-7Y3ZA6H3.js +198 -0
- package/Build/Workers/chunk-A6BMHZNA.js +38 -0
- package/Build/Workers/chunk-A7XY2MN7.js +171 -0
- package/Build/Workers/chunk-AC7ND63S.js +57 -0
- package/Build/Workers/chunk-AHCZ757M.js +9230 -0
- package/Build/Workers/chunk-ANOA7E7F.js +56 -0
- package/Build/Workers/chunk-AYO5HHV6.js +789 -0
- package/Build/Workers/chunk-BE2N56VZ.js +1344 -0
- package/Build/Workers/chunk-BR3BPM64.js +9230 -0
- package/Build/Workers/chunk-BVMRWGOK.js +455 -0
- package/Build/Workers/chunk-BXEL2NX7.js +455 -0
- package/Build/Workers/chunk-C5BO2JCG.js +278 -0
- package/Build/Workers/chunk-CIRQNZVR.js +301 -0
- package/Build/Workers/chunk-CM67CQME.js +305 -0
- package/Build/Workers/chunk-D3QIW4DH.js +630 -0
- package/Build/Workers/chunk-E5W7QIGZ.js +511 -0
- package/Build/Workers/chunk-E6CYGUJI.js +1054 -0
- package/Build/Workers/chunk-EIZ23IOX.js +414 -0
- package/Build/Workers/chunk-EIZJUMQY.js +101 -0
- package/Build/Workers/chunk-EXTMZJXB.js +82 -0
- package/Build/Workers/chunk-EYOOSIBW.js +682 -0
- package/Build/Workers/chunk-F37WADVC.js +1054 -0
- package/Build/Workers/chunk-FIWPJFHX.js +101 -0
- package/Build/Workers/chunk-FM32TNGT.js +198 -0
- package/Build/Workers/chunk-FOMYIEIB.js +476 -0
- package/Build/Workers/chunk-FWYDLSVQ.js +97 -0
- package/Build/Workers/chunk-HGZR6CZF.js +1067 -0
- package/Build/Workers/chunk-HIXHDABG.js +288 -0
- package/Build/Workers/chunk-HMCCZZWE.js +97 -0
- package/Build/Workers/chunk-HW54WHGM.js +2719 -0
- package/Build/Workers/chunk-IHYAI7GF.js +973 -0
- package/Build/Workers/chunk-INLQ7LVK.js +837 -0
- package/Build/Workers/chunk-IQMESTCB.js +124 -0
- package/Build/Workers/chunk-J4PISUNT.js +2342 -0
- package/Build/Workers/chunk-JSWU557I.js +693 -0
- package/Build/Workers/chunk-KHONDSQ7.js +693 -0
- package/Build/Workers/chunk-KLUL2SOE.js +352 -0
- package/Build/Workers/chunk-KMBLKQCC.js +1992 -0
- package/Build/Workers/chunk-KOTWWQN7.js +171 -0
- package/Build/Workers/chunk-KWV6ZTF4.js +163 -0
- package/Build/Workers/chunk-LSEFPQHG.js +476 -0
- package/Build/Workers/chunk-M66X4O24.js +44 -0
- package/Build/Workers/chunk-M6IXKBC7.js +1992 -0
- package/Build/Workers/chunk-MFUC3D5C.js +162 -0
- package/Build/Workers/chunk-MRMNELAH.js +82 -0
- package/Build/Workers/chunk-N3NUA5H2.js +3792 -0
- package/Build/Workers/chunk-NFB2NXJN.js +138 -0
- package/Build/Workers/chunk-NQAXBK4K.js +789 -0
- package/Build/Workers/chunk-NUGQWV6S.js +352 -0
- package/Build/Workers/chunk-O7S7WL7K.js +278 -0
- package/Build/Workers/chunk-ODZYB26X.js +1287 -0
- package/Build/Workers/chunk-OEHJY463.js +3201 -0
- package/Build/Workers/chunk-OMMRNMXF.js +44 -0
- package/Build/Workers/chunk-OZ3CQDO3.js +138 -0
- package/Build/Workers/chunk-PNXBG64I.js +219 -0
- package/Build/Workers/chunk-PYR35GK4.js +973 -0
- package/Build/Workers/chunk-Q4CXGW74.js +57 -0
- package/Build/Workers/chunk-QGISLKCW.js +147 -0
- package/Build/Workers/chunk-QQHVOJW6.js +497 -0
- package/Build/Workers/chunk-QWCMMRJW.js +58 -0
- package/Build/Workers/chunk-RDEZCHF4.js +398 -0
- package/Build/Workers/chunk-SJTE7FVN.js +778 -0
- package/Build/Workers/chunk-SM5T67LR.js +162 -0
- package/Build/Workers/chunk-T27NNXEU.js +58 -0
- package/Build/Workers/chunk-T4J5BWUO.js +511 -0
- package/Build/Workers/chunk-T6JS4BRN.js +140 -0
- package/Build/Workers/chunk-UH6DUQBW.js +140 -0
- package/Build/Workers/chunk-UJAH6XKF.js +73 -0
- package/Build/Workers/chunk-UKSTJ2PH.js +454 -0
- package/Build/Workers/chunk-UQCDCCZ7.js +368 -0
- package/Build/Workers/chunk-UXIFNEA3.js +1287 -0
- package/Build/Workers/chunk-UXJ6J5L7.js +56 -0
- package/Build/Workers/chunk-V4VUAZXI.js +1800 -0
- package/Build/Workers/chunk-VQH2YXO2.js +497 -0
- package/Build/Workers/chunk-VXKCLSE4.js +241 -0
- package/Build/Workers/chunk-W3U6YBEI.js +280 -0
- package/Build/Workers/chunk-W75ZVFKP.js +778 -0
- package/Build/Workers/chunk-WCDFJYFB.js +1344 -0
- package/Build/Workers/chunk-WME5M6W3.js +630 -0
- package/Build/Workers/chunk-XDQBQB64.js +1067 -0
- package/Build/Workers/chunk-Y6HOIWE5.js +959 -0
- package/Build/Workers/chunk-YEMC2ZOR.js +147 -0
- package/Build/Workers/chunk-YWNF3TPE.js +682 -0
- package/Build/Workers/chunk-Z55VGWJP.js +280 -0
- package/Build/Workers/chunk-Z5YWP24C.js +124 -0
- package/Build/Workers/chunk-ZHXCWUJB.js +387 -0
- package/Build/Workers/chunk-ZIMPUF2I.js +102 -0
- package/Build/Workers/chunk-ZKDWYQKC.js +3201 -0
- package/Build/Workers/combineGeometry.js +24 -22
- package/Build/Workers/createBoxGeometry.js +18 -16
- package/Build/Workers/createBoxOutlineGeometry.js +23 -25
- package/Build/Workers/createCircleGeometry.js +29 -27
- package/Build/Workers/createCircleOutlineGeometry.js +22 -20
- package/Build/Workers/createCoplanarPolygonGeometry.js +43 -43
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +37 -35
- package/Build/Workers/createCorridorGeometry.js +46 -49
- package/Build/Workers/createCorridorOutlineGeometry.js +40 -43
- package/Build/Workers/createCylinderGeometry.js +20 -18
- package/Build/Workers/createCylinderOutlineGeometry.js +27 -25
- package/Build/Workers/createEllipseGeometry.js +28 -25
- package/Build/Workers/createEllipseOutlineGeometry.js +21 -18
- package/Build/Workers/createEllipsoidGeometry.js +19 -17
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -16
- package/Build/Workers/createFrustumGeometry.js +18 -16
- package/Build/Workers/createFrustumOutlineGeometry.js +21 -21
- package/Build/Workers/createGeometry.js +31 -26
- package/Build/Workers/createGroundPolylineGeometry.js +188 -135
- package/Build/Workers/createPlaneGeometry.js +22 -21
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -13
- package/Build/Workers/createPolygonGeometry.js +51 -52
- package/Build/Workers/createPolygonOutlineGeometry.js +43 -44
- package/Build/Workers/createPolylineGeometry.js +37 -40
- package/Build/Workers/createPolylineVolumeGeometry.js +41 -44
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +36 -39
- package/Build/Workers/createRectangleGeometry.js +47 -53
- package/Build/Workers/createRectangleOutlineGeometry.js +32 -33
- package/Build/Workers/createSimplePolylineGeometry.js +33 -34
- package/Build/Workers/createSphereGeometry.js +20 -20
- package/Build/Workers/createSphereOutlineGeometry.js +19 -19
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +16 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -22
- package/Build/Workers/createVectorTilePoints.js +15 -13
- package/Build/Workers/createVectorTilePolygons.js +24 -21
- package/Build/Workers/createVectorTilePolylines.js +16 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +29 -27
- package/Build/Workers/createVerticesFromHeightmap.js +42 -63
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -280
- package/Build/Workers/createWallGeometry.js +35 -36
- package/Build/Workers/createWallOutlineGeometry.js +33 -34
- package/Build/Workers/decodeDraco.js +10 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +16 -20
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +20 -12
- package/Build/Workers/transcodeKTX2.js +42 -14
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -21
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Shaders/BillboardCollectionFS.js +85 -81
- package/Source/Shaders/BillboardCollectionVS.js +60 -118
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.js +12 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +11 -0
- package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +12 -0
- package/Source/Shaders/Builtin/Functions/columbusViewMorph.js +8 -1
- package/Source/Shaders/Builtin/Functions/computeTextureTransform.js +25 -0
- package/Source/Shaders/Builtin/Functions/decodeRGB8.js +24 -0
- package/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.js +2 -1
- package/Source/Shaders/Builtin/Functions/unpackTexture.js +37 -0
- package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js +0 -1
- package/Source/Shaders/EllipsoidVS.js +4 -4
- package/Source/Shaders/FXAA3_11.js +2 -0
- package/Source/Shaders/GlobeFS.js +22 -0
- package/Source/Shaders/GlobeVS.js +3 -2
- package/Source/Shaders/Model/MaterialStageFS.js +50 -20
- package/Source/Shaders/Model/MetadataStageFS.js +2 -1
- package/Source/Shaders/Model/MetadataStageVS.js +2 -1
- package/Source/Shaders/Model/ModelFS.js +32 -2
- package/Source/Shaders/Model/ModelVS.js +15 -1
- package/Source/Shaders/Model/PointCloudStylingStageVS.js +2 -1
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +0 -1
- package/Source/Shaders/PointPrimitiveCollectionVS.js +8 -39
- package/Source/Shaders/PolygonSignedDistanceFS.js +64 -33
- package/Source/Shaders/PolylineCommon.js +1 -1
- package/Source/Shaders/ShadowVolumeAppearanceFS.js +7 -15
- package/Source/Shaders/SkyAtmosphereVS.js +2 -1
- package/Source/Shaders/Voxels/IntersectBox.js +20 -33
- package/Source/Shaders/Voxels/IntersectCylinder.js +28 -32
- package/Source/Shaders/Voxels/IntersectDepth.js +10 -6
- package/Source/Shaders/Voxels/IntersectEllipsoid.js +12 -20
- package/Source/Shaders/Voxels/IntersectLongitude.js +21 -9
- package/Source/Shaders/Voxels/Intersection.js +3 -5
- package/Source/Shaders/Voxels/IntersectionUtils.js +2 -1
- package/Source/Shaders/Voxels/Megatexture.js +15 -83
- package/Source/Shaders/Voxels/Octree.js +53 -61
- package/Source/Shaders/Voxels/VoxelFS.js +67 -52
- package/Source/Shaders/Voxels/VoxelUtils.js +0 -19
- package/index.js +346 -261
- package/package.json +1 -1
- package/Source/Shaders/Voxels/IntersectClippingPlanes.js +0 -80
- package/Source/Shaders/Voxels/convertUvToBox.js +0 -46
- package/Source/Shaders/Voxels/convertUvToCylinder.js +0 -101
- package/Source/Shaders/Voxels/convertUvToEllipsoid.js +0 -141
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 0.1.3
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2011-2022 Cesium Contributors
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*
|
|
20
|
+
* Columbus View (Pat. Pend.)
|
|
21
|
+
*
|
|
22
|
+
* Portions licensed separately.
|
|
23
|
+
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
GeographicProjection_default
|
|
28
|
+
} from "./chunk-UXIFNEA3.js";
|
|
29
|
+
import {
|
|
30
|
+
Matrix2_default,
|
|
31
|
+
Rectangle_default
|
|
32
|
+
} from "./chunk-AHCZ757M.js";
|
|
33
|
+
import {
|
|
34
|
+
Cartographic_default,
|
|
35
|
+
Ellipsoid_default
|
|
36
|
+
} from "./chunk-KMBLKQCC.js";
|
|
37
|
+
import {
|
|
38
|
+
Cartesian3_default
|
|
39
|
+
} from "./chunk-45VV4SBO.js";
|
|
40
|
+
import {
|
|
41
|
+
Math_default
|
|
42
|
+
} from "./chunk-QQHVOJW6.js";
|
|
43
|
+
import {
|
|
44
|
+
DeveloperError_default
|
|
45
|
+
} from "./chunk-6EJMTDQJ.js";
|
|
46
|
+
import {
|
|
47
|
+
defined_default
|
|
48
|
+
} from "./chunk-EXTMZJXB.js";
|
|
49
|
+
|
|
50
|
+
// packages/engine/Source/Core/RectangleGeometryLibrary.js
|
|
51
|
+
var cos = Math.cos;
|
|
52
|
+
var sin = Math.sin;
|
|
53
|
+
var sqrt = Math.sqrt;
|
|
54
|
+
var RectangleGeometryLibrary = {};
|
|
55
|
+
RectangleGeometryLibrary.computePosition = function(computedOptions, ellipsoid, computeST, row, col, position, st) {
|
|
56
|
+
const radiiSquared = ellipsoid.radiiSquared;
|
|
57
|
+
const nwCorner = computedOptions.nwCorner;
|
|
58
|
+
const rectangle = computedOptions.boundingRectangle;
|
|
59
|
+
let stLatitude = nwCorner.latitude - computedOptions.granYCos * row + col * computedOptions.granXSin;
|
|
60
|
+
const cosLatitude = cos(stLatitude);
|
|
61
|
+
const nZ = sin(stLatitude);
|
|
62
|
+
const kZ = radiiSquared.z * nZ;
|
|
63
|
+
let stLongitude = nwCorner.longitude + row * computedOptions.granYSin + col * computedOptions.granXCos;
|
|
64
|
+
const nX = cosLatitude * cos(stLongitude);
|
|
65
|
+
const nY = cosLatitude * sin(stLongitude);
|
|
66
|
+
const kX = radiiSquared.x * nX;
|
|
67
|
+
const kY = radiiSquared.y * nY;
|
|
68
|
+
const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);
|
|
69
|
+
position.x = kX / gamma;
|
|
70
|
+
position.y = kY / gamma;
|
|
71
|
+
position.z = kZ / gamma;
|
|
72
|
+
if (computeST) {
|
|
73
|
+
const stNwCorner = computedOptions.stNwCorner;
|
|
74
|
+
if (defined_default(stNwCorner)) {
|
|
75
|
+
stLatitude = stNwCorner.latitude - computedOptions.stGranYCos * row + col * computedOptions.stGranXSin;
|
|
76
|
+
stLongitude = stNwCorner.longitude + row * computedOptions.stGranYSin + col * computedOptions.stGranXCos;
|
|
77
|
+
st.x = (stLongitude - computedOptions.stWest) * computedOptions.lonScalar;
|
|
78
|
+
st.y = (stLatitude - computedOptions.stSouth) * computedOptions.latScalar;
|
|
79
|
+
} else {
|
|
80
|
+
st.x = (stLongitude - rectangle.west) * computedOptions.lonScalar;
|
|
81
|
+
st.y = (stLatitude - rectangle.south) * computedOptions.latScalar;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
var rotationMatrixScratch = new Matrix2_default();
|
|
86
|
+
var nwCartesian = new Cartesian3_default();
|
|
87
|
+
var centerScratch = new Cartographic_default();
|
|
88
|
+
var centerCartesian = new Cartesian3_default();
|
|
89
|
+
var proj = new GeographicProjection_default();
|
|
90
|
+
function getRotationOptions(nwCorner, rotation, granularityX, granularityY, center, width, height) {
|
|
91
|
+
const cosRotation = Math.cos(rotation);
|
|
92
|
+
const granYCos = granularityY * cosRotation;
|
|
93
|
+
const granXCos = granularityX * cosRotation;
|
|
94
|
+
const sinRotation = Math.sin(rotation);
|
|
95
|
+
const granYSin = granularityY * sinRotation;
|
|
96
|
+
const granXSin = granularityX * sinRotation;
|
|
97
|
+
proj._ellipsoid = Ellipsoid_default.default;
|
|
98
|
+
nwCartesian = proj.project(nwCorner, nwCartesian);
|
|
99
|
+
nwCartesian = Cartesian3_default.subtract(nwCartesian, centerCartesian, nwCartesian);
|
|
100
|
+
const rotationMatrix = Matrix2_default.fromRotation(rotation, rotationMatrixScratch);
|
|
101
|
+
nwCartesian = Matrix2_default.multiplyByVector(
|
|
102
|
+
rotationMatrix,
|
|
103
|
+
nwCartesian,
|
|
104
|
+
nwCartesian
|
|
105
|
+
);
|
|
106
|
+
nwCartesian = Cartesian3_default.add(nwCartesian, centerCartesian, nwCartesian);
|
|
107
|
+
nwCorner = proj.unproject(nwCartesian, nwCorner);
|
|
108
|
+
width -= 1;
|
|
109
|
+
height -= 1;
|
|
110
|
+
const latitude = nwCorner.latitude;
|
|
111
|
+
const latitude0 = latitude + width * granXSin;
|
|
112
|
+
const latitude1 = latitude - granYCos * height;
|
|
113
|
+
const latitude2 = latitude - granYCos * height + width * granXSin;
|
|
114
|
+
const north = Math.max(latitude, latitude0, latitude1, latitude2);
|
|
115
|
+
const south = Math.min(latitude, latitude0, latitude1, latitude2);
|
|
116
|
+
const longitude = nwCorner.longitude;
|
|
117
|
+
const longitude0 = longitude + width * granXCos;
|
|
118
|
+
const longitude1 = longitude + height * granYSin;
|
|
119
|
+
const longitude2 = longitude + height * granYSin + width * granXCos;
|
|
120
|
+
const east = Math.max(longitude, longitude0, longitude1, longitude2);
|
|
121
|
+
const west = Math.min(longitude, longitude0, longitude1, longitude2);
|
|
122
|
+
return {
|
|
123
|
+
north,
|
|
124
|
+
south,
|
|
125
|
+
east,
|
|
126
|
+
west,
|
|
127
|
+
granYCos,
|
|
128
|
+
granYSin,
|
|
129
|
+
granXCos,
|
|
130
|
+
granXSin,
|
|
131
|
+
nwCorner
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
RectangleGeometryLibrary.computeOptions = function(rectangle, granularity, rotation, stRotation, boundingRectangleScratch, nwCornerResult, stNwCornerResult) {
|
|
135
|
+
let east = rectangle.east;
|
|
136
|
+
let west = rectangle.west;
|
|
137
|
+
let north = rectangle.north;
|
|
138
|
+
let south = rectangle.south;
|
|
139
|
+
let northCap = false;
|
|
140
|
+
let southCap = false;
|
|
141
|
+
if (north === Math_default.PI_OVER_TWO) {
|
|
142
|
+
northCap = true;
|
|
143
|
+
}
|
|
144
|
+
if (south === -Math_default.PI_OVER_TWO) {
|
|
145
|
+
southCap = true;
|
|
146
|
+
}
|
|
147
|
+
let dx;
|
|
148
|
+
const dy = north - south;
|
|
149
|
+
if (west > east) {
|
|
150
|
+
dx = Math_default.TWO_PI - west + east;
|
|
151
|
+
} else {
|
|
152
|
+
dx = east - west;
|
|
153
|
+
}
|
|
154
|
+
const width = Math.ceil(dx / granularity) + 1;
|
|
155
|
+
const height = Math.ceil(dy / granularity) + 1;
|
|
156
|
+
const granularityX = dx / (width - 1);
|
|
157
|
+
const granularityY = dy / (height - 1);
|
|
158
|
+
const nwCorner = Rectangle_default.northwest(rectangle, nwCornerResult);
|
|
159
|
+
const center = Rectangle_default.center(rectangle, centerScratch);
|
|
160
|
+
if (rotation !== 0 || stRotation !== 0) {
|
|
161
|
+
if (center.longitude < nwCorner.longitude) {
|
|
162
|
+
center.longitude += Math_default.TWO_PI;
|
|
163
|
+
}
|
|
164
|
+
proj._ellipsoid = Ellipsoid_default.default;
|
|
165
|
+
centerCartesian = proj.project(center, centerCartesian);
|
|
166
|
+
}
|
|
167
|
+
const granYCos = granularityY;
|
|
168
|
+
const granXCos = granularityX;
|
|
169
|
+
const granYSin = 0;
|
|
170
|
+
const granXSin = 0;
|
|
171
|
+
const boundingRectangle = Rectangle_default.clone(
|
|
172
|
+
rectangle,
|
|
173
|
+
boundingRectangleScratch
|
|
174
|
+
);
|
|
175
|
+
const computedOptions = {
|
|
176
|
+
granYCos,
|
|
177
|
+
granYSin,
|
|
178
|
+
granXCos,
|
|
179
|
+
granXSin,
|
|
180
|
+
nwCorner,
|
|
181
|
+
boundingRectangle,
|
|
182
|
+
width,
|
|
183
|
+
height,
|
|
184
|
+
northCap,
|
|
185
|
+
southCap
|
|
186
|
+
};
|
|
187
|
+
if (rotation !== 0) {
|
|
188
|
+
const rotationOptions = getRotationOptions(
|
|
189
|
+
nwCorner,
|
|
190
|
+
rotation,
|
|
191
|
+
granularityX,
|
|
192
|
+
granularityY,
|
|
193
|
+
center,
|
|
194
|
+
width,
|
|
195
|
+
height
|
|
196
|
+
);
|
|
197
|
+
north = rotationOptions.north;
|
|
198
|
+
south = rotationOptions.south;
|
|
199
|
+
east = rotationOptions.east;
|
|
200
|
+
west = rotationOptions.west;
|
|
201
|
+
if (north < -Math_default.PI_OVER_TWO || north > Math_default.PI_OVER_TWO || south < -Math_default.PI_OVER_TWO || south > Math_default.PI_OVER_TWO) {
|
|
202
|
+
throw new DeveloperError_default(
|
|
203
|
+
"Rotated rectangle is invalid. It crosses over either the north or south pole."
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
computedOptions.granYCos = rotationOptions.granYCos;
|
|
207
|
+
computedOptions.granYSin = rotationOptions.granYSin;
|
|
208
|
+
computedOptions.granXCos = rotationOptions.granXCos;
|
|
209
|
+
computedOptions.granXSin = rotationOptions.granXSin;
|
|
210
|
+
boundingRectangle.north = north;
|
|
211
|
+
boundingRectangle.south = south;
|
|
212
|
+
boundingRectangle.east = east;
|
|
213
|
+
boundingRectangle.west = west;
|
|
214
|
+
}
|
|
215
|
+
if (stRotation !== 0) {
|
|
216
|
+
rotation = rotation - stRotation;
|
|
217
|
+
const stNwCorner = Rectangle_default.northwest(boundingRectangle, stNwCornerResult);
|
|
218
|
+
const stRotationOptions = getRotationOptions(
|
|
219
|
+
stNwCorner,
|
|
220
|
+
rotation,
|
|
221
|
+
granularityX,
|
|
222
|
+
granularityY,
|
|
223
|
+
center,
|
|
224
|
+
width,
|
|
225
|
+
height
|
|
226
|
+
);
|
|
227
|
+
computedOptions.stGranYCos = stRotationOptions.granYCos;
|
|
228
|
+
computedOptions.stGranXCos = stRotationOptions.granXCos;
|
|
229
|
+
computedOptions.stGranYSin = stRotationOptions.granYSin;
|
|
230
|
+
computedOptions.stGranXSin = stRotationOptions.granXSin;
|
|
231
|
+
computedOptions.stNwCorner = stNwCorner;
|
|
232
|
+
computedOptions.stWest = stRotationOptions.west;
|
|
233
|
+
computedOptions.stSouth = stRotationOptions.south;
|
|
234
|
+
}
|
|
235
|
+
return computedOptions;
|
|
236
|
+
};
|
|
237
|
+
var RectangleGeometryLibrary_default = RectangleGeometryLibrary;
|
|
238
|
+
|
|
239
|
+
export {
|
|
240
|
+
RectangleGeometryLibrary_default
|
|
241
|
+
};
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 0.1.4
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2011-2022 Cesium Contributors
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*
|
|
20
|
+
* Columbus View (Pat. Pend.)
|
|
21
|
+
*
|
|
22
|
+
* Portions licensed separately.
|
|
23
|
+
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
Matrix2_default,
|
|
28
|
+
Quaternion_default,
|
|
29
|
+
Rectangle_default,
|
|
30
|
+
Transforms_default
|
|
31
|
+
} from "./chunk-BR3BPM64.js";
|
|
32
|
+
import {
|
|
33
|
+
Matrix4_default
|
|
34
|
+
} from "./chunk-OEHJY463.js";
|
|
35
|
+
import {
|
|
36
|
+
WebGLConstants_default
|
|
37
|
+
} from "./chunk-D3QIW4DH.js";
|
|
38
|
+
import {
|
|
39
|
+
Cartesian2_default,
|
|
40
|
+
Cartographic_default
|
|
41
|
+
} from "./chunk-M6IXKBC7.js";
|
|
42
|
+
import {
|
|
43
|
+
Cartesian3_default,
|
|
44
|
+
Frozen_default,
|
|
45
|
+
Matrix3_default
|
|
46
|
+
} from "./chunk-J4PISUNT.js";
|
|
47
|
+
import {
|
|
48
|
+
Check_default,
|
|
49
|
+
DeveloperError_default
|
|
50
|
+
} from "./chunk-KWV6ZTF4.js";
|
|
51
|
+
import {
|
|
52
|
+
defined_default
|
|
53
|
+
} from "./chunk-MRMNELAH.js";
|
|
54
|
+
|
|
55
|
+
// packages/engine/Source/Core/GeometryType.js
|
|
56
|
+
var GeometryType = {
|
|
57
|
+
NONE: 0,
|
|
58
|
+
TRIANGLES: 1,
|
|
59
|
+
LINES: 2,
|
|
60
|
+
POLYLINES: 3
|
|
61
|
+
};
|
|
62
|
+
Object.freeze(GeometryType);
|
|
63
|
+
var GeometryType_default = GeometryType;
|
|
64
|
+
|
|
65
|
+
// packages/engine/Source/Core/PrimitiveType.js
|
|
66
|
+
var PrimitiveType = {
|
|
67
|
+
/**
|
|
68
|
+
* Points primitive where each vertex (or index) is a separate point.
|
|
69
|
+
*
|
|
70
|
+
* @type {number}
|
|
71
|
+
* @constant
|
|
72
|
+
*/
|
|
73
|
+
POINTS: WebGLConstants_default.POINTS,
|
|
74
|
+
/**
|
|
75
|
+
* Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected.
|
|
76
|
+
*
|
|
77
|
+
* @type {number}
|
|
78
|
+
* @constant
|
|
79
|
+
*/
|
|
80
|
+
LINES: WebGLConstants_default.LINES,
|
|
81
|
+
/**
|
|
82
|
+
* Line loop primitive where each vertex (or index) after the first connects a line to
|
|
83
|
+
* the previous vertex, and the last vertex implicitly connects to the first.
|
|
84
|
+
*
|
|
85
|
+
* @type {number}
|
|
86
|
+
* @constant
|
|
87
|
+
*/
|
|
88
|
+
LINE_LOOP: WebGLConstants_default.LINE_LOOP,
|
|
89
|
+
/**
|
|
90
|
+
* Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex.
|
|
91
|
+
*
|
|
92
|
+
* @type {number}
|
|
93
|
+
* @constant
|
|
94
|
+
*/
|
|
95
|
+
LINE_STRIP: WebGLConstants_default.LINE_STRIP,
|
|
96
|
+
/**
|
|
97
|
+
* Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges.
|
|
98
|
+
*
|
|
99
|
+
* @type {number}
|
|
100
|
+
* @constant
|
|
101
|
+
*/
|
|
102
|
+
TRIANGLES: WebGLConstants_default.TRIANGLES,
|
|
103
|
+
/**
|
|
104
|
+
* Triangle strip primitive where each vertex (or index) after the first two connect to
|
|
105
|
+
* the previous two vertices forming a triangle. For example, this can be used to model a wall.
|
|
106
|
+
*
|
|
107
|
+
* @type {number}
|
|
108
|
+
* @constant
|
|
109
|
+
*/
|
|
110
|
+
TRIANGLE_STRIP: WebGLConstants_default.TRIANGLE_STRIP,
|
|
111
|
+
/**
|
|
112
|
+
* Triangle fan primitive where each vertex (or index) after the first two connect to
|
|
113
|
+
* the previous vertex and the first vertex forming a triangle. For example, this can be used
|
|
114
|
+
* to model a cone or circle.
|
|
115
|
+
*
|
|
116
|
+
* @type {number}
|
|
117
|
+
* @constant
|
|
118
|
+
*/
|
|
119
|
+
TRIANGLE_FAN: WebGLConstants_default.TRIANGLE_FAN
|
|
120
|
+
};
|
|
121
|
+
PrimitiveType.isLines = function(primitiveType) {
|
|
122
|
+
return primitiveType === PrimitiveType.LINES || primitiveType === PrimitiveType.LINE_LOOP || primitiveType === PrimitiveType.LINE_STRIP;
|
|
123
|
+
};
|
|
124
|
+
PrimitiveType.isTriangles = function(primitiveType) {
|
|
125
|
+
return primitiveType === PrimitiveType.TRIANGLES || primitiveType === PrimitiveType.TRIANGLE_STRIP || primitiveType === PrimitiveType.TRIANGLE_FAN;
|
|
126
|
+
};
|
|
127
|
+
PrimitiveType.validate = function(primitiveType) {
|
|
128
|
+
return primitiveType === PrimitiveType.POINTS || primitiveType === PrimitiveType.LINES || primitiveType === PrimitiveType.LINE_LOOP || primitiveType === PrimitiveType.LINE_STRIP || primitiveType === PrimitiveType.TRIANGLES || primitiveType === PrimitiveType.TRIANGLE_STRIP || primitiveType === PrimitiveType.TRIANGLE_FAN;
|
|
129
|
+
};
|
|
130
|
+
Object.freeze(PrimitiveType);
|
|
131
|
+
var PrimitiveType_default = PrimitiveType;
|
|
132
|
+
|
|
133
|
+
// packages/engine/Source/Core/Geometry.js
|
|
134
|
+
function Geometry(options) {
|
|
135
|
+
options = options ?? Frozen_default.EMPTY_OBJECT;
|
|
136
|
+
Check_default.typeOf.object("options.attributes", options.attributes);
|
|
137
|
+
this.attributes = options.attributes;
|
|
138
|
+
this.indices = options.indices;
|
|
139
|
+
this.primitiveType = options.primitiveType ?? PrimitiveType_default.TRIANGLES;
|
|
140
|
+
this.boundingSphere = options.boundingSphere;
|
|
141
|
+
this.geometryType = options.geometryType ?? GeometryType_default.NONE;
|
|
142
|
+
this.boundingSphereCV = options.boundingSphereCV;
|
|
143
|
+
this.offsetAttribute = options.offsetAttribute;
|
|
144
|
+
}
|
|
145
|
+
Geometry.computeNumberOfVertices = function(geometry) {
|
|
146
|
+
Check_default.typeOf.object("geometry", geometry);
|
|
147
|
+
let numberOfVertices = -1;
|
|
148
|
+
for (const property in geometry.attributes) {
|
|
149
|
+
if (geometry.attributes.hasOwnProperty(property) && defined_default(geometry.attributes[property]) && defined_default(geometry.attributes[property].values)) {
|
|
150
|
+
const attribute = geometry.attributes[property];
|
|
151
|
+
const num = attribute.values.length / attribute.componentsPerAttribute;
|
|
152
|
+
if (numberOfVertices !== num && numberOfVertices !== -1) {
|
|
153
|
+
throw new DeveloperError_default(
|
|
154
|
+
"All attribute lists must have the same number of attributes."
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
numberOfVertices = num;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return numberOfVertices;
|
|
161
|
+
};
|
|
162
|
+
var rectangleCenterScratch = new Cartographic_default();
|
|
163
|
+
var enuCenterScratch = new Cartesian3_default();
|
|
164
|
+
var fixedFrameToEnuScratch = new Matrix4_default();
|
|
165
|
+
var boundingRectanglePointsCartographicScratch = [
|
|
166
|
+
new Cartographic_default(),
|
|
167
|
+
new Cartographic_default(),
|
|
168
|
+
new Cartographic_default()
|
|
169
|
+
];
|
|
170
|
+
var boundingRectanglePointsEnuScratch = [
|
|
171
|
+
new Cartesian2_default(),
|
|
172
|
+
new Cartesian2_default(),
|
|
173
|
+
new Cartesian2_default()
|
|
174
|
+
];
|
|
175
|
+
var points2DScratch = [new Cartesian2_default(), new Cartesian2_default(), new Cartesian2_default()];
|
|
176
|
+
var pointEnuScratch = new Cartesian3_default();
|
|
177
|
+
var enuRotationScratch = new Quaternion_default();
|
|
178
|
+
var enuRotationMatrixScratch = new Matrix4_default();
|
|
179
|
+
var rotation2DScratch = new Matrix2_default();
|
|
180
|
+
Geometry._textureCoordinateRotationPoints = function(positions, stRotation, ellipsoid, boundingRectangle) {
|
|
181
|
+
let i;
|
|
182
|
+
const rectangleCenter = Rectangle_default.center(
|
|
183
|
+
boundingRectangle,
|
|
184
|
+
rectangleCenterScratch
|
|
185
|
+
);
|
|
186
|
+
const enuCenter = Cartographic_default.toCartesian(
|
|
187
|
+
rectangleCenter,
|
|
188
|
+
ellipsoid,
|
|
189
|
+
enuCenterScratch
|
|
190
|
+
);
|
|
191
|
+
const enuToFixedFrame = Transforms_default.eastNorthUpToFixedFrame(
|
|
192
|
+
enuCenter,
|
|
193
|
+
ellipsoid,
|
|
194
|
+
fixedFrameToEnuScratch
|
|
195
|
+
);
|
|
196
|
+
const fixedFrameToEnu = Matrix4_default.inverse(
|
|
197
|
+
enuToFixedFrame,
|
|
198
|
+
fixedFrameToEnuScratch
|
|
199
|
+
);
|
|
200
|
+
const boundingPointsEnu = boundingRectanglePointsEnuScratch;
|
|
201
|
+
const boundingPointsCarto = boundingRectanglePointsCartographicScratch;
|
|
202
|
+
boundingPointsCarto[0].longitude = boundingRectangle.west;
|
|
203
|
+
boundingPointsCarto[0].latitude = boundingRectangle.south;
|
|
204
|
+
boundingPointsCarto[1].longitude = boundingRectangle.west;
|
|
205
|
+
boundingPointsCarto[1].latitude = boundingRectangle.north;
|
|
206
|
+
boundingPointsCarto[2].longitude = boundingRectangle.east;
|
|
207
|
+
boundingPointsCarto[2].latitude = boundingRectangle.south;
|
|
208
|
+
let posEnu = pointEnuScratch;
|
|
209
|
+
for (i = 0; i < 3; i++) {
|
|
210
|
+
Cartographic_default.toCartesian(boundingPointsCarto[i], ellipsoid, posEnu);
|
|
211
|
+
posEnu = Matrix4_default.multiplyByPointAsVector(fixedFrameToEnu, posEnu, posEnu);
|
|
212
|
+
boundingPointsEnu[i].x = posEnu.x;
|
|
213
|
+
boundingPointsEnu[i].y = posEnu.y;
|
|
214
|
+
}
|
|
215
|
+
const rotation = Quaternion_default.fromAxisAngle(
|
|
216
|
+
Cartesian3_default.UNIT_Z,
|
|
217
|
+
-stRotation,
|
|
218
|
+
enuRotationScratch
|
|
219
|
+
);
|
|
220
|
+
const textureMatrix = Matrix3_default.fromQuaternion(
|
|
221
|
+
rotation,
|
|
222
|
+
enuRotationMatrixScratch
|
|
223
|
+
);
|
|
224
|
+
const positionsLength = positions.length;
|
|
225
|
+
let enuMinX = Number.POSITIVE_INFINITY;
|
|
226
|
+
let enuMinY = Number.POSITIVE_INFINITY;
|
|
227
|
+
let enuMaxX = Number.NEGATIVE_INFINITY;
|
|
228
|
+
let enuMaxY = Number.NEGATIVE_INFINITY;
|
|
229
|
+
for (i = 0; i < positionsLength; i++) {
|
|
230
|
+
posEnu = Matrix4_default.multiplyByPointAsVector(
|
|
231
|
+
fixedFrameToEnu,
|
|
232
|
+
positions[i],
|
|
233
|
+
posEnu
|
|
234
|
+
);
|
|
235
|
+
posEnu = Matrix3_default.multiplyByVector(textureMatrix, posEnu, posEnu);
|
|
236
|
+
enuMinX = Math.min(enuMinX, posEnu.x);
|
|
237
|
+
enuMinY = Math.min(enuMinY, posEnu.y);
|
|
238
|
+
enuMaxX = Math.max(enuMaxX, posEnu.x);
|
|
239
|
+
enuMaxY = Math.max(enuMaxY, posEnu.y);
|
|
240
|
+
}
|
|
241
|
+
const toDesiredInComputed = Matrix2_default.fromRotation(
|
|
242
|
+
stRotation,
|
|
243
|
+
rotation2DScratch
|
|
244
|
+
);
|
|
245
|
+
const points2D = points2DScratch;
|
|
246
|
+
points2D[0].x = enuMinX;
|
|
247
|
+
points2D[0].y = enuMinY;
|
|
248
|
+
points2D[1].x = enuMinX;
|
|
249
|
+
points2D[1].y = enuMaxY;
|
|
250
|
+
points2D[2].x = enuMaxX;
|
|
251
|
+
points2D[2].y = enuMinY;
|
|
252
|
+
const boundingEnuMin = boundingPointsEnu[0];
|
|
253
|
+
const boundingPointsWidth = boundingPointsEnu[2].x - boundingEnuMin.x;
|
|
254
|
+
const boundingPointsHeight = boundingPointsEnu[1].y - boundingEnuMin.y;
|
|
255
|
+
for (i = 0; i < 3; i++) {
|
|
256
|
+
const point2D = points2D[i];
|
|
257
|
+
Matrix2_default.multiplyByVector(toDesiredInComputed, point2D, point2D);
|
|
258
|
+
point2D.x = (point2D.x - boundingEnuMin.x) / boundingPointsWidth;
|
|
259
|
+
point2D.y = (point2D.y - boundingEnuMin.y) / boundingPointsHeight;
|
|
260
|
+
}
|
|
261
|
+
const minXYCorner = points2D[0];
|
|
262
|
+
const maxYCorner = points2D[1];
|
|
263
|
+
const maxXCorner = points2D[2];
|
|
264
|
+
const result = new Array(6);
|
|
265
|
+
Cartesian2_default.pack(minXYCorner, result);
|
|
266
|
+
Cartesian2_default.pack(maxYCorner, result, 2);
|
|
267
|
+
Cartesian2_default.pack(maxXCorner, result, 4);
|
|
268
|
+
return result;
|
|
269
|
+
};
|
|
270
|
+
var Geometry_default = Geometry;
|
|
271
|
+
|
|
272
|
+
// packages/engine/Source/Core/GeometryAttribute.js
|
|
273
|
+
function GeometryAttribute(options) {
|
|
274
|
+
options = options ?? Frozen_default.EMPTY_OBJECT;
|
|
275
|
+
if (!defined_default(options.componentDatatype)) {
|
|
276
|
+
throw new DeveloperError_default("options.componentDatatype is required.");
|
|
277
|
+
}
|
|
278
|
+
if (!defined_default(options.componentsPerAttribute)) {
|
|
279
|
+
throw new DeveloperError_default("options.componentsPerAttribute is required.");
|
|
280
|
+
}
|
|
281
|
+
if (options.componentsPerAttribute < 1 || options.componentsPerAttribute > 4) {
|
|
282
|
+
throw new DeveloperError_default(
|
|
283
|
+
"options.componentsPerAttribute must be between 1 and 4."
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
if (!defined_default(options.values)) {
|
|
287
|
+
throw new DeveloperError_default("options.values is required.");
|
|
288
|
+
}
|
|
289
|
+
this.componentDatatype = options.componentDatatype;
|
|
290
|
+
this.componentsPerAttribute = options.componentsPerAttribute;
|
|
291
|
+
this.normalize = options.normalize ?? false;
|
|
292
|
+
this.values = options.values;
|
|
293
|
+
}
|
|
294
|
+
var GeometryAttribute_default = GeometryAttribute;
|
|
295
|
+
|
|
296
|
+
export {
|
|
297
|
+
GeometryType_default,
|
|
298
|
+
PrimitiveType_default,
|
|
299
|
+
Geometry_default,
|
|
300
|
+
GeometryAttribute_default
|
|
301
|
+
};
|