@rtzh/engine 0.0.3 → 0.0.4
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 +640 -0
- package/Build/Workers/chunk-245NZYCR.js +124 -0
- package/Build/Workers/chunk-25BA4527.js +837 -0
- package/Build/Workers/chunk-2APW7KRS.js +101 -0
- package/Build/Workers/chunk-2BLQ3B4Q.js +299 -0
- package/Build/Workers/chunk-2CAIFJD5.js +387 -0
- package/Build/Workers/chunk-3K2PK2OU.js +1045 -0
- package/Build/Workers/chunk-3M5CRHSG.js +288 -0
- package/Build/Workers/chunk-4HXPSZRC.js +1483 -0
- package/Build/Workers/chunk-4Z26IS65.js +3514 -0
- package/Build/Workers/chunk-55IROWAX.js +139 -0
- package/Build/Workers/chunk-56XTN5NJ.js +1800 -0
- package/Build/Workers/chunk-5BIQOSBV.js +55 -0
- package/Build/Workers/chunk-5CSRWY7L.js +280 -0
- package/Build/Workers/chunk-5QTPACZQ.js +455 -0
- package/Build/Workers/chunk-5VZISKJF.js +629 -0
- package/Build/Workers/chunk-5WAG5YKS.js +368 -0
- package/Build/Workers/chunk-64W2RXA4.js +219 -0
- package/Build/Workers/chunk-66YGZWBI.js +1317 -0
- package/Build/Workers/chunk-6H33B6OL.js +37 -0
- package/Build/Workers/chunk-6LZBBEA7.js +439 -0
- package/Build/Workers/chunk-6QVMKRJ4.js +3514 -0
- package/Build/Workers/chunk-6XJO625E.js +497 -0
- package/Build/Workers/chunk-75UGCVME.js +102 -0
- package/Build/Workers/chunk-7B23DD46.js +1054 -0
- package/Build/Workers/chunk-7NCJH26L.js +352 -0
- package/Build/Workers/chunk-ACH67MPW.js +1483 -0
- package/Build/Workers/chunk-AIW5F22O.js +352 -0
- package/Build/Workers/chunk-AL22JVIA.js +256 -0
- package/Build/Workers/chunk-AVSQILVI.js +75 -0
- package/Build/Workers/chunk-B2VFNYD7.js +280 -0
- package/Build/Workers/chunk-BJ6WXQOW.js +305 -0
- package/Build/Workers/chunk-BN4WA7LX.js +75 -0
- package/Build/Workers/chunk-BOV6T7FO.js +44 -0
- package/Build/Workers/chunk-BXBGWQ3Z.js +171 -0
- package/Build/Workers/chunk-D7TGILR3.js +1054 -0
- package/Build/Workers/chunk-DBKYAGM6.js +1800 -0
- package/Build/Workers/chunk-DEIMB3B5.js +629 -0
- package/Build/Workers/chunk-DP76S3IQ.js +1067 -0
- package/Build/Workers/chunk-DSBEWMOQ.js +1067 -0
- package/Build/Workers/chunk-E2CARZA7.js +73 -0
- package/Build/Workers/chunk-EDIUN7V3.js +219 -0
- package/Build/Workers/chunk-EISI2CR2.js +2058 -0
- package/Build/Workers/chunk-EKMWNF4U.js +55 -0
- package/Build/Workers/chunk-ELXGXAYS.js +682 -0
- package/Build/Workers/chunk-F5LAPCFC.js +1460 -0
- package/Build/Workers/chunk-FJREGHFG.js +138 -0
- package/Build/Workers/chunk-FVYRV2T6.js +455 -0
- package/Build/Workers/chunk-GDIBU55R.js +778 -0
- package/Build/Workers/chunk-HAWJ7FMN.js +8366 -0
- package/Build/Workers/chunk-HAY6YE7M.js +97 -0
- package/Build/Workers/chunk-HGIGANIQ.js +163 -0
- package/Build/Workers/chunk-HI6X33GO.js +58 -0
- package/Build/Workers/chunk-HU5P7PMU.js +1317 -0
- package/Build/Workers/chunk-I76SRIKN.js +138 -0
- package/Build/Workers/chunk-IDVURFRN.js +241 -0
- package/Build/Workers/chunk-IELTSYPZ.js +241 -0
- package/Build/Workers/chunk-J3FBVUY4.js +37 -0
- package/Build/Workers/chunk-J4MIJCN5.js +171 -0
- package/Build/Workers/chunk-JFO3ELF3.js +642 -0
- package/Build/Workers/chunk-JH27ZGLN.js +352 -0
- package/Build/Workers/chunk-JURLMTV2.js +398 -0
- package/Build/Workers/chunk-K4IMD7KH.js +162 -0
- package/Build/Workers/chunk-KBAGFNQ4.js +139 -0
- package/Build/Workers/chunk-KFMCOG26.js +692 -0
- package/Build/Workers/chunk-KH2OWUUA.js +163 -0
- package/Build/Workers/chunk-KHKSE4WQ.js +778 -0
- package/Build/Workers/chunk-KKYQRQ57.js +368 -0
- package/Build/Workers/chunk-KQIZ7AFF.js +8366 -0
- package/Build/Workers/chunk-KUAWPGSB.js +511 -0
- package/Build/Workers/chunk-KVDSJXRK.js +114 -0
- package/Build/Workers/chunk-KVE5EAPO.js +398 -0
- package/Build/Workers/chunk-KXB3AARU.js +162 -0
- package/Build/Workers/chunk-LN4NMLYY.js +55 -0
- package/Build/Workers/chunk-LPM2FVDN.js +642 -0
- package/Build/Workers/chunk-MLFVICFZ.js +102 -0
- package/Build/Workers/chunk-MQ62ZE2U.js +124 -0
- package/Build/Workers/chunk-NOH3R3YY.js +198 -0
- package/Build/Workers/chunk-OAOREOSO.js +940 -0
- package/Build/Workers/chunk-OFJRMGNX.js +788 -0
- package/Build/Workers/chunk-OOB2KZC6.js +476 -0
- package/Build/Workers/chunk-OVPPHDU7.js +97 -0
- package/Build/Workers/chunk-P7M4VYFT.js +788 -0
- package/Build/Workers/chunk-PHB5MRHM.js +439 -0
- package/Build/Workers/chunk-PLLZB3R4.js +198 -0
- package/Build/Workers/chunk-POY6ZE32.js +2058 -0
- package/Build/Workers/chunk-PV5B2YNB.js +2719 -0
- package/Build/Workers/chunk-Q2DXNFYW.js +414 -0
- package/Build/Workers/chunk-QWV2DM66.js +1443 -0
- package/Build/Workers/chunk-R73BHGGI.js +305 -0
- package/Build/Workers/chunk-S3AE3MZZ.js +511 -0
- package/Build/Workers/chunk-SBFTVHRW.js +57 -0
- package/Build/Workers/chunk-SOR7PD4V.js +114 -0
- package/Build/Workers/chunk-TDI7UQBO.js +57 -0
- package/Build/Workers/chunk-TO7TWUET.js +476 -0
- package/Build/Workers/chunk-TSAJNE4K.js +101 -0
- package/Build/Workers/chunk-TWF4XRZ6.js +73 -0
- package/Build/Workers/chunk-U364CIW4.js +682 -0
- package/Build/Workers/chunk-UOD5YNH3.js +940 -0
- package/Build/Workers/chunk-UTWLMOPM.js +387 -0
- package/Build/Workers/chunk-UUJXSLQ2.js +2719 -0
- package/Build/Workers/chunk-UYT2PBMV.js +58 -0
- package/Build/Workers/chunk-VIYQ56Z7.js +837 -0
- package/Build/Workers/chunk-VR2L2Y4Z.js +1443 -0
- package/Build/Workers/chunk-WAS3IHIQ.js +288 -0
- package/Build/Workers/chunk-WLREXLZ7.js +414 -0
- package/Build/Workers/chunk-WMGESUDW.js +497 -0
- package/Build/Workers/chunk-WO5ZNC7S.js +1045 -0
- package/Build/Workers/chunk-X65Y2JSA.js +55 -0
- package/Build/Workers/chunk-XJKMLTSH.js +692 -0
- package/Build/Workers/chunk-XOVHLPKW.js +299 -0
- package/Build/Workers/chunk-YBVMSCW4.js +352 -0
- package/Build/Workers/chunk-YPGJSFOO.js +1460 -0
- package/Build/Workers/chunk-Z356SW7E.js +256 -0
- package/Build/Workers/chunk-ZV42SJKS.js +44 -0
- package/Build/Workers/combineGeometry.js +66 -0
- package/Build/Workers/createBoxGeometry.js +58 -0
- package/Build/Workers/createBoxOutlineGeometry.js +231 -0
- package/Build/Workers/createCircleGeometry.js +201 -0
- package/Build/Workers/createCircleOutlineGeometry.js +147 -0
- package/Build/Workers/createCoplanarPolygonGeometry.js +505 -0
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +225 -0
- package/Build/Workers/createCorridorGeometry.js +1258 -0
- package/Build/Workers/createCorridorOutlineGeometry.js +563 -0
- package/Build/Workers/createCylinderGeometry.js +60 -0
- package/Build/Workers/createCylinderOutlineGeometry.js +231 -0
- package/Build/Workers/createEllipseGeometry.js +72 -0
- package/Build/Workers/createEllipseOutlineGeometry.js +65 -0
- package/Build/Workers/createEllipsoidGeometry.js +59 -0
- package/Build/Workers/createEllipsoidOutlineGeometry.js +61 -0
- package/Build/Workers/createFrustumGeometry.js +58 -0
- package/Build/Workers/createFrustumOutlineGeometry.js +234 -0
- package/Build/Workers/createGeometry.js +173 -0
- package/Build/Workers/createGroundPolylineGeometry.js +1602 -0
- package/Build/Workers/createPlaneGeometry.js +223 -0
- package/Build/Workers/createPlaneOutlineGeometry.js +124 -0
- package/Build/Workers/createPolygonGeometry.js +1404 -0
- package/Build/Workers/createPolygonOutlineGeometry.js +532 -0
- package/Build/Workers/createPolylineGeometry.js +491 -0
- package/Build/Workers/createPolylineVolumeGeometry.js +374 -0
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +272 -0
- package/Build/Workers/createRectangleGeometry.js +1264 -0
- package/Build/Workers/createRectangleOutlineGeometry.js +476 -0
- package/Build/Workers/createSimplePolylineGeometry.js +397 -0
- package/Build/Workers/createSphereGeometry.js +116 -0
- package/Build/Workers/createSphereOutlineGeometry.js +116 -0
- package/Build/Workers/createTaskProcessorWorker.js +32 -0
- package/Build/Workers/createVectorTileClampedPolylines.js +492 -0
- package/Build/Workers/createVectorTileGeometries.js +387 -0
- package/Build/Workers/createVectorTilePoints.js +114 -0
- package/Build/Workers/createVectorTilePolygons.js +386 -0
- package/Build/Workers/createVectorTilePolylines.js +262 -0
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +91 -0
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +565 -0
- package/Build/Workers/createVerticesFromHeightmap.js +2254 -0
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +499 -0
- package/Build/Workers/createWallGeometry.js +487 -0
- package/Build/Workers/createWallOutlineGeometry.js +335 -0
- package/Build/Workers/decodeDraco.js +369 -0
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +2680 -0
- package/Build/Workers/decodeI3S.js +1339 -0
- package/Build/Workers/gaussianSplatSorter.js +62 -0
- package/Build/Workers/gaussianSplatTextureGenerator.js +68 -0
- package/Build/Workers/incrementallyBuildTerrainPicker.js +121 -0
- package/Build/Workers/transcodeKTX2.js +3463 -0
- package/Build/Workers/transferTypedArrayTest.js +41 -0
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +820 -0
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +95 -0
- package/Source/Scene/GltfLoader.js +2 -2
- package/Source/Scene/Model/I3dmLoader.js +2 -2
- package/index.js +110 -110
- package/package.json +1 -1
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 0.0.4
|
|
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
|
+
RectangleGeometryLibrary_default
|
|
28
|
+
} from "./chunk-IDVURFRN.js";
|
|
29
|
+
import {
|
|
30
|
+
GeometryOffsetAttribute_default
|
|
31
|
+
} from "./chunk-J3FBVUY4.js";
|
|
32
|
+
import {
|
|
33
|
+
PolygonPipeline_default
|
|
34
|
+
} from "./chunk-3K2PK2OU.js";
|
|
35
|
+
import "./chunk-5QTPACZQ.js";
|
|
36
|
+
import {
|
|
37
|
+
IndexDatatype_default
|
|
38
|
+
} from "./chunk-KBAGFNQ4.js";
|
|
39
|
+
import {
|
|
40
|
+
GeometryAttributes_default
|
|
41
|
+
} from "./chunk-ZV42SJKS.js";
|
|
42
|
+
import {
|
|
43
|
+
GeometryAttribute_default,
|
|
44
|
+
Geometry_default,
|
|
45
|
+
PrimitiveType_default
|
|
46
|
+
} from "./chunk-2BLQ3B4Q.js";
|
|
47
|
+
import {
|
|
48
|
+
BoundingSphere_default
|
|
49
|
+
} from "./chunk-UOD5YNH3.js";
|
|
50
|
+
import "./chunk-5BIQOSBV.js";
|
|
51
|
+
import {
|
|
52
|
+
Rectangle_default
|
|
53
|
+
} from "./chunk-HAWJ7FMN.js";
|
|
54
|
+
import "./chunk-EISI2CR2.js";
|
|
55
|
+
import {
|
|
56
|
+
ComponentDatatype_default
|
|
57
|
+
} from "./chunk-Z356SW7E.js";
|
|
58
|
+
import "./chunk-DEIMB3B5.js";
|
|
59
|
+
import "./chunk-HI6X33GO.js";
|
|
60
|
+
import {
|
|
61
|
+
Cartographic_default,
|
|
62
|
+
Ellipsoid_default
|
|
63
|
+
} from "./chunk-F5LAPCFC.js";
|
|
64
|
+
import {
|
|
65
|
+
Cartesian3_default,
|
|
66
|
+
Frozen_default
|
|
67
|
+
} from "./chunk-VR2L2Y4Z.js";
|
|
68
|
+
import {
|
|
69
|
+
Math_default
|
|
70
|
+
} from "./chunk-WMGESUDW.js";
|
|
71
|
+
import {
|
|
72
|
+
DeveloperError_default
|
|
73
|
+
} from "./chunk-HGIGANIQ.js";
|
|
74
|
+
import {
|
|
75
|
+
defined_default
|
|
76
|
+
} from "./chunk-BN4WA7LX.js";
|
|
77
|
+
|
|
78
|
+
// packages/engine/Source/Core/RectangleOutlineGeometry.js
|
|
79
|
+
var bottomBoundingSphere = new BoundingSphere_default();
|
|
80
|
+
var topBoundingSphere = new BoundingSphere_default();
|
|
81
|
+
var positionScratch = new Cartesian3_default();
|
|
82
|
+
var rectangleScratch = new Rectangle_default();
|
|
83
|
+
function constructRectangle(geometry, computedOptions) {
|
|
84
|
+
const ellipsoid = geometry._ellipsoid;
|
|
85
|
+
const height = computedOptions.height;
|
|
86
|
+
const width = computedOptions.width;
|
|
87
|
+
const northCap = computedOptions.northCap;
|
|
88
|
+
const southCap = computedOptions.southCap;
|
|
89
|
+
let rowHeight = height;
|
|
90
|
+
let widthMultiplier = 2;
|
|
91
|
+
let size = 0;
|
|
92
|
+
let corners = 4;
|
|
93
|
+
if (northCap) {
|
|
94
|
+
widthMultiplier -= 1;
|
|
95
|
+
rowHeight -= 1;
|
|
96
|
+
size += 1;
|
|
97
|
+
corners -= 2;
|
|
98
|
+
}
|
|
99
|
+
if (southCap) {
|
|
100
|
+
widthMultiplier -= 1;
|
|
101
|
+
rowHeight -= 1;
|
|
102
|
+
size += 1;
|
|
103
|
+
corners -= 2;
|
|
104
|
+
}
|
|
105
|
+
size += widthMultiplier * width + 2 * rowHeight - corners;
|
|
106
|
+
const positions = new Float64Array(size * 3);
|
|
107
|
+
let posIndex = 0;
|
|
108
|
+
let row = 0;
|
|
109
|
+
let col;
|
|
110
|
+
const position = positionScratch;
|
|
111
|
+
if (northCap) {
|
|
112
|
+
RectangleGeometryLibrary_default.computePosition(
|
|
113
|
+
computedOptions,
|
|
114
|
+
ellipsoid,
|
|
115
|
+
false,
|
|
116
|
+
row,
|
|
117
|
+
0,
|
|
118
|
+
position
|
|
119
|
+
);
|
|
120
|
+
positions[posIndex++] = position.x;
|
|
121
|
+
positions[posIndex++] = position.y;
|
|
122
|
+
positions[posIndex++] = position.z;
|
|
123
|
+
} else {
|
|
124
|
+
for (col = 0; col < width; col++) {
|
|
125
|
+
RectangleGeometryLibrary_default.computePosition(
|
|
126
|
+
computedOptions,
|
|
127
|
+
ellipsoid,
|
|
128
|
+
false,
|
|
129
|
+
row,
|
|
130
|
+
col,
|
|
131
|
+
position
|
|
132
|
+
);
|
|
133
|
+
positions[posIndex++] = position.x;
|
|
134
|
+
positions[posIndex++] = position.y;
|
|
135
|
+
positions[posIndex++] = position.z;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
col = width - 1;
|
|
139
|
+
for (row = 1; row < height; row++) {
|
|
140
|
+
RectangleGeometryLibrary_default.computePosition(
|
|
141
|
+
computedOptions,
|
|
142
|
+
ellipsoid,
|
|
143
|
+
false,
|
|
144
|
+
row,
|
|
145
|
+
col,
|
|
146
|
+
position
|
|
147
|
+
);
|
|
148
|
+
positions[posIndex++] = position.x;
|
|
149
|
+
positions[posIndex++] = position.y;
|
|
150
|
+
positions[posIndex++] = position.z;
|
|
151
|
+
}
|
|
152
|
+
row = height - 1;
|
|
153
|
+
if (!southCap) {
|
|
154
|
+
for (col = width - 2; col >= 0; col--) {
|
|
155
|
+
RectangleGeometryLibrary_default.computePosition(
|
|
156
|
+
computedOptions,
|
|
157
|
+
ellipsoid,
|
|
158
|
+
false,
|
|
159
|
+
row,
|
|
160
|
+
col,
|
|
161
|
+
position
|
|
162
|
+
);
|
|
163
|
+
positions[posIndex++] = position.x;
|
|
164
|
+
positions[posIndex++] = position.y;
|
|
165
|
+
positions[posIndex++] = position.z;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
col = 0;
|
|
169
|
+
for (row = height - 2; row > 0; row--) {
|
|
170
|
+
RectangleGeometryLibrary_default.computePosition(
|
|
171
|
+
computedOptions,
|
|
172
|
+
ellipsoid,
|
|
173
|
+
false,
|
|
174
|
+
row,
|
|
175
|
+
col,
|
|
176
|
+
position
|
|
177
|
+
);
|
|
178
|
+
positions[posIndex++] = position.x;
|
|
179
|
+
positions[posIndex++] = position.y;
|
|
180
|
+
positions[posIndex++] = position.z;
|
|
181
|
+
}
|
|
182
|
+
const indicesSize = positions.length / 3 * 2;
|
|
183
|
+
const indices = IndexDatatype_default.createTypedArray(
|
|
184
|
+
positions.length / 3,
|
|
185
|
+
indicesSize
|
|
186
|
+
);
|
|
187
|
+
let index = 0;
|
|
188
|
+
for (let i = 0; i < positions.length / 3 - 1; i++) {
|
|
189
|
+
indices[index++] = i;
|
|
190
|
+
indices[index++] = i + 1;
|
|
191
|
+
}
|
|
192
|
+
indices[index++] = positions.length / 3 - 1;
|
|
193
|
+
indices[index++] = 0;
|
|
194
|
+
const geo = new Geometry_default({
|
|
195
|
+
attributes: new GeometryAttributes_default(),
|
|
196
|
+
primitiveType: PrimitiveType_default.LINES
|
|
197
|
+
});
|
|
198
|
+
geo.attributes.position = new GeometryAttribute_default({
|
|
199
|
+
componentDatatype: ComponentDatatype_default.DOUBLE,
|
|
200
|
+
componentsPerAttribute: 3,
|
|
201
|
+
values: positions
|
|
202
|
+
});
|
|
203
|
+
geo.indices = indices;
|
|
204
|
+
return geo;
|
|
205
|
+
}
|
|
206
|
+
function constructExtrudedRectangle(rectangleGeometry, computedOptions) {
|
|
207
|
+
const maxHeight = rectangleGeometry._surfaceHeight;
|
|
208
|
+
const minHeight = rectangleGeometry._extrudedHeight;
|
|
209
|
+
const ellipsoid = rectangleGeometry._ellipsoid;
|
|
210
|
+
const geo = constructRectangle(rectangleGeometry, computedOptions);
|
|
211
|
+
const height = computedOptions.height;
|
|
212
|
+
const width = computedOptions.width;
|
|
213
|
+
const topPositions = PolygonPipeline_default.scaleToGeodeticHeight(
|
|
214
|
+
geo.attributes.position.values,
|
|
215
|
+
maxHeight,
|
|
216
|
+
ellipsoid,
|
|
217
|
+
false
|
|
218
|
+
);
|
|
219
|
+
let length = topPositions.length;
|
|
220
|
+
const positions = new Float64Array(length * 2);
|
|
221
|
+
positions.set(topPositions);
|
|
222
|
+
const bottomPositions = PolygonPipeline_default.scaleToGeodeticHeight(
|
|
223
|
+
geo.attributes.position.values,
|
|
224
|
+
minHeight,
|
|
225
|
+
ellipsoid
|
|
226
|
+
);
|
|
227
|
+
positions.set(bottomPositions, length);
|
|
228
|
+
geo.attributes.position.values = positions;
|
|
229
|
+
const northCap = computedOptions.northCap;
|
|
230
|
+
const southCap = computedOptions.southCap;
|
|
231
|
+
let corners = 4;
|
|
232
|
+
if (northCap) {
|
|
233
|
+
corners -= 1;
|
|
234
|
+
}
|
|
235
|
+
if (southCap) {
|
|
236
|
+
corners -= 1;
|
|
237
|
+
}
|
|
238
|
+
const indicesSize = (positions.length / 3 + corners) * 2;
|
|
239
|
+
const indices = IndexDatatype_default.createTypedArray(
|
|
240
|
+
positions.length / 3,
|
|
241
|
+
indicesSize
|
|
242
|
+
);
|
|
243
|
+
length = positions.length / 6;
|
|
244
|
+
let index = 0;
|
|
245
|
+
for (let i = 0; i < length - 1; i++) {
|
|
246
|
+
indices[index++] = i;
|
|
247
|
+
indices[index++] = i + 1;
|
|
248
|
+
indices[index++] = i + length;
|
|
249
|
+
indices[index++] = i + length + 1;
|
|
250
|
+
}
|
|
251
|
+
indices[index++] = length - 1;
|
|
252
|
+
indices[index++] = 0;
|
|
253
|
+
indices[index++] = length + length - 1;
|
|
254
|
+
indices[index++] = length;
|
|
255
|
+
indices[index++] = 0;
|
|
256
|
+
indices[index++] = length;
|
|
257
|
+
let bottomCorner;
|
|
258
|
+
if (northCap) {
|
|
259
|
+
bottomCorner = height - 1;
|
|
260
|
+
} else {
|
|
261
|
+
const topRightCorner = width - 1;
|
|
262
|
+
indices[index++] = topRightCorner;
|
|
263
|
+
indices[index++] = topRightCorner + length;
|
|
264
|
+
bottomCorner = width + height - 2;
|
|
265
|
+
}
|
|
266
|
+
indices[index++] = bottomCorner;
|
|
267
|
+
indices[index++] = bottomCorner + length;
|
|
268
|
+
if (!southCap) {
|
|
269
|
+
const bottomLeftCorner = width + bottomCorner - 1;
|
|
270
|
+
indices[index++] = bottomLeftCorner;
|
|
271
|
+
indices[index] = bottomLeftCorner + length;
|
|
272
|
+
}
|
|
273
|
+
geo.indices = indices;
|
|
274
|
+
return geo;
|
|
275
|
+
}
|
|
276
|
+
function RectangleOutlineGeometry(options) {
|
|
277
|
+
options = options ?? Frozen_default.EMPTY_OBJECT;
|
|
278
|
+
const rectangle = options.rectangle;
|
|
279
|
+
const granularity = options.granularity ?? Math_default.RADIANS_PER_DEGREE;
|
|
280
|
+
const ellipsoid = options.ellipsoid ?? Ellipsoid_default.default;
|
|
281
|
+
const rotation = options.rotation ?? 0;
|
|
282
|
+
if (!defined_default(rectangle)) {
|
|
283
|
+
throw new DeveloperError_default("rectangle is required.");
|
|
284
|
+
}
|
|
285
|
+
Rectangle_default._validate(rectangle);
|
|
286
|
+
if (rectangle.north < rectangle.south) {
|
|
287
|
+
throw new DeveloperError_default(
|
|
288
|
+
"options.rectangle.north must be greater than options.rectangle.south"
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
const height = options.height ?? 0;
|
|
292
|
+
const extrudedHeight = options.extrudedHeight ?? height;
|
|
293
|
+
this._rectangle = Rectangle_default.clone(rectangle);
|
|
294
|
+
this._granularity = granularity;
|
|
295
|
+
this._ellipsoid = ellipsoid;
|
|
296
|
+
this._surfaceHeight = Math.max(height, extrudedHeight);
|
|
297
|
+
this._rotation = rotation;
|
|
298
|
+
this._extrudedHeight = Math.min(height, extrudedHeight);
|
|
299
|
+
this._offsetAttribute = options.offsetAttribute;
|
|
300
|
+
this._workerName = "createRectangleOutlineGeometry";
|
|
301
|
+
}
|
|
302
|
+
RectangleOutlineGeometry.packedLength = Rectangle_default.packedLength + Ellipsoid_default.packedLength + 5;
|
|
303
|
+
RectangleOutlineGeometry.pack = function(value, array, startingIndex) {
|
|
304
|
+
if (!defined_default(value)) {
|
|
305
|
+
throw new DeveloperError_default("value is required");
|
|
306
|
+
}
|
|
307
|
+
if (!defined_default(array)) {
|
|
308
|
+
throw new DeveloperError_default("array is required");
|
|
309
|
+
}
|
|
310
|
+
startingIndex = startingIndex ?? 0;
|
|
311
|
+
Rectangle_default.pack(value._rectangle, array, startingIndex);
|
|
312
|
+
startingIndex += Rectangle_default.packedLength;
|
|
313
|
+
Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
|
|
314
|
+
startingIndex += Ellipsoid_default.packedLength;
|
|
315
|
+
array[startingIndex++] = value._granularity;
|
|
316
|
+
array[startingIndex++] = value._surfaceHeight;
|
|
317
|
+
array[startingIndex++] = value._rotation;
|
|
318
|
+
array[startingIndex++] = value._extrudedHeight;
|
|
319
|
+
array[startingIndex] = value._offsetAttribute ?? -1;
|
|
320
|
+
return array;
|
|
321
|
+
};
|
|
322
|
+
var scratchRectangle = new Rectangle_default();
|
|
323
|
+
var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
|
|
324
|
+
var scratchOptions = {
|
|
325
|
+
rectangle: scratchRectangle,
|
|
326
|
+
ellipsoid: scratchEllipsoid,
|
|
327
|
+
granularity: void 0,
|
|
328
|
+
height: void 0,
|
|
329
|
+
rotation: void 0,
|
|
330
|
+
extrudedHeight: void 0,
|
|
331
|
+
offsetAttribute: void 0
|
|
332
|
+
};
|
|
333
|
+
RectangleOutlineGeometry.unpack = function(array, startingIndex, result) {
|
|
334
|
+
if (!defined_default(array)) {
|
|
335
|
+
throw new DeveloperError_default("array is required");
|
|
336
|
+
}
|
|
337
|
+
startingIndex = startingIndex ?? 0;
|
|
338
|
+
const rectangle = Rectangle_default.unpack(array, startingIndex, scratchRectangle);
|
|
339
|
+
startingIndex += Rectangle_default.packedLength;
|
|
340
|
+
const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
|
|
341
|
+
startingIndex += Ellipsoid_default.packedLength;
|
|
342
|
+
const granularity = array[startingIndex++];
|
|
343
|
+
const height = array[startingIndex++];
|
|
344
|
+
const rotation = array[startingIndex++];
|
|
345
|
+
const extrudedHeight = array[startingIndex++];
|
|
346
|
+
const offsetAttribute = array[startingIndex];
|
|
347
|
+
if (!defined_default(result)) {
|
|
348
|
+
scratchOptions.granularity = granularity;
|
|
349
|
+
scratchOptions.height = height;
|
|
350
|
+
scratchOptions.rotation = rotation;
|
|
351
|
+
scratchOptions.extrudedHeight = extrudedHeight;
|
|
352
|
+
scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
|
|
353
|
+
return new RectangleOutlineGeometry(scratchOptions);
|
|
354
|
+
}
|
|
355
|
+
result._rectangle = Rectangle_default.clone(rectangle, result._rectangle);
|
|
356
|
+
result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
|
|
357
|
+
result._surfaceHeight = height;
|
|
358
|
+
result._rotation = rotation;
|
|
359
|
+
result._extrudedHeight = extrudedHeight;
|
|
360
|
+
result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
|
|
361
|
+
return result;
|
|
362
|
+
};
|
|
363
|
+
var nwScratch = new Cartographic_default();
|
|
364
|
+
RectangleOutlineGeometry.createGeometry = function(rectangleGeometry) {
|
|
365
|
+
const rectangle = rectangleGeometry._rectangle;
|
|
366
|
+
const ellipsoid = rectangleGeometry._ellipsoid;
|
|
367
|
+
const computedOptions = RectangleGeometryLibrary_default.computeOptions(
|
|
368
|
+
rectangle,
|
|
369
|
+
rectangleGeometry._granularity,
|
|
370
|
+
rectangleGeometry._rotation,
|
|
371
|
+
0,
|
|
372
|
+
rectangleScratch,
|
|
373
|
+
nwScratch
|
|
374
|
+
);
|
|
375
|
+
let geometry;
|
|
376
|
+
let boundingSphere;
|
|
377
|
+
if (Math_default.equalsEpsilon(
|
|
378
|
+
rectangle.north,
|
|
379
|
+
rectangle.south,
|
|
380
|
+
Math_default.EPSILON10
|
|
381
|
+
) || Math_default.equalsEpsilon(
|
|
382
|
+
rectangle.east,
|
|
383
|
+
rectangle.west,
|
|
384
|
+
Math_default.EPSILON10
|
|
385
|
+
)) {
|
|
386
|
+
return void 0;
|
|
387
|
+
}
|
|
388
|
+
const surfaceHeight = rectangleGeometry._surfaceHeight;
|
|
389
|
+
const extrudedHeight = rectangleGeometry._extrudedHeight;
|
|
390
|
+
const extrude = !Math_default.equalsEpsilon(
|
|
391
|
+
surfaceHeight,
|
|
392
|
+
extrudedHeight,
|
|
393
|
+
0,
|
|
394
|
+
Math_default.EPSILON2
|
|
395
|
+
);
|
|
396
|
+
let offsetValue;
|
|
397
|
+
if (extrude) {
|
|
398
|
+
geometry = constructExtrudedRectangle(rectangleGeometry, computedOptions);
|
|
399
|
+
if (defined_default(rectangleGeometry._offsetAttribute)) {
|
|
400
|
+
const size = geometry.attributes.position.values.length / 3;
|
|
401
|
+
let offsetAttribute = new Uint8Array(size);
|
|
402
|
+
if (rectangleGeometry._offsetAttribute === GeometryOffsetAttribute_default.TOP) {
|
|
403
|
+
offsetAttribute = offsetAttribute.fill(1, 0, size / 2);
|
|
404
|
+
} else {
|
|
405
|
+
offsetValue = rectangleGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
|
|
406
|
+
offsetAttribute = offsetAttribute.fill(offsetValue);
|
|
407
|
+
}
|
|
408
|
+
geometry.attributes.applyOffset = new GeometryAttribute_default({
|
|
409
|
+
componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
|
|
410
|
+
componentsPerAttribute: 1,
|
|
411
|
+
values: offsetAttribute
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
const topBS = BoundingSphere_default.fromRectangle3D(
|
|
415
|
+
rectangle,
|
|
416
|
+
ellipsoid,
|
|
417
|
+
surfaceHeight,
|
|
418
|
+
topBoundingSphere
|
|
419
|
+
);
|
|
420
|
+
const bottomBS = BoundingSphere_default.fromRectangle3D(
|
|
421
|
+
rectangle,
|
|
422
|
+
ellipsoid,
|
|
423
|
+
extrudedHeight,
|
|
424
|
+
bottomBoundingSphere
|
|
425
|
+
);
|
|
426
|
+
boundingSphere = BoundingSphere_default.union(topBS, bottomBS);
|
|
427
|
+
} else {
|
|
428
|
+
geometry = constructRectangle(rectangleGeometry, computedOptions);
|
|
429
|
+
geometry.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
|
|
430
|
+
geometry.attributes.position.values,
|
|
431
|
+
surfaceHeight,
|
|
432
|
+
ellipsoid,
|
|
433
|
+
false
|
|
434
|
+
);
|
|
435
|
+
if (defined_default(rectangleGeometry._offsetAttribute)) {
|
|
436
|
+
const length = geometry.attributes.position.values.length;
|
|
437
|
+
offsetValue = rectangleGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
|
|
438
|
+
const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
|
|
439
|
+
geometry.attributes.applyOffset = new GeometryAttribute_default({
|
|
440
|
+
componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
|
|
441
|
+
componentsPerAttribute: 1,
|
|
442
|
+
values: applyOffset
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
boundingSphere = BoundingSphere_default.fromRectangle3D(
|
|
446
|
+
rectangle,
|
|
447
|
+
ellipsoid,
|
|
448
|
+
surfaceHeight
|
|
449
|
+
);
|
|
450
|
+
}
|
|
451
|
+
return new Geometry_default({
|
|
452
|
+
attributes: geometry.attributes,
|
|
453
|
+
indices: geometry.indices,
|
|
454
|
+
primitiveType: PrimitiveType_default.LINES,
|
|
455
|
+
boundingSphere,
|
|
456
|
+
offsetAttribute: rectangleGeometry._offsetAttribute
|
|
457
|
+
});
|
|
458
|
+
};
|
|
459
|
+
var RectangleOutlineGeometry_default = RectangleOutlineGeometry;
|
|
460
|
+
|
|
461
|
+
// packages/engine/Source/Workers/createRectangleOutlineGeometry.js
|
|
462
|
+
function createRectangleOutlineGeometry(rectangleGeometry, offset) {
|
|
463
|
+
if (defined_default(offset)) {
|
|
464
|
+
rectangleGeometry = RectangleOutlineGeometry_default.unpack(
|
|
465
|
+
rectangleGeometry,
|
|
466
|
+
offset
|
|
467
|
+
);
|
|
468
|
+
}
|
|
469
|
+
rectangleGeometry._ellipsoid = Ellipsoid_default.clone(rectangleGeometry._ellipsoid);
|
|
470
|
+
rectangleGeometry._rectangle = Rectangle_default.clone(rectangleGeometry._rectangle);
|
|
471
|
+
return RectangleOutlineGeometry_default.createGeometry(rectangleGeometry);
|
|
472
|
+
}
|
|
473
|
+
var createRectangleOutlineGeometry_default = createRectangleOutlineGeometry;
|
|
474
|
+
export {
|
|
475
|
+
createRectangleOutlineGeometry_default as default
|
|
476
|
+
};
|