@cesium/engine 14.0.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-EWDGNOJE.js → chunk-25TOENEE.js} +7 -7
- package/Build/Workers/{chunk-OMXHEJTK.js → chunk-2AVIUB5H.js} +2 -2
- package/Build/Workers/{chunk-LJBJM6VI.js → chunk-3JZGPJMZ.js} +6 -6
- package/Build/Workers/{chunk-DT5NFR5C.js → chunk-3LHBH4TC.js} +7 -7
- package/Build/Workers/{chunk-3QLSKXKF.js → chunk-3LZF23RY.js} +6 -6
- package/Build/Workers/{chunk-ED6GLQTK.js → chunk-5S2B46UQ.js} +1 -1
- package/Build/Workers/{chunk-B4GSRXE3.js → chunk-67ONR44K.js} +6 -6
- package/Build/Workers/{chunk-LOZ4NKY3.js → chunk-6EDBC234.js} +11 -11
- package/Build/Workers/{chunk-7ZB2RVIQ.js → chunk-6EV4VOET.js} +10 -10
- package/Build/Workers/{chunk-KHWLAQVA.js → chunk-7ITUZTFH.js} +1 -1
- package/Build/Workers/{chunk-JHBPC4LK.js → chunk-ARVZCY6X.js} +7 -7
- package/Build/Workers/{chunk-FFBJDW4A.js → chunk-B2UQN3DH.js} +6 -6
- package/Build/Workers/{chunk-VCNOFQYH.js → chunk-B2Y4ZS6X.js} +9 -9
- package/Build/Workers/{chunk-Q4ZVWJXX.js → chunk-BD2TPFGC.js} +5 -5
- package/Build/Workers/{chunk-K4AH3TDT.js → chunk-CHX2K5AC.js} +10 -10
- package/Build/Workers/{chunk-3LYROPON.js → chunk-CJGVEABL.js} +13 -13
- package/Build/Workers/{chunk-KSYBJA4M.js → chunk-DYJHEP3B.js} +5 -5
- package/Build/Workers/{chunk-CI2HEJFC.js → chunk-E3H7AVMK.js} +13 -13
- package/Build/Workers/{chunk-F4CUH4MR.js → chunk-EZNAJPP5.js} +4 -4
- package/Build/Workers/{chunk-YJX7X577.js → chunk-F7ZI463G.js} +15 -15
- package/Build/Workers/{chunk-HEZHXDYB.js → chunk-FMZ5CX6V.js} +1 -1
- package/Build/Workers/{chunk-G3BVMPWG.js → chunk-FRAWHNSR.js} +2 -2
- package/Build/Workers/{chunk-J7IH4EYI.js → chunk-GGV2XJHE.js} +7 -7
- package/Build/Workers/{chunk-5KWRW7YL.js → chunk-GK4QU6QI.js} +2 -2
- package/Build/Workers/{chunk-77XPS7ZA.js → chunk-HYPB7FAV.js} +10 -10
- package/Build/Workers/{chunk-MVM4JV5U.js → chunk-I4HO2ED2.js} +9 -9
- package/Build/Workers/{chunk-FX4R4MTH.js → chunk-IGINOLDX.js} +6 -6
- package/Build/Workers/{chunk-PWF4EY5P.js → chunk-ISQSYLZY.js} +4 -4
- package/Build/Workers/{chunk-7UHKH6M3.js → chunk-JZAMRL5I.js} +6 -6
- package/Build/Workers/{chunk-HUFQVUMY.js → chunk-K5G2WELR.js} +7 -7
- package/Build/Workers/{chunk-5S5OOA6U.js → chunk-L5SO4Y5V.js} +1 -1
- package/Build/Workers/{chunk-LNSWJ43X.js → chunk-LCMJQVIF.js} +11 -11
- package/Build/Workers/{chunk-WVNLSTOF.js → chunk-MWJW37I7.js} +2 -2
- package/Build/Workers/{chunk-ZGFIT57T.js → chunk-NAGMYRDW.js} +27 -20
- package/Build/Workers/{chunk-SDIDRZDG.js → chunk-OYO6TKMU.js} +7 -7
- package/Build/Workers/{chunk-HKHQ3EDR.js → chunk-PUTA3AE2.js} +4 -4
- package/Build/Workers/{chunk-JPDKYBLF.js → chunk-Q5BHMNKU.js} +13 -13
- package/Build/Workers/{chunk-XK4OP6VA.js → chunk-QTEX3Y4V.js} +17 -17
- package/Build/Workers/{chunk-TVL3F7IU.js → chunk-QZKN2RXM.js} +1 -1
- package/Build/Workers/{chunk-Z3QWTHI7.js → chunk-RO2Z3LCR.js} +14 -14
- package/Build/Workers/{chunk-N2XAJBC6.js → chunk-RRN6LRDX.js} +12 -12
- package/Build/Workers/{chunk-FYGLNDKG.js → chunk-SLIA3GQP.js} +7 -7
- package/Build/Workers/{chunk-7EO56M5R.js → chunk-TFCOEX3W.js} +2 -2
- package/Build/Workers/{chunk-KM6MITPF.js → chunk-TU6ZXHVU.js} +5 -5
- package/Build/Workers/{chunk-LS3KVHYY.js → chunk-VJ2PDF64.js} +6 -6
- package/Build/Workers/{chunk-D7ZBZPHV.js → chunk-VMVPONIV.js} +5 -5
- package/Build/Workers/{chunk-3PIZQT3I.js → chunk-WPXU45PH.js} +4 -4
- package/Build/Workers/{chunk-WEHZP4SE.js → chunk-XDHM4G3P.js} +7 -7
- package/Build/Workers/{chunk-TY4DKOWR.js → chunk-XED3RXKO.js} +2 -2
- package/Build/Workers/{chunk-ZMNLEL6W.js → chunk-YNYCGTQH.js} +5 -5
- package/Build/Workers/{chunk-4CHMVQTQ.js → chunk-Z4SI54EB.js} +4 -4
- package/Build/Workers/{chunk-3JBEPBPL.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 +11 -11
- 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/EllipsoidRhumbLine.js +1 -1
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/PolygonGeometryLibrary.js +26 -4
- package/Source/Core/TexturePacker.js +166 -0
- package/Source/DataSources/BillboardVisualizer.js +3 -3
- package/Source/DataSources/EntityCluster.js +44 -19
- 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 +86 -141
- 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/Cesium3DTilesVoxelProvider.js +380 -126
- package/Source/Scene/Cesium3DTilesetStatistics.js +0 -1
- package/Source/Scene/Expression.js +1 -0
- package/Source/Scene/GltfLoader.js +5 -7
- package/Source/Scene/ImplicitSubtree.js +2 -0
- package/Source/Scene/KeyframeNode.js +16 -2
- package/Source/Scene/LabelCollection.js +212 -182
- 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/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 +122 -54
- package/Source/Scene/VoxelProvider.js +34 -29
- package/Source/Scene/VoxelRenderResources.js +30 -7
- package/Source/Scene/VoxelShape.js +10 -3
- package/Source/Scene/VoxelTraversal.js +264 -180
- package/Source/Scene/processVoxelProperties.js +3 -0
- package/Source/Shaders/GlobeFS.glsl +10 -1
- package/Source/Shaders/GlobeFS.js +10 -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/index.d.ts +176 -79
- package/index.js +413 -409
- package/package.json +2 -2
- package/Source/Scene/TextureAtlas.js +0 -558
|
@@ -26,6 +26,7 @@ function VoxelCylinderShape() {
|
|
|
26
26
|
/**
|
|
27
27
|
* An oriented bounding box containing the bounded shape.
|
|
28
28
|
* The update function must be called before accessing this value.
|
|
29
|
+
* @private
|
|
29
30
|
* @type {OrientedBoundingBox}
|
|
30
31
|
* @readonly
|
|
31
32
|
*/
|
|
@@ -34,6 +35,7 @@ function VoxelCylinderShape() {
|
|
|
34
35
|
/**
|
|
35
36
|
* A bounding sphere containing the bounded shape.
|
|
36
37
|
* The update function must be called before accessing this value.
|
|
38
|
+
* @private
|
|
37
39
|
* @type {BoundingSphere}
|
|
38
40
|
* @readonly
|
|
39
41
|
*/
|
|
@@ -42,6 +44,7 @@ function VoxelCylinderShape() {
|
|
|
42
44
|
/**
|
|
43
45
|
* A transformation matrix containing the bounded shape.
|
|
44
46
|
* The update function must be called before accessing this value.
|
|
47
|
+
* @private
|
|
45
48
|
* @type {Matrix4}
|
|
46
49
|
* @readonly
|
|
47
50
|
*/
|
|
@@ -50,6 +53,7 @@ function VoxelCylinderShape() {
|
|
|
50
53
|
/**
|
|
51
54
|
* A transformation matrix containing the shape, ignoring the bounds.
|
|
52
55
|
* The update function must be called before accessing this value.
|
|
56
|
+
* @private
|
|
53
57
|
* @type {Matrix4}
|
|
54
58
|
* @readonly
|
|
55
59
|
*/
|
|
@@ -71,42 +75,44 @@ function VoxelCylinderShape() {
|
|
|
71
75
|
* @type {number}
|
|
72
76
|
* @private
|
|
73
77
|
*/
|
|
74
|
-
this.
|
|
78
|
+
this._minimumAngle = VoxelCylinderShape.DefaultMinBounds.y;
|
|
75
79
|
|
|
76
80
|
/**
|
|
77
81
|
* @type {number}
|
|
78
82
|
* @private
|
|
79
83
|
*/
|
|
80
|
-
this.
|
|
84
|
+
this._maximumAngle = VoxelCylinderShape.DefaultMaxBounds.y;
|
|
81
85
|
|
|
82
86
|
/**
|
|
83
87
|
* @type {number}
|
|
84
88
|
* @private
|
|
85
89
|
*/
|
|
86
|
-
this.
|
|
90
|
+
this._minimumHeight = VoxelCylinderShape.DefaultMinBounds.z;
|
|
87
91
|
|
|
88
92
|
/**
|
|
89
93
|
* @type {number}
|
|
90
94
|
* @private
|
|
91
95
|
*/
|
|
92
|
-
this.
|
|
96
|
+
this._maximumHeight = VoxelCylinderShape.DefaultMaxBounds.z;
|
|
93
97
|
|
|
94
98
|
/**
|
|
99
|
+
* @private
|
|
95
100
|
* @type {Object<string, any>}
|
|
96
101
|
* @readonly
|
|
97
102
|
*/
|
|
98
103
|
this.shaderUniforms = {
|
|
99
|
-
cylinderRenderHeightMinMax: new Cartesian2(),
|
|
100
104
|
cylinderRenderRadiusMinMax: new Cartesian2(),
|
|
101
105
|
cylinderRenderAngleMinMax: new Cartesian2(),
|
|
106
|
+
cylinderRenderHeightMinMax: new Cartesian2(),
|
|
102
107
|
cylinderUvToShapeUvRadius: new Cartesian2(),
|
|
103
|
-
cylinderUvToShapeUvHeight: new Cartesian2(),
|
|
104
108
|
cylinderUvToShapeUvAngle: new Cartesian2(),
|
|
109
|
+
cylinderUvToShapeUvHeight: new Cartesian2(),
|
|
105
110
|
cylinderShapeUvAngleMinMax: new Cartesian2(),
|
|
106
111
|
cylinderShapeUvAngleRangeZeroMid: 0.0,
|
|
107
112
|
};
|
|
108
113
|
|
|
109
114
|
/**
|
|
115
|
+
* @private
|
|
110
116
|
* @type {Object<string, any>}
|
|
111
117
|
* @readonly
|
|
112
118
|
*/
|
|
@@ -132,6 +138,7 @@ function VoxelCylinderShape() {
|
|
|
132
138
|
|
|
133
139
|
/**
|
|
134
140
|
* The maximum number of intersections against the shape for any ray direction.
|
|
141
|
+
* @private
|
|
135
142
|
* @type {number}
|
|
136
143
|
* @readonly
|
|
137
144
|
*/
|
|
@@ -142,7 +149,7 @@ const scratchScale = new Cartesian3();
|
|
|
142
149
|
|
|
143
150
|
/**
|
|
144
151
|
* Update the shape's state.
|
|
145
|
-
*
|
|
152
|
+
* @private
|
|
146
153
|
* @param {Matrix4} modelMatrix The model matrix.
|
|
147
154
|
* @param {Cartesian3} minBounds The minimum bounds.
|
|
148
155
|
* @param {Cartesian3} maxBounds The maximum bounds.
|
|
@@ -173,10 +180,10 @@ VoxelCylinderShape.prototype.update = function (
|
|
|
173
180
|
|
|
174
181
|
const defaultMinRadius = VoxelCylinderShape.DefaultMinBounds.x;
|
|
175
182
|
const defaultMaxRadius = VoxelCylinderShape.DefaultMaxBounds.x;
|
|
176
|
-
const
|
|
177
|
-
const
|
|
178
|
-
const
|
|
179
|
-
const
|
|
183
|
+
const defaultMinAngle = VoxelCylinderShape.DefaultMinBounds.y;
|
|
184
|
+
const defaultMaxAngle = VoxelCylinderShape.DefaultMaxBounds.y;
|
|
185
|
+
const defaultMinHeight = VoxelCylinderShape.DefaultMinBounds.z;
|
|
186
|
+
const defaultMaxHeight = VoxelCylinderShape.DefaultMaxBounds.z;
|
|
180
187
|
const defaultAngleRange = defaultMaxAngle - defaultMinAngle;
|
|
181
188
|
const defaultAngleRangeHalf = 0.5 * defaultAngleRange;
|
|
182
189
|
|
|
@@ -208,38 +215,38 @@ VoxelCylinderShape.prototype.update = function (
|
|
|
208
215
|
const renderMinRadius = Math.max(shapeMinRadius, clipMinRadius);
|
|
209
216
|
const renderMaxRadius = Math.min(shapeMaxRadius, clipMaxRadius);
|
|
210
217
|
|
|
218
|
+
// Clamp the angles to the valid range
|
|
219
|
+
const shapeMinAngle = CesiumMath.negativePiToPi(minBounds.y);
|
|
220
|
+
const shapeMaxAngle = CesiumMath.negativePiToPi(maxBounds.y);
|
|
221
|
+
const clipMinAngle = CesiumMath.negativePiToPi(clipMinBounds.y);
|
|
222
|
+
const clipMaxAngle = CesiumMath.negativePiToPi(clipMaxBounds.y);
|
|
223
|
+
const renderMinAngle = Math.max(shapeMinAngle, clipMinAngle);
|
|
224
|
+
const renderMaxAngle = Math.min(shapeMaxAngle, clipMaxAngle);
|
|
225
|
+
|
|
211
226
|
// Clamp the heights to the valid range
|
|
212
227
|
const shapeMinHeight = CesiumMath.clamp(
|
|
213
|
-
minBounds.
|
|
228
|
+
minBounds.z,
|
|
214
229
|
defaultMinHeight,
|
|
215
230
|
defaultMaxHeight,
|
|
216
231
|
);
|
|
217
232
|
const shapeMaxHeight = CesiumMath.clamp(
|
|
218
|
-
maxBounds.
|
|
233
|
+
maxBounds.z,
|
|
219
234
|
defaultMinHeight,
|
|
220
235
|
defaultMaxHeight,
|
|
221
236
|
);
|
|
222
237
|
const clipMinHeight = CesiumMath.clamp(
|
|
223
|
-
clipMinBounds.
|
|
238
|
+
clipMinBounds.z,
|
|
224
239
|
defaultMinHeight,
|
|
225
240
|
defaultMaxHeight,
|
|
226
241
|
);
|
|
227
242
|
const clipMaxHeight = CesiumMath.clamp(
|
|
228
|
-
clipMaxBounds.
|
|
243
|
+
clipMaxBounds.z,
|
|
229
244
|
defaultMinHeight,
|
|
230
245
|
defaultMaxHeight,
|
|
231
246
|
);
|
|
232
247
|
const renderMinHeight = Math.max(shapeMinHeight, clipMinHeight);
|
|
233
248
|
const renderMaxHeight = Math.min(shapeMaxHeight, clipMaxHeight);
|
|
234
249
|
|
|
235
|
-
// Clamp the angles to the valid range
|
|
236
|
-
const shapeMinAngle = CesiumMath.negativePiToPi(minBounds.z);
|
|
237
|
-
const shapeMaxAngle = CesiumMath.negativePiToPi(maxBounds.z);
|
|
238
|
-
const clipMinAngle = CesiumMath.negativePiToPi(clipMinBounds.z);
|
|
239
|
-
const clipMaxAngle = CesiumMath.negativePiToPi(clipMaxBounds.z);
|
|
240
|
-
const renderMinAngle = Math.max(shapeMinAngle, clipMinAngle);
|
|
241
|
-
const renderMaxAngle = Math.min(shapeMaxAngle, clipMaxAngle);
|
|
242
|
-
|
|
243
250
|
const scale = Matrix4.getScale(modelMatrix, scratchScale);
|
|
244
251
|
|
|
245
252
|
// Exit early if the shape is not visible.
|
|
@@ -263,20 +270,20 @@ VoxelCylinderShape.prototype.update = function (
|
|
|
263
270
|
|
|
264
271
|
this._minimumRadius = shapeMinRadius; // [0,1]
|
|
265
272
|
this._maximumRadius = shapeMaxRadius; // [0,1]
|
|
266
|
-
this._minimumHeight = shapeMinHeight; // [-1,+1]
|
|
267
|
-
this._maximumHeight = shapeMaxHeight; // [-1,+1]
|
|
268
273
|
this._minimumAngle = shapeMinAngle; // [-pi,+pi]
|
|
269
274
|
this._maximumAngle = shapeMaxAngle; // [-pi,+pi]
|
|
275
|
+
this._minimumHeight = shapeMinHeight; // [-1,+1]
|
|
276
|
+
this._maximumHeight = shapeMaxHeight; // [-1,+1]
|
|
270
277
|
|
|
271
278
|
this.shapeTransform = Matrix4.clone(modelMatrix, this.shapeTransform);
|
|
272
279
|
|
|
273
280
|
this.orientedBoundingBox = getCylinderChunkObb(
|
|
274
281
|
renderMinRadius,
|
|
275
282
|
renderMaxRadius,
|
|
276
|
-
renderMinHeight,
|
|
277
|
-
renderMaxHeight,
|
|
278
283
|
renderMinAngle,
|
|
279
284
|
renderMaxAngle,
|
|
285
|
+
renderMinHeight,
|
|
286
|
+
renderMaxHeight,
|
|
280
287
|
this.shapeTransform,
|
|
281
288
|
this.orientedBoundingBox,
|
|
282
289
|
);
|
|
@@ -296,8 +303,6 @@ VoxelCylinderShape.prototype.update = function (
|
|
|
296
303
|
const shapeIsDefaultMinRadius = shapeMinRadius === defaultMinRadius;
|
|
297
304
|
const shapeIsDefaultRadius =
|
|
298
305
|
shapeIsDefaultMinRadius && shapeIsDefaultMaxRadius;
|
|
299
|
-
const shapeIsDefaultHeight =
|
|
300
|
-
shapeMinHeight === defaultMinHeight && shapeMaxHeight === defaultMaxHeight;
|
|
301
306
|
const shapeIsAngleReversed = shapeMaxAngle < shapeMinAngle;
|
|
302
307
|
const shapeAngleRange =
|
|
303
308
|
shapeMaxAngle - shapeMinAngle + shapeIsAngleReversed * defaultAngleRange;
|
|
@@ -323,6 +328,8 @@ VoxelCylinderShape.prototype.update = function (
|
|
|
323
328
|
undefined,
|
|
324
329
|
epsilonAngleDiscontinuity,
|
|
325
330
|
);
|
|
331
|
+
const shapeIsDefaultHeight =
|
|
332
|
+
shapeMinHeight === defaultMinHeight && shapeMaxHeight === defaultMaxHeight;
|
|
326
333
|
|
|
327
334
|
const renderIsDefaultMinRadius = renderMinRadius === defaultMinRadius;
|
|
328
335
|
const renderIsAngleReversed = renderMaxAngle < renderMinAngle;
|
|
@@ -504,7 +511,7 @@ VoxelCylinderShape.prototype.update = function (
|
|
|
504
511
|
/**
|
|
505
512
|
* Computes an oriented bounding box for a specified tile.
|
|
506
513
|
* The update function must be called before calling this function.
|
|
507
|
-
*
|
|
514
|
+
* @private
|
|
508
515
|
* @param {number} tileLevel The tile's level.
|
|
509
516
|
* @param {number} tileX The tile's x coordinate.
|
|
510
517
|
* @param {number} tileY The tile's y coordinate.
|
|
@@ -529,10 +536,10 @@ VoxelCylinderShape.prototype.computeOrientedBoundingBoxForTile = function (
|
|
|
529
536
|
|
|
530
537
|
const minimumRadius = this._minimumRadius;
|
|
531
538
|
const maximumRadius = this._maximumRadius;
|
|
532
|
-
const minimumHeight = this._minimumHeight;
|
|
533
|
-
const maximumHeight = this._maximumHeight;
|
|
534
539
|
const minimumAngle = this._minimumAngle;
|
|
535
540
|
const maximumAngle = this._maximumAngle;
|
|
541
|
+
const minimumHeight = this._minimumHeight;
|
|
542
|
+
const maximumHeight = this._maximumHeight;
|
|
536
543
|
|
|
537
544
|
const sizeAtLevel = 1.0 / Math.pow(2.0, tileLevel);
|
|
538
545
|
|
|
@@ -546,34 +553,34 @@ VoxelCylinderShape.prototype.computeOrientedBoundingBoxForTile = function (
|
|
|
546
553
|
maximumRadius,
|
|
547
554
|
(tileX + 1) * sizeAtLevel,
|
|
548
555
|
);
|
|
549
|
-
const heightStart = CesiumMath.lerp(
|
|
550
|
-
minimumHeight,
|
|
551
|
-
maximumHeight,
|
|
552
|
-
tileY * sizeAtLevel,
|
|
553
|
-
);
|
|
554
|
-
const heightEnd = CesiumMath.lerp(
|
|
555
|
-
minimumHeight,
|
|
556
|
-
maximumHeight,
|
|
557
|
-
(tileY + 1) * sizeAtLevel,
|
|
558
|
-
);
|
|
559
556
|
const angleStart = CesiumMath.lerp(
|
|
560
557
|
minimumAngle,
|
|
561
558
|
maximumAngle,
|
|
562
|
-
|
|
559
|
+
tileY * sizeAtLevel,
|
|
563
560
|
);
|
|
564
561
|
const angleEnd = CesiumMath.lerp(
|
|
565
562
|
minimumAngle,
|
|
566
563
|
maximumAngle,
|
|
564
|
+
(tileY + 1) * sizeAtLevel,
|
|
565
|
+
);
|
|
566
|
+
const heightStart = CesiumMath.lerp(
|
|
567
|
+
minimumHeight,
|
|
568
|
+
maximumHeight,
|
|
569
|
+
tileZ * sizeAtLevel,
|
|
570
|
+
);
|
|
571
|
+
const heightEnd = CesiumMath.lerp(
|
|
572
|
+
minimumHeight,
|
|
573
|
+
maximumHeight,
|
|
567
574
|
(tileZ + 1) * sizeAtLevel,
|
|
568
575
|
);
|
|
569
576
|
|
|
570
577
|
return getCylinderChunkObb(
|
|
571
578
|
radiusStart,
|
|
572
579
|
radiusEnd,
|
|
573
|
-
heightStart,
|
|
574
|
-
heightEnd,
|
|
575
580
|
angleStart,
|
|
576
581
|
angleEnd,
|
|
582
|
+
heightStart,
|
|
583
|
+
heightEnd,
|
|
577
584
|
this.shapeTransform,
|
|
578
585
|
result,
|
|
579
586
|
);
|
|
@@ -586,7 +593,7 @@ const scratchTileMaxBounds = new Cartesian3();
|
|
|
586
593
|
/**
|
|
587
594
|
* Computes an oriented bounding box for a specified sample within a specified tile.
|
|
588
595
|
* The update function must be called before calling this function.
|
|
589
|
-
*
|
|
596
|
+
* @private
|
|
590
597
|
* @param {SpatialNode} spatialNode The spatial node containing the sample
|
|
591
598
|
* @param {Cartesian3} tileDimensions The size of the tile in number of samples, before padding
|
|
592
599
|
* @param {Cartesian3} tileUv The sample coordinate within the tile
|
|
@@ -651,10 +658,10 @@ VoxelCylinderShape.prototype.computeOrientedBoundingBoxForSample = function (
|
|
|
651
658
|
return getCylinderChunkObb(
|
|
652
659
|
radiusStart,
|
|
653
660
|
radiusEnd,
|
|
654
|
-
heightStart,
|
|
655
|
-
heightEnd,
|
|
656
661
|
angleStart,
|
|
657
662
|
angleEnd,
|
|
663
|
+
heightStart,
|
|
664
|
+
heightEnd,
|
|
658
665
|
this.shapeTransform,
|
|
659
666
|
result,
|
|
660
667
|
);
|
|
@@ -670,7 +677,7 @@ VoxelCylinderShape.prototype.computeOrientedBoundingBoxForSample = function (
|
|
|
670
677
|
* @private
|
|
671
678
|
*/
|
|
672
679
|
VoxelCylinderShape.DefaultMinBounds = Object.freeze(
|
|
673
|
-
new Cartesian3(0.0, -
|
|
680
|
+
new Cartesian3(0.0, -CesiumMath.PI, -1.0),
|
|
674
681
|
);
|
|
675
682
|
|
|
676
683
|
/**
|
|
@@ -683,7 +690,7 @@ VoxelCylinderShape.DefaultMinBounds = Object.freeze(
|
|
|
683
690
|
* @private
|
|
684
691
|
*/
|
|
685
692
|
VoxelCylinderShape.DefaultMaxBounds = Object.freeze(
|
|
686
|
-
new Cartesian3(1.0, +
|
|
693
|
+
new Cartesian3(1.0, +CesiumMath.PI, +1.0),
|
|
687
694
|
);
|
|
688
695
|
|
|
689
696
|
const maxTestAngles = 5;
|
|
@@ -744,10 +751,10 @@ function computeLooseOrientedBoundingBox(matrix, result) {
|
|
|
744
751
|
*
|
|
745
752
|
* @param {number} radiusStart The radiusStart.
|
|
746
753
|
* @param {number} radiusEnd The radiusEnd.
|
|
747
|
-
* @param {number} heightStart The heightStart.
|
|
748
|
-
* @param {number} heightEnd The heightEnd.
|
|
749
754
|
* @param {number} angleStart The angleStart.
|
|
750
755
|
* @param {number} angleEnd The angleEnd.
|
|
756
|
+
* @param {number} heightStart The heightStart.
|
|
757
|
+
* @param {number} heightEnd The heightEnd.
|
|
751
758
|
* @param {Matrix4} matrix The matrix to transform the points.
|
|
752
759
|
* @param {OrientedBoundingBox} result The object onto which to store the result.
|
|
753
760
|
* @returns {OrientedBoundingBox} The oriented bounding box that contains this subregion.
|
|
@@ -757,10 +764,10 @@ function computeLooseOrientedBoundingBox(matrix, result) {
|
|
|
757
764
|
function getCylinderChunkObb(
|
|
758
765
|
radiusStart,
|
|
759
766
|
radiusEnd,
|
|
760
|
-
heightStart,
|
|
761
|
-
heightEnd,
|
|
762
767
|
angleStart,
|
|
763
768
|
angleEnd,
|
|
769
|
+
heightStart,
|
|
770
|
+
heightEnd,
|
|
764
771
|
matrix,
|
|
765
772
|
result,
|
|
766
773
|
) {
|
|
@@ -768,10 +775,10 @@ function getCylinderChunkObb(
|
|
|
768
775
|
const defaultMaxBounds = VoxelCylinderShape.DefaultMaxBounds;
|
|
769
776
|
const defaultMinRadius = defaultMinBounds.x; // 0
|
|
770
777
|
const defaultMaxRadius = defaultMaxBounds.x; // 1
|
|
771
|
-
const
|
|
772
|
-
const
|
|
773
|
-
const
|
|
774
|
-
const
|
|
778
|
+
const defaultMinAngle = defaultMinBounds.y; // -pi
|
|
779
|
+
const defaultMaxAngle = defaultMaxBounds.y; // +pi
|
|
780
|
+
const defaultMinHeight = defaultMinBounds.z; // -1
|
|
781
|
+
const defaultMaxHeight = defaultMaxBounds.z; // +1
|
|
775
782
|
|
|
776
783
|
// Return early if using the default bounds
|
|
777
784
|
if (
|
|
@@ -29,6 +29,7 @@ function VoxelEllipsoidShape() {
|
|
|
29
29
|
* The update function must be called before accessing this value.
|
|
30
30
|
* @type {OrientedBoundingBox}
|
|
31
31
|
* @readonly
|
|
32
|
+
* @private
|
|
32
33
|
*/
|
|
33
34
|
this.orientedBoundingBox = new OrientedBoundingBox();
|
|
34
35
|
|
|
@@ -37,6 +38,7 @@ function VoxelEllipsoidShape() {
|
|
|
37
38
|
* The update function must be called before accessing this value.
|
|
38
39
|
* @type {BoundingSphere}
|
|
39
40
|
* @readonly
|
|
41
|
+
* @private
|
|
40
42
|
*/
|
|
41
43
|
this.boundingSphere = new BoundingSphere();
|
|
42
44
|
|
|
@@ -45,6 +47,7 @@ function VoxelEllipsoidShape() {
|
|
|
45
47
|
* The update function must be called before accessing this value.
|
|
46
48
|
* @type {Matrix4}
|
|
47
49
|
* @readonly
|
|
50
|
+
* @private
|
|
48
51
|
*/
|
|
49
52
|
this.boundTransform = new Matrix4();
|
|
50
53
|
|
|
@@ -53,11 +56,13 @@ function VoxelEllipsoidShape() {
|
|
|
53
56
|
* The update function must be called before accessing this value.
|
|
54
57
|
* @type {Matrix4}
|
|
55
58
|
* @readonly
|
|
59
|
+
* @private
|
|
56
60
|
*/
|
|
57
61
|
this.shapeTransform = new Matrix4();
|
|
58
62
|
|
|
59
63
|
/**
|
|
60
64
|
* @type {Rectangle}
|
|
65
|
+
* @private
|
|
61
66
|
*/
|
|
62
67
|
this._rectangle = new Rectangle();
|
|
63
68
|
|
|
@@ -81,17 +86,20 @@ function VoxelEllipsoidShape() {
|
|
|
81
86
|
|
|
82
87
|
/**
|
|
83
88
|
* @type {Cartesian3}
|
|
89
|
+
* @private
|
|
84
90
|
*/
|
|
85
91
|
this._translation = new Cartesian3();
|
|
86
92
|
|
|
87
93
|
/**
|
|
88
94
|
* @type {Matrix3}
|
|
95
|
+
* @private
|
|
89
96
|
*/
|
|
90
97
|
this._rotation = new Matrix3();
|
|
91
98
|
|
|
92
99
|
/**
|
|
93
100
|
* @type {Object<string, any>}
|
|
94
101
|
* @readonly
|
|
102
|
+
* @private
|
|
95
103
|
*/
|
|
96
104
|
this.shaderUniforms = {
|
|
97
105
|
ellipsoidRadiiUv: new Cartesian3(),
|
|
@@ -110,6 +118,7 @@ function VoxelEllipsoidShape() {
|
|
|
110
118
|
/**
|
|
111
119
|
* @type {Object<string, any>}
|
|
112
120
|
* @readonly
|
|
121
|
+
* @private
|
|
113
122
|
*/
|
|
114
123
|
this.shaderDefines = {
|
|
115
124
|
ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE: undefined,
|
|
@@ -138,6 +147,7 @@ function VoxelEllipsoidShape() {
|
|
|
138
147
|
* The maximum number of intersections against the shape for any ray direction.
|
|
139
148
|
* @type {number}
|
|
140
149
|
* @readonly
|
|
150
|
+
* @private
|
|
141
151
|
*/
|
|
142
152
|
this.shaderMaximumIntersectionsLength = 0; // not known until update
|
|
143
153
|
}
|
|
@@ -157,7 +167,7 @@ const scratchRenderRectangle = new Rectangle();
|
|
|
157
167
|
|
|
158
168
|
/**
|
|
159
169
|
* Update the shape's state.
|
|
160
|
-
*
|
|
170
|
+
* @private
|
|
161
171
|
* @param {Matrix4} modelMatrix The model matrix.
|
|
162
172
|
* @param {Cartesian3} minBounds The minimum bounds.
|
|
163
173
|
* @param {Cartesian3} maxBounds The maximum bounds.
|
|
@@ -660,7 +670,7 @@ const scratchRectangle = new Rectangle();
|
|
|
660
670
|
/**
|
|
661
671
|
* Computes an oriented bounding box for a specified tile.
|
|
662
672
|
* The update function must be called before calling this function.
|
|
663
|
-
*
|
|
673
|
+
* @private
|
|
664
674
|
* @param {number} tileLevel The tile's level.
|
|
665
675
|
* @param {number} tileX The tile's x coordinate.
|
|
666
676
|
* @param {number} tileY The tile's y coordinate.
|
|
@@ -730,7 +740,7 @@ const scratchTileMaxBounds = new Cartesian3();
|
|
|
730
740
|
/**
|
|
731
741
|
* Computes an oriented bounding box for a specified sample within a specified tile.
|
|
732
742
|
* The update function must be called before calling this function.
|
|
733
|
-
*
|
|
743
|
+
* @private
|
|
734
744
|
* @param {SpatialNode} spatialNode The spatial node containing the sample
|
|
735
745
|
* @param {Cartesian3} tileDimensions The size of the tile in number of samples, before padding
|
|
736
746
|
* @param {Cartesian3} tileUv The sample coordinate within the tile
|
|
@@ -851,7 +861,7 @@ function getEllipsoidChunkObb(
|
|
|
851
861
|
|
|
852
862
|
/**
|
|
853
863
|
* Defines the minimum bounds of the shape. Corresponds to minimum longitude, latitude, height.
|
|
854
|
-
*
|
|
864
|
+
* @private
|
|
855
865
|
* @type {Cartesian3}
|
|
856
866
|
* @constant
|
|
857
867
|
* @readonly
|
|
@@ -866,7 +876,7 @@ VoxelEllipsoidShape.DefaultMinBounds = Object.freeze(
|
|
|
866
876
|
|
|
867
877
|
/**
|
|
868
878
|
* Defines the maximum bounds of the shape. Corresponds to maximum longitude, latitude, height.
|
|
869
|
-
*
|
|
879
|
+
* @private
|
|
870
880
|
* @type {Cartesian3}
|
|
871
881
|
* @constant
|
|
872
882
|
* @readonly
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metadata ordering for voxel content.
|
|
3
|
+
* In all cases, x data is contiguous in strides along the y axis,
|
|
4
|
+
* and each group of y strides represents a z slice.
|
|
5
|
+
* However, the orientation of the axes follows different conventions.
|
|
6
|
+
* @enum {number}
|
|
7
|
+
*/
|
|
8
|
+
const VoxelMetadataOrder = {
|
|
9
|
+
XYZ: 0, // Default ordering following the 3D Tiles convention. Z-axis points upward.
|
|
10
|
+
GLTF: 1, // Ordering following the glTF convention. Y-axis points upward.
|
|
11
|
+
};
|
|
12
|
+
export default Object.freeze(VoxelMetadataOrder);
|