@rtzh/engine 0.0.2 → 0.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/Source/Scene/GltfLoader.js +2 -2
- package/package.json +1 -1
- package/Build/ThirdParty/Workers/zip-web-worker.js +0 -640
- package/Build/Workers/chunk-245NZYCR.js +0 -124
- package/Build/Workers/chunk-25BA4527.js +0 -837
- package/Build/Workers/chunk-4HXPSZRC.js +0 -1483
- package/Build/Workers/chunk-4Z26IS65.js +0 -3514
- package/Build/Workers/chunk-55IROWAX.js +0 -139
- package/Build/Workers/chunk-56XTN5NJ.js +0 -1800
- package/Build/Workers/chunk-5VZISKJF.js +0 -629
- package/Build/Workers/chunk-5WAG5YKS.js +0 -368
- package/Build/Workers/chunk-66YGZWBI.js +0 -1317
- package/Build/Workers/chunk-6H33B6OL.js +0 -37
- package/Build/Workers/chunk-6LZBBEA7.js +0 -439
- package/Build/Workers/chunk-6XJO625E.js +0 -497
- package/Build/Workers/chunk-75UGCVME.js +0 -102
- package/Build/Workers/chunk-7B23DD46.js +0 -1054
- package/Build/Workers/chunk-7NCJH26L.js +0 -352
- package/Build/Workers/chunk-AIW5F22O.js +0 -352
- package/Build/Workers/chunk-AL22JVIA.js +0 -256
- package/Build/Workers/chunk-AVSQILVI.js +0 -75
- package/Build/Workers/chunk-B2VFNYD7.js +0 -280
- package/Build/Workers/chunk-BOV6T7FO.js +0 -44
- package/Build/Workers/chunk-DP76S3IQ.js +0 -1067
- package/Build/Workers/chunk-EDIUN7V3.js +0 -219
- package/Build/Workers/chunk-EKMWNF4U.js +0 -55
- package/Build/Workers/chunk-ELXGXAYS.js +0 -682
- package/Build/Workers/chunk-FVYRV2T6.js +0 -455
- package/Build/Workers/chunk-GDIBU55R.js +0 -778
- package/Build/Workers/chunk-HAY6YE7M.js +0 -97
- package/Build/Workers/chunk-I76SRIKN.js +0 -138
- package/Build/Workers/chunk-IELTSYPZ.js +0 -241
- package/Build/Workers/chunk-J4MIJCN5.js +0 -171
- package/Build/Workers/chunk-JFO3ELF3.js +0 -642
- package/Build/Workers/chunk-K4IMD7KH.js +0 -162
- package/Build/Workers/chunk-KFMCOG26.js +0 -692
- package/Build/Workers/chunk-KH2OWUUA.js +0 -163
- package/Build/Workers/chunk-KQIZ7AFF.js +0 -8366
- package/Build/Workers/chunk-KVE5EAPO.js +0 -398
- package/Build/Workers/chunk-OAOREOSO.js +0 -940
- package/Build/Workers/chunk-OFJRMGNX.js +0 -788
- package/Build/Workers/chunk-PLLZB3R4.js +0 -198
- package/Build/Workers/chunk-POY6ZE32.js +0 -2058
- package/Build/Workers/chunk-PV5B2YNB.js +0 -2719
- package/Build/Workers/chunk-Q2DXNFYW.js +0 -414
- package/Build/Workers/chunk-QWV2DM66.js +0 -1443
- package/Build/Workers/chunk-R73BHGGI.js +0 -305
- package/Build/Workers/chunk-S3AE3MZZ.js +0 -511
- package/Build/Workers/chunk-SBFTVHRW.js +0 -57
- package/Build/Workers/chunk-SOR7PD4V.js +0 -114
- package/Build/Workers/chunk-TO7TWUET.js +0 -476
- package/Build/Workers/chunk-TSAJNE4K.js +0 -101
- package/Build/Workers/chunk-TWF4XRZ6.js +0 -73
- package/Build/Workers/chunk-UTWLMOPM.js +0 -387
- package/Build/Workers/chunk-UYT2PBMV.js +0 -58
- package/Build/Workers/chunk-WAS3IHIQ.js +0 -288
- package/Build/Workers/chunk-WO5ZNC7S.js +0 -1045
- package/Build/Workers/chunk-X65Y2JSA.js +0 -55
- package/Build/Workers/chunk-XOVHLPKW.js +0 -299
- package/Build/Workers/chunk-YPGJSFOO.js +0 -1460
- package/Build/Workers/combineGeometry.js +0 -66
- package/Build/Workers/createBoxGeometry.js +0 -58
- package/Build/Workers/createBoxOutlineGeometry.js +0 -231
- package/Build/Workers/createCircleGeometry.js +0 -201
- package/Build/Workers/createCircleOutlineGeometry.js +0 -147
- package/Build/Workers/createCoplanarPolygonGeometry.js +0 -505
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +0 -225
- package/Build/Workers/createCorridorGeometry.js +0 -1258
- package/Build/Workers/createCorridorOutlineGeometry.js +0 -563
- package/Build/Workers/createCylinderGeometry.js +0 -60
- package/Build/Workers/createCylinderOutlineGeometry.js +0 -231
- package/Build/Workers/createEllipseGeometry.js +0 -72
- package/Build/Workers/createEllipseOutlineGeometry.js +0 -65
- package/Build/Workers/createEllipsoidGeometry.js +0 -59
- package/Build/Workers/createEllipsoidOutlineGeometry.js +0 -61
- package/Build/Workers/createFrustumGeometry.js +0 -58
- package/Build/Workers/createFrustumOutlineGeometry.js +0 -234
- package/Build/Workers/createGeometry.js +0 -173
- package/Build/Workers/createGroundPolylineGeometry.js +0 -1602
- package/Build/Workers/createPlaneGeometry.js +0 -223
- package/Build/Workers/createPlaneOutlineGeometry.js +0 -124
- package/Build/Workers/createPolygonGeometry.js +0 -1404
- package/Build/Workers/createPolygonOutlineGeometry.js +0 -532
- package/Build/Workers/createPolylineGeometry.js +0 -491
- package/Build/Workers/createPolylineVolumeGeometry.js +0 -374
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +0 -272
- package/Build/Workers/createRectangleGeometry.js +0 -1264
- package/Build/Workers/createRectangleOutlineGeometry.js +0 -476
- package/Build/Workers/createSimplePolylineGeometry.js +0 -397
- package/Build/Workers/createSphereGeometry.js +0 -116
- package/Build/Workers/createSphereOutlineGeometry.js +0 -116
- package/Build/Workers/createTaskProcessorWorker.js +0 -32
- package/Build/Workers/createVectorTileClampedPolylines.js +0 -492
- package/Build/Workers/createVectorTileGeometries.js +0 -387
- package/Build/Workers/createVectorTilePoints.js +0 -114
- package/Build/Workers/createVectorTilePolygons.js +0 -386
- package/Build/Workers/createVectorTilePolylines.js +0 -262
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +0 -91
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -565
- package/Build/Workers/createVerticesFromHeightmap.js +0 -2254
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -499
- package/Build/Workers/createWallGeometry.js +0 -487
- package/Build/Workers/createWallOutlineGeometry.js +0 -335
- package/Build/Workers/decodeDraco.js +0 -369
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +0 -2680
- package/Build/Workers/decodeI3S.js +0 -1339
- package/Build/Workers/gaussianSplatSorter.js +0 -62
- package/Build/Workers/gaussianSplatTextureGenerator.js +0 -68
- package/Build/Workers/incrementallyBuildTerrainPicker.js +0 -121
- package/Build/Workers/transcodeKTX2.js +0 -3463
- package/Build/Workers/transferTypedArrayTest.js +0 -41
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +0 -820
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +0 -95
|
@@ -1,487 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
-
* Version 0.0.1
|
|
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
|
-
WallGeometryLibrary_default
|
|
28
|
-
} from "./chunk-PLLZB3R4.js";
|
|
29
|
-
import "./chunk-Q2DXNFYW.js";
|
|
30
|
-
import "./chunk-AIW5F22O.js";
|
|
31
|
-
import {
|
|
32
|
-
VertexFormat_default
|
|
33
|
-
} from "./chunk-I76SRIKN.js";
|
|
34
|
-
import "./chunk-HAY6YE7M.js";
|
|
35
|
-
import "./chunk-FVYRV2T6.js";
|
|
36
|
-
import "./chunk-66YGZWBI.js";
|
|
37
|
-
import "./chunk-J4MIJCN5.js";
|
|
38
|
-
import {
|
|
39
|
-
IndexDatatype_default
|
|
40
|
-
} from "./chunk-55IROWAX.js";
|
|
41
|
-
import {
|
|
42
|
-
GeometryAttributes_default
|
|
43
|
-
} from "./chunk-BOV6T7FO.js";
|
|
44
|
-
import {
|
|
45
|
-
GeometryAttribute_default,
|
|
46
|
-
Geometry_default,
|
|
47
|
-
PrimitiveType_default
|
|
48
|
-
} from "./chunk-XOVHLPKW.js";
|
|
49
|
-
import {
|
|
50
|
-
BoundingSphere_default
|
|
51
|
-
} from "./chunk-OAOREOSO.js";
|
|
52
|
-
import "./chunk-EKMWNF4U.js";
|
|
53
|
-
import "./chunk-KQIZ7AFF.js";
|
|
54
|
-
import "./chunk-POY6ZE32.js";
|
|
55
|
-
import {
|
|
56
|
-
ComponentDatatype_default
|
|
57
|
-
} from "./chunk-AL22JVIA.js";
|
|
58
|
-
import "./chunk-5VZISKJF.js";
|
|
59
|
-
import "./chunk-UYT2PBMV.js";
|
|
60
|
-
import {
|
|
61
|
-
Ellipsoid_default
|
|
62
|
-
} from "./chunk-YPGJSFOO.js";
|
|
63
|
-
import {
|
|
64
|
-
Cartesian3_default,
|
|
65
|
-
Frozen_default
|
|
66
|
-
} from "./chunk-QWV2DM66.js";
|
|
67
|
-
import {
|
|
68
|
-
Math_default
|
|
69
|
-
} from "./chunk-6XJO625E.js";
|
|
70
|
-
import {
|
|
71
|
-
DeveloperError_default
|
|
72
|
-
} from "./chunk-KH2OWUUA.js";
|
|
73
|
-
import {
|
|
74
|
-
defined_default
|
|
75
|
-
} from "./chunk-AVSQILVI.js";
|
|
76
|
-
|
|
77
|
-
// packages/engine/Source/Core/WallGeometry.js
|
|
78
|
-
var scratchCartesian3Position1 = new Cartesian3_default();
|
|
79
|
-
var scratchCartesian3Position2 = new Cartesian3_default();
|
|
80
|
-
var scratchCartesian3Position4 = new Cartesian3_default();
|
|
81
|
-
var scratchCartesian3Position5 = new Cartesian3_default();
|
|
82
|
-
var scratchBitangent = new Cartesian3_default();
|
|
83
|
-
var scratchTangent = new Cartesian3_default();
|
|
84
|
-
var scratchNormal = new Cartesian3_default();
|
|
85
|
-
function WallGeometry(options) {
|
|
86
|
-
options = options ?? Frozen_default.EMPTY_OBJECT;
|
|
87
|
-
const wallPositions = options.positions;
|
|
88
|
-
const maximumHeights = options.maximumHeights;
|
|
89
|
-
const minimumHeights = options.minimumHeights;
|
|
90
|
-
if (!defined_default(wallPositions)) {
|
|
91
|
-
throw new DeveloperError_default("options.positions is required.");
|
|
92
|
-
}
|
|
93
|
-
if (defined_default(maximumHeights) && maximumHeights.length !== wallPositions.length) {
|
|
94
|
-
throw new DeveloperError_default(
|
|
95
|
-
"options.positions and options.maximumHeights must have the same length."
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
if (defined_default(minimumHeights) && minimumHeights.length !== wallPositions.length) {
|
|
99
|
-
throw new DeveloperError_default(
|
|
100
|
-
"options.positions and options.minimumHeights must have the same length."
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
const vertexFormat = options.vertexFormat ?? VertexFormat_default.DEFAULT;
|
|
104
|
-
const granularity = options.granularity ?? Math_default.RADIANS_PER_DEGREE;
|
|
105
|
-
const ellipsoid = options.ellipsoid ?? Ellipsoid_default.default;
|
|
106
|
-
this._positions = wallPositions;
|
|
107
|
-
this._minimumHeights = minimumHeights;
|
|
108
|
-
this._maximumHeights = maximumHeights;
|
|
109
|
-
this._vertexFormat = VertexFormat_default.clone(vertexFormat);
|
|
110
|
-
this._granularity = granularity;
|
|
111
|
-
this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
|
|
112
|
-
this._workerName = "createWallGeometry";
|
|
113
|
-
let numComponents = 1 + wallPositions.length * Cartesian3_default.packedLength + 2;
|
|
114
|
-
if (defined_default(minimumHeights)) {
|
|
115
|
-
numComponents += minimumHeights.length;
|
|
116
|
-
}
|
|
117
|
-
if (defined_default(maximumHeights)) {
|
|
118
|
-
numComponents += maximumHeights.length;
|
|
119
|
-
}
|
|
120
|
-
this.packedLength = numComponents + Ellipsoid_default.packedLength + VertexFormat_default.packedLength + 1;
|
|
121
|
-
}
|
|
122
|
-
WallGeometry.pack = function(value, array, startingIndex) {
|
|
123
|
-
if (!defined_default(value)) {
|
|
124
|
-
throw new DeveloperError_default("value is required");
|
|
125
|
-
}
|
|
126
|
-
if (!defined_default(array)) {
|
|
127
|
-
throw new DeveloperError_default("array is required");
|
|
128
|
-
}
|
|
129
|
-
startingIndex = startingIndex ?? 0;
|
|
130
|
-
let i;
|
|
131
|
-
const positions = value._positions;
|
|
132
|
-
let length = positions.length;
|
|
133
|
-
array[startingIndex++] = length;
|
|
134
|
-
for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
|
|
135
|
-
Cartesian3_default.pack(positions[i], array, startingIndex);
|
|
136
|
-
}
|
|
137
|
-
const minimumHeights = value._minimumHeights;
|
|
138
|
-
length = defined_default(minimumHeights) ? minimumHeights.length : 0;
|
|
139
|
-
array[startingIndex++] = length;
|
|
140
|
-
if (defined_default(minimumHeights)) {
|
|
141
|
-
for (i = 0; i < length; ++i) {
|
|
142
|
-
array[startingIndex++] = minimumHeights[i];
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
const maximumHeights = value._maximumHeights;
|
|
146
|
-
length = defined_default(maximumHeights) ? maximumHeights.length : 0;
|
|
147
|
-
array[startingIndex++] = length;
|
|
148
|
-
if (defined_default(maximumHeights)) {
|
|
149
|
-
for (i = 0; i < length; ++i) {
|
|
150
|
-
array[startingIndex++] = maximumHeights[i];
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
|
|
154
|
-
startingIndex += Ellipsoid_default.packedLength;
|
|
155
|
-
VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
|
|
156
|
-
startingIndex += VertexFormat_default.packedLength;
|
|
157
|
-
array[startingIndex] = value._granularity;
|
|
158
|
-
return array;
|
|
159
|
-
};
|
|
160
|
-
var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
|
|
161
|
-
var scratchVertexFormat = new VertexFormat_default();
|
|
162
|
-
var scratchOptions = {
|
|
163
|
-
positions: void 0,
|
|
164
|
-
minimumHeights: void 0,
|
|
165
|
-
maximumHeights: void 0,
|
|
166
|
-
ellipsoid: scratchEllipsoid,
|
|
167
|
-
vertexFormat: scratchVertexFormat,
|
|
168
|
-
granularity: void 0
|
|
169
|
-
};
|
|
170
|
-
WallGeometry.unpack = function(array, startingIndex, result) {
|
|
171
|
-
if (!defined_default(array)) {
|
|
172
|
-
throw new DeveloperError_default("array is required");
|
|
173
|
-
}
|
|
174
|
-
startingIndex = startingIndex ?? 0;
|
|
175
|
-
let i;
|
|
176
|
-
let length = array[startingIndex++];
|
|
177
|
-
const positions = new Array(length);
|
|
178
|
-
for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
|
|
179
|
-
positions[i] = Cartesian3_default.unpack(array, startingIndex);
|
|
180
|
-
}
|
|
181
|
-
length = array[startingIndex++];
|
|
182
|
-
let minimumHeights;
|
|
183
|
-
if (length > 0) {
|
|
184
|
-
minimumHeights = new Array(length);
|
|
185
|
-
for (i = 0; i < length; ++i) {
|
|
186
|
-
minimumHeights[i] = array[startingIndex++];
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
length = array[startingIndex++];
|
|
190
|
-
let maximumHeights;
|
|
191
|
-
if (length > 0) {
|
|
192
|
-
maximumHeights = new Array(length);
|
|
193
|
-
for (i = 0; i < length; ++i) {
|
|
194
|
-
maximumHeights[i] = array[startingIndex++];
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
|
|
198
|
-
startingIndex += Ellipsoid_default.packedLength;
|
|
199
|
-
const vertexFormat = VertexFormat_default.unpack(
|
|
200
|
-
array,
|
|
201
|
-
startingIndex,
|
|
202
|
-
scratchVertexFormat
|
|
203
|
-
);
|
|
204
|
-
startingIndex += VertexFormat_default.packedLength;
|
|
205
|
-
const granularity = array[startingIndex];
|
|
206
|
-
if (!defined_default(result)) {
|
|
207
|
-
scratchOptions.positions = positions;
|
|
208
|
-
scratchOptions.minimumHeights = minimumHeights;
|
|
209
|
-
scratchOptions.maximumHeights = maximumHeights;
|
|
210
|
-
scratchOptions.granularity = granularity;
|
|
211
|
-
return new WallGeometry(scratchOptions);
|
|
212
|
-
}
|
|
213
|
-
result._positions = positions;
|
|
214
|
-
result._minimumHeights = minimumHeights;
|
|
215
|
-
result._maximumHeights = maximumHeights;
|
|
216
|
-
result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
|
|
217
|
-
result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
|
|
218
|
-
result._granularity = granularity;
|
|
219
|
-
return result;
|
|
220
|
-
};
|
|
221
|
-
WallGeometry.fromConstantHeights = function(options) {
|
|
222
|
-
options = options ?? Frozen_default.EMPTY_OBJECT;
|
|
223
|
-
const positions = options.positions;
|
|
224
|
-
if (!defined_default(positions)) {
|
|
225
|
-
throw new DeveloperError_default("options.positions is required.");
|
|
226
|
-
}
|
|
227
|
-
let minHeights;
|
|
228
|
-
let maxHeights;
|
|
229
|
-
const min = options.minimumHeight;
|
|
230
|
-
const max = options.maximumHeight;
|
|
231
|
-
const doMin = defined_default(min);
|
|
232
|
-
const doMax = defined_default(max);
|
|
233
|
-
if (doMin || doMax) {
|
|
234
|
-
const length = positions.length;
|
|
235
|
-
minHeights = doMin ? new Array(length) : void 0;
|
|
236
|
-
maxHeights = doMax ? new Array(length) : void 0;
|
|
237
|
-
for (let i = 0; i < length; ++i) {
|
|
238
|
-
if (doMin) {
|
|
239
|
-
minHeights[i] = min;
|
|
240
|
-
}
|
|
241
|
-
if (doMax) {
|
|
242
|
-
maxHeights[i] = max;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
const newOptions = {
|
|
247
|
-
positions,
|
|
248
|
-
maximumHeights: maxHeights,
|
|
249
|
-
minimumHeights: minHeights,
|
|
250
|
-
ellipsoid: options.ellipsoid,
|
|
251
|
-
vertexFormat: options.vertexFormat
|
|
252
|
-
};
|
|
253
|
-
return new WallGeometry(newOptions);
|
|
254
|
-
};
|
|
255
|
-
WallGeometry.createGeometry = function(wallGeometry) {
|
|
256
|
-
const wallPositions = wallGeometry._positions;
|
|
257
|
-
const minimumHeights = wallGeometry._minimumHeights;
|
|
258
|
-
const maximumHeights = wallGeometry._maximumHeights;
|
|
259
|
-
const vertexFormat = wallGeometry._vertexFormat;
|
|
260
|
-
const granularity = wallGeometry._granularity;
|
|
261
|
-
const ellipsoid = wallGeometry._ellipsoid;
|
|
262
|
-
const pos = WallGeometryLibrary_default.computePositions(
|
|
263
|
-
ellipsoid,
|
|
264
|
-
wallPositions,
|
|
265
|
-
maximumHeights,
|
|
266
|
-
minimumHeights,
|
|
267
|
-
granularity,
|
|
268
|
-
true
|
|
269
|
-
);
|
|
270
|
-
if (!defined_default(pos)) {
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
const bottomPositions = pos.bottomPositions;
|
|
274
|
-
const topPositions = pos.topPositions;
|
|
275
|
-
const numCorners = pos.numCorners;
|
|
276
|
-
let length = topPositions.length;
|
|
277
|
-
let size = length * 2;
|
|
278
|
-
const positions = vertexFormat.position ? new Float64Array(size) : void 0;
|
|
279
|
-
const normals = vertexFormat.normal ? new Float32Array(size) : void 0;
|
|
280
|
-
const tangents = vertexFormat.tangent ? new Float32Array(size) : void 0;
|
|
281
|
-
const bitangents = vertexFormat.bitangent ? new Float32Array(size) : void 0;
|
|
282
|
-
const textureCoordinates = vertexFormat.st ? new Float32Array(size / 3 * 2) : void 0;
|
|
283
|
-
let positionIndex = 0;
|
|
284
|
-
let normalIndex = 0;
|
|
285
|
-
let bitangentIndex = 0;
|
|
286
|
-
let tangentIndex = 0;
|
|
287
|
-
let stIndex = 0;
|
|
288
|
-
let normal = scratchNormal;
|
|
289
|
-
let tangent = scratchTangent;
|
|
290
|
-
let bitangent = scratchBitangent;
|
|
291
|
-
let recomputeNormal = true;
|
|
292
|
-
length /= 3;
|
|
293
|
-
let i;
|
|
294
|
-
let s = 0;
|
|
295
|
-
const ds = 1 / (length - numCorners - 1);
|
|
296
|
-
for (i = 0; i < length; ++i) {
|
|
297
|
-
const i3 = i * 3;
|
|
298
|
-
const topPosition = Cartesian3_default.fromArray(
|
|
299
|
-
topPositions,
|
|
300
|
-
i3,
|
|
301
|
-
scratchCartesian3Position1
|
|
302
|
-
);
|
|
303
|
-
const bottomPosition = Cartesian3_default.fromArray(
|
|
304
|
-
bottomPositions,
|
|
305
|
-
i3,
|
|
306
|
-
scratchCartesian3Position2
|
|
307
|
-
);
|
|
308
|
-
if (vertexFormat.position) {
|
|
309
|
-
positions[positionIndex++] = bottomPosition.x;
|
|
310
|
-
positions[positionIndex++] = bottomPosition.y;
|
|
311
|
-
positions[positionIndex++] = bottomPosition.z;
|
|
312
|
-
positions[positionIndex++] = topPosition.x;
|
|
313
|
-
positions[positionIndex++] = topPosition.y;
|
|
314
|
-
positions[positionIndex++] = topPosition.z;
|
|
315
|
-
}
|
|
316
|
-
if (vertexFormat.st) {
|
|
317
|
-
textureCoordinates[stIndex++] = s;
|
|
318
|
-
textureCoordinates[stIndex++] = 0;
|
|
319
|
-
textureCoordinates[stIndex++] = s;
|
|
320
|
-
textureCoordinates[stIndex++] = 1;
|
|
321
|
-
}
|
|
322
|
-
if (vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent) {
|
|
323
|
-
let nextTop = Cartesian3_default.clone(
|
|
324
|
-
Cartesian3_default.ZERO,
|
|
325
|
-
scratchCartesian3Position5
|
|
326
|
-
);
|
|
327
|
-
const groundPosition = Cartesian3_default.subtract(
|
|
328
|
-
topPosition,
|
|
329
|
-
ellipsoid.geodeticSurfaceNormal(
|
|
330
|
-
topPosition,
|
|
331
|
-
scratchCartesian3Position2
|
|
332
|
-
),
|
|
333
|
-
scratchCartesian3Position2
|
|
334
|
-
);
|
|
335
|
-
if (i + 1 < length) {
|
|
336
|
-
nextTop = Cartesian3_default.fromArray(
|
|
337
|
-
topPositions,
|
|
338
|
-
i3 + 3,
|
|
339
|
-
scratchCartesian3Position5
|
|
340
|
-
);
|
|
341
|
-
}
|
|
342
|
-
if (recomputeNormal) {
|
|
343
|
-
const scalednextPosition = Cartesian3_default.subtract(
|
|
344
|
-
nextTop,
|
|
345
|
-
topPosition,
|
|
346
|
-
scratchCartesian3Position4
|
|
347
|
-
);
|
|
348
|
-
const scaledGroundPosition = Cartesian3_default.subtract(
|
|
349
|
-
groundPosition,
|
|
350
|
-
topPosition,
|
|
351
|
-
scratchCartesian3Position1
|
|
352
|
-
);
|
|
353
|
-
normal = Cartesian3_default.normalize(
|
|
354
|
-
Cartesian3_default.cross(scaledGroundPosition, scalednextPosition, normal),
|
|
355
|
-
normal
|
|
356
|
-
);
|
|
357
|
-
recomputeNormal = false;
|
|
358
|
-
}
|
|
359
|
-
if (Cartesian3_default.equalsEpsilon(topPosition, nextTop, Math_default.EPSILON10)) {
|
|
360
|
-
recomputeNormal = true;
|
|
361
|
-
} else {
|
|
362
|
-
s += ds;
|
|
363
|
-
if (vertexFormat.tangent) {
|
|
364
|
-
tangent = Cartesian3_default.normalize(
|
|
365
|
-
Cartesian3_default.subtract(nextTop, topPosition, tangent),
|
|
366
|
-
tangent
|
|
367
|
-
);
|
|
368
|
-
}
|
|
369
|
-
if (vertexFormat.bitangent) {
|
|
370
|
-
bitangent = Cartesian3_default.normalize(
|
|
371
|
-
Cartesian3_default.cross(normal, tangent, bitangent),
|
|
372
|
-
bitangent
|
|
373
|
-
);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
if (vertexFormat.normal) {
|
|
377
|
-
normals[normalIndex++] = normal.x;
|
|
378
|
-
normals[normalIndex++] = normal.y;
|
|
379
|
-
normals[normalIndex++] = normal.z;
|
|
380
|
-
normals[normalIndex++] = normal.x;
|
|
381
|
-
normals[normalIndex++] = normal.y;
|
|
382
|
-
normals[normalIndex++] = normal.z;
|
|
383
|
-
}
|
|
384
|
-
if (vertexFormat.tangent) {
|
|
385
|
-
tangents[tangentIndex++] = tangent.x;
|
|
386
|
-
tangents[tangentIndex++] = tangent.y;
|
|
387
|
-
tangents[tangentIndex++] = tangent.z;
|
|
388
|
-
tangents[tangentIndex++] = tangent.x;
|
|
389
|
-
tangents[tangentIndex++] = tangent.y;
|
|
390
|
-
tangents[tangentIndex++] = tangent.z;
|
|
391
|
-
}
|
|
392
|
-
if (vertexFormat.bitangent) {
|
|
393
|
-
bitangents[bitangentIndex++] = bitangent.x;
|
|
394
|
-
bitangents[bitangentIndex++] = bitangent.y;
|
|
395
|
-
bitangents[bitangentIndex++] = bitangent.z;
|
|
396
|
-
bitangents[bitangentIndex++] = bitangent.x;
|
|
397
|
-
bitangents[bitangentIndex++] = bitangent.y;
|
|
398
|
-
bitangents[bitangentIndex++] = bitangent.z;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
const attributes = new GeometryAttributes_default();
|
|
403
|
-
if (vertexFormat.position) {
|
|
404
|
-
attributes.position = new GeometryAttribute_default({
|
|
405
|
-
componentDatatype: ComponentDatatype_default.DOUBLE,
|
|
406
|
-
componentsPerAttribute: 3,
|
|
407
|
-
values: positions
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
if (vertexFormat.normal) {
|
|
411
|
-
attributes.normal = new GeometryAttribute_default({
|
|
412
|
-
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
413
|
-
componentsPerAttribute: 3,
|
|
414
|
-
values: normals
|
|
415
|
-
});
|
|
416
|
-
}
|
|
417
|
-
if (vertexFormat.tangent) {
|
|
418
|
-
attributes.tangent = new GeometryAttribute_default({
|
|
419
|
-
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
420
|
-
componentsPerAttribute: 3,
|
|
421
|
-
values: tangents
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
if (vertexFormat.bitangent) {
|
|
425
|
-
attributes.bitangent = new GeometryAttribute_default({
|
|
426
|
-
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
427
|
-
componentsPerAttribute: 3,
|
|
428
|
-
values: bitangents
|
|
429
|
-
});
|
|
430
|
-
}
|
|
431
|
-
if (vertexFormat.st) {
|
|
432
|
-
attributes.st = new GeometryAttribute_default({
|
|
433
|
-
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
434
|
-
componentsPerAttribute: 2,
|
|
435
|
-
values: textureCoordinates
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
|
-
const numVertices = size / 3;
|
|
439
|
-
size -= 6 * (numCorners + 1);
|
|
440
|
-
const indices = IndexDatatype_default.createTypedArray(numVertices, size);
|
|
441
|
-
let edgeIndex = 0;
|
|
442
|
-
for (i = 0; i < numVertices - 2; i += 2) {
|
|
443
|
-
const LL = i;
|
|
444
|
-
const LR = i + 2;
|
|
445
|
-
const pl = Cartesian3_default.fromArray(
|
|
446
|
-
positions,
|
|
447
|
-
LL * 3,
|
|
448
|
-
scratchCartesian3Position1
|
|
449
|
-
);
|
|
450
|
-
const pr = Cartesian3_default.fromArray(
|
|
451
|
-
positions,
|
|
452
|
-
LR * 3,
|
|
453
|
-
scratchCartesian3Position2
|
|
454
|
-
);
|
|
455
|
-
if (Cartesian3_default.equalsEpsilon(pl, pr, Math_default.EPSILON10)) {
|
|
456
|
-
continue;
|
|
457
|
-
}
|
|
458
|
-
const UL = i + 1;
|
|
459
|
-
const UR = i + 3;
|
|
460
|
-
indices[edgeIndex++] = UL;
|
|
461
|
-
indices[edgeIndex++] = LL;
|
|
462
|
-
indices[edgeIndex++] = UR;
|
|
463
|
-
indices[edgeIndex++] = UR;
|
|
464
|
-
indices[edgeIndex++] = LL;
|
|
465
|
-
indices[edgeIndex++] = LR;
|
|
466
|
-
}
|
|
467
|
-
return new Geometry_default({
|
|
468
|
-
attributes,
|
|
469
|
-
indices,
|
|
470
|
-
primitiveType: PrimitiveType_default.TRIANGLES,
|
|
471
|
-
boundingSphere: new BoundingSphere_default.fromVertices(positions)
|
|
472
|
-
});
|
|
473
|
-
};
|
|
474
|
-
var WallGeometry_default = WallGeometry;
|
|
475
|
-
|
|
476
|
-
// packages/engine/Source/Workers/createWallGeometry.js
|
|
477
|
-
function createWallGeometry(wallGeometry, offset) {
|
|
478
|
-
if (defined_default(offset)) {
|
|
479
|
-
wallGeometry = WallGeometry_default.unpack(wallGeometry, offset);
|
|
480
|
-
}
|
|
481
|
-
wallGeometry._ellipsoid = Ellipsoid_default.clone(wallGeometry._ellipsoid);
|
|
482
|
-
return WallGeometry_default.createGeometry(wallGeometry);
|
|
483
|
-
}
|
|
484
|
-
var createWallGeometry_default = createWallGeometry;
|
|
485
|
-
export {
|
|
486
|
-
createWallGeometry_default as default
|
|
487
|
-
};
|