@cesium/engine 3.0.0 → 3.0.1
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/{BoxGeometry-af7d05ef.js → BoxGeometry-7aa4ce7f.js} +1 -1
- package/Build/Workers/{CylinderGeometry-dbaa1678.js → CylinderGeometry-8fc7c44b.js} +1 -1
- package/Build/Workers/{EllipseGeometry-6508b78b.js → EllipseGeometry-16b3736a.js} +1 -1
- package/Build/Workers/{EllipseOutlineGeometry-2a2510bb.js → EllipseOutlineGeometry-05d35d18.js} +1 -1
- package/Build/Workers/{EllipsoidGeometry-8155e3a2.js → EllipsoidGeometry-a503d1d6.js} +1 -1
- package/Build/Workers/{EllipsoidOutlineGeometry-c045678d.js → EllipsoidOutlineGeometry-7b09f24d.js} +1 -1
- package/Build/Workers/{FrustumGeometry-d3ff16d0.js → FrustumGeometry-87ce8622.js} +1 -1
- package/Build/Workers/{GeometryAttribute-13da9466.js → GeometryAttribute-8fcff0d5.js} +1 -1
- package/Build/Workers/{GeometryPipeline-03bc5709.js → GeometryPipeline-70d69a43.js} +1 -1
- package/Build/Workers/{PolygonGeometryLibrary-d447448d.js → PolygonGeometryLibrary-bad6329a.js} +1 -1
- package/Build/Workers/{PolygonPipeline-460cce4e.js → PolygonPipeline-dd13ee78.js} +1 -1
- package/Build/Workers/{PrimitivePipeline-e648752b.js → PrimitivePipeline-111ee29f.js} +1 -1
- package/Build/Workers/cesiumWorkerBootstrapper.js +1 -1
- package/Build/Workers/combineGeometry.js +1 -1
- package/Build/Workers/createBoxGeometry.js +1 -1
- package/Build/Workers/createBoxOutlineGeometry.js +1 -1
- package/Build/Workers/createCircleGeometry.js +1 -1
- package/Build/Workers/createCircleOutlineGeometry.js +1 -1
- package/Build/Workers/createCoplanarPolygonGeometry.js +1 -1
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +1 -1
- package/Build/Workers/createCorridorGeometry.js +1 -1
- package/Build/Workers/createCorridorOutlineGeometry.js +1 -1
- package/Build/Workers/createCylinderGeometry.js +1 -1
- package/Build/Workers/createCylinderOutlineGeometry.js +1 -1
- package/Build/Workers/createEllipseGeometry.js +1 -1
- package/Build/Workers/createEllipseOutlineGeometry.js +1 -1
- package/Build/Workers/createEllipsoidGeometry.js +1 -1
- package/Build/Workers/createEllipsoidOutlineGeometry.js +1 -1
- package/Build/Workers/createFrustumGeometry.js +1 -1
- package/Build/Workers/createFrustumOutlineGeometry.js +1 -1
- package/Build/Workers/createGeometry.js +1 -1
- package/Build/Workers/createGroundPolylineGeometry.js +1 -1
- package/Build/Workers/createPlaneGeometry.js +1 -1
- package/Build/Workers/createPlaneOutlineGeometry.js +1 -1
- package/Build/Workers/createPolygonGeometry.js +1 -1
- package/Build/Workers/createPolygonOutlineGeometry.js +1 -1
- package/Build/Workers/createPolylineGeometry.js +1 -1
- package/Build/Workers/createPolylineVolumeGeometry.js +1 -1
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +1 -1
- package/Build/Workers/createRectangleGeometry.js +1 -1
- package/Build/Workers/createRectangleOutlineGeometry.js +1 -1
- package/Build/Workers/createSimplePolylineGeometry.js +1 -1
- package/Build/Workers/createSphereGeometry.js +1 -1
- package/Build/Workers/createSphereOutlineGeometry.js +1 -1
- package/Build/Workers/createVectorTileGeometries.js +1 -1
- package/Build/Workers/createWallGeometry.js +1 -1
- package/Build/Workers/createWallOutlineGeometry.js +1 -1
- package/Build/Workers/package.js +1 -1
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Source/Core/Geometry.js +1 -1
- package/Source/Scene/{parseBoundingVolumeSemantics.js → BoundingVolumeSemantics.js} +71 -15
- package/Source/Scene/Cesium3DTile.js +31 -13
- package/Source/Scene/Implicit3DTileContent.js +4 -2
- package/Source/Scene/Model/CustomShaderPipelineStage.js +178 -164
- package/Source/Scene/Model/Model.js +3 -1
- package/Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.glsl +1 -1
- package/Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.js +1 -1
- package/Source/Shaders/EllipsoidFS.glsl +1 -1
- package/Source/Shaders/EllipsoidFS.js +1 -1
- package/Source/Shaders/GlobeFS.glsl +1 -1
- package/Source/Shaders/GlobeFS.js +1 -1
- package/index.js +95 -95
- package/package.json +1 -1
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import Check from "../Core/Check.js";
|
|
2
2
|
import defined from "../Core/defined.js";
|
|
3
|
+
import DeveloperError from "../Core/DeveloperError.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Utilities for parsing bounding volume semantics from 3D Tiles 1.1 metadata.
|
|
7
|
+
*
|
|
8
|
+
* @namespace BoundingVolumeSemantics
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
11
|
+
const BoundingVolumeSemantics = {};
|
|
3
12
|
|
|
4
13
|
/**
|
|
5
14
|
* Parse the bounding volume-related semantics such as
|
|
@@ -19,24 +28,44 @@ import defined from "../Core/defined.js";
|
|
|
19
28
|
* @private
|
|
20
29
|
* @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
|
|
21
30
|
*/
|
|
22
|
-
function
|
|
31
|
+
BoundingVolumeSemantics.parseAllBoundingVolumeSemantics = function (
|
|
32
|
+
tileMetadata
|
|
33
|
+
) {
|
|
23
34
|
//>>includeStart('debug', pragmas.debug);
|
|
24
35
|
Check.typeOf.object("tileMetadata", tileMetadata);
|
|
25
36
|
//>>includeEnd('debug');
|
|
26
37
|
|
|
27
38
|
return {
|
|
28
39
|
tile: {
|
|
29
|
-
boundingVolume:
|
|
30
|
-
|
|
31
|
-
|
|
40
|
+
boundingVolume: BoundingVolumeSemantics.parseBoundingVolumeSemantic(
|
|
41
|
+
"TILE",
|
|
42
|
+
tileMetadata
|
|
43
|
+
),
|
|
44
|
+
minimumHeight: BoundingVolumeSemantics._parseMinimumHeight(
|
|
45
|
+
"TILE",
|
|
46
|
+
tileMetadata
|
|
47
|
+
),
|
|
48
|
+
maximumHeight: BoundingVolumeSemantics._parseMaximumHeight(
|
|
49
|
+
"TILE",
|
|
50
|
+
tileMetadata
|
|
51
|
+
),
|
|
32
52
|
},
|
|
33
53
|
content: {
|
|
34
|
-
boundingVolume:
|
|
35
|
-
|
|
36
|
-
|
|
54
|
+
boundingVolume: BoundingVolumeSemantics.parseBoundingVolumeSemantic(
|
|
55
|
+
"CONTENT",
|
|
56
|
+
tileMetadata
|
|
57
|
+
),
|
|
58
|
+
minimumHeight: BoundingVolumeSemantics._parseMinimumHeight(
|
|
59
|
+
"CONTENT",
|
|
60
|
+
tileMetadata
|
|
61
|
+
),
|
|
62
|
+
maximumHeight: BoundingVolumeSemantics._parseMaximumHeight(
|
|
63
|
+
"CONTENT",
|
|
64
|
+
tileMetadata
|
|
65
|
+
),
|
|
37
66
|
},
|
|
38
67
|
};
|
|
39
|
-
}
|
|
68
|
+
};
|
|
40
69
|
|
|
41
70
|
/**
|
|
42
71
|
* Parse the bounding volume from a tile metadata. If the metadata specify
|
|
@@ -52,7 +81,18 @@ function parseBoundingVolumeSemantics(tileMetadata) {
|
|
|
52
81
|
* @return {object} An object representing the JSON description of the tile metadata
|
|
53
82
|
* @private
|
|
54
83
|
*/
|
|
55
|
-
function
|
|
84
|
+
BoundingVolumeSemantics.parseBoundingVolumeSemantic = function (
|
|
85
|
+
prefix,
|
|
86
|
+
tileMetadata
|
|
87
|
+
) {
|
|
88
|
+
//>>includeStart('debug', pragmas.debug);
|
|
89
|
+
Check.typeOf.string("prefix", prefix);
|
|
90
|
+
if (prefix !== "TILE" && prefix !== "CONTENT") {
|
|
91
|
+
throw new DeveloperError("prefix must be either 'TILE' or 'CONTENT'");
|
|
92
|
+
}
|
|
93
|
+
Check.typeOf.object("tileMetadata", tileMetadata);
|
|
94
|
+
//>>includeEnd('debug');
|
|
95
|
+
|
|
56
96
|
const boundingBoxSemantic = `${prefix}_BOUNDING_BOX`;
|
|
57
97
|
const boundingBox = tileMetadata.getPropertyBySemantic(boundingBoxSemantic);
|
|
58
98
|
|
|
@@ -86,7 +126,7 @@ function parseBoundingVolume(prefix, tileMetadata) {
|
|
|
86
126
|
}
|
|
87
127
|
|
|
88
128
|
return undefined;
|
|
89
|
-
}
|
|
129
|
+
};
|
|
90
130
|
|
|
91
131
|
/**
|
|
92
132
|
* Parse the minimum height from tile metadata. This is used for making tighter
|
|
@@ -98,10 +138,18 @@ function parseBoundingVolume(prefix, tileMetadata) {
|
|
|
98
138
|
* @return {number} The minimum height
|
|
99
139
|
* @private
|
|
100
140
|
*/
|
|
101
|
-
function
|
|
141
|
+
BoundingVolumeSemantics._parseMinimumHeight = function (prefix, tileMetadata) {
|
|
142
|
+
//>>includeStart('debug', pragmas.debug);
|
|
143
|
+
Check.typeOf.string("prefix", prefix);
|
|
144
|
+
if (prefix !== "TILE" && prefix !== "CONTENT") {
|
|
145
|
+
throw new DeveloperError("prefix must be either 'TILE' or 'CONTENT'");
|
|
146
|
+
}
|
|
147
|
+
Check.typeOf.object("tileMetadata", tileMetadata);
|
|
148
|
+
//>>includeEnd('debug');
|
|
149
|
+
|
|
102
150
|
const minimumHeightSemantic = `${prefix}_MINIMUM_HEIGHT`;
|
|
103
151
|
return tileMetadata.getPropertyBySemantic(minimumHeightSemantic);
|
|
104
|
-
}
|
|
152
|
+
};
|
|
105
153
|
|
|
106
154
|
/**
|
|
107
155
|
* Parse the maximum height from tile metadata. This is used for making tighter
|
|
@@ -113,9 +161,17 @@ function parseMinimumHeight(prefix, tileMetadata) {
|
|
|
113
161
|
* @return {number} The maximum height
|
|
114
162
|
* @private
|
|
115
163
|
*/
|
|
116
|
-
function
|
|
164
|
+
BoundingVolumeSemantics._parseMaximumHeight = function (prefix, tileMetadata) {
|
|
165
|
+
//>>includeStart('debug', pragmas.debug);
|
|
166
|
+
Check.typeOf.string("prefix", prefix);
|
|
167
|
+
if (prefix !== "TILE" && prefix !== "CONTENT") {
|
|
168
|
+
throw new DeveloperError("prefix must be either 'TILE' or 'CONTENT'");
|
|
169
|
+
}
|
|
170
|
+
Check.typeOf.object("tileMetadata", tileMetadata);
|
|
171
|
+
//>>includeEnd('debug');
|
|
172
|
+
|
|
117
173
|
const maximumHeightSemantic = `${prefix}_MAXIMUM_HEIGHT`;
|
|
118
174
|
return tileMetadata.getPropertyBySemantic(maximumHeightSemantic);
|
|
119
|
-
}
|
|
175
|
+
};
|
|
120
176
|
|
|
121
|
-
export default
|
|
177
|
+
export default BoundingVolumeSemantics;
|
|
@@ -35,6 +35,7 @@ import findGroupMetadata from "./findGroupMetadata.js";
|
|
|
35
35
|
import findTileMetadata from "./findTileMetadata.js";
|
|
36
36
|
import hasExtension from "./hasExtension.js";
|
|
37
37
|
import Multiple3DTileContent from "./Multiple3DTileContent.js";
|
|
38
|
+
import BoundingVolumeSemantics from "./BoundingVolumeSemantics.js";
|
|
38
39
|
import preprocess3DTileContent from "./preprocess3DTileContent.js";
|
|
39
40
|
import SceneMode from "./SceneMode.js";
|
|
40
41
|
import TileBoundingRegion from "./TileBoundingRegion.js";
|
|
@@ -107,6 +108,20 @@ function Cesium3DTile(tileset, baseResource, header, parent) {
|
|
|
107
108
|
*/
|
|
108
109
|
this.computedTransform = computedTransform;
|
|
109
110
|
|
|
111
|
+
/**
|
|
112
|
+
* When tile metadata is present (3D Tiles 1.1) or the <code>3DTILES_metadata</code> extension is used,
|
|
113
|
+
* this stores a {@link TileMetadata} object for accessing tile metadata.
|
|
114
|
+
*
|
|
115
|
+
* @type {TileMetadata}
|
|
116
|
+
* @readonly
|
|
117
|
+
* @private
|
|
118
|
+
* @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
|
|
119
|
+
*/
|
|
120
|
+
this.metadata = findTileMetadata(tileset, header);
|
|
121
|
+
|
|
122
|
+
// Important: tile metadata must be parsed before this line so that the
|
|
123
|
+
// metadata semantics TILE_BOUNDING_BOX, TILE_BOUNDING_REGION, or TILE_BOUNDING_SPHERE
|
|
124
|
+
// can override header.boundingVolume (if necessary)
|
|
110
125
|
this._boundingVolume = this.createBoundingVolume(
|
|
111
126
|
header.boundingVolume,
|
|
112
127
|
computedTransform
|
|
@@ -328,17 +343,6 @@ function Cesium3DTile(tileset, baseResource, header, parent) {
|
|
|
328
343
|
*/
|
|
329
344
|
this.hasMultipleContents = hasMultipleContents;
|
|
330
345
|
|
|
331
|
-
/**
|
|
332
|
-
* When tile metadata is present (3D Tiles 1.1) or the <code>3DTILES_metadata</code> extension is used,
|
|
333
|
-
* this stores a {@link TileMetadata} object for accessing tile metadata.
|
|
334
|
-
*
|
|
335
|
-
* @type {TileMetadata}
|
|
336
|
-
* @readonly
|
|
337
|
-
* @private
|
|
338
|
-
* @experimental This feature is using part of the 3D Tiles spec that is not final and is subject to change without Cesium's standard deprecation policy.
|
|
339
|
-
*/
|
|
340
|
-
this.metadata = findTileMetadata(tileset, header);
|
|
341
|
-
|
|
342
346
|
/**
|
|
343
347
|
* The node in the tileset's LRU cache, used to determine when to unload a tile's content.
|
|
344
348
|
*
|
|
@@ -1763,6 +1767,20 @@ Cesium3DTile.prototype.createBoundingVolume = function (
|
|
|
1763
1767
|
transform,
|
|
1764
1768
|
result
|
|
1765
1769
|
) {
|
|
1770
|
+
// if explicit tile metadata includes TILE_BOUNDING_BOX, TILE_BOUNDING_REGION,
|
|
1771
|
+
// or TILE_BOUNDING_SPHERE, override tile.boundingVolume.
|
|
1772
|
+
const tileMetadata = this.metadata;
|
|
1773
|
+
let metadataBoundingVolumeHeader;
|
|
1774
|
+
if (defined(tileMetadata)) {
|
|
1775
|
+
metadataBoundingVolumeHeader = BoundingVolumeSemantics.parseBoundingVolumeSemantic(
|
|
1776
|
+
"TILE",
|
|
1777
|
+
tileMetadata
|
|
1778
|
+
);
|
|
1779
|
+
}
|
|
1780
|
+
if (defined(metadataBoundingVolumeHeader)) {
|
|
1781
|
+
boundingVolumeHeader = metadataBoundingVolumeHeader;
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1766
1784
|
if (!defined(boundingVolumeHeader)) {
|
|
1767
1785
|
throw new RuntimeError("boundingVolume must be defined");
|
|
1768
1786
|
}
|
|
@@ -2003,8 +2021,8 @@ function updateContent(tile, tileset, frameState) {
|
|
|
2003
2021
|
* - clipping function (union v. intersection)
|
|
2004
2022
|
|
|
2005
2023
|
* @private
|
|
2006
|
-
* @param {Cesium3DTile} tile
|
|
2007
|
-
* @param {Cesium3DTileset} tileset
|
|
2024
|
+
* @param {Cesium3DTile} tile
|
|
2025
|
+
* @param {Cesium3DTileset} tileset
|
|
2008
2026
|
*/
|
|
2009
2027
|
function updateClippingPlanes(tile, tileset) {
|
|
2010
2028
|
const clippingPlanes = tileset.clippingPlanes;
|
|
@@ -14,7 +14,7 @@ import S2Cell from "../Core/S2Cell.js";
|
|
|
14
14
|
import ImplicitSubtree from "./ImplicitSubtree.js";
|
|
15
15
|
import hasExtension from "./hasExtension.js";
|
|
16
16
|
import MetadataSemantic from "./MetadataSemantic.js";
|
|
17
|
-
import
|
|
17
|
+
import BoundingVolumeSemantics from "./BoundingVolumeSemantics.js";
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* A specialized {@link Cesium3DTileContent} that lazily evaluates an implicit
|
|
@@ -465,7 +465,9 @@ function deriveChildTile(
|
|
|
465
465
|
if (defined(subtree.tilePropertyTableJson)) {
|
|
466
466
|
tileMetadata = subtree.getTileMetadataView(implicitCoordinates);
|
|
467
467
|
|
|
468
|
-
const boundingVolumeSemantics =
|
|
468
|
+
const boundingVolumeSemantics = BoundingVolumeSemantics.parseAllBoundingVolumeSemantics(
|
|
469
|
+
tileMetadata
|
|
470
|
+
);
|
|
469
471
|
tileBounds = boundingVolumeSemantics.tile;
|
|
470
472
|
contentBounds = boundingVolumeSemantics.content;
|
|
471
473
|
}
|