@cesium/engine 18.3.1-ion.0 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/ThirdParty/Workers/z-worker-pako.js +75 -91
- package/Build/Workers/{chunk-VOGSSU24.js → chunk-23FRF5ZP.js} +9 -9
- package/Build/Workers/{chunk-AZK5KSZ4.js → chunk-25USKS4R.js} +6 -6
- package/Build/Workers/{chunk-4B4HLHFO.js → chunk-34DFERFC.js} +12 -12
- package/Build/Workers/{chunk-HTB5PIYZ.js → chunk-37IYBZDZ.js} +9 -9
- package/Build/Workers/{chunk-NZVPOOOT.js → chunk-4NRFVAG2.js} +5 -5
- package/Build/Workers/{chunk-QXOWDZYZ.js → chunk-4QWLEG4L.js} +14 -14
- package/Build/Workers/{chunk-XW6DEZZE.js → chunk-5VPO47LB.js} +8 -8
- package/Build/Workers/{chunk-FKO2XRXZ.js → chunk-5YCDPN3O.js} +1 -1
- package/Build/Workers/{chunk-HRF2GFMF.js → chunk-6T2PQKYP.js} +4 -4
- package/Build/Workers/{chunk-IDHHSZTD.js → chunk-AABNX23Q.js} +5 -5
- package/Build/Workers/{chunk-6FY4D6KD.js → chunk-AZPKFL5X.js} +5 -5
- package/Build/Workers/{chunk-HQCLIHYE.js → chunk-C36VNKTH.js} +4 -4
- package/Build/Workers/{chunk-AX3B4SGH.js → chunk-DAHXCIOX.js} +8 -8
- package/Build/Workers/{chunk-QKYGO6XL.js → chunk-DNCRKMCI.js} +6 -6
- package/Build/Workers/{chunk-S2BFGC4W.js → chunk-DPFAUGBE.js} +2 -2
- package/Build/Workers/{chunk-ADA7OX2I.js → chunk-DXYAD4ED.js} +1 -1
- package/Build/Workers/{chunk-Z2GDV3MT.js → chunk-E6NMEKSS.js} +4 -4
- package/Build/Workers/{chunk-52DTHTKR.js → chunk-ECWQXDZY.js} +16 -16
- package/Build/Workers/{chunk-NGFYQUAX.js → chunk-ESDVZ4QL.js} +10 -10
- package/Build/Workers/{chunk-BF2HFWMG.js → chunk-ETCPCGKC.js} +2 -2
- package/Build/Workers/{chunk-SKVVOFGK.js → chunk-EV4PBU7O.js} +1 -1
- package/Build/Workers/{chunk-XLDLCV2F.js → chunk-FQNSMOZT.js} +4 -4
- package/Build/Workers/{chunk-76WKZOUK.js → chunk-GO3IRH6U.js} +6 -6
- package/Build/Workers/{chunk-UXCG22U4.js → chunk-GVO3YIU2.js} +4 -4
- package/Build/Workers/{chunk-SMLHKQNB.js → chunk-HHHBRTSW.js} +9 -9
- package/Build/Workers/{chunk-UHLWUS37.js → chunk-HJ6KFRM7.js} +16 -16
- package/Build/Workers/{chunk-JUYK3CDA.js → chunk-IE2BEHLE.js} +12 -12
- package/Build/Workers/{chunk-IYXAFSJX.js → chunk-JZVUMRYA.js} +13 -13
- package/Build/Workers/{chunk-E7KSST7M.js → chunk-K5VGMGFM.js} +7 -7
- package/Build/Workers/{chunk-DILVD7VK.js → chunk-KTDHOEXR.js} +1 -1
- package/Build/Workers/{chunk-TLR6NX6R.js → chunk-MBDKO456.js} +5 -5
- package/Build/Workers/{chunk-WMSBRWGI.js → chunk-MUL374P3.js} +2 -2
- package/Build/Workers/{chunk-QREBKKN5.js → chunk-NKM2EV46.js} +1 -1
- package/Build/Workers/{chunk-2XJLU3UN.js → chunk-NMAT4IJ6.js} +7 -7
- package/Build/Workers/{chunk-7G2O6QH3.js → chunk-PAH73ETP.js} +5 -5
- package/Build/Workers/{chunk-G2VBRELF.js → chunk-Q2QXUN33.js} +2 -2
- package/Build/Workers/{chunk-B3LHDD7Q.js → chunk-RIQM3XY5.js} +4 -4
- package/Build/Workers/{chunk-ILTPHRDS.js → chunk-RZJA77TX.js} +6 -6
- package/Build/Workers/{chunk-MIUZNGES.js → chunk-SO2Z6H6F.js} +2 -2
- package/Build/Workers/{chunk-UX2S2KIQ.js → chunk-SOYVF5RC.js} +2 -2
- package/Build/Workers/{chunk-VFEUHPSM.js → chunk-SVGHDIZG.js} +5 -5
- package/Build/Workers/{chunk-NL2YZDVI.js → chunk-SXMHGVZ7.js} +12 -12
- package/Build/Workers/{chunk-S2JHBHWB.js → chunk-T7C73J6H.js} +4 -4
- package/Build/Workers/{chunk-KGB6H3RI.js → chunk-UPU755HO.js} +12 -12
- package/Build/Workers/{chunk-IHRAESIS.js → chunk-VCCR35R6.js} +11 -11
- package/Build/Workers/{chunk-QMKOMHVM.js → chunk-W32QSECR.js} +6 -6
- package/Build/Workers/{chunk-3UEVA4NO.js → chunk-WUMTX3FI.js} +6 -6
- package/Build/Workers/{chunk-2Y2IF6ZP.js → chunk-XUYCCEG6.js} +5 -5
- package/Build/Workers/{chunk-Q6SJKTTQ.js → chunk-Y3PM6G2V.js} +3 -3
- package/Build/Workers/{chunk-FBPIDRZN.js → chunk-Y6LLFNXN.js} +10 -10
- package/Build/Workers/{chunk-ERTHACXD.js → chunk-YPNIIVIF.js} +6 -6
- package/Build/Workers/{chunk-EZUKH7KU.js → chunk-ZNEIUXBK.js} +7 -7
- package/Build/Workers/combineGeometry.js +21 -21
- package/Build/Workers/createBoxGeometry.js +15 -15
- package/Build/Workers/createBoxOutlineGeometry.js +13 -13
- package/Build/Workers/createCircleGeometry.js +23 -23
- package/Build/Workers/createCircleOutlineGeometry.js +16 -16
- package/Build/Workers/createCoplanarPolygonGeometry.js +30 -30
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +28 -28
- package/Build/Workers/createCorridorGeometry.js +26 -26
- package/Build/Workers/createCorridorOutlineGeometry.js +25 -25
- package/Build/Workers/createCylinderGeometry.js +17 -17
- package/Build/Workers/createCylinderOutlineGeometry.js +15 -15
- package/Build/Workers/createEllipseGeometry.js +23 -23
- package/Build/Workers/createEllipseOutlineGeometry.js +16 -16
- package/Build/Workers/createEllipsoidGeometry.js +16 -16
- package/Build/Workers/createEllipsoidOutlineGeometry.js +15 -15
- package/Build/Workers/createFrustumGeometry.js +15 -15
- package/Build/Workers/createFrustumOutlineGeometry.js +15 -15
- package/Build/Workers/createGeometry.js +21 -21
- package/Build/Workers/createGroundPolylineGeometry.js +19 -19
- package/Build/Workers/createPlaneGeometry.js +13 -13
- package/Build/Workers/createPlaneOutlineGeometry.js +12 -12
- package/Build/Workers/createPolygonGeometry.js +29 -29
- package/Build/Workers/createPolygonOutlineGeometry.js +27 -27
- package/Build/Workers/createPolylineGeometry.js +22 -22
- package/Build/Workers/createPolylineVolumeGeometry.js +28 -28
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +24 -24
- package/Build/Workers/createRectangleGeometry.js +24 -24
- package/Build/Workers/createRectangleOutlineGeometry.js +17 -17
- package/Build/Workers/createSimplePolylineGeometry.js +20 -20
- package/Build/Workers/createSphereGeometry.js +16 -16
- package/Build/Workers/createSphereOutlineGeometry.js +15 -15
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +12 -12
- package/Build/Workers/createVectorTileGeometries.js +21 -21
- package/Build/Workers/createVectorTilePoints.js +11 -11
- package/Build/Workers/createVectorTilePolygons.js +19 -19
- package/Build/Workers/createVectorTilePolylines.js +12 -12
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +19 -19
- package/Build/Workers/createVerticesFromHeightmap.js +19 -19
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +16 -16
- package/Build/Workers/createWallGeometry.js +21 -21
- package/Build/Workers/createWallOutlineGeometry.js +20 -20
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +9 -9
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +19 -19
- package/LICENSE.md +32 -25
- package/Source/Core/ITwinPlatform.js +8 -1
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/ScreenSpaceEventHandler.js +3 -3
- package/Source/Core/addAllToArray.js +40 -0
- package/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js +54 -26
- package/Source/Renderer/Context.js +8 -4
- package/Source/Renderer/Renderbuffer.js +4 -2
- package/Source/Renderer/Sampler.js +13 -0
- package/Source/Renderer/ShaderBuilder.js +7 -6
- package/Source/Renderer/SharedContext.js +186 -0
- package/Source/Renderer/Texture.js +4 -5
- package/Source/Renderer/Texture3D.js +17 -7
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/BillboardCollection.js +1 -1
- package/Source/Scene/Cesium3DTileBatchTable.js +6 -4
- package/Source/Scene/Cesium3DTileStyle.js +4 -3
- package/Source/Scene/Cesium3DTileset.js +1 -1
- package/Source/Scene/ConditionsExpression.js +3 -2
- package/Source/Scene/GaussianSplatPrimitive.js +1 -1
- package/Source/Scene/GltfLoader.js +3 -2
- package/Source/Scene/GltfPipeline/ForEach.js +7 -7
- package/Source/Scene/GltfPipeline/addDefaults.js +1 -2
- package/Source/Scene/GltfPipeline/addToArray.js +2 -0
- package/Source/Scene/GltfPipeline/findAccessorMinMax.js +1 -1
- package/Source/Scene/GltfPipeline/getComponentReader.js +16 -16
- package/Source/Scene/GltfPipeline/moveTechniqueRenderStates.js +1 -1
- package/Source/Scene/GltfPipeline/moveTechniquesToExtension.js +3 -3
- package/Source/Scene/GltfPipeline/parseGlb.js +1 -1
- package/Source/Scene/GltfPipeline/readAccessorPacked.js +2 -2
- package/Source/Scene/GltfPipeline/removeUnusedElements.js +5 -6
- package/Source/Scene/GltfPipeline/updateAccessorComponentTypes.js +1 -1
- package/Source/Scene/GltfPipeline/updateVersion.js +13 -13
- package/Source/Scene/GltfSpzLoader.js +3 -1
- package/Source/Scene/HeightReference.js +1 -1
- package/Source/Scene/ITwinData.js +97 -34
- package/Source/Scene/ImageBasedLighting.js +6 -2
- package/Source/Scene/ImageryLayer.js +10 -10
- package/Source/Scene/MetadataTableProperty.js +2 -1
- package/Source/Scene/Model/ClassificationModelDrawCommand.js +7 -6
- package/Source/Scene/Model/GeoJsonLoader.js +3 -1
- package/Source/Scene/Model/ImageryConfiguration.js +1 -0
- package/Source/Scene/Model/ImageryPipelineStage.js +8 -2
- package/Source/Scene/Model/InstancingPipelineStage.js +3 -8
- package/Source/Scene/Model/MaterialPipelineStage.js +10 -1
- package/Source/Scene/Model/ModelImagery.js +3 -0
- package/Source/Scene/Model/ModelSceneGraph.js +2 -1
- package/Source/Scene/Picking.js +41 -1
- package/Source/Scene/Primitive.js +0 -1
- package/Source/Scene/PrimitiveCollection.js +32 -6
- package/Source/Scene/PrimitiveLoadPlan.js +0 -36
- package/Source/Scene/PropertyTable.js +7 -12
- package/Source/Scene/Scene.js +41 -32
- package/Source/Scene/ScreenSpaceCameraController.js +2 -0
- package/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.glsl +2 -1
- package/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.js +2 -1
- package/Source/Shaders/EllipsoidVS.glsl +4 -4
- package/Source/Shaders/EllipsoidVS.js +4 -4
- package/Source/Shaders/FXAA3_11.glsl +2 -0
- package/Source/Shaders/FXAA3_11.js +2 -0
- package/Source/Shaders/GlobeVS.glsl +2 -1
- package/Source/Shaders/GlobeVS.js +2 -1
- package/Source/Shaders/SkyAtmosphereVS.glsl +2 -1
- package/Source/Shaders/SkyAtmosphereVS.js +2 -1
- package/Source/ThirdParty/Workers/z-worker-pako.js +1 -1
- package/index.d.ts +82 -53
- package/index.js +244 -242
- package/package.json +3 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import addAllToArray from "../Core/addAllToArray.js";
|
|
1
2
|
import clone from "../Core/clone.js";
|
|
2
3
|
import Frozen from "../Core/Frozen.js";
|
|
3
4
|
import defined from "../Core/defined.js";
|
|
@@ -1452,15 +1453,15 @@ Cesium3DTileStyle.prototype.getVariables = function () {
|
|
|
1452
1453
|
let variables = [];
|
|
1453
1454
|
|
|
1454
1455
|
if (defined(this.color) && defined(this.color.getVariables)) {
|
|
1455
|
-
|
|
1456
|
+
addAllToArray(variables, this.color.getVariables());
|
|
1456
1457
|
}
|
|
1457
1458
|
|
|
1458
1459
|
if (defined(this.show) && defined(this.show.getVariables)) {
|
|
1459
|
-
|
|
1460
|
+
addAllToArray(variables, this.show.getVariables());
|
|
1460
1461
|
}
|
|
1461
1462
|
|
|
1462
1463
|
if (defined(this.pointSize) && defined(this.pointSize.getVariables)) {
|
|
1463
|
-
|
|
1464
|
+
addAllToArray(variables, this.pointSize.getVariables());
|
|
1464
1465
|
}
|
|
1465
1466
|
|
|
1466
1467
|
// Remove duplicates
|
|
@@ -119,7 +119,7 @@ import ImageryLayerCollection from "./ImageryLayerCollection.js";
|
|
|
119
119
|
* @property {string|number} [instanceFeatureIdLabel="instanceFeatureId_0"] Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string "instanceFeatureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
|
|
120
120
|
* @property {boolean} [showCreditsOnScreen=false] Whether to display the credits of this tileset on screen.
|
|
121
121
|
* @property {SplitDirection} [splitDirection=SplitDirection.NONE] The {@link SplitDirection} split to apply to this tileset.
|
|
122
|
-
* @property {boolean} [enableCollision=false] When <code>true</code>, enables collisions for camera or CPU picking. While this is <code>true</code> the camera will be prevented from going below the tileset surface if {@link ScreenSpaceCameraController#enableCollisionDetection} is true.
|
|
122
|
+
* @property {boolean} [enableCollision=false] When <code>true</code>, enables collisions for camera or CPU picking. While this is <code>true</code> the camera will be prevented from going below the tileset surface if {@link ScreenSpaceCameraController#enableCollisionDetection} is true. This also affects the behavior of {@link HeightReference.CLAMP_TO_GROUND} when clamping to 3D Tiles surfaces. If <code>enableCollision</code> is <code>false</code>, entities may not be correctly clamped to the tileset geometry.
|
|
123
123
|
* @property {boolean} [projectTo2D=false] Whether to accurately project the tileset to 2D. If this is true, the tileset will be projected accurately to 2D, but it will use more memory to do so. If this is false, the tileset will use less memory and will still render in 2D / CV mode, but its projected positions may be inaccurate. This cannot be set after the tileset has been created.
|
|
124
124
|
* @property {boolean} [enablePick=false] Whether to allow collision and CPU picking with <code>pick</code> when using WebGL 1. If using WebGL 2 or above, this option will be ignored. If using WebGL 1 and this is true, the <code>pick</code> operation will work correctly, but it will use more memory to do so. If running with WebGL 1 and this is false, the model will use less memory, but <code>pick</code> will always return <code>undefined</code>. This cannot be set after the tileset has loaded.
|
|
125
125
|
* @property {boolean} [asynchronouslyLoadImagery=false] Whether loading imagery that is draped over the tileset should be done asynchronously. If this is <code>true</code>, then tile content will be displayed with its original texture until the imagery texture is loaded. If this is <code>false</code>, then the tile content will not be displayed until the imagery is ready.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import addAllToArray from "../Core/addAllToArray.js";
|
|
1
2
|
import clone from "../Core/clone.js";
|
|
2
3
|
import defined from "../Core/defined.js";
|
|
3
4
|
import Expression from "./Expression.js";
|
|
@@ -203,8 +204,8 @@ ConditionsExpression.prototype.getVariables = function () {
|
|
|
203
204
|
const length = conditions.length;
|
|
204
205
|
for (let i = 0; i < length; ++i) {
|
|
205
206
|
const statement = conditions[i];
|
|
206
|
-
|
|
207
|
-
|
|
207
|
+
addAllToArray(variables, statement.condition.getVariables());
|
|
208
|
+
addAllToArray(variables, statement.expression.getVariables());
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
// Remove duplicates
|
|
@@ -720,7 +720,7 @@ GaussianSplatPrimitive.prototype.update = function (frameState) {
|
|
|
720
720
|
this._rootTransform = tileset.root.computedTransform;
|
|
721
721
|
}
|
|
722
722
|
|
|
723
|
-
if (this._drawCommand) {
|
|
723
|
+
if (this._drawCommand && tileset.show) {
|
|
724
724
|
frameState.commandList.push(this._drawCommand);
|
|
725
725
|
}
|
|
726
726
|
|
|
@@ -32,6 +32,7 @@ import VertexAttributeSemantic from "./VertexAttributeSemantic.js";
|
|
|
32
32
|
import GltfGpmLoader from "./Model/Extensions/Gpm/GltfGpmLoader.js";
|
|
33
33
|
import GltfMeshPrimitiveGpmLoader from "./Model/Extensions/Gpm/GltfMeshPrimitiveGpmLoader.js";
|
|
34
34
|
import oneTimeWarning from "../Core/oneTimeWarning.js";
|
|
35
|
+
import addAllToArray from "../Core/addAllToArray.js";
|
|
35
36
|
|
|
36
37
|
const {
|
|
37
38
|
Attribute,
|
|
@@ -2827,12 +2828,12 @@ function parse(loader, frameState) {
|
|
|
2827
2828
|
|
|
2828
2829
|
// Gather promises and handle any errors
|
|
2829
2830
|
const readyPromises = [];
|
|
2830
|
-
|
|
2831
|
+
addAllToArray(readyPromises, loader._loaderPromises);
|
|
2831
2832
|
|
|
2832
2833
|
// When incrementallyLoadTextures is true, the errors are caught and thrown individually
|
|
2833
2834
|
// since it doesn't affect the overall loader state
|
|
2834
2835
|
if (!loader._incrementallyLoadTextures) {
|
|
2835
|
-
|
|
2836
|
+
addAllToArray(readyPromises, loader._texturesPromises);
|
|
2836
2837
|
}
|
|
2837
2838
|
|
|
2838
2839
|
return Promise.all(readyPromises);
|
|
@@ -80,7 +80,7 @@ ForEach.accessorWithSemantic = function (gltf, semantic, handler) {
|
|
|
80
80
|
return value;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
}
|
|
83
|
+
},
|
|
84
84
|
);
|
|
85
85
|
|
|
86
86
|
if (defined(valueForEach)) {
|
|
@@ -102,7 +102,7 @@ ForEach.accessorWithSemantic = function (gltf, semantic, handler) {
|
|
|
102
102
|
return value;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
}
|
|
105
|
+
},
|
|
106
106
|
);
|
|
107
107
|
});
|
|
108
108
|
});
|
|
@@ -124,7 +124,7 @@ ForEach.accessorContainingVertexAttributeData = function (gltf, handler) {
|
|
|
124
124
|
return value;
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
|
-
}
|
|
127
|
+
},
|
|
128
128
|
);
|
|
129
129
|
|
|
130
130
|
if (defined(valueForEach)) {
|
|
@@ -143,7 +143,7 @@ ForEach.accessorContainingVertexAttributeData = function (gltf, handler) {
|
|
|
143
143
|
return value;
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
}
|
|
146
|
+
},
|
|
147
147
|
);
|
|
148
148
|
});
|
|
149
149
|
});
|
|
@@ -322,7 +322,7 @@ ForEach.program = function (gltf, handler) {
|
|
|
322
322
|
if (usesExtension(gltf, "KHR_techniques_webgl")) {
|
|
323
323
|
return ForEach.object(
|
|
324
324
|
gltf.extensions.KHR_techniques_webgl.programs,
|
|
325
|
-
handler
|
|
325
|
+
handler,
|
|
326
326
|
);
|
|
327
327
|
}
|
|
328
328
|
|
|
@@ -341,7 +341,7 @@ ForEach.shader = function (gltf, handler) {
|
|
|
341
341
|
if (usesExtension(gltf, "KHR_techniques_webgl")) {
|
|
342
342
|
return ForEach.object(
|
|
343
343
|
gltf.extensions.KHR_techniques_webgl.shaders,
|
|
344
|
-
handler
|
|
344
|
+
handler,
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
347
|
|
|
@@ -410,7 +410,7 @@ ForEach.technique = function (gltf, handler) {
|
|
|
410
410
|
if (usesExtension(gltf, "KHR_techniques_webgl")) {
|
|
411
411
|
return ForEach.object(
|
|
412
412
|
gltf.extensions.KHR_techniques_webgl.techniques,
|
|
413
|
-
handler
|
|
413
|
+
handler,
|
|
414
414
|
);
|
|
415
415
|
}
|
|
416
416
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import addToArray from "./addToArray.js";
|
|
2
2
|
import ForEach from "./ForEach.js";
|
|
3
3
|
import getAccessorByteStride from "./getAccessorByteStride.js";
|
|
4
|
-
import Frozen from "../../Core/Frozen.js";
|
|
5
4
|
import defined from "../../Core/defined.js";
|
|
6
5
|
import WebGLConstants from "../../Core/WebGLConstants.js";
|
|
7
6
|
|
|
@@ -62,7 +61,7 @@ function addDefaults(gltf) {
|
|
|
62
61
|
});
|
|
63
62
|
|
|
64
63
|
ForEach.material(gltf, function (material) {
|
|
65
|
-
const extensions = material.extensions ??
|
|
64
|
+
const extensions = material.extensions ?? {};
|
|
66
65
|
const materialsCommon = extensions.KHR_materials_common;
|
|
67
66
|
if (defined(materialsCommon)) {
|
|
68
67
|
const technique = materialsCommon.technique;
|
|
@@ -16,11 +16,11 @@ function getComponentReader(componentType) {
|
|
|
16
16
|
byteOffset,
|
|
17
17
|
numberOfComponents,
|
|
18
18
|
componentTypeByteLength,
|
|
19
|
-
result
|
|
19
|
+
result,
|
|
20
20
|
) {
|
|
21
21
|
for (let i = 0; i < numberOfComponents; ++i) {
|
|
22
22
|
result[i] = dataView.getInt8(
|
|
23
|
-
byteOffset + i * componentTypeByteLength
|
|
23
|
+
byteOffset + i * componentTypeByteLength,
|
|
24
24
|
);
|
|
25
25
|
}
|
|
26
26
|
};
|
|
@@ -30,11 +30,11 @@ function getComponentReader(componentType) {
|
|
|
30
30
|
byteOffset,
|
|
31
31
|
numberOfComponents,
|
|
32
32
|
componentTypeByteLength,
|
|
33
|
-
result
|
|
33
|
+
result,
|
|
34
34
|
) {
|
|
35
35
|
for (let i = 0; i < numberOfComponents; ++i) {
|
|
36
36
|
result[i] = dataView.getUint8(
|
|
37
|
-
byteOffset + i * componentTypeByteLength
|
|
37
|
+
byteOffset + i * componentTypeByteLength,
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
};
|
|
@@ -44,12 +44,12 @@ function getComponentReader(componentType) {
|
|
|
44
44
|
byteOffset,
|
|
45
45
|
numberOfComponents,
|
|
46
46
|
componentTypeByteLength,
|
|
47
|
-
result
|
|
47
|
+
result,
|
|
48
48
|
) {
|
|
49
49
|
for (let i = 0; i < numberOfComponents; ++i) {
|
|
50
50
|
result[i] = dataView.getInt16(
|
|
51
51
|
byteOffset + i * componentTypeByteLength,
|
|
52
|
-
true
|
|
52
|
+
true,
|
|
53
53
|
);
|
|
54
54
|
}
|
|
55
55
|
};
|
|
@@ -59,12 +59,12 @@ function getComponentReader(componentType) {
|
|
|
59
59
|
byteOffset,
|
|
60
60
|
numberOfComponents,
|
|
61
61
|
componentTypeByteLength,
|
|
62
|
-
result
|
|
62
|
+
result,
|
|
63
63
|
) {
|
|
64
64
|
for (let i = 0; i < numberOfComponents; ++i) {
|
|
65
65
|
result[i] = dataView.getUint16(
|
|
66
66
|
byteOffset + i * componentTypeByteLength,
|
|
67
|
-
true
|
|
67
|
+
true,
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
};
|
|
@@ -74,12 +74,12 @@ function getComponentReader(componentType) {
|
|
|
74
74
|
byteOffset,
|
|
75
75
|
numberOfComponents,
|
|
76
76
|
componentTypeByteLength,
|
|
77
|
-
result
|
|
77
|
+
result,
|
|
78
78
|
) {
|
|
79
79
|
for (let i = 0; i < numberOfComponents; ++i) {
|
|
80
80
|
result[i] = dataView.getInt32(
|
|
81
81
|
byteOffset + i * componentTypeByteLength,
|
|
82
|
-
true
|
|
82
|
+
true,
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
85
|
};
|
|
@@ -89,12 +89,12 @@ function getComponentReader(componentType) {
|
|
|
89
89
|
byteOffset,
|
|
90
90
|
numberOfComponents,
|
|
91
91
|
componentTypeByteLength,
|
|
92
|
-
result
|
|
92
|
+
result,
|
|
93
93
|
) {
|
|
94
94
|
for (let i = 0; i < numberOfComponents; ++i) {
|
|
95
95
|
result[i] = dataView.getUint32(
|
|
96
96
|
byteOffset + i * componentTypeByteLength,
|
|
97
|
-
true
|
|
97
|
+
true,
|
|
98
98
|
);
|
|
99
99
|
}
|
|
100
100
|
};
|
|
@@ -104,12 +104,12 @@ function getComponentReader(componentType) {
|
|
|
104
104
|
byteOffset,
|
|
105
105
|
numberOfComponents,
|
|
106
106
|
componentTypeByteLength,
|
|
107
|
-
result
|
|
107
|
+
result,
|
|
108
108
|
) {
|
|
109
109
|
for (let i = 0; i < numberOfComponents; ++i) {
|
|
110
110
|
result[i] = dataView.getFloat32(
|
|
111
111
|
byteOffset + i * componentTypeByteLength,
|
|
112
|
-
true
|
|
112
|
+
true,
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
};
|
|
@@ -119,12 +119,12 @@ function getComponentReader(componentType) {
|
|
|
119
119
|
byteOffset,
|
|
120
120
|
numberOfComponents,
|
|
121
121
|
componentTypeByteLength,
|
|
122
|
-
result
|
|
122
|
+
result,
|
|
123
123
|
) {
|
|
124
124
|
for (let i = 0; i < numberOfComponents; ++i) {
|
|
125
125
|
result[i] = dataView.getFloat64(
|
|
126
126
|
byteOffset + i * componentTypeByteLength,
|
|
127
|
-
true
|
|
127
|
+
true,
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
130
|
};
|
|
@@ -44,7 +44,7 @@ function moveTechniquesToExtension(gltf) {
|
|
|
44
44
|
technique.attributes[attributeName] = {
|
|
45
45
|
semantic: parameterLegacy.semantic,
|
|
46
46
|
};
|
|
47
|
-
}
|
|
47
|
+
},
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
ForEach.techniqueUniform(
|
|
@@ -64,7 +64,7 @@ function moveTechniquesToExtension(gltf) {
|
|
|
64
64
|
mappedUniforms[techniqueId] = {};
|
|
65
65
|
}
|
|
66
66
|
mappedUniforms[techniqueId][parameterName] = uniformName;
|
|
67
|
-
}
|
|
67
|
+
},
|
|
68
68
|
);
|
|
69
69
|
|
|
70
70
|
if (!defined(seenPrograms[techniqueLegacy.program])) {
|
|
@@ -92,7 +92,7 @@ function moveTechniquesToExtension(gltf) {
|
|
|
92
92
|
// Store the index of the new technique to reference instead.
|
|
93
93
|
updatedTechniqueIndices[techniqueId] = addToArray(
|
|
94
94
|
extension.techniques,
|
|
95
|
-
technique
|
|
95
|
+
technique,
|
|
96
96
|
);
|
|
97
97
|
});
|
|
98
98
|
|
|
@@ -16,7 +16,7 @@ import defined from "../../Core/defined.js";
|
|
|
16
16
|
function readAccessorPacked(gltf, accessor) {
|
|
17
17
|
const byteStride = getAccessorByteStride(gltf, accessor);
|
|
18
18
|
const componentTypeByteLength = ComponentDatatype.getSizeInBytes(
|
|
19
|
-
accessor.componentType
|
|
19
|
+
accessor.componentType,
|
|
20
20
|
);
|
|
21
21
|
const numberOfComponents = numberOfComponentsForType(accessor.type);
|
|
22
22
|
const count = accessor.count;
|
|
@@ -41,7 +41,7 @@ function readAccessorPacked(gltf, accessor) {
|
|
|
41
41
|
byteOffset,
|
|
42
42
|
numberOfComponents,
|
|
43
43
|
componentTypeByteLength,
|
|
44
|
-
components
|
|
44
|
+
components,
|
|
45
45
|
);
|
|
46
46
|
for (let j = 0; j < numberOfComponents; ++j) {
|
|
47
47
|
values[i * numberOfComponents + j] = components[j];
|
|
@@ -87,7 +87,7 @@ Remove.accessor = function (gltf, accessorId) {
|
|
|
87
87
|
if (attributeAccessorId > accessorId) {
|
|
88
88
|
primitive.attributes[semantic]--;
|
|
89
89
|
}
|
|
90
|
-
}
|
|
90
|
+
},
|
|
91
91
|
);
|
|
92
92
|
|
|
93
93
|
// Update accessor ids for the targets.
|
|
@@ -98,7 +98,7 @@ Remove.accessor = function (gltf, accessorId) {
|
|
|
98
98
|
if (attributeAccessorId > accessorId) {
|
|
99
99
|
target[semantic]--;
|
|
100
100
|
}
|
|
101
|
-
}
|
|
101
|
+
},
|
|
102
102
|
);
|
|
103
103
|
});
|
|
104
104
|
const indices = primitive.indices;
|
|
@@ -548,7 +548,7 @@ getListOfElementsIdsInUse.accessor = function (gltf) {
|
|
|
548
548
|
const attributeAccessorId =
|
|
549
549
|
node.extensions.EXT_mesh_gpu_instancing.attributes[key];
|
|
550
550
|
usedAccessorIds[attributeAccessorId] = true;
|
|
551
|
-
}
|
|
551
|
+
},
|
|
552
552
|
);
|
|
553
553
|
}
|
|
554
554
|
});
|
|
@@ -587,9 +587,8 @@ getListOfElementsIdsInUse.buffer = function (gltf) {
|
|
|
587
587
|
defined(bufferView.extensions) &&
|
|
588
588
|
defined(bufferView.extensions.EXT_meshopt_compression)
|
|
589
589
|
) {
|
|
590
|
-
usedBufferIds[
|
|
591
|
-
|
|
592
|
-
] = true;
|
|
590
|
+
usedBufferIds[bufferView.extensions.EXT_meshopt_compression.buffer] =
|
|
591
|
+
true;
|
|
593
592
|
}
|
|
594
593
|
});
|
|
595
594
|
|
|
@@ -42,7 +42,7 @@ function updateAccessorComponentTypes(gltf) {
|
|
|
42
42
|
function convertType(gltf, accessor, updatedComponentType) {
|
|
43
43
|
const typedArray = ComponentDatatype.createTypedArray(
|
|
44
44
|
updatedComponentType,
|
|
45
|
-
readAccessorPacked(gltf, accessor)
|
|
45
|
+
readAccessorPacked(gltf, accessor),
|
|
46
46
|
);
|
|
47
47
|
const newBuffer = new Uint8Array(typedArray.buffer);
|
|
48
48
|
accessor.bufferView = addBuffer(gltf, newBuffer);
|
|
@@ -13,7 +13,6 @@ import Cartesian3 from "../../Core/Cartesian3.js";
|
|
|
13
13
|
import Cartesian4 from "../../Core/Cartesian4.js";
|
|
14
14
|
import clone from "../../Core/clone.js";
|
|
15
15
|
import ComponentDatatype from "../../Core/ComponentDatatype.js";
|
|
16
|
-
import Frozen from "../../Core/Frozen.js";
|
|
17
16
|
import defined from "../../Core/defined.js";
|
|
18
17
|
import Matrix4 from "../../Core/Matrix4.js";
|
|
19
18
|
import Quaternion from "../../Core/Quaternion.js";
|
|
@@ -40,11 +39,13 @@ const updateFunctions = {
|
|
|
40
39
|
* @private
|
|
41
40
|
*/
|
|
42
41
|
function updateVersion(gltf, options) {
|
|
43
|
-
options = options ??
|
|
42
|
+
options = options ?? {};
|
|
44
43
|
const targetVersion = options.targetVersion;
|
|
45
44
|
let version = gltf.version;
|
|
46
45
|
|
|
47
|
-
gltf.asset = gltf.asset ?? {
|
|
46
|
+
gltf.asset = gltf.asset ?? {
|
|
47
|
+
version: "1.0",
|
|
48
|
+
};
|
|
48
49
|
|
|
49
50
|
gltf.asset.version = gltf.asset.version ?? "1.0";
|
|
50
51
|
version = (version ?? gltf.asset.version).toString();
|
|
@@ -176,7 +177,7 @@ function updateAnimations(gltf) {
|
|
|
176
177
|
componentType,
|
|
177
178
|
source.buffer,
|
|
178
179
|
byteOffset,
|
|
179
|
-
length
|
|
180
|
+
length,
|
|
180
181
|
);
|
|
181
182
|
|
|
182
183
|
for (let j = 0; j < count; j++) {
|
|
@@ -416,7 +417,7 @@ function objectsToArrays(gltf) {
|
|
|
416
417
|
primitive,
|
|
417
418
|
function (accessorId, semantic) {
|
|
418
419
|
primitive.attributes[semantic] = globalMapping.accessors[accessorId];
|
|
419
|
-
}
|
|
420
|
+
},
|
|
420
421
|
);
|
|
421
422
|
if (defined(primitive.material)) {
|
|
422
423
|
primitive.material = globalMapping.materials[primitive.material];
|
|
@@ -636,7 +637,7 @@ function requireAttributeSetIndex(gltf) {
|
|
|
636
637
|
} else if (semantic === "COLOR") {
|
|
637
638
|
primitive.attributes.COLOR_0 = accessorId;
|
|
638
639
|
}
|
|
639
|
-
}
|
|
640
|
+
},
|
|
640
641
|
);
|
|
641
642
|
delete primitive.attributes.TEXCOORD;
|
|
642
643
|
delete primitive.attributes.COLOR;
|
|
@@ -695,7 +696,7 @@ function underscoreApplicationSpecificSemantics(gltf) {
|
|
|
695
696
|
mappedSemantics[semantic] = newSemantic;
|
|
696
697
|
}
|
|
697
698
|
}
|
|
698
|
-
}
|
|
699
|
+
},
|
|
699
700
|
);
|
|
700
701
|
for (const semantic in mappedSemantics) {
|
|
701
702
|
if (Object.prototype.hasOwnProperty.call(mappedSemantics, semantic)) {
|
|
@@ -756,7 +757,7 @@ function requireByteLength(gltf) {
|
|
|
756
757
|
accessor.byteOffset + accessor.count * accessorByteStride;
|
|
757
758
|
bufferView.byteLength = Math.max(
|
|
758
759
|
bufferView.byteLength ?? 0,
|
|
759
|
-
accessorByteEnd
|
|
760
|
+
accessorByteEnd,
|
|
760
761
|
);
|
|
761
762
|
}
|
|
762
763
|
});
|
|
@@ -861,7 +862,7 @@ function isNodeEmpty(node) {
|
|
|
861
862
|
Cartesian3.fromArray(node.scale).equals(new Cartesian3(1.0, 1.0, 1.0))) &&
|
|
862
863
|
(!defined(node.rotation) ||
|
|
863
864
|
Cartesian4.fromArray(node.rotation).equals(
|
|
864
|
-
new Cartesian4(0.0, 0.0, 0.0, 1.0)
|
|
865
|
+
new Cartesian4(0.0, 0.0, 0.0, 1.0),
|
|
865
866
|
)) &&
|
|
866
867
|
(!defined(node.matrix) ||
|
|
867
868
|
Matrix4.fromColumnMajorArray(node.matrix).equals(Matrix4.IDENTITY)) &&
|
|
@@ -1028,7 +1029,7 @@ function srgbToLinear(srgb) {
|
|
|
1028
1029
|
linear[i] = Math.pow(
|
|
1029
1030
|
// eslint-disable-next-line no-loss-of-precision
|
|
1030
1031
|
(c + 0.055) * 0.94786729857819905213270142180095,
|
|
1031
|
-
2.4
|
|
1032
|
+
2.4,
|
|
1032
1033
|
);
|
|
1033
1034
|
}
|
|
1034
1035
|
}
|
|
@@ -1037,7 +1038,7 @@ function srgbToLinear(srgb) {
|
|
|
1037
1038
|
}
|
|
1038
1039
|
|
|
1039
1040
|
function convertTechniquesToPbr(gltf, options) {
|
|
1040
|
-
options = options ??
|
|
1041
|
+
options = options ?? {};
|
|
1041
1042
|
const baseColorTextureNames =
|
|
1042
1043
|
options.baseColorTextureNames ?? defaultBaseColorTextureNames;
|
|
1043
1044
|
const baseColorFactorNames =
|
|
@@ -1083,8 +1084,7 @@ function assignAsEmissive(material, emissive) {
|
|
|
1083
1084
|
function convertMaterialsCommonToPbr(gltf) {
|
|
1084
1085
|
// Future work: convert KHR_materials_common lights to KHR_lights_punctual
|
|
1085
1086
|
ForEach.material(gltf, function (material) {
|
|
1086
|
-
const materialsCommon = (material.extensions ??
|
|
1087
|
-
.KHR_materials_common;
|
|
1087
|
+
const materialsCommon = (material.extensions ?? {}).KHR_materials_common;
|
|
1088
1088
|
if (!defined(materialsCommon)) {
|
|
1089
1089
|
// Nothing to do
|
|
1090
1090
|
return;
|
|
@@ -194,7 +194,9 @@ GltfSpzLoader.prototype.process = function (frameState) {
|
|
|
194
194
|
return false;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
const decodePromise = loadSpz(this._bufferViewTypedArray
|
|
197
|
+
const decodePromise = loadSpz(this._bufferViewTypedArray, {
|
|
198
|
+
unpackOptions: { coordinateSystem: "UNSPECIFIED" },
|
|
199
|
+
});
|
|
198
200
|
|
|
199
201
|
if (!defined(decodePromise)) {
|
|
200
202
|
return false;
|
|
@@ -12,7 +12,7 @@ const HeightReference = {
|
|
|
12
12
|
NONE: 0,
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* The position is clamped to the terrain and 3D Tiles.
|
|
15
|
+
* The position is clamped to the terrain and 3D Tiles. When clamping to 3D Tilesets such as photorealistic 3D Tiles, ensure the tileset has {@link Cesium3DTileset#enableCollision} set to <code>true</code>. Otherwise, the entity may not be correctly clamped to the tileset surface.
|
|
16
16
|
* @type {number}
|
|
17
17
|
* @constant
|
|
18
18
|
*/
|