@rtzh/engine 0.0.1 → 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.
Files changed (115) hide show
  1. package/Source/Scene/GltfLoader.js +2 -2
  2. package/Source/Scene/Model/CustomShader.js +2 -2
  3. package/index.js +504 -504
  4. package/package.json +1 -1
  5. package/Build/ThirdParty/Workers/zip-web-worker.js +0 -640
  6. package/Build/Workers/chunk-245NZYCR.js +0 -124
  7. package/Build/Workers/chunk-25BA4527.js +0 -837
  8. package/Build/Workers/chunk-4HXPSZRC.js +0 -1483
  9. package/Build/Workers/chunk-4Z26IS65.js +0 -3514
  10. package/Build/Workers/chunk-55IROWAX.js +0 -139
  11. package/Build/Workers/chunk-56XTN5NJ.js +0 -1800
  12. package/Build/Workers/chunk-5VZISKJF.js +0 -629
  13. package/Build/Workers/chunk-5WAG5YKS.js +0 -368
  14. package/Build/Workers/chunk-66YGZWBI.js +0 -1317
  15. package/Build/Workers/chunk-6H33B6OL.js +0 -37
  16. package/Build/Workers/chunk-6LZBBEA7.js +0 -439
  17. package/Build/Workers/chunk-6XJO625E.js +0 -497
  18. package/Build/Workers/chunk-75UGCVME.js +0 -102
  19. package/Build/Workers/chunk-7B23DD46.js +0 -1054
  20. package/Build/Workers/chunk-7NCJH26L.js +0 -352
  21. package/Build/Workers/chunk-AIW5F22O.js +0 -352
  22. package/Build/Workers/chunk-AL22JVIA.js +0 -256
  23. package/Build/Workers/chunk-AVSQILVI.js +0 -75
  24. package/Build/Workers/chunk-B2VFNYD7.js +0 -280
  25. package/Build/Workers/chunk-BOV6T7FO.js +0 -44
  26. package/Build/Workers/chunk-DP76S3IQ.js +0 -1067
  27. package/Build/Workers/chunk-EDIUN7V3.js +0 -219
  28. package/Build/Workers/chunk-EKMWNF4U.js +0 -55
  29. package/Build/Workers/chunk-ELXGXAYS.js +0 -682
  30. package/Build/Workers/chunk-FVYRV2T6.js +0 -455
  31. package/Build/Workers/chunk-GDIBU55R.js +0 -778
  32. package/Build/Workers/chunk-HAY6YE7M.js +0 -97
  33. package/Build/Workers/chunk-I76SRIKN.js +0 -138
  34. package/Build/Workers/chunk-IELTSYPZ.js +0 -241
  35. package/Build/Workers/chunk-J4MIJCN5.js +0 -171
  36. package/Build/Workers/chunk-JFO3ELF3.js +0 -642
  37. package/Build/Workers/chunk-K4IMD7KH.js +0 -162
  38. package/Build/Workers/chunk-KFMCOG26.js +0 -692
  39. package/Build/Workers/chunk-KH2OWUUA.js +0 -163
  40. package/Build/Workers/chunk-KQIZ7AFF.js +0 -8366
  41. package/Build/Workers/chunk-KVE5EAPO.js +0 -398
  42. package/Build/Workers/chunk-OAOREOSO.js +0 -940
  43. package/Build/Workers/chunk-OFJRMGNX.js +0 -788
  44. package/Build/Workers/chunk-PLLZB3R4.js +0 -198
  45. package/Build/Workers/chunk-POY6ZE32.js +0 -2058
  46. package/Build/Workers/chunk-PV5B2YNB.js +0 -2719
  47. package/Build/Workers/chunk-Q2DXNFYW.js +0 -414
  48. package/Build/Workers/chunk-QWV2DM66.js +0 -1443
  49. package/Build/Workers/chunk-R73BHGGI.js +0 -305
  50. package/Build/Workers/chunk-S3AE3MZZ.js +0 -511
  51. package/Build/Workers/chunk-SBFTVHRW.js +0 -57
  52. package/Build/Workers/chunk-SOR7PD4V.js +0 -114
  53. package/Build/Workers/chunk-TO7TWUET.js +0 -476
  54. package/Build/Workers/chunk-TSAJNE4K.js +0 -101
  55. package/Build/Workers/chunk-TWF4XRZ6.js +0 -73
  56. package/Build/Workers/chunk-UTWLMOPM.js +0 -387
  57. package/Build/Workers/chunk-UYT2PBMV.js +0 -58
  58. package/Build/Workers/chunk-WAS3IHIQ.js +0 -288
  59. package/Build/Workers/chunk-WO5ZNC7S.js +0 -1045
  60. package/Build/Workers/chunk-X65Y2JSA.js +0 -55
  61. package/Build/Workers/chunk-XOVHLPKW.js +0 -299
  62. package/Build/Workers/chunk-YPGJSFOO.js +0 -1460
  63. package/Build/Workers/combineGeometry.js +0 -66
  64. package/Build/Workers/createBoxGeometry.js +0 -58
  65. package/Build/Workers/createBoxOutlineGeometry.js +0 -231
  66. package/Build/Workers/createCircleGeometry.js +0 -201
  67. package/Build/Workers/createCircleOutlineGeometry.js +0 -147
  68. package/Build/Workers/createCoplanarPolygonGeometry.js +0 -505
  69. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +0 -225
  70. package/Build/Workers/createCorridorGeometry.js +0 -1258
  71. package/Build/Workers/createCorridorOutlineGeometry.js +0 -563
  72. package/Build/Workers/createCylinderGeometry.js +0 -60
  73. package/Build/Workers/createCylinderOutlineGeometry.js +0 -231
  74. package/Build/Workers/createEllipseGeometry.js +0 -72
  75. package/Build/Workers/createEllipseOutlineGeometry.js +0 -65
  76. package/Build/Workers/createEllipsoidGeometry.js +0 -59
  77. package/Build/Workers/createEllipsoidOutlineGeometry.js +0 -61
  78. package/Build/Workers/createFrustumGeometry.js +0 -58
  79. package/Build/Workers/createFrustumOutlineGeometry.js +0 -234
  80. package/Build/Workers/createGeometry.js +0 -173
  81. package/Build/Workers/createGroundPolylineGeometry.js +0 -1602
  82. package/Build/Workers/createPlaneGeometry.js +0 -223
  83. package/Build/Workers/createPlaneOutlineGeometry.js +0 -124
  84. package/Build/Workers/createPolygonGeometry.js +0 -1404
  85. package/Build/Workers/createPolygonOutlineGeometry.js +0 -532
  86. package/Build/Workers/createPolylineGeometry.js +0 -491
  87. package/Build/Workers/createPolylineVolumeGeometry.js +0 -374
  88. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +0 -272
  89. package/Build/Workers/createRectangleGeometry.js +0 -1264
  90. package/Build/Workers/createRectangleOutlineGeometry.js +0 -476
  91. package/Build/Workers/createSimplePolylineGeometry.js +0 -397
  92. package/Build/Workers/createSphereGeometry.js +0 -116
  93. package/Build/Workers/createSphereOutlineGeometry.js +0 -116
  94. package/Build/Workers/createTaskProcessorWorker.js +0 -32
  95. package/Build/Workers/createVectorTileClampedPolylines.js +0 -492
  96. package/Build/Workers/createVectorTileGeometries.js +0 -387
  97. package/Build/Workers/createVectorTilePoints.js +0 -114
  98. package/Build/Workers/createVectorTilePolygons.js +0 -386
  99. package/Build/Workers/createVectorTilePolylines.js +0 -262
  100. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +0 -91
  101. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +0 -565
  102. package/Build/Workers/createVerticesFromHeightmap.js +0 -2254
  103. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -499
  104. package/Build/Workers/createWallGeometry.js +0 -487
  105. package/Build/Workers/createWallOutlineGeometry.js +0 -335
  106. package/Build/Workers/decodeDraco.js +0 -369
  107. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +0 -2680
  108. package/Build/Workers/decodeI3S.js +0 -1339
  109. package/Build/Workers/gaussianSplatSorter.js +0 -62
  110. package/Build/Workers/gaussianSplatTextureGenerator.js +0 -68
  111. package/Build/Workers/incrementallyBuildTerrainPicker.js +0 -121
  112. package/Build/Workers/transcodeKTX2.js +0 -3463
  113. package/Build/Workers/transferTypedArrayTest.js +0 -41
  114. package/Build/Workers/upsampleQuantizedTerrainMesh.js +0 -820
  115. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +0 -95
