@rtzh/engine 0.0.3 → 0.0.5
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-23CHWHW6.js +97 -0
- package/Build/Workers/chunk-27JI7F7B.js +101 -0
- package/Build/Workers/chunk-2OWEFNS4.js +97 -0
- package/Build/Workers/chunk-2VN5W6HA.js +352 -0
- package/Build/Workers/chunk-2YAONTGQ.js +476 -0
- package/Build/Workers/chunk-324L25HV.js +352 -0
- package/Build/Workers/chunk-3EZBCDBK.js +439 -0
- package/Build/Workers/chunk-3JPA6GA3.js +837 -0
- package/Build/Workers/chunk-3WRJXCJS.js +497 -0
- package/Build/Workers/chunk-3ZJ6X3BW.js +57 -0
- package/Build/Workers/chunk-42I3QSKJ.js +280 -0
- package/Build/Workers/chunk-4BJHO56J.js +171 -0
- package/Build/Workers/chunk-4GPHI5UY.js +288 -0
- package/Build/Workers/chunk-4NAHNN5G.js +288 -0
- package/Build/Workers/chunk-54AFUJNV.js +414 -0
- package/Build/Workers/chunk-553BNJPP.js +299 -0
- package/Build/Workers/chunk-56MKFDJH.js +778 -0
- package/Build/Workers/chunk-5DPCF65K.js +162 -0
- package/Build/Workers/chunk-5MCUZL44.js +455 -0
- package/Build/Workers/chunk-5T4DXPEL.js +299 -0
- package/Build/Workers/chunk-5UHIRI2A.js +1800 -0
- package/Build/Workers/chunk-664SI23B.js +368 -0
- package/Build/Workers/chunk-6GNLKYQO.js +114 -0
- package/Build/Workers/chunk-6ZF4QOFM.js +2058 -0
- package/Build/Workers/chunk-763Q2YKY.js +1483 -0
- package/Build/Workers/chunk-7R74V5Z3.js +241 -0
- package/Build/Workers/chunk-7X6CLAD2.js +439 -0
- package/Build/Workers/chunk-ADQVXDEJ.js +2719 -0
- package/Build/Workers/chunk-ATC2WXI4.js +1054 -0
- package/Build/Workers/chunk-B5ZUBUPB.js +398 -0
- package/Build/Workers/chunk-BHTWF7UG.js +73 -0
- package/Build/Workers/chunk-BLZILZWF.js +2719 -0
- package/Build/Workers/chunk-CCPKBCZD.js +171 -0
- package/Build/Workers/chunk-CMAG5O53.js +1483 -0
- package/Build/Workers/chunk-D3FNWB3Q.js +138 -0
- package/Build/Workers/chunk-DAYNPAVN.js +58 -0
- package/Build/Workers/chunk-DKJMD2HX.js +2058 -0
- package/Build/Workers/chunk-DVTKM7FF.js +256 -0
- package/Build/Workers/chunk-FTHCZAWE.js +44 -0
- package/Build/Workers/chunk-FTXEOX64.js +1067 -0
- package/Build/Workers/chunk-FUFHIXPT.js +305 -0
- package/Build/Workers/chunk-G2KELS4I.js +138 -0
- package/Build/Workers/chunk-GCZNJHST.js +162 -0
- package/Build/Workers/chunk-GJFIEALZ.js +387 -0
- package/Build/Workers/chunk-HC6DDPFU.js +198 -0
- package/Build/Workers/chunk-HHN2M3ES.js +682 -0
- package/Build/Workers/chunk-HHUKBKWS.js +414 -0
- package/Build/Workers/chunk-HLIXASKN.js +476 -0
- package/Build/Workers/chunk-IEBTKCMB.js +497 -0
- package/Build/Workers/chunk-IYXLSOLF.js +692 -0
- package/Build/Workers/chunk-JJD7S2CV.js +3514 -0
- package/Build/Workers/chunk-K6PDZWHZ.js +1460 -0
- package/Build/Workers/chunk-KWFCDTXS.js +940 -0
- package/Build/Workers/chunk-LENXRROQ.js +398 -0
- package/Build/Workers/chunk-MB2ZJQR3.js +55 -0
- package/Build/Workers/chunk-MCNY7SPD.js +139 -0
- package/Build/Workers/chunk-MHEKNHOF.js +511 -0
- package/Build/Workers/chunk-MRLJERN3.js +114 -0
- package/Build/Workers/chunk-NOJAQPXU.js +102 -0
- package/Build/Workers/chunk-OAFZ26QL.js +837 -0
- package/Build/Workers/chunk-OBQVOEPZ.js +124 -0
- package/Build/Workers/chunk-OC63Z35M.js +280 -0
- package/Build/Workers/chunk-OEAC5XUG.js +73 -0
- package/Build/Workers/chunk-OQK27J4J.js +139 -0
- package/Build/Workers/chunk-OTDNJAYJ.js +55 -0
- package/Build/Workers/chunk-PGYA2CMO.js +642 -0
- package/Build/Workers/chunk-PSDWIJMU.js +219 -0
- package/Build/Workers/chunk-PW3GQAXA.js +3514 -0
- package/Build/Workers/chunk-Q2YRPH7V.js +1067 -0
- package/Build/Workers/chunk-QDNIPHD7.js +368 -0
- package/Build/Workers/chunk-QEGQDFX2.js +1045 -0
- package/Build/Workers/chunk-R5U3MYPS.js +198 -0
- package/Build/Workers/chunk-RJIH4MDC.js +241 -0
- package/Build/Workers/chunk-RO7SDGOD.js +352 -0
- package/Build/Workers/chunk-RTJ6L5O4.js +163 -0
- package/Build/Workers/chunk-SCNCHSTQ.js +642 -0
- package/Build/Workers/chunk-SG56ZOPD.js +788 -0
- package/Build/Workers/chunk-SHQEATE2.js +1045 -0
- package/Build/Workers/chunk-SPL7JK6K.js +1054 -0
- package/Build/Workers/chunk-SYCWSSRX.js +1443 -0
- package/Build/Workers/chunk-TEZGNCXH.js +8366 -0
- package/Build/Workers/chunk-TIQZUI5N.js +44 -0
- package/Build/Workers/chunk-TKJHRY4V.js +511 -0
- package/Build/Workers/chunk-TLXEQ5QY.js +778 -0
- package/Build/Workers/chunk-UIMHSWDJ.js +455 -0
- package/Build/Workers/chunk-UO3AWZR3.js +352 -0
- package/Build/Workers/chunk-UTXXZ7XH.js +940 -0
- package/Build/Workers/chunk-V2TRFTCU.js +1317 -0
- package/Build/Workers/chunk-V4I3IKAK.js +1460 -0
- package/Build/Workers/chunk-W2EK42GB.js +75 -0
- package/Build/Workers/chunk-W2OMUTYA.js +1800 -0
- package/Build/Workers/chunk-WHOEQFL4.js +682 -0
- package/Build/Workers/chunk-XHNWVOIJ.js +219 -0
- package/Build/Workers/chunk-XNKQLSHI.js +629 -0
- package/Build/Workers/chunk-XOXF37BU.js +1317 -0
- package/Build/Workers/chunk-YC6PFDXQ.js +8366 -0
- package/Build/Workers/chunk-YFJB3US4.js +102 -0
- package/Build/Workers/chunk-YMXATXRN.js +57 -0
- package/Build/Workers/chunk-YVRD2PO5.js +124 -0
- package/Build/Workers/chunk-Z24A5EMJ.js +387 -0
- package/Build/Workers/chunk-Z4IW5XUY.js +788 -0
- package/Build/Workers/chunk-ZFHCP7RN.js +692 -0
- package/Build/Workers/chunk-ZHHEFNHL.js +37 -0
- package/Build/Workers/chunk-ZI5GDNEV.js +305 -0
- package/Build/Workers/chunk-ZYTMDBCR.js +1443 -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/Cesium3DTileset.js +173 -0
- package/Source/Scene/GltfLoader.js +2 -2
- package/Source/Scene/Model/BarycentricWireframePipelineStage.js +176 -0
- package/Source/Scene/Model/I3dmLoader.js +2 -2
- package/Source/Scene/Model/Model.js +174 -2
- package/Source/Scene/Model/Model3DTileContent.js +18 -1
- package/Source/Scene/Model/ModelRuntimePrimitive.js +12 -1
- package/Source/Scene/Model/WireframePipelineStage.js +6 -2
- package/Source/Shaders/Model/ModelFS.glsl +12 -0
- package/Source/Shaders/Model/ModelFS.js +12 -0
- package/Source/Shaders/Model/ModelVS.glsl +4 -0
- package/Source/Shaders/Model/ModelVS.js +4 -0
- package/index.d.ts +166 -0
- package/index.js +57 -56
- package/package.json +1 -1
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 0.0.5
|
|
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
|
+
CorridorGeometryLibrary_default
|
|
28
|
+
} from "./chunk-HLIXASKN.js";
|
|
29
|
+
import {
|
|
30
|
+
CornerType_default
|
|
31
|
+
} from "./chunk-ZFHCP7RN.js";
|
|
32
|
+
import "./chunk-HHUKBKWS.js";
|
|
33
|
+
import "./chunk-324L25HV.js";
|
|
34
|
+
import {
|
|
35
|
+
GeometryOffsetAttribute_default
|
|
36
|
+
} from "./chunk-ZHHEFNHL.js";
|
|
37
|
+
import "./chunk-4GPHI5UY.js";
|
|
38
|
+
import "./chunk-GCZNJHST.js";
|
|
39
|
+
import {
|
|
40
|
+
PolygonPipeline_default
|
|
41
|
+
} from "./chunk-QEGQDFX2.js";
|
|
42
|
+
import {
|
|
43
|
+
arrayRemoveDuplicates_default
|
|
44
|
+
} from "./chunk-23CHWHW6.js";
|
|
45
|
+
import "./chunk-5MCUZL44.js";
|
|
46
|
+
import "./chunk-XOXF37BU.js";
|
|
47
|
+
import "./chunk-CCPKBCZD.js";
|
|
48
|
+
import {
|
|
49
|
+
IndexDatatype_default
|
|
50
|
+
} from "./chunk-OQK27J4J.js";
|
|
51
|
+
import {
|
|
52
|
+
GeometryAttributes_default
|
|
53
|
+
} from "./chunk-FTHCZAWE.js";
|
|
54
|
+
import {
|
|
55
|
+
GeometryAttribute_default,
|
|
56
|
+
Geometry_default,
|
|
57
|
+
PrimitiveType_default
|
|
58
|
+
} from "./chunk-5T4DXPEL.js";
|
|
59
|
+
import {
|
|
60
|
+
BoundingSphere_default
|
|
61
|
+
} from "./chunk-UTXXZ7XH.js";
|
|
62
|
+
import "./chunk-MB2ZJQR3.js";
|
|
63
|
+
import "./chunk-TEZGNCXH.js";
|
|
64
|
+
import "./chunk-DKJMD2HX.js";
|
|
65
|
+
import {
|
|
66
|
+
ComponentDatatype_default
|
|
67
|
+
} from "./chunk-DVTKM7FF.js";
|
|
68
|
+
import "./chunk-XNKQLSHI.js";
|
|
69
|
+
import "./chunk-DAYNPAVN.js";
|
|
70
|
+
import {
|
|
71
|
+
Ellipsoid_default
|
|
72
|
+
} from "./chunk-V4I3IKAK.js";
|
|
73
|
+
import {
|
|
74
|
+
Cartesian3_default,
|
|
75
|
+
Frozen_default
|
|
76
|
+
} from "./chunk-ZYTMDBCR.js";
|
|
77
|
+
import {
|
|
78
|
+
Math_default
|
|
79
|
+
} from "./chunk-IEBTKCMB.js";
|
|
80
|
+
import {
|
|
81
|
+
Check_default
|
|
82
|
+
} from "./chunk-RTJ6L5O4.js";
|
|
83
|
+
import {
|
|
84
|
+
defined_default
|
|
85
|
+
} from "./chunk-W2EK42GB.js";
|
|
86
|
+
|
|
87
|
+
// packages/engine/Source/Core/CorridorOutlineGeometry.js
|
|
88
|
+
var cartesian1 = new Cartesian3_default();
|
|
89
|
+
var cartesian2 = new Cartesian3_default();
|
|
90
|
+
var cartesian3 = new Cartesian3_default();
|
|
91
|
+
function scaleToSurface(positions, ellipsoid) {
|
|
92
|
+
for (let i = 0; i < positions.length; i++) {
|
|
93
|
+
positions[i] = ellipsoid.scaleToGeodeticSurface(positions[i], positions[i]);
|
|
94
|
+
}
|
|
95
|
+
return positions;
|
|
96
|
+
}
|
|
97
|
+
function combine(computedPositions, cornerType) {
|
|
98
|
+
const wallIndices = [];
|
|
99
|
+
const positions = computedPositions.positions;
|
|
100
|
+
const corners = computedPositions.corners;
|
|
101
|
+
const endPositions = computedPositions.endPositions;
|
|
102
|
+
const attributes = new GeometryAttributes_default();
|
|
103
|
+
let corner;
|
|
104
|
+
let leftCount = 0;
|
|
105
|
+
let rightCount = 0;
|
|
106
|
+
let i;
|
|
107
|
+
let indicesLength = 0;
|
|
108
|
+
let length;
|
|
109
|
+
for (i = 0; i < positions.length; i += 2) {
|
|
110
|
+
length = positions[i].length - 3;
|
|
111
|
+
leftCount += length;
|
|
112
|
+
indicesLength += length / 3 * 4;
|
|
113
|
+
rightCount += positions[i + 1].length - 3;
|
|
114
|
+
}
|
|
115
|
+
leftCount += 3;
|
|
116
|
+
rightCount += 3;
|
|
117
|
+
for (i = 0; i < corners.length; i++) {
|
|
118
|
+
corner = corners[i];
|
|
119
|
+
const leftSide = corners[i].leftPositions;
|
|
120
|
+
if (defined_default(leftSide)) {
|
|
121
|
+
length = leftSide.length;
|
|
122
|
+
leftCount += length;
|
|
123
|
+
indicesLength += length / 3 * 2;
|
|
124
|
+
} else {
|
|
125
|
+
length = corners[i].rightPositions.length;
|
|
126
|
+
rightCount += length;
|
|
127
|
+
indicesLength += length / 3 * 2;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const addEndPositions = defined_default(endPositions);
|
|
131
|
+
let endPositionLength;
|
|
132
|
+
if (addEndPositions) {
|
|
133
|
+
endPositionLength = endPositions[0].length - 3;
|
|
134
|
+
leftCount += endPositionLength;
|
|
135
|
+
rightCount += endPositionLength;
|
|
136
|
+
endPositionLength /= 3;
|
|
137
|
+
indicesLength += endPositionLength * 4;
|
|
138
|
+
}
|
|
139
|
+
const size = leftCount + rightCount;
|
|
140
|
+
const finalPositions = new Float64Array(size);
|
|
141
|
+
let front = 0;
|
|
142
|
+
let back = size - 1;
|
|
143
|
+
let UL, LL, UR, LR;
|
|
144
|
+
let rightPos, leftPos;
|
|
145
|
+
const halfLength = endPositionLength / 2;
|
|
146
|
+
const indices = IndexDatatype_default.createTypedArray(size / 3, indicesLength + 4);
|
|
147
|
+
let index = 0;
|
|
148
|
+
indices[index++] = front / 3;
|
|
149
|
+
indices[index++] = (back - 2) / 3;
|
|
150
|
+
if (addEndPositions) {
|
|
151
|
+
wallIndices.push(front / 3);
|
|
152
|
+
leftPos = cartesian1;
|
|
153
|
+
rightPos = cartesian2;
|
|
154
|
+
const firstEndPositions = endPositions[0];
|
|
155
|
+
for (i = 0; i < halfLength; i++) {
|
|
156
|
+
leftPos = Cartesian3_default.fromArray(
|
|
157
|
+
firstEndPositions,
|
|
158
|
+
(halfLength - 1 - i) * 3,
|
|
159
|
+
leftPos
|
|
160
|
+
);
|
|
161
|
+
rightPos = Cartesian3_default.fromArray(
|
|
162
|
+
firstEndPositions,
|
|
163
|
+
(halfLength + i) * 3,
|
|
164
|
+
rightPos
|
|
165
|
+
);
|
|
166
|
+
CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
|
|
167
|
+
CorridorGeometryLibrary_default.addAttribute(
|
|
168
|
+
finalPositions,
|
|
169
|
+
leftPos,
|
|
170
|
+
void 0,
|
|
171
|
+
back
|
|
172
|
+
);
|
|
173
|
+
LL = front / 3;
|
|
174
|
+
LR = LL + 1;
|
|
175
|
+
UL = (back - 2) / 3;
|
|
176
|
+
UR = UL - 1;
|
|
177
|
+
indices[index++] = UL;
|
|
178
|
+
indices[index++] = UR;
|
|
179
|
+
indices[index++] = LL;
|
|
180
|
+
indices[index++] = LR;
|
|
181
|
+
front += 3;
|
|
182
|
+
back -= 3;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
let posIndex = 0;
|
|
186
|
+
let rightEdge = positions[posIndex++];
|
|
187
|
+
let leftEdge = positions[posIndex++];
|
|
188
|
+
finalPositions.set(rightEdge, front);
|
|
189
|
+
finalPositions.set(leftEdge, back - leftEdge.length + 1);
|
|
190
|
+
length = leftEdge.length - 3;
|
|
191
|
+
wallIndices.push(front / 3, (back - 2) / 3);
|
|
192
|
+
for (i = 0; i < length; i += 3) {
|
|
193
|
+
LL = front / 3;
|
|
194
|
+
LR = LL + 1;
|
|
195
|
+
UL = (back - 2) / 3;
|
|
196
|
+
UR = UL - 1;
|
|
197
|
+
indices[index++] = UL;
|
|
198
|
+
indices[index++] = UR;
|
|
199
|
+
indices[index++] = LL;
|
|
200
|
+
indices[index++] = LR;
|
|
201
|
+
front += 3;
|
|
202
|
+
back -= 3;
|
|
203
|
+
}
|
|
204
|
+
for (i = 0; i < corners.length; i++) {
|
|
205
|
+
let j;
|
|
206
|
+
corner = corners[i];
|
|
207
|
+
const l = corner.leftPositions;
|
|
208
|
+
const r = corner.rightPositions;
|
|
209
|
+
let start;
|
|
210
|
+
let outsidePoint = cartesian3;
|
|
211
|
+
if (defined_default(l)) {
|
|
212
|
+
back -= 3;
|
|
213
|
+
start = UR;
|
|
214
|
+
wallIndices.push(LR);
|
|
215
|
+
for (j = 0; j < l.length / 3; j++) {
|
|
216
|
+
outsidePoint = Cartesian3_default.fromArray(l, j * 3, outsidePoint);
|
|
217
|
+
indices[index++] = start - j - 1;
|
|
218
|
+
indices[index++] = start - j;
|
|
219
|
+
CorridorGeometryLibrary_default.addAttribute(
|
|
220
|
+
finalPositions,
|
|
221
|
+
outsidePoint,
|
|
222
|
+
void 0,
|
|
223
|
+
back
|
|
224
|
+
);
|
|
225
|
+
back -= 3;
|
|
226
|
+
}
|
|
227
|
+
wallIndices.push(start - Math.floor(l.length / 6));
|
|
228
|
+
if (cornerType === CornerType_default.BEVELED) {
|
|
229
|
+
wallIndices.push((back - 2) / 3 + 1);
|
|
230
|
+
}
|
|
231
|
+
front += 3;
|
|
232
|
+
} else {
|
|
233
|
+
front += 3;
|
|
234
|
+
start = LR;
|
|
235
|
+
wallIndices.push(UR);
|
|
236
|
+
for (j = 0; j < r.length / 3; j++) {
|
|
237
|
+
outsidePoint = Cartesian3_default.fromArray(r, j * 3, outsidePoint);
|
|
238
|
+
indices[index++] = start + j;
|
|
239
|
+
indices[index++] = start + j + 1;
|
|
240
|
+
CorridorGeometryLibrary_default.addAttribute(
|
|
241
|
+
finalPositions,
|
|
242
|
+
outsidePoint,
|
|
243
|
+
front
|
|
244
|
+
);
|
|
245
|
+
front += 3;
|
|
246
|
+
}
|
|
247
|
+
wallIndices.push(start + Math.floor(r.length / 6));
|
|
248
|
+
if (cornerType === CornerType_default.BEVELED) {
|
|
249
|
+
wallIndices.push(front / 3 - 1);
|
|
250
|
+
}
|
|
251
|
+
back -= 3;
|
|
252
|
+
}
|
|
253
|
+
rightEdge = positions[posIndex++];
|
|
254
|
+
leftEdge = positions[posIndex++];
|
|
255
|
+
rightEdge.splice(0, 3);
|
|
256
|
+
leftEdge.splice(leftEdge.length - 3, 3);
|
|
257
|
+
finalPositions.set(rightEdge, front);
|
|
258
|
+
finalPositions.set(leftEdge, back - leftEdge.length + 1);
|
|
259
|
+
length = leftEdge.length - 3;
|
|
260
|
+
for (j = 0; j < leftEdge.length; j += 3) {
|
|
261
|
+
LR = front / 3;
|
|
262
|
+
LL = LR - 1;
|
|
263
|
+
UR = (back - 2) / 3;
|
|
264
|
+
UL = UR + 1;
|
|
265
|
+
indices[index++] = UL;
|
|
266
|
+
indices[index++] = UR;
|
|
267
|
+
indices[index++] = LL;
|
|
268
|
+
indices[index++] = LR;
|
|
269
|
+
front += 3;
|
|
270
|
+
back -= 3;
|
|
271
|
+
}
|
|
272
|
+
front -= 3;
|
|
273
|
+
back += 3;
|
|
274
|
+
wallIndices.push(front / 3, (back - 2) / 3);
|
|
275
|
+
}
|
|
276
|
+
if (addEndPositions) {
|
|
277
|
+
front += 3;
|
|
278
|
+
back -= 3;
|
|
279
|
+
leftPos = cartesian1;
|
|
280
|
+
rightPos = cartesian2;
|
|
281
|
+
const lastEndPositions = endPositions[1];
|
|
282
|
+
for (i = 0; i < halfLength; i++) {
|
|
283
|
+
leftPos = Cartesian3_default.fromArray(
|
|
284
|
+
lastEndPositions,
|
|
285
|
+
(endPositionLength - i - 1) * 3,
|
|
286
|
+
leftPos
|
|
287
|
+
);
|
|
288
|
+
rightPos = Cartesian3_default.fromArray(lastEndPositions, i * 3, rightPos);
|
|
289
|
+
CorridorGeometryLibrary_default.addAttribute(
|
|
290
|
+
finalPositions,
|
|
291
|
+
leftPos,
|
|
292
|
+
void 0,
|
|
293
|
+
back
|
|
294
|
+
);
|
|
295
|
+
CorridorGeometryLibrary_default.addAttribute(finalPositions, rightPos, front);
|
|
296
|
+
LR = front / 3;
|
|
297
|
+
LL = LR - 1;
|
|
298
|
+
UR = (back - 2) / 3;
|
|
299
|
+
UL = UR + 1;
|
|
300
|
+
indices[index++] = UL;
|
|
301
|
+
indices[index++] = UR;
|
|
302
|
+
indices[index++] = LL;
|
|
303
|
+
indices[index++] = LR;
|
|
304
|
+
front += 3;
|
|
305
|
+
back -= 3;
|
|
306
|
+
}
|
|
307
|
+
wallIndices.push(front / 3);
|
|
308
|
+
} else {
|
|
309
|
+
wallIndices.push(front / 3, (back - 2) / 3);
|
|
310
|
+
}
|
|
311
|
+
indices[index++] = front / 3;
|
|
312
|
+
indices[index++] = (back - 2) / 3;
|
|
313
|
+
attributes.position = new GeometryAttribute_default({
|
|
314
|
+
componentDatatype: ComponentDatatype_default.DOUBLE,
|
|
315
|
+
componentsPerAttribute: 3,
|
|
316
|
+
values: finalPositions
|
|
317
|
+
});
|
|
318
|
+
return {
|
|
319
|
+
attributes,
|
|
320
|
+
indices,
|
|
321
|
+
wallIndices
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
function computePositionsExtruded(params) {
|
|
325
|
+
const ellipsoid = params.ellipsoid;
|
|
326
|
+
const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
|
|
327
|
+
const attr = combine(computedPositions, params.cornerType);
|
|
328
|
+
const wallIndices = attr.wallIndices;
|
|
329
|
+
const height = params.height;
|
|
330
|
+
const extrudedHeight = params.extrudedHeight;
|
|
331
|
+
const attributes = attr.attributes;
|
|
332
|
+
const indices = attr.indices;
|
|
333
|
+
let positions = attributes.position.values;
|
|
334
|
+
let length = positions.length;
|
|
335
|
+
let extrudedPositions = new Float64Array(length);
|
|
336
|
+
extrudedPositions.set(positions);
|
|
337
|
+
const newPositions = new Float64Array(length * 2);
|
|
338
|
+
positions = PolygonPipeline_default.scaleToGeodeticHeight(
|
|
339
|
+
positions,
|
|
340
|
+
height,
|
|
341
|
+
ellipsoid
|
|
342
|
+
);
|
|
343
|
+
extrudedPositions = PolygonPipeline_default.scaleToGeodeticHeight(
|
|
344
|
+
extrudedPositions,
|
|
345
|
+
extrudedHeight,
|
|
346
|
+
ellipsoid
|
|
347
|
+
);
|
|
348
|
+
newPositions.set(positions);
|
|
349
|
+
newPositions.set(extrudedPositions, length);
|
|
350
|
+
attributes.position.values = newPositions;
|
|
351
|
+
length /= 3;
|
|
352
|
+
if (defined_default(params.offsetAttribute)) {
|
|
353
|
+
let applyOffset = new Uint8Array(length * 2);
|
|
354
|
+
if (params.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
|
|
355
|
+
applyOffset = applyOffset.fill(1, 0, length);
|
|
356
|
+
} else {
|
|
357
|
+
const applyOffsetValue = params.offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
|
|
358
|
+
applyOffset = applyOffset.fill(applyOffsetValue);
|
|
359
|
+
}
|
|
360
|
+
attributes.applyOffset = new GeometryAttribute_default({
|
|
361
|
+
componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
|
|
362
|
+
componentsPerAttribute: 1,
|
|
363
|
+
values: applyOffset
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
let i;
|
|
367
|
+
const iLength = indices.length;
|
|
368
|
+
const newIndices = IndexDatatype_default.createTypedArray(
|
|
369
|
+
newPositions.length / 3,
|
|
370
|
+
(iLength + wallIndices.length) * 2
|
|
371
|
+
);
|
|
372
|
+
newIndices.set(indices);
|
|
373
|
+
let index = iLength;
|
|
374
|
+
for (i = 0; i < iLength; i += 2) {
|
|
375
|
+
const v0 = indices[i];
|
|
376
|
+
const v1 = indices[i + 1];
|
|
377
|
+
newIndices[index++] = v0 + length;
|
|
378
|
+
newIndices[index++] = v1 + length;
|
|
379
|
+
}
|
|
380
|
+
let UL, LL;
|
|
381
|
+
for (i = 0; i < wallIndices.length; i++) {
|
|
382
|
+
UL = wallIndices[i];
|
|
383
|
+
LL = UL + length;
|
|
384
|
+
newIndices[index++] = UL;
|
|
385
|
+
newIndices[index++] = LL;
|
|
386
|
+
}
|
|
387
|
+
return {
|
|
388
|
+
attributes,
|
|
389
|
+
indices: newIndices
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
function CorridorOutlineGeometry(options) {
|
|
393
|
+
options = options ?? Frozen_default.EMPTY_OBJECT;
|
|
394
|
+
const positions = options.positions;
|
|
395
|
+
const width = options.width;
|
|
396
|
+
Check_default.typeOf.object("options.positions", positions);
|
|
397
|
+
Check_default.typeOf.number("options.width", width);
|
|
398
|
+
const height = options.height ?? 0;
|
|
399
|
+
const extrudedHeight = options.extrudedHeight ?? height;
|
|
400
|
+
this._positions = positions;
|
|
401
|
+
this._ellipsoid = Ellipsoid_default.clone(options.ellipsoid ?? Ellipsoid_default.default);
|
|
402
|
+
this._width = width;
|
|
403
|
+
this._height = Math.max(height, extrudedHeight);
|
|
404
|
+
this._extrudedHeight = Math.min(height, extrudedHeight);
|
|
405
|
+
this._cornerType = options.cornerType ?? CornerType_default.ROUNDED;
|
|
406
|
+
this._granularity = options.granularity ?? Math_default.RADIANS_PER_DEGREE;
|
|
407
|
+
this._offsetAttribute = options.offsetAttribute;
|
|
408
|
+
this._workerName = "createCorridorOutlineGeometry";
|
|
409
|
+
this.packedLength = 1 + positions.length * Cartesian3_default.packedLength + Ellipsoid_default.packedLength + 6;
|
|
410
|
+
}
|
|
411
|
+
CorridorOutlineGeometry.pack = function(value, array, startingIndex) {
|
|
412
|
+
Check_default.typeOf.object("value", value);
|
|
413
|
+
Check_default.typeOf.object("array", array);
|
|
414
|
+
startingIndex = startingIndex ?? 0;
|
|
415
|
+
const positions = value._positions;
|
|
416
|
+
const length = positions.length;
|
|
417
|
+
array[startingIndex++] = length;
|
|
418
|
+
for (let i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
|
|
419
|
+
Cartesian3_default.pack(positions[i], array, startingIndex);
|
|
420
|
+
}
|
|
421
|
+
Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
|
|
422
|
+
startingIndex += Ellipsoid_default.packedLength;
|
|
423
|
+
array[startingIndex++] = value._width;
|
|
424
|
+
array[startingIndex++] = value._height;
|
|
425
|
+
array[startingIndex++] = value._extrudedHeight;
|
|
426
|
+
array[startingIndex++] = value._cornerType;
|
|
427
|
+
array[startingIndex++] = value._granularity;
|
|
428
|
+
array[startingIndex] = value._offsetAttribute ?? -1;
|
|
429
|
+
return array;
|
|
430
|
+
};
|
|
431
|
+
var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
|
|
432
|
+
var scratchOptions = {
|
|
433
|
+
positions: void 0,
|
|
434
|
+
ellipsoid: scratchEllipsoid,
|
|
435
|
+
width: void 0,
|
|
436
|
+
height: void 0,
|
|
437
|
+
extrudedHeight: void 0,
|
|
438
|
+
cornerType: void 0,
|
|
439
|
+
granularity: void 0,
|
|
440
|
+
offsetAttribute: void 0
|
|
441
|
+
};
|
|
442
|
+
CorridorOutlineGeometry.unpack = function(array, startingIndex, result) {
|
|
443
|
+
Check_default.typeOf.object("array", array);
|
|
444
|
+
startingIndex = startingIndex ?? 0;
|
|
445
|
+
const length = array[startingIndex++];
|
|
446
|
+
const positions = new Array(length);
|
|
447
|
+
for (let i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
|
|
448
|
+
positions[i] = Cartesian3_default.unpack(array, startingIndex);
|
|
449
|
+
}
|
|
450
|
+
const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
|
|
451
|
+
startingIndex += Ellipsoid_default.packedLength;
|
|
452
|
+
const width = array[startingIndex++];
|
|
453
|
+
const height = array[startingIndex++];
|
|
454
|
+
const extrudedHeight = array[startingIndex++];
|
|
455
|
+
const cornerType = array[startingIndex++];
|
|
456
|
+
const granularity = array[startingIndex++];
|
|
457
|
+
const offsetAttribute = array[startingIndex];
|
|
458
|
+
if (!defined_default(result)) {
|
|
459
|
+
scratchOptions.positions = positions;
|
|
460
|
+
scratchOptions.width = width;
|
|
461
|
+
scratchOptions.height = height;
|
|
462
|
+
scratchOptions.extrudedHeight = extrudedHeight;
|
|
463
|
+
scratchOptions.cornerType = cornerType;
|
|
464
|
+
scratchOptions.granularity = granularity;
|
|
465
|
+
scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
|
|
466
|
+
return new CorridorOutlineGeometry(scratchOptions);
|
|
467
|
+
}
|
|
468
|
+
result._positions = positions;
|
|
469
|
+
result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
|
|
470
|
+
result._width = width;
|
|
471
|
+
result._height = height;
|
|
472
|
+
result._extrudedHeight = extrudedHeight;
|
|
473
|
+
result._cornerType = cornerType;
|
|
474
|
+
result._granularity = granularity;
|
|
475
|
+
result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
|
|
476
|
+
return result;
|
|
477
|
+
};
|
|
478
|
+
CorridorOutlineGeometry.createGeometry = function(corridorOutlineGeometry) {
|
|
479
|
+
let positions = corridorOutlineGeometry._positions;
|
|
480
|
+
const width = corridorOutlineGeometry._width;
|
|
481
|
+
const ellipsoid = corridorOutlineGeometry._ellipsoid;
|
|
482
|
+
positions = scaleToSurface(positions, ellipsoid);
|
|
483
|
+
const cleanPositions = arrayRemoveDuplicates_default(
|
|
484
|
+
positions,
|
|
485
|
+
Cartesian3_default.equalsEpsilon
|
|
486
|
+
);
|
|
487
|
+
if (cleanPositions.length < 2 || width <= 0) {
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
const height = corridorOutlineGeometry._height;
|
|
491
|
+
const extrudedHeight = corridorOutlineGeometry._extrudedHeight;
|
|
492
|
+
const extrude = !Math_default.equalsEpsilon(
|
|
493
|
+
height,
|
|
494
|
+
extrudedHeight,
|
|
495
|
+
0,
|
|
496
|
+
Math_default.EPSILON2
|
|
497
|
+
);
|
|
498
|
+
const params = {
|
|
499
|
+
ellipsoid,
|
|
500
|
+
positions: cleanPositions,
|
|
501
|
+
width,
|
|
502
|
+
cornerType: corridorOutlineGeometry._cornerType,
|
|
503
|
+
granularity: corridorOutlineGeometry._granularity,
|
|
504
|
+
saveAttributes: false
|
|
505
|
+
};
|
|
506
|
+
let attr;
|
|
507
|
+
if (extrude) {
|
|
508
|
+
params.height = height;
|
|
509
|
+
params.extrudedHeight = extrudedHeight;
|
|
510
|
+
params.offsetAttribute = corridorOutlineGeometry._offsetAttribute;
|
|
511
|
+
attr = computePositionsExtruded(params);
|
|
512
|
+
} else {
|
|
513
|
+
const computedPositions = CorridorGeometryLibrary_default.computePositions(params);
|
|
514
|
+
attr = combine(computedPositions, params.cornerType);
|
|
515
|
+
attr.attributes.position.values = PolygonPipeline_default.scaleToGeodeticHeight(
|
|
516
|
+
attr.attributes.position.values,
|
|
517
|
+
height,
|
|
518
|
+
ellipsoid
|
|
519
|
+
);
|
|
520
|
+
if (defined_default(corridorOutlineGeometry._offsetAttribute)) {
|
|
521
|
+
const length = attr.attributes.position.values.length;
|
|
522
|
+
const offsetValue = corridorOutlineGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
|
|
523
|
+
const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
|
|
524
|
+
attr.attributes.applyOffset = new GeometryAttribute_default({
|
|
525
|
+
componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
|
|
526
|
+
componentsPerAttribute: 1,
|
|
527
|
+
values: applyOffset
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
const attributes = attr.attributes;
|
|
532
|
+
const boundingSphere = BoundingSphere_default.fromVertices(
|
|
533
|
+
attributes.position.values,
|
|
534
|
+
void 0,
|
|
535
|
+
3
|
|
536
|
+
);
|
|
537
|
+
return new Geometry_default({
|
|
538
|
+
attributes,
|
|
539
|
+
indices: attr.indices,
|
|
540
|
+
primitiveType: PrimitiveType_default.LINES,
|
|
541
|
+
boundingSphere,
|
|
542
|
+
offsetAttribute: corridorOutlineGeometry._offsetAttribute
|
|
543
|
+
});
|
|
544
|
+
};
|
|
545
|
+
var CorridorOutlineGeometry_default = CorridorOutlineGeometry;
|
|
546
|
+
|
|
547
|
+
// packages/engine/Source/Workers/createCorridorOutlineGeometry.js
|
|
548
|
+
function createCorridorOutlineGeometry(corridorOutlineGeometry, offset) {
|
|
549
|
+
if (defined_default(offset)) {
|
|
550
|
+
corridorOutlineGeometry = CorridorOutlineGeometry_default.unpack(
|
|
551
|
+
corridorOutlineGeometry,
|
|
552
|
+
offset
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
corridorOutlineGeometry._ellipsoid = Ellipsoid_default.clone(
|
|
556
|
+
corridorOutlineGeometry._ellipsoid
|
|
557
|
+
);
|
|
558
|
+
return CorridorOutlineGeometry_default.createGeometry(corridorOutlineGeometry);
|
|
559
|
+
}
|
|
560
|
+
var createCorridorOutlineGeometry_default = createCorridorOutlineGeometry;
|
|
561
|
+
export {
|
|
562
|
+
createCorridorOutlineGeometry_default as default
|
|
563
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 0.0.5
|
|
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
|
+
CylinderGeometry_default
|
|
28
|
+
} from "./chunk-LENXRROQ.js";
|
|
29
|
+
import "./chunk-BHTWF7UG.js";
|
|
30
|
+
import "./chunk-ZHHEFNHL.js";
|
|
31
|
+
import "./chunk-D3FNWB3Q.js";
|
|
32
|
+
import "./chunk-OQK27J4J.js";
|
|
33
|
+
import "./chunk-FTHCZAWE.js";
|
|
34
|
+
import "./chunk-5T4DXPEL.js";
|
|
35
|
+
import "./chunk-UTXXZ7XH.js";
|
|
36
|
+
import "./chunk-MB2ZJQR3.js";
|
|
37
|
+
import "./chunk-TEZGNCXH.js";
|
|
38
|
+
import "./chunk-DKJMD2HX.js";
|
|
39
|
+
import "./chunk-DVTKM7FF.js";
|
|
40
|
+
import "./chunk-XNKQLSHI.js";
|
|
41
|
+
import "./chunk-DAYNPAVN.js";
|
|
42
|
+
import "./chunk-V4I3IKAK.js";
|
|
43
|
+
import "./chunk-ZYTMDBCR.js";
|
|
44
|
+
import "./chunk-IEBTKCMB.js";
|
|
45
|
+
import "./chunk-RTJ6L5O4.js";
|
|
46
|
+
import {
|
|
47
|
+
defined_default
|
|
48
|
+
} from "./chunk-W2EK42GB.js";
|
|
49
|
+
|
|
50
|
+
// packages/engine/Source/Workers/createCylinderGeometry.js
|
|
51
|
+
function createCylinderGeometry(cylinderGeometry, offset) {
|
|
52
|
+
if (defined_default(offset)) {
|
|
53
|
+
cylinderGeometry = CylinderGeometry_default.unpack(cylinderGeometry, offset);
|
|
54
|
+
}
|
|
55
|
+
return CylinderGeometry_default.createGeometry(cylinderGeometry);
|
|
56
|
+
}
|
|
57
|
+
var createCylinderGeometry_default = createCylinderGeometry;
|
|
58
|
+
export {
|
|
59
|
+
createCylinderGeometry_default as default
|
|
60
|
+
};
|