@rtzh/engine 0.0.7 → 0.0.9

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 (177) hide show
  1. package/Build/Workers/chunk-2B7VLWK3.js +58 -0
  2. package/Build/Workers/chunk-2CZLDPAQ.js +101 -0
  3. package/Build/Workers/chunk-2LMIHR6B.js +73 -0
  4. package/Build/Workers/chunk-2ZR6KBRW.js +8366 -0
  5. package/Build/Workers/chunk-32GOIUYC.js +139 -0
  6. package/Build/Workers/chunk-37WPNI52.js +55 -0
  7. package/Build/Workers/chunk-3L7XBXFS.js +124 -0
  8. package/Build/Workers/chunk-3QLIXW6V.js +778 -0
  9. package/Build/Workers/chunk-3SVEN5QG.js +288 -0
  10. package/Build/Workers/chunk-3YO7HM5H.js +476 -0
  11. package/Build/Workers/chunk-3ZDA3MBK.js +114 -0
  12. package/Build/Workers/chunk-45SKJP37.js +102 -0
  13. package/Build/Workers/chunk-4C4UR2S6.js +682 -0
  14. package/Build/Workers/chunk-4DQ3ODGO.js +629 -0
  15. package/Build/Workers/chunk-4SZJ3KRD.js +497 -0
  16. package/Build/Workers/chunk-4UBPBH32.js +162 -0
  17. package/Build/Workers/chunk-5A4OWIAY.js +511 -0
  18. package/Build/Workers/chunk-5D3ECYS3.js +97 -0
  19. package/Build/Workers/chunk-5IOA3NCI.js +8366 -0
  20. package/Build/Workers/chunk-5UKR42KW.js +1483 -0
  21. package/Build/Workers/chunk-5WAMP6Z4.js +299 -0
  22. package/Build/Workers/chunk-6F4HKBHD.js +352 -0
  23. package/Build/Workers/chunk-6HB2DMC2.js +2719 -0
  24. package/Build/Workers/chunk-6J63N735.js +171 -0
  25. package/Build/Workers/chunk-72YPCD72.js +1067 -0
  26. package/Build/Workers/chunk-7AS3X42P.js +682 -0
  27. package/Build/Workers/chunk-7BQLJI3P.js +692 -0
  28. package/Build/Workers/chunk-7EU3DIKZ.js +3514 -0
  29. package/Build/Workers/chunk-AFZVC5JN.js +778 -0
  30. package/Build/Workers/chunk-ASGXCLGL.js +97 -0
  31. package/Build/Workers/chunk-BGG3BP2R.js +280 -0
  32. package/Build/Workers/chunk-BQRZMSMM.js +102 -0
  33. package/Build/Workers/chunk-BYTLHM7N.js +414 -0
  34. package/Build/Workers/chunk-CR6BZUQC.js +1443 -0
  35. package/Build/Workers/chunk-CV5JLCHF.js +387 -0
  36. package/Build/Workers/chunk-CXDJ7YNS.js +305 -0
  37. package/Build/Workers/chunk-DBM2NHJ5.js +352 -0
  38. package/Build/Workers/chunk-DLRIAMQF.js +1800 -0
  39. package/Build/Workers/chunk-DPTYP7J3.js +75 -0
  40. package/Build/Workers/chunk-E7SFSMUX.js +44 -0
  41. package/Build/Workers/chunk-EE4T7VKT.js +368 -0
  42. package/Build/Workers/chunk-ENIF6OQ5.js +139 -0
  43. package/Build/Workers/chunk-ET7K6FSD.js +398 -0
  44. package/Build/Workers/chunk-F6JVBOM5.js +788 -0
  45. package/Build/Workers/chunk-F7IITURY.js +497 -0
  46. package/Build/Workers/chunk-FRF5LWIM.js +299 -0
  47. package/Build/Workers/chunk-GMOKUODV.js +352 -0
  48. package/Build/Workers/chunk-GPWELPVQ.js +198 -0
  49. package/Build/Workers/chunk-H3BSU65R.js +1067 -0
  50. package/Build/Workers/chunk-HEFUSHA6.js +3514 -0
  51. package/Build/Workers/chunk-HKSICPYV.js +55 -0
  52. package/Build/Workers/chunk-I7LWED3Z.js +101 -0
  53. package/Build/Workers/chunk-IHOM6QXV.js +439 -0
  54. package/Build/Workers/chunk-IK4D64GY.js +439 -0
  55. package/Build/Workers/chunk-IVDXHQYL.js +124 -0
  56. package/Build/Workers/chunk-J2S3WMUZ.js +642 -0
  57. package/Build/Workers/chunk-JM4TFRYQ.js +163 -0
  58. package/Build/Workers/chunk-JNNIPGJU.js +163 -0
  59. package/Build/Workers/chunk-JQ7IQ56G.js +837 -0
  60. package/Build/Workers/chunk-K2PUGKEO.js +2058 -0
  61. package/Build/Workers/chunk-KMJD5APO.js +162 -0
  62. package/Build/Workers/chunk-KWX3CJFT.js +198 -0
  63. package/Build/Workers/chunk-L33HPENB.js +75 -0
  64. package/Build/Workers/chunk-LFQ63ZU4.js +455 -0
  65. package/Build/Workers/chunk-LHJDLAZT.js +1483 -0
  66. package/Build/Workers/chunk-LSGHTNF5.js +511 -0
  67. package/Build/Workers/chunk-LVU4AZC6.js +219 -0
  68. package/Build/Workers/chunk-LXOUU2I5.js +219 -0
  69. package/Build/Workers/chunk-M7EEEKQE.js +476 -0
  70. package/Build/Workers/chunk-MXKQUDTP.js +55 -0
  71. package/Build/Workers/chunk-NEF7XO5W.js +940 -0
  72. package/Build/Workers/chunk-NL7US44X.js +171 -0
  73. package/Build/Workers/chunk-NSRZZEHH.js +455 -0
  74. package/Build/Workers/chunk-NUMQ72QV.js +55 -0
  75. package/Build/Workers/chunk-O4MZOV3C.js +414 -0
  76. package/Build/Workers/chunk-OOIZ7CHP.js +114 -0
  77. package/Build/Workers/chunk-OX4DGIUJ.js +788 -0
  78. package/Build/Workers/chunk-PEEYBEL5.js +2058 -0
  79. package/Build/Workers/chunk-PEUDXOFI.js +241 -0
  80. package/Build/Workers/chunk-PKXFFIEZ.js +57 -0
  81. package/Build/Workers/chunk-Q2X2Z7JH.js +241 -0
  82. package/Build/Workers/chunk-QFN5B75P.js +1054 -0
  83. package/Build/Workers/chunk-QOLOPE4O.js +1317 -0
  84. package/Build/Workers/chunk-RGD6RGTH.js +138 -0
  85. package/Build/Workers/chunk-RJ564LVX.js +398 -0
  86. package/Build/Workers/chunk-RNZ5L3W4.js +387 -0
  87. package/Build/Workers/chunk-SPPYSEH2.js +1460 -0
  88. package/Build/Workers/chunk-SSE2O2SB.js +1460 -0
  89. package/Build/Workers/chunk-SX6GJD6B.js +837 -0
  90. package/Build/Workers/chunk-SXISWCV7.js +58 -0
  91. package/Build/Workers/chunk-TBEKWAR5.js +73 -0
  92. package/Build/Workers/chunk-TE277WT3.js +280 -0
  93. package/Build/Workers/chunk-TFL2ZV77.js +692 -0
  94. package/Build/Workers/chunk-THWXTO7B.js +57 -0
  95. package/Build/Workers/chunk-TSNKYHSC.js +305 -0
  96. package/Build/Workers/chunk-TYQ7MNMK.js +37 -0
  97. package/Build/Workers/chunk-ULWO6TCN.js +352 -0
  98. package/Build/Workers/chunk-UQSQNTEF.js +368 -0
  99. package/Build/Workers/chunk-USWXYJRX.js +1045 -0
  100. package/Build/Workers/chunk-UTDSEOTC.js +288 -0
  101. package/Build/Workers/chunk-UUKLWTJC.js +2719 -0
  102. package/Build/Workers/chunk-V7QHEF6O.js +1317 -0
  103. package/Build/Workers/chunk-VFC54WB7.js +940 -0
  104. package/Build/Workers/chunk-VG7NX64T.js +37 -0
  105. package/Build/Workers/chunk-VIMRGSM5.js +256 -0
  106. package/Build/Workers/chunk-VL4QTEZC.js +138 -0
  107. package/Build/Workers/chunk-W3LNGBJU.js +44 -0
  108. package/Build/Workers/chunk-WDMHDACX.js +1800 -0
  109. package/Build/Workers/chunk-WF224D4A.js +642 -0
  110. package/Build/Workers/chunk-WZJEAPEP.js +629 -0
  111. package/Build/Workers/chunk-XHGB5IOL.js +1045 -0
  112. package/Build/Workers/chunk-XZN7KCY3.js +1054 -0
  113. package/Build/Workers/chunk-YWPKCFKZ.js +1443 -0
  114. package/Build/Workers/chunk-ZEEVOFG2.js +256 -0
  115. package/Build/Workers/combineGeometry.js +24 -24
  116. package/Build/Workers/createBoxGeometry.js +18 -18
  117. package/Build/Workers/createBoxOutlineGeometry.js +16 -16
  118. package/Build/Workers/createCircleGeometry.js +26 -26
  119. package/Build/Workers/createCircleOutlineGeometry.js +19 -19
  120. package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
  121. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
  122. package/Build/Workers/createCorridorGeometry.js +29 -29
  123. package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
  124. package/Build/Workers/createCylinderGeometry.js +20 -20
  125. package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
  126. package/Build/Workers/createEllipseGeometry.js +26 -26
  127. package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
  128. package/Build/Workers/createEllipsoidGeometry.js +19 -19
  129. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
  130. package/Build/Workers/createFrustumGeometry.js +18 -18
  131. package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
  132. package/Build/Workers/createGeometry.js +24 -24
  133. package/Build/Workers/createGroundPolylineGeometry.js +22 -22
  134. package/Build/Workers/createPlaneGeometry.js +16 -16
  135. package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
  136. package/Build/Workers/createPolygonGeometry.js +32 -32
  137. package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
  138. package/Build/Workers/createPolylineGeometry.js +25 -25
  139. package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
  140. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
  141. package/Build/Workers/createRectangleGeometry.js +27 -27
  142. package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
  143. package/Build/Workers/createSimplePolylineGeometry.js +23 -23
  144. package/Build/Workers/createSphereGeometry.js +19 -19
  145. package/Build/Workers/createSphereOutlineGeometry.js +18 -18
  146. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  147. package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
  148. package/Build/Workers/createVectorTileGeometries.js +24 -24
  149. package/Build/Workers/createVectorTilePoints.js +13 -13
  150. package/Build/Workers/createVectorTilePolygons.js +22 -22
  151. package/Build/Workers/createVectorTilePolylines.js +14 -14
  152. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
  153. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
  154. package/Build/Workers/createVerticesFromHeightmap.js +22 -22
  155. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
  156. package/Build/Workers/createWallGeometry.js +24 -24
  157. package/Build/Workers/createWallOutlineGeometry.js +23 -23
  158. package/Build/Workers/decodeDraco.js +10 -10
  159. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  160. package/Build/Workers/decodeI3S.js +10 -10
  161. package/Build/Workers/gaussianSplatSorter.js +4 -4
  162. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  163. package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
  164. package/Build/Workers/transcodeKTX2.js +6 -6
  165. package/Build/Workers/transferTypedArrayTest.js +1 -1
  166. package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
  167. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  168. package/Source/Scene/Cesium3DTileset.js +1 -7
  169. package/Source/Scene/Model/BarycentricWireframePipelineStage.js +79 -95
  170. package/Source/Scene/Model/Model.js +15 -15
  171. package/Source/Scene/Model/Model3DTileContent.js +16 -33
  172. package/Source/Shaders/Model/ModelFS.glsl +7 -10
  173. package/Source/Shaders/Model/ModelFS.js +7 -10
  174. package/Source/Shaders/Model/ModelVS.glsl +2 -1
  175. package/Source/Shaders/Model/ModelVS.js +2 -1
  176. package/index.js +136 -136
  177. package/package.json +1 -1
