@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.
Files changed (174) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +640 -0
  2. package/Build/Workers/chunk-23CHWHW6.js +97 -0
  3. package/Build/Workers/chunk-27JI7F7B.js +101 -0
  4. package/Build/Workers/chunk-2OWEFNS4.js +97 -0
  5. package/Build/Workers/chunk-2VN5W6HA.js +352 -0
  6. package/Build/Workers/chunk-2YAONTGQ.js +476 -0
  7. package/Build/Workers/chunk-324L25HV.js +352 -0
  8. package/Build/Workers/chunk-3EZBCDBK.js +439 -0
  9. package/Build/Workers/chunk-3JPA6GA3.js +837 -0
  10. package/Build/Workers/chunk-3WRJXCJS.js +497 -0
  11. package/Build/Workers/chunk-3ZJ6X3BW.js +57 -0
  12. package/Build/Workers/chunk-42I3QSKJ.js +280 -0
  13. package/Build/Workers/chunk-4BJHO56J.js +171 -0
  14. package/Build/Workers/chunk-4GPHI5UY.js +288 -0
  15. package/Build/Workers/chunk-4NAHNN5G.js +288 -0
  16. package/Build/Workers/chunk-54AFUJNV.js +414 -0
  17. package/Build/Workers/chunk-553BNJPP.js +299 -0
  18. package/Build/Workers/chunk-56MKFDJH.js +778 -0
  19. package/Build/Workers/chunk-5DPCF65K.js +162 -0
  20. package/Build/Workers/chunk-5MCUZL44.js +455 -0
  21. package/Build/Workers/chunk-5T4DXPEL.js +299 -0
  22. package/Build/Workers/chunk-5UHIRI2A.js +1800 -0
  23. package/Build/Workers/chunk-664SI23B.js +368 -0
  24. package/Build/Workers/chunk-6GNLKYQO.js +114 -0
  25. package/Build/Workers/chunk-6ZF4QOFM.js +2058 -0
  26. package/Build/Workers/chunk-763Q2YKY.js +1483 -0
  27. package/Build/Workers/chunk-7R74V5Z3.js +241 -0
  28. package/Build/Workers/chunk-7X6CLAD2.js +439 -0
  29. package/Build/Workers/chunk-ADQVXDEJ.js +2719 -0
  30. package/Build/Workers/chunk-ATC2WXI4.js +1054 -0
  31. package/Build/Workers/chunk-B5ZUBUPB.js +398 -0
  32. package/Build/Workers/chunk-BHTWF7UG.js +73 -0
  33. package/Build/Workers/chunk-BLZILZWF.js +2719 -0
  34. package/Build/Workers/chunk-CCPKBCZD.js +171 -0
  35. package/Build/Workers/chunk-CMAG5O53.js +1483 -0
  36. package/Build/Workers/chunk-D3FNWB3Q.js +138 -0
  37. package/Build/Workers/chunk-DAYNPAVN.js +58 -0
  38. package/Build/Workers/chunk-DKJMD2HX.js +2058 -0
  39. package/Build/Workers/chunk-DVTKM7FF.js +256 -0
  40. package/Build/Workers/chunk-FTHCZAWE.js +44 -0
  41. package/Build/Workers/chunk-FTXEOX64.js +1067 -0
  42. package/Build/Workers/chunk-FUFHIXPT.js +305 -0
  43. package/Build/Workers/chunk-G2KELS4I.js +138 -0
  44. package/Build/Workers/chunk-GCZNJHST.js +162 -0
  45. package/Build/Workers/chunk-GJFIEALZ.js +387 -0
  46. package/Build/Workers/chunk-HC6DDPFU.js +198 -0
  47. package/Build/Workers/chunk-HHN2M3ES.js +682 -0
  48. package/Build/Workers/chunk-HHUKBKWS.js +414 -0
  49. package/Build/Workers/chunk-HLIXASKN.js +476 -0
  50. package/Build/Workers/chunk-IEBTKCMB.js +497 -0
  51. package/Build/Workers/chunk-IYXLSOLF.js +692 -0
  52. package/Build/Workers/chunk-JJD7S2CV.js +3514 -0
  53. package/Build/Workers/chunk-K6PDZWHZ.js +1460 -0
  54. package/Build/Workers/chunk-KWFCDTXS.js +940 -0
  55. package/Build/Workers/chunk-LENXRROQ.js +398 -0
  56. package/Build/Workers/chunk-MB2ZJQR3.js +55 -0
  57. package/Build/Workers/chunk-MCNY7SPD.js +139 -0
  58. package/Build/Workers/chunk-MHEKNHOF.js +511 -0
  59. package/Build/Workers/chunk-MRLJERN3.js +114 -0
  60. package/Build/Workers/chunk-NOJAQPXU.js +102 -0
  61. package/Build/Workers/chunk-OAFZ26QL.js +837 -0
  62. package/Build/Workers/chunk-OBQVOEPZ.js +124 -0
  63. package/Build/Workers/chunk-OC63Z35M.js +280 -0
  64. package/Build/Workers/chunk-OEAC5XUG.js +73 -0
  65. package/Build/Workers/chunk-OQK27J4J.js +139 -0
  66. package/Build/Workers/chunk-OTDNJAYJ.js +55 -0
  67. package/Build/Workers/chunk-PGYA2CMO.js +642 -0
  68. package/Build/Workers/chunk-PSDWIJMU.js +219 -0
  69. package/Build/Workers/chunk-PW3GQAXA.js +3514 -0
  70. package/Build/Workers/chunk-Q2YRPH7V.js +1067 -0
  71. package/Build/Workers/chunk-QDNIPHD7.js +368 -0
  72. package/Build/Workers/chunk-QEGQDFX2.js +1045 -0
  73. package/Build/Workers/chunk-R5U3MYPS.js +198 -0
  74. package/Build/Workers/chunk-RJIH4MDC.js +241 -0
  75. package/Build/Workers/chunk-RO7SDGOD.js +352 -0
  76. package/Build/Workers/chunk-RTJ6L5O4.js +163 -0
  77. package/Build/Workers/chunk-SCNCHSTQ.js +642 -0
  78. package/Build/Workers/chunk-SG56ZOPD.js +788 -0
  79. package/Build/Workers/chunk-SHQEATE2.js +1045 -0
  80. package/Build/Workers/chunk-SPL7JK6K.js +1054 -0
  81. package/Build/Workers/chunk-SYCWSSRX.js +1443 -0
  82. package/Build/Workers/chunk-TEZGNCXH.js +8366 -0
  83. package/Build/Workers/chunk-TIQZUI5N.js +44 -0
  84. package/Build/Workers/chunk-TKJHRY4V.js +511 -0
  85. package/Build/Workers/chunk-TLXEQ5QY.js +778 -0
  86. package/Build/Workers/chunk-UIMHSWDJ.js +455 -0
  87. package/Build/Workers/chunk-UO3AWZR3.js +352 -0
  88. package/Build/Workers/chunk-UTXXZ7XH.js +940 -0
  89. package/Build/Workers/chunk-V2TRFTCU.js +1317 -0
  90. package/Build/Workers/chunk-V4I3IKAK.js +1460 -0
  91. package/Build/Workers/chunk-W2EK42GB.js +75 -0
  92. package/Build/Workers/chunk-W2OMUTYA.js +1800 -0
  93. package/Build/Workers/chunk-WHOEQFL4.js +682 -0
  94. package/Build/Workers/chunk-XHNWVOIJ.js +219 -0
  95. package/Build/Workers/chunk-XNKQLSHI.js +629 -0
  96. package/Build/Workers/chunk-XOXF37BU.js +1317 -0
  97. package/Build/Workers/chunk-YC6PFDXQ.js +8366 -0
  98. package/Build/Workers/chunk-YFJB3US4.js +102 -0
  99. package/Build/Workers/chunk-YMXATXRN.js +57 -0
  100. package/Build/Workers/chunk-YVRD2PO5.js +124 -0
  101. package/Build/Workers/chunk-Z24A5EMJ.js +387 -0
  102. package/Build/Workers/chunk-Z4IW5XUY.js +788 -0
  103. package/Build/Workers/chunk-ZFHCP7RN.js +692 -0
  104. package/Build/Workers/chunk-ZHHEFNHL.js +37 -0
  105. package/Build/Workers/chunk-ZI5GDNEV.js +305 -0
  106. package/Build/Workers/chunk-ZYTMDBCR.js +1443 -0
  107. package/Build/Workers/combineGeometry.js +66 -0
  108. package/Build/Workers/createBoxGeometry.js +58 -0
  109. package/Build/Workers/createBoxOutlineGeometry.js +231 -0
  110. package/Build/Workers/createCircleGeometry.js +201 -0
  111. package/Build/Workers/createCircleOutlineGeometry.js +147 -0
  112. package/Build/Workers/createCoplanarPolygonGeometry.js +505 -0
  113. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +225 -0
  114. package/Build/Workers/createCorridorGeometry.js +1258 -0
  115. package/Build/Workers/createCorridorOutlineGeometry.js +563 -0
  116. package/Build/Workers/createCylinderGeometry.js +60 -0
  117. package/Build/Workers/createCylinderOutlineGeometry.js +231 -0
  118. package/Build/Workers/createEllipseGeometry.js +72 -0
  119. package/Build/Workers/createEllipseOutlineGeometry.js +65 -0
  120. package/Build/Workers/createEllipsoidGeometry.js +59 -0
  121. package/Build/Workers/createEllipsoidOutlineGeometry.js +61 -0
  122. package/Build/Workers/createFrustumGeometry.js +58 -0
  123. package/Build/Workers/createFrustumOutlineGeometry.js +234 -0
  124. package/Build/Workers/createGeometry.js +173 -0
  125. package/Build/Workers/createGroundPolylineGeometry.js +1602 -0
  126. package/Build/Workers/createPlaneGeometry.js +223 -0
  127. package/Build/Workers/createPlaneOutlineGeometry.js +124 -0
  128. package/Build/Workers/createPolygonGeometry.js +1404 -0
  129. package/Build/Workers/createPolygonOutlineGeometry.js +532 -0
  130. package/Build/Workers/createPolylineGeometry.js +491 -0
  131. package/Build/Workers/createPolylineVolumeGeometry.js +374 -0
  132. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +272 -0
  133. package/Build/Workers/createRectangleGeometry.js +1264 -0
  134. package/Build/Workers/createRectangleOutlineGeometry.js +476 -0
  135. package/Build/Workers/createSimplePolylineGeometry.js +397 -0
  136. package/Build/Workers/createSphereGeometry.js +116 -0
  137. package/Build/Workers/createSphereOutlineGeometry.js +116 -0
  138. package/Build/Workers/createTaskProcessorWorker.js +32 -0
  139. package/Build/Workers/createVectorTileClampedPolylines.js +492 -0
  140. package/Build/Workers/createVectorTileGeometries.js +387 -0
  141. package/Build/Workers/createVectorTilePoints.js +114 -0
  142. package/Build/Workers/createVectorTilePolygons.js +386 -0
  143. package/Build/Workers/createVectorTilePolylines.js +262 -0
  144. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +91 -0
  145. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +565 -0
  146. package/Build/Workers/createVerticesFromHeightmap.js +2254 -0
  147. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +499 -0
  148. package/Build/Workers/createWallGeometry.js +487 -0
  149. package/Build/Workers/createWallOutlineGeometry.js +335 -0
  150. package/Build/Workers/decodeDraco.js +369 -0
  151. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +2680 -0
  152. package/Build/Workers/decodeI3S.js +1339 -0
  153. package/Build/Workers/gaussianSplatSorter.js +62 -0
  154. package/Build/Workers/gaussianSplatTextureGenerator.js +68 -0
  155. package/Build/Workers/incrementallyBuildTerrainPicker.js +121 -0
  156. package/Build/Workers/transcodeKTX2.js +3463 -0
  157. package/Build/Workers/transferTypedArrayTest.js +41 -0
  158. package/Build/Workers/upsampleQuantizedTerrainMesh.js +820 -0
  159. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +95 -0
  160. package/Source/Scene/Cesium3DTileset.js +173 -0
  161. package/Source/Scene/GltfLoader.js +2 -2
  162. package/Source/Scene/Model/BarycentricWireframePipelineStage.js +176 -0
  163. package/Source/Scene/Model/I3dmLoader.js +2 -2
  164. package/Source/Scene/Model/Model.js +174 -2
  165. package/Source/Scene/Model/Model3DTileContent.js +18 -1
  166. package/Source/Scene/Model/ModelRuntimePrimitive.js +12 -1
  167. package/Source/Scene/Model/WireframePipelineStage.js +6 -2
  168. package/Source/Shaders/Model/ModelFS.glsl +12 -0
  169. package/Source/Shaders/Model/ModelFS.js +12 -0
  170. package/Source/Shaders/Model/ModelVS.glsl +4 -0
  171. package/Source/Shaders/Model/ModelVS.js +4 -0
  172. package/index.d.ts +166 -0
  173. package/index.js +57 -56
  174. package/package.json +1 -1
