@cesium/engine 23.0.0 → 24.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-QTOHIXGF.js → chunk-2N4KDHS3.js} +10 -10
- package/Build/Workers/{chunk-SQTRWKO2.js → chunk-44EMEGKW.js} +5 -5
- package/Build/Workers/{chunk-OHBM4YG4.js → chunk-4TIG36AW.js} +12 -12
- package/Build/Workers/{chunk-BNBD2YZK.js → chunk-5A2SW66E.js} +16 -16
- package/Build/Workers/{chunk-52K3GJKG.js → chunk-5GXYJQ2K.js} +3 -3
- package/Build/Workers/{chunk-NQCAZU7S.js → chunk-63SIWPLS.js} +13 -13
- package/Build/Workers/{chunk-UEEGWJJP.js → chunk-6MPGQEHA.js} +2 -2
- package/Build/Workers/{chunk-PQVNT5CJ.js → chunk-6RMS4S72.js} +6 -6
- package/Build/Workers/{chunk-HYTFXWMY.js → chunk-6WLHJFD3.js} +7 -7
- package/Build/Workers/{chunk-DT5SJBKA.js → chunk-72VYSVEW.js} +9 -9
- package/Build/Workers/{chunk-JUGY5AZN.js → chunk-7MDYBRYJ.js} +4 -4
- package/Build/Workers/{chunk-6SLGTBB2.js → chunk-7O5XJTVE.js} +5 -5
- package/Build/Workers/{chunk-4UNQX2MP.js → chunk-7QRFIKWQ.js} +2 -2
- package/Build/Workers/{chunk-GN5NEUDT.js → chunk-7TYLCBGK.js} +8 -8
- package/Build/Workers/{chunk-SGKTBHFQ.js → chunk-7X322WP2.js} +13 -13
- package/Build/Workers/{chunk-T43FXHNC.js → chunk-A47HVBC5.js} +7 -7
- package/Build/Workers/{chunk-FSDVXW7M.js → chunk-AF3MU2RL.js} +5 -5
- package/Build/Workers/{chunk-3B65YFXC.js → chunk-AJLTU6PF.js} +1 -1
- package/Build/Workers/{chunk-OQ3EAJNW.js → chunk-AMIHNSST.js} +2 -2
- package/Build/Workers/{chunk-N4AWE7TZ.js → chunk-B6SCUUFP.js} +10 -10
- package/Build/Workers/{chunk-OMXN7YF4.js → chunk-BJD6QGXZ.js} +12 -12
- package/Build/Workers/{chunk-APDKMX7W.js → chunk-C6P4IG5P.js} +6 -6
- package/Build/Workers/{chunk-QA24Q62E.js → chunk-D4EJ2NXG.js} +17 -17
- package/Build/Workers/{chunk-HYLEKKO5.js → chunk-DHKPFLSJ.js} +1 -1
- package/Build/Workers/{chunk-MQJG522T.js → chunk-DVB56LG7.js} +6 -6
- package/Build/Workers/{chunk-Y5AJSEEN.js → chunk-EDXL4W76.js} +2 -2
- package/Build/Workers/{chunk-QQX7S5QT.js → chunk-EV3VGO6Y.js} +17 -17
- package/Build/Workers/{chunk-IFA7VHHP.js → chunk-GOQBUCXH.js} +10 -10
- package/Build/Workers/{chunk-5A7YSAXT.js → chunk-GQUNK2XC.js} +14 -14
- package/Build/Workers/{chunk-36LBFITA.js → chunk-HKUES6UG.js} +12 -12
- package/Build/Workers/{chunk-OC6X22PG.js → chunk-HRHRYFHS.js} +9 -9
- package/Build/Workers/{chunk-L7RDJ4V7.js → chunk-HXJMS2ZI.js} +1 -1
- package/Build/Workers/{chunk-NAYRNPEP.js → chunk-ILMFADZA.js} +4 -4
- package/Build/Workers/{chunk-AA33B6PU.js → chunk-ISY4EZCA.js} +4 -4
- package/Build/Workers/{chunk-7KRN6JPQ.js → chunk-J6AW5YHS.js} +14 -14
- package/Build/Workers/{chunk-OQBPOKPZ.js → chunk-JCI63T3K.js} +6 -6
- package/Build/Workers/{chunk-2WI4HGJU.js → chunk-KLPGTXS3.js} +6 -6
- package/Build/Workers/{chunk-5R7SBUTW.js → chunk-LIB2H534.js} +10 -10
- package/Build/Workers/{chunk-IYVDOB5V.js → chunk-LXMCPFFS.js} +4 -4
- package/Build/Workers/{chunk-NUYLNQKV.js → chunk-MKM27KGV.js} +2 -2
- package/Build/Workers/{chunk-R7M4XNPP.js → chunk-N65BAKSH.js} +8 -8
- package/Build/Workers/{chunk-4LGFX2P5.js → chunk-NKT5K3K3.js} +11 -11
- package/Build/Workers/{chunk-NNHU33JK.js → chunk-NPF7SSHZ.js} +7 -7
- package/Build/Workers/{chunk-LDQWNMEC.js → chunk-PVV64VFW.js} +1 -1
- package/Build/Workers/{chunk-WKXDCVBO.js → chunk-Q3C6VQH6.js} +4 -4
- package/Build/Workers/{chunk-ARCFIOKA.js → chunk-RQNJD3O4.js} +12 -12
- package/Build/Workers/{chunk-G3YT7M7A.js → chunk-UIGVOKKI.js} +1 -1
- package/Build/Workers/{chunk-ZIW5FCIW.js → chunk-UQU4RXLT.js} +27 -19
- package/Build/Workers/{chunk-MT5M7RLZ.js → chunk-VLDEUTOP.js} +2 -2
- package/Build/Workers/{chunk-5JP5FG7U.js → chunk-VMVOUQ5J.js} +7 -7
- package/Build/Workers/{chunk-2GL2EUEE.js → chunk-XJRBB253.js} +11 -11
- package/Build/Workers/{chunk-ESD4IEOU.js → chunk-XY6HMDGI.js} +5 -5
- package/Build/Workers/{chunk-56OHFSLH.js → chunk-Y7HNNPNK.js} +10 -10
- package/Build/Workers/{chunk-6FVFM2KB.js → chunk-YAOZMOFL.js} +5 -5
- package/Build/Workers/{chunk-AP6XWET5.js → chunk-YJZGW74L.js} +8 -8
- package/Build/Workers/{chunk-KPYU6YZG.js → chunk-YQFTYQMZ.js} +1 -1
- package/Build/Workers/{chunk-5VKZVPO5.js → chunk-ZBZRTRJB.js} +10 -10
- 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 +25 -25
- package/Build/Workers/createWallOutlineGeometry.js +24 -24
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +12 -12
- 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/BoundingSphere.js +1 -1
- package/Source/Core/Cartesian2.js +7 -5
- package/Source/Core/Cartesian3.js +8 -6
- package/Source/Core/Cartesian4.js +8 -6
- package/Source/Core/Color.js +5 -3
- package/Source/Core/DeveloperError.js +2 -1
- package/Source/Core/ITwinPlatform.js +1 -0
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/S2Cell.js +2 -2
- package/Source/Core/TerrainMesh.js +10 -1
- package/Source/Core/TerrainPicker.js +1 -0
- package/Source/Core/WallGeometry.js +1 -1
- package/Source/Core/WallOutlineGeometry.js +1 -1
- package/Source/Core/assert.js +27 -0
- package/Source/Core/globalTypes.js +4 -0
- package/Source/DataSources/CzmlDataSource.js +9 -0
- package/Source/DataSources/PathGraphics.js +13 -0
- package/Source/DataSources/PathVisualizer.js +330 -18
- package/Source/DataSources/StaticGeometryColorBatch.js +7 -2
- package/Source/DataSources/StaticGeometryPerMaterialBatch.js +7 -2
- package/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js +3 -1
- package/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js +3 -1
- package/Source/Renderer/Context.js +1 -1
- package/Source/Renderer/RenderState.js +2 -2
- package/Source/Renderer/VertexArray.js +80 -0
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/BillboardCollection.js +65 -364
- package/Source/Scene/BufferPoint.js +148 -0
- package/Source/Scene/BufferPointCollection.js +135 -0
- package/Source/Scene/BufferPointMaterial.js +95 -0
- package/Source/Scene/BufferPolygon.js +516 -0
- package/Source/Scene/BufferPolygonCollection.js +368 -0
- package/Source/Scene/BufferPolygonMaterial.js +41 -0
- package/Source/Scene/BufferPolyline.js +185 -0
- package/Source/Scene/BufferPolylineCollection.js +136 -0
- package/Source/Scene/BufferPolylineMaterial.js +93 -0
- package/Source/Scene/BufferPrimitive.js +347 -0
- package/Source/Scene/BufferPrimitiveCollection.js +702 -0
- package/Source/Scene/BufferPrimitiveMaterial.js +140 -0
- package/Source/Scene/Cesium3DTileContent.js +5 -1
- package/Source/Scene/Cesium3DTileContentFactory.js +9 -0
- package/Source/Scene/Cesium3DTileStyle.js +22 -0
- package/Source/Scene/Cesium3DTileset.js +1 -0
- package/Source/Scene/ClippingPolygonCollection.js +270 -101
- package/Source/Scene/CubeMapPanorama.js +4 -4
- package/Source/Scene/GaussianSplat3DTileContent.js +40 -46
- package/Source/Scene/GaussianSplatPrimitive.js +413 -70
- package/Source/Scene/GetFeatureInfoFormat.js +3 -3
- package/Source/Scene/GltfLoader.js +227 -34
- package/Source/Scene/GltfSpzLoader.js +109 -0
- package/Source/Scene/ITwinData.js +1 -0
- package/Source/Scene/Label.js +32 -0
- package/Source/Scene/LabelCollection.js +14 -13
- package/Source/Scene/Material.js +2 -0
- package/Source/Scene/Megatexture.js +1 -0
- package/Source/Scene/MetadataClassProperty.js +24 -10
- package/Source/Scene/MetadataComponentType.js +115 -23
- package/Source/Scene/Model/CustomShaderPipelineStage.js +3 -1
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +761 -263
- package/Source/Scene/Model/MaterialPipelineStage.js +147 -0
- package/Source/Scene/Model/MetadataPipelineStage.js +3 -3
- package/Source/Scene/Model/ModelDrawCommand.js +6 -0
- package/Source/Scene/Model/ModelReader.js +1 -1
- package/Source/Scene/Model/ModelUtility.js +3 -1
- package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +330 -0
- package/Source/Scene/ModelComponents.js +1632 -1542
- package/Source/Scene/PickedMetadataInfo.js +1 -0
- package/Source/Scene/ScreenSpaceCameraController.js +13 -0
- package/Source/Scene/SkyBox.js +17 -8
- package/Source/Scene/TileBoundingRegion.js +1 -1
- package/Source/Scene/TileBoundingS2Cell.js +1 -1
- package/Source/Scene/TileBoundingSphere.js +1 -1
- package/Source/Scene/TweenCollection.js +7 -0
- package/Source/Scene/VectorGltf3DTileContent.js +382 -0
- package/Source/Scene/VertexAttributeSemantic.js +14 -0
- package/Source/Scene/WebMapServiceImageryProvider.js +2 -2
- package/Source/Scene/WebMapTileServiceImageryProvider.js +366 -131
- package/Source/Scene/parseStructuralMetadata.js +97 -37
- package/Source/Scene/renderBufferPointCollection.js +334 -0
- package/Source/Scene/renderBufferPolygonCollection.js +386 -0
- package/Source/Scene/renderBufferPolylineCollection.js +529 -0
- package/Source/Shaders/BillboardCollectionFS.glsl +2 -77
- package/Source/Shaders/BillboardCollectionFS.js +2 -77
- package/Source/Shaders/BillboardCollectionVS.glsl +2 -60
- package/Source/Shaders/BillboardCollectionVS.js +2 -60
- package/Source/Shaders/BufferPointMaterialFS.glsl +27 -0
- package/Source/Shaders/BufferPointMaterialFS.js +29 -0
- package/Source/Shaders/BufferPointMaterialVS.glsl +48 -0
- package/Source/Shaders/BufferPointMaterialVS.js +50 -0
- package/Source/Shaders/BufferPolygonMaterialFS.glsl +13 -0
- package/Source/Shaders/BufferPolygonMaterialFS.js +15 -0
- package/Source/Shaders/BufferPolygonMaterialVS.glsl +30 -0
- package/Source/Shaders/BufferPolygonMaterialVS.js +32 -0
- package/Source/Shaders/BufferPolylineMaterialFS.glsl +13 -0
- package/Source/Shaders/BufferPolylineMaterialFS.js +15 -0
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +49 -0
- package/Source/Shaders/BufferPolylineMaterialVS.js +51 -0
- package/Source/Shaders/Model/EdgeVisibilityStageFS.glsl +34 -48
- package/Source/Shaders/Model/EdgeVisibilityStageFS.js +34 -49
- package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +98 -0
- package/Source/Shaders/Model/EdgeVisibilityStageVS.js +100 -0
- package/Source/Shaders/Model/ModelFS.glsl +15 -0
- package/Source/Shaders/Model/ModelFS.js +15 -0
- package/Source/Shaders/Model/ModelVS.glsl +8 -0
- package/Source/Shaders/Model/ModelVS.js +8 -0
- package/Source/Shaders/PolygonSignedDistanceFS.glsl +64 -33
- package/Source/Shaders/PolygonSignedDistanceFS.js +64 -33
- package/Source/Shaders/PrimitiveGaussianSplatVS.glsl +9 -2
- package/Source/Shaders/PrimitiveGaussianSplatVS.js +9 -2
- package/Source/Shaders/Voxels/VoxelFS.glsl +1 -1
- package/Source/Shaders/Voxels/VoxelFS.js +1 -1
- package/Source/Workers/decodeDraco.js +3 -0
- package/Source/Workers/decodeI3S.js +5 -2
- package/index.d.ts +1007 -111
- package/index.js +368 -343
- package/package.json +2 -2
|
@@ -8,6 +8,7 @@ import MaterialStageFS from "../../Shaders/Model/MaterialStageFS.js";
|
|
|
8
8
|
import AlphaMode from "../AlphaMode.js";
|
|
9
9
|
import ModelComponents from "../ModelComponents.js";
|
|
10
10
|
import VertexAttributeSemantic from "../VertexAttributeSemantic.js";
|
|
11
|
+
import PrimitiveType from "../../Core/PrimitiveType.js";
|
|
11
12
|
import LightingModel from "./LightingModel.js";
|
|
12
13
|
import ModelUtility from "./ModelUtility.js";
|
|
13
14
|
|
|
@@ -184,6 +185,16 @@ MaterialPipelineStage.process = function (
|
|
|
184
185
|
};
|
|
185
186
|
}
|
|
186
187
|
|
|
188
|
+
if (defined(material.lineStyle)) {
|
|
189
|
+
processLineStyleUniforms(
|
|
190
|
+
material.lineStyle,
|
|
191
|
+
primitive,
|
|
192
|
+
frameState,
|
|
193
|
+
uniformMap,
|
|
194
|
+
shaderBuilder,
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
187
198
|
shaderBuilder.addFragmentLines(MaterialStageFS);
|
|
188
199
|
|
|
189
200
|
if (material.doubleSided) {
|
|
@@ -195,6 +206,142 @@ MaterialPipelineStage.process = function (
|
|
|
195
206
|
}
|
|
196
207
|
};
|
|
197
208
|
|
|
209
|
+
/**
|
|
210
|
+
* Add uniforms and defines for the BENTLEY_materials_line_style extension.
|
|
211
|
+
*
|
|
212
|
+
* @param {ModelComponents.LineStyle} lineStyle The line style properties.
|
|
213
|
+
* @param {ModelComponents.Primitive} primitive The primitive being processed.
|
|
214
|
+
* @param {FrameState} frameState The frame state.
|
|
215
|
+
* @param {object} uniformMap The uniform map for the primitive.
|
|
216
|
+
* @param {ShaderBuilder} shaderBuilder The shader builder to modify.
|
|
217
|
+
* @private
|
|
218
|
+
*/
|
|
219
|
+
function processLineStyleUniforms(
|
|
220
|
+
lineStyle,
|
|
221
|
+
primitive,
|
|
222
|
+
frameState,
|
|
223
|
+
uniformMap,
|
|
224
|
+
shaderBuilder,
|
|
225
|
+
) {
|
|
226
|
+
const { width, pattern } = lineStyle;
|
|
227
|
+
|
|
228
|
+
if (defined(width)) {
|
|
229
|
+
shaderBuilder.addUniform("float", "u_lineWidth", ShaderDestination.VERTEX);
|
|
230
|
+
uniformMap.u_lineWidth = function () {
|
|
231
|
+
return width * frameState.pixelRatio;
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (defined(pattern)) {
|
|
236
|
+
shaderBuilder.addDefine(
|
|
237
|
+
"HAS_LINE_PATTERN",
|
|
238
|
+
undefined,
|
|
239
|
+
ShaderDestination.BOTH,
|
|
240
|
+
);
|
|
241
|
+
shaderBuilder.addUniform(
|
|
242
|
+
"float",
|
|
243
|
+
"u_linePattern",
|
|
244
|
+
ShaderDestination.FRAGMENT,
|
|
245
|
+
);
|
|
246
|
+
shaderBuilder.addVarying("float", "v_lineCoord");
|
|
247
|
+
uniformMap.u_linePattern = function () {
|
|
248
|
+
return pattern;
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const cumDistAttribute = ModelUtility.getAttributeBySemantic(
|
|
253
|
+
primitive,
|
|
254
|
+
VertexAttributeSemantic.CUMULATIVE_DISTANCE,
|
|
255
|
+
);
|
|
256
|
+
if (
|
|
257
|
+
defined(pattern) &&
|
|
258
|
+
defined(cumDistAttribute) &&
|
|
259
|
+
(primitive.primitiveType === PrimitiveType.LINES ||
|
|
260
|
+
primitive.primitiveType === PrimitiveType.TRIANGLE_STRIP)
|
|
261
|
+
) {
|
|
262
|
+
shaderBuilder.addDefine(
|
|
263
|
+
"HAS_LINE_CUMULATIVE_DISTANCE",
|
|
264
|
+
undefined,
|
|
265
|
+
ShaderDestination.VERTEX,
|
|
266
|
+
);
|
|
267
|
+
|
|
268
|
+
if (cumDistAttribute.normalized) {
|
|
269
|
+
shaderBuilder.addDefine(
|
|
270
|
+
"LINE_CUM_DIST_NORMALIZED",
|
|
271
|
+
undefined,
|
|
272
|
+
ShaderDestination.VERTEX,
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
shaderBuilder.addUniform(
|
|
277
|
+
"float",
|
|
278
|
+
"u_cumulativeDistanceMax",
|
|
279
|
+
ShaderDestination.VERTEX,
|
|
280
|
+
);
|
|
281
|
+
shaderBuilder.addUniform(
|
|
282
|
+
"float",
|
|
283
|
+
"u_pixelsPerWorld",
|
|
284
|
+
ShaderDestination.VERTEX,
|
|
285
|
+
);
|
|
286
|
+
|
|
287
|
+
const cumDistMax = defined(cumDistAttribute.max)
|
|
288
|
+
? cumDistAttribute.max
|
|
289
|
+
: 1.0;
|
|
290
|
+
uniformMap.u_cumulativeDistanceMax = function () {
|
|
291
|
+
return cumDistMax;
|
|
292
|
+
};
|
|
293
|
+
uniformMap.u_pixelsPerWorld = function () {
|
|
294
|
+
// Match iTwin behavior: stable pattern scaling in orthographic views.
|
|
295
|
+
const frustum = frameState.camera.frustum;
|
|
296
|
+
let pixelsPerWorld = 1.0;
|
|
297
|
+
let worldWidth;
|
|
298
|
+
if (defined(frustum.right) && defined(frustum.left)) {
|
|
299
|
+
worldWidth = frustum.right - frustum.left;
|
|
300
|
+
} else if (defined(frustum.width)) {
|
|
301
|
+
worldWidth = frustum.width;
|
|
302
|
+
}
|
|
303
|
+
if (defined(worldWidth) && worldWidth > 0) {
|
|
304
|
+
pixelsPerWorld = frameState.context.drawingBufferWidth / worldWidth;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
return pixelsPerWorld;
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
const cumDistVar =
|
|
311
|
+
ModelUtility.getAttributeInfo(cumDistAttribute).variableName;
|
|
312
|
+
shaderBuilder.addVertexLines(`
|
|
313
|
+
#ifdef HAS_LINE_CUMULATIVE_DISTANCE
|
|
314
|
+
void lineStyleStageVS(in ProcessedAttributes attributes)
|
|
315
|
+
{
|
|
316
|
+
float cumDist = attributes.${cumDistVar};
|
|
317
|
+
#ifdef LINE_CUM_DIST_NORMALIZED
|
|
318
|
+
cumDist *= u_cumulativeDistanceMax;
|
|
319
|
+
#endif
|
|
320
|
+
const float textureCoordinateBase = 8192.0;
|
|
321
|
+
v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld;
|
|
322
|
+
}
|
|
323
|
+
#endif
|
|
324
|
+
`);
|
|
325
|
+
} else if (defined(pattern)) {
|
|
326
|
+
shaderBuilder.addVertexLines(`
|
|
327
|
+
#ifdef HAS_LINE_PATTERN
|
|
328
|
+
void lineStyleStageVS(in ProcessedAttributes attributes)
|
|
329
|
+
{
|
|
330
|
+
vec4 posClip = gl_Position;
|
|
331
|
+
vec2 screenPos = ((posClip.xy / posClip.w) * 0.5 + 0.5) * czm_viewport.zw;
|
|
332
|
+
|
|
333
|
+
const float textureCoordinateBase = 8192.0;
|
|
334
|
+
if (czm_viewport.z > czm_viewport.w) {
|
|
335
|
+
v_lineCoord = textureCoordinateBase + screenPos.x;
|
|
336
|
+
} else {
|
|
337
|
+
v_lineCoord = textureCoordinateBase + screenPos.y;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
#endif
|
|
341
|
+
`);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
198
345
|
/**
|
|
199
346
|
* Process a single texture transformation and add it to the shader and uniform map.
|
|
200
347
|
*
|
|
@@ -1030,20 +1030,20 @@ function collectMetadataUsedInPointCloudStyling(
|
|
|
1030
1030
|
return;
|
|
1031
1031
|
}
|
|
1032
1032
|
|
|
1033
|
-
const colorVariables = style.color?.getVariables() ?? [];
|
|
1033
|
+
const colorVariables = style.color?.getVariables?.() ?? [];
|
|
1034
1034
|
for (const propertyId of colorVariables) {
|
|
1035
1035
|
usedInVertex.add(propertyId);
|
|
1036
1036
|
usedInFragment.add(propertyId);
|
|
1037
1037
|
}
|
|
1038
1038
|
|
|
1039
|
-
const showVariables = style.show?.getVariables() ?? [];
|
|
1039
|
+
const showVariables = style.show?.getVariables?.() ?? [];
|
|
1040
1040
|
for (const propertyId of showVariables) {
|
|
1041
1041
|
usedInVertex.add(propertyId);
|
|
1042
1042
|
usedInFragment.add(propertyId);
|
|
1043
1043
|
}
|
|
1044
1044
|
|
|
1045
1045
|
// Only used in vertex shader
|
|
1046
|
-
const pointSizeVariables = style.pointSize?.getVariables() ?? [];
|
|
1046
|
+
const pointSizeVariables = style.pointSize?.getVariables?.() ?? [];
|
|
1047
1047
|
for (const propertyId of pointSizeVariables) {
|
|
1048
1048
|
usedInVertex.add(propertyId);
|
|
1049
1049
|
}
|
|
@@ -574,6 +574,11 @@ ModelDrawCommand.prototype.pushCommands = function (frameState, result) {
|
|
|
574
574
|
|
|
575
575
|
pushCommand(result, this._originalCommand, use2D);
|
|
576
576
|
|
|
577
|
+
// Push edge commands after the original command
|
|
578
|
+
if (this._needsEdgeCommands) {
|
|
579
|
+
pushCommand(result, this._edgeCommand, use2D);
|
|
580
|
+
}
|
|
581
|
+
|
|
577
582
|
return result;
|
|
578
583
|
};
|
|
579
584
|
|
|
@@ -815,6 +820,7 @@ function deriveEdgeCommand(command, renderResources) {
|
|
|
815
820
|
};
|
|
816
821
|
edgeCommand.uniformMap = uniformMap;
|
|
817
822
|
|
|
823
|
+
edgeCommand.uniformMap = uniformMap;
|
|
818
824
|
edgeCommand.castShadows = false;
|
|
819
825
|
edgeCommand.receiveShadows = false;
|
|
820
826
|
|
|
@@ -53,7 +53,7 @@ class ModelReader {
|
|
|
53
53
|
*
|
|
54
54
|
* The result will be THE actual attribute data.
|
|
55
55
|
*
|
|
56
|
-
* @param {
|
|
56
|
+
* @param {Attribute} attribute The attribute
|
|
57
57
|
* @returns {TypedArray} The attribute data
|
|
58
58
|
*/
|
|
59
59
|
static readAttributeAsTypedArray(attribute) {
|
|
@@ -10,6 +10,8 @@ import CullFace from "../CullFace.js";
|
|
|
10
10
|
import PrimitiveType from "../../Core/PrimitiveType.js";
|
|
11
11
|
import Matrix3 from "../../Core/Matrix3.js";
|
|
12
12
|
|
|
13
|
+
/** @import {Attribute} from "../ModelComponents.js"; */
|
|
14
|
+
|
|
13
15
|
/**
|
|
14
16
|
* Utility functions for {@link Model}.
|
|
15
17
|
*
|
|
@@ -69,7 +71,7 @@ ModelUtility.getNodeTransform = function (node) {
|
|
|
69
71
|
* @param {ModelComponents.Primitive|ModelComponents.Instances} object The primitive components or instances object
|
|
70
72
|
* @param {VertexAttributeSemantic|InstanceAttributeSemantic} semantic The semantic to search for
|
|
71
73
|
* @param {number} [setIndex] The set index of the semantic. May be undefined for some semantics (POSITION, NORMAL, TRANSLATION, ROTATION, for example)
|
|
72
|
-
* @return {
|
|
74
|
+
* @return {Attribute} The selected attribute, or undefined if not found.
|
|
73
75
|
*
|
|
74
76
|
* @private
|
|
75
77
|
*/
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
import Cartesian3 from "../../Core/Cartesian3.js";
|
|
4
|
+
import assert from "../../Core/assert.js";
|
|
5
|
+
import defined from "../../Core/defined.js";
|
|
6
|
+
import Matrix4 from "../../Core/Matrix4.js";
|
|
7
|
+
import PrimitiveType from "../../Core/PrimitiveType.js";
|
|
8
|
+
import RuntimeError from "../../Core/RuntimeError.js";
|
|
9
|
+
import BufferPoint from "../BufferPoint.js";
|
|
10
|
+
import BufferPointCollection from "../BufferPointCollection.js";
|
|
11
|
+
import BufferPolygon from "../BufferPolygon.js";
|
|
12
|
+
import BufferPolygonCollection from "../BufferPolygonCollection.js";
|
|
13
|
+
import BufferPolyline from "../BufferPolyline.js";
|
|
14
|
+
import BufferPolylineCollection from "../BufferPolylineCollection.js";
|
|
15
|
+
import VertexAttributeSemantic from "../VertexAttributeSemantic.js";
|
|
16
|
+
import ModelReader from "./ModelReader.js";
|
|
17
|
+
import ModelUtility from "./ModelUtility.js";
|
|
18
|
+
import ModelComponents from "../ModelComponents.js";
|
|
19
|
+
|
|
20
|
+
/** @import { TypedArray } from "../../Core/globalTypes.js"; */
|
|
21
|
+
/** @import BufferPrimitive from "../BufferPrimitive.js"; */
|
|
22
|
+
/** @import BufferPrimitiveCollection from "../BufferPrimitiveCollection.js"; */
|
|
23
|
+
/** @import VectorGltf3DTileContent from "../VectorGltf3DTileContent.js"; */
|
|
24
|
+
/** @import {Attribute, Components, Node, Primitive} from "../ModelComponents.js"; */
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {object} VectorTileResult
|
|
28
|
+
* @property {Array<BufferPrimitiveCollection<BufferPrimitive>>} collections
|
|
29
|
+
* @property {Array<Matrix4>} collectionLocalMatrices
|
|
30
|
+
* @ignore
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
const scratchPosition = new Cartesian3();
|
|
34
|
+
const scratchPoint = new BufferPoint();
|
|
35
|
+
const scratchPolyline = new BufferPolyline();
|
|
36
|
+
const scratchPolygon = new BufferPolygon();
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Creates vector buffers from model components.
|
|
40
|
+
*
|
|
41
|
+
* @param {VectorGltf3DTileContent} content
|
|
42
|
+
* @param {Components} components
|
|
43
|
+
* @returns {VectorTileResult}
|
|
44
|
+
*
|
|
45
|
+
* @ignore
|
|
46
|
+
*/
|
|
47
|
+
function createVectorTileBuffersFromModelComponents(content, components) {
|
|
48
|
+
const rootNodes = components.scene.nodes;
|
|
49
|
+
|
|
50
|
+
/** @type {VectorTileResult} */
|
|
51
|
+
const result = { collections: [], collectionLocalMatrices: [] };
|
|
52
|
+
|
|
53
|
+
for (let i = 0; i < rootNodes.length; i++) {
|
|
54
|
+
appendNodeToBuffers(content, rootNodes[i], Matrix4.IDENTITY, result);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @param {TypedArray} indices
|
|
62
|
+
* @ignore
|
|
63
|
+
*/
|
|
64
|
+
function getPrimitiveRestartIndex(indices) {
|
|
65
|
+
const bits = indices.BYTES_PER_ELEMENT * 8;
|
|
66
|
+
return Math.pow(2, bits) - 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @param {TypedArray} indices
|
|
71
|
+
* @param {Function} callback
|
|
72
|
+
* @ignore
|
|
73
|
+
*/
|
|
74
|
+
function forEachLineStripSegment(indices, callback) {
|
|
75
|
+
const restart = getPrimitiveRestartIndex(indices);
|
|
76
|
+
let segmentStart = 0;
|
|
77
|
+
for (let i = 0; i <= indices.length; i++) {
|
|
78
|
+
if (i === indices.length || indices[i] === restart) {
|
|
79
|
+
const segmentCount = i - segmentStart;
|
|
80
|
+
if (segmentCount > 0) {
|
|
81
|
+
callback(segmentStart, segmentCount);
|
|
82
|
+
}
|
|
83
|
+
segmentStart = i + 1;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @param {Primitive} primitive
|
|
90
|
+
* @ignore
|
|
91
|
+
*/
|
|
92
|
+
function gatherPrimitiveStats(primitive) {
|
|
93
|
+
const stats = {
|
|
94
|
+
pointPrimitiveCount: 0,
|
|
95
|
+
pointVertexCount: 0,
|
|
96
|
+
polylinePrimitiveCount: 0,
|
|
97
|
+
polylineVertexCount: 0,
|
|
98
|
+
polygonPrimitiveCount: 0,
|
|
99
|
+
polygonVertexCount: 0,
|
|
100
|
+
polygonHoleCount: 0,
|
|
101
|
+
polygonTriangleCount: 0,
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const vector = primitive.vector;
|
|
105
|
+
const primitiveType = primitive.primitiveType;
|
|
106
|
+
const positionAttribute = ModelUtility.getAttributeBySemantic(
|
|
107
|
+
primitive,
|
|
108
|
+
VertexAttributeSemantic.POSITION,
|
|
109
|
+
);
|
|
110
|
+
const positionCount = positionAttribute.count;
|
|
111
|
+
|
|
112
|
+
const indices = primitive.indices
|
|
113
|
+
? ModelReader.readIndicesAsTypedArray(primitive.indices)
|
|
114
|
+
: undefined;
|
|
115
|
+
|
|
116
|
+
// @ts-expect-error Requires https://github.com/CesiumGS/cesium/pull/13203.
|
|
117
|
+
if (primitiveType === PrimitiveType.POINTS) {
|
|
118
|
+
stats.pointPrimitiveCount += vector.count;
|
|
119
|
+
stats.pointVertexCount += vector.count;
|
|
120
|
+
|
|
121
|
+
// @ts-expect-error Requires https://github.com/CesiumGS/cesium/pull/13203.
|
|
122
|
+
} else if (primitiveType === PrimitiveType.LINE_STRIP) {
|
|
123
|
+
//>>includeStart('debug', pragmas.debug);
|
|
124
|
+
assert(defined(indices), "Vector LINE_STRIP primitive must be indexed.");
|
|
125
|
+
//>>includeEnd('debug');
|
|
126
|
+
|
|
127
|
+
stats.polylinePrimitiveCount += vector.count;
|
|
128
|
+
stats.polylineVertexCount += indices.length - (vector.count - 1);
|
|
129
|
+
|
|
130
|
+
// @ts-expect-error Requires https://github.com/CesiumGS/cesium/pull/13203.
|
|
131
|
+
} else if (primitiveType === PrimitiveType.TRIANGLES) {
|
|
132
|
+
//>>includeStart('debug', pragmas.debug);
|
|
133
|
+
assert(defined(indices), "Vector TRIANGLES primitive must be indexed.");
|
|
134
|
+
//>>includeEnd('debug');
|
|
135
|
+
|
|
136
|
+
stats.polygonPrimitiveCount += vector.count;
|
|
137
|
+
stats.polygonVertexCount += positionCount;
|
|
138
|
+
stats.polygonTriangleCount += indices.length / 3;
|
|
139
|
+
|
|
140
|
+
const polygonHoleCounts = vector.polygonHoleCounts;
|
|
141
|
+
if (polygonHoleCounts) {
|
|
142
|
+
for (let i = 0; i < polygonHoleCounts.length; i++) {
|
|
143
|
+
stats.polygonHoleCount += polygonHoleCounts[i];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
throw new RuntimeError(`Unexpected primitive type: ${primitiveType}`);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return stats;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* @param {VectorGltf3DTileContent} content
|
|
155
|
+
* @param {Primitive} primitive
|
|
156
|
+
* @param {BufferPrimitiveCollection<BufferPrimitive>} collection
|
|
157
|
+
* @ignore
|
|
158
|
+
*/
|
|
159
|
+
function appendPrimitiveToBuffers(content, primitive, collection) {
|
|
160
|
+
const vector = primitive.vector;
|
|
161
|
+
const positionAttribute = ModelUtility.getAttributeBySemantic(
|
|
162
|
+
primitive,
|
|
163
|
+
VertexAttributeSemantic.POSITION,
|
|
164
|
+
);
|
|
165
|
+
/** @type {TypedArray} */
|
|
166
|
+
const collectionPositions =
|
|
167
|
+
positionAttribute.typedArray ??
|
|
168
|
+
ModelReader.readAttributeAsTypedArray(positionAttribute);
|
|
169
|
+
const vertexCount = collectionPositions.length / 3;
|
|
170
|
+
|
|
171
|
+
/** @type {TypedArray} */
|
|
172
|
+
const indices = primitive.indices
|
|
173
|
+
? ModelReader.readIndicesAsTypedArray(primitive.indices)
|
|
174
|
+
: undefined;
|
|
175
|
+
|
|
176
|
+
const featureIdComponent = primitive.featureIds?.[0];
|
|
177
|
+
/** @type {Attribute} */
|
|
178
|
+
let featureIdAttribute;
|
|
179
|
+
/** @type {TypedArray} */
|
|
180
|
+
let featureIdArray;
|
|
181
|
+
if (featureIdComponent instanceof ModelComponents.FeatureIdAttribute) {
|
|
182
|
+
featureIdAttribute = ModelUtility.getAttributeBySemantic(
|
|
183
|
+
primitive,
|
|
184
|
+
VertexAttributeSemantic.FEATURE_ID,
|
|
185
|
+
featureIdComponent.setIndex,
|
|
186
|
+
);
|
|
187
|
+
featureIdArray =
|
|
188
|
+
featureIdAttribute.typedArray ??
|
|
189
|
+
ModelReader.readAttributeAsTypedArray(featureIdAttribute);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
if (collection instanceof BufferPointCollection) {
|
|
193
|
+
for (let i = 0, il = indices ? indices.length : vertexCount; i < il; i++) {
|
|
194
|
+
const vertexOffset = indices ? indices[i] : i;
|
|
195
|
+
Cartesian3.fromArray(
|
|
196
|
+
// @ts-expect-error TODO(tsd-jsdoc): See https://github.com/CesiumGS/cesium/pull/13302.
|
|
197
|
+
collectionPositions,
|
|
198
|
+
vertexOffset * 3,
|
|
199
|
+
scratchPosition,
|
|
200
|
+
);
|
|
201
|
+
collection.add({ position: scratchPosition }, scratchPoint);
|
|
202
|
+
|
|
203
|
+
const featureId = Math.trunc(featureIdArray[vertexOffset]);
|
|
204
|
+
if (featureId !== featureIdComponent.nullFeatureId) {
|
|
205
|
+
scratchPoint.featureId = featureId;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
} else if (collection instanceof BufferPolylineCollection) {
|
|
209
|
+
// @ts-expect-error TODO
|
|
210
|
+
forEachLineStripSegment(indices, (indexOffset, indexCount) => {
|
|
211
|
+
const vertexOffset = indices[indexOffset];
|
|
212
|
+
const positions = collectionPositions.subarray(
|
|
213
|
+
vertexOffset * 3,
|
|
214
|
+
(vertexOffset + indexCount) * 3,
|
|
215
|
+
);
|
|
216
|
+
collection.add({ positions }, scratchPolyline);
|
|
217
|
+
|
|
218
|
+
const featureId = Math.trunc(featureIdArray[vertexOffset]);
|
|
219
|
+
if (featureId !== featureIdComponent.nullFeatureId) {
|
|
220
|
+
scratchPolyline.featureId = featureId;
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
} else if (collection instanceof BufferPolygonCollection) {
|
|
224
|
+
const polygonAttributeOffsets = vector.polygonAttributeOffsets;
|
|
225
|
+
const polygonIndicesOffsets = vector.polygonIndicesOffsets;
|
|
226
|
+
const polygonHoleCounts = vector.polygonHoleCounts;
|
|
227
|
+
const polygonHoleOffsets = vector.polygonHoleOffsets;
|
|
228
|
+
|
|
229
|
+
const polygonCount = polygonAttributeOffsets.length;
|
|
230
|
+
for (let i = 0; i < polygonCount; i++) {
|
|
231
|
+
const polygonVertexStart = polygonAttributeOffsets[i];
|
|
232
|
+
const polygonVertexEnd =
|
|
233
|
+
i + 1 < polygonCount ? polygonAttributeOffsets[i + 1] : vertexCount;
|
|
234
|
+
|
|
235
|
+
const positions = collectionPositions.subarray(
|
|
236
|
+
polygonVertexStart * 3,
|
|
237
|
+
polygonVertexEnd * 3,
|
|
238
|
+
);
|
|
239
|
+
|
|
240
|
+
let holes;
|
|
241
|
+
if (defined(polygonHoleCounts) && polygonHoleCounts[i] > 0) {
|
|
242
|
+
const holeCount = polygonHoleCounts[i];
|
|
243
|
+
holes = polygonHoleOffsets.slice(i, i + holeCount);
|
|
244
|
+
for (let h = 0; h < holeCount; h++) {
|
|
245
|
+
holes[i] -= polygonVertexStart;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const triangleIndexStart = polygonIndicesOffsets[i];
|
|
250
|
+
const triangleIndexEnd =
|
|
251
|
+
i + 1 < polygonCount ? polygonIndicesOffsets[i + 1] : indices.length;
|
|
252
|
+
const triangles = indices.slice(triangleIndexStart, triangleIndexEnd);
|
|
253
|
+
for (let t = 0; t < triangleIndexEnd; t++) {
|
|
254
|
+
triangles[t] -= polygonVertexStart;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
collection.add({ positions, triangles, holes }, scratchPolygon);
|
|
258
|
+
|
|
259
|
+
const featureId = Math.trunc(featureIdArray[polygonVertexStart]);
|
|
260
|
+
if (featureId !== featureIdComponent.nullFeatureId) {
|
|
261
|
+
scratchPolygon.featureId = featureId;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @param {VectorGltf3DTileContent} content
|
|
269
|
+
* @param {Node} node
|
|
270
|
+
* @param {Matrix4} parentTransform
|
|
271
|
+
* @param {VectorTileResult} result
|
|
272
|
+
* @ignore
|
|
273
|
+
*/
|
|
274
|
+
function appendNodeToBuffers(content, node, parentTransform, result) {
|
|
275
|
+
const localTransform = ModelUtility.getNodeTransform(node);
|
|
276
|
+
const nodeTransform = Matrix4.multiplyTransformation(
|
|
277
|
+
parentTransform,
|
|
278
|
+
localTransform,
|
|
279
|
+
new Matrix4(),
|
|
280
|
+
);
|
|
281
|
+
|
|
282
|
+
const primitives = node.primitives;
|
|
283
|
+
for (let i = 0; i < primitives.length; i++) {
|
|
284
|
+
const primitive = primitives[i];
|
|
285
|
+
const primitiveType = primitive.primitiveType;
|
|
286
|
+
if (!primitive.vector) {
|
|
287
|
+
continue;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/** @type {BufferPrimitiveCollection<BufferPrimitive>} */
|
|
291
|
+
let collection;
|
|
292
|
+
|
|
293
|
+
const stats = gatherPrimitiveStats(primitive);
|
|
294
|
+
|
|
295
|
+
// @ts-expect-error Requires https://github.com/CesiumGS/cesium/pull/13203.
|
|
296
|
+
if (primitiveType === PrimitiveType.POINTS) {
|
|
297
|
+
collection = new BufferPointCollection({
|
|
298
|
+
primitiveCountMax: stats.pointPrimitiveCount,
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
// @ts-expect-error Requires https://github.com/CesiumGS/cesium/pull/13203.
|
|
302
|
+
} else if (primitiveType === PrimitiveType.LINE_STRIP) {
|
|
303
|
+
collection = new BufferPolylineCollection({
|
|
304
|
+
primitiveCountMax: stats.polylinePrimitiveCount,
|
|
305
|
+
vertexCountMax: stats.polylineVertexCount,
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
// @ts-expect-error Requires https://github.com/CesiumGS/cesium/pull/13203.
|
|
309
|
+
} else if (primitiveType === PrimitiveType.TRIANGLES) {
|
|
310
|
+
collection = new BufferPolygonCollection({
|
|
311
|
+
primitiveCountMax: stats.polygonPrimitiveCount,
|
|
312
|
+
vertexCountMax: stats.polygonVertexCount,
|
|
313
|
+
holeCountMax: stats.polygonHoleCount,
|
|
314
|
+
triangleCountMax: stats.polygonTriangleCount,
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
result.collections.push(collection);
|
|
319
|
+
result.collectionLocalMatrices.push(Matrix4.clone(nodeTransform));
|
|
320
|
+
|
|
321
|
+
appendPrimitiveToBuffers(content, primitive, collection);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
const children = node.children;
|
|
325
|
+
for (let i = 0; i < children.length; i++) {
|
|
326
|
+
appendNodeToBuffers(content, children[i], nodeTransform, result);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export default createVectorTileBuffersFromModelComponents;
|