@@ -1,97 +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
- Math_default
28
- } from "./chunk-6XJO625E.js";
29
- import {
30
- Check_default
31
- } from "./chunk-KH2OWUUA.js";
32
- import {
33
- defined_default
34
- } from "./chunk-AVSQILVI.js";
35
-
36
- // packages/engine/Source/Core/arrayRemoveDuplicates.js
37
- var removeDuplicatesEpsilon = Math_default.EPSILON10;
38
- function arrayRemoveDuplicates(values, equalsEpsilon, wrapAround, removedIndices) {
39
- Check_default.defined("equalsEpsilon", equalsEpsilon);
40
- if (!defined_default(values)) {
41
- return void 0;
42
- }
43
- wrapAround = wrapAround ?? false;
44
- const storeRemovedIndices = defined_default(removedIndices);
45
- const length = values.length;
46
- if (length < 2) {
47
- return values;
48
- }
49
- let i;
50
- let v0 = values[0];
51
- let v1;
52
- let cleanedValues;
53
- let lastCleanIndex = 0;
54
- let removedIndexLCI = -1;
55
- for (i = 1; i < length; ++i) {
56
- v1 = values[i];
57
- if (equalsEpsilon(v0, v1, removeDuplicatesEpsilon)) {
58
- if (!defined_default(cleanedValues)) {
59
- cleanedValues = values.slice(0, i);
60
- lastCleanIndex = i - 1;
61
- removedIndexLCI = 0;
62
- }
63
- if (storeRemovedIndices) {
64
- removedIndices.push(i);
65
- }
66
- } else {
67
- if (defined_default(cleanedValues)) {
68
- cleanedValues.push(v1);
69
- lastCleanIndex = i;
70
- if (storeRemovedIndices) {
71
- removedIndexLCI = removedIndices.length;
72
- }
73
- }
74
- v0 = v1;
75
- }
76
- }
77
- if (wrapAround && equalsEpsilon(values[0], values[length - 1], removeDuplicatesEpsilon)) {
78
- if (storeRemovedIndices) {
79
- if (defined_default(cleanedValues)) {
80
- removedIndices.splice(removedIndexLCI, 0, lastCleanIndex);
81
- } else {
82
- removedIndices.push(length - 1);
83
- }
84
- }
85
- if (defined_default(cleanedValues)) {
86
- cleanedValues.length -= 1;
87
- } else {
88
- cleanedValues = values.slice(0, -1);
89
- }
90
- }
91
- return defined_default(cleanedValues) ? cleanedValues : values;
92
- }
93
- var arrayRemoveDuplicates_default = arrayRemoveDuplicates;
94
-
95
- export {
96
- arrayRemoveDuplicates_default
97
- };
@@ -1,138 +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
- Frozen_default
28
- } from "./chunk-QWV2DM66.js";
29
- import {
30
- DeveloperError_default
31
- } from "./chunk-KH2OWUUA.js";
32
- import {
33
- defined_default
34
- } from "./chunk-AVSQILVI.js";
35
-
36
- // packages/engine/Source/Core/VertexFormat.js
37
- function VertexFormat(options) {
38
- options = options ?? Frozen_default.EMPTY_OBJECT;
39
- this.position = options.position ?? false;
40
- this.normal = options.normal ?? false;
41
- this.st = options.st ?? false;
42
- this.bitangent = options.bitangent ?? false;
43
- this.tangent = options.tangent ?? false;
44
- this.color = options.color ?? false;
45
- }
46
- VertexFormat.POSITION_ONLY = Object.freeze(
47
- new VertexFormat({
48
- position: true
49
- })
50
- );
51
- VertexFormat.POSITION_AND_NORMAL = Object.freeze(
52
- new VertexFormat({
53
- position: true,
54
- normal: true
55
- })
56
- );
57
- VertexFormat.POSITION_NORMAL_AND_ST = Object.freeze(
58
- new VertexFormat({
59
- position: true,
60
- normal: true,
61
- st: true
62
- })
63
- );
64
- VertexFormat.POSITION_AND_ST = Object.freeze(
65
- new VertexFormat({
66
- position: true,
67
- st: true
68
- })
69
- );
70
- VertexFormat.POSITION_AND_COLOR = Object.freeze(
71
- new VertexFormat({
72
- position: true,
73
- color: true
74
- })
75
- );
76
- VertexFormat.ALL = Object.freeze(
77
- new VertexFormat({
78
- position: true,
79
- normal: true,
80
- st: true,
81
- tangent: true,
82
- bitangent: true
83
- })
84
- );
85
- VertexFormat.DEFAULT = VertexFormat.POSITION_NORMAL_AND_ST;
86
- VertexFormat.packedLength = 6;
87
- VertexFormat.pack = function(value, array, startingIndex) {
88
- if (!defined_default(value)) {
89
- throw new DeveloperError_default("value is required");
90
- }
91
- if (!defined_default(array)) {
92
- throw new DeveloperError_default("array is required");
93
- }
94
- startingIndex = startingIndex ?? 0;
95
- array[startingIndex++] = value.position ? 1 : 0;
96
- array[startingIndex++] = value.normal ? 1 : 0;
97
- array[startingIndex++] = value.st ? 1 : 0;
98
- array[startingIndex++] = value.tangent ? 1 : 0;
99
- array[startingIndex++] = value.bitangent ? 1 : 0;
100
- array[startingIndex] = value.color ? 1 : 0;
101
- return array;
102
- };
103
- VertexFormat.unpack = function(array, startingIndex, result) {
104
- if (!defined_default(array)) {
105
- throw new DeveloperError_default("array is required");
106
- }
107
- startingIndex = startingIndex ?? 0;
108
- if (!defined_default(result)) {
109
- result = new VertexFormat();
110
- }
111
- result.position = array[startingIndex++] === 1;
112
- result.normal = array[startingIndex++] === 1;
113
- result.st = array[startingIndex++] === 1;
114
- result.tangent = array[startingIndex++] === 1;
115
- result.bitangent = array[startingIndex++] === 1;
116
- result.color = array[startingIndex] === 1;
117
- return result;
118
- };
119
- VertexFormat.clone = function(vertexFormat, result) {
120
- if (!defined_default(vertexFormat)) {
121
- return void 0;
122
- }
123
- if (!defined_default(result)) {
124
- result = new VertexFormat();
125
- }
126
- result.position = vertexFormat.position;
127
- result.normal = vertexFormat.normal;
128
- result.st = vertexFormat.st;
129
- result.tangent = vertexFormat.tangent;
130
- result.bitangent = vertexFormat.bitangent;
131
- result.color = vertexFormat.color;
132
- return result;
133
- };
134
- var VertexFormat_default = VertexFormat;
135
-
136
- export {
137
- VertexFormat_default
138
- };
@@ -1,241 +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
- GeographicProjection_default
28
- } from "./chunk-OAOREOSO.js";
29
- import {
30
- Matrix2_default,
31
- Rectangle_default
32
- } from "./chunk-KQIZ7AFF.js";
33
- import {
34
- Cartographic_default,
35
- Ellipsoid_default
36
- } from "./chunk-YPGJSFOO.js";
37
- import {
38
- Cartesian3_default
39
- } from "./chunk-QWV2DM66.js";
40
- import {
41
- Math_default
42
- } from "./chunk-6XJO625E.js";
43
- import {
44
- DeveloperError_default
45
- } from "./chunk-KH2OWUUA.js";
46
- import {
47
- defined_default
48
- } from "./chunk-AVSQILVI.js";
49
-
50
- // packages/engine/Source/Core/RectangleGeometryLibrary.js
51
- var cos = Math.cos;
52
- var sin = Math.sin;
53
- var sqrt = Math.sqrt;
54
- var RectangleGeometryLibrary = {};
55
- RectangleGeometryLibrary.computePosition = function(computedOptions, ellipsoid, computeST, row, col, position, st) {
56
- const radiiSquared = ellipsoid.radiiSquared;
57
- const nwCorner = computedOptions.nwCorner;
58
- const rectangle = computedOptions.boundingRectangle;
59
- let stLatitude = nwCorner.latitude - computedOptions.granYCos * row + col * computedOptions.granXSin;
60
- const cosLatitude = cos(stLatitude);
61
- const nZ = sin(stLatitude);
62
- const kZ = radiiSquared.z * nZ;
63
- let stLongitude = nwCorner.longitude + row * computedOptions.granYSin + col * computedOptions.granXCos;
64
- const nX = cosLatitude * cos(stLongitude);
65
- const nY = cosLatitude * sin(stLongitude);
66
- const kX = radiiSquared.x * nX;
67
- const kY = radiiSquared.y * nY;
68
- const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);
69
- position.x = kX / gamma;
70
- position.y = kY / gamma;
71
- position.z = kZ / gamma;
72
- if (computeST) {
73
- const stNwCorner = computedOptions.stNwCorner;
74
- if (defined_default(stNwCorner)) {
75
- stLatitude = stNwCorner.latitude - computedOptions.stGranYCos * row + col * computedOptions.stGranXSin;
76
- stLongitude = stNwCorner.longitude + row * computedOptions.stGranYSin + col * computedOptions.stGranXCos;
77
- st.x = (stLongitude - computedOptions.stWest) * computedOptions.lonScalar;
78
- st.y = (stLatitude - computedOptions.stSouth) * computedOptions.latScalar;
79
- } else {
80
- st.x = (stLongitude - rectangle.west) * computedOptions.lonScalar;
81
- st.y = (stLatitude - rectangle.south) * computedOptions.latScalar;
82
- }
83
- }
84
- };
85
- var rotationMatrixScratch = new Matrix2_default();
86
- var nwCartesian = new Cartesian3_default();
87
- var centerScratch = new Cartographic_default();
88
- var centerCartesian = new Cartesian3_default();
89
- var proj = new GeographicProjection_default();
90
- function getRotationOptions(nwCorner, rotation, granularityX, granularityY, center, width, height) {
91
- const cosRotation = Math.cos(rotation);
92
- const granYCos = granularityY * cosRotation;
93
- const granXCos = granularityX * cosRotation;
94
- const sinRotation = Math.sin(rotation);
95
- const granYSin = granularityY * sinRotation;
96
- const granXSin = granularityX * sinRotation;
97
- proj._ellipsoid = Ellipsoid_default.default;
98
- nwCartesian = proj.project(nwCorner, nwCartesian);
99
- nwCartesian = Cartesian3_default.subtract(nwCartesian, centerCartesian, nwCartesian);
100
- const rotationMatrix = Matrix2_default.fromRotation(rotation, rotationMatrixScratch);
101
- nwCartesian = Matrix2_default.multiplyByVector(
102
- rotationMatrix,
103
- nwCartesian,
104
- nwCartesian
105
- );
106
- nwCartesian = Cartesian3_default.add(nwCartesian, centerCartesian, nwCartesian);
107
- nwCorner = proj.unproject(nwCartesian, nwCorner);
108
- width -= 1;
109
- height -= 1;
110
- const latitude = nwCorner.latitude;
111
- const latitude0 = latitude + width * granXSin;
112
- const latitude1 = latitude - granYCos * height;
113
- const latitude2 = latitude - granYCos * height + width * granXSin;
114
- const north = Math.max(latitude, latitude0, latitude1, latitude2);
115
- const south = Math.min(latitude, latitude0, latitude1, latitude2);
116
- const longitude = nwCorner.longitude;
117
- const longitude0 = longitude + width * granXCos;
118
- const longitude1 = longitude + height * granYSin;
119
- const longitude2 = longitude + height * granYSin + width * granXCos;
120
- const east = Math.max(longitude, longitude0, longitude1, longitude2);
121
- const west = Math.min(longitude, longitude0, longitude1, longitude2);
122
- return {
123
- north,
124
- south,
125
- east,
126
- west,
127
- granYCos,
128
- granYSin,
129
- granXCos,
130
- granXSin,
131
- nwCorner
132
- };
133
- }
134
- RectangleGeometryLibrary.computeOptions = function(rectangle, granularity, rotation, stRotation, boundingRectangleScratch, nwCornerResult, stNwCornerResult) {
135
- let east = rectangle.east;
136
- let west = rectangle.west;
137
- let north = rectangle.north;
138
- let south = rectangle.south;
139
- let northCap = false;
140
- let southCap = false;
141
- if (north === Math_default.PI_OVER_TWO) {
142
- northCap = true;
143
- }
144
- if (south === -Math_default.PI_OVER_TWO) {
145
- southCap = true;
146
- }
147
- let dx;
148
- const dy = north - south;
149
- if (west > east) {
150
- dx = Math_default.TWO_PI - west + east;
151
- } else {
152
- dx = east - west;
153
- }
154
- const width = Math.ceil(dx / granularity) + 1;
155
- const height = Math.ceil(dy / granularity) + 1;
156
- const granularityX = dx / (width - 1);
157
- const granularityY = dy / (height - 1);
158
- const nwCorner = Rectangle_default.northwest(rectangle, nwCornerResult);
159
- const center = Rectangle_default.center(rectangle, centerScratch);
160
- if (rotation !== 0 || stRotation !== 0) {
161
- if (center.longitude < nwCorner.longitude) {
162
- center.longitude += Math_default.TWO_PI;
163
- }
164
- proj._ellipsoid = Ellipsoid_default.default;
165
- centerCartesian = proj.project(center, centerCartesian);
166
- }
167
- const granYCos = granularityY;
168
- const granXCos = granularityX;
169
- const granYSin = 0;
170
- const granXSin = 0;
171
- const boundingRectangle = Rectangle_default.clone(
172
- rectangle,
173
- boundingRectangleScratch
174
- );
175
- const computedOptions = {
176
- granYCos,
177
- granYSin,
178
- granXCos,
179
- granXSin,
180
- nwCorner,
181
- boundingRectangle,
182
- width,
183
- height,
184
- northCap,
185
- southCap
186
- };
187
- if (rotation !== 0) {
188
- const rotationOptions = getRotationOptions(
189
- nwCorner,
190
- rotation,
191
- granularityX,
192
- granularityY,
193
- center,
194
- width,
195
- height
196
- );
197
- north = rotationOptions.north;
198
- south = rotationOptions.south;
199
- east = rotationOptions.east;
200
- west = rotationOptions.west;
201
- if (north < -Math_default.PI_OVER_TWO || north > Math_default.PI_OVER_TWO || south < -Math_default.PI_OVER_TWO || south > Math_default.PI_OVER_TWO) {
202
- throw new DeveloperError_default(
203
- "Rotated rectangle is invalid. It crosses over either the north or south pole."
204
- );
205
- }
206
- computedOptions.granYCos = rotationOptions.granYCos;
207
- computedOptions.granYSin = rotationOptions.granYSin;
208
- computedOptions.granXCos = rotationOptions.granXCos;
209
- computedOptions.granXSin = rotationOptions.granXSin;
210
- boundingRectangle.north = north;
211
- boundingRectangle.south = south;
212
- boundingRectangle.east = east;
213
- boundingRectangle.west = west;
214
- }
215
- if (stRotation !== 0) {
216
- rotation = rotation - stRotation;
217
- const stNwCorner = Rectangle_default.northwest(boundingRectangle, stNwCornerResult);
218
- const stRotationOptions = getRotationOptions(
219
- stNwCorner,
220
- rotation,
221
- granularityX,
222
- granularityY,
223
- center,
224
- width,
225
- height
226
- );
227
- computedOptions.stGranYCos = stRotationOptions.granYCos;
228
- computedOptions.stGranXCos = stRotationOptions.granXCos;
229
- computedOptions.stGranYSin = stRotationOptions.granYSin;
230
- computedOptions.stGranXSin = stRotationOptions.granXSin;
231
- computedOptions.stNwCorner = stNwCorner;
232
- computedOptions.stWest = stRotationOptions.west;
233
- computedOptions.stSouth = stRotationOptions.south;
234
- }
235
- return computedOptions;
236
- };
237
- var RectangleGeometryLibrary_default = RectangleGeometryLibrary;
238
-
239
- export {
240
- RectangleGeometryLibrary_default
241
- };
@@ -1,171 +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
- Cartesian4_default,
28
- Matrix4_default
29
- } from "./chunk-POY6ZE32.js";
30
- import {
31
- Cartesian3_default
32
- } from "./chunk-QWV2DM66.js";
33
- import {
34
- Math_default
35
- } from "./chunk-6XJO625E.js";
36
- import {
37
- Check_default,
38
- DeveloperError_default
39
- } from "./chunk-KH2OWUUA.js";
40
- import {
41
- defined_default
42
- } from "./chunk-AVSQILVI.js";
43
-
44
- // packages/engine/Source/Core/Plane.js
45
- function Plane(normal, distance) {
46
- Check_default.typeOf.object("normal", normal);
47
- if (!Math_default.equalsEpsilon(
48
- Cartesian3_default.magnitude(normal),
49
- 1,
50
- Math_default.EPSILON6
51
- )) {
52
- throw new DeveloperError_default("normal must be normalized.");
53
- }
54
- Check_default.typeOf.number("distance", distance);
55
- this.normal = Cartesian3_default.clone(normal);
56
- this.distance = distance;
57
- }
58
- Plane.fromPointNormal = function(point, normal, result) {
59
- Check_default.typeOf.object("point", point);
60
- Check_default.typeOf.object("normal", normal);
61
- if (!Math_default.equalsEpsilon(
62
- Cartesian3_default.magnitude(normal),
63
- 1,
64
- Math_default.EPSILON6
65
- )) {
66
- throw new DeveloperError_default("normal must be normalized.");
67
- }
68
- const distance = -Cartesian3_default.dot(normal, point);
69
- if (!defined_default(result)) {
70
- return new Plane(normal, distance);
71
- }
72
- Cartesian3_default.clone(normal, result.normal);
73
- result.distance = distance;
74
- return result;
75
- };
76
- var scratchNormal = new Cartesian3_default();
77
- Plane.fromCartesian4 = function(coefficients, result) {
78
- Check_default.typeOf.object("coefficients", coefficients);
79
- const normal = Cartesian3_default.fromCartesian4(coefficients, scratchNormal);
80
- const distance = coefficients.w;
81
- if (!Math_default.equalsEpsilon(
82
- Cartesian3_default.magnitude(normal),
83
- 1,
84
- Math_default.EPSILON6
85
- )) {
86
- throw new DeveloperError_default("normal must be normalized.");
87
- }
88
- if (!defined_default(result)) {
89
- return new Plane(normal, distance);
90
- }
91
- Cartesian3_default.clone(normal, result.normal);
92
- result.distance = distance;
93
- return result;
94
- };
95
- Plane.getPointDistance = function(plane, point) {
96
- Check_default.typeOf.object("plane", plane);
97
- Check_default.typeOf.object("point", point);
98
- return Cartesian3_default.dot(plane.normal, point) + plane.distance;
99
- };
100
- var scratchCartesian = new Cartesian3_default();
101
- Plane.projectPointOntoPlane = function(plane, point, result) {
102
- Check_default.typeOf.object("plane", plane);
103
- Check_default.typeOf.object("point", point);
104
- if (!defined_default(result)) {
105
- result = new Cartesian3_default();
106
- }
107
- const pointDistance = Plane.getPointDistance(plane, point);
108
- const scaledNormal = Cartesian3_default.multiplyByScalar(
109
- plane.normal,
110
- pointDistance,
111
- scratchCartesian
112
- );
113
- return Cartesian3_default.subtract(point, scaledNormal, result);
114
- };
115
- var scratchInverseTranspose = new Matrix4_default();
116
- var scratchPlaneCartesian4 = new Cartesian4_default();
117
- var scratchTransformNormal = new Cartesian3_default();
118
- Plane.transform = function(plane, transform, result) {
119
- Check_default.typeOf.object("plane", plane);
120
- Check_default.typeOf.object("transform", transform);
121
- const normal = plane.normal;
122
- const distance = plane.distance;
123
- const inverseTranspose = Matrix4_default.inverseTranspose(
124
- transform,
125
- scratchInverseTranspose
126
- );
127
- let planeAsCartesian4 = Cartesian4_default.fromElements(
128
- normal.x,
129
- normal.y,
130
- normal.z,
131
- distance,
132
- scratchPlaneCartesian4
133
- );
134
- planeAsCartesian4 = Matrix4_default.multiplyByVector(
135
- inverseTranspose,
136
- planeAsCartesian4,
137
- planeAsCartesian4
138
- );
139
- const transformedNormal = Cartesian3_default.fromCartesian4(
140
- planeAsCartesian4,
141
- scratchTransformNormal
142
- );
143
- planeAsCartesian4 = Cartesian4_default.divideByScalar(
144
- planeAsCartesian4,
145
- Cartesian3_default.magnitude(transformedNormal),
146
- planeAsCartesian4
147
- );
148
- return Plane.fromCartesian4(planeAsCartesian4, result);
149
- };
150
- Plane.clone = function(plane, result) {
151
- Check_default.typeOf.object("plane", plane);
152
- if (!defined_default(result)) {
153
- return new Plane(plane.normal, plane.distance);
154
- }
155
- Cartesian3_default.clone(plane.normal, result.normal);
156
- result.distance = plane.distance;
157
- return result;
158
- };
159
- Plane.equals = function(left, right) {
160
- Check_default.typeOf.object("left", left);
161
- Check_default.typeOf.object("right", right);
162
- return left.distance === right.distance && Cartesian3_default.equals(left.normal, right.normal);
163
- };
164
- Plane.ORIGIN_XY_PLANE = Object.freeze(new Plane(Cartesian3_default.UNIT_Z, 0));
165
- Plane.ORIGIN_YZ_PLANE = Object.freeze(new Plane(Cartesian3_default.UNIT_X, 0));
166
- Plane.ORIGIN_ZX_PLANE = Object.freeze(new Plane(Cartesian3_default.UNIT_Y, 0));
167
- var Plane_default = Plane;
168
-
169
- export {
170
- Plane_default
171
- };