@hztxi/cesium-engine 25.0.2 → 25.0.3
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 +761 -520
- package/Build/Workers/chunk-2KZP32NE.js +3201 -0
- package/Build/Workers/chunk-2P5SGQUU.js +44 -0
- package/Build/Workers/chunk-2PFSIZOR.js +959 -0
- package/Build/Workers/chunk-2RC5GQMH.js +82 -0
- package/Build/Workers/chunk-2TM5FET3.js +241 -0
- package/Build/Workers/chunk-2ZYMQXBB.js +519 -0
- package/Build/Workers/chunk-37IVAHRF.js +3201 -0
- package/Build/Workers/chunk-3CSWK42O.js +3648 -0
- package/Build/Workers/chunk-3GDVUAIX.js +1287 -0
- package/Build/Workers/chunk-3L5NZHVW.js +288 -0
- package/Build/Workers/chunk-3LQDIJFX.js +2719 -0
- package/Build/Workers/chunk-3WIDW5QO.js +1800 -0
- package/Build/Workers/chunk-4L4ZXXL7.js +57 -0
- package/Build/Workers/chunk-4QK5RZ5I.js +171 -0
- package/Build/Workers/chunk-4RWSLDVO.js +198 -0
- package/Build/Workers/chunk-53HFLKT5.js +76 -0
- package/Build/Workers/chunk-5DJBLQEH.js +56 -0
- package/Build/Workers/chunk-5FNZGB4U.js +368 -0
- package/Build/Workers/chunk-5KOCUIKQ.js +476 -0
- package/Build/Workers/chunk-5PK42ITB.js +219 -0
- package/Build/Workers/chunk-5SGB3BKM.js +73 -0
- package/Build/Workers/chunk-5ZWRS2E6.js +280 -0
- package/Build/Workers/chunk-6FU5LWYG.js +352 -0
- package/Build/Workers/chunk-6IYEGXEW.js +1344 -0
- package/Build/Workers/chunk-6KWWDFT4.js +278 -0
- package/Build/Workers/chunk-73DJHI53.js +398 -0
- package/Build/Workers/chunk-73OT3YBQ.js +1054 -0
- package/Build/Workers/chunk-73T2E2OA.js +454 -0
- package/Build/Workers/chunk-752QDGCS.js +778 -0
- package/Build/Workers/chunk-76HD3HYN.js +2342 -0
- package/Build/Workers/chunk-7I4AKIEV.js +58 -0
- package/Build/Workers/chunk-7ZYD7GL6.js +414 -0
- package/Build/Workers/chunk-ALJYMECF.js +973 -0
- package/Build/Workers/chunk-ANGZAKVP.js +257 -0
- package/Build/Workers/chunk-ATT5UEK6.js +97 -0
- package/Build/Workers/chunk-AW3UT5RP.js +97 -0
- package/Build/Workers/chunk-AZGPL6BR.js +38 -0
- package/Build/Workers/chunk-B7SMDRPA.js +476 -0
- package/Build/Workers/chunk-BADQ2G5E.js +837 -0
- package/Build/Workers/chunk-BAPOWX62.js +368 -0
- package/Build/Workers/chunk-BE5ULV4I.js +1800 -0
- package/Build/Workers/chunk-BII4UB3C.js +476 -0
- package/Build/Workers/chunk-BPL3HT2R.js +837 -0
- package/Build/Workers/chunk-BVAMP4M3.js +101 -0
- package/Build/Workers/chunk-BVFS5LSK.js +1067 -0
- package/Build/Workers/chunk-CKWUU4JK.js +138 -0
- package/Build/Workers/chunk-CMMHWVUF.js +2719 -0
- package/Build/Workers/chunk-CQNFIAZU.js +56 -0
- package/Build/Workers/chunk-CSUBL77L.js +140 -0
- package/Build/Workers/chunk-DHCQSFRN.js +301 -0
- package/Build/Workers/chunk-DKFSOFKR.js +241 -0
- package/Build/Workers/chunk-DLHFYNG6.js +52 -0
- package/Build/Workers/chunk-ETABYWY4.js +973 -0
- package/Build/Workers/chunk-EYVCQUVQ.js +1067 -0
- package/Build/Workers/chunk-FE7VHPNW.js +102 -0
- package/Build/Workers/chunk-FFEVCOBU.js +387 -0
- package/Build/Workers/chunk-FWABE4BL.js +305 -0
- package/Build/Workers/chunk-GC24BPCQ.js +305 -0
- package/Build/Workers/chunk-GCTHMF35.js +387 -0
- package/Build/Workers/chunk-GDHSPLWC.js +9237 -0
- package/Build/Workers/chunk-GGK7SA4Y.js +414 -0
- package/Build/Workers/chunk-GGVG7G5Z.js +1483 -0
- package/Build/Workers/chunk-GL7W3I3A.js +959 -0
- package/Build/Workers/chunk-H52M4HMP.js +9230 -0
- package/Build/Workers/chunk-H7QGY7HB.js +1054 -0
- package/Build/Workers/chunk-H7ZXQIV2.js +398 -0
- package/Build/Workers/chunk-HBJKIDKK.js +76 -0
- package/Build/Workers/chunk-HERVRBJW.js +76 -0
- package/Build/Workers/chunk-HFMS7MXO.js +511 -0
- package/Build/Workers/chunk-HH6PJ22V.js +455 -0
- package/Build/Workers/chunk-HQ2PXPP7.js +102 -0
- package/Build/Workers/chunk-HTO45L3X.js +454 -0
- package/Build/Workers/chunk-HW5TLMPQ.js +57 -0
- package/Build/Workers/chunk-IC3HVJBG.js +301 -0
- package/Build/Workers/chunk-IEKP7CEH.js +387 -0
- package/Build/Workers/chunk-ILUFUAF3.js +1992 -0
- package/Build/Workers/chunk-ILX5N5QR.js +2342 -0
- package/Build/Workers/chunk-IRSD4EJW.js +630 -0
- package/Build/Workers/chunk-J3A3XMTG.js +672 -0
- package/Build/Workers/chunk-JK54NBBO.js +778 -0
- package/Build/Workers/chunk-JSFKPEFK.js +352 -0
- package/Build/Workers/chunk-JTSSQ3RH.js +147 -0
- package/Build/Workers/chunk-JZVZDHC2.js +288 -0
- package/Build/Workers/chunk-K724BR5O.js +455 -0
- package/Build/Workers/chunk-KJOVSN7J.js +56 -0
- package/Build/Workers/chunk-KKEMKV5G.js +44 -0
- package/Build/Workers/chunk-KXNXQXP5.js +682 -0
- package/Build/Workers/chunk-KYXZ3XTC.js +497 -0
- package/Build/Workers/chunk-L65LWRUE.js +3648 -0
- package/Build/Workers/chunk-LAN4XQR6.js +162 -0
- package/Build/Workers/chunk-LVO4J36T.js +1800 -0
- package/Build/Workers/chunk-LY5KUQ2L.js +57 -0
- package/Build/Workers/chunk-M2XWG5VC.js +124 -0
- package/Build/Workers/chunk-MUPWJMPP.js +44 -0
- package/Build/Workers/chunk-MVBEMXN4.js +163 -0
- package/Build/Workers/chunk-MVQYVX6D.js +511 -0
- package/Build/Workers/chunk-N4RF6TUL.js +301 -0
- package/Build/Workers/chunk-NCH4P66E.js +219 -0
- package/Build/Workers/chunk-NCL22ZUX.js +56 -0
- package/Build/Workers/chunk-NNJDVVEG.js +3794 -0
- package/Build/Workers/chunk-NYQSZLRF.js +78 -0
- package/Build/Workers/chunk-O2V4I3I5.js +682 -0
- package/Build/Workers/chunk-O453S45W.js +1483 -0
- package/Build/Workers/chunk-O5CYW2IR.js +1046 -0
- package/Build/Workers/chunk-OJ7O7DKV.js +973 -0
- package/Build/Workers/chunk-OJK33YVT.js +171 -0
- package/Build/Workers/chunk-OKFC4PDV.js +1344 -0
- package/Build/Workers/chunk-OKUXJIW3.js +124 -0
- package/Build/Workers/chunk-OWDZ5BX4.js +280 -0
- package/Build/Workers/chunk-PCERHV4S.js +198 -0
- package/Build/Workers/chunk-PJT22BD4.js +352 -0
- package/Build/Workers/chunk-PKV3R77E.js +672 -0
- package/Build/Workers/chunk-PQ2MGY7X.js +162 -0
- package/Build/Workers/chunk-PR62UBKE.js +693 -0
- package/Build/Workers/chunk-QJJ3GXSH.js +140 -0
- package/Build/Workers/chunk-QM4HZZYW.js +219 -0
- package/Build/Workers/chunk-QQ2BBL7Z.js +162 -0
- package/Build/Workers/chunk-QYC6Y25A.js +124 -0
- package/Build/Workers/chunk-RBAZR7R2.js +280 -0
- package/Build/Workers/chunk-REZJEC6F.js +241 -0
- package/Build/Workers/chunk-RS3LRHOK.js +73 -0
- package/Build/Workers/chunk-S2WTOFGB.js +102 -0
- package/Build/Workers/chunk-SGLJWWWY.js +352 -0
- package/Build/Workers/chunk-SJZMU3OS.js +2342 -0
- package/Build/Workers/chunk-SMZXVFCA.js +1344 -0
- package/Build/Workers/chunk-SND4KNB6.js +754 -0
- package/Build/Workers/chunk-SRH2XIWS.js +1067 -0
- package/Build/Workers/chunk-SXSP3JHS.js +38 -0
- package/Build/Workers/chunk-T6SVKD76.js +511 -0
- package/Build/Workers/chunk-TA3PH4Q7.js +519 -0
- package/Build/Workers/chunk-TDJ2NSYJ.js +171 -0
- package/Build/Workers/chunk-TJCD5NV5.js +837 -0
- package/Build/Workers/chunk-TXBADNRA.js +9237 -0
- package/Build/Workers/chunk-TYW2D7VU.js +2719 -0
- package/Build/Workers/chunk-U3KB4HMG.js +1054 -0
- package/Build/Workers/chunk-U6OMVSBY.js +368 -0
- package/Build/Workers/chunk-UAVMVBMC.js +754 -0
- package/Build/Workers/chunk-UCOZLNHF.js +1284 -0
- package/Build/Workers/chunk-UDKEO3UF.js +163 -0
- package/Build/Workers/chunk-UIQUUY4A.js +73 -0
- package/Build/Workers/chunk-ULY2FDDP.js +454 -0
- package/Build/Workers/chunk-UT7YX565.js +1992 -0
- package/Build/Workers/chunk-UTOYFI3Q.js +1992 -0
- package/Build/Workers/chunk-UUXWWJI7.js +101 -0
- package/Build/Workers/chunk-V5AWAGL2.js +97 -0
- package/Build/Workers/chunk-V5AXOGPW.js +682 -0
- package/Build/Workers/chunk-VAUX2Q2X.js +138 -0
- package/Build/Workers/chunk-VDX4SJKV.js +58 -0
- package/Build/Workers/chunk-W7WEPLZL.js +414 -0
- package/Build/Workers/chunk-WNAG4FHY.js +305 -0
- package/Build/Workers/chunk-WNQX2CP3.js +455 -0
- package/Build/Workers/chunk-XCASHPVG.js +778 -0
- package/Build/Workers/chunk-XJUIVTHG.js +1483 -0
- package/Build/Workers/chunk-XQVSSVT2.js +140 -0
- package/Build/Workers/chunk-Y5E2LVSX.js +138 -0
- package/Build/Workers/chunk-YEMKJOOG.js +352 -0
- package/Build/Workers/chunk-YGFVAGYF.js +630 -0
- package/Build/Workers/chunk-YNWTO2WN.js +147 -0
- package/Build/Workers/chunk-YZAMLSIA.js +352 -0
- package/Build/Workers/chunk-Z6LUW5FN.js +198 -0
- package/Build/Workers/chunk-ZDUCDVKX.js +288 -0
- package/Build/Workers/chunk-ZEEPTE4R.js +147 -0
- package/Build/Workers/chunk-ZIBW2BFB.js +1284 -0
- package/Build/Workers/chunk-ZOYVNCFZ.js +754 -0
- package/Build/Workers/chunk-ZSWY7UNG.js +3201 -0
- package/Build/Workers/chunk-ZXRWKKJP.js +398 -0
- 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 +23 -23
- package/Build/Workers/createMvtTile.js +1815 -0
- 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 +26 -26
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +23 -23
- package/Build/Workers/createVerticesFromHeightmap.js +25 -25
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +21 -21
- 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 +58 -44
- 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 +7 -7
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +23 -23
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +26 -26
- package/Source/Core/ScreenSpaceEventHandler.js +19 -0
- package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/index.d.ts +48305 -0
- package/index.js +373 -373
- package/package.json +10 -10
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 1.144.0
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2011-2022 Cesium Contributors
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*
|
|
20
|
+
* Columbus View (Pat. Pend.)
|
|
21
|
+
*
|
|
22
|
+
* Portions licensed separately.
|
|
23
|
+
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
Math_default
|
|
28
|
+
} from "./chunk-2ZYMQXBB.js";
|
|
29
|
+
|
|
30
|
+
// packages/engine/Source/Core/CylinderGeometryLibrary.js
|
|
31
|
+
var CylinderGeometryLibrary = {};
|
|
32
|
+
CylinderGeometryLibrary.computePositions = function(length, topRadius, bottomRadius, slices, fill) {
|
|
33
|
+
const topZ = length * 0.5;
|
|
34
|
+
const bottomZ = -topZ;
|
|
35
|
+
const twoSlice = slices + slices;
|
|
36
|
+
const size = fill ? 2 * twoSlice : twoSlice;
|
|
37
|
+
const positions = new Float64Array(size * 3);
|
|
38
|
+
let i;
|
|
39
|
+
let index = 0;
|
|
40
|
+
let tbIndex = 0;
|
|
41
|
+
const bottomOffset = fill ? twoSlice * 3 : 0;
|
|
42
|
+
const topOffset = fill ? (twoSlice + slices) * 3 : slices * 3;
|
|
43
|
+
for (i = 0; i < slices; i++) {
|
|
44
|
+
const angle = i / slices * Math_default.TWO_PI;
|
|
45
|
+
const x = Math.cos(angle);
|
|
46
|
+
const y = Math.sin(angle);
|
|
47
|
+
const bottomX = x * bottomRadius;
|
|
48
|
+
const bottomY = y * bottomRadius;
|
|
49
|
+
const topX = x * topRadius;
|
|
50
|
+
const topY = y * topRadius;
|
|
51
|
+
positions[tbIndex + bottomOffset] = bottomX;
|
|
52
|
+
positions[tbIndex + bottomOffset + 1] = bottomY;
|
|
53
|
+
positions[tbIndex + bottomOffset + 2] = bottomZ;
|
|
54
|
+
positions[tbIndex + topOffset] = topX;
|
|
55
|
+
positions[tbIndex + topOffset + 1] = topY;
|
|
56
|
+
positions[tbIndex + topOffset + 2] = topZ;
|
|
57
|
+
tbIndex += 3;
|
|
58
|
+
if (fill) {
|
|
59
|
+
positions[index++] = bottomX;
|
|
60
|
+
positions[index++] = bottomY;
|
|
61
|
+
positions[index++] = bottomZ;
|
|
62
|
+
positions[index++] = topX;
|
|
63
|
+
positions[index++] = topY;
|
|
64
|
+
positions[index++] = topZ;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return positions;
|
|
68
|
+
};
|
|
69
|
+
var CylinderGeometryLibrary_default = CylinderGeometryLibrary;
|
|
70
|
+
|
|
71
|
+
export {
|
|
72
|
+
CylinderGeometryLibrary_default
|
|
73
|
+
};
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 1.141.3
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2011-2022 Cesium Contributors
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*
|
|
20
|
+
* Columbus View (Pat. Pend.)
|
|
21
|
+
*
|
|
22
|
+
* Portions licensed separately.
|
|
23
|
+
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
// node_modules/.pnpm/@cesium+wasm-splats@0.1.0-alpha.2/node_modules/@cesium/wasm-splats/wasm_splats.js
|
|
28
|
+
var wasm;
|
|
29
|
+
var cachedTextDecoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }) : { decode: () => {
|
|
30
|
+
throw Error("TextDecoder not available");
|
|
31
|
+
} };
|
|
32
|
+
if (typeof TextDecoder !== "undefined") {
|
|
33
|
+
cachedTextDecoder.decode();
|
|
34
|
+
}
|
|
35
|
+
var cachedUint8ArrayMemory0 = null;
|
|
36
|
+
function getUint8ArrayMemory0() {
|
|
37
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
38
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
39
|
+
}
|
|
40
|
+
return cachedUint8ArrayMemory0;
|
|
41
|
+
}
|
|
42
|
+
function getStringFromWasm0(ptr, len) {
|
|
43
|
+
ptr = ptr >>> 0;
|
|
44
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
45
|
+
}
|
|
46
|
+
var cachedUint32ArrayMemory0 = null;
|
|
47
|
+
function getUint32ArrayMemory0() {
|
|
48
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
49
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
50
|
+
}
|
|
51
|
+
return cachedUint32ArrayMemory0;
|
|
52
|
+
}
|
|
53
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
54
|
+
ptr = ptr >>> 0;
|
|
55
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
56
|
+
}
|
|
57
|
+
var WASM_VECTOR_LEN = 0;
|
|
58
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
59
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
60
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
61
|
+
WASM_VECTOR_LEN = arg.length;
|
|
62
|
+
return ptr;
|
|
63
|
+
}
|
|
64
|
+
function takeFromExternrefTable0(idx) {
|
|
65
|
+
const value = wasm.__wbindgen_export_0.get(idx);
|
|
66
|
+
wasm.__externref_table_dealloc(idx);
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
function generate_splat_texture(positions, scales, rotations, colors, count) {
|
|
70
|
+
const ret = wasm.generate_splat_texture(positions, scales, rotations, colors, count);
|
|
71
|
+
if (ret[2]) {
|
|
72
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
73
|
+
}
|
|
74
|
+
return TextureData.__wrap(ret[0]);
|
|
75
|
+
}
|
|
76
|
+
function radix_sort_gaussians_indexes(positions_arr, model_view_arr, count) {
|
|
77
|
+
const ret = wasm.radix_sort_gaussians_indexes(positions_arr, model_view_arr, count);
|
|
78
|
+
if (ret[2]) {
|
|
79
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
80
|
+
}
|
|
81
|
+
return takeFromExternrefTable0(ret[0]);
|
|
82
|
+
}
|
|
83
|
+
var TextureDataFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
84
|
+
}, unregister: () => {
|
|
85
|
+
} } : new FinalizationRegistry((ptr) => wasm.__wbg_texturedata_free(ptr >>> 0, 1));
|
|
86
|
+
var TextureData = class _TextureData {
|
|
87
|
+
static __wrap(ptr) {
|
|
88
|
+
ptr = ptr >>> 0;
|
|
89
|
+
const obj = Object.create(_TextureData.prototype);
|
|
90
|
+
obj.__wbg_ptr = ptr;
|
|
91
|
+
TextureDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
92
|
+
return obj;
|
|
93
|
+
}
|
|
94
|
+
__destroy_into_raw() {
|
|
95
|
+
const ptr = this.__wbg_ptr;
|
|
96
|
+
this.__wbg_ptr = 0;
|
|
97
|
+
TextureDataFinalization.unregister(this);
|
|
98
|
+
return ptr;
|
|
99
|
+
}
|
|
100
|
+
free() {
|
|
101
|
+
const ptr = this.__destroy_into_raw();
|
|
102
|
+
wasm.__wbg_texturedata_free(ptr, 0);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Getter for the underlying texture data. Always returns a copy.
|
|
106
|
+
* @returns {Uint32Array}
|
|
107
|
+
*/
|
|
108
|
+
get data() {
|
|
109
|
+
const ret = wasm.texturedata_data(this.__wbg_ptr);
|
|
110
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
111
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
112
|
+
return v1;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Getter for the width of the texture in pixels.
|
|
116
|
+
* @returns {number}
|
|
117
|
+
*/
|
|
118
|
+
get width() {
|
|
119
|
+
const ret = wasm.texturedata_width(this.__wbg_ptr);
|
|
120
|
+
return ret >>> 0;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Getter for the height of the texture in pixels.
|
|
124
|
+
* @returns {number}
|
|
125
|
+
*/
|
|
126
|
+
get height() {
|
|
127
|
+
const ret = wasm.texturedata_height(this.__wbg_ptr);
|
|
128
|
+
return ret >>> 0;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Creates a new texture data object with the underlying data, width, and height.
|
|
132
|
+
* @param {Uint32Array} data
|
|
133
|
+
* @param {number} width
|
|
134
|
+
* @param {number} height
|
|
135
|
+
* @returns {TextureData}
|
|
136
|
+
*/
|
|
137
|
+
static new(data, width, height) {
|
|
138
|
+
const ptr0 = passArray32ToWasm0(data, wasm.__wbindgen_malloc);
|
|
139
|
+
const len0 = WASM_VECTOR_LEN;
|
|
140
|
+
const ret = wasm.texturedata_new(ptr0, len0, width, height);
|
|
141
|
+
return _TextureData.__wrap(ret);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
async function __wbg_load(module, imports) {
|
|
145
|
+
if (typeof Response === "function" && module instanceof Response) {
|
|
146
|
+
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
147
|
+
try {
|
|
148
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
149
|
+
} catch (e) {
|
|
150
|
+
if (module.headers.get("Content-Type") != "application/wasm") {
|
|
151
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
152
|
+
} else {
|
|
153
|
+
throw e;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const bytes = await module.arrayBuffer();
|
|
158
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
159
|
+
} else {
|
|
160
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
161
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
162
|
+
return { instance, module };
|
|
163
|
+
} else {
|
|
164
|
+
return instance;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function __wbg_get_imports() {
|
|
169
|
+
const imports = {};
|
|
170
|
+
imports.wbg = {};
|
|
171
|
+
imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
172
|
+
const ret = arg0.buffer;
|
|
173
|
+
return ret;
|
|
174
|
+
};
|
|
175
|
+
imports.wbg.__wbg_length_3b4f022188ae8db6 = function(arg0) {
|
|
176
|
+
const ret = arg0.length;
|
|
177
|
+
return ret;
|
|
178
|
+
};
|
|
179
|
+
imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
180
|
+
const ret = arg0.length;
|
|
181
|
+
return ret;
|
|
182
|
+
};
|
|
183
|
+
imports.wbg.__wbg_new_780abee5c1739fd7 = function(arg0) {
|
|
184
|
+
const ret = new Float32Array(arg0);
|
|
185
|
+
return ret;
|
|
186
|
+
};
|
|
187
|
+
imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
188
|
+
const ret = new Uint8Array(arg0);
|
|
189
|
+
return ret;
|
|
190
|
+
};
|
|
191
|
+
imports.wbg.__wbg_new_e3b321dcfef89fc7 = function(arg0) {
|
|
192
|
+
const ret = new Uint32Array(arg0);
|
|
193
|
+
return ret;
|
|
194
|
+
};
|
|
195
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212 = function(arg0, arg1, arg2) {
|
|
196
|
+
const ret = new Uint32Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
197
|
+
return ret;
|
|
198
|
+
};
|
|
199
|
+
imports.wbg.__wbg_set_10bad9bee0e9c58b = function(arg0, arg1, arg2) {
|
|
200
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
201
|
+
};
|
|
202
|
+
imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
203
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
204
|
+
};
|
|
205
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
206
|
+
const table = wasm.__wbindgen_export_0;
|
|
207
|
+
const offset = table.grow(4);
|
|
208
|
+
table.set(0, void 0);
|
|
209
|
+
table.set(offset + 0, void 0);
|
|
210
|
+
table.set(offset + 1, null);
|
|
211
|
+
table.set(offset + 2, true);
|
|
212
|
+
table.set(offset + 3, false);
|
|
213
|
+
;
|
|
214
|
+
};
|
|
215
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
216
|
+
const ret = wasm.memory;
|
|
217
|
+
return ret;
|
|
218
|
+
};
|
|
219
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
220
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
221
|
+
return ret;
|
|
222
|
+
};
|
|
223
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
224
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
225
|
+
};
|
|
226
|
+
return imports;
|
|
227
|
+
}
|
|
228
|
+
function __wbg_init_memory(imports, memory) {
|
|
229
|
+
}
|
|
230
|
+
function __wbg_finalize_init(instance, module) {
|
|
231
|
+
wasm = instance.exports;
|
|
232
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
233
|
+
cachedUint32ArrayMemory0 = null;
|
|
234
|
+
cachedUint8ArrayMemory0 = null;
|
|
235
|
+
wasm.__wbindgen_start();
|
|
236
|
+
return wasm;
|
|
237
|
+
}
|
|
238
|
+
function initSync(module) {
|
|
239
|
+
if (wasm !== void 0) return wasm;
|
|
240
|
+
if (typeof module !== "undefined") {
|
|
241
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
242
|
+
({ module } = module);
|
|
243
|
+
} else {
|
|
244
|
+
console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
const imports = __wbg_get_imports();
|
|
248
|
+
__wbg_init_memory(imports);
|
|
249
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
250
|
+
module = new WebAssembly.Module(module);
|
|
251
|
+
}
|
|
252
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
253
|
+
return __wbg_finalize_init(instance, module);
|
|
254
|
+
}
|
|
255
|
+
async function __wbg_init(module_or_path) {
|
|
256
|
+
if (wasm !== void 0) return wasm;
|
|
257
|
+
if (typeof module_or_path !== "undefined") {
|
|
258
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
259
|
+
({ module_or_path } = module_or_path);
|
|
260
|
+
} else {
|
|
261
|
+
console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (typeof module_or_path === "undefined") {
|
|
265
|
+
module_or_path = new URL("wasm_splats_bg.wasm", import.meta.url);
|
|
266
|
+
}
|
|
267
|
+
const imports = __wbg_get_imports();
|
|
268
|
+
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
|
|
269
|
+
module_or_path = fetch(module_or_path);
|
|
270
|
+
}
|
|
271
|
+
__wbg_init_memory(imports);
|
|
272
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
273
|
+
return __wbg_finalize_init(instance, module);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export {
|
|
277
|
+
generate_splat_texture,
|
|
278
|
+
radix_sort_gaussians_indexes,
|
|
279
|
+
initSync
|
|
280
|
+
};
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 1.141.3
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2011-2022 Cesium Contributors
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
9
|
+
* you may not use this file except in compliance with the License.
|
|
10
|
+
* You may obtain a copy of the License at
|
|
11
|
+
*
|
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
13
|
+
*
|
|
14
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
15
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
16
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
|
+
* See the License for the specific language governing permissions and
|
|
18
|
+
* limitations under the License.
|
|
19
|
+
*
|
|
20
|
+
* Columbus View (Pat. Pend.)
|
|
21
|
+
*
|
|
22
|
+
* Portions licensed separately.
|
|
23
|
+
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import {
|
|
27
|
+
IndexDatatype_default
|
|
28
|
+
} from "./chunk-XQVSSVT2.js";
|
|
29
|
+
import {
|
|
30
|
+
Math_default
|
|
31
|
+
} from "./chunk-KYXZ3XTC.js";
|
|
32
|
+
import {
|
|
33
|
+
DeveloperError_default
|
|
34
|
+
} from "./chunk-MVBEMXN4.js";
|
|
35
|
+
import {
|
|
36
|
+
defined_default
|
|
37
|
+
} from "./chunk-2RC5GQMH.js";
|
|
38
|
+
|
|
39
|
+
// packages/engine/Source/Core/TerrainProvider.js
|
|
40
|
+
function TerrainProvider() {
|
|
41
|
+
DeveloperError_default.throwInstantiationError();
|
|
42
|
+
}
|
|
43
|
+
Object.defineProperties(TerrainProvider.prototype, {
|
|
44
|
+
/**
|
|
45
|
+
* Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
|
|
46
|
+
* to the event, you will be notified of the error and can potentially recover from it. Event listeners
|
|
47
|
+
* are passed an instance of {@link TileProviderError}.
|
|
48
|
+
* @memberof TerrainProvider.prototype
|
|
49
|
+
* @type {Event<TerrainProvider.ErrorEvent>}
|
|
50
|
+
* @readonly
|
|
51
|
+
*/
|
|
52
|
+
errorEvent: {
|
|
53
|
+
get: DeveloperError_default.throwInstantiationError
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* Gets the credit to display when this terrain provider is active. Typically this is used to credit
|
|
57
|
+
* the source of the terrain.
|
|
58
|
+
* @memberof TerrainProvider.prototype
|
|
59
|
+
* @type {Credit}
|
|
60
|
+
* @readonly
|
|
61
|
+
*/
|
|
62
|
+
credit: {
|
|
63
|
+
get: DeveloperError_default.throwInstantiationError
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* Gets the tiling scheme used by the provider.
|
|
67
|
+
* @memberof TerrainProvider.prototype
|
|
68
|
+
* @type {TilingScheme}
|
|
69
|
+
* @readonly
|
|
70
|
+
*/
|
|
71
|
+
tilingScheme: {
|
|
72
|
+
get: DeveloperError_default.throwInstantiationError
|
|
73
|
+
},
|
|
74
|
+
/**
|
|
75
|
+
* Gets a value indicating whether or not the provider includes a water mask. The water mask
|
|
76
|
+
* indicates which areas of the globe are water rather than land, so they can be rendered
|
|
77
|
+
* as a reflective surface with animated waves.
|
|
78
|
+
* @memberof TerrainProvider.prototype
|
|
79
|
+
* @type {boolean}
|
|
80
|
+
* @readonly
|
|
81
|
+
*/
|
|
82
|
+
hasWaterMask: {
|
|
83
|
+
get: DeveloperError_default.throwInstantiationError
|
|
84
|
+
},
|
|
85
|
+
/**
|
|
86
|
+
* Gets a value indicating whether or not the requested tiles include vertex normals.
|
|
87
|
+
* @memberof TerrainProvider.prototype
|
|
88
|
+
* @type {boolean}
|
|
89
|
+
* @readonly
|
|
90
|
+
*/
|
|
91
|
+
hasVertexNormals: {
|
|
92
|
+
get: DeveloperError_default.throwInstantiationError
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* Gets an object that can be used to determine availability of terrain from this provider, such as
|
|
96
|
+
* at points and in rectangles. This property may be undefined if availability
|
|
97
|
+
* information is not available.
|
|
98
|
+
* @memberof TerrainProvider.prototype
|
|
99
|
+
* @type {TileAvailability|undefined}
|
|
100
|
+
* @readonly
|
|
101
|
+
*/
|
|
102
|
+
availability: {
|
|
103
|
+
get: DeveloperError_default.throwInstantiationError
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
var regularGridIndicesCache = [];
|
|
107
|
+
TerrainProvider.getRegularGridIndices = function(width, height) {
|
|
108
|
+
if (width * height >= Math_default.FOUR_GIGABYTES) {
|
|
109
|
+
throw new DeveloperError_default(
|
|
110
|
+
"The total number of vertices (width * height) must be less than 4,294,967,296."
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
let byWidth = regularGridIndicesCache[width];
|
|
114
|
+
if (!defined_default(byWidth)) {
|
|
115
|
+
regularGridIndicesCache[width] = byWidth = [];
|
|
116
|
+
}
|
|
117
|
+
let indices = byWidth[height];
|
|
118
|
+
if (!defined_default(indices)) {
|
|
119
|
+
if (width * height < Math_default.SIXTY_FOUR_KILOBYTES) {
|
|
120
|
+
indices = byWidth[height] = new Uint16Array(
|
|
121
|
+
(width - 1) * (height - 1) * 6
|
|
122
|
+
);
|
|
123
|
+
} else {
|
|
124
|
+
indices = byWidth[height] = new Uint32Array(
|
|
125
|
+
(width - 1) * (height - 1) * 6
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
addRegularGridIndices(width, height, indices, 0);
|
|
129
|
+
}
|
|
130
|
+
return indices;
|
|
131
|
+
};
|
|
132
|
+
var regularGridAndEdgeIndicesCache = [];
|
|
133
|
+
TerrainProvider.getRegularGridIndicesAndEdgeIndices = function(width, height) {
|
|
134
|
+
if (width * height >= Math_default.FOUR_GIGABYTES) {
|
|
135
|
+
throw new DeveloperError_default(
|
|
136
|
+
"The total number of vertices (width * height) must be less than 4,294,967,296."
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
let byWidth = regularGridAndEdgeIndicesCache[width];
|
|
140
|
+
if (!defined_default(byWidth)) {
|
|
141
|
+
regularGridAndEdgeIndicesCache[width] = byWidth = [];
|
|
142
|
+
}
|
|
143
|
+
let indicesAndEdges = byWidth[height];
|
|
144
|
+
if (!defined_default(indicesAndEdges)) {
|
|
145
|
+
const indices = TerrainProvider.getRegularGridIndices(width, height);
|
|
146
|
+
const edgeIndices = getEdgeIndices(width, height);
|
|
147
|
+
const westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth;
|
|
148
|
+
const southIndicesEastToWest = edgeIndices.southIndicesEastToWest;
|
|
149
|
+
const eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth;
|
|
150
|
+
const northIndicesWestToEast = edgeIndices.northIndicesWestToEast;
|
|
151
|
+
indicesAndEdges = byWidth[height] = {
|
|
152
|
+
indices,
|
|
153
|
+
westIndicesSouthToNorth,
|
|
154
|
+
southIndicesEastToWest,
|
|
155
|
+
eastIndicesNorthToSouth,
|
|
156
|
+
northIndicesWestToEast
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
return indicesAndEdges;
|
|
160
|
+
};
|
|
161
|
+
var regularGridAndSkirtAndEdgeIndicesCache = [];
|
|
162
|
+
TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices = function(width, height) {
|
|
163
|
+
if (width * height >= Math_default.FOUR_GIGABYTES) {
|
|
164
|
+
throw new DeveloperError_default(
|
|
165
|
+
"The total number of vertices (width * height) must be less than 4,294,967,296."
|
|
166
|
+
);
|
|
167
|
+
}
|
|
168
|
+
let byWidth = regularGridAndSkirtAndEdgeIndicesCache[width];
|
|
169
|
+
if (!defined_default(byWidth)) {
|
|
170
|
+
regularGridAndSkirtAndEdgeIndicesCache[width] = byWidth = [];
|
|
171
|
+
}
|
|
172
|
+
let indicesAndEdges = byWidth[height];
|
|
173
|
+
if (!defined_default(indicesAndEdges)) {
|
|
174
|
+
const gridVertexCount = width * height;
|
|
175
|
+
const gridIndexCount = (width - 1) * (height - 1) * 6;
|
|
176
|
+
const edgeVertexCount = width * 2 + height * 2;
|
|
177
|
+
const edgeIndexCount = Math.max(0, edgeVertexCount - 4) * 6;
|
|
178
|
+
const vertexCount = gridVertexCount + edgeVertexCount;
|
|
179
|
+
const indexCount = gridIndexCount + edgeIndexCount;
|
|
180
|
+
const edgeIndices = getEdgeIndices(width, height);
|
|
181
|
+
const westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth;
|
|
182
|
+
const southIndicesEastToWest = edgeIndices.southIndicesEastToWest;
|
|
183
|
+
const eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth;
|
|
184
|
+
const northIndicesWestToEast = edgeIndices.northIndicesWestToEast;
|
|
185
|
+
const indices = IndexDatatype_default.createTypedArray(vertexCount, indexCount);
|
|
186
|
+
addRegularGridIndices(width, height, indices, 0);
|
|
187
|
+
TerrainProvider.addSkirtIndices(
|
|
188
|
+
westIndicesSouthToNorth,
|
|
189
|
+
southIndicesEastToWest,
|
|
190
|
+
eastIndicesNorthToSouth,
|
|
191
|
+
northIndicesWestToEast,
|
|
192
|
+
gridVertexCount,
|
|
193
|
+
indices,
|
|
194
|
+
gridIndexCount
|
|
195
|
+
);
|
|
196
|
+
indicesAndEdges = byWidth[height] = {
|
|
197
|
+
indices,
|
|
198
|
+
westIndicesSouthToNorth,
|
|
199
|
+
southIndicesEastToWest,
|
|
200
|
+
eastIndicesNorthToSouth,
|
|
201
|
+
northIndicesWestToEast,
|
|
202
|
+
indexCountWithoutSkirts: gridIndexCount
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
return indicesAndEdges;
|
|
206
|
+
};
|
|
207
|
+
TerrainProvider.getSkirtVertexCount = function(westIndicesSouthToNorth, southIndicesEastToWest, eastIndicesNorthToSouth, northIndicesWestToEast) {
|
|
208
|
+
return westIndicesSouthToNorth.length + southIndicesEastToWest.length + eastIndicesNorthToSouth.length + northIndicesWestToEast.length;
|
|
209
|
+
};
|
|
210
|
+
TerrainProvider.getSkirtIndexCount = function(skirtVertexCount) {
|
|
211
|
+
return (skirtVertexCount - 4) * 2 * 3;
|
|
212
|
+
};
|
|
213
|
+
TerrainProvider.getSkirtIndexCountWithFilledCorners = function(skirtVertexCount) {
|
|
214
|
+
return ((skirtVertexCount - 4) * 2 + 4) * 3;
|
|
215
|
+
};
|
|
216
|
+
TerrainProvider.addSkirtIndices = function(westIndicesSouthToNorth, southIndicesEastToWest, eastIndicesNorthToSouth, northIndicesWestToEast, vertexCount, indices, offset) {
|
|
217
|
+
let vertexIndex = vertexCount;
|
|
218
|
+
offset = addSkirtIndices(
|
|
219
|
+
westIndicesSouthToNorth,
|
|
220
|
+
vertexIndex,
|
|
221
|
+
indices,
|
|
222
|
+
offset
|
|
223
|
+
);
|
|
224
|
+
vertexIndex += westIndicesSouthToNorth.length;
|
|
225
|
+
offset = addSkirtIndices(
|
|
226
|
+
southIndicesEastToWest,
|
|
227
|
+
vertexIndex,
|
|
228
|
+
indices,
|
|
229
|
+
offset
|
|
230
|
+
);
|
|
231
|
+
vertexIndex += southIndicesEastToWest.length;
|
|
232
|
+
offset = addSkirtIndices(
|
|
233
|
+
eastIndicesNorthToSouth,
|
|
234
|
+
vertexIndex,
|
|
235
|
+
indices,
|
|
236
|
+
offset
|
|
237
|
+
);
|
|
238
|
+
vertexIndex += eastIndicesNorthToSouth.length;
|
|
239
|
+
addSkirtIndices(northIndicesWestToEast, vertexIndex, indices, offset);
|
|
240
|
+
};
|
|
241
|
+
TerrainProvider.addSkirtIndicesWithFilledCorners = function(westIndicesSouthToNorth, southIndicesEastToWest, eastIndicesNorthToSouth, northIndicesWestToEast, vertexCount, indices, offset) {
|
|
242
|
+
TerrainProvider.addSkirtIndices(
|
|
243
|
+
westIndicesSouthToNorth,
|
|
244
|
+
southIndicesEastToWest,
|
|
245
|
+
eastIndicesNorthToSouth,
|
|
246
|
+
northIndicesWestToEast,
|
|
247
|
+
vertexCount,
|
|
248
|
+
indices,
|
|
249
|
+
offset
|
|
250
|
+
);
|
|
251
|
+
const skirtVertexCount = TerrainProvider.getSkirtVertexCount(
|
|
252
|
+
westIndicesSouthToNorth,
|
|
253
|
+
southIndicesEastToWest,
|
|
254
|
+
eastIndicesNorthToSouth,
|
|
255
|
+
northIndicesWestToEast
|
|
256
|
+
);
|
|
257
|
+
const skirtIndexCountWithoutCaps = TerrainProvider.getSkirtIndexCount(skirtVertexCount);
|
|
258
|
+
const cornerStartIdx = offset + skirtIndexCountWithoutCaps;
|
|
259
|
+
const cornerSWIndex = westIndicesSouthToNorth[0];
|
|
260
|
+
const cornerNWIndex = northIndicesWestToEast[0];
|
|
261
|
+
const cornerNEIndex = eastIndicesNorthToSouth[0];
|
|
262
|
+
const cornerSEIndex = southIndicesEastToWest[0];
|
|
263
|
+
const westSouthIndex = vertexCount;
|
|
264
|
+
const westNorthIndex = westSouthIndex + westIndicesSouthToNorth.length - 1;
|
|
265
|
+
const southEastIndex = westNorthIndex + 1;
|
|
266
|
+
const southWestIndex = southEastIndex + southIndicesEastToWest.length - 1;
|
|
267
|
+
const eastNorthIndex = southWestIndex + 1;
|
|
268
|
+
const eastSouthIndex = eastNorthIndex + eastIndicesNorthToSouth.length - 1;
|
|
269
|
+
const northWestIndex = eastSouthIndex + 1;
|
|
270
|
+
const northEastIndex = northWestIndex + northIndicesWestToEast.length - 1;
|
|
271
|
+
indices[cornerStartIdx + 0] = cornerSWIndex;
|
|
272
|
+
indices[cornerStartIdx + 1] = westSouthIndex;
|
|
273
|
+
indices[cornerStartIdx + 2] = southWestIndex;
|
|
274
|
+
indices[cornerStartIdx + 3] = cornerSEIndex;
|
|
275
|
+
indices[cornerStartIdx + 4] = southEastIndex;
|
|
276
|
+
indices[cornerStartIdx + 5] = eastSouthIndex;
|
|
277
|
+
indices[cornerStartIdx + 6] = cornerNEIndex;
|
|
278
|
+
indices[cornerStartIdx + 7] = eastNorthIndex;
|
|
279
|
+
indices[cornerStartIdx + 8] = northEastIndex;
|
|
280
|
+
indices[cornerStartIdx + 9] = cornerNWIndex;
|
|
281
|
+
indices[cornerStartIdx + 10] = northWestIndex;
|
|
282
|
+
indices[cornerStartIdx + 11] = westNorthIndex;
|
|
283
|
+
};
|
|
284
|
+
function getEdgeIndices(width, height) {
|
|
285
|
+
const westIndicesSouthToNorth = new Array(height);
|
|
286
|
+
const southIndicesEastToWest = new Array(width);
|
|
287
|
+
const eastIndicesNorthToSouth = new Array(height);
|
|
288
|
+
const northIndicesWestToEast = new Array(width);
|
|
289
|
+
let i;
|
|
290
|
+
for (i = 0; i < width; ++i) {
|
|
291
|
+
northIndicesWestToEast[i] = i;
|
|
292
|
+
southIndicesEastToWest[i] = width * height - 1 - i;
|
|
293
|
+
}
|
|
294
|
+
for (i = 0; i < height; ++i) {
|
|
295
|
+
eastIndicesNorthToSouth[i] = (i + 1) * width - 1;
|
|
296
|
+
westIndicesSouthToNorth[i] = (height - i - 1) * width;
|
|
297
|
+
}
|
|
298
|
+
return {
|
|
299
|
+
westIndicesSouthToNorth,
|
|
300
|
+
southIndicesEastToWest,
|
|
301
|
+
eastIndicesNorthToSouth,
|
|
302
|
+
northIndicesWestToEast
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
function addRegularGridIndices(width, height, indices, offset) {
|
|
306
|
+
let index = 0;
|
|
307
|
+
for (let j = 0; j < height - 1; ++j) {
|
|
308
|
+
for (let i = 0; i < width - 1; ++i) {
|
|
309
|
+
const upperLeft = index;
|
|
310
|
+
const lowerLeft = upperLeft + width;
|
|
311
|
+
const lowerRight = lowerLeft + 1;
|
|
312
|
+
const upperRight = upperLeft + 1;
|
|
313
|
+
indices[offset++] = upperLeft;
|
|
314
|
+
indices[offset++] = lowerLeft;
|
|
315
|
+
indices[offset++] = upperRight;
|
|
316
|
+
indices[offset++] = upperRight;
|
|
317
|
+
indices[offset++] = lowerLeft;
|
|
318
|
+
indices[offset++] = lowerRight;
|
|
319
|
+
++index;
|
|
320
|
+
}
|
|
321
|
+
++index;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
function addSkirtIndices(edgeIndices, vertexIndex, indices, offset) {
|
|
325
|
+
let previousIndex = edgeIndices[0];
|
|
326
|
+
const length = edgeIndices.length;
|
|
327
|
+
for (let i = 1; i < length; ++i) {
|
|
328
|
+
const index = edgeIndices[i];
|
|
329
|
+
indices[offset++] = previousIndex;
|
|
330
|
+
indices[offset++] = index;
|
|
331
|
+
indices[offset++] = vertexIndex;
|
|
332
|
+
indices[offset++] = vertexIndex;
|
|
333
|
+
indices[offset++] = index;
|
|
334
|
+
indices[offset++] = vertexIndex + 1;
|
|
335
|
+
previousIndex = index;
|
|
336
|
+
++vertexIndex;
|
|
337
|
+
}
|
|
338
|
+
return offset;
|
|
339
|
+
}
|
|
340
|
+
TerrainProvider.heightmapTerrainQuality = 0.25;
|
|
341
|
+
TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap = function(ellipsoid, tileImageWidth, numberOfTilesAtLevelZero) {
|
|
342
|
+
return ellipsoid.maximumRadius * 2 * Math.PI * TerrainProvider.heightmapTerrainQuality / (tileImageWidth * numberOfTilesAtLevelZero);
|
|
343
|
+
};
|
|
344
|
+
TerrainProvider.prototype.requestTileGeometry = DeveloperError_default.throwInstantiationError;
|
|
345
|
+
TerrainProvider.prototype.getLevelMaximumGeometricError = DeveloperError_default.throwInstantiationError;
|
|
346
|
+
TerrainProvider.prototype.getTileDataAvailable = DeveloperError_default.throwInstantiationError;
|
|
347
|
+
TerrainProvider.prototype.loadTileDataAvailability = DeveloperError_default.throwInstantiationError;
|
|
348
|
+
var TerrainProvider_default = TerrainProvider;
|
|
349
|
+
|
|
350
|
+
export {
|
|
351
|
+
TerrainProvider_default
|
|
352
|
+
};
|