@@ -0,0 +1,335 @@
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
+ WallGeometryLibrary_default
28
+ } from "./chunk-R5U3MYPS.js";
29
+ import "./chunk-HHUKBKWS.js";
30
+ import "./chunk-324L25HV.js";
31
+ import "./chunk-23CHWHW6.js";
32
+ import "./chunk-5MCUZL44.js";
33
+ import "./chunk-XOXF37BU.js";
34
+ import "./chunk-CCPKBCZD.js";
35
+ import {
36
+ IndexDatatype_default
37
+ } from "./chunk-OQK27J4J.js";
38
+ import {
39
+ GeometryAttributes_default
40
+ } from "./chunk-FTHCZAWE.js";
41
+ import {
42
+ GeometryAttribute_default,
43
+ Geometry_default,
44
+ PrimitiveType_default
45
+ } from "./chunk-5T4DXPEL.js";
46
+ import {
47
+ BoundingSphere_default
48
+ } from "./chunk-UTXXZ7XH.js";
49
+ import "./chunk-MB2ZJQR3.js";
50
+ import "./chunk-TEZGNCXH.js";
51
+ import "./chunk-DKJMD2HX.js";
52
+ import {
53
+ ComponentDatatype_default
54
+ } from "./chunk-DVTKM7FF.js";
55
+ import "./chunk-XNKQLSHI.js";
56
+ import "./chunk-DAYNPAVN.js";
57
+ import {
58
+ Ellipsoid_default
59
+ } from "./chunk-V4I3IKAK.js";
60
+ import {
61
+ Cartesian3_default,
62
+ Frozen_default
63
+ } from "./chunk-ZYTMDBCR.js";
64
+ import {
65
+ Math_default
66
+ } from "./chunk-IEBTKCMB.js";
67
+ import {
68
+ DeveloperError_default
69
+ } from "./chunk-RTJ6L5O4.js";
70
+ import {
71
+ defined_default
72
+ } from "./chunk-W2EK42GB.js";
73
+
74
+ // packages/engine/Source/Core/WallOutlineGeometry.js
75
+ var scratchCartesian3Position1 = new Cartesian3_default();
76
+ var scratchCartesian3Position2 = new Cartesian3_default();
77
+ function WallOutlineGeometry(options) {
78
+ options = options ?? Frozen_default.EMPTY_OBJECT;
79
+ const wallPositions = options.positions;
80
+ const maximumHeights = options.maximumHeights;
81
+ const minimumHeights = options.minimumHeights;
82
+ if (!defined_default(wallPositions)) {
83
+ throw new DeveloperError_default("options.positions is required.");
84
+ }
85
+ if (defined_default(maximumHeights) && maximumHeights.length !== wallPositions.length) {
86
+ throw new DeveloperError_default(
87
+ "options.positions and options.maximumHeights must have the same length."
88
+ );
89
+ }
90
+ if (defined_default(minimumHeights) && minimumHeights.length !== wallPositions.length) {
91
+ throw new DeveloperError_default(
92
+ "options.positions and options.minimumHeights must have the same length."
93
+ );
94
+ }
95
+ const granularity = options.granularity ?? Math_default.RADIANS_PER_DEGREE;
96
+ const ellipsoid = options.ellipsoid ?? Ellipsoid_default.default;
97
+ this._positions = wallPositions;
98
+ this._minimumHeights = minimumHeights;
99
+ this._maximumHeights = maximumHeights;
100
+ this._granularity = granularity;
101
+ this._ellipsoid = Ellipsoid_default.clone(ellipsoid);
102
+ this._workerName = "createWallOutlineGeometry";
103
+ let numComponents = 1 + wallPositions.length * Cartesian3_default.packedLength + 2;
104
+ if (defined_default(minimumHeights)) {
105
+ numComponents += minimumHeights.length;
106
+ }
107
+ if (defined_default(maximumHeights)) {
108
+ numComponents += maximumHeights.length;
109
+ }
110
+ this.packedLength = numComponents + Ellipsoid_default.packedLength + 1;
111
+ }
112
+ WallOutlineGeometry.pack = function(value, array, startingIndex) {
113
+ if (!defined_default(value)) {
114
+ throw new DeveloperError_default("value is required");
115
+ }
116
+ if (!defined_default(array)) {
117
+ throw new DeveloperError_default("array is required");
118
+ }
119
+ startingIndex = startingIndex ?? 0;
120
+ let i;
121
+ const positions = value._positions;
122
+ let length = positions.length;
123
+ array[startingIndex++] = length;
124
+ for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
125
+ Cartesian3_default.pack(positions[i], array, startingIndex);
126
+ }
127
+ const minimumHeights = value._minimumHeights;
128
+ length = defined_default(minimumHeights) ? minimumHeights.length : 0;
129
+ array[startingIndex++] = length;
130
+ if (defined_default(minimumHeights)) {
131
+ for (i = 0; i < length; ++i) {
132
+ array[startingIndex++] = minimumHeights[i];
133
+ }
134
+ }
135
+ const maximumHeights = value._maximumHeights;
136
+ length = defined_default(maximumHeights) ? maximumHeights.length : 0;
137
+ array[startingIndex++] = length;
138
+ if (defined_default(maximumHeights)) {
139
+ for (i = 0; i < length; ++i) {
140
+ array[startingIndex++] = maximumHeights[i];
141
+ }
142
+ }
143
+ Ellipsoid_default.pack(value._ellipsoid, array, startingIndex);
144
+ startingIndex += Ellipsoid_default.packedLength;
145
+ array[startingIndex] = value._granularity;
146
+ return array;
147
+ };
148
+ var scratchEllipsoid = Ellipsoid_default.clone(Ellipsoid_default.UNIT_SPHERE);
149
+ var scratchOptions = {
150
+ positions: void 0,
151
+ minimumHeights: void 0,
152
+ maximumHeights: void 0,
153
+ ellipsoid: scratchEllipsoid,
154
+ granularity: void 0
155
+ };
156
+ WallOutlineGeometry.unpack = function(array, startingIndex, result) {
157
+ if (!defined_default(array)) {
158
+ throw new DeveloperError_default("array is required");
159
+ }
160
+ startingIndex = startingIndex ?? 0;
161
+ let i;
162
+ let length = array[startingIndex++];
163
+ const positions = new Array(length);
164
+ for (i = 0; i < length; ++i, startingIndex += Cartesian3_default.packedLength) {
165
+ positions[i] = Cartesian3_default.unpack(array, startingIndex);
166
+ }
167
+ length = array[startingIndex++];
168
+ let minimumHeights;
169
+ if (length > 0) {
170
+ minimumHeights = new Array(length);
171
+ for (i = 0; i < length; ++i) {
172
+ minimumHeights[i] = array[startingIndex++];
173
+ }
174
+ }
175
+ length = array[startingIndex++];
176
+ let maximumHeights;
177
+ if (length > 0) {
178
+ maximumHeights = new Array(length);
179
+ for (i = 0; i < length; ++i) {
180
+ maximumHeights[i] = array[startingIndex++];
181
+ }
182
+ }
183
+ const ellipsoid = Ellipsoid_default.unpack(array, startingIndex, scratchEllipsoid);
184
+ startingIndex += Ellipsoid_default.packedLength;
185
+ const granularity = array[startingIndex];
186
+ if (!defined_default(result)) {
187
+ scratchOptions.positions = positions;
188
+ scratchOptions.minimumHeights = minimumHeights;
189
+ scratchOptions.maximumHeights = maximumHeights;
190
+ scratchOptions.granularity = granularity;
191
+ return new WallOutlineGeometry(scratchOptions);
192
+ }
193
+ result._positions = positions;
194
+ result._minimumHeights = minimumHeights;
195
+ result._maximumHeights = maximumHeights;
196
+ result._ellipsoid = Ellipsoid_default.clone(ellipsoid, result._ellipsoid);
197
+ result._granularity = granularity;
198
+ return result;
199
+ };
200
+ WallOutlineGeometry.fromConstantHeights = function(options) {
201
+ options = options ?? Frozen_default.EMPTY_OBJECT;
202
+ const positions = options.positions;
203
+ if (!defined_default(positions)) {
204
+ throw new DeveloperError_default("options.positions is required.");
205
+ }
206
+ let minHeights;
207
+ let maxHeights;
208
+ const min = options.minimumHeight;
209
+ const max = options.maximumHeight;
210
+ const doMin = defined_default(min);
211
+ const doMax = defined_default(max);
212
+ if (doMin || doMax) {
213
+ const length = positions.length;
214
+ minHeights = doMin ? new Array(length) : void 0;
215
+ maxHeights = doMax ? new Array(length) : void 0;
216
+ for (let i = 0; i < length; ++i) {
217
+ if (doMin) {
218
+ minHeights[i] = min;
219
+ }
220
+ if (doMax) {
221
+ maxHeights[i] = max;
222
+ }
223
+ }
224
+ }
225
+ const newOptions = {
226
+ positions,
227
+ maximumHeights: maxHeights,
228
+ minimumHeights: minHeights,
229
+ ellipsoid: options.ellipsoid
230
+ };
231
+ return new WallOutlineGeometry(newOptions);
232
+ };
233
+ WallOutlineGeometry.createGeometry = function(wallGeometry) {
234
+ const wallPositions = wallGeometry._positions;
235
+ const minimumHeights = wallGeometry._minimumHeights;
236
+ const maximumHeights = wallGeometry._maximumHeights;
237
+ const granularity = wallGeometry._granularity;
238
+ const ellipsoid = wallGeometry._ellipsoid;
239
+ const pos = WallGeometryLibrary_default.computePositions(
240
+ ellipsoid,
241
+ wallPositions,
242
+ maximumHeights,
243
+ minimumHeights,
244
+ granularity,
245
+ false
246
+ );
247
+ if (!defined_default(pos)) {
248
+ return;
249
+ }
250
+ const bottomPositions = pos.bottomPositions;
251
+ const topPositions = pos.topPositions;
252
+ let length = topPositions.length;
253
+ let size = length * 2;
254
+ const positions = new Float64Array(size);
255
+ let positionIndex = 0;
256
+ length /= 3;
257
+ let i;
258
+ for (i = 0; i < length; ++i) {
259
+ const i3 = i * 3;
260
+ const topPosition = Cartesian3_default.fromArray(
261
+ topPositions,
262
+ i3,
263
+ scratchCartesian3Position1
264
+ );
265
+ const bottomPosition = Cartesian3_default.fromArray(
266
+ bottomPositions,
267
+ i3,
268
+ scratchCartesian3Position2
269
+ );
270
+ positions[positionIndex++] = bottomPosition.x;
271
+ positions[positionIndex++] = bottomPosition.y;
272
+ positions[positionIndex++] = bottomPosition.z;
273
+ positions[positionIndex++] = topPosition.x;
274
+ positions[positionIndex++] = topPosition.y;
275
+ positions[positionIndex++] = topPosition.z;
276
+ }
277
+ const attributes = new GeometryAttributes_default({
278
+ position: new GeometryAttribute_default({
279
+ componentDatatype: ComponentDatatype_default.DOUBLE,
280
+ componentsPerAttribute: 3,
281
+ values: positions
282
+ })
283
+ });
284
+ const numVertices = size / 3;
285
+ size = 2 * numVertices - 4 + numVertices;
286
+ const indices = IndexDatatype_default.createTypedArray(numVertices, size);
287
+ let edgeIndex = 0;
288
+ for (i = 0; i < numVertices - 2; i += 2) {
289
+ const LL = i;
290
+ const LR = i + 2;
291
+ const pl = Cartesian3_default.fromArray(
292
+ positions,
293
+ LL * 3,
294
+ scratchCartesian3Position1
295
+ );
296
+ const pr = Cartesian3_default.fromArray(
297
+ positions,
298
+ LR * 3,
299
+ scratchCartesian3Position2
300
+ );
301
+ if (Cartesian3_default.equalsEpsilon(pl, pr, Math_default.EPSILON10)) {
302
+ continue;
303
+ }
304
+ const UL = i + 1;
305
+ const UR = i + 3;
306
+ indices[edgeIndex++] = UL;
307
+ indices[edgeIndex++] = LL;
308
+ indices[edgeIndex++] = UL;
309
+ indices[edgeIndex++] = UR;
310
+ indices[edgeIndex++] = LL;
311
+ indices[edgeIndex++] = LR;
312
+ }
313
+ indices[edgeIndex++] = numVertices - 2;
314
+ indices[edgeIndex++] = numVertices - 1;
315
+ return new Geometry_default({
316
+ attributes,
317
+ indices,
318
+ primitiveType: PrimitiveType_default.LINES,
319
+ boundingSphere: new BoundingSphere_default.fromVertices(positions)
320
+ });
321
+ };
322
+ var WallOutlineGeometry_default = WallOutlineGeometry;
323
+
324
+ // packages/engine/Source/Workers/createWallOutlineGeometry.js
325
+ function createWallOutlineGeometry(wallGeometry, offset) {
326
+ if (defined_default(offset)) {
327
+ wallGeometry = WallOutlineGeometry_default.unpack(wallGeometry, offset);
328
+ }
329
+ wallGeometry._ellipsoid = Ellipsoid_default.clone(wallGeometry._ellipsoid);
330
+ return WallOutlineGeometry_default.createGeometry(wallGeometry);
331
+ }
332
+ var createWallOutlineGeometry_default = createWallOutlineGeometry;
333
+ export {
334
+ createWallOutlineGeometry_default as default
335
+ };
@@ -0,0 +1,369 @@
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
+ require_draco_decoder_nodejs
28
+ } from "./chunk-5UHIRI2A.js";
29
+ import {
30
+ createTaskProcessorWorker_default
31
+ } from "./chunk-27JI7F7B.js";
32
+ import {
33
+ IndexDatatype_default
34
+ } from "./chunk-OQK27J4J.js";
35
+ import {
36
+ ComponentDatatype_default
37
+ } from "./chunk-DVTKM7FF.js";
38
+ import "./chunk-XNKQLSHI.js";
39
+ import {
40
+ RuntimeError_default
41
+ } from "./chunk-DAYNPAVN.js";
42
+ import "./chunk-IEBTKCMB.js";
43
+ import "./chunk-RTJ6L5O4.js";
44
+ import {
45
+ __toESM,
46
+ defined_default
47
+ } from "./chunk-W2EK42GB.js";
48
+
49
+ // packages/engine/Source/Workers/decodeDraco.js
50
+ var import_draco_decoder_nodejs = __toESM(require_draco_decoder_nodejs(), 1);
51
+ var draco;
52
+ function decodeIndexArray(dracoGeometry, dracoDecoder) {
53
+ const numPoints = dracoGeometry.num_points();
54
+ const numFaces = dracoGeometry.num_faces();
55
+ const faceIndices = new draco.DracoInt32Array();
56
+ const numIndices = numFaces * 3;
57
+ const indexArray = IndexDatatype_default.createTypedArray(numPoints, numIndices);
58
+ let offset = 0;
59
+ for (let i = 0; i < numFaces; ++i) {
60
+ dracoDecoder.GetFaceFromMesh(dracoGeometry, i, faceIndices);
61
+ indexArray[offset + 0] = faceIndices.GetValue(0);
62
+ indexArray[offset + 1] = faceIndices.GetValue(1);
63
+ indexArray[offset + 2] = faceIndices.GetValue(2);
64
+ offset += 3;
65
+ }
66
+ draco.destroy(faceIndices);
67
+ return {
68
+ typedArray: indexArray,
69
+ numberOfIndices: numIndices
70
+ };
71
+ }
72
+ function decodeQuantizedDracoTypedArray(dracoGeometry, dracoDecoder, dracoAttribute, quantization, vertexArrayLength) {
73
+ let vertexArray;
74
+ let attributeData;
75
+ if (quantization.quantizationBits <= 8) {
76
+ attributeData = new draco.DracoUInt8Array();
77
+ vertexArray = new Uint8Array(vertexArrayLength);
78
+ dracoDecoder.GetAttributeUInt8ForAllPoints(
79
+ dracoGeometry,
80
+ dracoAttribute,
81
+ attributeData
82
+ );
83
+ } else if (quantization.quantizationBits <= 16) {
84
+ attributeData = new draco.DracoUInt16Array();
85
+ vertexArray = new Uint16Array(vertexArrayLength);
86
+ dracoDecoder.GetAttributeUInt16ForAllPoints(
87
+ dracoGeometry,
88
+ dracoAttribute,
89
+ attributeData
90
+ );
91
+ } else {
92
+ attributeData = new draco.DracoFloat32Array();
93
+ vertexArray = new Float32Array(vertexArrayLength);
94
+ dracoDecoder.GetAttributeFloatForAllPoints(
95
+ dracoGeometry,
96
+ dracoAttribute,
97
+ attributeData
98
+ );
99
+ }
100
+ for (let i = 0; i < vertexArrayLength; ++i) {
101
+ vertexArray[i] = attributeData.GetValue(i);
102
+ }
103
+ draco.destroy(attributeData);
104
+ return vertexArray;
105
+ }
106
+ function decodeDracoTypedArray(dracoGeometry, dracoDecoder, dracoAttribute, vertexArrayLength) {
107
+ let vertexArray;
108
+ let attributeData;
109
+ switch (dracoAttribute.data_type()) {
110
+ case 1:
111
+ case 11:
112
+ attributeData = new draco.DracoInt8Array();
113
+ vertexArray = new Int8Array(vertexArrayLength);
114
+ dracoDecoder.GetAttributeInt8ForAllPoints(
115
+ dracoGeometry,
116
+ dracoAttribute,
117
+ attributeData
118
+ );
119
+ break;
120
+ case 2:
121
+ attributeData = new draco.DracoUInt8Array();
122
+ vertexArray = new Uint8Array(vertexArrayLength);
123
+ dracoDecoder.GetAttributeUInt8ForAllPoints(
124
+ dracoGeometry,
125
+ dracoAttribute,
126
+ attributeData
127
+ );
128
+ break;
129
+ case 3:
130
+ attributeData = new draco.DracoInt16Array();
131
+ vertexArray = new Int16Array(vertexArrayLength);
132
+ dracoDecoder.GetAttributeInt16ForAllPoints(
133
+ dracoGeometry,
134
+ dracoAttribute,
135
+ attributeData
136
+ );
137
+ break;
138
+ case 4:
139
+ attributeData = new draco.DracoUInt16Array();
140
+ vertexArray = new Uint16Array(vertexArrayLength);
141
+ dracoDecoder.GetAttributeUInt16ForAllPoints(
142
+ dracoGeometry,
143
+ dracoAttribute,
144
+ attributeData
145
+ );
146
+ break;
147
+ case 5:
148
+ case 7:
149
+ attributeData = new draco.DracoInt32Array();
150
+ vertexArray = new Int32Array(vertexArrayLength);
151
+ dracoDecoder.GetAttributeInt32ForAllPoints(
152
+ dracoGeometry,
153
+ dracoAttribute,
154
+ attributeData
155
+ );
156
+ break;
157
+ case 6:
158
+ case 8:
159
+ attributeData = new draco.DracoUInt32Array();
160
+ vertexArray = new Uint32Array(vertexArrayLength);
161
+ dracoDecoder.GetAttributeUInt32ForAllPoints(
162
+ dracoGeometry,
163
+ dracoAttribute,
164
+ attributeData
165
+ );
166
+ break;
167
+ case 9:
168
+ case 10:
169
+ attributeData = new draco.DracoFloat32Array();
170
+ vertexArray = new Float32Array(vertexArrayLength);
171
+ dracoDecoder.GetAttributeFloatForAllPoints(
172
+ dracoGeometry,
173
+ dracoAttribute,
174
+ attributeData
175
+ );
176
+ break;
177
+ }
178
+ for (let i = 0; i < vertexArrayLength; ++i) {
179
+ vertexArray[i] = attributeData.GetValue(i);
180
+ }
181
+ draco.destroy(attributeData);
182
+ return vertexArray;
183
+ }
184
+ function decodeAttribute(dracoGeometry, dracoDecoder, dracoAttribute) {
185
+ const numPoints = dracoGeometry.num_points();
186
+ const numComponents = dracoAttribute.num_components();
187
+ let quantization;
188
+ let transform = new draco.AttributeQuantizationTransform();
189
+ if (transform.InitFromAttribute(dracoAttribute)) {
190
+ const minValues = new Array(numComponents);
191
+ for (let i = 0; i < numComponents; ++i) {
192
+ minValues[i] = transform.min_value(i);
193
+ }
194
+ quantization = {
195
+ quantizationBits: transform.quantization_bits(),
196
+ minValues,
197
+ range: transform.range(),
198
+ octEncoded: false
199
+ };
200
+ }
201
+ draco.destroy(transform);
202
+ transform = new draco.AttributeOctahedronTransform();
203
+ if (transform.InitFromAttribute(dracoAttribute)) {
204
+ quantization = {
205
+ quantizationBits: transform.quantization_bits(),
206
+ octEncoded: true
207
+ };
208
+ }
209
+ draco.destroy(transform);
210
+ const vertexArrayLength = numPoints * numComponents;
211
+ let vertexArray;
212
+ if (defined_default(quantization)) {
213
+ vertexArray = decodeQuantizedDracoTypedArray(
214
+ dracoGeometry,
215
+ dracoDecoder,
216
+ dracoAttribute,
217
+ quantization,
218
+ vertexArrayLength
219
+ );
220
+ } else {
221
+ vertexArray = decodeDracoTypedArray(
222
+ dracoGeometry,
223
+ dracoDecoder,
224
+ dracoAttribute,
225
+ vertexArrayLength
226
+ );
227
+ }
228
+ const componentDatatype = ComponentDatatype_default.fromTypedArray(vertexArray);
229
+ return {
230
+ array: vertexArray,
231
+ data: {
232
+ componentsPerAttribute: numComponents,
233
+ componentDatatype,
234
+ byteOffset: dracoAttribute.byte_offset(),
235
+ byteStride: ComponentDatatype_default.getSizeInBytes(componentDatatype) * numComponents,
236
+ normalized: dracoAttribute.normalized(),
237
+ quantization
238
+ }
239
+ };
240
+ }
241
+ function decodePointCloud(parameters) {
242
+ const dracoDecoder = new draco.Decoder();
243
+ if (parameters.dequantizeInShader) {
244
+ dracoDecoder.SkipAttributeTransform(draco.POSITION);
245
+ dracoDecoder.SkipAttributeTransform(draco.NORMAL);
246
+ }
247
+ const buffer = new draco.DecoderBuffer();
248
+ buffer.Init(parameters.buffer, parameters.buffer.length);
249
+ const geometryType = dracoDecoder.GetEncodedGeometryType(buffer);
250
+ if (geometryType !== draco.POINT_CLOUD) {
251
+ throw new RuntimeError_default("Draco geometry type must be POINT_CLOUD.");
252
+ }
253
+ const dracoPointCloud = new draco.PointCloud();
254
+ const decodingStatus = dracoDecoder.DecodeBufferToPointCloud(
255
+ buffer,
256
+ dracoPointCloud
257
+ );
258
+ if (!decodingStatus.ok() || dracoPointCloud.ptr === 0) {
259
+ throw new RuntimeError_default(
260
+ `Error decoding draco point cloud: ${decodingStatus.error_msg()}`
261
+ );
262
+ }
263
+ draco.destroy(buffer);
264
+ const result = {};
265
+ const properties = parameters.properties;
266
+ for (const propertyName in properties) {
267
+ if (properties.hasOwnProperty(propertyName)) {
268
+ let dracoAttribute;
269
+ if (propertyName === "POSITION" || propertyName === "NORMAL") {
270
+ const dracoAttributeId = dracoDecoder.GetAttributeId(
271
+ dracoPointCloud,
272
+ draco[propertyName]
273
+ );
274
+ dracoAttribute = dracoDecoder.GetAttribute(
275
+ dracoPointCloud,
276
+ dracoAttributeId
277
+ );
278
+ } else {
279
+ const attributeId = properties[propertyName];
280
+ dracoAttribute = dracoDecoder.GetAttributeByUniqueId(
281
+ dracoPointCloud,
282
+ attributeId
283
+ );
284
+ }
285
+ result[propertyName] = decodeAttribute(
286
+ dracoPointCloud,
287
+ dracoDecoder,
288
+ dracoAttribute
289
+ );
290
+ }
291
+ }
292
+ draco.destroy(dracoPointCloud);
293
+ draco.destroy(dracoDecoder);
294
+ return result;
295
+ }
296
+ function decodePrimitive(parameters) {
297
+ const dracoDecoder = new draco.Decoder();
298
+ if (parameters.dequantizeInShader) {
299
+ for (let i = 0; i < parameters.attributesToSkipTransform.length; ++i) {
300
+ dracoDecoder.SkipAttributeTransform(
301
+ draco[parameters.attributesToSkipTransform[i]]
302
+ );
303
+ }
304
+ }
305
+ const bufferView = parameters.bufferView;
306
+ const buffer = new draco.DecoderBuffer();
307
+ buffer.Init(parameters.array, bufferView.byteLength);
308
+ const geometryType = dracoDecoder.GetEncodedGeometryType(buffer);
309
+ if (geometryType !== draco.TRIANGULAR_MESH) {
310
+ throw new RuntimeError_default("Unsupported draco mesh geometry type.");
311
+ }
312
+ const dracoGeometry = new draco.Mesh();
313
+ const decodingStatus = dracoDecoder.DecodeBufferToMesh(buffer, dracoGeometry);
314
+ if (!decodingStatus.ok() || dracoGeometry.ptr === 0) {
315
+ throw new RuntimeError_default(
316
+ `Error decoding draco mesh geometry: ${decodingStatus.error_msg()}`
317
+ );
318
+ }
319
+ draco.destroy(buffer);
320
+ const attributeData = {};
321
+ const compressedAttributes = parameters.compressedAttributes;
322
+ for (const attributeName in compressedAttributes) {
323
+ if (compressedAttributes.hasOwnProperty(attributeName)) {
324
+ const compressedAttribute = compressedAttributes[attributeName];
325
+ const dracoAttribute = dracoDecoder.GetAttributeByUniqueId(
326
+ dracoGeometry,
327
+ compressedAttribute
328
+ );
329
+ attributeData[attributeName] = decodeAttribute(
330
+ dracoGeometry,
331
+ dracoDecoder,
332
+ dracoAttribute
333
+ );
334
+ }
335
+ }
336
+ const result = {
337
+ indexArray: decodeIndexArray(dracoGeometry, dracoDecoder),
338
+ attributeData
339
+ };
340
+ draco.destroy(dracoGeometry);
341
+ draco.destroy(dracoDecoder);
342
+ return result;
343
+ }
344
+ async function decode(parameters, transferableObjects) {
345
+ if (defined_default(parameters.bufferView)) {
346
+ return decodePrimitive(parameters);
347
+ }
348
+ return decodePointCloud(parameters);
349
+ }
350
+ async function initWorker(parameters, transferableObjects) {
351
+ const wasmConfig = parameters.webAssemblyConfig;
352
+ if (defined_default(wasmConfig) && defined_default(wasmConfig.wasmBinaryFile)) {
353
+ draco = await (0, import_draco_decoder_nodejs.default)(wasmConfig);
354
+ } else {
355
+ draco = await (0, import_draco_decoder_nodejs.default)();
356
+ }
357
+ return true;
358
+ }
359
+ async function decodeDraco(parameters, transferableObjects) {
360
+ const wasmConfig = parameters.webAssemblyConfig;
361
+ if (defined_default(wasmConfig)) {
362
+ return initWorker(parameters, transferableObjects);
363
+ }
364
+ return decode(parameters, transferableObjects);
365
+ }
366
+ var decodeDraco_default = createTaskProcessorWorker_default(decodeDraco);
367
+ export {
368
+ decodeDraco_default as default
369
+ };