@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
|
@@ -14,10 +14,11 @@ import createPropertyDescriptor from "./createPropertyDescriptor.js";
|
|
|
14
14
|
* @property {Property | number} [leadTime] A Property specifying the number of seconds in front the object to show.
|
|
15
15
|
* @property {Property | number} [trailTime] A Property specifying the number of seconds behind of the object to show.
|
|
16
16
|
* @property {Property | number} [width=1.0] A numeric Property specifying the width in pixels.
|
|
17
|
-
* @property {Property | number} [resolution=60] A numeric Property specifying the maximum number of seconds to step when sampling the position.
|
|
17
|
+
* @property {Property | number} [resolution=60] A numeric Property specifying the maximum number of seconds to step when sampling the position. Fractional positive values are allowed; in PORTIONS materialMode, non-positive values fall back to the default resolution of 60 seconds.
|
|
18
18
|
* @property {MaterialProperty | Color} [material=Color.WHITE] A Property specifying the material used to draw the path.
|
|
19
19
|
* @property {Property | DistanceDisplayCondition} [distanceDisplayCondition] A Property specifying at what distance from the camera that this path will be displayed.
|
|
20
20
|
* @property {Property | string} [relativeTo] A Property specifying the frame in which to visualize the path. Use another entity's id to visualize the path relative to that entity, or use the string values "FIXED" or "INERTIAL" to visualize the path in those reference frames.
|
|
21
|
+
* @property {Property | PathMode} [materialMode] A Property specifying how material properties are applied along the path.
|
|
21
22
|
*/
|
|
22
23
|
|
|
23
24
|
/**
|
|
@@ -46,6 +47,8 @@ function PathGraphics(options) {
|
|
|
46
47
|
this._distanceDisplayConditionSubscription = undefined;
|
|
47
48
|
this._relativeTo = undefined;
|
|
48
49
|
this._relativeToSubscription = undefined;
|
|
50
|
+
this._materialMode = undefined;
|
|
51
|
+
this._materialModeSubscription = undefined;
|
|
49
52
|
|
|
50
53
|
this.merge(options ?? Frozen.EMPTY_OBJECT);
|
|
51
54
|
}
|
|
@@ -95,6 +98,7 @@ Object.defineProperties(PathGraphics.prototype, {
|
|
|
95
98
|
|
|
96
99
|
/**
|
|
97
100
|
* Gets or sets the Property specifying the maximum number of seconds to step when sampling the position.
|
|
101
|
+
* Fractional positive values are allowed; in PORTIONS materialMode, non-positive values fall back to the default resolution of 60 seconds.
|
|
98
102
|
* @memberof PathGraphics.prototype
|
|
99
103
|
* @type {Property|undefined}
|
|
100
104
|
* @default 60
|
|
@@ -125,6 +129,7 @@ Object.defineProperties(PathGraphics.prototype, {
|
|
|
125
129
|
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
126
130
|
*/
|
|
127
131
|
relativeTo: createPropertyDescriptor("relativeTo"),
|
|
132
|
+
materialMode: createPropertyDescriptor("materialMode"),
|
|
128
133
|
});
|
|
129
134
|
|
|
130
135
|
/**
|
|
@@ -145,6 +150,7 @@ PathGraphics.prototype.clone = function (result) {
|
|
|
145
150
|
result.material = this.material;
|
|
146
151
|
result.distanceDisplayCondition = this.distanceDisplayCondition;
|
|
147
152
|
result.relativeTo = this.relativeTo;
|
|
153
|
+
result.materialMode = this.materialMode;
|
|
148
154
|
return result;
|
|
149
155
|
};
|
|
150
156
|
|
|
@@ -170,5 +176,6 @@ PathGraphics.prototype.merge = function (source) {
|
|
|
170
176
|
this.distanceDisplayCondition =
|
|
171
177
|
this.distanceDisplayCondition ?? source.distanceDisplayCondition;
|
|
172
178
|
this.relativeTo = this.relativeTo ?? source.relativeTo;
|
|
179
|
+
this.materialMode = this.materialMode ?? source.materialMode;
|
|
173
180
|
};
|
|
174
181
|
export default PathGraphics;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Defines how material properties are applied along a path.
|
|
5
|
+
*
|
|
6
|
+
* @enum {number}
|
|
7
|
+
*/
|
|
8
|
+
const PathMode = {
|
|
9
|
+
/**
|
|
10
|
+
* The material is applied to the entire path as a whole.
|
|
11
|
+
* @type {number}
|
|
12
|
+
* @constant
|
|
13
|
+
*/
|
|
14
|
+
WHOLE: 0,
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The material is applied in portions based on temporal position information,
|
|
18
|
+
* using interval-based material properties.
|
|
19
|
+
* @type {number}
|
|
20
|
+
* @constant
|
|
21
|
+
*/
|
|
22
|
+
PORTIONS: 1,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
Object.freeze(PathMode);
|
|
26
|
+
|
|
27
|
+
export default PathMode;
|
|
@@ -17,12 +17,14 @@ import CallbackPositionProperty from "./CallbackPositionProperty.js";
|
|
|
17
17
|
import CompositePositionProperty from "./CompositePositionProperty.js";
|
|
18
18
|
import ConstantPositionProperty from "./ConstantPositionProperty.js";
|
|
19
19
|
import MaterialProperty from "./MaterialProperty.js";
|
|
20
|
+
import PathMode from "./PathMode.js";
|
|
20
21
|
import Property from "./Property.js";
|
|
21
22
|
import ReferenceProperty from "./ReferenceProperty.js";
|
|
22
23
|
import SampledPositionProperty from "./SampledPositionProperty.js";
|
|
23
24
|
import ScaledPositionProperty from "./ScaledPositionProperty.js";
|
|
24
25
|
import TimeIntervalCollectionPositionProperty from "./TimeIntervalCollectionPositionProperty.js";
|
|
25
26
|
import Quaternion from "../Core/Quaternion.js";
|
|
27
|
+
import arrayRemoveDuplicates from "../Core/arrayRemoveDuplicates.js";
|
|
26
28
|
|
|
27
29
|
const update3DMatrix3Scratch1 = new Matrix3();
|
|
28
30
|
const update3DMatrix3Scratch2 = new Matrix3();
|
|
@@ -210,6 +212,7 @@ const subSampleIntervalPropertyScratch = new TimeInterval();
|
|
|
210
212
|
function EntityData(entity) {
|
|
211
213
|
this.entity = entity;
|
|
212
214
|
this.polyline = undefined;
|
|
215
|
+
this.segmentPolylines = [];
|
|
213
216
|
this.index = undefined;
|
|
214
217
|
this.updater = undefined;
|
|
215
218
|
}
|
|
@@ -734,6 +737,111 @@ function subSample(
|
|
|
734
737
|
const toFixedScratch = new Matrix3();
|
|
735
738
|
const updateOrientationScratch = new Quaternion();
|
|
736
739
|
const updateRotationScratch = new Matrix3();
|
|
740
|
+
const portionsVisibleIntervalScratch = new TimeInterval();
|
|
741
|
+
const portionsSegmentIntervalScratch = new TimeInterval();
|
|
742
|
+
const portionsDynamicIntervalScratch = new TimeInterval();
|
|
743
|
+
|
|
744
|
+
function getDynamicMaterialProperties(materialData) {
|
|
745
|
+
const dynamic = [];
|
|
746
|
+
if (!defined(materialData)) {
|
|
747
|
+
return dynamic;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
for (const key in materialData) {
|
|
751
|
+
// Material properties store uniforms as underscored backing fields.
|
|
752
|
+
// Ignore event and subscription bookkeeping fields.
|
|
753
|
+
if (
|
|
754
|
+
key[0] !== "_" ||
|
|
755
|
+
key === "_definitionChanged" ||
|
|
756
|
+
key.endsWith("Subscription")
|
|
757
|
+
) {
|
|
758
|
+
continue;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
const prop = materialData[key];
|
|
762
|
+
if (
|
|
763
|
+
defined(prop) &&
|
|
764
|
+
typeof prop.getValue === "function" &&
|
|
765
|
+
!Property.isConstant(prop)
|
|
766
|
+
) {
|
|
767
|
+
dynamic.push(prop);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
return dynamic;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
function emitSegmentsForSplitTimes(
|
|
775
|
+
splitTimes,
|
|
776
|
+
positionProperty,
|
|
777
|
+
time,
|
|
778
|
+
pathGraphics,
|
|
779
|
+
entity,
|
|
780
|
+
item,
|
|
781
|
+
polylineCollection,
|
|
782
|
+
resolution,
|
|
783
|
+
referenceFrame,
|
|
784
|
+
materialProp,
|
|
785
|
+
startingSegIndex,
|
|
786
|
+
) {
|
|
787
|
+
// Sort and dedupe
|
|
788
|
+
splitTimes.sort(JulianDate.compare);
|
|
789
|
+
splitTimes = arrayRemoveDuplicates(splitTimes, JulianDate.equalsEpsilon);
|
|
790
|
+
|
|
791
|
+
let segIndex = startingSegIndex;
|
|
792
|
+
for (let j = 0; j < splitTimes.length - 1; j++) {
|
|
793
|
+
const splitStart = splitTimes[j];
|
|
794
|
+
const splitStop = splitTimes[j + 1];
|
|
795
|
+
if (!JulianDate.lessThan(splitStart, splitStop)) {
|
|
796
|
+
continue;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
// Get segment midpoint
|
|
800
|
+
const splitMidTime = JulianDate.addSeconds(
|
|
801
|
+
splitStart,
|
|
802
|
+
JulianDate.secondsDifference(splitStop, splitStart) / 2,
|
|
803
|
+
new JulianDate(),
|
|
804
|
+
);
|
|
805
|
+
|
|
806
|
+
// Subsample positions
|
|
807
|
+
const subPositions = subSample(
|
|
808
|
+
positionProperty,
|
|
809
|
+
splitStart,
|
|
810
|
+
splitStop,
|
|
811
|
+
time,
|
|
812
|
+
referenceFrame,
|
|
813
|
+
resolution,
|
|
814
|
+
[],
|
|
815
|
+
);
|
|
816
|
+
if (subPositions.length < 2) {
|
|
817
|
+
continue;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
// Get or create a polyline for this segment
|
|
821
|
+
let segPolyline = item.segmentPolylines[segIndex];
|
|
822
|
+
if (!defined(segPolyline)) {
|
|
823
|
+
segPolyline = polylineCollection.add();
|
|
824
|
+
segPolyline.id = entity;
|
|
825
|
+
item.segmentPolylines[segIndex] = segPolyline;
|
|
826
|
+
}
|
|
827
|
+
segPolyline.show = true;
|
|
828
|
+
segPolyline.positions = subPositions;
|
|
829
|
+
segPolyline.material = MaterialProperty.getValue(
|
|
830
|
+
splitMidTime,
|
|
831
|
+
materialProp,
|
|
832
|
+
segPolyline.material,
|
|
833
|
+
);
|
|
834
|
+
segPolyline.width = Property.getValueOrDefault(
|
|
835
|
+
pathGraphics._width,
|
|
836
|
+
time,
|
|
837
|
+
defaultWidth,
|
|
838
|
+
);
|
|
839
|
+
|
|
840
|
+
segIndex++;
|
|
841
|
+
}
|
|
842
|
+
return segIndex;
|
|
843
|
+
}
|
|
844
|
+
|
|
737
845
|
function PolylineUpdater(scene, referenceFrame) {
|
|
738
846
|
this._unusedIndexes = [];
|
|
739
847
|
this._polylineCollection = new PolylineCollection();
|
|
@@ -845,6 +953,9 @@ PolylineUpdater.prototype.updateObject = function (time, item) {
|
|
|
845
953
|
polyline.show = false;
|
|
846
954
|
item.index = undefined;
|
|
847
955
|
}
|
|
956
|
+
for (let j = 0; j < item.segmentPolylines.length; j++) {
|
|
957
|
+
item.segmentPolylines[j].show = false;
|
|
958
|
+
}
|
|
848
959
|
return;
|
|
849
960
|
}
|
|
850
961
|
|
|
@@ -883,16 +994,198 @@ PolylineUpdater.prototype.updateObject = function (time, item) {
|
|
|
883
994
|
// This can happen if the position is sampled at a time when it is only defined at a single point
|
|
884
995
|
if (positions.length < 2) {
|
|
885
996
|
polyline.show = false;
|
|
997
|
+
for (let j = 0; j < item.segmentPolylines.length; j++) {
|
|
998
|
+
item.segmentPolylines[j].show = false;
|
|
999
|
+
}
|
|
886
1000
|
return;
|
|
887
1001
|
}
|
|
888
1002
|
|
|
889
1003
|
polyline.show = true;
|
|
890
1004
|
polyline.positions = positions;
|
|
1005
|
+
|
|
891
1006
|
polyline.material = MaterialProperty.getValue(
|
|
892
1007
|
time,
|
|
893
|
-
pathGraphics.
|
|
1008
|
+
pathGraphics.material,
|
|
894
1009
|
polyline.material,
|
|
895
1010
|
);
|
|
1011
|
+
|
|
1012
|
+
const materialMode = Property.getValueOrUndefined(
|
|
1013
|
+
pathGraphics.materialMode,
|
|
1014
|
+
time,
|
|
1015
|
+
);
|
|
1016
|
+
const materialProp = pathGraphics.material;
|
|
1017
|
+
if (materialMode === PathMode.PORTIONS && !materialProp.isConstant) {
|
|
1018
|
+
// Hide the single polyline if it exists
|
|
1019
|
+
if (defined(polyline)) {
|
|
1020
|
+
polyline.show = false;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
// Prevent non-positive split steps from creating non-terminating loops.
|
|
1024
|
+
// Positive fractional resolutions are valid; only values <= 0 fall back to the default.
|
|
1025
|
+
const splitResolution = resolution > 0 ? resolution : defaultResolution;
|
|
1026
|
+
|
|
1027
|
+
const intervals = materialProp.intervals;
|
|
1028
|
+
let nextSegIndex = 0;
|
|
1029
|
+
|
|
1030
|
+
if (!defined(intervals)) {
|
|
1031
|
+
// Sampled/interpolated root material - generate synthetic times at resolution intervals
|
|
1032
|
+
const splitTimes = [
|
|
1033
|
+
JulianDate.clone(sampleStart),
|
|
1034
|
+
JulianDate.clone(sampleStop),
|
|
1035
|
+
];
|
|
1036
|
+
let splitTime = JulianDate.addSeconds(
|
|
1037
|
+
sampleStart,
|
|
1038
|
+
splitResolution,
|
|
1039
|
+
new JulianDate(),
|
|
1040
|
+
);
|
|
1041
|
+
while (JulianDate.lessThan(splitTime, sampleStop)) {
|
|
1042
|
+
splitTimes.push(JulianDate.clone(splitTime));
|
|
1043
|
+
splitTime = JulianDate.addSeconds(
|
|
1044
|
+
splitTime,
|
|
1045
|
+
splitResolution,
|
|
1046
|
+
new JulianDate(),
|
|
1047
|
+
);
|
|
1048
|
+
}
|
|
1049
|
+
nextSegIndex = emitSegmentsForSplitTimes(
|
|
1050
|
+
splitTimes,
|
|
1051
|
+
positionProperty,
|
|
1052
|
+
time,
|
|
1053
|
+
pathGraphics,
|
|
1054
|
+
entity,
|
|
1055
|
+
item,
|
|
1056
|
+
this._polylineCollection,
|
|
1057
|
+
splitResolution,
|
|
1058
|
+
this._referenceFrame,
|
|
1059
|
+
pathGraphics.material,
|
|
1060
|
+
nextSegIndex,
|
|
1061
|
+
);
|
|
1062
|
+
} else {
|
|
1063
|
+
portionsVisibleIntervalScratch.start = sampleStart;
|
|
1064
|
+
portionsVisibleIntervalScratch.stop = sampleStop;
|
|
1065
|
+
portionsVisibleIntervalScratch.isStartIncluded = true;
|
|
1066
|
+
portionsVisibleIntervalScratch.isStopIncluded = true;
|
|
1067
|
+
|
|
1068
|
+
// Interval-based material - process each interval separately
|
|
1069
|
+
for (let i = 0; i < intervals.length; i++) {
|
|
1070
|
+
const interval = intervals.get(i);
|
|
1071
|
+
|
|
1072
|
+
if (
|
|
1073
|
+
!TimeInterval.intersect(
|
|
1074
|
+
interval,
|
|
1075
|
+
portionsVisibleIntervalScratch,
|
|
1076
|
+
portionsSegmentIntervalScratch,
|
|
1077
|
+
)
|
|
1078
|
+
) {
|
|
1079
|
+
continue;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
const segStart = portionsSegmentIntervalScratch.start;
|
|
1083
|
+
const segStop = portionsSegmentIntervalScratch.stop;
|
|
1084
|
+
|
|
1085
|
+
if (JulianDate.greaterThanOrEquals(segStart, segStop)) {
|
|
1086
|
+
continue;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
// Detect dynamic properties and collect their split times
|
|
1090
|
+
const dynamic = getDynamicMaterialProperties(interval.data);
|
|
1091
|
+
const splitTimes = [
|
|
1092
|
+
JulianDate.clone(segStart),
|
|
1093
|
+
JulianDate.clone(segStop),
|
|
1094
|
+
];
|
|
1095
|
+
|
|
1096
|
+
for (let j = 0; j < dynamic.length; j++) {
|
|
1097
|
+
const prop = dynamic[j];
|
|
1098
|
+
const timeDynamicIntervals = prop.intervals;
|
|
1099
|
+
|
|
1100
|
+
if (defined(timeDynamicIntervals)) {
|
|
1101
|
+
// Interval-based property: collect interval boundaries
|
|
1102
|
+
for (let k = 0; k < timeDynamicIntervals.length; k++) {
|
|
1103
|
+
const timeDynamicInterval = timeDynamicIntervals.get(k);
|
|
1104
|
+
|
|
1105
|
+
if (
|
|
1106
|
+
!TimeInterval.intersect(
|
|
1107
|
+
timeDynamicInterval,
|
|
1108
|
+
portionsSegmentIntervalScratch,
|
|
1109
|
+
portionsDynamicIntervalScratch,
|
|
1110
|
+
)
|
|
1111
|
+
) {
|
|
1112
|
+
continue;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
if (
|
|
1116
|
+
JulianDate.greaterThan(
|
|
1117
|
+
portionsDynamicIntervalScratch.start,
|
|
1118
|
+
segStart,
|
|
1119
|
+
) &&
|
|
1120
|
+
JulianDate.lessThan(
|
|
1121
|
+
portionsDynamicIntervalScratch.start,
|
|
1122
|
+
segStop,
|
|
1123
|
+
)
|
|
1124
|
+
) {
|
|
1125
|
+
splitTimes.push(
|
|
1126
|
+
JulianDate.clone(portionsDynamicIntervalScratch.start),
|
|
1127
|
+
);
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
if (
|
|
1131
|
+
JulianDate.greaterThan(
|
|
1132
|
+
portionsDynamicIntervalScratch.stop,
|
|
1133
|
+
segStart,
|
|
1134
|
+
) &&
|
|
1135
|
+
JulianDate.lessThan(
|
|
1136
|
+
portionsDynamicIntervalScratch.stop,
|
|
1137
|
+
segStop,
|
|
1138
|
+
)
|
|
1139
|
+
) {
|
|
1140
|
+
splitTimes.push(
|
|
1141
|
+
JulianDate.clone(portionsDynamicIntervalScratch.stop),
|
|
1142
|
+
);
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
} else if (!Property.isConstant(prop)) {
|
|
1146
|
+
// Sampled/interpolated property: add resolution-based split times
|
|
1147
|
+
let sampledTime = JulianDate.clone(segStart);
|
|
1148
|
+
while (JulianDate.lessThan(sampledTime, segStop)) {
|
|
1149
|
+
splitTimes.push(JulianDate.clone(sampledTime));
|
|
1150
|
+
sampledTime = JulianDate.addSeconds(
|
|
1151
|
+
sampledTime,
|
|
1152
|
+
splitResolution,
|
|
1153
|
+
new JulianDate(),
|
|
1154
|
+
);
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
// Emit segments for this interval's split times
|
|
1160
|
+
nextSegIndex = emitSegmentsForSplitTimes(
|
|
1161
|
+
splitTimes,
|
|
1162
|
+
positionProperty,
|
|
1163
|
+
time,
|
|
1164
|
+
pathGraphics,
|
|
1165
|
+
entity,
|
|
1166
|
+
item,
|
|
1167
|
+
this._polylineCollection,
|
|
1168
|
+
splitResolution,
|
|
1169
|
+
this._referenceFrame,
|
|
1170
|
+
interval.data,
|
|
1171
|
+
nextSegIndex,
|
|
1172
|
+
);
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
// Hide any excess segment polylines from previous frames.
|
|
1177
|
+
for (let j = nextSegIndex; j < item.segmentPolylines.length; j++) {
|
|
1178
|
+
if (defined(item.segmentPolylines[j])) {
|
|
1179
|
+
item.segmentPolylines[j].show = false;
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
} else {
|
|
1183
|
+
// Not in PORTIONS mode, hide all segment polylines from previous frames
|
|
1184
|
+
for (let j = 0; j < item.segmentPolylines.length; j++) {
|
|
1185
|
+
item.segmentPolylines[j].show = false;
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
|
|
896
1189
|
polyline.width = Property.getValueOrDefault(
|
|
897
1190
|
pathGraphics._width,
|
|
898
1191
|
time,
|
|
@@ -914,6 +1207,10 @@ PolylineUpdater.prototype.removeObject = function (item) {
|
|
|
914
1207
|
polyline.id = undefined;
|
|
915
1208
|
item.index = undefined;
|
|
916
1209
|
}
|
|
1210
|
+
for (let i = 0; i < item.segmentPolylines.length; i++) {
|
|
1211
|
+
item.segmentPolylines[i].show = false;
|
|
1212
|
+
}
|
|
1213
|
+
item.segmentPolylines.length = 0;
|
|
917
1214
|
};
|
|
918
1215
|
|
|
919
1216
|
PolylineUpdater.prototype.destroy = function () {
|
package/Source/Renderer/Pass.js
CHANGED
|
@@ -576,7 +576,7 @@ function loadNull(texture) {
|
|
|
576
576
|
/**
|
|
577
577
|
* This function is identical to using the Texture constructor except that it can be
|
|
578
578
|
* replaced with a mock/spy in tests.
|
|
579
|
-
* @
|
|
579
|
+
* @ignore
|
|
580
580
|
*/
|
|
581
581
|
Texture.create = function (options) {
|
|
582
582
|
return new Texture(options);
|
|
@@ -16,6 +16,7 @@ import assert from "../Core/assert.js";
|
|
|
16
16
|
|
|
17
17
|
/** @import {TypedArray, TypedArrayConstructor} from "../Core/globalTypes.js"; */
|
|
18
18
|
|
|
19
|
+
/** @ignore */
|
|
19
20
|
function addAttribute(attributes, attribute, index, context) {
|
|
20
21
|
const hasVertexBuffer = defined(attribute.vertexBuffer);
|
|
21
22
|
const hasValue = defined(attribute.value);
|