@cesium/engine 6.2.0 → 7.0.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/Build/ThirdParty/Workers/z-worker-pako.js +568 -407
- package/Build/Workers/{chunk-QRBRVGZC.js → chunk-2HJWSU7B.js} +4 -4
- package/Build/Workers/{chunk-ZQRZBHYI.js → chunk-46UD5ABS.js} +4 -4
- package/Build/Workers/{chunk-GVL5I7TC.js → chunk-4EBHOMFX.js} +17 -17
- package/Build/Workers/{chunk-CDGHUKQ4.js → chunk-5HDYHG3F.js} +13 -13
- package/Build/Workers/{chunk-CWJQGBWT.js → chunk-5M3U6ZMA.js} +1 -1
- package/Build/Workers/{chunk-Y4OJ4B23.js → chunk-5WQ523AW.js} +5 -5
- package/Build/Workers/{chunk-NE4JNU6H.js → chunk-5YLJ77FF.js} +10 -10
- package/Build/Workers/{chunk-SV7DDPAC.js → chunk-6HZQPRUS.js} +1 -1
- package/Build/Workers/{chunk-434ZTTFX.js → chunk-6VJVYK2V.js} +2 -2
- package/Build/Workers/{chunk-LGJUI2CE.js → chunk-72SANQJV.js} +5 -5
- package/Build/Workers/{chunk-QTZQZY2C.js → chunk-7XEAYGZK.js} +34 -10
- package/Build/Workers/{chunk-Z4JUBRHP.js → chunk-AIPU2VSX.js} +6 -6
- package/Build/Workers/{chunk-PZ2WJWUG.js → chunk-AR5DNBJ4.js} +6 -6
- package/Build/Workers/{chunk-BUZDZBUH.js → chunk-BZP4T2JJ.js} +10 -10
- package/Build/Workers/{chunk-Z2SIPUKB.js → chunk-DTAIXKTO.js} +6 -6
- package/Build/Workers/{chunk-HOT2SNXP.js → chunk-F6SE42BK.js} +127 -90
- package/Build/Workers/{chunk-TIXXVKUY.js → chunk-FP6GYBFX.js} +10 -10
- package/Build/Workers/{chunk-ARPTYYKS.js → chunk-GEJTYLCO.js} +5 -5
- package/Build/Workers/{chunk-XUTVA4K5.js → chunk-GV56Q4LU.js} +11 -11
- package/Build/Workers/{chunk-HPP4JLNH.js → chunk-IQBYFRVW.js} +7 -7
- package/Build/Workers/{chunk-O43GWBSF.js → chunk-IX2JCCNM.js} +1 -1
- package/Build/Workers/{chunk-H5DUXHCV.js → chunk-JCNXK6EL.js} +11 -11
- package/Build/Workers/{chunk-SQVTYRZY.js → chunk-JJ4VBOQ3.js} +4 -4
- package/Build/Workers/{chunk-RIDPF7PO.js → chunk-JXDC723O.js} +2 -2
- package/Build/Workers/{chunk-R3HUGXBH.js → chunk-JY5YEZFA.js} +8 -8
- package/Build/Workers/{chunk-GF5TNNKP.js → chunk-L2ZN645J.js} +6 -6
- package/Build/Workers/{chunk-5GDBZTHX.js → chunk-LZ7JIV3K.js} +17 -17
- package/Build/Workers/{chunk-52VSIKEA.js → chunk-LZGHD6NY.js} +15 -15
- package/Build/Workers/{chunk-RH4N2ONY.js → chunk-MY3VNFGQ.js} +7 -7
- package/Build/Workers/{chunk-MN34FIF5.js → chunk-NKPBIX7F.js} +1 -1
- package/Build/Workers/{chunk-AXFRNOVC.js → chunk-NY3K4IM3.js} +12 -12
- package/Build/Workers/{chunk-MW3CJYLX.js → chunk-ODW7WYM4.js} +2 -2
- package/Build/Workers/{chunk-R4OZKBXH.js → chunk-OVLG3FRS.js} +6 -6
- package/Build/Workers/{chunk-TMPVBFJQ.js → chunk-PNBGBETF.js} +10 -10
- package/Build/Workers/{chunk-DR5XZ6K5.js → chunk-PTQQUQC3.js} +13 -13
- package/Build/Workers/{chunk-3PW6ZBN4.js → chunk-QZAD5O7I.js} +7 -7
- package/Build/Workers/{chunk-5SK36PU4.js → chunk-R5X4OQT4.js} +7 -7
- package/Build/Workers/{chunk-DMCSY5BU.js → chunk-RAEV7K66.js} +5 -5
- package/Build/Workers/{chunk-BP467WX3.js → chunk-RV7ZYPFT.js} +4 -4
- package/Build/Workers/{chunk-5HLGKKG3.js → chunk-S4MAZ3SS.js} +2 -2
- package/Build/Workers/{chunk-LX6XV4DK.js → chunk-S6SKF6DT.js} +5 -5
- package/Build/Workers/{chunk-HUPNRBWW.js → chunk-U2VCRRQW.js} +6 -6
- package/Build/Workers/{chunk-SNN7WOC2.js → chunk-UAEW6HKG.js} +13 -13
- package/Build/Workers/{chunk-HFKSAB5K.js → chunk-UDO6BFSF.js} +13 -13
- package/Build/Workers/{chunk-YBKFS53K.js → chunk-UGK3FCDY.js} +1 -1
- package/Build/Workers/{chunk-PIXK6KHB.js → chunk-VK3EJHWI.js} +2 -2
- package/Build/Workers/{chunk-5IRLXUTA.js → chunk-VRGFV2UO.js} +7 -7
- package/Build/Workers/{chunk-JGG36SQV.js → chunk-WBQCVXR3.js} +4 -4
- package/Build/Workers/{chunk-4KP73B43.js → chunk-WZU2YLWG.js} +3 -3
- package/Build/Workers/{chunk-LGL4P5KL.js → chunk-XWXM2O2R.js} +6 -6
- package/Build/Workers/{chunk-FWGNCYP6.js → chunk-YUCVWAY6.js} +7 -7
- package/Build/Workers/{chunk-CSIZ3BGT.js → chunk-ZK5JOS3D.js} +14 -14
- package/Build/Workers/{chunk-HPH5HSFE.js → chunk-ZUA2UUNV.js} +2 -2
- package/Build/Workers/combineGeometry.js +23 -23
- package/Build/Workers/createBoxGeometry.js +17 -17
- package/Build/Workers/createBoxOutlineGeometry.js +15 -15
- package/Build/Workers/createCircleGeometry.js +25 -25
- package/Build/Workers/createCircleOutlineGeometry.js +18 -18
- package/Build/Workers/createCoplanarPolygonGeometry.js +32 -32
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createCorridorGeometry.js +28 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +27 -28
- package/Build/Workers/createCylinderGeometry.js +19 -19
- package/Build/Workers/createCylinderOutlineGeometry.js +17 -17
- package/Build/Workers/createEllipseGeometry.js +25 -25
- package/Build/Workers/createEllipseOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipsoidGeometry.js +18 -18
- package/Build/Workers/createEllipsoidOutlineGeometry.js +17 -17
- package/Build/Workers/createFrustumGeometry.js +17 -17
- package/Build/Workers/createFrustumOutlineGeometry.js +17 -17
- package/Build/Workers/createGeometry.js +23 -23
- package/Build/Workers/createGroundPolylineGeometry.js +21 -21
- package/Build/Workers/createPlaneGeometry.js +15 -15
- package/Build/Workers/createPlaneOutlineGeometry.js +14 -14
- package/Build/Workers/createPolygonGeometry.js +31 -166
- package/Build/Workers/createPolygonOutlineGeometry.js +29 -29
- package/Build/Workers/createPolylineGeometry.js +24 -24
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -33
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +26 -27
- package/Build/Workers/createRectangleGeometry.js +26 -26
- package/Build/Workers/createRectangleOutlineGeometry.js +19 -19
- package/Build/Workers/createSimplePolylineGeometry.js +22 -22
- package/Build/Workers/createSphereGeometry.js +18 -18
- package/Build/Workers/createSphereOutlineGeometry.js +17 -17
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +23 -23
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +21 -21
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +21 -21
- package/Build/Workers/createVerticesFromHeightmap.js +21 -21
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +18 -18
- package/Build/Workers/createWallGeometry.js +23 -23
- package/Build/Workers/createWallOutlineGeometry.js +22 -22
- package/Build/Workers/decodeDraco.js +11 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +9 -9
- package/Build/Workers/transcodeKTX2.js +7 -7
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +21 -21
- package/LICENSE.md +1 -1
- package/Source/Assets/approximateTerrainHeights.json +1 -1
- package/Source/Core/GregorianDate.js +85 -0
- package/Source/Core/HeadingPitchRange.js +2 -2
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/PolygonGeometry.js +0 -169
- package/Source/Core/Resource.js +30 -69
- package/Source/Core/Transforms.js +27 -18
- package/Source/Core/createWorldBathymetryAsync.js +45 -0
- package/Source/DataSources/EllipsoidGeometryUpdater.js +3 -4
- package/Source/DataSources/Entity.js +8 -5
- package/Source/DataSources/EntityCollection.js +1 -2
- package/Source/DataSources/GeometryUpdater.js +1 -2
- package/Source/DataSources/GroundGeometryUpdater.js +6 -3
- package/Source/DataSources/ModelVisualizer.js +19 -98
- package/Source/DataSources/PolygonGeometryUpdater.js +14 -2
- package/Source/DataSources/PolylineGeometryUpdater.js +9 -8
- package/Source/DataSources/TerrainOffsetProperty.js +15 -23
- package/Source/Renderer/AutomaticUniforms.js +121 -1
- package/Source/Renderer/UniformState.js +127 -0
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Atmosphere.js +127 -0
- package/Source/Scene/Billboard.js +29 -26
- package/Source/Scene/BillboardCollection.js +3 -3
- package/Source/Scene/Camera.js +1 -1
- package/Source/Scene/Cesium3DTile.js +1 -0
- package/Source/Scene/Cesium3DTileContent.js +14 -0
- package/Source/Scene/Cesium3DTileset.js +326 -45
- package/Source/Scene/Cesium3DTilesetTraversal.js +4 -0
- package/Source/Scene/Composite3DTileContent.js +42 -0
- package/Source/Scene/DynamicAtmosphereLightingType.js +56 -0
- package/Source/Scene/Empty3DTileContent.js +4 -0
- package/Source/Scene/Fog.js +1 -0
- package/Source/Scene/FrameState.js +9 -1
- package/Source/Scene/Geometry3DTileContent.js +4 -0
- package/Source/Scene/Globe.js +3 -2
- package/Source/Scene/GlobeSurfaceTileProvider.js +3 -1
- package/Source/Scene/GltfLoader.js +15 -5
- package/Source/Scene/HeightReference.js +59 -2
- package/Source/Scene/Implicit3DTileContent.js +4 -0
- package/Source/Scene/LabelCollection.js +2 -2
- package/Source/Scene/Model/AtmospherePipelineStage.js +59 -0
- package/Source/Scene/Model/B3dmLoader.js +4 -0
- package/Source/Scene/Model/FeatureIdPipelineStage.js +25 -2
- package/Source/Scene/Model/I3dmLoader.js +4 -0
- package/Source/Scene/Model/InstancingPipelineStage.js +24 -6
- package/Source/Scene/Model/MetadataPipelineStage.js +31 -3
- package/Source/Scene/Model/Model.js +82 -32
- package/Source/Scene/Model/Model3DTileContent.js +31 -0
- package/Source/Scene/Model/ModelAnimationChannel.js +16 -15
- package/Source/Scene/Model/ModelSceneGraph.js +6 -0
- package/Source/Scene/Model/pickModel.js +408 -0
- package/Source/Scene/Multiple3DTileContent.js +42 -0
- package/Source/Scene/QuadtreePrimitive.js +1 -1
- package/Source/Scene/Scene.js +198 -16
- package/Source/Scene/ScreenSpaceCameraController.js +2 -6
- package/Source/Scene/SkyAtmosphere.js +5 -6
- package/Source/Scene/Terrain.js +49 -0
- package/Source/Scene/TileBoundingS2Cell.js +2 -2
- package/Source/Scene/Tileset3DTileContent.js +4 -0
- package/Source/Scene/Vector3DTileContent.js +4 -0
- package/Source/Shaders/AtmosphereCommon.glsl +3 -11
- package/Source/Shaders/AtmosphereCommon.js +3 -11
- package/Source/Shaders/Builtin/CzmBuiltins.js +12 -0
- package/Source/Shaders/Builtin/Functions/applyHSBShift.glsl +32 -0
- package/Source/Shaders/Builtin/Functions/applyHSBShift.js +34 -0
- package/Source/Shaders/Builtin/Functions/approximateTanh.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/approximateTanh.js +12 -0
- package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.glsl +44 -0
- package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.js +46 -0
- package/Source/Shaders/Builtin/Functions/computeGroundAtmosphereScattering.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/computeGroundAtmosphereScattering.js +32 -0
- package/Source/Shaders/Builtin/Functions/computeScattering.glsl +150 -0
- package/Source/Shaders/Builtin/Functions/computeScattering.js +152 -0
- package/Source/Shaders/Builtin/Functions/getDynamicAtmosphereLightDirection.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/getDynamicAtmosphereLightDirection.js +24 -0
- package/Source/Shaders/Builtin/Functions/translateRelativeToEye.glsl +5 -0
- package/Source/Shaders/Builtin/Functions/translateRelativeToEye.js +5 -0
- package/Source/Shaders/GlobeFS.glsl +16 -25
- package/Source/Shaders/GlobeFS.js +16 -25
- package/Source/Shaders/GlobeVS.glsl +1 -1
- package/Source/Shaders/GlobeVS.js +1 -1
- package/Source/Shaders/Model/AtmosphereStageFS.glsl +111 -0
- package/Source/Shaders/Model/AtmosphereStageFS.js +113 -0
- package/Source/Shaders/Model/AtmosphereStageVS.glsl +12 -0
- package/Source/Shaders/Model/AtmosphereStageVS.js +14 -0
- package/Source/Shaders/Model/GeometryStageFS.glsl +1 -1
- package/Source/Shaders/Model/GeometryStageFS.js +1 -1
- package/Source/Shaders/Model/GeometryStageVS.glsl +4 -4
- package/Source/Shaders/Model/GeometryStageVS.js +4 -4
- package/Source/Shaders/Model/ModelColorStageFS.glsl +1 -1
- package/Source/Shaders/Model/ModelColorStageFS.js +2 -1
- package/Source/Shaders/Model/ModelFS.glsl +4 -0
- package/Source/Shaders/Model/ModelFS.js +4 -0
- package/Source/Shaders/Model/ModelVS.glsl +9 -4
- package/Source/Shaders/Model/ModelVS.js +9 -4
- package/Source/Shaders/SkyAtmosphereCommon.glsl +3 -13
- package/Source/Shaders/SkyAtmosphereCommon.js +3 -13
- package/Source/Shaders/SkyAtmosphereFS.glsl +5 -10
- package/Source/Shaders/SkyAtmosphereFS.js +5 -10
- package/Source/Shaders/SkyAtmosphereVS.glsl +3 -2
- package/Source/Shaders/SkyAtmosphereVS.js +3 -2
- package/Source/ThirdParty/Workers/z-worker-pako.js +1 -1
- package/Source/ThirdParty/draco_decoder.wasm +0 -0
- package/index.d.ts +283 -65
- package/index.js +260 -247
- package/package.json +3 -3
- package/Build/Workers/chunk-ATB2I7OS.js +0 -55
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import Check from "./Check.js";
|
|
2
|
+
import defaultValue from "./defaultValue.js";
|
|
3
|
+
import DeveloperError from "./DeveloperError.js";
|
|
4
|
+
import isLeapYear from "./isLeapYear.js";
|
|
5
|
+
|
|
6
|
+
const daysInYear = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
7
|
+
|
|
1
8
|
/**
|
|
2
9
|
* Represents a Gregorian date in a more precise format than the JavaScript Date object.
|
|
3
10
|
* In addition to submillisecond precision, this object can also represent leap seconds.
|
|
@@ -25,6 +32,27 @@ function GregorianDate(
|
|
|
25
32
|
millisecond,
|
|
26
33
|
isLeapSecond
|
|
27
34
|
) {
|
|
35
|
+
const minimumYear = 1;
|
|
36
|
+
const minimumMonth = 1;
|
|
37
|
+
const minimumDay = 1;
|
|
38
|
+
const minimumHour = 0;
|
|
39
|
+
const minimumMinute = 0;
|
|
40
|
+
const minimumSecond = 0;
|
|
41
|
+
const minimumMillisecond = 0;
|
|
42
|
+
|
|
43
|
+
year = defaultValue(year, minimumYear);
|
|
44
|
+
month = defaultValue(month, minimumMonth);
|
|
45
|
+
day = defaultValue(day, minimumDay);
|
|
46
|
+
hour = defaultValue(hour, minimumHour);
|
|
47
|
+
minute = defaultValue(minute, minimumMinute);
|
|
48
|
+
second = defaultValue(second, minimumSecond);
|
|
49
|
+
millisecond = defaultValue(millisecond, minimumMillisecond);
|
|
50
|
+
isLeapSecond = defaultValue(isLeapSecond, false);
|
|
51
|
+
//>>includeStart('debug', pragmas.debug);
|
|
52
|
+
validateRange();
|
|
53
|
+
validateDate();
|
|
54
|
+
//>>includeEnd('debug');
|
|
55
|
+
|
|
28
56
|
/**
|
|
29
57
|
* Gets or sets the year as a whole number.
|
|
30
58
|
* @type {number}
|
|
@@ -65,5 +93,62 @@ function GregorianDate(
|
|
|
65
93
|
* @type {boolean}
|
|
66
94
|
*/
|
|
67
95
|
this.isLeapSecond = isLeapSecond;
|
|
96
|
+
|
|
97
|
+
function validateRange() {
|
|
98
|
+
const maximumYear = 9999;
|
|
99
|
+
const maximumMonth = 12;
|
|
100
|
+
const maximumDay = 31;
|
|
101
|
+
const maximumHour = 23;
|
|
102
|
+
const maximumMinute = 59;
|
|
103
|
+
const maximumSecond = 59;
|
|
104
|
+
const excludedMaximumMilisecond = 1000;
|
|
105
|
+
|
|
106
|
+
Check.typeOf.number.greaterThanOrEquals("Year", year, minimumYear);
|
|
107
|
+
Check.typeOf.number.lessThanOrEquals("Year", year, maximumYear);
|
|
108
|
+
|
|
109
|
+
Check.typeOf.number.greaterThanOrEquals("Month", month, minimumMonth);
|
|
110
|
+
Check.typeOf.number.lessThanOrEquals("Month", month, maximumMonth);
|
|
111
|
+
|
|
112
|
+
Check.typeOf.number.greaterThanOrEquals("Day", day, minimumDay);
|
|
113
|
+
Check.typeOf.number.lessThanOrEquals("Day", day, maximumDay);
|
|
114
|
+
|
|
115
|
+
Check.typeOf.number.greaterThanOrEquals("Hour", hour, minimumHour);
|
|
116
|
+
Check.typeOf.number.lessThanOrEquals("Hour", hour, maximumHour);
|
|
117
|
+
|
|
118
|
+
Check.typeOf.number.greaterThanOrEquals("Minute", minute, minimumMinute);
|
|
119
|
+
Check.typeOf.number.lessThanOrEquals("Minute", minute, maximumMinute);
|
|
120
|
+
|
|
121
|
+
Check.typeOf.bool("IsLeapSecond", isLeapSecond);
|
|
122
|
+
|
|
123
|
+
Check.typeOf.number.greaterThanOrEquals("Second", second, minimumSecond);
|
|
124
|
+
Check.typeOf.number.lessThanOrEquals(
|
|
125
|
+
"Second",
|
|
126
|
+
second,
|
|
127
|
+
isLeapSecond ? maximumSecond + 1 : maximumSecond
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
Check.typeOf.number.greaterThanOrEquals(
|
|
131
|
+
"Millisecond",
|
|
132
|
+
millisecond,
|
|
133
|
+
minimumMillisecond
|
|
134
|
+
);
|
|
135
|
+
Check.typeOf.number.lessThan(
|
|
136
|
+
"Millisecond",
|
|
137
|
+
millisecond,
|
|
138
|
+
excludedMaximumMilisecond
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Javascript date object supports only dates greater than 1901. Thus validating with custom logic
|
|
143
|
+
function validateDate() {
|
|
144
|
+
const daysInMonth =
|
|
145
|
+
month === 2 && isLeapYear(year)
|
|
146
|
+
? daysInYear[month - 1] + 1
|
|
147
|
+
: daysInYear[month - 1];
|
|
148
|
+
|
|
149
|
+
if (day > daysInMonth) {
|
|
150
|
+
throw new DeveloperError("Month and Day represents invalid date");
|
|
151
|
+
}
|
|
152
|
+
}
|
|
68
153
|
}
|
|
69
154
|
export default GregorianDate;
|
|
@@ -3,7 +3,7 @@ import defined from "./defined.js";
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Defines a heading angle, pitch angle, and range in a local frame.
|
|
6
|
-
* Heading is the rotation from the local
|
|
6
|
+
* Heading is the rotation from the local east direction where a positive angle is increasing southward.
|
|
7
7
|
* Pitch is the rotation from the local xy-plane. Positive pitch angles are above the plane. Negative pitch
|
|
8
8
|
* angles are below the plane. Range is the distance from the center of the frame.
|
|
9
9
|
* @alias HeadingPitchRange
|
|
@@ -15,7 +15,7 @@ import defined from "./defined.js";
|
|
|
15
15
|
*/
|
|
16
16
|
function HeadingPitchRange(heading, pitch, range) {
|
|
17
17
|
/**
|
|
18
|
-
* Heading is the rotation from the local
|
|
18
|
+
* Heading is the rotation from the local east direction where a positive angle is increasing southward.
|
|
19
19
|
* @type {number}
|
|
20
20
|
* @default 0.0
|
|
21
21
|
*/
|
package/Source/Core/Ion.js
CHANGED
|
@@ -4,7 +4,7 @@ import Resource from "./Resource.js";
|
|
|
4
4
|
|
|
5
5
|
let defaultTokenCredit;
|
|
6
6
|
const defaultAccessToken =
|
|
7
|
-
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
7
|
+
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiOGQ5NjRhYy1lYzBmLTRjYjktODA5MC01M2FhYmE4YjliZTIiLCJpZCI6MjU5LCJpYXQiOjE3MDY4MDU1MTR9.3b1XUfaoUwtY0Mi87tOQUGTnU4oMyyzSwAYqkDENcHo";
|
|
8
8
|
/**
|
|
9
9
|
* Default settings for accessing the Cesium ion API.
|
|
10
10
|
*
|
|
@@ -8,10 +8,8 @@ import Check from "./Check.js";
|
|
|
8
8
|
import ComponentDatatype from "./ComponentDatatype.js";
|
|
9
9
|
import defaultValue from "./defaultValue.js";
|
|
10
10
|
import defined from "./defined.js";
|
|
11
|
-
import deprecationWarning from "./deprecationWarning.js";
|
|
12
11
|
import DeveloperError from "./DeveloperError.js";
|
|
13
12
|
import Ellipsoid from "./Ellipsoid.js";
|
|
14
|
-
import EllipsoidGeodesic from "./EllipsoidGeodesic.js";
|
|
15
13
|
import EllipsoidTangentPlane from "./EllipsoidTangentPlane.js";
|
|
16
14
|
import Geometry from "./Geometry.js";
|
|
17
15
|
import GeometryAttribute from "./GeometryAttribute.js";
|
|
@@ -425,123 +423,6 @@ function computeAttributes(options) {
|
|
|
425
423
|
return geometry;
|
|
426
424
|
}
|
|
427
425
|
|
|
428
|
-
const startCartographicScratch = new Cartographic();
|
|
429
|
-
const endCartographicScratch = new Cartographic();
|
|
430
|
-
const idlCross = {
|
|
431
|
-
westOverIDL: 0.0,
|
|
432
|
-
eastOverIDL: 0.0,
|
|
433
|
-
};
|
|
434
|
-
let ellipsoidGeodesic = new EllipsoidGeodesic();
|
|
435
|
-
function computeRectangle(positions, ellipsoid, arcType, granularity, result) {
|
|
436
|
-
result = defaultValue(result, new Rectangle());
|
|
437
|
-
if (!defined(positions) || positions.length < 3) {
|
|
438
|
-
result.west = 0.0;
|
|
439
|
-
result.north = 0.0;
|
|
440
|
-
result.south = 0.0;
|
|
441
|
-
result.east = 0.0;
|
|
442
|
-
return result;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
if (arcType === ArcType.RHUMB) {
|
|
446
|
-
return Rectangle.fromCartesianArray(positions, ellipsoid, result);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
if (!ellipsoidGeodesic.ellipsoid.equals(ellipsoid)) {
|
|
450
|
-
ellipsoidGeodesic = new EllipsoidGeodesic(undefined, undefined, ellipsoid);
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
result.west = Number.POSITIVE_INFINITY;
|
|
454
|
-
result.east = Number.NEGATIVE_INFINITY;
|
|
455
|
-
result.south = Number.POSITIVE_INFINITY;
|
|
456
|
-
result.north = Number.NEGATIVE_INFINITY;
|
|
457
|
-
|
|
458
|
-
idlCross.westOverIDL = Number.POSITIVE_INFINITY;
|
|
459
|
-
idlCross.eastOverIDL = Number.NEGATIVE_INFINITY;
|
|
460
|
-
|
|
461
|
-
const inverseChordLength =
|
|
462
|
-
1.0 / CesiumMath.chordLength(granularity, ellipsoid.maximumRadius);
|
|
463
|
-
const positionsLength = positions.length;
|
|
464
|
-
let endCartographic = ellipsoid.cartesianToCartographic(
|
|
465
|
-
positions[0],
|
|
466
|
-
endCartographicScratch
|
|
467
|
-
);
|
|
468
|
-
let startCartographic = startCartographicScratch;
|
|
469
|
-
let swap;
|
|
470
|
-
|
|
471
|
-
for (let i = 1; i < positionsLength; i++) {
|
|
472
|
-
swap = startCartographic;
|
|
473
|
-
startCartographic = endCartographic;
|
|
474
|
-
endCartographic = ellipsoid.cartesianToCartographic(positions[i], swap);
|
|
475
|
-
ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);
|
|
476
|
-
interpolateAndGrowRectangle(
|
|
477
|
-
ellipsoidGeodesic,
|
|
478
|
-
inverseChordLength,
|
|
479
|
-
result,
|
|
480
|
-
idlCross
|
|
481
|
-
);
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
swap = startCartographic;
|
|
485
|
-
startCartographic = endCartographic;
|
|
486
|
-
endCartographic = ellipsoid.cartesianToCartographic(positions[0], swap);
|
|
487
|
-
ellipsoidGeodesic.setEndPoints(startCartographic, endCartographic);
|
|
488
|
-
interpolateAndGrowRectangle(
|
|
489
|
-
ellipsoidGeodesic,
|
|
490
|
-
inverseChordLength,
|
|
491
|
-
result,
|
|
492
|
-
idlCross
|
|
493
|
-
);
|
|
494
|
-
|
|
495
|
-
if (result.east - result.west > idlCross.eastOverIDL - idlCross.westOverIDL) {
|
|
496
|
-
result.west = idlCross.westOverIDL;
|
|
497
|
-
result.east = idlCross.eastOverIDL;
|
|
498
|
-
|
|
499
|
-
if (result.east > CesiumMath.PI) {
|
|
500
|
-
result.east = result.east - CesiumMath.TWO_PI;
|
|
501
|
-
}
|
|
502
|
-
if (result.west > CesiumMath.PI) {
|
|
503
|
-
result.west = result.west - CesiumMath.TWO_PI;
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
return result;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
const interpolatedCartographicScratch = new Cartographic();
|
|
511
|
-
function interpolateAndGrowRectangle(
|
|
512
|
-
ellipsoidGeodesic,
|
|
513
|
-
inverseChordLength,
|
|
514
|
-
result,
|
|
515
|
-
idlCross
|
|
516
|
-
) {
|
|
517
|
-
const segmentLength = ellipsoidGeodesic.surfaceDistance;
|
|
518
|
-
|
|
519
|
-
const numPoints = Math.ceil(segmentLength * inverseChordLength);
|
|
520
|
-
const subsegmentDistance =
|
|
521
|
-
numPoints > 0 ? segmentLength / (numPoints - 1) : Number.POSITIVE_INFINITY;
|
|
522
|
-
let interpolationDistance = 0.0;
|
|
523
|
-
|
|
524
|
-
for (let i = 0; i < numPoints; i++) {
|
|
525
|
-
const interpolatedCartographic = ellipsoidGeodesic.interpolateUsingSurfaceDistance(
|
|
526
|
-
interpolationDistance,
|
|
527
|
-
interpolatedCartographicScratch
|
|
528
|
-
);
|
|
529
|
-
interpolationDistance += subsegmentDistance;
|
|
530
|
-
const longitude = interpolatedCartographic.longitude;
|
|
531
|
-
const latitude = interpolatedCartographic.latitude;
|
|
532
|
-
|
|
533
|
-
result.west = Math.min(result.west, longitude);
|
|
534
|
-
result.east = Math.max(result.east, longitude);
|
|
535
|
-
result.south = Math.min(result.south, latitude);
|
|
536
|
-
result.north = Math.max(result.north, latitude);
|
|
537
|
-
|
|
538
|
-
const lonAdjusted =
|
|
539
|
-
longitude >= 0 ? longitude : longitude + CesiumMath.TWO_PI;
|
|
540
|
-
idlCross.westOverIDL = Math.min(idlCross.westOverIDL, lonAdjusted);
|
|
541
|
-
idlCross.eastOverIDL = Math.max(idlCross.eastOverIDL, lonAdjusted);
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
|
|
545
426
|
const createGeometryFromPositionsExtrudedPositions = [];
|
|
546
427
|
|
|
547
428
|
function createGeometryFromPositionsExtruded(
|
|
@@ -1264,56 +1145,6 @@ PolygonGeometry.computeRectangleFromPositions = function (
|
|
|
1264
1145
|
return result;
|
|
1265
1146
|
};
|
|
1266
1147
|
|
|
1267
|
-
/**
|
|
1268
|
-
* Returns the bounding rectangle given the provided options
|
|
1269
|
-
*
|
|
1270
|
-
* @param {object} options Object with the following properties:
|
|
1271
|
-
* @param {PolygonHierarchy} options.polygonHierarchy A polygon hierarchy that can include holes.
|
|
1272
|
-
* @param {number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions sampled.
|
|
1273
|
-
* @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
|
|
1274
|
-
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
|
|
1275
|
-
* @param {Rectangle} [result] An object in which to store the result.
|
|
1276
|
-
*
|
|
1277
|
-
* @returns {Rectangle} The result rectangle
|
|
1278
|
-
*
|
|
1279
|
-
* @deprecated
|
|
1280
|
-
*/
|
|
1281
|
-
PolygonGeometry.computeRectangle = function (options, result) {
|
|
1282
|
-
//>>includeStart('debug', pragmas.debug);
|
|
1283
|
-
Check.typeOf.object("options", options);
|
|
1284
|
-
Check.typeOf.object("options.polygonHierarchy", options.polygonHierarchy);
|
|
1285
|
-
//>>includeEnd('debug');
|
|
1286
|
-
|
|
1287
|
-
deprecationWarning(
|
|
1288
|
-
"PolygonGeometry.computeRectangle",
|
|
1289
|
-
"PolygonGeometry.computeRectangle was deprecated in CesiumJS 1.110. It will be removed in CesiumJS 1.112. Use PolygonGeometry.computeRectangleFromPositions instead."
|
|
1290
|
-
);
|
|
1291
|
-
|
|
1292
|
-
const granularity = defaultValue(
|
|
1293
|
-
options.granularity,
|
|
1294
|
-
CesiumMath.RADIANS_PER_DEGREE
|
|
1295
|
-
);
|
|
1296
|
-
const arcType = defaultValue(options.arcType, ArcType.GEODESIC);
|
|
1297
|
-
//>>includeStart('debug', pragmas.debug);
|
|
1298
|
-
if (arcType !== ArcType.GEODESIC && arcType !== ArcType.RHUMB) {
|
|
1299
|
-
throw new DeveloperError(
|
|
1300
|
-
"Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB."
|
|
1301
|
-
);
|
|
1302
|
-
}
|
|
1303
|
-
//>>includeEnd('debug');
|
|
1304
|
-
|
|
1305
|
-
const polygonHierarchy = options.polygonHierarchy;
|
|
1306
|
-
const ellipsoid = defaultValue(options.ellipsoid, Ellipsoid.WGS84);
|
|
1307
|
-
|
|
1308
|
-
return computeRectangle(
|
|
1309
|
-
polygonHierarchy.positions,
|
|
1310
|
-
ellipsoid,
|
|
1311
|
-
arcType,
|
|
1312
|
-
granularity,
|
|
1313
|
-
result
|
|
1314
|
-
);
|
|
1315
|
-
};
|
|
1316
|
-
|
|
1317
1148
|
const scratchPolarForPlane = new Stereographic();
|
|
1318
1149
|
function getTangentPlane(rectangle, positions, ellipsoid) {
|
|
1319
1150
|
if (rectangle.height >= CesiumMath.PI || rectangle.width >= CesiumMath.PI) {
|
package/Source/Core/Resource.js
CHANGED
|
@@ -2045,17 +2045,6 @@ Resource.createImageBitmapFromBlob = function (blob, options) {
|
|
|
2045
2045
|
});
|
|
2046
2046
|
};
|
|
2047
2047
|
|
|
2048
|
-
function decodeResponse(loadWithHttpResponse, responseType) {
|
|
2049
|
-
switch (responseType) {
|
|
2050
|
-
case "text":
|
|
2051
|
-
return loadWithHttpResponse.toString("utf8");
|
|
2052
|
-
case "json":
|
|
2053
|
-
return JSON.parse(loadWithHttpResponse.toString("utf8"));
|
|
2054
|
-
default:
|
|
2055
|
-
return new Uint8Array(loadWithHttpResponse).buffer;
|
|
2056
|
-
}
|
|
2057
|
-
}
|
|
2058
|
-
|
|
2059
2048
|
function loadWithHttpRequest(
|
|
2060
2049
|
url,
|
|
2061
2050
|
responseType,
|
|
@@ -2066,64 +2055,36 @@ function loadWithHttpRequest(
|
|
|
2066
2055
|
overrideMimeType
|
|
2067
2056
|
) {
|
|
2068
2057
|
// Note: only the 'json' and 'text' responseTypes transforms the loaded buffer
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
query: URL.query,
|
|
2085
|
-
method: method,
|
|
2086
|
-
headers: headers,
|
|
2087
|
-
};
|
|
2088
|
-
http
|
|
2089
|
-
.request(options)
|
|
2090
|
-
.on("response", function (res) {
|
|
2091
|
-
if (res.statusCode < 200 || res.statusCode >= 300) {
|
|
2092
|
-
deferred.reject(
|
|
2093
|
-
new RequestErrorEvent(res.statusCode, res, res.headers)
|
|
2094
|
-
);
|
|
2095
|
-
return;
|
|
2096
|
-
}
|
|
2097
|
-
|
|
2098
|
-
const chunkArray = [];
|
|
2099
|
-
res.on("data", function (chunk) {
|
|
2100
|
-
chunkArray.push(chunk);
|
|
2101
|
-
});
|
|
2058
|
+
fetch(url, {
|
|
2059
|
+
method,
|
|
2060
|
+
headers,
|
|
2061
|
+
})
|
|
2062
|
+
.then(async (response) => {
|
|
2063
|
+
if (!response.ok) {
|
|
2064
|
+
const responseHeaders = {};
|
|
2065
|
+
response.headers.forEach((value, key) => {
|
|
2066
|
+
responseHeaders[key] = value;
|
|
2067
|
+
});
|
|
2068
|
+
deferred.reject(
|
|
2069
|
+
new RequestErrorEvent(response.status, response, responseHeaders)
|
|
2070
|
+
);
|
|
2071
|
+
return;
|
|
2072
|
+
}
|
|
2102
2073
|
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
});
|
|
2118
|
-
} else {
|
|
2119
|
-
deferred.resolve(decodeResponse(result, responseType));
|
|
2120
|
-
}
|
|
2121
|
-
});
|
|
2122
|
-
})
|
|
2123
|
-
.on("error", function (e) {
|
|
2124
|
-
deferred.reject(new RequestErrorEvent());
|
|
2125
|
-
})
|
|
2126
|
-
.end();
|
|
2074
|
+
switch (responseType) {
|
|
2075
|
+
case "text":
|
|
2076
|
+
deferred.resolve(response.text());
|
|
2077
|
+
break;
|
|
2078
|
+
case "json":
|
|
2079
|
+
deferred.resolve(response.json());
|
|
2080
|
+
break;
|
|
2081
|
+
default:
|
|
2082
|
+
deferred.resolve(new Uint8Array(await response.arrayBuffer()).buffer);
|
|
2083
|
+
break;
|
|
2084
|
+
}
|
|
2085
|
+
})
|
|
2086
|
+
.catch(() => {
|
|
2087
|
+
deferred.reject(new RequestErrorEvent());
|
|
2127
2088
|
});
|
|
2128
2089
|
}
|
|
2129
2090
|
|
|
@@ -2226,7 +2187,7 @@ Resource._Implementations.loadWithXhr = function (
|
|
|
2226
2187
|
//or do not support the xhr.response property.
|
|
2227
2188
|
if (xhr.status === 204) {
|
|
2228
2189
|
// accept no content
|
|
2229
|
-
deferred.resolve();
|
|
2190
|
+
deferred.resolve(undefined);
|
|
2230
2191
|
} else if (
|
|
2231
2192
|
defined(response) &&
|
|
2232
2193
|
(!defined(responseType) || browserResponseType === responseType)
|
|
@@ -360,7 +360,7 @@ const scratchHPRMatrix4 = new Matrix4();
|
|
|
360
360
|
|
|
361
361
|
/**
|
|
362
362
|
* Computes a 4x4 transformation matrix from a reference frame with axes computed from the heading-pitch-roll angles
|
|
363
|
-
* centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local
|
|
363
|
+
* centered at the provided origin to the provided ellipsoid's fixed reference frame. Heading is the rotation from the local east
|
|
364
364
|
* direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
|
|
365
365
|
* are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
|
|
366
366
|
*
|
|
@@ -415,7 +415,7 @@ const scratchHPRMatrix3 = new Matrix3();
|
|
|
415
415
|
|
|
416
416
|
/**
|
|
417
417
|
* Computes a quaternion from a reference frame with axes computed from the heading-pitch-roll angles
|
|
418
|
-
* centered at the provided origin. Heading is the rotation from the local
|
|
418
|
+
* centered at the provided origin. Heading is the rotation from the local east
|
|
419
419
|
* direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
|
|
420
420
|
* are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
|
|
421
421
|
*
|
|
@@ -465,7 +465,7 @@ const hprTransformScratch = new Matrix4();
|
|
|
465
465
|
const hprRotationScratch = new Matrix3();
|
|
466
466
|
const hprQuaternionScratch = new Quaternion();
|
|
467
467
|
/**
|
|
468
|
-
* Computes heading-pitch-roll angles from a transform in a particular reference frame. Heading is the rotation from the local
|
|
468
|
+
* Computes heading-pitch-roll angles from a transform in a particular reference frame. Heading is the rotation from the local east
|
|
469
469
|
* direction where a positive angle is increasing eastward. Pitch is the rotation from the local east-north plane. Positive pitch angles
|
|
470
470
|
* are above the plane. Negative pitch angles are below the plane. Roll is the first rotation applied about the local east axis.
|
|
471
471
|
*
|
|
@@ -1045,21 +1045,30 @@ Transforms.basisTo2D = function (projection, matrix, result) {
|
|
|
1045
1045
|
const rtcCenter = Matrix4.getTranslation(matrix, scratchCenter);
|
|
1046
1046
|
const ellipsoid = projection.ellipsoid;
|
|
1047
1047
|
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
projectedPosition
|
|
1062
|
-
|
|
1048
|
+
let projectedPosition;
|
|
1049
|
+
if (Cartesian3.equals(rtcCenter, Cartesian3.ZERO)) {
|
|
1050
|
+
projectedPosition = Cartesian3.clone(
|
|
1051
|
+
Cartesian3.ZERO,
|
|
1052
|
+
scratchCartesian3Projection
|
|
1053
|
+
);
|
|
1054
|
+
} else {
|
|
1055
|
+
// Get the 2D Center
|
|
1056
|
+
const cartographic = ellipsoid.cartesianToCartographic(
|
|
1057
|
+
rtcCenter,
|
|
1058
|
+
scratchCartographic
|
|
1059
|
+
);
|
|
1060
|
+
|
|
1061
|
+
projectedPosition = projection.project(
|
|
1062
|
+
cartographic,
|
|
1063
|
+
scratchCartesian3Projection
|
|
1064
|
+
);
|
|
1065
|
+
Cartesian3.fromElements(
|
|
1066
|
+
projectedPosition.z,
|
|
1067
|
+
projectedPosition.x,
|
|
1068
|
+
projectedPosition.y,
|
|
1069
|
+
projectedPosition
|
|
1070
|
+
);
|
|
1071
|
+
}
|
|
1063
1072
|
|
|
1064
1073
|
// Assuming the instance are positioned in WGS84, invert the WGS84 transform to get the local transform and then convert to 2D
|
|
1065
1074
|
const fromENU = Transforms.eastNorthUpToFixedFrame(
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import CesiumTerrainProvider from "./CesiumTerrainProvider.js";
|
|
2
|
+
import defaultValue from "./defaultValue.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Creates a {@link CesiumTerrainProvider} instance for the {@link https://cesium.com/content/#cesium-world-bathymetry|Cesium World Bathymetry}.
|
|
6
|
+
*
|
|
7
|
+
* @function
|
|
8
|
+
*
|
|
9
|
+
* @param {Object} [options] Object with the following properties:
|
|
10
|
+
* @param {Boolean} [options.requestVertexNormals=false] Flag that indicates if the client should request additional lighting information from the server if available.
|
|
11
|
+
* @returns {Promise<CesiumTerrainProvider>} A promise that resolves to the created CesiumTerrainProvider
|
|
12
|
+
*
|
|
13
|
+
* @see Ion
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Create Cesium World Bathymetry with default settings
|
|
17
|
+
* try {
|
|
18
|
+
* const viewer = new Cesium.Viewer("cesiumContainer", {
|
|
19
|
+
* terrainProvider: await Cesium.createWorldBathymetryAsync();
|
|
20
|
+
* });
|
|
21
|
+
* } catch (error) {
|
|
22
|
+
* console.log(error);
|
|
23
|
+
* }
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // Create Cesium World Bathymetry with normals.
|
|
27
|
+
* try {
|
|
28
|
+
* const viewer1 = new Cesium.Viewer("cesiumContainer", {
|
|
29
|
+
* terrainProvider: await Cesium.createWorldBathymetryAsync({
|
|
30
|
+
* requestVertexNormals: true
|
|
31
|
+
* });
|
|
32
|
+
* });
|
|
33
|
+
* } catch (error) {
|
|
34
|
+
* console.log(error);
|
|
35
|
+
* }
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
function createWorldBathymetryAsync(options) {
|
|
39
|
+
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
|
|
40
|
+
|
|
41
|
+
return CesiumTerrainProvider.fromIonAssetId(2426648, {
|
|
42
|
+
requestVertexNormals: defaultValue(options.requestVertexNormals, false),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
export default createWorldBathymetryAsync;
|
|
@@ -547,11 +547,10 @@ DynamicEllipsoidGeometryUpdater.prototype.update = function (time) {
|
|
|
547
547
|
options.radii = Cartesian3.clone(in3D ? unitSphere : radii, options.radii);
|
|
548
548
|
if (defined(innerRadii)) {
|
|
549
549
|
if (in3D) {
|
|
550
|
-
const mag = Cartesian3.magnitude(radii);
|
|
551
550
|
options.innerRadii = Cartesian3.fromElements(
|
|
552
|
-
innerRadii.x /
|
|
553
|
-
innerRadii.y /
|
|
554
|
-
innerRadii.z /
|
|
551
|
+
innerRadii.x / radii.x,
|
|
552
|
+
innerRadii.y / radii.y,
|
|
553
|
+
innerRadii.z / radii.z,
|
|
555
554
|
options.innerRadii
|
|
556
555
|
);
|
|
557
556
|
} else {
|
|
@@ -13,7 +13,9 @@ import Quaternion from "../Core/Quaternion.js";
|
|
|
13
13
|
import Transforms from "../Core/Transforms.js";
|
|
14
14
|
import GroundPolylinePrimitive from "../Scene/GroundPolylinePrimitive.js";
|
|
15
15
|
import GroundPrimitive from "../Scene/GroundPrimitive.js";
|
|
16
|
-
import HeightReference
|
|
16
|
+
import HeightReference, {
|
|
17
|
+
isHeightReferenceClamp,
|
|
18
|
+
} from "../Scene/HeightReference.js";
|
|
17
19
|
import BillboardGraphics from "./BillboardGraphics.js";
|
|
18
20
|
import BoxGraphics from "./BoxGraphics.js";
|
|
19
21
|
import ConstantPositionProperty from "./ConstantPositionProperty.js";
|
|
@@ -71,8 +73,8 @@ function createPropertyTypeDescriptor(name, Type) {
|
|
|
71
73
|
* @property {boolean} [show] A boolean value indicating if the entity and its children are displayed.
|
|
72
74
|
* @property {Property | string} [description] A string Property specifying an HTML description for this entity.
|
|
73
75
|
* @property {PositionProperty | Cartesian3} [position] A Property specifying the entity position.
|
|
74
|
-
* @property {Property} [orientation] A Property specifying the entity orientation.
|
|
75
|
-
* @property {Property} [viewFrom] A suggested initial offset for viewing this object.
|
|
76
|
+
* @property {Property | Quaternion} [orientation=Transforms.eastNorthUpToFixedFrame(position)] A Property specifying the entity orientation in respect to Earth-fixed-Earth-centered (ECEF). If undefined, east-north-up at entity position is used.
|
|
77
|
+
* @property {Property | Cartesian3} [viewFrom] A suggested initial offset for viewing this object.
|
|
76
78
|
* @property {Entity} [parent] A parent entity to associate with this entity.
|
|
77
79
|
* @property {BillboardGraphics | BillboardGraphics.ConstructorOptions} [billboard] A billboard to associate with this entity.
|
|
78
80
|
* @property {BoxGraphics | BoxGraphics.ConstructorOptions} [box] A box to associate with this entity.
|
|
@@ -413,7 +415,8 @@ Object.defineProperties(Entity.prototype, {
|
|
|
413
415
|
*/
|
|
414
416
|
tileset: createPropertyTypeDescriptor("tileset", Cesium3DTilesetGraphics),
|
|
415
417
|
/**
|
|
416
|
-
* Gets or sets the orientation.
|
|
418
|
+
* Gets or sets the orientation in respect to Earth-fixed-Earth-centered (ECEF).
|
|
419
|
+
* Defaults to east-north-up at entity position.
|
|
417
420
|
* @memberof Entity.prototype
|
|
418
421
|
* @type {Property|undefined}
|
|
419
422
|
*/
|
|
@@ -706,7 +709,7 @@ Entity.prototype.computeModelMatrixForHeightReference = function (
|
|
|
706
709
|
}
|
|
707
710
|
|
|
708
711
|
const carto = ellipsoid.cartesianToCartographic(position, cartoScratch);
|
|
709
|
-
if (heightReference
|
|
712
|
+
if (isHeightReferenceClamp(heightReference)) {
|
|
710
713
|
carto.height = heightOffset;
|
|
711
714
|
} else {
|
|
712
715
|
carto.height += heightOffset;
|
|
@@ -5,7 +5,6 @@ import DeveloperError from "../Core/DeveloperError.js";
|
|
|
5
5
|
import Event from "../Core/Event.js";
|
|
6
6
|
import Iso8601 from "../Core/Iso8601.js";
|
|
7
7
|
import JulianDate from "../Core/JulianDate.js";
|
|
8
|
-
import RuntimeError from "../Core/RuntimeError.js";
|
|
9
8
|
import TimeInterval from "../Core/TimeInterval.js";
|
|
10
9
|
import Entity from "./Entity.js";
|
|
11
10
|
|
|
@@ -281,7 +280,7 @@ EntityCollection.prototype.add = function (entity) {
|
|
|
281
280
|
const id = entity.id;
|
|
282
281
|
const entities = this._entities;
|
|
283
282
|
if (entities.contains(id)) {
|
|
284
|
-
throw new
|
|
283
|
+
throw new DeveloperError(
|
|
285
284
|
`An entity with id ${id} already exists in this collection.`
|
|
286
285
|
);
|
|
287
286
|
}
|
|
@@ -233,8 +233,7 @@ Object.defineProperties(GeometryUpdater.prototype, {
|
|
|
233
233
|
},
|
|
234
234
|
/**
|
|
235
235
|
* Gets a value indicating if the geometry is time-varying.
|
|
236
|
-
*
|
|
237
|
-
* returned by GeometryUpdater#createDynamicUpdater.
|
|
236
|
+
*
|
|
238
237
|
* @memberof GeometryUpdater.prototype
|
|
239
238
|
*
|
|
240
239
|
* @type {boolean}
|
|
@@ -5,7 +5,9 @@ import DeveloperError from "../Core/DeveloperError.js";
|
|
|
5
5
|
import GeometryOffsetAttribute from "../Core/GeometryOffsetAttribute.js";
|
|
6
6
|
import oneTimeWarning from "../Core/oneTimeWarning.js";
|
|
7
7
|
import GroundPrimitive from "../Scene/GroundPrimitive.js";
|
|
8
|
-
import HeightReference
|
|
8
|
+
import HeightReference, {
|
|
9
|
+
isHeightReferenceClamp,
|
|
10
|
+
} from "../Scene/HeightReference.js";
|
|
9
11
|
import CallbackProperty from "./CallbackProperty.js";
|
|
10
12
|
import ConstantProperty from "./ConstantProperty.js";
|
|
11
13
|
import GeometryUpdater from "./GeometryUpdater.js";
|
|
@@ -164,9 +166,10 @@ GroundGeometryUpdater.getGeometryHeight = function (height, heightReference) {
|
|
|
164
166
|
return;
|
|
165
167
|
}
|
|
166
168
|
|
|
167
|
-
if (heightReference
|
|
169
|
+
if (!isHeightReferenceClamp(heightReference)) {
|
|
168
170
|
return height;
|
|
169
171
|
}
|
|
172
|
+
|
|
170
173
|
return 0.0;
|
|
171
174
|
};
|
|
172
175
|
|
|
@@ -186,7 +189,7 @@ GroundGeometryUpdater.getGeometryExtrudedHeight = function (
|
|
|
186
189
|
}
|
|
187
190
|
return;
|
|
188
191
|
}
|
|
189
|
-
if (extrudedHeightReference
|
|
192
|
+
if (!isHeightReferenceClamp(extrudedHeightReference)) {
|
|
190
193
|
return extrudedHeight;
|
|
191
194
|
}
|
|
192
195
|
|