@cesium/engine 13.1.0 → 15.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-APCS5YJI.js → chunk-25TOENEE.js} +7 -7
- package/Build/Workers/{chunk-FNCXBBCF.js → chunk-2AVIUB5H.js} +2 -2
- package/Build/Workers/{chunk-OZTFRHA2.js → chunk-3JZGPJMZ.js} +6 -6
- package/Build/Workers/{chunk-5JY4LYO3.js → chunk-3LHBH4TC.js} +7 -7
- package/Build/Workers/{chunk-MGABCOOH.js → chunk-3LZF23RY.js} +6 -6
- package/Build/Workers/{chunk-AXYZUG4N.js → chunk-5S2B46UQ.js} +1 -1
- package/Build/Workers/{chunk-2SRHVCFD.js → chunk-67ONR44K.js} +6 -6
- package/Build/Workers/{chunk-PBJQFLKS.js → chunk-6EDBC234.js} +11 -11
- package/Build/Workers/{chunk-GSLKQJM2.js → chunk-6EV4VOET.js} +10 -10
- package/Build/Workers/{chunk-OGRXNUR2.js → chunk-7ITUZTFH.js} +1 -1
- package/Build/Workers/{chunk-IP7F2MVW.js → chunk-ARVZCY6X.js} +7 -7
- package/Build/Workers/{chunk-EYZFEJX3.js → chunk-B2UQN3DH.js} +6 -6
- package/Build/Workers/{chunk-WE4KF4AM.js → chunk-B2Y4ZS6X.js} +9 -9
- package/Build/Workers/{chunk-DWIKWWEE.js → chunk-BD2TPFGC.js} +5 -5
- package/Build/Workers/{chunk-5ICYLS6B.js → chunk-CHX2K5AC.js} +10 -10
- package/Build/Workers/{chunk-NQDKNE7V.js → chunk-CJGVEABL.js} +13 -13
- package/Build/Workers/{chunk-B34JXFHF.js → chunk-DYJHEP3B.js} +5 -5
- package/Build/Workers/{chunk-J7BMSSY7.js → chunk-E3H7AVMK.js} +13 -13
- package/Build/Workers/{chunk-TOHDFUJM.js → chunk-EZNAJPP5.js} +4 -4
- package/Build/Workers/{chunk-K62EHZFT.js → chunk-F7ZI463G.js} +15 -15
- package/Build/Workers/{chunk-EJ5DT5BP.js → chunk-FMZ5CX6V.js} +1 -1
- package/Build/Workers/{chunk-OARMSJUU.js → chunk-FRAWHNSR.js} +2 -2
- package/Build/Workers/{chunk-S3UM4OKP.js → chunk-GGV2XJHE.js} +7 -7
- package/Build/Workers/{chunk-SAKQO5NX.js → chunk-GK4QU6QI.js} +2 -2
- package/Build/Workers/{chunk-LFUFGHL3.js → chunk-HYPB7FAV.js} +10 -10
- package/Build/Workers/{chunk-3SCCWLZS.js → chunk-I4HO2ED2.js} +9 -9
- package/Build/Workers/{chunk-K6SQV4IS.js → chunk-IGINOLDX.js} +6 -6
- package/Build/Workers/{chunk-IXNXKVOB.js → chunk-ISQSYLZY.js} +4 -4
- package/Build/Workers/{chunk-PM76TX2X.js → chunk-JZAMRL5I.js} +6 -6
- package/Build/Workers/{chunk-CBE4HRBH.js → chunk-K5G2WELR.js} +7 -7
- package/Build/Workers/{chunk-EHGQQA7C.js → chunk-L5SO4Y5V.js} +1 -1
- package/Build/Workers/{chunk-M2AA2ARJ.js → chunk-LCMJQVIF.js} +11 -11
- package/Build/Workers/{chunk-HI73PIPQ.js → chunk-MWJW37I7.js} +2 -2
- package/Build/Workers/{chunk-WAJNX74N.js → chunk-NAGMYRDW.js} +27 -20
- package/Build/Workers/{chunk-WUIDEXAN.js → chunk-OYO6TKMU.js} +7 -7
- package/Build/Workers/{chunk-YVGU235V.js → chunk-PUTA3AE2.js} +4 -4
- package/Build/Workers/{chunk-ZWSWJYJP.js → chunk-Q5BHMNKU.js} +13 -13
- package/Build/Workers/{chunk-LQT2ZK7D.js → chunk-QTEX3Y4V.js} +17 -17
- package/Build/Workers/{chunk-UBAHTE4Q.js → chunk-QZKN2RXM.js} +1 -1
- package/Build/Workers/{chunk-T34EOLFR.js → chunk-RO2Z3LCR.js} +14 -14
- package/Build/Workers/{chunk-PTFIVVLX.js → chunk-RRN6LRDX.js} +12 -12
- package/Build/Workers/{chunk-B6IJY6AN.js → chunk-SLIA3GQP.js} +7 -7
- package/Build/Workers/{chunk-GIOZHX7U.js → chunk-TFCOEX3W.js} +2 -2
- package/Build/Workers/{chunk-KRVALCCI.js → chunk-TU6ZXHVU.js} +5 -5
- package/Build/Workers/{chunk-54I6VSRP.js → chunk-VJ2PDF64.js} +6 -6
- package/Build/Workers/{chunk-BMFWWTD7.js → chunk-VMVPONIV.js} +5 -5
- package/Build/Workers/{chunk-CNPP6TQ2.js → chunk-WPXU45PH.js} +4 -4
- package/Build/Workers/{chunk-2ONAV62A.js → chunk-XDHM4G3P.js} +7 -7
- package/Build/Workers/{chunk-KO232FLP.js → chunk-XED3RXKO.js} +2 -2
- package/Build/Workers/{chunk-5I3LPAS7.js → chunk-YNYCGTQH.js} +5 -5
- package/Build/Workers/{chunk-THDHWSEJ.js → chunk-Z4SI54EB.js} +4 -4
- package/Build/Workers/{chunk-R2KGFZBA.js → chunk-ZVDLC3T4.js} +13 -13
- package/Build/Workers/combineGeometry.js +22 -22
- package/Build/Workers/createBoxGeometry.js +16 -16
- package/Build/Workers/createBoxOutlineGeometry.js +14 -14
- package/Build/Workers/createCircleGeometry.js +24 -24
- package/Build/Workers/createCircleOutlineGeometry.js +17 -17
- package/Build/Workers/createCoplanarPolygonGeometry.js +31 -31
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +29 -29
- package/Build/Workers/createCorridorGeometry.js +27 -27
- package/Build/Workers/createCorridorOutlineGeometry.js +26 -26
- package/Build/Workers/createCylinderGeometry.js +18 -18
- package/Build/Workers/createCylinderOutlineGeometry.js +16 -16
- package/Build/Workers/createEllipseGeometry.js +24 -24
- package/Build/Workers/createEllipseOutlineGeometry.js +17 -17
- package/Build/Workers/createEllipsoidGeometry.js +17 -17
- package/Build/Workers/createEllipsoidOutlineGeometry.js +16 -16
- package/Build/Workers/createFrustumGeometry.js +16 -16
- package/Build/Workers/createFrustumOutlineGeometry.js +16 -16
- package/Build/Workers/createGeometry.js +22 -22
- package/Build/Workers/createGroundPolylineGeometry.js +20 -20
- package/Build/Workers/createPlaneGeometry.js +14 -14
- package/Build/Workers/createPlaneOutlineGeometry.js +13 -13
- package/Build/Workers/createPolygonGeometry.js +30 -30
- package/Build/Workers/createPolygonOutlineGeometry.js +28 -28
- package/Build/Workers/createPolylineGeometry.js +23 -23
- package/Build/Workers/createPolylineVolumeGeometry.js +29 -29
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +25 -25
- package/Build/Workers/createRectangleGeometry.js +25 -25
- package/Build/Workers/createRectangleOutlineGeometry.js +18 -18
- package/Build/Workers/createSimplePolylineGeometry.js +21 -21
- package/Build/Workers/createSphereGeometry.js +17 -17
- package/Build/Workers/createSphereOutlineGeometry.js +16 -16
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +13 -13
- package/Build/Workers/createVectorTileGeometries.js +22 -22
- package/Build/Workers/createVectorTilePoints.js +12 -12
- package/Build/Workers/createVectorTilePolygons.js +20 -20
- package/Build/Workers/createVectorTilePolylines.js +13 -13
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +20 -20
- package/Build/Workers/createVerticesFromHeightmap.js +20 -20
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +17 -17
- package/Build/Workers/createWallGeometry.js +22 -22
- package/Build/Workers/createWallOutlineGeometry.js +21 -21
- package/Build/Workers/decodeDraco.js +15 -14
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/transcodeKTX2.js +50 -43
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +20 -20
- package/Source/Core/Color.js +3 -3
- package/Source/Core/Credit.js +3 -3
- package/Source/Core/DistanceDisplayCondition.js +3 -3
- package/Source/Core/EllipsoidRhumbLine.js +1 -1
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/OrientedBoundingBox.js +2 -2
- package/Source/Core/PolygonGeometryLibrary.js +26 -4
- package/Source/Core/Spherical.js +3 -3
- package/Source/Core/TexturePacker.js +166 -0
- package/Source/Core/writeTextToCanvas.js +0 -1
- package/Source/DataSources/BillboardVisualizer.js +3 -3
- package/Source/DataSources/BoundingSphereState.js +3 -3
- package/Source/DataSources/DataSourceClock.js +1 -1
- package/Source/DataSources/DataSourceDisplay.js +5 -2
- package/Source/DataSources/EntityCluster.js +44 -19
- package/Source/Renderer/AutomaticUniforms.js +2 -2
- package/Source/Renderer/Context.js +0 -4
- package/Source/Renderer/Texture.js +6 -5
- package/Source/Renderer/TextureAtlas.js +802 -0
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +87 -142
- package/Source/Scene/BillboardCollection.js +132 -202
- package/Source/Scene/BillboardLoadState.js +44 -0
- package/Source/Scene/BillboardTexture.js +348 -0
- package/Source/Scene/Camera.js +2 -2
- package/Source/Scene/Cesium3DTile.js +56 -28
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +403 -132
- package/Source/Scene/Cesium3DTilesetStatistics.js +0 -1
- package/Source/Scene/ClippingPolygon.js +2 -2
- package/Source/Scene/Expression.js +1 -0
- package/Source/Scene/GltfDracoLoader.js +45 -0
- package/Source/Scene/GltfIndexBufferLoader.js +5 -0
- package/Source/Scene/GltfLoader.js +22 -9
- package/Source/Scene/GltfVertexBufferLoader.js +13 -0
- package/Source/Scene/ITwinData.js +47 -1
- package/Source/Scene/ImageryLayer.js +1 -1
- package/Source/Scene/ImplicitSubtree.js +2 -0
- package/Source/Scene/KeyframeNode.js +16 -2
- package/Source/Scene/Label.js +1 -1
- package/Source/Scene/LabelCollection.js +212 -193
- package/Source/Scene/Megatexture.js +145 -81
- package/Source/Scene/Model/CustomShader.js +0 -2
- package/Source/Scene/Model/Model.js +1 -1
- package/Source/Scene/Model/ModelUtility.js +5 -1
- package/Source/Scene/Multiple3DTileContent.js +21 -8
- package/Source/Scene/PointPrimitive.js +1 -1
- package/Source/Scene/ResourceCache.js +17 -1
- package/Source/Scene/Scene.js +39 -15
- package/Source/Scene/ScreenSpaceCameraController.js +0 -8
- package/Source/Scene/SpatialNode.js +4 -11
- package/Source/Scene/Vector3DTilePoints.js +2 -5
- package/Source/Scene/VoxelBoxShape.js +12 -5
- package/Source/Scene/VoxelCell.js +6 -5
- package/Source/Scene/VoxelContent.js +171 -107
- package/Source/Scene/VoxelCylinderShape.js +65 -58
- package/Source/Scene/VoxelEllipsoidShape.js +15 -5
- package/Source/Scene/VoxelMetadataOrder.js +12 -0
- package/Source/Scene/VoxelPrimitive.js +245 -53
- package/Source/Scene/VoxelProvider.js +44 -29
- package/Source/Scene/VoxelRenderResources.js +30 -7
- package/Source/Scene/VoxelShape.js +10 -3
- package/Source/Scene/VoxelTraversal.js +326 -166
- package/Source/Scene/WebMapTileServiceImageryProvider.js +2 -2
- package/Source/Scene/createGooglePhotorealistic3DTileset.js +5 -8
- package/Source/Scene/processVoxelProperties.js +3 -0
- package/Source/Shaders/GlobeFS.glsl +10 -1
- package/Source/Shaders/GlobeFS.js +10 -1
- package/Source/Shaders/PolylineCommon.glsl +1 -1
- package/Source/Shaders/PolylineCommon.js +1 -1
- package/Source/Shaders/Voxels/Megatexture.glsl +4 -16
- package/Source/Shaders/Voxels/Megatexture.js +4 -16
- package/Source/Shaders/Voxels/Octree.glsl +44 -7
- package/Source/Shaders/Voxels/Octree.js +44 -7
- package/Source/Shaders/Voxels/VoxelFS.glsl +9 -15
- package/Source/Shaders/Voxels/VoxelFS.js +9 -15
- package/Source/Shaders/Voxels/convertUvToCylinder.glsl +15 -15
- package/Source/Shaders/Voxels/convertUvToCylinder.js +15 -15
- package/Source/Widget/CesiumWidget.js +16 -10
- package/Source/Workers/decodeDraco.js +4 -4
- package/index.d.ts +321 -110
- package/index.js +209 -205
- package/package.json +2 -2
- package/Source/Scene/TextureAtlas.js +0 -558
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import BoundingRectangle from "./BoundingRectangle.js";
|
|
2
|
+
import Check from "./Check.js";
|
|
3
|
+
import defined from "./defined.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {object} TexturePacker.PackableObject
|
|
7
|
+
* Any object, such as an <code>Image</code> with the following properties:
|
|
8
|
+
* @private
|
|
9
|
+
* @property {number} width The width of the image, or other object, usually in pixels
|
|
10
|
+
* @property {number} height The height of the image, or other object, usually in pixels
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A texture atlas is recursively broken down into regions of space called nodes.
|
|
15
|
+
* Nodes contain either an image reference or child nodes.
|
|
16
|
+
* @private
|
|
17
|
+
* @constructor
|
|
18
|
+
* @param {object} options An options object with the following properties:
|
|
19
|
+
* @param {number} options.x The x-offset of the texture node
|
|
20
|
+
* @param {number} options.y The y-offset of the texture node
|
|
21
|
+
* @param {number} options.width The width of the texture node
|
|
22
|
+
* @param {number} options.height The width of the texture node
|
|
23
|
+
*/
|
|
24
|
+
function TextureNode({ x, y, width, height }) {
|
|
25
|
+
/**
|
|
26
|
+
* @type {BoundingRectangle}
|
|
27
|
+
*/
|
|
28
|
+
this.rectangle = new BoundingRectangle(x, y, width, height);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @type {TextureNode|undefined}
|
|
32
|
+
*/
|
|
33
|
+
this.childNode1 = undefined;
|
|
34
|
+
/**
|
|
35
|
+
* @type {TextureNode|undefined}
|
|
36
|
+
*/
|
|
37
|
+
this.childNode2 = undefined;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Identifier referencing an image or packed data
|
|
41
|
+
* @type {number|undefined}
|
|
42
|
+
*/
|
|
43
|
+
this.index = undefined;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Typically used with {@link TextureAtlas} to calculate efficient regions of the larger areas to store images or other data. Typically, all units are specified in pixels.
|
|
48
|
+
* @alias TexturePacker
|
|
49
|
+
* @constructor
|
|
50
|
+
* @private
|
|
51
|
+
* @param {options} options Object with the following properties:
|
|
52
|
+
* @param {number} options.width Width of the atlas, in pixels
|
|
53
|
+
* @param {number} options.height Height of atlas, in pixels
|
|
54
|
+
* @param {number} options.borderPadding Amount of border padding, in pixels
|
|
55
|
+
*/
|
|
56
|
+
function TexturePacker({ width, height, borderPadding }) {
|
|
57
|
+
this._width = width;
|
|
58
|
+
this._height = height;
|
|
59
|
+
|
|
60
|
+
this._borderPadding = borderPadding;
|
|
61
|
+
|
|
62
|
+
this._root = new TextureNode({
|
|
63
|
+
x: borderPadding,
|
|
64
|
+
y: borderPadding,
|
|
65
|
+
width: width - 2 * borderPadding,
|
|
66
|
+
height: height - 2 * borderPadding,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Inserts the given object into the next available region based on it's dimensions. Where convenient, it's most efficient to pack items largest to smallest.
|
|
72
|
+
* @private
|
|
73
|
+
* @param {number} index An identifier referencing the image or other stored data
|
|
74
|
+
* @param {TexturePacker.PackableObject} packableObject An object, such as an <code>Image</code>, with <code>width</code> and <code>height</code> properties in pixels.
|
|
75
|
+
* @returns {TextureNode|undefined} The created region, or <code>undefined</code> if there is no region large enough to accommodate the object's dimensions.
|
|
76
|
+
*/
|
|
77
|
+
TexturePacker.prototype.pack = function (index, { width, height }) {
|
|
78
|
+
//>>includeStart('debug', pragmas.debug);
|
|
79
|
+
Check.typeOf.number.greaterThanOrEquals("index", index, 0);
|
|
80
|
+
Check.typeOf.number.greaterThanOrEquals("image.width", width, 1);
|
|
81
|
+
Check.typeOf.number.greaterThanOrEquals("image.height", height, 1);
|
|
82
|
+
//>>includeEnd('debug');
|
|
83
|
+
|
|
84
|
+
const node = this._findNode(this._root, { width, height });
|
|
85
|
+
if (!defined(node)) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
node.index = index;
|
|
90
|
+
return node;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
// A recursive function that finds the best place to insert
|
|
94
|
+
// a new image based on existing image 'nodes'.
|
|
95
|
+
// Inspired by: http://blackpawn.com/texts/lightmaps/default.html
|
|
96
|
+
TexturePacker.prototype._findNode = function (node, { width, height }) {
|
|
97
|
+
if (!defined(node)) {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Leaf node
|
|
102
|
+
if (!defined(node.childNode1) && !defined(node.childNode2)) {
|
|
103
|
+
if (defined(node.index)) {
|
|
104
|
+
// Node already contains an image: Skip it.
|
|
105
|
+
return undefined;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const { rectangle } = node;
|
|
109
|
+
|
|
110
|
+
const nodeWidth = rectangle.width;
|
|
111
|
+
const nodeHeight = rectangle.height;
|
|
112
|
+
const widthDifference = nodeWidth - width;
|
|
113
|
+
const heightDifference = nodeHeight - height;
|
|
114
|
+
|
|
115
|
+
// Node is smaller than the image.
|
|
116
|
+
if (widthDifference < 0 || heightDifference < 0) {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// If the node is the same size as the image, return the node
|
|
121
|
+
if (widthDifference === 0 && heightDifference === 0) {
|
|
122
|
+
return node;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Vertical split (childNode1 = left half, childNode2 = right half).
|
|
126
|
+
if (widthDifference > heightDifference) {
|
|
127
|
+
node.childNode1 = new TextureNode({
|
|
128
|
+
x: rectangle.x,
|
|
129
|
+
y: rectangle.y,
|
|
130
|
+
width,
|
|
131
|
+
height: nodeHeight,
|
|
132
|
+
});
|
|
133
|
+
node.childNode2 = new TextureNode({
|
|
134
|
+
x: rectangle.x + width,
|
|
135
|
+
y: rectangle.y,
|
|
136
|
+
width: widthDifference,
|
|
137
|
+
height: nodeHeight,
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
return this._findNode(node.childNode1, { width, height });
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Horizontal split (childNode1 = bottom half, childNode2 = top half).
|
|
144
|
+
node.childNode1 = new TextureNode({
|
|
145
|
+
x: rectangle.x,
|
|
146
|
+
y: rectangle.y,
|
|
147
|
+
width: nodeWidth,
|
|
148
|
+
height,
|
|
149
|
+
});
|
|
150
|
+
node.childNode2 = new TextureNode({
|
|
151
|
+
x: rectangle.x,
|
|
152
|
+
y: rectangle.y + height,
|
|
153
|
+
width: nodeWidth,
|
|
154
|
+
height: heightDifference,
|
|
155
|
+
});
|
|
156
|
+
return this._findNode(node.childNode1, { width, height });
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// If not a leaf node
|
|
160
|
+
return (
|
|
161
|
+
this._findNode(node.childNode1, { width, height }) ||
|
|
162
|
+
this._findNode(node.childNode2, { width, height })
|
|
163
|
+
);
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export default TexturePacker;
|
|
@@ -104,7 +104,6 @@ let imageSmoothingEnabledName;
|
|
|
104
104
|
* @param {string} text The text to write.
|
|
105
105
|
* @param {object} [options] Object with the following properties:
|
|
106
106
|
* @param {string} [options.font='10px sans-serif'] The CSS font to use.
|
|
107
|
-
* @param {string} [options.textBaseline='bottom'] The baseline of the text.
|
|
108
107
|
* @param {boolean} [options.fill=true] Whether to fill the text.
|
|
109
108
|
* @param {boolean} [options.stroke=false] Whether to stroke the text.
|
|
110
109
|
* @param {Color} [options.fillColor=Color.WHITE] The fill color.
|
|
@@ -126,12 +126,12 @@ BillboardVisualizer.prototype.update = function (time) {
|
|
|
126
126
|
if (!defined(billboard)) {
|
|
127
127
|
billboard = cluster.getBillboard(entity);
|
|
128
128
|
billboard.id = entity;
|
|
129
|
-
billboard.image = undefined;
|
|
130
129
|
item.billboard = billboard;
|
|
130
|
+
item.textureValue = undefined;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
billboard.show = show;
|
|
134
|
-
if (
|
|
134
|
+
if (item.textureValue !== textureValue) {
|
|
135
135
|
billboard.image = textureValue;
|
|
136
136
|
item.textureValue = textureValue;
|
|
137
137
|
}
|
|
@@ -233,7 +233,7 @@ BillboardVisualizer.prototype.update = function (time) {
|
|
|
233
233
|
boundingRectangleScratch,
|
|
234
234
|
);
|
|
235
235
|
if (defined(subRegion)) {
|
|
236
|
-
billboard.setImageSubRegion(billboard.
|
|
236
|
+
billboard.setImageSubRegion(billboard.image, subRegion);
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
return true;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @enum {number}
|
|
4
4
|
* @private
|
|
5
5
|
*/
|
|
6
|
-
const BoundingSphereState = {
|
|
6
|
+
const BoundingSphereState = Object.freeze({
|
|
7
7
|
/**
|
|
8
8
|
* The BoundingSphere has been computed.
|
|
9
9
|
* @type BoundingSphereState
|
|
@@ -22,5 +22,5 @@ const BoundingSphereState = {
|
|
|
22
22
|
* @constant
|
|
23
23
|
*/
|
|
24
24
|
FAILED: 2,
|
|
25
|
-
};
|
|
26
|
-
export default
|
|
25
|
+
});
|
|
26
|
+
export default BoundingSphereState;
|
|
@@ -108,7 +108,7 @@ DataSourceClock.prototype.clone = function (result) {
|
|
|
108
108
|
/**
|
|
109
109
|
* Returns true if this DataSourceClock is equivalent to the other
|
|
110
110
|
*
|
|
111
|
-
* @param {DataSourceClock} other The other DataSourceClock to compare to.
|
|
111
|
+
* @param {DataSourceClock} [other] The other DataSourceClock to compare to.
|
|
112
112
|
* @returns {boolean} <code>true</code> if the DataSourceClocks are equal; otherwise, <code>false</code>.
|
|
113
113
|
*/
|
|
114
114
|
DataSourceClock.prototype.equals = function (other) {
|
|
@@ -330,7 +330,10 @@ DataSourceDisplay.prototype.update = function (time) {
|
|
|
330
330
|
if (!this._ready && result) {
|
|
331
331
|
this._scene.requestRender();
|
|
332
332
|
}
|
|
333
|
-
|
|
333
|
+
|
|
334
|
+
// once the DataSourceDisplay is ready it should stay ready to prevent
|
|
335
|
+
// entities from breaking updates when they become "un-ready"
|
|
336
|
+
this._ready = this._ready || result;
|
|
334
337
|
|
|
335
338
|
return result;
|
|
336
339
|
};
|
|
@@ -386,7 +389,7 @@ DataSourceDisplay.prototype.getBoundingSphere = function (
|
|
|
386
389
|
Check.defined("result", result);
|
|
387
390
|
//>>includeEnd('debug');
|
|
388
391
|
|
|
389
|
-
if (!this._ready
|
|
392
|
+
if (!this._ready) {
|
|
390
393
|
return BoundingSphereState.PENDING;
|
|
391
394
|
}
|
|
392
395
|
|
|
@@ -610,6 +610,25 @@ Object.defineProperties(EntityCluster.prototype, {
|
|
|
610
610
|
this._clusterPoints = value;
|
|
611
611
|
},
|
|
612
612
|
},
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* Returns true when all clustered data has been rendered.
|
|
616
|
+
* @memberof EntityCluster.prototype
|
|
617
|
+
* @type {boolean}
|
|
618
|
+
* @readonly
|
|
619
|
+
* @private
|
|
620
|
+
*/
|
|
621
|
+
ready: {
|
|
622
|
+
get: function () {
|
|
623
|
+
return (
|
|
624
|
+
!this._enabledDirty &&
|
|
625
|
+
!this._clusterDirty &&
|
|
626
|
+
(!defined(this._billboardCollection) ||
|
|
627
|
+
this._billboardCollection.ready) &&
|
|
628
|
+
(!defined(this._labelCollection) || this._labelCollection.ready)
|
|
629
|
+
);
|
|
630
|
+
},
|
|
631
|
+
},
|
|
613
632
|
});
|
|
614
633
|
|
|
615
634
|
function createGetEntity(
|
|
@@ -866,28 +885,30 @@ EntityCluster.prototype.update = function (frameState) {
|
|
|
866
885
|
// the glyphs haven't been created so the screen space bounding boxes
|
|
867
886
|
// are incorrect.
|
|
868
887
|
let commandList;
|
|
888
|
+
const labelCollection = this._labelCollection;
|
|
869
889
|
if (
|
|
870
|
-
defined(
|
|
871
|
-
|
|
872
|
-
|
|
890
|
+
defined(labelCollection) &&
|
|
891
|
+
labelCollection.length > 0 &&
|
|
892
|
+
!labelCollection.ready
|
|
873
893
|
) {
|
|
874
894
|
commandList = frameState.commandList;
|
|
875
895
|
frameState.commandList = [];
|
|
876
|
-
|
|
896
|
+
labelCollection.update(frameState);
|
|
877
897
|
frameState.commandList = commandList;
|
|
878
898
|
}
|
|
879
899
|
|
|
880
|
-
// If clustering is enabled before the billboard
|
|
900
|
+
// If clustering is enabled before the billboard collections are updated,
|
|
881
901
|
// the images haven't been added to the image atlas so the screen space bounding boxes
|
|
882
902
|
// are incorrect.
|
|
903
|
+
const billboardCollection = this._billboardCollection;
|
|
883
904
|
if (
|
|
884
|
-
defined(
|
|
885
|
-
|
|
886
|
-
!
|
|
905
|
+
defined(billboardCollection) &&
|
|
906
|
+
billboardCollection.length > 0 &&
|
|
907
|
+
!billboardCollection.ready
|
|
887
908
|
) {
|
|
888
909
|
commandList = frameState.commandList;
|
|
889
910
|
frameState.commandList = [];
|
|
890
|
-
|
|
911
|
+
billboardCollection.update(frameState);
|
|
891
912
|
frameState.commandList = commandList;
|
|
892
913
|
}
|
|
893
914
|
|
|
@@ -898,8 +919,12 @@ EntityCluster.prototype.update = function (frameState) {
|
|
|
898
919
|
}
|
|
899
920
|
|
|
900
921
|
if (this._clusterDirty) {
|
|
901
|
-
this._clusterDirty = false;
|
|
902
922
|
this._cluster();
|
|
923
|
+
|
|
924
|
+
// Unless all existing billboards and labels were clustered, clustering will need to execute again next frame
|
|
925
|
+
this._clusterDirty =
|
|
926
|
+
(defined(labelCollection) && !labelCollection.ready) ||
|
|
927
|
+
(defined(billboardCollection) && !billboardCollection.ready);
|
|
903
928
|
}
|
|
904
929
|
|
|
905
930
|
if (defined(this._clusterLabelCollection)) {
|
|
@@ -912,11 +937,11 @@ EntityCluster.prototype.update = function (frameState) {
|
|
|
912
937
|
this._clusterPointCollection.update(frameState);
|
|
913
938
|
}
|
|
914
939
|
|
|
915
|
-
if (defined(
|
|
916
|
-
|
|
940
|
+
if (defined(labelCollection)) {
|
|
941
|
+
labelCollection.update(frameState);
|
|
917
942
|
}
|
|
918
|
-
if (defined(
|
|
919
|
-
|
|
943
|
+
if (defined(billboardCollection)) {
|
|
944
|
+
billboardCollection.update(frameState);
|
|
920
945
|
}
|
|
921
946
|
if (defined(this._pointCollection)) {
|
|
922
947
|
this._pointCollection.update(frameState);
|
|
@@ -932,6 +957,11 @@ EntityCluster.prototype.update = function (frameState) {
|
|
|
932
957
|
* </p>
|
|
933
958
|
*/
|
|
934
959
|
EntityCluster.prototype.destroy = function () {
|
|
960
|
+
if (defined(this._removeEventListener)) {
|
|
961
|
+
this._removeEventListener();
|
|
962
|
+
this._removeEventListener = undefined;
|
|
963
|
+
}
|
|
964
|
+
|
|
935
965
|
this._labelCollection =
|
|
936
966
|
this._labelCollection && this._labelCollection.destroy();
|
|
937
967
|
this._billboardCollection =
|
|
@@ -947,11 +977,6 @@ EntityCluster.prototype.destroy = function () {
|
|
|
947
977
|
this._clusterPointCollection =
|
|
948
978
|
this._clusterPointCollection && this._clusterPointCollection.destroy();
|
|
949
979
|
|
|
950
|
-
if (defined(this._removeEventListener)) {
|
|
951
|
-
this._removeEventListener();
|
|
952
|
-
this._removeEventListener = undefined;
|
|
953
|
-
}
|
|
954
|
-
|
|
955
980
|
this._labelCollection = undefined;
|
|
956
981
|
this._billboardCollection = undefined;
|
|
957
982
|
this._pointCollection = undefined;
|
|
@@ -1488,11 +1488,11 @@ const AutomaticUniforms = {
|
|
|
1488
1488
|
*
|
|
1489
1489
|
* @example
|
|
1490
1490
|
* // GLSL declaration
|
|
1491
|
-
* uniform
|
|
1491
|
+
* uniform samplerCube czm_specularEnvironmentMaps;
|
|
1492
1492
|
*/
|
|
1493
1493
|
czm_specularEnvironmentMaps: new AutomaticUniform({
|
|
1494
1494
|
size: 1,
|
|
1495
|
-
datatype: WebGLConstants.
|
|
1495
|
+
datatype: WebGLConstants.SAMPLER_CUBE,
|
|
1496
1496
|
getValue: function (uniformState) {
|
|
1497
1497
|
return uniformState.specularEnvironmentMaps;
|
|
1498
1498
|
},
|
|
@@ -4,7 +4,6 @@ import ComponentDatatype from "../Core/ComponentDatatype.js";
|
|
|
4
4
|
import createGuid from "../Core/createGuid.js";
|
|
5
5
|
import defaultValue from "../Core/defaultValue.js";
|
|
6
6
|
import defined from "../Core/defined.js";
|
|
7
|
-
import deprecationWarning from "../Core/deprecationWarning.js";
|
|
8
7
|
import destroyObject from "../Core/destroyObject.js";
|
|
9
8
|
import DeveloperError from "../Core/DeveloperError.js";
|
|
10
9
|
import Geometry from "../Core/Geometry.js";
|
|
@@ -1671,7 +1670,4 @@ Context.prototype.destroy = function () {
|
|
|
1671
1670
|
return destroyObject(this);
|
|
1672
1671
|
};
|
|
1673
1672
|
|
|
1674
|
-
// Used for specs.
|
|
1675
|
-
Context._deprecationWarning = deprecationWarning;
|
|
1676
|
-
|
|
1677
1673
|
export default Context;
|
|
@@ -23,7 +23,7 @@ import TextureMinificationFilter from "./TextureMinificationFilter.js";
|
|
|
23
23
|
* @property {PixelDatatype} [pixelDatatype=PixelDatatype.UNSIGNED_BYTE] The data type of each pixel.
|
|
24
24
|
* @property {boolean} [flipY=true] If true, the source values will be read as if the y-axis is inverted (y=0 at the top).
|
|
25
25
|
* @property {boolean} [skipColorSpaceConversion=false] If true, color space conversions will be skipped when reading the texel values.
|
|
26
|
-
* @property {Sampler} [sampler] Information about how to sample the
|
|
26
|
+
* @property {Sampler} [sampler] Information about how to sample the texture.
|
|
27
27
|
* @property {number} [width] The pixel width of the texture. If not supplied, must be available from the source.
|
|
28
28
|
* @property {number} [height] The pixel height of the texture. If not supplied, must be available from the source.
|
|
29
29
|
* @property {boolean} [preMultiplyAlpha] If true, the alpha channel will be multiplied into the other channels.
|
|
@@ -704,7 +704,8 @@ Object.defineProperties(Texture.prototype, {
|
|
|
704
704
|
* coordinates in both directions, uses linear filtering for both magnification and minification,
|
|
705
705
|
* and uses a maximum anisotropy of 1.0.
|
|
706
706
|
* @memberof Texture.prototype
|
|
707
|
-
* @type {
|
|
707
|
+
* @type {Sampler}
|
|
708
|
+
* @private
|
|
708
709
|
*/
|
|
709
710
|
sampler: {
|
|
710
711
|
get: function () {
|
|
@@ -842,7 +843,7 @@ function setupSampler(texture, sampler) {
|
|
|
842
843
|
* @exception {DeveloperError} xOffset + source.width must be less than or equal to width.
|
|
843
844
|
* @exception {DeveloperError} yOffset + source.height must be less than or equal to height.
|
|
844
845
|
* @exception {DeveloperError} This texture was destroyed, i.e., destroy() was called.
|
|
845
|
-
*
|
|
846
|
+
* @private
|
|
846
847
|
* @example
|
|
847
848
|
* texture.copyFrom({
|
|
848
849
|
* source: {
|
|
@@ -965,7 +966,7 @@ Texture.prototype.copyFrom = function (options) {
|
|
|
965
966
|
* @param {number} [framebufferYOffset=0] optional
|
|
966
967
|
* @param {number} [width=width] optional
|
|
967
968
|
* @param {number} [height=height] optional
|
|
968
|
-
*
|
|
969
|
+
* @private
|
|
969
970
|
* @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.
|
|
970
971
|
* @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.
|
|
971
972
|
* @exception {DeveloperError} Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.
|
|
@@ -1060,7 +1061,7 @@ Texture.prototype.copyFromFramebuffer = function (
|
|
|
1060
1061
|
|
|
1061
1062
|
/**
|
|
1062
1063
|
* @param {MipmapHint} [hint=MipmapHint.DONT_CARE] optional.
|
|
1063
|
-
*
|
|
1064
|
+
* @private
|
|
1064
1065
|
* @exception {DeveloperError} Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.
|
|
1065
1066
|
* @exception {DeveloperError} Cannot call generateMipmap when the texture pixel format is a compressed format.
|
|
1066
1067
|
* @exception {DeveloperError} hint is invalid.
|