@@ -0,0 +1,299 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.0.10
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
+ Matrix2_default,
28
+ Quaternion_default,
29
+ Rectangle_default,
30
+ Transforms_default
31
+ } from "./chunk-2ZR6KBRW.js";
32
+ import {
33
+ Matrix4_default
34
+ } from "./chunk-PEEYBEL5.js";
35
+ import {
36
+ WebGLConstants_default
37
+ } from "./chunk-4DQ3ODGO.js";
38
+ import {
39
+ Cartesian2_default,
40
+ Cartographic_default
41
+ } from "./chunk-SSE2O2SB.js";
42
+ import {
43
+ Cartesian3_default,
44
+ Frozen_default,
45
+ Matrix3_default
46
+ } from "./chunk-YWPKCFKZ.js";
47
+ import {
48
+ Check_default,
49
+ DeveloperError_default
50
+ } from "./chunk-JNNIPGJU.js";
51
+ import {
52
+ defined_default
53
+ } from "./chunk-DPTYP7J3.js";
54
+
55
+ // packages/engine/Source/Core/GeometryType.js
56
+ var GeometryType = {
57
+ NONE: 0,
58
+ TRIANGLES: 1,
59
+ LINES: 2,
60
+ POLYLINES: 3
61
+ };
62
+ var GeometryType_default = Object.freeze(GeometryType);
63
+
64
+ // packages/engine/Source/Core/PrimitiveType.js
65
+ var PrimitiveType = {
66
+ /**
67
+ * Points primitive where each vertex (or index) is a separate point.
68
+ *
69
+ * @type {number}
70
+ * @constant
71
+ */
72
+ POINTS: WebGLConstants_default.POINTS,
73
+ /**
74
+ * Lines primitive where each two vertices (or indices) is a line segment. Line segments are not necessarily connected.
75
+ *
76
+ * @type {number}
77
+ * @constant
78
+ */
79
+ LINES: WebGLConstants_default.LINES,
80
+ /**
81
+ * Line loop primitive where each vertex (or index) after the first connects a line to
82
+ * the previous vertex, and the last vertex implicitly connects to the first.
83
+ *
84
+ * @type {number}
85
+ * @constant
86
+ */
87
+ LINE_LOOP: WebGLConstants_default.LINE_LOOP,
88
+ /**
89
+ * Line strip primitive where each vertex (or index) after the first connects a line to the previous vertex.
90
+ *
91
+ * @type {number}
92
+ * @constant
93
+ */
94
+ LINE_STRIP: WebGLConstants_default.LINE_STRIP,
95
+ /**
96
+ * Triangles primitive where each three vertices (or indices) is a triangle. Triangles do not necessarily share edges.
97
+ *
98
+ * @type {number}
99
+ * @constant
100
+ */
101
+ TRIANGLES: WebGLConstants_default.TRIANGLES,
102
+ /**
103
+ * Triangle strip primitive where each vertex (or index) after the first two connect to
104
+ * the previous two vertices forming a triangle. For example, this can be used to model a wall.
105
+ *
106
+ * @type {number}
107
+ * @constant
108
+ */
109
+ TRIANGLE_STRIP: WebGLConstants_default.TRIANGLE_STRIP,
110
+ /**
111
+ * Triangle fan primitive where each vertex (or index) after the first two connect to
112
+ * the previous vertex and the first vertex forming a triangle. For example, this can be used
113
+ * to model a cone or circle.
114
+ *
115
+ * @type {number}
116
+ * @constant
117
+ */
118
+ TRIANGLE_FAN: WebGLConstants_default.TRIANGLE_FAN
119
+ };
120
+ PrimitiveType.isLines = function(primitiveType) {
121
+ return primitiveType === PrimitiveType.LINES || primitiveType === PrimitiveType.LINE_LOOP || primitiveType === PrimitiveType.LINE_STRIP;
122
+ };
123
+ PrimitiveType.isTriangles = function(primitiveType) {
124
+ return primitiveType === PrimitiveType.TRIANGLES || primitiveType === PrimitiveType.TRIANGLE_STRIP || primitiveType === PrimitiveType.TRIANGLE_FAN;
125
+ };
126
+ PrimitiveType.validate = function(primitiveType) {
127
+ return primitiveType === PrimitiveType.POINTS || primitiveType === PrimitiveType.LINES || primitiveType === PrimitiveType.LINE_LOOP || primitiveType === PrimitiveType.LINE_STRIP || primitiveType === PrimitiveType.TRIANGLES || primitiveType === PrimitiveType.TRIANGLE_STRIP || primitiveType === PrimitiveType.TRIANGLE_FAN;
128
+ };
129
+ var PrimitiveType_default = Object.freeze(PrimitiveType);
130
+
131
+ // packages/engine/Source/Core/Geometry.js
132
+ function Geometry(options) {
133
+ options = options ?? Frozen_default.EMPTY_OBJECT;
134
+ Check_default.typeOf.object("options.attributes", options.attributes);
135
+ this.attributes = options.attributes;
136
+ this.indices = options.indices;
137
+ this.primitiveType = options.primitiveType ?? PrimitiveType_default.TRIANGLES;
138
+ this.boundingSphere = options.boundingSphere;
139
+ this.geometryType = options.geometryType ?? GeometryType_default.NONE;
140
+ this.boundingSphereCV = options.boundingSphereCV;
141
+ this.offsetAttribute = options.offsetAttribute;
142
+ }
143
+ Geometry.computeNumberOfVertices = function(geometry) {
144
+ Check_default.typeOf.object("geometry", geometry);
145
+ let numberOfVertices = -1;
146
+ for (const property in geometry.attributes) {
147
+ if (geometry.attributes.hasOwnProperty(property) && defined_default(geometry.attributes[property]) && defined_default(geometry.attributes[property].values)) {
148
+ const attribute = geometry.attributes[property];
149
+ const num = attribute.values.length / attribute.componentsPerAttribute;
150
+ if (numberOfVertices !== num && numberOfVertices !== -1) {
151
+ throw new DeveloperError_default(
152
+ "All attribute lists must have the same number of attributes."
153
+ );
154
+ }
155
+ numberOfVertices = num;
156
+ }
157
+ }
158
+ return numberOfVertices;
159
+ };
160
+ var rectangleCenterScratch = new Cartographic_default();
161
+ var enuCenterScratch = new Cartesian3_default();
162
+ var fixedFrameToEnuScratch = new Matrix4_default();
163
+ var boundingRectanglePointsCartographicScratch = [
164
+ new Cartographic_default(),
165
+ new Cartographic_default(),
166
+ new Cartographic_default()
167
+ ];
168
+ var boundingRectanglePointsEnuScratch = [
169
+ new Cartesian2_default(),
170
+ new Cartesian2_default(),
171
+ new Cartesian2_default()
172
+ ];
173
+ var points2DScratch = [new Cartesian2_default(), new Cartesian2_default(), new Cartesian2_default()];
174
+ var pointEnuScratch = new Cartesian3_default();
175
+ var enuRotationScratch = new Quaternion_default();
176
+ var enuRotationMatrixScratch = new Matrix4_default();
177
+ var rotation2DScratch = new Matrix2_default();
178
+ Geometry._textureCoordinateRotationPoints = function(positions, stRotation, ellipsoid, boundingRectangle) {
179
+ let i;
180
+ const rectangleCenter = Rectangle_default.center(
181
+ boundingRectangle,
182
+ rectangleCenterScratch
183
+ );
184
+ const enuCenter = Cartographic_default.toCartesian(
185
+ rectangleCenter,
186
+ ellipsoid,
187
+ enuCenterScratch
188
+ );
189
+ const enuToFixedFrame = Transforms_default.eastNorthUpToFixedFrame(
190
+ enuCenter,
191
+ ellipsoid,
192
+ fixedFrameToEnuScratch
193
+ );
194
+ const fixedFrameToEnu = Matrix4_default.inverse(
195
+ enuToFixedFrame,
196
+ fixedFrameToEnuScratch
197
+ );
198
+ const boundingPointsEnu = boundingRectanglePointsEnuScratch;
199
+ const boundingPointsCarto = boundingRectanglePointsCartographicScratch;
200
+ boundingPointsCarto[0].longitude = boundingRectangle.west;
201
+ boundingPointsCarto[0].latitude = boundingRectangle.south;
202
+ boundingPointsCarto[1].longitude = boundingRectangle.west;
203
+ boundingPointsCarto[1].latitude = boundingRectangle.north;
204
+ boundingPointsCarto[2].longitude = boundingRectangle.east;
205
+ boundingPointsCarto[2].latitude = boundingRectangle.south;
206
+ let posEnu = pointEnuScratch;
207
+ for (i = 0; i < 3; i++) {
208
+ Cartographic_default.toCartesian(boundingPointsCarto[i], ellipsoid, posEnu);
209
+ posEnu = Matrix4_default.multiplyByPointAsVector(fixedFrameToEnu, posEnu, posEnu);
210
+ boundingPointsEnu[i].x = posEnu.x;
211
+ boundingPointsEnu[i].y = posEnu.y;
212
+ }
213
+ const rotation = Quaternion_default.fromAxisAngle(
214
+ Cartesian3_default.UNIT_Z,
215
+ -stRotation,
216
+ enuRotationScratch
217
+ );
218
+ const textureMatrix = Matrix3_default.fromQuaternion(
219
+ rotation,
220
+ enuRotationMatrixScratch
221
+ );
222
+ const positionsLength = positions.length;
223
+ let enuMinX = Number.POSITIVE_INFINITY;
224
+ let enuMinY = Number.POSITIVE_INFINITY;
225
+ let enuMaxX = Number.NEGATIVE_INFINITY;
226
+ let enuMaxY = Number.NEGATIVE_INFINITY;
227
+ for (i = 0; i < positionsLength; i++) {
228
+ posEnu = Matrix4_default.multiplyByPointAsVector(
229
+ fixedFrameToEnu,
230
+ positions[i],
231
+ posEnu
232
+ );
233
+ posEnu = Matrix3_default.multiplyByVector(textureMatrix, posEnu, posEnu);
234
+ enuMinX = Math.min(enuMinX, posEnu.x);
235
+ enuMinY = Math.min(enuMinY, posEnu.y);
236
+ enuMaxX = Math.max(enuMaxX, posEnu.x);
237
+ enuMaxY = Math.max(enuMaxY, posEnu.y);
238
+ }
239
+ const toDesiredInComputed = Matrix2_default.fromRotation(
240
+ stRotation,
241
+ rotation2DScratch
242
+ );
243
+ const points2D = points2DScratch;
244
+ points2D[0].x = enuMinX;
245
+ points2D[0].y = enuMinY;
246
+ points2D[1].x = enuMinX;
247
+ points2D[1].y = enuMaxY;
248
+ points2D[2].x = enuMaxX;
249
+ points2D[2].y = enuMinY;
250
+ const boundingEnuMin = boundingPointsEnu[0];
251
+ const boundingPointsWidth = boundingPointsEnu[2].x - boundingEnuMin.x;
252
+ const boundingPointsHeight = boundingPointsEnu[1].y - boundingEnuMin.y;
253
+ for (i = 0; i < 3; i++) {
254
+ const point2D = points2D[i];
255
+ Matrix2_default.multiplyByVector(toDesiredInComputed, point2D, point2D);
256
+ point2D.x = (point2D.x - boundingEnuMin.x) / boundingPointsWidth;
257
+ point2D.y = (point2D.y - boundingEnuMin.y) / boundingPointsHeight;
258
+ }
259
+ const minXYCorner = points2D[0];
260
+ const maxYCorner = points2D[1];
261
+ const maxXCorner = points2D[2];
262
+ const result = new Array(6);
263
+ Cartesian2_default.pack(minXYCorner, result);
264
+ Cartesian2_default.pack(maxYCorner, result, 2);
265
+ Cartesian2_default.pack(maxXCorner, result, 4);
266
+ return result;
267
+ };
268
+ var Geometry_default = Geometry;
269
+
270
+ // packages/engine/Source/Core/GeometryAttribute.js
271
+ function GeometryAttribute(options) {
272
+ options = options ?? Frozen_default.EMPTY_OBJECT;
273
+ if (!defined_default(options.componentDatatype)) {
274
+ throw new DeveloperError_default("options.componentDatatype is required.");
275
+ }
276
+ if (!defined_default(options.componentsPerAttribute)) {
277
+ throw new DeveloperError_default("options.componentsPerAttribute is required.");
278
+ }
279
+ if (options.componentsPerAttribute < 1 || options.componentsPerAttribute > 4) {
280
+ throw new DeveloperError_default(
281
+ "options.componentsPerAttribute must be between 1 and 4."
282
+ );
283
+ }
284
+ if (!defined_default(options.values)) {
285
+ throw new DeveloperError_default("options.values is required.");
286
+ }
287
+ this.componentDatatype = options.componentDatatype;
288
+ this.componentsPerAttribute = options.componentsPerAttribute;
289
+ this.normalize = options.normalize ?? false;
290
+ this.values = options.values;
291
+ }
292
+ var GeometryAttribute_default = GeometryAttribute;
293
+
294
+ export {
295
+ GeometryType_default,
296
+ PrimitiveType_default,
297
+ Geometry_default,
298
+ GeometryAttribute_default
299
+ };
@@ -0,0 +1,352 @@
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 0.0.9
5
+ *
6
+ * Copyright 2011-2022 Cesium Contributors
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * Columbus View (Pat. Pend.)
21
+ *
22
+ * Portions licensed separately.
23
+ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
+ */
25
+
26
+ import {
27
+ IndexDatatype_default
28
+ } from "./chunk-ENIF6OQ5.js";
29
+ import {
30
+ Math_default
31
+ } from "./chunk-4SZJ3KRD.js";
32
+ import {
33
+ DeveloperError_default
34
+ } from "./chunk-JM4TFRYQ.js";
35
+ import {
36
+ defined_default
37
+ } from "./chunk-L33HPENB.js";
38
+
39
+ // packages/engine/Source/Core/TerrainProvider.js
40
+ function TerrainProvider() {
41
+ DeveloperError_default.throwInstantiationError();
42
+ }
43
+ Object.defineProperties(TerrainProvider.prototype, {
44
+ /**
45
+ * Gets an event that is raised when the terrain provider encounters an asynchronous error. By subscribing
46
+ * to the event, you will be notified of the error and can potentially recover from it. Event listeners
47
+ * are passed an instance of {@link TileProviderError}.
48
+ * @memberof TerrainProvider.prototype
49
+ * @type {Event<TerrainProvider.ErrorEvent>}
50
+ * @readonly
51
+ */
52
+ errorEvent: {
53
+ get: DeveloperError_default.throwInstantiationError
54
+ },
55
+ /**
56
+ * Gets the credit to display when this terrain provider is active. Typically this is used to credit
57
+ * the source of the terrain.
58
+ * @memberof TerrainProvider.prototype
59
+ * @type {Credit}
60
+ * @readonly
61
+ */
62
+ credit: {
63
+ get: DeveloperError_default.throwInstantiationError
64
+ },
65
+ /**
66
+ * Gets the tiling scheme used by the provider.
67
+ * @memberof TerrainProvider.prototype
68
+ * @type {TilingScheme}
69
+ * @readonly
70
+ */
71
+ tilingScheme: {
72
+ get: DeveloperError_default.throwInstantiationError
73
+ },
74
+ /**
75
+ * Gets a value indicating whether or not the provider includes a water mask. The water mask
76
+ * indicates which areas of the globe are water rather than land, so they can be rendered
77
+ * as a reflective surface with animated waves.
78
+ * @memberof TerrainProvider.prototype
79
+ * @type {boolean}
80
+ * @readonly
81
+ */
82
+ hasWaterMask: {
83
+ get: DeveloperError_default.throwInstantiationError
84
+ },
85
+ /**
86
+ * Gets a value indicating whether or not the requested tiles include vertex normals.
87
+ * @memberof TerrainProvider.prototype
88
+ * @type {boolean}
89
+ * @readonly
90
+ */
91
+ hasVertexNormals: {
92
+ get: DeveloperError_default.throwInstantiationError
93
+ },
94
+ /**
95
+ * Gets an object that can be used to determine availability of terrain from this provider, such as
96
+ * at points and in rectangles. This property may be undefined if availability
97
+ * information is not available.
98
+ * @memberof TerrainProvider.prototype
99
+ * @type {TileAvailability|undefined}
100
+ * @readonly
101
+ */
102
+ availability: {
103
+ get: DeveloperError_default.throwInstantiationError
104
+ }
105
+ });
106
+ var regularGridIndicesCache = [];
107
+ TerrainProvider.getRegularGridIndices = function(width, height) {
108
+ if (width * height >= Math_default.FOUR_GIGABYTES) {
109
+ throw new DeveloperError_default(
110
+ "The total number of vertices (width * height) must be less than 4,294,967,296."
111
+ );
112
+ }
113
+ let byWidth = regularGridIndicesCache[width];
114
+ if (!defined_default(byWidth)) {
115
+ regularGridIndicesCache[width] = byWidth = [];
116
+ }
117
+ let indices = byWidth[height];
118
+ if (!defined_default(indices)) {
119
+ if (width * height < Math_default.SIXTY_FOUR_KILOBYTES) {
120
+ indices = byWidth[height] = new Uint16Array(
121
+ (width - 1) * (height - 1) * 6
122
+ );
123
+ } else {
124
+ indices = byWidth[height] = new Uint32Array(
125
+ (width - 1) * (height - 1) * 6
126
+ );
127
+ }
128
+ addRegularGridIndices(width, height, indices, 0);
129
+ }
130
+ return indices;
131
+ };
132
+ var regularGridAndEdgeIndicesCache = [];
133
+ TerrainProvider.getRegularGridIndicesAndEdgeIndices = function(width, height) {
134
+ if (width * height >= Math_default.FOUR_GIGABYTES) {
135
+ throw new DeveloperError_default(
136
+ "The total number of vertices (width * height) must be less than 4,294,967,296."
137
+ );
138
+ }
139
+ let byWidth = regularGridAndEdgeIndicesCache[width];
140
+ if (!defined_default(byWidth)) {
141
+ regularGridAndEdgeIndicesCache[width] = byWidth = [];
142
+ }
143
+ let indicesAndEdges = byWidth[height];
144
+ if (!defined_default(indicesAndEdges)) {
145
+ const indices = TerrainProvider.getRegularGridIndices(width, height);
146
+ const edgeIndices = getEdgeIndices(width, height);
147
+ const westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth;
148
+ const southIndicesEastToWest = edgeIndices.southIndicesEastToWest;
149
+ const eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth;
150
+ const northIndicesWestToEast = edgeIndices.northIndicesWestToEast;
151
+ indicesAndEdges = byWidth[height] = {
152
+ indices,
153
+ westIndicesSouthToNorth,
154
+ southIndicesEastToWest,
155
+ eastIndicesNorthToSouth,
156
+ northIndicesWestToEast
157
+ };
158
+ }
159
+ return indicesAndEdges;
160
+ };
161
+ var regularGridAndSkirtAndEdgeIndicesCache = [];
162
+ TerrainProvider.getRegularGridAndSkirtIndicesAndEdgeIndices = function(width, height) {
163
+ if (width * height >= Math_default.FOUR_GIGABYTES) {
164
+ throw new DeveloperError_default(
165
+ "The total number of vertices (width * height) must be less than 4,294,967,296."
166
+ );
167
+ }
168
+ let byWidth = regularGridAndSkirtAndEdgeIndicesCache[width];
169
+ if (!defined_default(byWidth)) {
170
+ regularGridAndSkirtAndEdgeIndicesCache[width] = byWidth = [];
171
+ }
172
+ let indicesAndEdges = byWidth[height];
173
+ if (!defined_default(indicesAndEdges)) {
174
+ const gridVertexCount = width * height;
175
+ const gridIndexCount = (width - 1) * (height - 1) * 6;
176
+ const edgeVertexCount = width * 2 + height * 2;
177
+ const edgeIndexCount = Math.max(0, edgeVertexCount - 4) * 6;
178
+ const vertexCount = gridVertexCount + edgeVertexCount;
179
+ const indexCount = gridIndexCount + edgeIndexCount;
180
+ const edgeIndices = getEdgeIndices(width, height);
181
+ const westIndicesSouthToNorth = edgeIndices.westIndicesSouthToNorth;
182
+ const southIndicesEastToWest = edgeIndices.southIndicesEastToWest;
183
+ const eastIndicesNorthToSouth = edgeIndices.eastIndicesNorthToSouth;
184
+ const northIndicesWestToEast = edgeIndices.northIndicesWestToEast;
185
+ const indices = IndexDatatype_default.createTypedArray(vertexCount, indexCount);
186
+ addRegularGridIndices(width, height, indices, 0);
187
+ TerrainProvider.addSkirtIndices(
188
+ westIndicesSouthToNorth,
189
+ southIndicesEastToWest,
190
+ eastIndicesNorthToSouth,
191
+ northIndicesWestToEast,
192
+ gridVertexCount,
193
+ indices,
194
+ gridIndexCount
195
+ );
196
+ indicesAndEdges = byWidth[height] = {
197
+ indices,
198
+ westIndicesSouthToNorth,
199
+ southIndicesEastToWest,
200
+ eastIndicesNorthToSouth,
201
+ northIndicesWestToEast,
202
+ indexCountWithoutSkirts: gridIndexCount
203
+ };
204
+ }
205
+ return indicesAndEdges;
206
+ };
207
+ TerrainProvider.getSkirtVertexCount = function(westIndicesSouthToNorth, southIndicesEastToWest, eastIndicesNorthToSouth, northIndicesWestToEast) {
208
+ return westIndicesSouthToNorth.length + southIndicesEastToWest.length + eastIndicesNorthToSouth.length + northIndicesWestToEast.length;
209
+ };
210
+ TerrainProvider.getSkirtIndexCount = function(skirtVertexCount) {
211
+ return (skirtVertexCount - 4) * 2 * 3;
212
+ };
213
+ TerrainProvider.getSkirtIndexCountWithFilledCorners = function(skirtVertexCount) {
214
+ return ((skirtVertexCount - 4) * 2 + 4) * 3;
215
+ };
216
+ TerrainProvider.addSkirtIndices = function(westIndicesSouthToNorth, southIndicesEastToWest, eastIndicesNorthToSouth, northIndicesWestToEast, vertexCount, indices, offset) {
217
+ let vertexIndex = vertexCount;
218
+ offset = addSkirtIndices(
219
+ westIndicesSouthToNorth,
220
+ vertexIndex,
221
+ indices,
222
+ offset
223
+ );
224
+ vertexIndex += westIndicesSouthToNorth.length;
225
+ offset = addSkirtIndices(
226
+ southIndicesEastToWest,
227
+ vertexIndex,
228
+ indices,
229
+ offset
230
+ );
231
+ vertexIndex += southIndicesEastToWest.length;
232
+ offset = addSkirtIndices(
233
+ eastIndicesNorthToSouth,
234
+ vertexIndex,
235
+ indices,
236
+ offset
237
+ );
238
+ vertexIndex += eastIndicesNorthToSouth.length;
239
+ addSkirtIndices(northIndicesWestToEast, vertexIndex, indices, offset);
240
+ };
241
+ TerrainProvider.addSkirtIndicesWithFilledCorners = function(westIndicesSouthToNorth, southIndicesEastToWest, eastIndicesNorthToSouth, northIndicesWestToEast, vertexCount, indices, offset) {
242
+ TerrainProvider.addSkirtIndices(
243
+ westIndicesSouthToNorth,
244
+ southIndicesEastToWest,
245
+ eastIndicesNorthToSouth,
246
+ northIndicesWestToEast,
247
+ vertexCount,
248
+ indices,
249
+ offset
250
+ );
251
+ const skirtVertexCount = TerrainProvider.getSkirtVertexCount(
252
+ westIndicesSouthToNorth,
253
+ southIndicesEastToWest,
254
+ eastIndicesNorthToSouth,
255
+ northIndicesWestToEast
256
+ );
257
+ const skirtIndexCountWithoutCaps = TerrainProvider.getSkirtIndexCount(skirtVertexCount);
258
+ const cornerStartIdx = offset + skirtIndexCountWithoutCaps;
259
+ const cornerSWIndex = westIndicesSouthToNorth[0];
260
+ const cornerNWIndex = northIndicesWestToEast[0];
261
+ const cornerNEIndex = eastIndicesNorthToSouth[0];
262
+ const cornerSEIndex = southIndicesEastToWest[0];
263
+ const westSouthIndex = vertexCount;
264
+ const westNorthIndex = westSouthIndex + westIndicesSouthToNorth.length - 1;
265
+ const southEastIndex = westNorthIndex + 1;
266
+ const southWestIndex = southEastIndex + southIndicesEastToWest.length - 1;
267
+ const eastNorthIndex = southWestIndex + 1;
268
+ const eastSouthIndex = eastNorthIndex + eastIndicesNorthToSouth.length - 1;
269
+ const northWestIndex = eastSouthIndex + 1;
270
+ const northEastIndex = northWestIndex + northIndicesWestToEast.length - 1;
271
+ indices[cornerStartIdx + 0] = cornerSWIndex;
272
+ indices[cornerStartIdx + 1] = westSouthIndex;
273
+ indices[cornerStartIdx + 2] = southWestIndex;
274
+ indices[cornerStartIdx + 3] = cornerSEIndex;
275
+ indices[cornerStartIdx + 4] = southEastIndex;
276
+ indices[cornerStartIdx + 5] = eastSouthIndex;
277
+ indices[cornerStartIdx + 6] = cornerNEIndex;
278
+ indices[cornerStartIdx + 7] = eastNorthIndex;
279
+ indices[cornerStartIdx + 8] = northEastIndex;
280
+ indices[cornerStartIdx + 9] = cornerNWIndex;
281
+ indices[cornerStartIdx + 10] = northWestIndex;
282
+ indices[cornerStartIdx + 11] = westNorthIndex;
283
+ };
284
+ function getEdgeIndices(width, height) {
285
+ const westIndicesSouthToNorth = new Array(height);
286
+ const southIndicesEastToWest = new Array(width);
287
+ const eastIndicesNorthToSouth = new Array(height);
288
+ const northIndicesWestToEast = new Array(width);
289
+ let i;
290
+ for (i = 0; i < width; ++i) {
291
+ northIndicesWestToEast[i] = i;
292
+ southIndicesEastToWest[i] = width * height - 1 - i;
293
+ }
294
+ for (i = 0; i < height; ++i) {
295
+ eastIndicesNorthToSouth[i] = (i + 1) * width - 1;
296
+ westIndicesSouthToNorth[i] = (height - i - 1) * width;
297
+ }
298
+ return {
299
+ westIndicesSouthToNorth,
300
+ southIndicesEastToWest,
301
+ eastIndicesNorthToSouth,
302
+ northIndicesWestToEast
303
+ };
304
+ }
305
+ function addRegularGridIndices(width, height, indices, offset) {
306
+ let index = 0;
307
+ for (let j = 0; j < height - 1; ++j) {
308
+ for (let i = 0; i < width - 1; ++i) {
309
+ const upperLeft = index;
310
+ const lowerLeft = upperLeft + width;
311
+ const lowerRight = lowerLeft + 1;
312
+ const upperRight = upperLeft + 1;
313
+ indices[offset++] = upperLeft;
314
+ indices[offset++] = lowerLeft;
315
+ indices[offset++] = upperRight;
316
+ indices[offset++] = upperRight;
317
+ indices[offset++] = lowerLeft;
318
+ indices[offset++] = lowerRight;
319
+ ++index;
320
+ }
321
+ ++index;
322
+ }
323
+ }
324
+ function addSkirtIndices(edgeIndices, vertexIndex, indices, offset) {
325
+ let previousIndex = edgeIndices[0];
326
+ const length = edgeIndices.length;
327
+ for (let i = 1; i < length; ++i) {
328
+ const index = edgeIndices[i];
329
+ indices[offset++] = previousIndex;
330
+ indices[offset++] = index;
331
+ indices[offset++] = vertexIndex;
332
+ indices[offset++] = vertexIndex;
333
+ indices[offset++] = index;
334
+ indices[offset++] = vertexIndex + 1;
335
+ previousIndex = index;
336
+ ++vertexIndex;
337
+ }
338
+ return offset;
339
+ }
340
+ TerrainProvider.heightmapTerrainQuality = 0.25;
341
+ TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap = function(ellipsoid, tileImageWidth, numberOfTilesAtLevelZero) {
342
+ return ellipsoid.maximumRadius * 2 * Math.PI * TerrainProvider.heightmapTerrainQuality / (tileImageWidth * numberOfTilesAtLevelZero);
343
+ };
344
+ TerrainProvider.prototype.requestTileGeometry = DeveloperError_default.throwInstantiationError;
345
+ TerrainProvider.prototype.getLevelMaximumGeometricError = DeveloperError_default.throwInstantiationError;
346
+ TerrainProvider.prototype.getTileDataAvailable = DeveloperError_default.throwInstantiationError;
347
+ TerrainProvider.prototype.loadTileDataAvailability = DeveloperError_default.throwInstantiationError;
348
+ var TerrainProvider_default = TerrainProvider;
349
+
350
+ export {
351
+ TerrainProvider_default
352
+ };