deeptwins-cesium-engine 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Build/Workers/chunk-25EUEBF2.js +124 -0
- package/Build/Workers/chunk-2CAKI5VM.js +57 -0
- package/Build/Workers/chunk-2HWLF3FT.js +837 -0
- package/Build/Workers/chunk-2KXMJ5XS.js +3792 -0
- package/Build/Workers/chunk-2NPCLB3H.js +56 -0
- package/Build/Workers/chunk-2QJB3UQS.js +693 -0
- package/Build/Workers/chunk-2ZHQTIBH.js +1483 -0
- package/Build/Workers/chunk-3GLYOW63.js +352 -0
- package/Build/Workers/chunk-3L22KMPU.js +219 -0
- package/Build/Workers/chunk-3Q6V2B2I.js +73 -0
- package/Build/Workers/chunk-3QOKKRIG.js +387 -0
- package/Build/Workers/chunk-44YZFGRH.js +1800 -0
- package/Build/Workers/chunk-45VV4SBO.js +2342 -0
- package/Build/Workers/chunk-4EJ4AA2S.js +368 -0
- package/Build/Workers/chunk-4IJFHUL6.js +414 -0
- package/Build/Workers/chunk-4K3V5CGW.js +454 -0
- package/Build/Workers/chunk-4M4QL6KJ.js +305 -0
- package/Build/Workers/chunk-4NYAIWKE.js +9230 -0
- package/Build/Workers/chunk-4UFWOGZY.js +219 -0
- package/Build/Workers/chunk-4WQTGBXO.js +101 -0
- package/Build/Workers/chunk-4YNRIEQ6.js +288 -0
- package/Build/Workers/chunk-56CVDPH5.js +352 -0
- package/Build/Workers/chunk-5CTAAPXH.js +1483 -0
- package/Build/Workers/chunk-5ISZ6NJD.js +102 -0
- package/Build/Workers/chunk-5JU3AMGC.js +305 -0
- package/Build/Workers/chunk-5SDHYIOS.js +56 -0
- package/Build/Workers/chunk-66TGUMCU.js +2719 -0
- package/Build/Workers/chunk-6EJMTDQJ.js +163 -0
- package/Build/Workers/chunk-6G5GV3DZ.js +1344 -0
- package/Build/Workers/chunk-6PEUTCFR.js +198 -0
- package/Build/Workers/chunk-6R6KMIRZ.js +2342 -0
- package/Build/Workers/chunk-6VWXYSMH.js +959 -0
- package/Build/Workers/chunk-6VZ7VB2Q.js +241 -0
- package/Build/Workers/chunk-77GTDBAP.js +56 -0
- package/Build/Workers/chunk-7AMRE57Q.js +301 -0
- package/Build/Workers/chunk-7DH6C33H.js +398 -0
- package/Build/Workers/chunk-7EIO4FD6.js +959 -0
- package/Build/Workers/chunk-7LAIAVBB.js +58 -0
- package/Build/Workers/chunk-7VUS3FVE.js +38 -0
- package/Build/Workers/chunk-7WWTFKKO.js +368 -0
- package/Build/Workers/chunk-7Y2RBWWM.js +38 -0
- package/Build/Workers/chunk-7Y3ZA6H3.js +198 -0
- package/Build/Workers/chunk-A6BMHZNA.js +38 -0
- package/Build/Workers/chunk-A7XY2MN7.js +171 -0
- package/Build/Workers/chunk-AC7ND63S.js +57 -0
- package/Build/Workers/chunk-AHCZ757M.js +9230 -0
- package/Build/Workers/chunk-AKD5GQ6U.js +2719 -0
- package/Build/Workers/chunk-ALLK4PGJ.js +789 -0
- package/Build/Workers/chunk-AMF27T27.js +56 -0
- package/Build/Workers/chunk-ANOA7E7F.js +56 -0
- package/Build/Workers/chunk-AYO5HHV6.js +789 -0
- package/Build/Workers/chunk-BE2N56VZ.js +1344 -0
- package/Build/Workers/chunk-BK4QH7VE.js +414 -0
- package/Build/Workers/chunk-BR3BPM64.js +9230 -0
- package/Build/Workers/chunk-BVKS7HHS.js +973 -0
- package/Build/Workers/chunk-BVMRWGOK.js +455 -0
- package/Build/Workers/chunk-BXEL2NX7.js +455 -0
- package/Build/Workers/chunk-C5BO2JCG.js +278 -0
- package/Build/Workers/chunk-CIRQNZVR.js +301 -0
- package/Build/Workers/chunk-CM67CQME.js +305 -0
- package/Build/Workers/chunk-D3QIW4DH.js +630 -0
- package/Build/Workers/chunk-DSQHAHOK.js +837 -0
- package/Build/Workers/chunk-E5W7QIGZ.js +511 -0
- package/Build/Workers/chunk-E6CYGUJI.js +1054 -0
- package/Build/Workers/chunk-EGJXVWHV.js +1054 -0
- package/Build/Workers/chunk-EIZ23IOX.js +414 -0
- package/Build/Workers/chunk-EIZJUMQY.js +101 -0
- package/Build/Workers/chunk-ENS5SOS4.js +511 -0
- package/Build/Workers/chunk-EXTMZJXB.js +82 -0
- package/Build/Workers/chunk-EYOOSIBW.js +682 -0
- package/Build/Workers/chunk-F37WADVC.js +1054 -0
- package/Build/Workers/chunk-FIWPJFHX.js +101 -0
- package/Build/Workers/chunk-FM32TNGT.js +198 -0
- package/Build/Workers/chunk-FOMYIEIB.js +476 -0
- package/Build/Workers/chunk-FQR6XCLN.js +162 -0
- package/Build/Workers/chunk-FSWIXRGZ.js +497 -0
- package/Build/Workers/chunk-FWYDLSVQ.js +97 -0
- package/Build/Workers/chunk-GBT2N74U.js +163 -0
- package/Build/Workers/chunk-HGEAXEOZ.js +280 -0
- package/Build/Workers/chunk-HGZR6CZF.js +1067 -0
- package/Build/Workers/chunk-HIXHDABG.js +288 -0
- package/Build/Workers/chunk-HMCCZZWE.js +97 -0
- package/Build/Workers/chunk-HQZEFF4Z.js +454 -0
- package/Build/Workers/chunk-HW54WHGM.js +2719 -0
- package/Build/Workers/chunk-I4QYOM5K.js +455 -0
- package/Build/Workers/chunk-IHE2N4VH.js +288 -0
- package/Build/Workers/chunk-IHYAI7GF.js +973 -0
- package/Build/Workers/chunk-INLQ7LVK.js +837 -0
- package/Build/Workers/chunk-IQMESTCB.js +124 -0
- package/Build/Workers/chunk-J4PISUNT.js +2342 -0
- package/Build/Workers/chunk-JCS3XT73.js +82 -0
- package/Build/Workers/chunk-JSWU557I.js +693 -0
- package/Build/Workers/chunk-KCH6EOD4.js +352 -0
- package/Build/Workers/chunk-KHONDSQ7.js +693 -0
- package/Build/Workers/chunk-KLUL2SOE.js +352 -0
- package/Build/Workers/chunk-KMBLKQCC.js +1992 -0
- package/Build/Workers/chunk-KOTWWQN7.js +171 -0
- package/Build/Workers/chunk-KWV6ZTF4.js +163 -0
- package/Build/Workers/chunk-LSEFPQHG.js +476 -0
- package/Build/Workers/chunk-LV4OI5ID.js +387 -0
- package/Build/Workers/chunk-M66X4O24.js +44 -0
- package/Build/Workers/chunk-M6IXKBC7.js +1992 -0
- package/Build/Workers/chunk-MFUC3D5C.js +162 -0
- package/Build/Workers/chunk-MFZKRTYB.js +1483 -0
- package/Build/Workers/chunk-MRMNELAH.js +82 -0
- package/Build/Workers/chunk-MUWZDPXK.js +1800 -0
- package/Build/Workers/chunk-N3NUA5H2.js +3792 -0
- package/Build/Workers/chunk-NESWM54C.js +682 -0
- package/Build/Workers/chunk-NFB2NXJN.js +138 -0
- package/Build/Workers/chunk-NQAXBK4K.js +789 -0
- package/Build/Workers/chunk-NUGQWV6S.js +352 -0
- package/Build/Workers/chunk-O7S7WL7K.js +278 -0
- package/Build/Workers/chunk-ODULNNLO.js +1287 -0
- package/Build/Workers/chunk-ODZYB26X.js +1287 -0
- package/Build/Workers/chunk-OEHJY463.js +3201 -0
- package/Build/Workers/chunk-OL5H7YBQ.js +352 -0
- package/Build/Workers/chunk-OMMRNMXF.js +44 -0
- package/Build/Workers/chunk-OZ2IRN2C.js +778 -0
- package/Build/Workers/chunk-OZ3CQDO3.js +138 -0
- package/Build/Workers/chunk-P4UBHYRZ.js +97 -0
- package/Build/Workers/chunk-PNXBG64I.js +219 -0
- package/Build/Workers/chunk-PPWA7GXB.js +44 -0
- package/Build/Workers/chunk-PYR35GK4.js +973 -0
- package/Build/Workers/chunk-Q4CXGW74.js +57 -0
- package/Build/Workers/chunk-QBIOFX7R.js +301 -0
- package/Build/Workers/chunk-QGISLKCW.js +147 -0
- package/Build/Workers/chunk-QQHVOJW6.js +497 -0
- package/Build/Workers/chunk-QWCMMRJW.js +58 -0
- package/Build/Workers/chunk-RD45JEP7.js +1067 -0
- package/Build/Workers/chunk-RDEZCHF4.js +398 -0
- package/Build/Workers/chunk-RER7IKLT.js +3792 -0
- package/Build/Workers/chunk-RYZFATWN.js +102 -0
- package/Build/Workers/chunk-S2QSARI3.js +171 -0
- package/Build/Workers/chunk-S5JQY4HG.js +241 -0
- package/Build/Workers/chunk-SJTE7FVN.js +778 -0
- package/Build/Workers/chunk-SM5T67LR.js +162 -0
- package/Build/Workers/chunk-T27NNXEU.js +58 -0
- package/Build/Workers/chunk-T4J5BWUO.js +511 -0
- package/Build/Workers/chunk-T6JS4BRN.js +140 -0
- package/Build/Workers/chunk-TBJLMQRB.js +73 -0
- package/Build/Workers/chunk-UH6DUQBW.js +140 -0
- package/Build/Workers/chunk-UJAH6XKF.js +73 -0
- package/Build/Workers/chunk-UKSTJ2PH.js +454 -0
- package/Build/Workers/chunk-UNZDKQSP.js +476 -0
- package/Build/Workers/chunk-UQCDCCZ7.js +368 -0
- package/Build/Workers/chunk-USCOUU3R.js +138 -0
- package/Build/Workers/chunk-UXIFNEA3.js +1287 -0
- package/Build/Workers/chunk-UXJ6J5L7.js +56 -0
- package/Build/Workers/chunk-V4VUAZXI.js +1800 -0
- package/Build/Workers/chunk-VQH2YXO2.js +497 -0
- package/Build/Workers/chunk-VXKCLSE4.js +241 -0
- package/Build/Workers/chunk-W3U6YBEI.js +280 -0
- package/Build/Workers/chunk-W75ZVFKP.js +778 -0
- package/Build/Workers/chunk-WCDFJYFB.js +1344 -0
- package/Build/Workers/chunk-WME5M6W3.js +630 -0
- package/Build/Workers/chunk-XDQBQB64.js +1067 -0
- package/Build/Workers/chunk-XPE3XXMD.js +630 -0
- package/Build/Workers/chunk-XSA5DY4V.js +147 -0
- package/Build/Workers/chunk-XYSBQE34.js +398 -0
- package/Build/Workers/chunk-Y6HOIWE5.js +959 -0
- package/Build/Workers/chunk-YEMC2ZOR.js +147 -0
- package/Build/Workers/chunk-YWNF3TPE.js +682 -0
- package/Build/Workers/chunk-YWX7P76L.js +3201 -0
- package/Build/Workers/chunk-Z55VGWJP.js +280 -0
- package/Build/Workers/chunk-Z5YWP24C.js +124 -0
- package/Build/Workers/chunk-ZHXCWUJB.js +387 -0
- package/Build/Workers/chunk-ZIMPUF2I.js +102 -0
- package/Build/Workers/chunk-ZKDWYQKC.js +3201 -0
- package/Build/Workers/chunk-ZLZGNFFR.js +278 -0
- package/Build/Workers/chunk-ZNXRMW7W.js +140 -0
- package/Build/Workers/chunk-ZXZCQCUS.js +1992 -0
- package/Build/Workers/combineGeometry.js +24 -22
- package/Build/Workers/createBoxGeometry.js +18 -16
- package/Build/Workers/createBoxOutlineGeometry.js +23 -25
- package/Build/Workers/createCircleGeometry.js +29 -27
- package/Build/Workers/createCircleOutlineGeometry.js +22 -20
- package/Build/Workers/createCoplanarPolygonGeometry.js +43 -43
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +37 -35
- package/Build/Workers/createCorridorGeometry.js +46 -49
- package/Build/Workers/createCorridorOutlineGeometry.js +40 -43
- package/Build/Workers/createCylinderGeometry.js +20 -18
- package/Build/Workers/createCylinderOutlineGeometry.js +27 -25
- package/Build/Workers/createEllipseGeometry.js +28 -25
- package/Build/Workers/createEllipseOutlineGeometry.js +21 -18
- package/Build/Workers/createEllipsoidGeometry.js +19 -17
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -16
- package/Build/Workers/createFrustumGeometry.js +18 -16
- package/Build/Workers/createFrustumOutlineGeometry.js +21 -21
- package/Build/Workers/createGeometry.js +31 -26
- package/Build/Workers/createGroundPolylineGeometry.js +188 -135
- package/Build/Workers/createPlaneGeometry.js +22 -21
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -13
- package/Build/Workers/createPolygonGeometry.js +51 -52
- package/Build/Workers/createPolygonOutlineGeometry.js +43 -44
- package/Build/Workers/createPolylineGeometry.js +37 -40
- package/Build/Workers/createPolylineVolumeGeometry.js +41 -44
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +36 -39
- package/Build/Workers/createRectangleGeometry.js +47 -53
- package/Build/Workers/createRectangleOutlineGeometry.js +32 -33
- package/Build/Workers/createSimplePolylineGeometry.js +33 -34
- package/Build/Workers/createSphereGeometry.js +20 -20
- package/Build/Workers/createSphereOutlineGeometry.js +19 -19
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +16 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -22
- package/Build/Workers/createVectorTilePoints.js +15 -13
- package/Build/Workers/createVectorTilePolygons.js +24 -21
- package/Build/Workers/createVectorTilePolylines.js +16 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +29 -27
- package/Build/Workers/createVerticesFromHeightmap.js +42 -63
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -280
- package/Build/Workers/createWallGeometry.js +35 -36
- package/Build/Workers/createWallOutlineGeometry.js +33 -34
- package/Build/Workers/decodeDraco.js +10 -11
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +16 -20
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +20 -12
- package/Build/Workers/transcodeKTX2.js +42 -14
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -21
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Renderer/TextureAtlas.js +240 -43
- package/Source/Shaders/BillboardCollectionFS.js +85 -81
- package/Source/Shaders/BillboardCollectionVS.js +60 -118
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.js +12 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +11 -0
- package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +12 -0
- package/Source/Shaders/Builtin/Functions/columbusViewMorph.js +8 -1
- package/Source/Shaders/Builtin/Functions/computeTextureTransform.js +25 -0
- package/Source/Shaders/Builtin/Functions/decodeRGB8.js +24 -0
- package/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.js +2 -1
- package/Source/Shaders/Builtin/Functions/unpackTexture.js +37 -0
- package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js +0 -1
- package/Source/Shaders/EllipsoidVS.js +4 -4
- package/Source/Shaders/FXAA3_11.js +2 -0
- package/Source/Shaders/GlobeFS.js +22 -0
- package/Source/Shaders/GlobeVS.js +3 -2
- package/Source/Shaders/Model/MaterialStageFS.js +50 -20
- package/Source/Shaders/Model/MetadataStageFS.js +2 -1
- package/Source/Shaders/Model/MetadataStageVS.js +2 -1
- package/Source/Shaders/Model/ModelFS.js +32 -2
- package/Source/Shaders/Model/ModelVS.js +15 -1
- package/Source/Shaders/Model/PointCloudStylingStageVS.js +2 -1
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +0 -1
- package/Source/Shaders/PointPrimitiveCollectionVS.js +8 -39
- package/Source/Shaders/PolygonSignedDistanceFS.js +64 -33
- package/Source/Shaders/PolylineCommon.js +1 -1
- package/Source/Shaders/ShadowVolumeAppearanceFS.js +7 -15
- package/Source/Shaders/SkyAtmosphereVS.js +2 -1
- package/Source/Shaders/Voxels/IntersectBox.js +20 -33
- package/Source/Shaders/Voxels/IntersectCylinder.js +28 -32
- package/Source/Shaders/Voxels/IntersectDepth.js +10 -6
- package/Source/Shaders/Voxels/IntersectEllipsoid.js +12 -20
- package/Source/Shaders/Voxels/IntersectLongitude.js +21 -9
- package/Source/Shaders/Voxels/Intersection.js +3 -5
- package/Source/Shaders/Voxels/IntersectionUtils.js +2 -1
- package/Source/Shaders/Voxels/Megatexture.js +15 -83
- package/Source/Shaders/Voxels/Octree.js +53 -61
- package/Source/Shaders/Voxels/VoxelFS.js +67 -52
- package/Source/Shaders/Voxels/VoxelUtils.js +0 -19
- package/index.js +170 -168
- package/package.json +1 -1
- package/Source/Shaders/Voxels/IntersectClippingPlanes.js +0 -80
- package/Source/Shaders/Voxels/convertUvToBox.js +0 -46
- package/Source/Shaders/Voxels/convertUvToCylinder.js +0 -101
- package/Source/Shaders/Voxels/convertUvToEllipsoid.js +0 -141
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 0.1.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
|
+
Cartographic_default,
|
|
28
|
+
Ellipsoid_default
|
|
29
|
+
} from "./chunk-ZXZCQCUS.js";
|
|
30
|
+
import {
|
|
31
|
+
Cartesian3_default
|
|
32
|
+
} from "./chunk-6R6KMIRZ.js";
|
|
33
|
+
import {
|
|
34
|
+
Math_default
|
|
35
|
+
} from "./chunk-FSWIXRGZ.js";
|
|
36
|
+
import {
|
|
37
|
+
DeveloperError_default
|
|
38
|
+
} from "./chunk-GBT2N74U.js";
|
|
39
|
+
import {
|
|
40
|
+
defined_default
|
|
41
|
+
} from "./chunk-JCS3XT73.js";
|
|
42
|
+
|
|
43
|
+
// packages/engine/Source/Core/WebMercatorProjection.js
|
|
44
|
+
var WebMercatorProjection = class _WebMercatorProjection {
|
|
45
|
+
/**
|
|
46
|
+
* @param {Ellipsoid} [ellipsoid=Ellipsoid.WGS84] The ellipsoid.
|
|
47
|
+
*/
|
|
48
|
+
constructor(ellipsoid) {
|
|
49
|
+
this._ellipsoid = ellipsoid ?? Ellipsoid_default.WGS84;
|
|
50
|
+
this._semimajorAxis = this._ellipsoid.maximumRadius;
|
|
51
|
+
this._oneOverSemimajorAxis = 1 / this._semimajorAxis;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Gets the {@link Ellipsoid}.
|
|
55
|
+
*
|
|
56
|
+
* @type {Ellipsoid}
|
|
57
|
+
* @readonly
|
|
58
|
+
*/
|
|
59
|
+
get ellipsoid() {
|
|
60
|
+
return this._ellipsoid;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Converts a Mercator angle, in the range -PI to PI, to a geodetic latitude
|
|
64
|
+
* in the range -PI/2 to PI/2.
|
|
65
|
+
*
|
|
66
|
+
* @param {number} mercatorAngle The angle to convert.
|
|
67
|
+
* @returns {number} The geodetic latitude in radians.
|
|
68
|
+
*/
|
|
69
|
+
static mercatorAngleToGeodeticLatitude(mercatorAngle) {
|
|
70
|
+
return Math_default.PI_OVER_TWO - 2 * Math.atan(Math.exp(-mercatorAngle));
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Converts a geodetic latitude in radians, in the range -PI/2 to PI/2, to a Mercator
|
|
74
|
+
* angle in the range -PI to PI.
|
|
75
|
+
*
|
|
76
|
+
* @param {number} latitude The geodetic latitude in radians.
|
|
77
|
+
* @returns {number} The Mercator angle.
|
|
78
|
+
*/
|
|
79
|
+
static geodeticLatitudeToMercatorAngle(latitude) {
|
|
80
|
+
if (latitude > _WebMercatorProjection.MaximumLatitude) {
|
|
81
|
+
latitude = _WebMercatorProjection.MaximumLatitude;
|
|
82
|
+
} else if (latitude < -_WebMercatorProjection.MaximumLatitude) {
|
|
83
|
+
latitude = -_WebMercatorProjection.MaximumLatitude;
|
|
84
|
+
}
|
|
85
|
+
const sinLatitude = Math.sin(latitude);
|
|
86
|
+
return 0.5 * Math.log((1 + sinLatitude) / (1 - sinLatitude));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Converts geodetic ellipsoid coordinates, in radians, to the equivalent Web Mercator
|
|
90
|
+
* X, Y, Z coordinates expressed in meters and returned in a {@link Cartesian3}. The height
|
|
91
|
+
* is copied unmodified to the Z coordinate.
|
|
92
|
+
*
|
|
93
|
+
* @param {Cartographic} cartographic The cartographic coordinates in radians.
|
|
94
|
+
* @param {Cartesian3} [result] The instance to which to copy the result, or undefined if a
|
|
95
|
+
* new instance should be created.
|
|
96
|
+
* @returns {Cartesian3} The equivalent web mercator X, Y, Z coordinates, in meters.
|
|
97
|
+
*/
|
|
98
|
+
project(cartographic, result) {
|
|
99
|
+
const semimajorAxis = this._semimajorAxis;
|
|
100
|
+
const x = cartographic.longitude * semimajorAxis;
|
|
101
|
+
const y = _WebMercatorProjection.geodeticLatitudeToMercatorAngle(
|
|
102
|
+
cartographic.latitude
|
|
103
|
+
) * semimajorAxis;
|
|
104
|
+
const z = cartographic.height;
|
|
105
|
+
if (!defined_default(result)) {
|
|
106
|
+
return new Cartesian3_default(x, y, z);
|
|
107
|
+
}
|
|
108
|
+
result.x = x;
|
|
109
|
+
result.y = y;
|
|
110
|
+
result.z = z;
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Converts Web Mercator X, Y coordinates, expressed in meters, to a {@link Cartographic}
|
|
115
|
+
* containing geodetic ellipsoid coordinates. The Z coordinate is copied unmodified to the
|
|
116
|
+
* height.
|
|
117
|
+
*
|
|
118
|
+
* @param {Cartesian3} cartesian The web mercator Cartesian position to unrproject with height (z) in meters.
|
|
119
|
+
* @param {Cartographic} [result] The instance to which to copy the result, or undefined if a
|
|
120
|
+
* new instance should be created.
|
|
121
|
+
* @returns {Cartographic} The equivalent cartographic coordinates.
|
|
122
|
+
*/
|
|
123
|
+
unproject(cartesian, result) {
|
|
124
|
+
if (!defined_default(cartesian)) {
|
|
125
|
+
throw new DeveloperError_default("cartesian is required");
|
|
126
|
+
}
|
|
127
|
+
const oneOverEarthSemimajorAxis = this._oneOverSemimajorAxis;
|
|
128
|
+
const longitude = cartesian.x * oneOverEarthSemimajorAxis;
|
|
129
|
+
const latitude = _WebMercatorProjection.mercatorAngleToGeodeticLatitude(
|
|
130
|
+
cartesian.y * oneOverEarthSemimajorAxis
|
|
131
|
+
);
|
|
132
|
+
const height = cartesian.z;
|
|
133
|
+
if (!defined_default(result)) {
|
|
134
|
+
return new Cartographic_default(longitude, latitude, height);
|
|
135
|
+
}
|
|
136
|
+
result.longitude = longitude;
|
|
137
|
+
result.latitude = latitude;
|
|
138
|
+
result.height = height;
|
|
139
|
+
return result;
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
WebMercatorProjection.MaximumLatitude = WebMercatorProjection.mercatorAngleToGeodeticLatitude(Math.PI);
|
|
143
|
+
var WebMercatorProjection_default = WebMercatorProjection;
|
|
144
|
+
|
|
145
|
+
export {
|
|
146
|
+
WebMercatorProjection_default
|
|
147
|
+
};
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
+
* Version 0.1.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
|
+
CylinderGeometryLibrary_default
|
|
28
|
+
} from "./chunk-TBJLMQRB.js";
|
|
29
|
+
import {
|
|
30
|
+
GeometryOffsetAttribute_default
|
|
31
|
+
} from "./chunk-7Y2RBWWM.js";
|
|
32
|
+
import {
|
|
33
|
+
VertexFormat_default
|
|
34
|
+
} from "./chunk-USCOUU3R.js";
|
|
35
|
+
import {
|
|
36
|
+
IndexDatatype_default
|
|
37
|
+
} from "./chunk-ZNXRMW7W.js";
|
|
38
|
+
import {
|
|
39
|
+
GeometryAttributes_default
|
|
40
|
+
} from "./chunk-PPWA7GXB.js";
|
|
41
|
+
import {
|
|
42
|
+
GeometryAttribute_default,
|
|
43
|
+
Geometry_default,
|
|
44
|
+
PrimitiveType_default
|
|
45
|
+
} from "./chunk-QBIOFX7R.js";
|
|
46
|
+
import {
|
|
47
|
+
BoundingSphere_default
|
|
48
|
+
} from "./chunk-ODULNNLO.js";
|
|
49
|
+
import {
|
|
50
|
+
ComponentDatatype_default
|
|
51
|
+
} from "./chunk-ZLZGNFFR.js";
|
|
52
|
+
import {
|
|
53
|
+
Cartesian2_default
|
|
54
|
+
} from "./chunk-ZXZCQCUS.js";
|
|
55
|
+
import {
|
|
56
|
+
Cartesian3_default,
|
|
57
|
+
Frozen_default
|
|
58
|
+
} from "./chunk-6R6KMIRZ.js";
|
|
59
|
+
import {
|
|
60
|
+
Math_default
|
|
61
|
+
} from "./chunk-FSWIXRGZ.js";
|
|
62
|
+
import {
|
|
63
|
+
DeveloperError_default
|
|
64
|
+
} from "./chunk-GBT2N74U.js";
|
|
65
|
+
import {
|
|
66
|
+
defined_default
|
|
67
|
+
} from "./chunk-JCS3XT73.js";
|
|
68
|
+
|
|
69
|
+
// packages/engine/Source/Core/CylinderGeometry.js
|
|
70
|
+
var radiusScratch = new Cartesian2_default();
|
|
71
|
+
var normalScratch = new Cartesian3_default();
|
|
72
|
+
var bitangentScratch = new Cartesian3_default();
|
|
73
|
+
var tangentScratch = new Cartesian3_default();
|
|
74
|
+
var positionScratch = new Cartesian3_default();
|
|
75
|
+
function CylinderGeometry(options) {
|
|
76
|
+
options = options ?? Frozen_default.EMPTY_OBJECT;
|
|
77
|
+
const length = options.length;
|
|
78
|
+
const topRadius = options.topRadius;
|
|
79
|
+
const bottomRadius = options.bottomRadius;
|
|
80
|
+
const vertexFormat = options.vertexFormat ?? VertexFormat_default.DEFAULT;
|
|
81
|
+
const slices = options.slices ?? 128;
|
|
82
|
+
if (!defined_default(length)) {
|
|
83
|
+
throw new DeveloperError_default("options.length must be defined.");
|
|
84
|
+
}
|
|
85
|
+
if (!defined_default(topRadius)) {
|
|
86
|
+
throw new DeveloperError_default("options.topRadius must be defined.");
|
|
87
|
+
}
|
|
88
|
+
if (!defined_default(bottomRadius)) {
|
|
89
|
+
throw new DeveloperError_default("options.bottomRadius must be defined.");
|
|
90
|
+
}
|
|
91
|
+
if (slices < 3) {
|
|
92
|
+
throw new DeveloperError_default(
|
|
93
|
+
"options.slices must be greater than or equal to 3."
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
if (defined_default(options.offsetAttribute) && options.offsetAttribute === GeometryOffsetAttribute_default.TOP) {
|
|
97
|
+
throw new DeveloperError_default(
|
|
98
|
+
"GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry."
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
this._length = length;
|
|
102
|
+
this._topRadius = topRadius;
|
|
103
|
+
this._bottomRadius = bottomRadius;
|
|
104
|
+
this._vertexFormat = VertexFormat_default.clone(vertexFormat);
|
|
105
|
+
this._slices = slices;
|
|
106
|
+
this._offsetAttribute = options.offsetAttribute;
|
|
107
|
+
this._workerName = "createCylinderGeometry";
|
|
108
|
+
}
|
|
109
|
+
CylinderGeometry.packedLength = VertexFormat_default.packedLength + 5;
|
|
110
|
+
CylinderGeometry.pack = function(value, array, startingIndex) {
|
|
111
|
+
if (!defined_default(value)) {
|
|
112
|
+
throw new DeveloperError_default("value is required");
|
|
113
|
+
}
|
|
114
|
+
if (!defined_default(array)) {
|
|
115
|
+
throw new DeveloperError_default("array is required");
|
|
116
|
+
}
|
|
117
|
+
startingIndex = startingIndex ?? 0;
|
|
118
|
+
VertexFormat_default.pack(value._vertexFormat, array, startingIndex);
|
|
119
|
+
startingIndex += VertexFormat_default.packedLength;
|
|
120
|
+
array[startingIndex++] = value._length;
|
|
121
|
+
array[startingIndex++] = value._topRadius;
|
|
122
|
+
array[startingIndex++] = value._bottomRadius;
|
|
123
|
+
array[startingIndex++] = value._slices;
|
|
124
|
+
array[startingIndex] = value._offsetAttribute ?? -1;
|
|
125
|
+
return array;
|
|
126
|
+
};
|
|
127
|
+
var scratchVertexFormat = new VertexFormat_default();
|
|
128
|
+
var scratchOptions = {
|
|
129
|
+
vertexFormat: scratchVertexFormat,
|
|
130
|
+
length: void 0,
|
|
131
|
+
topRadius: void 0,
|
|
132
|
+
bottomRadius: void 0,
|
|
133
|
+
slices: void 0,
|
|
134
|
+
offsetAttribute: void 0
|
|
135
|
+
};
|
|
136
|
+
CylinderGeometry.unpack = function(array, startingIndex, result) {
|
|
137
|
+
if (!defined_default(array)) {
|
|
138
|
+
throw new DeveloperError_default("array is required");
|
|
139
|
+
}
|
|
140
|
+
startingIndex = startingIndex ?? 0;
|
|
141
|
+
const vertexFormat = VertexFormat_default.unpack(
|
|
142
|
+
array,
|
|
143
|
+
startingIndex,
|
|
144
|
+
scratchVertexFormat
|
|
145
|
+
);
|
|
146
|
+
startingIndex += VertexFormat_default.packedLength;
|
|
147
|
+
const length = array[startingIndex++];
|
|
148
|
+
const topRadius = array[startingIndex++];
|
|
149
|
+
const bottomRadius = array[startingIndex++];
|
|
150
|
+
const slices = array[startingIndex++];
|
|
151
|
+
const offsetAttribute = array[startingIndex];
|
|
152
|
+
if (!defined_default(result)) {
|
|
153
|
+
scratchOptions.length = length;
|
|
154
|
+
scratchOptions.topRadius = topRadius;
|
|
155
|
+
scratchOptions.bottomRadius = bottomRadius;
|
|
156
|
+
scratchOptions.slices = slices;
|
|
157
|
+
scratchOptions.offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
|
|
158
|
+
return new CylinderGeometry(scratchOptions);
|
|
159
|
+
}
|
|
160
|
+
result._vertexFormat = VertexFormat_default.clone(vertexFormat, result._vertexFormat);
|
|
161
|
+
result._length = length;
|
|
162
|
+
result._topRadius = topRadius;
|
|
163
|
+
result._bottomRadius = bottomRadius;
|
|
164
|
+
result._slices = slices;
|
|
165
|
+
result._offsetAttribute = offsetAttribute === -1 ? void 0 : offsetAttribute;
|
|
166
|
+
return result;
|
|
167
|
+
};
|
|
168
|
+
CylinderGeometry.createGeometry = function(cylinderGeometry) {
|
|
169
|
+
let length = cylinderGeometry._length;
|
|
170
|
+
const topRadius = cylinderGeometry._topRadius;
|
|
171
|
+
const bottomRadius = cylinderGeometry._bottomRadius;
|
|
172
|
+
const vertexFormat = cylinderGeometry._vertexFormat;
|
|
173
|
+
const slices = cylinderGeometry._slices;
|
|
174
|
+
if (length <= 0 || topRadius < 0 || bottomRadius < 0 || topRadius === 0 && bottomRadius === 0) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
const twoSlices = slices + slices;
|
|
178
|
+
const threeSlices = slices + twoSlices;
|
|
179
|
+
const numVertices = twoSlices + twoSlices;
|
|
180
|
+
const positions = CylinderGeometryLibrary_default.computePositions(
|
|
181
|
+
length,
|
|
182
|
+
topRadius,
|
|
183
|
+
bottomRadius,
|
|
184
|
+
slices,
|
|
185
|
+
true
|
|
186
|
+
);
|
|
187
|
+
const st = vertexFormat.st ? new Float32Array(numVertices * 2) : void 0;
|
|
188
|
+
const normals = vertexFormat.normal ? new Float32Array(numVertices * 3) : void 0;
|
|
189
|
+
const tangents = vertexFormat.tangent ? new Float32Array(numVertices * 3) : void 0;
|
|
190
|
+
const bitangents = vertexFormat.bitangent ? new Float32Array(numVertices * 3) : void 0;
|
|
191
|
+
let i;
|
|
192
|
+
const computeNormal = vertexFormat.normal || vertexFormat.tangent || vertexFormat.bitangent;
|
|
193
|
+
if (computeNormal) {
|
|
194
|
+
const computeTangent = vertexFormat.tangent || vertexFormat.bitangent;
|
|
195
|
+
let normalIndex = 0;
|
|
196
|
+
let tangentIndex = 0;
|
|
197
|
+
let bitangentIndex = 0;
|
|
198
|
+
const theta = Math.atan2(bottomRadius - topRadius, length);
|
|
199
|
+
const normal = normalScratch;
|
|
200
|
+
normal.z = Math.sin(theta);
|
|
201
|
+
const normalScale = Math.cos(theta);
|
|
202
|
+
let tangent = tangentScratch;
|
|
203
|
+
let bitangent = bitangentScratch;
|
|
204
|
+
for (i = 0; i < slices; i++) {
|
|
205
|
+
const angle = i / slices * Math_default.TWO_PI;
|
|
206
|
+
const x = normalScale * Math.cos(angle);
|
|
207
|
+
const y = normalScale * Math.sin(angle);
|
|
208
|
+
if (computeNormal) {
|
|
209
|
+
normal.x = x;
|
|
210
|
+
normal.y = y;
|
|
211
|
+
if (computeTangent) {
|
|
212
|
+
tangent = Cartesian3_default.normalize(
|
|
213
|
+
Cartesian3_default.cross(Cartesian3_default.UNIT_Z, normal, tangent),
|
|
214
|
+
tangent
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
if (vertexFormat.normal) {
|
|
218
|
+
normals[normalIndex++] = normal.x;
|
|
219
|
+
normals[normalIndex++] = normal.y;
|
|
220
|
+
normals[normalIndex++] = normal.z;
|
|
221
|
+
normals[normalIndex++] = normal.x;
|
|
222
|
+
normals[normalIndex++] = normal.y;
|
|
223
|
+
normals[normalIndex++] = normal.z;
|
|
224
|
+
}
|
|
225
|
+
if (vertexFormat.tangent) {
|
|
226
|
+
tangents[tangentIndex++] = tangent.x;
|
|
227
|
+
tangents[tangentIndex++] = tangent.y;
|
|
228
|
+
tangents[tangentIndex++] = tangent.z;
|
|
229
|
+
tangents[tangentIndex++] = tangent.x;
|
|
230
|
+
tangents[tangentIndex++] = tangent.y;
|
|
231
|
+
tangents[tangentIndex++] = tangent.z;
|
|
232
|
+
}
|
|
233
|
+
if (vertexFormat.bitangent) {
|
|
234
|
+
bitangent = Cartesian3_default.normalize(
|
|
235
|
+
Cartesian3_default.cross(normal, tangent, bitangent),
|
|
236
|
+
bitangent
|
|
237
|
+
);
|
|
238
|
+
bitangents[bitangentIndex++] = bitangent.x;
|
|
239
|
+
bitangents[bitangentIndex++] = bitangent.y;
|
|
240
|
+
bitangents[bitangentIndex++] = bitangent.z;
|
|
241
|
+
bitangents[bitangentIndex++] = bitangent.x;
|
|
242
|
+
bitangents[bitangentIndex++] = bitangent.y;
|
|
243
|
+
bitangents[bitangentIndex++] = bitangent.z;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
for (i = 0; i < slices; i++) {
|
|
248
|
+
if (vertexFormat.normal) {
|
|
249
|
+
normals[normalIndex++] = 0;
|
|
250
|
+
normals[normalIndex++] = 0;
|
|
251
|
+
normals[normalIndex++] = -1;
|
|
252
|
+
}
|
|
253
|
+
if (vertexFormat.tangent) {
|
|
254
|
+
tangents[tangentIndex++] = 1;
|
|
255
|
+
tangents[tangentIndex++] = 0;
|
|
256
|
+
tangents[tangentIndex++] = 0;
|
|
257
|
+
}
|
|
258
|
+
if (vertexFormat.bitangent) {
|
|
259
|
+
bitangents[bitangentIndex++] = 0;
|
|
260
|
+
bitangents[bitangentIndex++] = -1;
|
|
261
|
+
bitangents[bitangentIndex++] = 0;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
for (i = 0; i < slices; i++) {
|
|
265
|
+
if (vertexFormat.normal) {
|
|
266
|
+
normals[normalIndex++] = 0;
|
|
267
|
+
normals[normalIndex++] = 0;
|
|
268
|
+
normals[normalIndex++] = 1;
|
|
269
|
+
}
|
|
270
|
+
if (vertexFormat.tangent) {
|
|
271
|
+
tangents[tangentIndex++] = 1;
|
|
272
|
+
tangents[tangentIndex++] = 0;
|
|
273
|
+
tangents[tangentIndex++] = 0;
|
|
274
|
+
}
|
|
275
|
+
if (vertexFormat.bitangent) {
|
|
276
|
+
bitangents[bitangentIndex++] = 0;
|
|
277
|
+
bitangents[bitangentIndex++] = 1;
|
|
278
|
+
bitangents[bitangentIndex++] = 0;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
const numIndices = 12 * slices - 12;
|
|
283
|
+
const indices = IndexDatatype_default.createTypedArray(numVertices, numIndices);
|
|
284
|
+
let index = 0;
|
|
285
|
+
let j = 0;
|
|
286
|
+
for (i = 0; i < slices - 1; i++) {
|
|
287
|
+
indices[index++] = j;
|
|
288
|
+
indices[index++] = j + 2;
|
|
289
|
+
indices[index++] = j + 3;
|
|
290
|
+
indices[index++] = j;
|
|
291
|
+
indices[index++] = j + 3;
|
|
292
|
+
indices[index++] = j + 1;
|
|
293
|
+
j += 2;
|
|
294
|
+
}
|
|
295
|
+
indices[index++] = twoSlices - 2;
|
|
296
|
+
indices[index++] = 0;
|
|
297
|
+
indices[index++] = 1;
|
|
298
|
+
indices[index++] = twoSlices - 2;
|
|
299
|
+
indices[index++] = 1;
|
|
300
|
+
indices[index++] = twoSlices - 1;
|
|
301
|
+
for (i = 1; i < slices - 1; i++) {
|
|
302
|
+
indices[index++] = twoSlices + i + 1;
|
|
303
|
+
indices[index++] = twoSlices + i;
|
|
304
|
+
indices[index++] = twoSlices;
|
|
305
|
+
}
|
|
306
|
+
for (i = 1; i < slices - 1; i++) {
|
|
307
|
+
indices[index++] = threeSlices;
|
|
308
|
+
indices[index++] = threeSlices + i;
|
|
309
|
+
indices[index++] = threeSlices + i + 1;
|
|
310
|
+
}
|
|
311
|
+
let textureCoordIndex = 0;
|
|
312
|
+
if (vertexFormat.st) {
|
|
313
|
+
const rad = Math.max(topRadius, bottomRadius);
|
|
314
|
+
for (i = 0; i < numVertices; i++) {
|
|
315
|
+
const position = Cartesian3_default.fromArray(positions, i * 3, positionScratch);
|
|
316
|
+
st[textureCoordIndex++] = (position.x + rad) / (2 * rad);
|
|
317
|
+
st[textureCoordIndex++] = (position.y + rad) / (2 * rad);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
const attributes = new GeometryAttributes_default();
|
|
321
|
+
if (vertexFormat.position) {
|
|
322
|
+
attributes.position = new GeometryAttribute_default({
|
|
323
|
+
componentDatatype: ComponentDatatype_default.DOUBLE,
|
|
324
|
+
componentsPerAttribute: 3,
|
|
325
|
+
values: positions
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
if (vertexFormat.normal) {
|
|
329
|
+
attributes.normal = new GeometryAttribute_default({
|
|
330
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
331
|
+
componentsPerAttribute: 3,
|
|
332
|
+
values: normals
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
if (vertexFormat.tangent) {
|
|
336
|
+
attributes.tangent = new GeometryAttribute_default({
|
|
337
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
338
|
+
componentsPerAttribute: 3,
|
|
339
|
+
values: tangents
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
if (vertexFormat.bitangent) {
|
|
343
|
+
attributes.bitangent = new GeometryAttribute_default({
|
|
344
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
345
|
+
componentsPerAttribute: 3,
|
|
346
|
+
values: bitangents
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
if (vertexFormat.st) {
|
|
350
|
+
attributes.st = new GeometryAttribute_default({
|
|
351
|
+
componentDatatype: ComponentDatatype_default.FLOAT,
|
|
352
|
+
componentsPerAttribute: 2,
|
|
353
|
+
values: st
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
radiusScratch.x = length * 0.5;
|
|
357
|
+
radiusScratch.y = Math.max(bottomRadius, topRadius);
|
|
358
|
+
const boundingSphere = new BoundingSphere_default(
|
|
359
|
+
Cartesian3_default.ZERO,
|
|
360
|
+
Cartesian2_default.magnitude(radiusScratch)
|
|
361
|
+
);
|
|
362
|
+
if (defined_default(cylinderGeometry._offsetAttribute)) {
|
|
363
|
+
length = positions.length;
|
|
364
|
+
const offsetValue = cylinderGeometry._offsetAttribute === GeometryOffsetAttribute_default.NONE ? 0 : 1;
|
|
365
|
+
const applyOffset = new Uint8Array(length / 3).fill(offsetValue);
|
|
366
|
+
attributes.applyOffset = new GeometryAttribute_default({
|
|
367
|
+
componentDatatype: ComponentDatatype_default.UNSIGNED_BYTE,
|
|
368
|
+
componentsPerAttribute: 1,
|
|
369
|
+
values: applyOffset
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
return new Geometry_default({
|
|
373
|
+
attributes,
|
|
374
|
+
indices,
|
|
375
|
+
primitiveType: PrimitiveType_default.TRIANGLES,
|
|
376
|
+
boundingSphere,
|
|
377
|
+
offsetAttribute: cylinderGeometry._offsetAttribute
|
|
378
|
+
});
|
|
379
|
+
};
|
|
380
|
+
var unitCylinderGeometry;
|
|
381
|
+
CylinderGeometry.getUnitCylinder = function() {
|
|
382
|
+
if (!defined_default(unitCylinderGeometry)) {
|
|
383
|
+
unitCylinderGeometry = CylinderGeometry.createGeometry(
|
|
384
|
+
new CylinderGeometry({
|
|
385
|
+
topRadius: 1,
|
|
386
|
+
bottomRadius: 1,
|
|
387
|
+
length: 1,
|
|
388
|
+
vertexFormat: VertexFormat_default.POSITION_ONLY
|
|
389
|
+
})
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
return unitCylinderGeometry;
|
|
393
|
+
};
|
|
394
|
+
var CylinderGeometry_default = CylinderGeometry;
|
|
395
|
+
|
|
396
|
+
export {
|
|
397
|
+
CylinderGeometry_default
|
|
398
|
+
};
|