@cesium/engine 20.0.2-ion.0 → 21.0.1-ion.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/ThirdParty/Workers/zip-web-worker.js +637 -0
- package/Build/Workers/{chunk-AFKNTEMH.js → chunk-26ZRRKTU.js} +16 -16
- package/Build/Workers/{chunk-NKKNQMEH.js → chunk-2PX2ULSM.js} +3 -3
- package/Build/Workers/{chunk-OIMV4OE5.js → chunk-3K4DRV7Y.js} +9 -9
- package/Build/Workers/{chunk-IS5FETN7.js → chunk-3XTJC4CV.js} +5 -5
- package/Build/Workers/{chunk-Z2W7ZIGV.js → chunk-6KX3IUUT.js} +2 -2
- package/Build/Workers/{chunk-BHAATGZA.js → chunk-75UG66GR.js} +5 -5
- package/Build/Workers/{chunk-YXTWHLJA.js → chunk-ADADBRLI.js} +4 -4
- package/Build/Workers/{chunk-CUU3WGXJ.js → chunk-AGT6W3JS.js} +6 -6
- package/Build/Workers/{chunk-QID3DXQA.js → chunk-AQ4A5CMC.js} +7 -7
- package/Build/Workers/{chunk-MTBXKKSQ.js → chunk-B56XVJRS.js} +12 -12
- package/Build/Workers/{chunk-VODCZKV2.js → chunk-DTYIUWZU.js} +4 -4
- package/Build/Workers/{chunk-VSMKMGX4.js → chunk-E6T4LSM6.js} +5 -5
- package/Build/Workers/{chunk-WZKTQZUW.js → chunk-EEDSGIH7.js} +6 -6
- package/Build/Workers/{chunk-FNUSHLOY.js → chunk-EHMAKCWQ.js} +1 -1
- package/Build/Workers/{chunk-CYC7JX3P.js → chunk-ESPNIYL5.js} +8 -8
- package/Build/Workers/{chunk-LS63ERFB.js → chunk-EZJXK2UP.js} +4 -4
- package/Build/Workers/{chunk-Q3OWKSC5.js → chunk-G5RX7BPJ.js} +10 -10
- package/Build/Workers/{chunk-FAQ2XNFV.js → chunk-G74UMFQ4.js} +5 -5
- package/Build/Workers/{chunk-YUHWFX5H.js → chunk-H3G7OYZY.js} +2 -2
- package/Build/Workers/{chunk-6LULWCX3.js → chunk-HDBIC7IL.js} +1 -1
- package/Build/Workers/{chunk-WORBFT5H.js → chunk-JESBYOH5.js} +9 -9
- package/Build/Workers/{chunk-P2V7PVDH.js → chunk-KGL66RWW.js} +8 -8
- package/Build/Workers/{chunk-USK6ZAY2.js → chunk-L73TRTIG.js} +1 -1
- package/Build/Workers/{chunk-VA7LWA5Q.js → chunk-LEFV6H2V.js} +9 -9
- package/Build/Workers/{chunk-23B3EYUM.js → chunk-LK7H6V2E.js} +4 -4
- package/Build/Workers/{chunk-JVG6T2WE.js → chunk-LSNF6CIP.js} +12 -12
- package/Build/Workers/{chunk-ABTG74AR.js → chunk-MBIUW42A.js} +1 -1
- package/Build/Workers/{chunk-VZNF2GT7.js → chunk-MFPT34BC.js} +4 -4
- package/Build/Workers/{chunk-X6GXYB3M.js → chunk-MIFUV36K.js} +1 -1
- package/Build/Workers/{chunk-K6THSIDU.js → chunk-MJWRSKJV.js} +2 -2
- package/Build/Workers/{chunk-FYYP46TF.js → chunk-NWJRIJQG.js} +2 -2
- package/Build/Workers/{chunk-H5IQLAJP.js → chunk-OLH67Z2S.js} +82 -54
- package/Build/Workers/{chunk-FHLPYFIW.js → chunk-OWCFUM4Z.js} +13 -13
- package/Build/Workers/{chunk-66MGJQFZ.js → chunk-PQW63B2T.js} +2 -2
- package/Build/Workers/{chunk-UR36KLNW.js → chunk-RFZAUDYZ.js} +4 -4
- package/Build/Workers/{chunk-XWRUYDF6.js → chunk-SDFGZML6.js} +2 -2
- package/Build/Workers/{chunk-AHFTST3Q.js → chunk-SF2XXYOB.js} +12 -12
- package/Build/Workers/{chunk-QZGZIAK2.js → chunk-SGEAS4NZ.js} +6 -6
- package/Build/Workers/{chunk-MFXTB5I4.js → chunk-T7WXNKIA.js} +11 -11
- package/Build/Workers/{chunk-H7HFDM3G.js → chunk-TXK2FF6N.js} +5 -5
- package/Build/Workers/{chunk-D4XRQNUO.js → chunk-UTL4WVC3.js} +5 -5
- package/Build/Workers/{chunk-V6ZGOX4I.js → chunk-UTTKH2UG.js} +7 -7
- package/Build/Workers/{chunk-X55ZOYMS.js → chunk-VIDWZGD6.js} +12 -12
- package/Build/Workers/{chunk-TZDR2BAP.js → chunk-WIPOMPA5.js} +6 -6
- package/Build/Workers/{chunk-CEA3L7M7.js → chunk-WJV24LAS.js} +4 -4
- package/Build/Workers/{chunk-F4PS6RFF.js → chunk-WMG6UOCJ.js} +10 -10
- package/Build/Workers/{chunk-XIDMFHR4.js → chunk-XFS2ORSO.js} +14 -14
- package/Build/Workers/{chunk-VLGVUVJY.js → chunk-XPTKQIVN.js} +6 -6
- package/Build/Workers/{chunk-D5X2LOJ2.js → chunk-XYBFMHXA.js} +7 -7
- package/Build/Workers/{chunk-YNPZU55A.js → chunk-YFZMB6FZ.js} +6 -6
- package/Build/Workers/{chunk-YSDOO7AG.js → chunk-ZOVMWDPW.js} +5 -5
- package/Build/Workers/{chunk-5DF5RVIO.js → chunk-ZTGZMKAB.js} +16 -16
- package/Build/Workers/combineGeometry.js +21 -21
- package/Build/Workers/createBoxGeometry.js +15 -15
- package/Build/Workers/createBoxOutlineGeometry.js +13 -13
- package/Build/Workers/createCircleGeometry.js +23 -23
- package/Build/Workers/createCircleOutlineGeometry.js +16 -16
- package/Build/Workers/createCoplanarPolygonGeometry.js +30 -30
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +28 -28
- package/Build/Workers/createCorridorGeometry.js +26 -26
- package/Build/Workers/createCorridorOutlineGeometry.js +25 -25
- package/Build/Workers/createCylinderGeometry.js +17 -17
- package/Build/Workers/createCylinderOutlineGeometry.js +15 -15
- package/Build/Workers/createEllipseGeometry.js +23 -23
- package/Build/Workers/createEllipseOutlineGeometry.js +16 -16
- package/Build/Workers/createEllipsoidGeometry.js +16 -16
- package/Build/Workers/createEllipsoidOutlineGeometry.js +15 -15
- package/Build/Workers/createFrustumGeometry.js +15 -15
- package/Build/Workers/createFrustumOutlineGeometry.js +15 -15
- package/Build/Workers/createGeometry.js +21 -21
- package/Build/Workers/createGroundPolylineGeometry.js +19 -19
- package/Build/Workers/createPlaneGeometry.js +13 -13
- package/Build/Workers/createPlaneOutlineGeometry.js +12 -12
- package/Build/Workers/createPolygonGeometry.js +29 -29
- package/Build/Workers/createPolygonOutlineGeometry.js +27 -27
- package/Build/Workers/createPolylineGeometry.js +22 -22
- package/Build/Workers/createPolylineVolumeGeometry.js +28 -28
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +24 -24
- package/Build/Workers/createRectangleGeometry.js +24 -24
- package/Build/Workers/createRectangleOutlineGeometry.js +17 -17
- package/Build/Workers/createSimplePolylineGeometry.js +20 -20
- package/Build/Workers/createSphereGeometry.js +16 -16
- package/Build/Workers/createSphereOutlineGeometry.js +15 -15
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +12 -12
- package/Build/Workers/createVectorTileGeometries.js +21 -21
- package/Build/Workers/createVectorTilePoints.js +11 -11
- package/Build/Workers/createVectorTilePolygons.js +19 -19
- package/Build/Workers/createVectorTilePolylines.js +12 -12
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +19 -19
- package/Build/Workers/createVerticesFromHeightmap.js +19 -19
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +16 -16
- package/Build/Workers/createWallGeometry.js +21 -21
- package/Build/Workers/createWallOutlineGeometry.js +20 -20
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +9 -9
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +19 -19
- package/Source/Core/Event.js +94 -53
- package/Source/Core/GoogleMaps.js +2 -2
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/IonResource.js +30 -4
- package/Source/Core/Resource.js +5 -1
- package/Source/DataSources/KmlDataSource.js +62 -63
- package/Source/DataSources/exportKml.js +27 -30
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Azure2DImageryProvider.js +308 -0
- package/Source/Scene/Billboard.js +4 -0
- package/Source/Scene/BillboardCollection.js +9 -2
- package/Source/Scene/ClippingPlaneCollection.js +3 -3
- package/Source/Scene/ClippingPolygon.js +91 -2
- package/Source/Scene/CreditDisplay.js +1 -1
- package/Source/Scene/GaussianSplat3DTileContent.js +54 -9
- package/Source/Scene/GaussianSplatPrimitive.js +49 -50
- package/Source/Scene/Google2DImageryProvider.js +614 -0
- package/Source/Scene/IonImageryProvider.js +22 -1
- package/Source/Scene/LabelCollection.js +1 -0
- package/Source/Scene/Material.js +248 -80
- package/Source/Scene/Primitive.js +6 -0
- package/Source/Scene/PrimitiveState.js +123 -0
- package/Source/Scene/Scene.js +2 -2
- package/Source/Scene/VoxelBoundsCollection.js +494 -0
- package/Source/Scene/VoxelBoxShape.js +236 -101
- package/Source/Scene/VoxelCylinderShape.js +315 -204
- package/Source/Scene/VoxelEllipsoidShape.js +402 -119
- package/Source/Scene/VoxelPrimitive.js +119 -84
- package/Source/Scene/VoxelRenderResources.js +17 -10
- package/Source/Scene/VoxelShape.js +21 -6
- package/Source/Scene/buildVoxelDrawCommands.js +61 -20
- package/Source/Scene/createGooglePhotorealistic3DTileset.js +1 -1
- package/Source/Scene/getClippingFunction.js +79 -88
- package/Source/Shaders/BillboardCollectionVS.glsl +2 -0
- package/Source/Shaders/BillboardCollectionVS.js +2 -0
- package/Source/Shaders/Voxels/IntersectBox.glsl +20 -33
- package/Source/Shaders/Voxels/IntersectBox.js +20 -33
- package/Source/Shaders/Voxels/IntersectCylinder.glsl +28 -32
- package/Source/Shaders/Voxels/IntersectCylinder.js +28 -32
- package/Source/Shaders/Voxels/IntersectDepth.glsl +1 -4
- package/Source/Shaders/Voxels/IntersectDepth.js +1 -4
- package/Source/Shaders/Voxels/IntersectEllipsoid.glsl +12 -20
- package/Source/Shaders/Voxels/IntersectEllipsoid.js +12 -20
- package/Source/Shaders/Voxels/IntersectLongitude.glsl +21 -9
- package/Source/Shaders/Voxels/IntersectLongitude.js +21 -9
- package/Source/Shaders/Voxels/{IntersectClippingPlanes.glsl → IntersectPlane.glsl} +5 -3
- package/Source/Shaders/Voxels/{IntersectClippingPlanes.js → IntersectPlane.js} +5 -3
- package/Source/Shaders/Voxels/Intersection.glsl +3 -3
- package/Source/Shaders/Voxels/Intersection.js +3 -3
- package/Source/Shaders/Voxels/Octree.glsl +46 -51
- package/Source/Shaders/Voxels/Octree.js +46 -51
- package/Source/Shaders/Voxels/VoxelFS.glsl +50 -48
- package/Source/Shaders/Voxels/VoxelFS.js +50 -48
- package/Source/Shaders/Voxels/VoxelUtils.glsl +0 -19
- package/Source/Shaders/Voxels/VoxelUtils.js +0 -19
- package/Source/Shaders/Voxels/convertLocalToBoxUv.glsl +30 -0
- package/Source/Shaders/Voxels/convertLocalToBoxUv.js +32 -0
- package/Source/Shaders/Voxels/convertLocalToCylinderUv.glsl +97 -0
- package/Source/Shaders/Voxels/convertLocalToCylinderUv.js +99 -0
- package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.glsl +193 -0
- package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.js +195 -0
- package/Source/ThirdParty/Workers/zip-web-worker.js +1 -0
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/index.d.ts +317 -14
- package/index.js +177 -175
- package/package.json +2 -2
- package/Build/ThirdParty/Workers/pako_deflate.min.js +0 -503
- package/Build/ThirdParty/Workers/pako_inflate.min.js +0 -698
- package/Build/ThirdParty/Workers/z-worker-pako.js +0 -601
- package/Source/Core/defaultValue.js +0 -48
- package/Source/Shaders/Voxels/convertUvToBox.glsl +0 -45
- package/Source/Shaders/Voxels/convertUvToBox.js +0 -46
- package/Source/Shaders/Voxels/convertUvToCylinder.glsl +0 -99
- package/Source/Shaders/Voxels/convertUvToCylinder.js +0 -101
- package/Source/Shaders/Voxels/convertUvToEllipsoid.glsl +0 -139
- package/Source/Shaders/Voxels/convertUvToEllipsoid.js +0 -141
- package/Source/ThirdParty/Workers/pako_deflate.min.js +0 -2
- package/Source/ThirdParty/Workers/pako_inflate.min.js +0 -2
- package/Source/ThirdParty/Workers/z-worker-pako.js +0 -1
|
@@ -46,7 +46,90 @@ function ClippingPolygon(options) {
|
|
|
46
46
|
//>>includeEnd('debug');
|
|
47
47
|
|
|
48
48
|
this._ellipsoid = options.ellipsoid ?? Ellipsoid.default;
|
|
49
|
-
this._positions =
|
|
49
|
+
this._positions = copyArrayCartesian3(options.positions);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A copy of the input positions.
|
|
53
|
+
*
|
|
54
|
+
* This is used to detect modifications of the positions in
|
|
55
|
+
* <code>coputeRectangle</code>: The rectangle only has
|
|
56
|
+
* to be re-computed when these positions have changed.
|
|
57
|
+
*
|
|
58
|
+
* @type {Cartesian3[]|undefined}
|
|
59
|
+
* @private
|
|
60
|
+
*/
|
|
61
|
+
this._cachedPositions = undefined;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* A cached version of the rectangle that is computed in
|
|
65
|
+
* <code>computeRectangle</code>.
|
|
66
|
+
*
|
|
67
|
+
* This is only re-computed when the positions have changed, as
|
|
68
|
+
* determined by comparing the <code>_positions</code> to the
|
|
69
|
+
* <code>_cachedPositions</code>
|
|
70
|
+
*
|
|
71
|
+
* @type {Rectangle|undefined}
|
|
72
|
+
* @private
|
|
73
|
+
*/
|
|
74
|
+
this._cachedRectangle = undefined;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Returns a deep copy of the given array.
|
|
79
|
+
*
|
|
80
|
+
* If the input is undefined, then <code>undefined</code> is returned.
|
|
81
|
+
*
|
|
82
|
+
* Otherwise, the result will be a copy of the given array, where
|
|
83
|
+
* each element is copied with <code>Cartesian3.clone</code>.
|
|
84
|
+
*
|
|
85
|
+
* @param {Cartesian3[]|undefined} input The input array
|
|
86
|
+
* @returns {Cartesian3[]|undefined} The copy
|
|
87
|
+
*/
|
|
88
|
+
function copyArrayCartesian3(input) {
|
|
89
|
+
if (!defined(input)) {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
const n = input.length;
|
|
93
|
+
const output = Array(n);
|
|
94
|
+
for (let i = 0; i < n; i++) {
|
|
95
|
+
output[i] = Cartesian3.clone(input[i]);
|
|
96
|
+
}
|
|
97
|
+
return output;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Returns whether the given arrays are component-wise equal.
|
|
102
|
+
*
|
|
103
|
+
* When both arrays are undefined, then <code>true</code> is returned.
|
|
104
|
+
* When only one array is defined, or they are both defined but have
|
|
105
|
+
* different lengths, then <code>false</code> is returned.
|
|
106
|
+
*
|
|
107
|
+
* Otherwise, returns whether the corresponding elements of the arrays
|
|
108
|
+
* are equal, as of <code>Cartesian3.equals</code>.
|
|
109
|
+
*
|
|
110
|
+
* @param {Cartesian3[]|undefined} a The first array
|
|
111
|
+
* @param {Cartesian3[]|undefined} b The second array
|
|
112
|
+
* @returns {boolean} Whether the arrays are equal
|
|
113
|
+
*/
|
|
114
|
+
function equalsArrayCartesian3(a, b) {
|
|
115
|
+
if (!defined(a) && !defined(b)) {
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
if (defined(a) !== defined(b)) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
if (a.length !== b.length) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
const n = a.length;
|
|
125
|
+
for (let i = 0; i < n; i++) {
|
|
126
|
+
const ca = a[i];
|
|
127
|
+
const cb = b[i];
|
|
128
|
+
if (!Cartesian3.equals(ca, cb)) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return true;
|
|
50
133
|
}
|
|
51
134
|
|
|
52
135
|
Object.defineProperties(ClippingPolygon.prototype, {
|
|
@@ -138,12 +221,18 @@ ClippingPolygon.equals = function (left, right) {
|
|
|
138
221
|
* @returns {Rectangle} The result rectangle
|
|
139
222
|
*/
|
|
140
223
|
ClippingPolygon.prototype.computeRectangle = function (result) {
|
|
141
|
-
|
|
224
|
+
if (equalsArrayCartesian3(this._positions, this._cachedPositions)) {
|
|
225
|
+
return Rectangle.clone(this._cachedRectangle, result);
|
|
226
|
+
}
|
|
227
|
+
const rectangle = PolygonGeometry.computeRectangleFromPositions(
|
|
142
228
|
this.positions,
|
|
143
229
|
this.ellipsoid,
|
|
144
230
|
undefined,
|
|
145
231
|
result,
|
|
146
232
|
);
|
|
233
|
+
this._cachedPositions = copyArrayCartesian3(this._positions);
|
|
234
|
+
this._cachedRectangle = Rectangle.clone(rectangle);
|
|
235
|
+
return rectangle;
|
|
147
236
|
};
|
|
148
237
|
|
|
149
238
|
const scratchRectangle = new Rectangle();
|
|
@@ -194,7 +194,7 @@ function appendCss(container) {
|
|
|
194
194
|
.cesium-credit-lightbox.cesium-credit-lightbox-expanded {
|
|
195
195
|
border: 1px solid #444;
|
|
196
196
|
border-radius: 5px;
|
|
197
|
-
max-width:
|
|
197
|
+
max-width: 470px;
|
|
198
198
|
}
|
|
199
199
|
.cesium-credit-lightbox.cesium-credit-lightbox-mobile {
|
|
200
200
|
height: 100%;
|
|
@@ -31,15 +31,28 @@ function GaussianSplat3DTileContent(loader, tileset, tile, resource) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* the underlying data was modified.
|
|
34
|
+
* Local copy of the position attribute buffer that has been transformed into root tile space. Originals are kept in the gltf loader.
|
|
35
|
+
* Used for rendering
|
|
37
36
|
* @type {undefined|Float32Array}
|
|
38
37
|
* @private
|
|
39
38
|
*/
|
|
40
|
-
this.
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
this._positions = undefined;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Local copy of the rotation attribute buffer that has been transformed into root tile space. Originals are kept in the gltf loader.
|
|
43
|
+
* Used for rendering
|
|
44
|
+
* @type {undefined|Float32Array}
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
this._rotations = undefined;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Local copy of the scale attribute buffer that has been transformed into root tile space. Originals are kept in the gltf loader.
|
|
51
|
+
* Used for rendering
|
|
52
|
+
* @type {undefined|Float32Array}
|
|
53
|
+
* @private
|
|
54
|
+
*/
|
|
55
|
+
this._scales = undefined;
|
|
43
56
|
|
|
44
57
|
/**
|
|
45
58
|
* glTF primitive data that contains the Gaussian splat data needed for rendering.
|
|
@@ -368,6 +381,38 @@ Object.defineProperties(GaussianSplat3DTileContent.prototype, {
|
|
|
368
381
|
},
|
|
369
382
|
},
|
|
370
383
|
|
|
384
|
+
/**
|
|
385
|
+
* Get the transformed positions of this tile's Gaussian splats.
|
|
386
|
+
* @type {undefined|Float32Array}
|
|
387
|
+
* @private
|
|
388
|
+
*/
|
|
389
|
+
positions: {
|
|
390
|
+
get: function () {
|
|
391
|
+
return this._positions;
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
/**
|
|
395
|
+
* Get the transformed rotations of this tile's Gaussian splats.
|
|
396
|
+
* @type {undefined|Float32Array}
|
|
397
|
+
* @private
|
|
398
|
+
*/
|
|
399
|
+
rotations: {
|
|
400
|
+
get: function () {
|
|
401
|
+
return this._rotations;
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Get the transformed scales of this tile's Gaussian splats.
|
|
407
|
+
* @type {undefined|Float32Array}
|
|
408
|
+
* @private
|
|
409
|
+
*/
|
|
410
|
+
scales: {
|
|
411
|
+
get: function () {
|
|
412
|
+
return this._scales;
|
|
413
|
+
},
|
|
414
|
+
},
|
|
415
|
+
|
|
371
416
|
/**
|
|
372
417
|
* The number of spherical harmonic coefficients used for the Gaussian splats.
|
|
373
418
|
* @type {number}
|
|
@@ -629,21 +674,21 @@ GaussianSplat3DTileContent.prototype.update = function (primitive, frameState) {
|
|
|
629
674
|
this.worldTransform = loader.components.scene.nodes[0].matrix;
|
|
630
675
|
this._ready = true;
|
|
631
676
|
|
|
632
|
-
this.
|
|
677
|
+
this._positions = new Float32Array(
|
|
633
678
|
ModelUtility.getAttributeBySemantic(
|
|
634
679
|
this.gltfPrimitive,
|
|
635
680
|
VertexAttributeSemantic.POSITION,
|
|
636
681
|
).typedArray,
|
|
637
682
|
);
|
|
638
683
|
|
|
639
|
-
this.
|
|
684
|
+
this._rotations = new Float32Array(
|
|
640
685
|
ModelUtility.getAttributeBySemantic(
|
|
641
686
|
this.gltfPrimitive,
|
|
642
687
|
VertexAttributeSemantic.ROTATION,
|
|
643
688
|
).typedArray,
|
|
644
689
|
);
|
|
645
690
|
|
|
646
|
-
this.
|
|
691
|
+
this._scales = new Float32Array(
|
|
647
692
|
ModelUtility.getAttributeBySemantic(
|
|
648
693
|
this.gltfPrimitive,
|
|
649
694
|
VertexAttributeSemantic.SCALE,
|
|
@@ -450,9 +450,9 @@ GaussianSplatPrimitive.transformTile = function (tile) {
|
|
|
450
450
|
computedModelMatrix,
|
|
451
451
|
scratchMatrix4A,
|
|
452
452
|
);
|
|
453
|
-
const positions = tile.content.
|
|
454
|
-
const rotations = tile.content.
|
|
455
|
-
const scales = tile.content.
|
|
453
|
+
const positions = tile.content.positions;
|
|
454
|
+
const rotations = tile.content.rotations;
|
|
455
|
+
const scales = tile.content.scales;
|
|
456
456
|
const attributePositions = ModelUtility.getAttributeBySemantic(
|
|
457
457
|
gltfPrimitive,
|
|
458
458
|
VertexAttributeSemantic.POSITION,
|
|
@@ -471,19 +471,19 @@ GaussianSplatPrimitive.transformTile = function (tile) {
|
|
|
471
471
|
const position = new Cartesian3();
|
|
472
472
|
const rotation = new Quaternion();
|
|
473
473
|
const scale = new Cartesian3();
|
|
474
|
-
for (let i = 0; i <
|
|
475
|
-
position.x =
|
|
476
|
-
position.y =
|
|
477
|
-
position.z =
|
|
474
|
+
for (let i = 0; i < attributePositions.length / 3; ++i) {
|
|
475
|
+
position.x = attributePositions[i * 3];
|
|
476
|
+
position.y = attributePositions[i * 3 + 1];
|
|
477
|
+
position.z = attributePositions[i * 3 + 2];
|
|
478
478
|
|
|
479
|
-
rotation.x =
|
|
480
|
-
rotation.y =
|
|
481
|
-
rotation.z =
|
|
482
|
-
rotation.w =
|
|
479
|
+
rotation.x = attributeRotations[i * 4];
|
|
480
|
+
rotation.y = attributeRotations[i * 4 + 1];
|
|
481
|
+
rotation.z = attributeRotations[i * 4 + 2];
|
|
482
|
+
rotation.w = attributeRotations[i * 4 + 3];
|
|
483
483
|
|
|
484
|
-
scale.x =
|
|
485
|
-
scale.y =
|
|
486
|
-
scale.z =
|
|
484
|
+
scale.x = attributeScales[i * 3];
|
|
485
|
+
scale.y = attributeScales[i * 3 + 1];
|
|
486
|
+
scale.z = attributeScales[i * 3 + 2];
|
|
487
487
|
|
|
488
488
|
Matrix4.fromTranslationQuaternionRotationScale(
|
|
489
489
|
position,
|
|
@@ -498,18 +498,18 @@ GaussianSplatPrimitive.transformTile = function (tile) {
|
|
|
498
498
|
Matrix4.getRotation(scratchMatrix4C, rotation);
|
|
499
499
|
Matrix4.getScale(scratchMatrix4C, scale);
|
|
500
500
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
501
|
+
positions[i * 3] = position.x;
|
|
502
|
+
positions[i * 3 + 1] = position.y;
|
|
503
|
+
positions[i * 3 + 2] = position.z;
|
|
504
504
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
505
|
+
rotations[i * 4] = rotation.x;
|
|
506
|
+
rotations[i * 4 + 1] = rotation.y;
|
|
507
|
+
rotations[i * 4 + 2] = rotation.z;
|
|
508
|
+
rotations[i * 4 + 3] = rotation.w;
|
|
509
509
|
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
510
|
+
scales[i * 3] = scale.x;
|
|
511
|
+
scales[i * 3 + 1] = scale.y;
|
|
512
|
+
scales[i * 3 + 2] = scale.z;
|
|
513
513
|
}
|
|
514
514
|
};
|
|
515
515
|
|
|
@@ -566,7 +566,7 @@ GaussianSplatPrimitive.generateSplatTexture = function (primitive, frameState) {
|
|
|
566
566
|
},
|
|
567
567
|
});
|
|
568
568
|
}
|
|
569
|
-
|
|
569
|
+
primitive._vertexArray = undefined;
|
|
570
570
|
primitive._lastTextureHeight = splatTextureData.height;
|
|
571
571
|
primitive._lastTextureWidth = splatTextureData.width;
|
|
572
572
|
|
|
@@ -652,8 +652,9 @@ GaussianSplatPrimitive.buildGSplatDrawCommand = function (
|
|
|
652
652
|
|
|
653
653
|
const uniformMap = renderResources.uniformMap;
|
|
654
654
|
|
|
655
|
+
const textureCache = primitive.gaussianSplatTexture;
|
|
655
656
|
uniformMap.u_splatAttributeTexture = function () {
|
|
656
|
-
return
|
|
657
|
+
return textureCache;
|
|
657
658
|
};
|
|
658
659
|
|
|
659
660
|
if (primitive._sphericalHarmonicsDegree > 0) {
|
|
@@ -768,12 +769,13 @@ GaussianSplatPrimitive.buildGSplatDrawCommand = function (
|
|
|
768
769
|
scratchMatrix4B,
|
|
769
770
|
);
|
|
770
771
|
|
|
772
|
+
const vertexArrayCache = primitive._vertexArray;
|
|
771
773
|
const command = new DrawCommand({
|
|
772
774
|
boundingVolume: tileset.boundingSphere,
|
|
773
775
|
modelMatrix: modelMatrix,
|
|
774
776
|
uniformMap: uniformMap,
|
|
775
777
|
renderState: renderState,
|
|
776
|
-
vertexArray:
|
|
778
|
+
vertexArray: vertexArrayCache,
|
|
777
779
|
shaderProgram: shaderProgram,
|
|
778
780
|
cull: renderStateOptions.cull.enabled,
|
|
779
781
|
pass: Pass.GAUSSIAN_SPLATS,
|
|
@@ -858,21 +860,27 @@ GaussianSplatPrimitive.prototype.update = function (frameState) {
|
|
|
858
860
|
const aggregateAttributeValues = (
|
|
859
861
|
componentDatatype,
|
|
860
862
|
getAttributeCallback,
|
|
863
|
+
numberOfComponents,
|
|
861
864
|
) => {
|
|
862
865
|
let aggregate;
|
|
863
866
|
let offset = 0;
|
|
864
867
|
for (const tile of tiles) {
|
|
865
|
-
const
|
|
866
|
-
const attribute = getAttributeCallback(
|
|
868
|
+
const content = tile.content;
|
|
869
|
+
const attribute = getAttributeCallback(content);
|
|
870
|
+
const componentsPerAttribute = defined(numberOfComponents)
|
|
871
|
+
? numberOfComponents
|
|
872
|
+
: AttributeType.getNumberOfComponents(attribute.type);
|
|
873
|
+
const buffer = defined(attribute.typedArray)
|
|
874
|
+
? attribute.typedArray
|
|
875
|
+
: attribute;
|
|
867
876
|
if (!defined(aggregate)) {
|
|
868
877
|
aggregate = ComponentDatatype.createTypedArray(
|
|
869
878
|
componentDatatype,
|
|
870
|
-
totalElements *
|
|
871
|
-
AttributeType.getNumberOfComponents(attribute.type),
|
|
879
|
+
totalElements * componentsPerAttribute,
|
|
872
880
|
);
|
|
873
881
|
}
|
|
874
|
-
aggregate.set(
|
|
875
|
-
offset +=
|
|
882
|
+
aggregate.set(buffer, offset);
|
|
883
|
+
offset += buffer.length;
|
|
876
884
|
}
|
|
877
885
|
return aggregate;
|
|
878
886
|
};
|
|
@@ -904,36 +912,27 @@ GaussianSplatPrimitive.prototype.update = function (frameState) {
|
|
|
904
912
|
|
|
905
913
|
this._positions = aggregateAttributeValues(
|
|
906
914
|
ComponentDatatype.FLOAT,
|
|
907
|
-
(
|
|
908
|
-
|
|
909
|
-
gltfPrimitive,
|
|
910
|
-
VertexAttributeSemantic.POSITION,
|
|
911
|
-
),
|
|
915
|
+
(content) => content.positions,
|
|
916
|
+
3,
|
|
912
917
|
);
|
|
913
918
|
|
|
914
919
|
this._scales = aggregateAttributeValues(
|
|
915
920
|
ComponentDatatype.FLOAT,
|
|
916
|
-
(
|
|
917
|
-
|
|
918
|
-
gltfPrimitive,
|
|
919
|
-
VertexAttributeSemantic.SCALE,
|
|
920
|
-
),
|
|
921
|
+
(content) => content.scales,
|
|
922
|
+
3,
|
|
921
923
|
);
|
|
922
924
|
|
|
923
925
|
this._rotations = aggregateAttributeValues(
|
|
924
926
|
ComponentDatatype.FLOAT,
|
|
925
|
-
(
|
|
926
|
-
|
|
927
|
-
gltfPrimitive,
|
|
928
|
-
VertexAttributeSemantic.ROTATION,
|
|
929
|
-
),
|
|
927
|
+
(content) => content.rotations,
|
|
928
|
+
4,
|
|
930
929
|
);
|
|
931
930
|
|
|
932
931
|
this._colors = aggregateAttributeValues(
|
|
933
932
|
ComponentDatatype.UNSIGNED_BYTE,
|
|
934
|
-
(
|
|
933
|
+
(content) =>
|
|
935
934
|
ModelUtility.getAttributeBySemantic(
|
|
936
|
-
gltfPrimitive,
|
|
935
|
+
content.gltfPrimitive,
|
|
937
936
|
VertexAttributeSemantic.COLOR,
|
|
938
937
|
),
|
|
939
938
|
);
|