@cesium/engine 25.0.0 → 26.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/Workers/{chunk-GPIGURCG.js → chunk-3VFEWOBI.js} +7 -7
- package/Build/Workers/{chunk-BTX2NL3P.js → chunk-424RNO3D.js} +18 -18
- package/Build/Workers/{chunk-HSVQATK2.js → chunk-4MGMYHOO.js} +6 -6
- package/Build/Workers/{chunk-FIBS5S7R.js → chunk-4S7IE3LB.js} +2 -2
- package/Build/Workers/{chunk-A7ZBMVFS.js → chunk-52JDLOEM.js} +14 -14
- package/Build/Workers/{chunk-ZCCIIBZT.js → chunk-54I6Y66F.js} +6 -6
- package/Build/Workers/{chunk-J647NNZW.js → chunk-6YEE6JDR.js} +6 -6
- package/Build/Workers/{chunk-HVMG6AG4.js → chunk-7J2HKPRH.js} +9 -9
- package/Build/Workers/{chunk-K6NFIRFB.js → chunk-7WM2PX4V.js} +5 -5
- package/Build/Workers/{chunk-3LSD7OOA.js → chunk-ACXQXN46.js} +16 -16
- package/Build/Workers/{chunk-CZ23Y3RM.js → chunk-AYKR4VBR.js} +2 -2
- package/Build/Workers/{chunk-4MTRQFJP.js → chunk-C6J67V5A.js} +1 -1
- package/Build/Workers/{chunk-WTQGE7Q6.js → chunk-C6KNZ7T4.js} +17 -17
- package/Build/Workers/{chunk-AWFZHD2B.js → chunk-CFQP6LYM.js} +4 -4
- package/Build/Workers/{chunk-ST2UWDUU.js → chunk-CXOYE2WM.js} +5 -5
- package/Build/Workers/{chunk-H2A4USJR.js → chunk-CZEYZU4N.js} +10 -10
- package/Build/Workers/{chunk-DFEI5MAV.js → chunk-DBOEKL43.js} +7 -7
- package/Build/Workers/{chunk-A7A433MD.js → chunk-DDWSZVMY.js} +5 -5
- package/Build/Workers/{chunk-J7KQEKPK.js → chunk-DOBXCNC3.js} +13 -13
- package/Build/Workers/{chunk-URUCCIPS.js → chunk-E7VQ76KE.js} +6 -6
- package/Build/Workers/{chunk-ZAPOS52G.js → chunk-EBSIOBXY.js} +8 -8
- package/Build/Workers/{chunk-3VDDRF2E.js → chunk-EF2QYXGA.js} +14 -14
- package/Build/Workers/{chunk-WN6P5UDH.js → chunk-EPYXRCDB.js} +12 -12
- package/Build/Workers/{chunk-EZARA5FJ.js → chunk-F6QDY6HU.js} +13 -13
- package/Build/Workers/{chunk-GL7DNVUS.js → chunk-FRQZECAO.js} +5 -5
- package/Build/Workers/{chunk-VQKLRBIK.js → chunk-G7PXZRVF.js} +7 -7
- package/Build/Workers/{chunk-4QQXGTCE.js → chunk-INUEEEQA.js} +8 -8
- package/Build/Workers/{chunk-ITD2IN7N.js → chunk-IRBKFCEJ.js} +2 -2
- package/Build/Workers/{chunk-6SDGQI27.js → chunk-IYOUHCZB.js} +1 -1
- package/Build/Workers/{chunk-DYT5NR6P.js → chunk-J6BWOHUF.js} +3 -3
- package/Build/Workers/{chunk-4GF4MVPY.js → chunk-KFSTQKNM.js} +7 -7
- package/Build/Workers/{chunk-4XXHJI6Y.js → chunk-KKOSKAZB.js} +17 -17
- package/Build/Workers/{chunk-WC57YYBN.js → chunk-KSSWJIZW.js} +2 -2
- package/Build/Workers/{chunk-5T6QQAJW.js → chunk-M3B5JKSM.js} +1 -1
- package/Build/Workers/{chunk-QO2CGXMP.js → chunk-MPZHGZU6.js} +6 -6
- package/Build/Workers/{chunk-WUBKZFF6.js → chunk-MYP774IS.js} +9 -9
- package/Build/Workers/{chunk-WNN5D4W3.js → chunk-O3EA5HS7.js} +10 -10
- package/Build/Workers/{chunk-77RL3MBD.js → chunk-P3CK7MCY.js} +25 -4
- package/Build/Workers/{chunk-QXNQQYPV.js → chunk-Q3PY526V.js} +8 -8
- package/Build/Workers/{chunk-CKQP3DSS.js → chunk-QN67VG36.js} +6 -6
- package/Build/Workers/{chunk-ACFFCHHZ.js → chunk-QRWGUWI6.js} +11 -11
- package/Build/Workers/{chunk-LH5SF3XV.js → chunk-S4MCOY6I.js} +5 -5
- package/Build/Workers/{chunk-FVLVVOBQ.js → chunk-SMQZZOW6.js} +10 -10
- package/Build/Workers/{chunk-TA777BGS.js → chunk-TKKIREQ6.js} +1 -1
- package/Build/Workers/{chunk-AEAVLYPS.js → chunk-U3ZA64U7.js} +2 -2
- package/Build/Workers/{chunk-7LSFAEWF.js → chunk-UA25D5MX.js} +10 -10
- package/Build/Workers/{chunk-J3OFS2RD.js → chunk-UOOIQ3KX.js} +12 -12
- package/Build/Workers/{chunk-ND3NTTOF.js → chunk-V7VQKN6N.js} +6 -6
- package/Build/Workers/{chunk-I3A6DXYZ.js → chunk-VQYETPWC.js} +4 -4
- package/Build/Workers/{chunk-35H3UBIO.js → chunk-VWV2IJRB.js} +11 -11
- package/Build/Workers/{chunk-QSDY4NS7.js → chunk-XZMBNNDX.js} +9 -9
- package/Build/Workers/{chunk-TAI4HLII.js → chunk-Y57HREW5.js} +4 -4
- package/Build/Workers/{chunk-3TKLDHV3.js → chunk-Y5BF6AFU.js} +2 -2
- package/Build/Workers/{chunk-3XY3MVPG.js → chunk-YLY7NKAB.js} +4 -4
- package/Build/Workers/{chunk-BVAIWR7O.js → chunk-ZK3CF7ZD.js} +12 -12
- package/Build/Workers/{chunk-DH26SNAB.js → chunk-ZP7JMQV4.js} +1 -1
- package/Build/Workers/{chunk-3RFFPH4M.js → chunk-ZZ46LWL6.js} +1 -1
- 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 +22 -22
- 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 +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- 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 +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/Cartesian2.js +1 -1
- package/Source/Core/Cartesian3.js +1 -1
- package/Source/Core/Cartesian4.js +1 -1
- package/Source/Core/ComponentDatatype.js +35 -0
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/MapProjection.js +1 -0
- package/Source/Core/Matrix2.js +1 -1
- package/Source/Core/Matrix3.js +1 -1
- package/Source/Core/Matrix4.js +1 -1
- package/Source/Core/Resource.js +1 -1
- package/Source/Core/ScreenSpaceEventHandler.js +51 -41
- package/Source/Core/createColorRamp.js +37 -0
- package/Source/Core/globalTypes.js +25 -0
- package/Source/Renderer/Pass.js +3 -2
- package/Source/Renderer/createUniform.js +346 -239
- package/Source/Renderer/createUniformArray.js +494 -381
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/BufferPoint.js +1 -0
- package/Source/Scene/BufferPointCollection.js +14 -1
- package/Source/Scene/BufferPolygon.js +3 -2
- package/Source/Scene/BufferPolygonCollection.js +10 -0
- package/Source/Scene/BufferPolyline.js +1 -0
- package/Source/Scene/BufferPolylineCollection.js +2 -0
- package/Source/Scene/BufferPrimitiveCollection.js +79 -28
- package/Source/Scene/CameraEventAggregator.js +30 -18
- package/Source/Scene/Cesium3DTile.js +54 -1
- package/Source/Scene/Cesium3DTileContent.js +195 -254
- package/Source/Scene/Cesium3DTileContentFactory.js +10 -2
- package/Source/Scene/Cesium3DTileset.js +45 -5
- package/Source/Scene/Composite3DTileContent.js +254 -292
- package/Source/Scene/EdgeDisplayMode.js +50 -0
- package/Source/Scene/Empty3DTileContent.js +100 -132
- package/Source/Scene/GaussianSplat3DTileContent.js +436 -478
- package/Source/Scene/GeoJsonPrimitive.js +874 -0
- package/Source/Scene/Geometry3DTileContent.js +151 -185
- package/Source/Scene/GltfLoader.js +109 -0
- package/Source/Scene/Implicit3DTileContent.js +179 -214
- package/Source/Scene/MVTDataProvider.js +147 -0
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +79 -311
- package/Source/Scene/Model/Model.js +34 -0
- package/Source/Scene/Model/Model3DTileContent.js +424 -458
- package/Source/Scene/Model/ModelDrawCommand.js +31 -3
- package/Source/Scene/Model/ModelUtility.js +4 -0
- package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +466 -150
- package/Source/Scene/ModelComponents.js +39 -1
- package/Source/Scene/Multiple3DTileContent.js +291 -334
- package/Source/Scene/Scene.js +26 -0
- package/Source/Scene/Tileset3DTileContent.js +113 -146
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +499 -0
- package/Source/Scene/Vector3DTileContent.js +205 -234
- package/Source/Scene/VectorGltf3DTileContent.js +85 -36
- package/Source/Scene/VoxelPrimitive.js +159 -175
- package/Source/Scene/VoxelProvider.js +64 -91
- package/Source/Scene/buildVectorGltfFromMVT.js +1059 -0
- package/Source/Scene/buildVoxelCustomShader.js +199 -0
- package/Source/Scene/decodeMVT.js +634 -0
- package/Source/Scene/renderBufferPointCollection.js +110 -64
- package/Source/Scene/renderBufferPolygonCollection.js +102 -55
- package/Source/Scene/renderBufferPolylineCollection.js +365 -166
- package/Source/Shaders/BufferPointMaterialFS.glsl +1 -0
- package/Source/Shaders/BufferPointMaterialFS.js +1 -0
- package/Source/Shaders/BufferPointMaterialVS.glsl +19 -9
- package/Source/Shaders/BufferPointMaterialVS.js +20 -10
- package/Source/Shaders/BufferPolygonMaterialVS.glsl +13 -4
- package/Source/Shaders/BufferPolygonMaterialVS.js +14 -5
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +16 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +17 -3
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
- package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +0 -1
- package/Source/Shaders/Model/EdgeVisibilityStageVS.js +0 -1
- package/index.d.ts +253 -35
- package/index.js +71 -62
- package/package.json +2 -2
|
@@ -13,147 +13,172 @@ import Vector3DTileGeometry from "./Vector3DTileGeometry.js";
|
|
|
13
13
|
* Implements the {@link Cesium3DTileContent} interface.
|
|
14
14
|
* </p>
|
|
15
15
|
*
|
|
16
|
-
* @
|
|
17
|
-
* @constructor
|
|
18
|
-
*
|
|
16
|
+
* @implements Cesium3DTileContent
|
|
19
17
|
* @private
|
|
20
18
|
*/
|
|
21
|
-
|
|
22
|
-
tileset,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
) {
|
|
28
|
-
this._tileset = tileset;
|
|
29
|
-
this._tile = tile;
|
|
30
|
-
this._resource = resource;
|
|
31
|
-
this._geometries = undefined;
|
|
32
|
-
|
|
33
|
-
this._metadata = undefined;
|
|
34
|
-
|
|
35
|
-
this._batchTable = undefined;
|
|
36
|
-
this._features = undefined;
|
|
19
|
+
class Geometry3DTileContent {
|
|
20
|
+
constructor(tileset, tile, resource, arrayBuffer, byteOffset) {
|
|
21
|
+
this._tileset = tileset;
|
|
22
|
+
this._tile = tile;
|
|
23
|
+
this._resource = resource;
|
|
24
|
+
this._geometries = undefined;
|
|
37
25
|
|
|
38
|
-
|
|
39
|
-
* Part of the {@link Cesium3DTileContent} interface.
|
|
40
|
-
*/
|
|
41
|
-
this.featurePropertiesDirty = false;
|
|
42
|
-
this._group = undefined;
|
|
26
|
+
this._metadata = undefined;
|
|
43
27
|
|
|
44
|
-
|
|
28
|
+
this._batchTable = undefined;
|
|
29
|
+
this._features = undefined;
|
|
45
30
|
|
|
46
|
-
|
|
47
|
-
}
|
|
31
|
+
/**
|
|
32
|
+
* Part of the {@link Cesium3DTileContent} interface.
|
|
33
|
+
*/
|
|
34
|
+
this.featurePropertiesDirty = false;
|
|
35
|
+
this._group = undefined;
|
|
48
36
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
trianglesLength
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
? this._batchTable.batchTableByteLength
|
|
90
|
-
: 0;
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
innerContents: {
|
|
95
|
-
get: function () {
|
|
96
|
-
return undefined;
|
|
97
|
-
},
|
|
98
|
-
},
|
|
37
|
+
this._ready = false;
|
|
38
|
+
|
|
39
|
+
initialize(this, arrayBuffer, byteOffset);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get featuresLength() {
|
|
43
|
+
return defined(this._batchTable) ? this._batchTable.featuresLength : 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
get pointsLength() {
|
|
47
|
+
return 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
get trianglesLength() {
|
|
51
|
+
if (defined(this._geometries)) {
|
|
52
|
+
return this._geometries.trianglesLength;
|
|
53
|
+
}
|
|
54
|
+
return 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
get geometryByteLength() {
|
|
58
|
+
if (defined(this._geometries)) {
|
|
59
|
+
return this._geometries.geometryByteLength;
|
|
60
|
+
}
|
|
61
|
+
return 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
get texturesByteLength() {
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
get batchTableByteLength() {
|
|
69
|
+
return defined(this._batchTable)
|
|
70
|
+
? this._batchTable.batchTableByteLength
|
|
71
|
+
: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
get innerContents() {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
99
77
|
|
|
100
78
|
/**
|
|
101
79
|
* Returns true when the tile's content is ready to render; otherwise false
|
|
102
80
|
*
|
|
103
|
-
* @memberof Geometry3DTileContent.prototype
|
|
104
81
|
*
|
|
105
82
|
* @type {boolean}
|
|
106
83
|
* @readonly
|
|
107
84
|
* @private
|
|
108
85
|
*/
|
|
109
|
-
ready
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
})
|
|
86
|
+
get ready() {
|
|
87
|
+
return this._ready;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
get tileset() {
|
|
91
|
+
return this._tileset;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
get tile() {
|
|
95
|
+
return this._tile;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
get url() {
|
|
99
|
+
return this._resource.getUrlComponent(true);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
get metadata() {
|
|
103
|
+
return this._metadata;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
set metadata(value) {
|
|
107
|
+
this._metadata = value;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
get batchTable() {
|
|
111
|
+
return this._batchTable;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
get group() {
|
|
115
|
+
return this._group;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
set group(value) {
|
|
119
|
+
this._group = value;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
hasProperty(batchId, name) {
|
|
123
|
+
return this._batchTable.hasProperty(batchId, name);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
getFeature(batchId) {
|
|
127
|
+
//>>includeStart('debug', pragmas.debug);
|
|
128
|
+
const featuresLength = this.featuresLength;
|
|
129
|
+
if (!defined(batchId) || batchId < 0 || batchId >= featuresLength) {
|
|
130
|
+
throw new DeveloperError(
|
|
131
|
+
`batchId is required and between zero and featuresLength - 1 (${
|
|
132
|
+
featuresLength - 1
|
|
133
|
+
}).`,
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
//>>includeEnd('debug');
|
|
137
|
+
|
|
138
|
+
createFeatures(this);
|
|
139
|
+
return this._features[batchId];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
applyDebugSettings(enabled, color) {
|
|
143
|
+
if (defined(this._geometries)) {
|
|
144
|
+
this._geometries.applyDebugSettings(enabled, color);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
applyStyle(style) {
|
|
149
|
+
createFeatures(this);
|
|
150
|
+
if (defined(this._geometries)) {
|
|
151
|
+
this._geometries.applyStyle(style, this._features);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
update(tileset, frameState) {
|
|
156
|
+
if (defined(this._geometries)) {
|
|
157
|
+
this._geometries.classificationType = this._tileset.classificationType;
|
|
158
|
+
this._geometries.debugWireframe = this._tileset.debugWireframe;
|
|
159
|
+
this._geometries.update(frameState);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (defined(this._batchTable) && this._geometries.ready) {
|
|
163
|
+
this._batchTable.update(tileset, frameState);
|
|
164
|
+
this._ready = true;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
pick(ray, frameState, result) {
|
|
169
|
+
return undefined;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
isDestroyed() {
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
destroy() {
|
|
177
|
+
this._geometries = this._geometries && this._geometries.destroy();
|
|
178
|
+
this._batchTable = this._batchTable && this._batchTable.destroy();
|
|
179
|
+
return destroyObject(this);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
157
182
|
|
|
158
183
|
function createColorChangedCallback(content) {
|
|
159
184
|
return function (batchId, color) {
|
|
@@ -472,63 +497,4 @@ function createFeatures(content) {
|
|
|
472
497
|
}
|
|
473
498
|
}
|
|
474
499
|
|
|
475
|
-
Geometry3DTileContent.prototype.hasProperty = function (batchId, name) {
|
|
476
|
-
return this._batchTable.hasProperty(batchId, name);
|
|
477
|
-
};
|
|
478
|
-
|
|
479
|
-
Geometry3DTileContent.prototype.getFeature = function (batchId) {
|
|
480
|
-
//>>includeStart('debug', pragmas.debug);
|
|
481
|
-
const featuresLength = this.featuresLength;
|
|
482
|
-
if (!defined(batchId) || batchId < 0 || batchId >= featuresLength) {
|
|
483
|
-
throw new DeveloperError(
|
|
484
|
-
`batchId is required and between zero and featuresLength - 1 (${
|
|
485
|
-
featuresLength - 1
|
|
486
|
-
}).`,
|
|
487
|
-
);
|
|
488
|
-
}
|
|
489
|
-
//>>includeEnd('debug');
|
|
490
|
-
|
|
491
|
-
createFeatures(this);
|
|
492
|
-
return this._features[batchId];
|
|
493
|
-
};
|
|
494
|
-
|
|
495
|
-
Geometry3DTileContent.prototype.applyDebugSettings = function (enabled, color) {
|
|
496
|
-
if (defined(this._geometries)) {
|
|
497
|
-
this._geometries.applyDebugSettings(enabled, color);
|
|
498
|
-
}
|
|
499
|
-
};
|
|
500
|
-
|
|
501
|
-
Geometry3DTileContent.prototype.applyStyle = function (style) {
|
|
502
|
-
createFeatures(this);
|
|
503
|
-
if (defined(this._geometries)) {
|
|
504
|
-
this._geometries.applyStyle(style, this._features);
|
|
505
|
-
}
|
|
506
|
-
};
|
|
507
|
-
|
|
508
|
-
Geometry3DTileContent.prototype.update = function (tileset, frameState) {
|
|
509
|
-
if (defined(this._geometries)) {
|
|
510
|
-
this._geometries.classificationType = this._tileset.classificationType;
|
|
511
|
-
this._geometries.debugWireframe = this._tileset.debugWireframe;
|
|
512
|
-
this._geometries.update(frameState);
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
if (defined(this._batchTable) && this._geometries.ready) {
|
|
516
|
-
this._batchTable.update(tileset, frameState);
|
|
517
|
-
this._ready = true;
|
|
518
|
-
}
|
|
519
|
-
};
|
|
520
|
-
|
|
521
|
-
Geometry3DTileContent.prototype.pick = function (ray, frameState, result) {
|
|
522
|
-
return undefined;
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
Geometry3DTileContent.prototype.isDestroyed = function () {
|
|
526
|
-
return false;
|
|
527
|
-
};
|
|
528
|
-
|
|
529
|
-
Geometry3DTileContent.prototype.destroy = function () {
|
|
530
|
-
this._geometries = this._geometries && this._geometries.destroy();
|
|
531
|
-
this._batchTable = this._batchTable && this._batchTable.destroy();
|
|
532
|
-
return destroyObject(this);
|
|
533
|
-
};
|
|
534
500
|
export default Geometry3DTileContent;
|
|
@@ -64,6 +64,7 @@ const {
|
|
|
64
64
|
LineStyle,
|
|
65
65
|
Material,
|
|
66
66
|
Vector,
|
|
67
|
+
Polygon,
|
|
67
68
|
} = ModelComponents;
|
|
68
69
|
|
|
69
70
|
/**
|
|
@@ -899,6 +900,38 @@ function loadAccessor(loader, accessor, useQuaternion) {
|
|
|
899
900
|
return loadDefaultAccessorValues(accessor, values);
|
|
900
901
|
}
|
|
901
902
|
|
|
903
|
+
function loadAccessorTypedArray(loader, accessor) {
|
|
904
|
+
const values = ComponentDatatype.createTypedArray(
|
|
905
|
+
accessor.componentType,
|
|
906
|
+
accessor.count * AttributeType.getNumberOfComponents(accessor.type),
|
|
907
|
+
);
|
|
908
|
+
|
|
909
|
+
if (!defined(accessor.bufferView)) {
|
|
910
|
+
return values;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
const bufferViewLoader = getBufferViewLoader(loader, accessor.bufferView);
|
|
914
|
+
|
|
915
|
+
// Save a link to the gltfJson, which is removed after bufferViewLoader.load()
|
|
916
|
+
const { gltfJson } = loader;
|
|
917
|
+
|
|
918
|
+
const promise = bufferViewLoader.load().then(() => {
|
|
919
|
+
if (loader.isDestroyed()) {
|
|
920
|
+
return;
|
|
921
|
+
}
|
|
922
|
+
const result = getPackedTypedArray(
|
|
923
|
+
gltfJson,
|
|
924
|
+
accessor,
|
|
925
|
+
bufferViewLoader.typedArray,
|
|
926
|
+
);
|
|
927
|
+
values.set(result);
|
|
928
|
+
});
|
|
929
|
+
|
|
930
|
+
loader._loaderPromises.push(promise);
|
|
931
|
+
|
|
932
|
+
return values;
|
|
933
|
+
}
|
|
934
|
+
|
|
902
935
|
function fromArray(MathType, values) {
|
|
903
936
|
if (!defined(values)) {
|
|
904
937
|
return undefined;
|
|
@@ -2208,6 +2241,17 @@ function loadPrimitive(loader, gltfPrimitive, hasInstances, frameState) {
|
|
|
2208
2241
|
}
|
|
2209
2242
|
|
|
2210
2243
|
const extensions = gltfPrimitive.extensions ?? Frozen.EMPTY_OBJECT;
|
|
2244
|
+
|
|
2245
|
+
const polygonExtension = extensions.EXT_mesh_polygon;
|
|
2246
|
+
if (defined(polygonExtension)) {
|
|
2247
|
+
primitive.polygon = loadMeshPolygonExtension(
|
|
2248
|
+
loader,
|
|
2249
|
+
gltfPrimitive,
|
|
2250
|
+
polygonExtension,
|
|
2251
|
+
);
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
// @deprecated CESIUM_mesh_vector to be removed after v1.142 release.
|
|
2211
2255
|
const meshVectorExtension = extensions.CESIUM_mesh_vector;
|
|
2212
2256
|
if (defined(meshVectorExtension)) {
|
|
2213
2257
|
primitive.vector = loadMeshVectorExtension(loader, meshVectorExtension);
|
|
@@ -2365,12 +2409,77 @@ function loadPrimitiveOutline(loader, outlineExtension) {
|
|
|
2365
2409
|
return loadAccessor(loader, accessor, useQuaternion);
|
|
2366
2410
|
}
|
|
2367
2411
|
|
|
2412
|
+
/**
|
|
2413
|
+
* @typedef {object} EXTMeshPolygonExtension
|
|
2414
|
+
* @property {number} count
|
|
2415
|
+
* @property {number} indicesOffsets
|
|
2416
|
+
* @property {number} [loopIndices]
|
|
2417
|
+
* @property {number} [loopIndicesOffsets]
|
|
2418
|
+
* @property {number} [triangleIndices]
|
|
2419
|
+
* @property {number} [triangleIndicesOffsets]
|
|
2420
|
+
*/
|
|
2421
|
+
|
|
2422
|
+
/**
|
|
2423
|
+
* Load EXT_mesh_polygon.
|
|
2424
|
+
* @param {GltfLoader} loader
|
|
2425
|
+
* @param {object} gltfPrimitive
|
|
2426
|
+
* @param {EXTMeshPolygonExtension} polygonExtension
|
|
2427
|
+
* @returns {ModelComponents.Polygon}
|
|
2428
|
+
* @ignore
|
|
2429
|
+
*/
|
|
2430
|
+
function loadMeshPolygonExtension(loader, gltfPrimitive, polygonExtension) {
|
|
2431
|
+
const result = new Polygon();
|
|
2432
|
+
const accessors = loader.gltfJson.accessors;
|
|
2433
|
+
|
|
2434
|
+
result.count = polygonExtension.count;
|
|
2435
|
+
|
|
2436
|
+
// See ModelComponents.Polygon definition.
|
|
2437
|
+
if (gltfPrimitive.mode === PrimitiveType.LINE_LOOP) {
|
|
2438
|
+
result.loopIndices = loadAccessorTypedArray(
|
|
2439
|
+
loader,
|
|
2440
|
+
accessors[gltfPrimitive.indices],
|
|
2441
|
+
);
|
|
2442
|
+
result.loopIndicesOffsets = loadAccessorTypedArray(
|
|
2443
|
+
loader,
|
|
2444
|
+
accessors[polygonExtension.indicesOffsets],
|
|
2445
|
+
);
|
|
2446
|
+
result.triangleIndices = loadAccessorTypedArray(
|
|
2447
|
+
loader,
|
|
2448
|
+
accessors[polygonExtension.triangleIndices],
|
|
2449
|
+
);
|
|
2450
|
+
result.triangleIndicesOffsets = loadAccessorTypedArray(
|
|
2451
|
+
loader,
|
|
2452
|
+
accessors[polygonExtension.triangleIndicesOffsets],
|
|
2453
|
+
);
|
|
2454
|
+
} else if (gltfPrimitive.mode === PrimitiveType.TRIANGLES) {
|
|
2455
|
+
result.loopIndices = loadAccessorTypedArray(
|
|
2456
|
+
loader,
|
|
2457
|
+
accessors[polygonExtension.loopIndices],
|
|
2458
|
+
);
|
|
2459
|
+
result.loopIndicesOffsets = loadAccessorTypedArray(
|
|
2460
|
+
loader,
|
|
2461
|
+
accessors[polygonExtension.loopIndicesOffsets],
|
|
2462
|
+
);
|
|
2463
|
+
result.triangleIndices = loadAccessorTypedArray(
|
|
2464
|
+
loader,
|
|
2465
|
+
accessors[gltfPrimitive.indices],
|
|
2466
|
+
);
|
|
2467
|
+
result.triangleIndicesOffsets = loadAccessorTypedArray(
|
|
2468
|
+
loader,
|
|
2469
|
+
accessors[polygonExtension.indicesOffsets],
|
|
2470
|
+
);
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2473
|
+
return result;
|
|
2474
|
+
}
|
|
2475
|
+
|
|
2368
2476
|
/**
|
|
2369
2477
|
* Load CESIUM_mesh_vector.
|
|
2370
2478
|
* @param {GltfLoader} loader
|
|
2371
2479
|
* @param {*} meshVectorExtension
|
|
2372
2480
|
* @returns {ModelComponents.Vector}
|
|
2373
2481
|
* @ignore
|
|
2482
|
+
* @deprecated
|
|
2374
2483
|
*/
|
|
2375
2484
|
function loadMeshVectorExtension(loader, meshVectorExtension) {
|
|
2376
2485
|
if (!defined(meshVectorExtension)) {
|