@cesium/engine 25.0.0 → 26.1.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-3VDDRF2E.js → chunk-2EFYUSUY.js} +14 -14
- package/Build/Workers/{chunk-4GF4MVPY.js → chunk-5LSOO2KD.js} +7 -7
- package/Build/Workers/{chunk-I3A6DXYZ.js → chunk-6HK6IXK2.js} +4 -4
- package/Build/Workers/{chunk-CZ23Y3RM.js → chunk-6YR6JBMY.js} +2 -2
- package/Build/Workers/{chunk-J7KQEKPK.js → chunk-76FDC45O.js} +13 -13
- package/Build/Workers/{chunk-ZCCIIBZT.js → chunk-7D2HZKH7.js} +6 -6
- package/Build/Workers/{chunk-HSVQATK2.js → chunk-7KVKHY7O.js} +6 -6
- package/Build/Workers/{chunk-ITD2IN7N.js → chunk-A3O6EDBK.js} +2 -2
- package/Build/Workers/{chunk-ND3NTTOF.js → chunk-A6X24AZI.js} +6 -6
- package/Build/Workers/{chunk-DH26SNAB.js → chunk-AHWAZRBV.js} +6 -2
- package/Build/Workers/{chunk-3XY3MVPG.js → chunk-B4CQSLZJ.js} +4 -4
- package/Build/Workers/{chunk-DYT5NR6P.js → chunk-C7JQVRLM.js} +3 -3
- package/Build/Workers/{chunk-WC57YYBN.js → chunk-CDJDJ5LK.js} +2 -2
- package/Build/Workers/{chunk-VQKLRBIK.js → chunk-CEEZE3YZ.js} +7 -7
- package/Build/Workers/{chunk-4QQXGTCE.js → chunk-CLCTQVVL.js} +8 -8
- package/Build/Workers/{chunk-WNN5D4W3.js → chunk-DBD5WWG2.js} +10 -10
- package/Build/Workers/{chunk-URUCCIPS.js → chunk-DIGUUD6G.js} +6 -6
- package/Build/Workers/{chunk-BTX2NL3P.js → chunk-E7NZJOK7.js} +196 -22
- package/Build/Workers/{chunk-3LSD7OOA.js → chunk-EHTS2YPT.js} +16 -16
- package/Build/Workers/{chunk-35H3UBIO.js → chunk-ENNFMWDW.js} +11 -11
- package/Build/Workers/{chunk-GL7DNVUS.js → chunk-FCP2QY4G.js} +5 -5
- package/Build/Workers/{chunk-3RFFPH4M.js → chunk-FDK4K5IA.js} +1 -1
- package/Build/Workers/{chunk-WTQGE7Q6.js → chunk-FGQFQHN5.js} +17 -17
- package/Build/Workers/{chunk-WUBKZFF6.js → chunk-GSWMAFTE.js} +9 -9
- package/Build/Workers/{chunk-3TKLDHV3.js → chunk-GXWQZBAI.js} +2 -2
- package/Build/Workers/{chunk-A7A433MD.js → chunk-HHV3MCGV.js} +5 -5
- package/Build/Workers/{chunk-A7ZBMVFS.js → chunk-HS6AD4P2.js} +14 -14
- package/Build/Workers/{chunk-QXNQQYPV.js → chunk-IGAZBTFZ.js} +8 -8
- package/Build/Workers/{chunk-ZAPOS52G.js → chunk-ILME5BXA.js} +8 -8
- package/Build/Workers/{chunk-4MTRQFJP.js → chunk-JKXV6PG5.js} +1 -1
- package/Build/Workers/{chunk-FVLVVOBQ.js → chunk-JW6OZT4R.js} +10 -10
- package/Build/Workers/{chunk-EZARA5FJ.js → chunk-KGXSYGBG.js} +13 -13
- package/Build/Workers/{chunk-J3OFS2RD.js → chunk-LD64RPYV.js} +12 -12
- package/Build/Workers/{chunk-AWFZHD2B.js → chunk-LGNDTZVX.js} +4 -4
- package/Build/Workers/{chunk-AEAVLYPS.js → chunk-LNSQVXFH.js} +2 -2
- package/Build/Workers/{chunk-TA777BGS.js → chunk-N7CCOFLX.js} +1 -1
- package/Build/Workers/{chunk-7LSFAEWF.js → chunk-NIWITKQK.js} +10 -10
- package/Build/Workers/{chunk-4XXHJI6Y.js → chunk-OBEU25PI.js} +17 -17
- package/Build/Workers/{chunk-5T6QQAJW.js → chunk-QVLAFFJY.js} +1 -1
- package/Build/Workers/{chunk-J647NNZW.js → chunk-R4FPNAZ2.js} +6 -6
- package/Build/Workers/{chunk-HVMG6AG4.js → chunk-RG4F5R57.js} +9 -9
- package/Build/Workers/{chunk-ST2UWDUU.js → chunk-SF6K72D7.js} +5 -5
- package/Build/Workers/{chunk-H2A4USJR.js → chunk-SGRGNDOD.js} +10 -10
- package/Build/Workers/{chunk-DFEI5MAV.js → chunk-SM2CDCYF.js} +7 -7
- package/Build/Workers/{chunk-TAI4HLII.js → chunk-SS5ABQGY.js} +4 -4
- package/Build/Workers/{chunk-ACFFCHHZ.js → chunk-T5QBPLE3.js} +11 -11
- package/Build/Workers/{chunk-BVAIWR7O.js → chunk-TVZD72WJ.js} +12 -12
- package/Build/Workers/{chunk-6SDGQI27.js → chunk-UEY73NRN.js} +1 -1
- package/Build/Workers/{chunk-K6NFIRFB.js → chunk-UVO6COT2.js} +5 -5
- package/Build/Workers/{chunk-77RL3MBD.js → chunk-VAL7DYNR.js} +25 -4
- package/Build/Workers/{chunk-WN6P5UDH.js → chunk-WBSY7HDY.js} +12 -12
- package/Build/Workers/{chunk-FIBS5S7R.js → chunk-XDWCTQCZ.js} +2 -2
- package/Build/Workers/{chunk-CKQP3DSS.js → chunk-XLXSDIP5.js} +6 -6
- package/Build/Workers/{chunk-LH5SF3XV.js → chunk-XQ3SKCMM.js} +5 -5
- package/Build/Workers/{chunk-QSDY4NS7.js → chunk-YKU2Q3A2.js} +9 -9
- package/Build/Workers/{chunk-GPIGURCG.js → chunk-ZMBHFYOX.js} +7 -7
- package/Build/Workers/{chunk-QO2CGXMP.js → chunk-ZSGUV73H.js} +6 -6
- 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 +987 -2320
- 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/BoundingRectangle.js +6 -8
- package/Source/Core/Cartesian2.js +1 -1
- package/Source/Core/Cartesian3.js +1 -1
- package/Source/Core/Cartesian4.js +1 -1
- package/Source/Core/Color.js +1 -0
- package/Source/Core/ComponentDatatype.js +35 -0
- package/Source/Core/InterpolationAlgorithm.js +57 -50
- 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/TerrainMesh.js +3 -3
- package/Source/Core/TerrainPicker.js +1 -0
- package/Source/Core/createColorRamp.js +37 -0
- package/Source/Core/globalTypes.js +25 -0
- package/Source/Core/writeTextToCanvas.js +1 -0
- package/Source/DataSources/CzmlDataSource.js +12 -0
- package/Source/DataSources/KmlDataSource.js +528 -555
- package/Source/DataSources/PathGraphics.js +8 -1
- package/Source/DataSources/PathMode.js +27 -0
- package/Source/DataSources/PathVisualizer.js +298 -1
- package/Source/Renderer/Pass.js +3 -2
- package/Source/Renderer/Texture.js +1 -1
- package/Source/Renderer/VertexArray.js +1 -0
- package/Source/Renderer/createUniform.js +346 -239
- package/Source/Renderer/createUniformArray.js +494 -381
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/BillboardTexture.js +5 -3
- 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/Cesium3DTileOptimizations.js +4 -6
- package/Source/Scene/Cesium3DTileset.js +45 -5
- package/Source/Scene/ClippingPlaneCollection.js +2 -2
- package/Source/Scene/ClippingPolygon.js +2 -0
- package/Source/Scene/ClippingPolygonCollection.js +2 -2
- package/Source/Scene/Composite3DTileContent.js +254 -292
- package/Source/Scene/DerivedCommand.js +4 -0
- package/Source/Scene/EdgeDisplayMode.js +50 -0
- package/Source/Scene/Empty3DTileContent.js +100 -132
- package/Source/Scene/Expression.js +6 -8
- package/Source/Scene/GaussianSplat3DTileContent.js +436 -478
- package/Source/Scene/GeoJsonPrimitive.js +874 -0
- package/Source/Scene/Geometry3DTileContent.js +151 -185
- package/Source/Scene/GlobeSurfaceShaderSet.js +501 -409
- package/Source/Scene/GlobeSurfaceTile.js +540 -401
- package/Source/Scene/GlobeSurfaceTileProvider.js +1259 -1146
- package/Source/Scene/GltfBufferViewLoader.js +3 -3
- package/Source/Scene/GltfLoader.js +110 -0
- package/Source/Scene/GltfLoaderUtil.js +20 -4
- package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +10 -0
- package/Source/Scene/GltfPipeline/removeUnusedElements.js +21 -11
- package/Source/Scene/ImageryLayer.js +2 -2
- package/Source/Scene/ImageryLayerCollection.js +2 -2
- package/Source/Scene/Implicit3DTileContent.js +179 -214
- package/Source/Scene/MVTDataProvider.js +147 -0
- package/Source/Scene/Material.js +1 -0
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +79 -311
- package/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js +4 -0
- package/Source/Scene/Model/Model.js +37 -0
- package/Source/Scene/Model/Model3DTileContent.js +424 -458
- package/Source/Scene/Model/ModelDrawCommand.js +31 -3
- package/Source/Scene/Model/ModelUtility.js +5 -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/Picking.js +5 -0
- package/Source/Scene/PntsParser.js +1 -0
- package/Source/Scene/QuadtreePrimitive.js +3 -2
- package/Source/Scene/ResourceCacheKey.js +5 -5
- package/Source/Scene/Scene.js +27 -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/findMeshoptExtension.js +23 -0
- package/Source/Scene/renderBufferPointCollection.js +113 -62
- package/Source/Scene/renderBufferPolygonCollection.js +98 -55
- package/Source/Scene/renderBufferPolylineCollection.js +270 -143
- 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/Source/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2
- package/Source/Workers/incrementallyBuildTerrainPicker.js +2 -0
- package/index.d.ts +311 -288
- package/index.js +103 -92
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Check from "../Core/Check.js";
|
|
2
2
|
import Frozen from "../Core/Frozen.js";
|
|
3
3
|
import defined from "../Core/defined.js";
|
|
4
|
-
import
|
|
4
|
+
import findMeshoptExtension from "./findMeshoptExtension.js";
|
|
5
5
|
import { MeshoptDecoder } from "meshoptimizer";
|
|
6
6
|
import ResourceLoader from "./ResourceLoader.js";
|
|
7
7
|
import ResourceLoaderState from "./ResourceLoaderState.js";
|
|
@@ -54,8 +54,8 @@ class GltfBufferViewLoader extends ResourceLoader {
|
|
|
54
54
|
let meshoptMode;
|
|
55
55
|
let meshoptFilter;
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
const meshopt = findMeshoptExtension(bufferView);
|
|
58
|
+
if (defined(meshopt)) {
|
|
59
59
|
bufferId = meshopt.buffer;
|
|
60
60
|
byteOffset = meshopt.byteOffset ?? 0;
|
|
61
61
|
byteLength = meshopt.byteLength;
|
|
@@ -64,6 +64,7 @@ const {
|
|
|
64
64
|
LineStyle,
|
|
65
65
|
Material,
|
|
66
66
|
Vector,
|
|
67
|
+
Polygon,
|
|
67
68
|
} = ModelComponents;
|
|
68
69
|
|
|
69
70
|
/**
|
|
@@ -533,6 +534,7 @@ class GltfLoader extends ResourceLoader {
|
|
|
533
534
|
|
|
534
535
|
/**
|
|
535
536
|
* Loads the gltf object
|
|
537
|
+
* @ignore
|
|
536
538
|
*/
|
|
537
539
|
async function loadGltfJson(loader) {
|
|
538
540
|
loader._state = GltfLoaderState.LOADING;
|
|
@@ -899,6 +901,38 @@ function loadAccessor(loader, accessor, useQuaternion) {
|
|
|
899
901
|
return loadDefaultAccessorValues(accessor, values);
|
|
900
902
|
}
|
|
901
903
|
|
|
904
|
+
function loadAccessorTypedArray(loader, accessor) {
|
|
905
|
+
const values = ComponentDatatype.createTypedArray(
|
|
906
|
+
accessor.componentType,
|
|
907
|
+
accessor.count * AttributeType.getNumberOfComponents(accessor.type),
|
|
908
|
+
);
|
|
909
|
+
|
|
910
|
+
if (!defined(accessor.bufferView)) {
|
|
911
|
+
return values;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
const bufferViewLoader = getBufferViewLoader(loader, accessor.bufferView);
|
|
915
|
+
|
|
916
|
+
// Save a link to the gltfJson, which is removed after bufferViewLoader.load()
|
|
917
|
+
const { gltfJson } = loader;
|
|
918
|
+
|
|
919
|
+
const promise = bufferViewLoader.load().then(() => {
|
|
920
|
+
if (loader.isDestroyed()) {
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
const result = getPackedTypedArray(
|
|
924
|
+
gltfJson,
|
|
925
|
+
accessor,
|
|
926
|
+
bufferViewLoader.typedArray,
|
|
927
|
+
);
|
|
928
|
+
values.set(result);
|
|
929
|
+
});
|
|
930
|
+
|
|
931
|
+
loader._loaderPromises.push(promise);
|
|
932
|
+
|
|
933
|
+
return values;
|
|
934
|
+
}
|
|
935
|
+
|
|
902
936
|
function fromArray(MathType, values) {
|
|
903
937
|
if (!defined(values)) {
|
|
904
938
|
return undefined;
|
|
@@ -2208,6 +2242,17 @@ function loadPrimitive(loader, gltfPrimitive, hasInstances, frameState) {
|
|
|
2208
2242
|
}
|
|
2209
2243
|
|
|
2210
2244
|
const extensions = gltfPrimitive.extensions ?? Frozen.EMPTY_OBJECT;
|
|
2245
|
+
|
|
2246
|
+
const polygonExtension = extensions.EXT_mesh_polygon;
|
|
2247
|
+
if (defined(polygonExtension)) {
|
|
2248
|
+
primitive.polygon = loadMeshPolygonExtension(
|
|
2249
|
+
loader,
|
|
2250
|
+
gltfPrimitive,
|
|
2251
|
+
polygonExtension,
|
|
2252
|
+
);
|
|
2253
|
+
}
|
|
2254
|
+
|
|
2255
|
+
// @deprecated CESIUM_mesh_vector to be removed after v1.142 release.
|
|
2211
2256
|
const meshVectorExtension = extensions.CESIUM_mesh_vector;
|
|
2212
2257
|
if (defined(meshVectorExtension)) {
|
|
2213
2258
|
primitive.vector = loadMeshVectorExtension(loader, meshVectorExtension);
|
|
@@ -2365,12 +2410,77 @@ function loadPrimitiveOutline(loader, outlineExtension) {
|
|
|
2365
2410
|
return loadAccessor(loader, accessor, useQuaternion);
|
|
2366
2411
|
}
|
|
2367
2412
|
|
|
2413
|
+
/**
|
|
2414
|
+
* @typedef {object} EXTMeshPolygonExtension
|
|
2415
|
+
* @property {number} count
|
|
2416
|
+
* @property {number} indicesOffsets
|
|
2417
|
+
* @property {number} [loopIndices]
|
|
2418
|
+
* @property {number} [loopIndicesOffsets]
|
|
2419
|
+
* @property {number} [triangleIndices]
|
|
2420
|
+
* @property {number} [triangleIndicesOffsets]
|
|
2421
|
+
*/
|
|
2422
|
+
|
|
2423
|
+
/**
|
|
2424
|
+
* Load EXT_mesh_polygon.
|
|
2425
|
+
* @param {GltfLoader} loader
|
|
2426
|
+
* @param {object} gltfPrimitive
|
|
2427
|
+
* @param {EXTMeshPolygonExtension} polygonExtension
|
|
2428
|
+
* @returns {ModelComponents.Polygon}
|
|
2429
|
+
* @ignore
|
|
2430
|
+
*/
|
|
2431
|
+
function loadMeshPolygonExtension(loader, gltfPrimitive, polygonExtension) {
|
|
2432
|
+
const result = new Polygon();
|
|
2433
|
+
const accessors = loader.gltfJson.accessors;
|
|
2434
|
+
|
|
2435
|
+
result.count = polygonExtension.count;
|
|
2436
|
+
|
|
2437
|
+
// See ModelComponents.Polygon definition.
|
|
2438
|
+
if (gltfPrimitive.mode === PrimitiveType.LINE_LOOP) {
|
|
2439
|
+
result.loopIndices = loadAccessorTypedArray(
|
|
2440
|
+
loader,
|
|
2441
|
+
accessors[gltfPrimitive.indices],
|
|
2442
|
+
);
|
|
2443
|
+
result.loopIndicesOffsets = loadAccessorTypedArray(
|
|
2444
|
+
loader,
|
|
2445
|
+
accessors[polygonExtension.indicesOffsets],
|
|
2446
|
+
);
|
|
2447
|
+
result.triangleIndices = loadAccessorTypedArray(
|
|
2448
|
+
loader,
|
|
2449
|
+
accessors[polygonExtension.triangleIndices],
|
|
2450
|
+
);
|
|
2451
|
+
result.triangleIndicesOffsets = loadAccessorTypedArray(
|
|
2452
|
+
loader,
|
|
2453
|
+
accessors[polygonExtension.triangleIndicesOffsets],
|
|
2454
|
+
);
|
|
2455
|
+
} else if (gltfPrimitive.mode === PrimitiveType.TRIANGLES) {
|
|
2456
|
+
result.loopIndices = loadAccessorTypedArray(
|
|
2457
|
+
loader,
|
|
2458
|
+
accessors[polygonExtension.loopIndices],
|
|
2459
|
+
);
|
|
2460
|
+
result.loopIndicesOffsets = loadAccessorTypedArray(
|
|
2461
|
+
loader,
|
|
2462
|
+
accessors[polygonExtension.loopIndicesOffsets],
|
|
2463
|
+
);
|
|
2464
|
+
result.triangleIndices = loadAccessorTypedArray(
|
|
2465
|
+
loader,
|
|
2466
|
+
accessors[gltfPrimitive.indices],
|
|
2467
|
+
);
|
|
2468
|
+
result.triangleIndicesOffsets = loadAccessorTypedArray(
|
|
2469
|
+
loader,
|
|
2470
|
+
accessors[polygonExtension.indicesOffsets],
|
|
2471
|
+
);
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
return result;
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2368
2477
|
/**
|
|
2369
2478
|
* Load CESIUM_mesh_vector.
|
|
2370
2479
|
* @param {GltfLoader} loader
|
|
2371
2480
|
* @param {*} meshVectorExtension
|
|
2372
2481
|
* @returns {ModelComponents.Vector}
|
|
2373
2482
|
* @ignore
|
|
2483
|
+
* @deprecated
|
|
2374
2484
|
*/
|
|
2375
2485
|
function loadMeshVectorExtension(loader, meshVectorExtension) {
|
|
2376
2486
|
if (!defined(meshVectorExtension)) {
|
|
@@ -111,6 +111,22 @@ GltfLoaderUtil.createSampler = function (options) {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
if (!TextureWrap.validate(wrapS)) {
|
|
115
|
+
wrapS = TextureWrap.REPEAT;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (!TextureWrap.validate(wrapT)) {
|
|
119
|
+
wrapT = TextureWrap.REPEAT;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (!TextureMinificationFilter.validate(minFilter)) {
|
|
123
|
+
minFilter = TextureMinificationFilter.LINEAR;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (!TextureMagnificationFilter.validate(magFilter)) {
|
|
127
|
+
magFilter = TextureMagnificationFilter.LINEAR;
|
|
128
|
+
}
|
|
129
|
+
|
|
114
130
|
return new Sampler({
|
|
115
131
|
wrapS: wrapS,
|
|
116
132
|
wrapT: wrapT,
|
|
@@ -164,10 +180,10 @@ GltfLoaderUtil.createModelTextureReader = function (options) {
|
|
|
164
180
|
|
|
165
181
|
// prettier-ignore
|
|
166
182
|
transform = new Matrix3(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
183
|
+
Math.cos(rotation) * scale.x, -Math.sin(rotation) * scale.y, offset.x,
|
|
184
|
+
Math.sin(rotation) * scale.x, Math.cos(rotation) * scale.y, offset.y,
|
|
185
|
+
0.0, 0.0, 1.0
|
|
186
|
+
);
|
|
171
187
|
}
|
|
172
188
|
|
|
173
189
|
const modelTextureReader = new ModelComponents.TextureReader();
|
|
@@ -73,6 +73,16 @@ function forEachTextureInMaterial(material, handler) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
// Transmission extension
|
|
77
|
+
const transmission = extensions.KHR_materials_transmission;
|
|
78
|
+
if (defined(transmission) && defined(transmission.transmissionTexture)) {
|
|
79
|
+
const textureInfo = transmission.transmissionTexture;
|
|
80
|
+
const value = handler(textureInfo.index, textureInfo);
|
|
81
|
+
if (defined(value)) {
|
|
82
|
+
return value;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
76
86
|
// Materials common extension (may be present in models converted from glTF 1.0)
|
|
77
87
|
const materialsCommon = extensions.KHR_materials_common;
|
|
78
88
|
if (defined(materialsCommon) && defined(materialsCommon.values)) {
|
|
@@ -148,11 +148,16 @@ Remove.buffer = function (gltf, bufferId) {
|
|
|
148
148
|
bufferView.buffer--;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
const extensions = bufferView.extensions;
|
|
152
|
+
if (defined(extensions)) {
|
|
153
|
+
const ext = extensions.EXT_meshopt_compression;
|
|
154
|
+
if (defined(ext) && ext.buffer > bufferId) {
|
|
155
|
+
ext.buffer--;
|
|
156
|
+
}
|
|
157
|
+
const khr = extensions.KHR_meshopt_compression;
|
|
158
|
+
if (defined(khr) && khr.buffer > bufferId) {
|
|
159
|
+
khr.buffer--;
|
|
160
|
+
}
|
|
156
161
|
}
|
|
157
162
|
});
|
|
158
163
|
};
|
|
@@ -583,12 +588,17 @@ getListOfElementsIdsInUse.buffer = function (gltf) {
|
|
|
583
588
|
if (defined(bufferView.buffer)) {
|
|
584
589
|
usedBufferIds[bufferView.buffer] = true;
|
|
585
590
|
}
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
true;
|
|
591
|
+
|
|
592
|
+
const extensions = bufferView.extensions;
|
|
593
|
+
if (defined(extensions)) {
|
|
594
|
+
const ext = extensions.EXT_meshopt_compression;
|
|
595
|
+
if (defined(ext)) {
|
|
596
|
+
usedBufferIds[ext.buffer] = true;
|
|
597
|
+
}
|
|
598
|
+
const khr = extensions.KHR_meshopt_compression;
|
|
599
|
+
if (defined(khr)) {
|
|
600
|
+
usedBufferIds[khr.buffer] = true;
|
|
601
|
+
}
|
|
592
602
|
}
|
|
593
603
|
});
|
|
594
604
|
|
|
@@ -676,11 +676,11 @@ ImageryLayer.prototype.getImageryRectangle = function () {
|
|
|
676
676
|
* Create skeletons for the imagery tiles that partially or completely overlap a given terrain
|
|
677
677
|
* tile.
|
|
678
678
|
*
|
|
679
|
-
* @
|
|
679
|
+
* @ignore
|
|
680
680
|
*
|
|
681
681
|
* @param {QuadtreeTile} tile The terrain tile.
|
|
682
682
|
* @param {TerrainProvider|undefined} terrainProvider The terrain provider associated with the terrain tile.
|
|
683
|
-
* @param {number} insertionPoint The position to insert new skeletons before in the tile's imagery list.
|
|
683
|
+
* @param {number} [insertionPoint] The position to insert new skeletons before in the tile's imagery list.
|
|
684
684
|
* @returns {boolean} true if this layer overlaps any portion of the terrain tile; otherwise, false.
|
|
685
685
|
*/
|
|
686
686
|
ImageryLayer.prototype._createTileImagerySkeletons = function (
|
|
@@ -545,7 +545,7 @@ ImageryLayerCollection.prototype.pickImageryLayerFeatures = function (
|
|
|
545
545
|
/**
|
|
546
546
|
* Updates frame state to execute any queued texture re-projections.
|
|
547
547
|
*
|
|
548
|
-
* @
|
|
548
|
+
* @ignore
|
|
549
549
|
*
|
|
550
550
|
* @param {FrameState} frameState The frameState.
|
|
551
551
|
*/
|
|
@@ -561,7 +561,7 @@ ImageryLayerCollection.prototype.queueReprojectionCommands = function (
|
|
|
561
561
|
/**
|
|
562
562
|
* Cancels re-projection commands queued for the next frame.
|
|
563
563
|
*
|
|
564
|
-
* @
|
|
564
|
+
* @ignore
|
|
565
565
|
*/
|
|
566
566
|
ImageryLayerCollection.prototype.cancelReprojections = function () {
|
|
567
567
|
const layers = this._layers;
|