@hztxi/cesium-engine 25.0.3 → 25.0.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-3B2TIEWW.js +73 -0
- package/Build/Workers/chunk-3HOOLJ6E.js +1483 -0
- package/Build/Workers/chunk-3MWOYCFC.js +511 -0
- package/Build/Workers/chunk-3Q52BERF.js +476 -0
- package/Build/Workers/chunk-4MHUA5ZK.js +163 -0
- package/Build/Workers/chunk-5BVKUNRB.js +368 -0
- package/Build/Workers/chunk-642GMGGP.js +162 -0
- package/Build/Workers/chunk-65LZTCWG.js +1344 -0
- package/Build/Workers/chunk-6PYOAYJD.js +1046 -0
- package/Build/Workers/chunk-AH6GJ5MT.js +754 -0
- package/Build/Workers/chunk-AM56LGEB.js +352 -0
- package/Build/Workers/chunk-CADDH6MK.js +140 -0
- package/Build/Workers/chunk-CEIY3YH2.js +57 -0
- package/Build/Workers/chunk-CJT3FTZK.js +58 -0
- package/Build/Workers/chunk-CV7K25H3.js +138 -0
- package/Build/Workers/chunk-DNEERCHO.js +171 -0
- package/Build/Workers/chunk-EHXAKTME.js +147 -0
- package/Build/Workers/chunk-FF6JKPLF.js +454 -0
- package/Build/Workers/chunk-FTRHXHI5.js +3794 -0
- package/Build/Workers/chunk-GH2D6MPO.js +497 -0
- package/Build/Workers/chunk-GHVEEVR7.js +778 -0
- package/Build/Workers/chunk-HUNCRVVV.js +1067 -0
- package/Build/Workers/chunk-IFSGYIDE.js +257 -0
- package/Build/Workers/chunk-ISRYZ3F4.js +414 -0
- package/Build/Workers/chunk-JBJ5PC2D.js +102 -0
- package/Build/Workers/chunk-JFPBQCDB.js +398 -0
- package/Build/Workers/chunk-JKPELBSI.js +682 -0
- package/Build/Workers/chunk-JLLWLD6O.js +973 -0
- package/Build/Workers/chunk-KCUS7QEU.js +387 -0
- package/Build/Workers/chunk-KFRKYG4B.js +288 -0
- package/Build/Workers/chunk-LERIK6IA.js +219 -0
- package/Build/Workers/chunk-LOVXQI64.js +2719 -0
- package/Build/Workers/chunk-MD7CEJO5.js +2342 -0
- package/Build/Workers/chunk-OKPQ3QBG.js +124 -0
- package/Build/Workers/chunk-PC7533X2.js +1800 -0
- package/Build/Workers/chunk-PCXE4XMI.js +82 -0
- package/Build/Workers/chunk-PXPUYOFJ.js +1287 -0
- package/Build/Workers/chunk-QX6AYJX2.js +455 -0
- package/Build/Workers/chunk-RSJUCJPN.js +241 -0
- package/Build/Workers/chunk-SPTT255E.js +301 -0
- package/Build/Workers/chunk-STXWAEVD.js +101 -0
- package/Build/Workers/chunk-SUG6ECWR.js +76 -0
- package/Build/Workers/chunk-TPT5IM72.js +280 -0
- package/Build/Workers/chunk-TTG2JNFN.js +198 -0
- package/Build/Workers/chunk-UDXUBVNR.js +1992 -0
- package/Build/Workers/chunk-UNXJWCXV.js +9230 -0
- package/Build/Workers/chunk-UTKCX3AS.js +352 -0
- package/Build/Workers/chunk-VL2WHGQI.js +305 -0
- package/Build/Workers/chunk-W37YFRTG.js +38 -0
- package/Build/Workers/chunk-W5AGSDWX.js +44 -0
- package/Build/Workers/chunk-WBQDTVCN.js +97 -0
- package/Build/Workers/chunk-WDSHSR57.js +837 -0
- package/Build/Workers/chunk-XPIDT6UT.js +1054 -0
- package/Build/Workers/chunk-XQETP7YD.js +3201 -0
- package/Build/Workers/chunk-Z3KHKVNA.js +56 -0
- package/Build/Workers/chunk-Z7XRKD6H.js +693 -0
- package/Build/Workers/chunk-ZQUSI7YK.js +630 -0
- package/Build/Workers/chunk-ZY4DTNR2.js +56 -0
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +23 -23
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +26 -26
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +23 -23
- package/Build/Workers/createVerticesFromHeightmap.js +23 -23
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +21 -21
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +23 -23
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +23 -23
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -26
- package/Source/Scene/Globe.js +55 -0
- package/Source/Scene/GlobeSurfaceShaderSet.js +132 -1
- package/Source/Scene/GlobeSurfaceTileProvider.js +378 -2
- package/Source/Scene/ImageryLayer.js +244 -10
- package/Source/Scene/QuadtreePrimitive.js +256 -2
- package/Source/Shaders/GlobeFS.glsl +43 -0
- package/Source/Shaders/GlobeFS.js +43 -0
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/index.js +371 -371
- package/package.json +10 -10
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 1.141.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
|
+
Frozen_default
|
|
28
|
+
} from "./chunk-MD7CEJO5.js";
|
|
29
|
+
import {
|
|
30
|
+
DeveloperError_default
|
|
31
|
+
} from "./chunk-4MHUA5ZK.js";
|
|
32
|
+
import {
|
|
33
|
+
defined_default
|
|
34
|
+
} from "./chunk-PCXE4XMI.js";
|
|
35
|
+
|
|
36
|
+
// packages/engine/Source/Core/VertexFormat.js
|
|
37
|
+
function VertexFormat(options) {
|
|
38
|
+
options = options ?? Frozen_default.EMPTY_OBJECT;
|
|
39
|
+
this.position = options.position ?? false;
|
|
40
|
+
this.normal = options.normal ?? false;
|
|
41
|
+
this.st = options.st ?? false;
|
|
42
|
+
this.bitangent = options.bitangent ?? false;
|
|
43
|
+
this.tangent = options.tangent ?? false;
|
|
44
|
+
this.color = options.color ?? false;
|
|
45
|
+
}
|
|
46
|
+
VertexFormat.POSITION_ONLY = Object.freeze(
|
|
47
|
+
new VertexFormat({
|
|
48
|
+
position: true
|
|
49
|
+
})
|
|
50
|
+
);
|
|
51
|
+
VertexFormat.POSITION_AND_NORMAL = Object.freeze(
|
|
52
|
+
new VertexFormat({
|
|
53
|
+
position: true,
|
|
54
|
+
normal: true
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
VertexFormat.POSITION_NORMAL_AND_ST = Object.freeze(
|
|
58
|
+
new VertexFormat({
|
|
59
|
+
position: true,
|
|
60
|
+
normal: true,
|
|
61
|
+
st: true
|
|
62
|
+
})
|
|
63
|
+
);
|
|
64
|
+
VertexFormat.POSITION_AND_ST = Object.freeze(
|
|
65
|
+
new VertexFormat({
|
|
66
|
+
position: true,
|
|
67
|
+
st: true
|
|
68
|
+
})
|
|
69
|
+
);
|
|
70
|
+
VertexFormat.POSITION_AND_COLOR = Object.freeze(
|
|
71
|
+
new VertexFormat({
|
|
72
|
+
position: true,
|
|
73
|
+
color: true
|
|
74
|
+
})
|
|
75
|
+
);
|
|
76
|
+
VertexFormat.ALL = Object.freeze(
|
|
77
|
+
new VertexFormat({
|
|
78
|
+
position: true,
|
|
79
|
+
normal: true,
|
|
80
|
+
st: true,
|
|
81
|
+
tangent: true,
|
|
82
|
+
bitangent: true
|
|
83
|
+
})
|
|
84
|
+
);
|
|
85
|
+
VertexFormat.DEFAULT = VertexFormat.POSITION_NORMAL_AND_ST;
|
|
86
|
+
VertexFormat.packedLength = 6;
|
|
87
|
+
VertexFormat.pack = function(value, array, startingIndex) {
|
|
88
|
+
if (!defined_default(value)) {
|
|
89
|
+
throw new DeveloperError_default("value is required");
|
|
90
|
+
}
|
|
91
|
+
if (!defined_default(array)) {
|
|
92
|
+
throw new DeveloperError_default("array is required");
|
|
93
|
+
}
|
|
94
|
+
startingIndex = startingIndex ?? 0;
|
|
95
|
+
array[startingIndex++] = value.position ? 1 : 0;
|
|
96
|
+
array[startingIndex++] = value.normal ? 1 : 0;
|
|
97
|
+
array[startingIndex++] = value.st ? 1 : 0;
|
|
98
|
+
array[startingIndex++] = value.tangent ? 1 : 0;
|
|
99
|
+
array[startingIndex++] = value.bitangent ? 1 : 0;
|
|
100
|
+
array[startingIndex] = value.color ? 1 : 0;
|
|
101
|
+
return array;
|
|
102
|
+
};
|
|
103
|
+
VertexFormat.unpack = function(array, startingIndex, result) {
|
|
104
|
+
if (!defined_default(array)) {
|
|
105
|
+
throw new DeveloperError_default("array is required");
|
|
106
|
+
}
|
|
107
|
+
startingIndex = startingIndex ?? 0;
|
|
108
|
+
if (!defined_default(result)) {
|
|
109
|
+
result = new VertexFormat();
|
|
110
|
+
}
|
|
111
|
+
result.position = array[startingIndex++] === 1;
|
|
112
|
+
result.normal = array[startingIndex++] === 1;
|
|
113
|
+
result.st = array[startingIndex++] === 1;
|
|
114
|
+
result.tangent = array[startingIndex++] === 1;
|
|
115
|
+
result.bitangent = array[startingIndex++] === 1;
|
|
116
|
+
result.color = array[startingIndex] === 1;
|
|
117
|
+
return result;
|
|
118
|
+
};
|
|
119
|
+
VertexFormat.clone = function(vertexFormat, result) {
|
|
120
|
+
if (!defined_default(vertexFormat)) {
|
|
121
|
+
return void 0;
|
|
122
|
+
}
|
|
123
|
+
if (!defined_default(result)) {
|
|
124
|
+
result = new VertexFormat();
|
|
125
|
+
}
|
|
126
|
+
result.position = vertexFormat.position;
|
|
127
|
+
result.normal = vertexFormat.normal;
|
|
128
|
+
result.st = vertexFormat.st;
|
|
129
|
+
result.tangent = vertexFormat.tangent;
|
|
130
|
+
result.bitangent = vertexFormat.bitangent;
|
|
131
|
+
result.color = vertexFormat.color;
|
|
132
|
+
return result;
|
|
133
|
+
};
|
|
134
|
+
var VertexFormat_default = VertexFormat;
|
|
135
|
+
|
|
136
|
+
export {
|
|
137
|
+
VertexFormat_default
|
|
138
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 1.141.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
|
+
Cartesian4_default,
|
|
28
|
+
Matrix4_default
|
|
29
|
+
} from "./chunk-XQETP7YD.js";
|
|
30
|
+
import {
|
|
31
|
+
Cartesian3_default
|
|
32
|
+
} from "./chunk-MD7CEJO5.js";
|
|
33
|
+
import {
|
|
34
|
+
Math_default
|
|
35
|
+
} from "./chunk-GH2D6MPO.js";
|
|
36
|
+
import {
|
|
37
|
+
Check_default,
|
|
38
|
+
DeveloperError_default
|
|
39
|
+
} from "./chunk-4MHUA5ZK.js";
|
|
40
|
+
import {
|
|
41
|
+
defined_default
|
|
42
|
+
} from "./chunk-PCXE4XMI.js";
|
|
43
|
+
|
|
44
|
+
// packages/engine/Source/Core/Plane.js
|
|
45
|
+
function Plane(normal, distance) {
|
|
46
|
+
Check_default.typeOf.object("normal", normal);
|
|
47
|
+
if (!Math_default.equalsEpsilon(
|
|
48
|
+
Cartesian3_default.magnitude(normal),
|
|
49
|
+
1,
|
|
50
|
+
Math_default.EPSILON6
|
|
51
|
+
)) {
|
|
52
|
+
throw new DeveloperError_default("normal must be normalized.");
|
|
53
|
+
}
|
|
54
|
+
Check_default.typeOf.number("distance", distance);
|
|
55
|
+
this.normal = Cartesian3_default.clone(normal);
|
|
56
|
+
this.distance = distance;
|
|
57
|
+
}
|
|
58
|
+
Plane.fromPointNormal = function(point, normal, result) {
|
|
59
|
+
Check_default.typeOf.object("point", point);
|
|
60
|
+
Check_default.typeOf.object("normal", normal);
|
|
61
|
+
if (!Math_default.equalsEpsilon(
|
|
62
|
+
Cartesian3_default.magnitude(normal),
|
|
63
|
+
1,
|
|
64
|
+
Math_default.EPSILON6
|
|
65
|
+
)) {
|
|
66
|
+
throw new DeveloperError_default("normal must be normalized.");
|
|
67
|
+
}
|
|
68
|
+
const distance = -Cartesian3_default.dot(normal, point);
|
|
69
|
+
if (!defined_default(result)) {
|
|
70
|
+
return new Plane(normal, distance);
|
|
71
|
+
}
|
|
72
|
+
Cartesian3_default.clone(normal, result.normal);
|
|
73
|
+
result.distance = distance;
|
|
74
|
+
return result;
|
|
75
|
+
};
|
|
76
|
+
var scratchNormal = new Cartesian3_default();
|
|
77
|
+
Plane.fromCartesian4 = function(coefficients, result) {
|
|
78
|
+
Check_default.typeOf.object("coefficients", coefficients);
|
|
79
|
+
const normal = Cartesian3_default.fromCartesian4(coefficients, scratchNormal);
|
|
80
|
+
const distance = coefficients.w;
|
|
81
|
+
if (!Math_default.equalsEpsilon(
|
|
82
|
+
Cartesian3_default.magnitude(normal),
|
|
83
|
+
1,
|
|
84
|
+
Math_default.EPSILON6
|
|
85
|
+
)) {
|
|
86
|
+
throw new DeveloperError_default("normal must be normalized.");
|
|
87
|
+
}
|
|
88
|
+
if (!defined_default(result)) {
|
|
89
|
+
return new Plane(normal, distance);
|
|
90
|
+
}
|
|
91
|
+
Cartesian3_default.clone(normal, result.normal);
|
|
92
|
+
result.distance = distance;
|
|
93
|
+
return result;
|
|
94
|
+
};
|
|
95
|
+
Plane.getPointDistance = function(plane, point) {
|
|
96
|
+
Check_default.typeOf.object("plane", plane);
|
|
97
|
+
Check_default.typeOf.object("point", point);
|
|
98
|
+
return Cartesian3_default.dot(plane.normal, point) + plane.distance;
|
|
99
|
+
};
|
|
100
|
+
var scratchCartesian = new Cartesian3_default();
|
|
101
|
+
Plane.projectPointOntoPlane = function(plane, point, result) {
|
|
102
|
+
Check_default.typeOf.object("plane", plane);
|
|
103
|
+
Check_default.typeOf.object("point", point);
|
|
104
|
+
if (!defined_default(result)) {
|
|
105
|
+
result = new Cartesian3_default();
|
|
106
|
+
}
|
|
107
|
+
const pointDistance = Plane.getPointDistance(plane, point);
|
|
108
|
+
const scaledNormal = Cartesian3_default.multiplyByScalar(
|
|
109
|
+
plane.normal,
|
|
110
|
+
pointDistance,
|
|
111
|
+
scratchCartesian
|
|
112
|
+
);
|
|
113
|
+
return Cartesian3_default.subtract(point, scaledNormal, result);
|
|
114
|
+
};
|
|
115
|
+
var scratchInverseTranspose = new Matrix4_default();
|
|
116
|
+
var scratchPlaneCartesian4 = new Cartesian4_default();
|
|
117
|
+
var scratchTransformNormal = new Cartesian3_default();
|
|
118
|
+
Plane.transform = function(plane, transform, result) {
|
|
119
|
+
Check_default.typeOf.object("plane", plane);
|
|
120
|
+
Check_default.typeOf.object("transform", transform);
|
|
121
|
+
const normal = plane.normal;
|
|
122
|
+
const distance = plane.distance;
|
|
123
|
+
const inverseTranspose = Matrix4_default.inverseTranspose(
|
|
124
|
+
transform,
|
|
125
|
+
scratchInverseTranspose
|
|
126
|
+
);
|
|
127
|
+
let planeAsCartesian4 = Cartesian4_default.fromElements(
|
|
128
|
+
normal.x,
|
|
129
|
+
normal.y,
|
|
130
|
+
normal.z,
|
|
131
|
+
distance,
|
|
132
|
+
scratchPlaneCartesian4
|
|
133
|
+
);
|
|
134
|
+
planeAsCartesian4 = Matrix4_default.multiplyByVector(
|
|
135
|
+
inverseTranspose,
|
|
136
|
+
planeAsCartesian4,
|
|
137
|
+
planeAsCartesian4
|
|
138
|
+
);
|
|
139
|
+
const transformedNormal = Cartesian3_default.fromCartesian4(
|
|
140
|
+
planeAsCartesian4,
|
|
141
|
+
scratchTransformNormal
|
|
142
|
+
);
|
|
143
|
+
planeAsCartesian4 = Cartesian4_default.divideByScalar(
|
|
144
|
+
planeAsCartesian4,
|
|
145
|
+
Cartesian3_default.magnitude(transformedNormal),
|
|
146
|
+
planeAsCartesian4
|
|
147
|
+
);
|
|
148
|
+
return Plane.fromCartesian4(planeAsCartesian4, result);
|
|
149
|
+
};
|
|
150
|
+
Plane.clone = function(plane, result) {
|
|
151
|
+
Check_default.typeOf.object("plane", plane);
|
|
152
|
+
if (!defined_default(result)) {
|
|
153
|
+
return new Plane(plane.normal, plane.distance);
|
|
154
|
+
}
|
|
155
|
+
Cartesian3_default.clone(plane.normal, result.normal);
|
|
156
|
+
result.distance = plane.distance;
|
|
157
|
+
return result;
|
|
158
|
+
};
|
|
159
|
+
Plane.equals = function(left, right) {
|
|
160
|
+
Check_default.typeOf.object("left", left);
|
|
161
|
+
Check_default.typeOf.object("right", right);
|
|
162
|
+
return left.distance === right.distance && Cartesian3_default.equals(left.normal, right.normal);
|
|
163
|
+
};
|
|
164
|
+
Plane.ORIGIN_XY_PLANE = Object.freeze(new Plane(Cartesian3_default.UNIT_Z, 0));
|
|
165
|
+
Plane.ORIGIN_YZ_PLANE = Object.freeze(new Plane(Cartesian3_default.UNIT_X, 0));
|
|
166
|
+
Plane.ORIGIN_ZX_PLANE = Object.freeze(new Plane(Cartesian3_default.UNIT_Y, 0));
|
|
167
|
+
var Plane_default = Plane;
|
|
168
|
+
|
|
169
|
+
export {
|
|
170
|
+
Plane_default
|
|
171
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 1.141.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
|
+
Cartographic_default,
|
|
28
|
+
Ellipsoid_default
|
|
29
|
+
} from "./chunk-UDXUBVNR.js";
|
|
30
|
+
import {
|
|
31
|
+
Cartesian3_default
|
|
32
|
+
} from "./chunk-MD7CEJO5.js";
|
|
33
|
+
import {
|
|
34
|
+
Math_default
|
|
35
|
+
} from "./chunk-GH2D6MPO.js";
|
|
36
|
+
import {
|
|
37
|
+
DeveloperError_default
|
|
38
|
+
} from "./chunk-4MHUA5ZK.js";
|
|
39
|
+
import {
|
|
40
|
+
defined_default
|
|
41
|
+
} from "./chunk-PCXE4XMI.js";
|
|
42
|
+
|
|
43
|
+
// packages/engine/Source/Core/WebMercatorProjection.js
|
|
44
|
+
var WebMercatorProjection = class _WebMercatorProjection {
|
|
45
|
+
/**
|
|
46
|
+
* @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid.
|
|
47
|
+
*/
|
|
48
|
+
constructor(ellipsoid) {
|
|
49
|
+
this._ellipsoid = ellipsoid ?? Ellipsoid_default.WGS84;
|
|
50
|
+
this._semimajorAxis = this._ellipsoid.maximumRadius;
|
|
51
|
+
this._oneOverSemimajorAxis = 1 / this._semimajorAxis;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Gets the {@link Ellipsoid}.
|
|
55
|
+
*
|
|
56
|
+
* @type {Ellipsoid}
|
|
57
|
+
* @readonly
|
|
58
|
+
*/
|
|
59
|
+
get ellipsoid() {
|
|
60
|
+
return this._ellipsoid;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude
|
|
64
|
+
* in the range -PI/2 to PI/2.
|
|
65
|
+
*
|
|
66
|
+
* @param {number} mercatorAngle The angle to convert.
|
|
67
|
+
* @returns {number} The geodetic latitude in radians.
|
|
68
|
+
*/
|
|
69
|
+
static mercatorAngleToGeodeticLatitude(mercatorAngle) {
|
|
70
|
+
return Math_default.PI_OVER_TWO - 2 * Math.atan(Math.exp(-mercatorAngle));
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator
|
|
74
|
+
* angle in the range -PI to PI.
|
|
75
|
+
*
|
|
76
|
+
* @param {number} latitude The geodetic latitude in radians.
|
|
77
|
+
* @returns {number} The Mercator angle.
|
|
78
|
+
*/
|
|
79
|
+
static geodeticLatitudeToMercatorAngle(latitude) {
|
|
80
|
+
if (latitude > _WebMercatorProjection.MaximumLatitude) {
|
|
81
|
+
latitude = _WebMercatorProjection.MaximumLatitude;
|
|
82
|
+
} else if (latitude < -_WebMercatorProjection.MaximumLatitude) {
|
|
83
|
+
latitude = -_WebMercatorProjection.MaximumLatitude;
|
|
84
|
+
}
|
|
85
|
+
const sinLatitude = Math.sin(latitude);
|
|
86
|
+
return 0.5 * Math.log((1 + sinLatitude) / (1 - sinLatitude));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator
|
|
90
|
+
* X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}. The height
|
|
91
|
+
* is copied unmodified to the Z coordinate.
|
|
92
|
+
*
|
|
93
|
+
* @param {Cartographic} cartographic The cartographic coordinates in radians.
|
|
94
|
+
* @param {Cartesian3} [result] The instance to which to copy the result, or undefined if a
|
|
95
|
+
* new instance should be created.
|
|
96
|
+
* @returns {Cartesian3} The equivalent web mercator X, Y, Z coordinates, in meters.
|
|
97
|
+
*/
|
|
98
|
+
project(cartographic, result) {
|
|
99
|
+
const semimajorAxis = this._semimajorAxis;
|
|
100
|
+
const x = cartographic.longitude * semimajorAxis;
|
|
101
|
+
const y = _WebMercatorProjection.geodeticLatitudeToMercatorAngle(
|
|
102
|
+
cartographic.latitude
|
|
103
|
+
) * semimajorAxis;
|
|
104
|
+
const z = cartographic.height;
|
|
105
|
+
if (!defined_default(result)) {
|
|
106
|
+
return new Cartesian3_default(x, y, z);
|
|
107
|
+
}
|
|
108
|
+
result.x = x;
|
|
109
|
+
result.y = y;
|
|
110
|
+
result.z = z;
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Converts Web Mercator X, Y coordinates, expressed in meters, to a {@link Cartographic}
|
|
115
|
+
* containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the
|
|
116
|
+
* height.
|
|
117
|
+
*
|
|
118
|
+
* @param {Cartesian3} cartesian The web mercator Cartesian position to unrproject with height (z) in meters.
|
|
119
|
+
* @param {Cartographic} [result] The instance to which to copy the result, or undefined if a
|
|
120
|
+
* new instance should be created.
|
|
121
|
+
* @returns {Cartographic} The equivalent cartographic coordinates.
|
|
122
|
+
*/
|
|
123
|
+
unproject(cartesian, result) {
|
|
124
|
+
if (!defined_default(cartesian)) {
|
|
125
|
+
throw new DeveloperError_default("cartesian is required");
|
|
126
|
+
}
|
|
127
|
+
const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;
|
|
128
|
+
const longitude = cartesian.x * oneOverEarthSemimajorAxis;
|
|
129
|
+
const latitude = _WebMercatorProjection.mercatorAngleToGeodeticLatitude(
|
|
130
|
+
cartesian.y * oneOverEarthSemimajorAxis
|
|
131
|
+
);
|
|
132
|
+
const height = cartesian.z;
|
|
133
|
+
if (!defined_default(result)) {
|
|
134
|
+
return new Cartographic_default(longitude, latitude, height);
|
|
135
|
+
}
|
|
136
|
+
result.longitude = longitude;
|
|
137
|
+
result.latitude = latitude;
|
|
138
|
+
result.height = height;
|
|
139
|
+
return result;
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
WebMercatorProjection.MaximumLatitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI);
|
|
143
|
+
var WebMercatorProjection_default = WebMercatorProjection;
|
|
144
|
+
|
|
145
|
+
export {
|
|
146
|
+
WebMercatorProjection_default
|
|
147
|
+
};
|