itowns 2.42.1-next.2 → 2.42.1-next.20
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/dist/debug.js +1 -1
- package/dist/debug.js.map +1 -1
- package/dist/itowns.js +1 -1
- package/dist/itowns.js.map +1 -1
- package/dist/itowns_widgets.js +1 -1
- package/dist/itowns_widgets.js.map +1 -1
- package/examples/{.eslintrc.js → .eslintrc.cjs} +1 -1
- package/examples/effects_stereo.html +2 -2
- package/examples/entwine_simple_loader.html +24 -8
- package/examples/misc_collada.html +2 -2
- package/examples/misc_instancing.html +1 -1
- package/examples/source_file_gpx_3d.html +2 -2
- package/examples/source_stream_wfs_25d.html +11 -11
- package/examples/source_stream_wfs_3d.html +1 -1
- package/examples/vector_tile_3d_mesh.html +2 -2
- package/examples/vector_tile_raster_2d.html +1 -1
- package/examples/vector_tile_raster_3d.html +1 -1
- package/examples/view_25d_map.html +2 -2
- package/examples/view_3d_map.html +3 -3
- package/examples/view_3d_map_webxr.html +1 -1
- package/examples/view_3d_mns_map.html +3 -3
- package/examples/view_immersive.html +1 -1
- package/examples/view_multi_25d.html +2 -2
- package/examples/widgets_minimap.html +1 -1
- package/examples/widgets_searchbar.html +2 -2
- package/lib/Controls/FirstPersonControls.js +5 -12
- package/lib/Controls/FlyControls.js +4 -13
- package/lib/Controls/GlobeControls.js +33 -43
- package/lib/Controls/PlanarControls.js +9 -20
- package/lib/Controls/StateControl.js +2 -11
- package/lib/Controls/StreetControls.js +14 -24
- package/lib/Converter/Feature2Mesh.js +77 -70
- package/lib/Converter/Feature2Texture.js +15 -25
- package/lib/Converter/convertToTile.js +16 -26
- package/lib/Converter/textureConverter.js +9 -19
- package/lib/Core/3DTiles/C3DTBatchTable.js +5 -13
- package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.js +1 -8
- package/lib/Core/3DTiles/C3DTBoundingVolume.js +17 -27
- package/lib/Core/3DTiles/C3DTExtensions.js +1 -8
- package/lib/Core/3DTiles/C3DTFeature.js +3 -10
- package/lib/Core/3DTiles/C3DTilesEnums.js +3 -11
- package/lib/Core/3DTiles/C3DTileset.js +7 -16
- package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.js +5 -11
- package/lib/Core/AnimationPlayer.js +2 -11
- package/lib/Core/Deprecated/Undeprecator.js +8 -19
- package/lib/Core/EntwinePointTileNode.js +6 -16
- package/lib/Core/Feature.js +16 -30
- package/lib/Core/Geographic/CoordStars.js +3 -12
- package/lib/Core/Geographic/Coordinates.js +12 -22
- package/lib/Core/Geographic/Crs.js +7 -15
- package/lib/Core/Geographic/Extent.js +36 -47
- package/lib/Core/Geographic/GeoidGrid.js +6 -16
- package/lib/Core/Label.js +7 -17
- package/lib/Core/MainLoop.js +7 -16
- package/lib/Core/Math/Ellipsoid.js +6 -17
- package/lib/Core/Picking.js +10 -20
- package/lib/Core/PointCloudNode.js +2 -11
- package/lib/Core/PotreeNode.js +4 -13
- package/lib/Core/Prefab/Globe/Atmosphere.js +17 -26
- package/lib/Core/Prefab/Globe/BuilderEllipsoidTile.js +6 -16
- package/lib/Core/Prefab/Globe/GlobeLayer.js +19 -28
- package/lib/Core/Prefab/Globe/SkyShader.js +2 -11
- package/lib/Core/Prefab/GlobeView.js +27 -37
- package/lib/Core/Prefab/Planar/PlanarLayer.js +11 -20
- package/lib/Core/Prefab/Planar/PlanarTileBuilder.js +6 -16
- package/lib/Core/Prefab/PlanarView.js +10 -20
- package/lib/Core/Prefab/TileBuilder.js +11 -20
- package/lib/Core/Prefab/computeBufferTileGeometry.js +11 -15
- package/lib/Core/Scheduler/Cache.js +2 -10
- package/lib/Core/Scheduler/CancelledCommandException.js +1 -8
- package/lib/Core/Scheduler/Scheduler.js +15 -23
- package/lib/Core/Style.js +26 -40
- package/lib/Core/System/Capabilities.js +2 -9
- package/lib/Core/TileGeometry.js +11 -14
- package/lib/Core/TileMesh.js +6 -15
- package/lib/Core/View.js +43 -53
- package/lib/Layer/C3DTilesLayer.js +29 -41
- package/lib/Layer/ColorLayer.js +10 -16
- package/lib/Layer/ElevationLayer.js +7 -14
- package/lib/Layer/EntwinePointTileLayer.js +11 -18
- package/lib/Layer/FeatureGeometryLayer.js +9 -16
- package/lib/Layer/GeoidLayer.js +6 -15
- package/lib/Layer/GeometryLayer.js +11 -17
- package/lib/Layer/InfoLayer.js +5 -14
- package/lib/Layer/LabelLayer.js +22 -32
- package/lib/Layer/Layer.js +16 -26
- package/lib/Layer/LayerUpdateState.js +1 -8
- package/lib/Layer/LayerUpdateStrategy.js +7 -18
- package/lib/Layer/OrientedImageLayer.js +15 -25
- package/lib/Layer/PointCloudLayer.js +27 -24
- package/lib/Layer/PotreeLayer.js +8 -18
- package/lib/Layer/RasterLayer.js +9 -17
- package/lib/Layer/ReferencingLayerProperties.js +1 -8
- package/lib/Layer/TiledGeometryLayer.js +37 -33
- package/lib/Main.js +86 -707
- package/lib/MainBundle.js +4 -34
- package/lib/Parser/B3dmParser.js +80 -131
- package/lib/Parser/CameraCalibrationParser.js +5 -14
- package/lib/Parser/GDFParser.js +11 -22
- package/lib/Parser/GLTFParser.js +88 -0
- package/lib/Parser/GTXParser.js +9 -21
- package/lib/Parser/GeoJsonParser.js +14 -22
- package/lib/Parser/GpxParser.js +7 -14
- package/lib/Parser/ISGParser.js +19 -28
- package/lib/Parser/KMLParser.js +7 -14
- package/lib/Parser/LASLoader.js +31 -21
- package/lib/Parser/LASParser.js +10 -17
- package/lib/Parser/MapBoxUrlParser.js +2 -9
- package/lib/Parser/PntsParser.js +4 -14
- package/lib/Parser/PotreeBinParser.js +8 -16
- package/lib/Parser/PotreeCinParser.js +3 -12
- package/lib/Parser/ShapefileParser.js +11 -18
- package/lib/Parser/VectorTileParser.js +23 -31
- package/lib/Parser/XbilParser.js +5 -13
- package/lib/Parser/deprecated/LegacyGLTFLoader.js +2 -12
- package/lib/Process/3dTilesProcessing.js +14 -27
- package/lib/Process/FeatureProcessing.js +14 -22
- package/lib/Process/LayeredMaterialNodeProcessing.js +19 -28
- package/lib/Process/ObjectRemovalHelper.js +2 -9
- package/lib/Process/handlerNodeError.js +1 -7
- package/lib/Provider/3dTilesProvider.js +32 -29
- package/lib/Provider/DataSourceProvider.js +2 -9
- package/lib/Provider/Fetcher.js +37 -13
- package/lib/Provider/PointCloudProvider.js +7 -19
- package/lib/Provider/TileProvider.js +4 -12
- package/lib/Provider/URLBuilder.js +4 -12
- package/lib/Renderer/Camera.js +7 -17
- package/lib/Renderer/Color.js +3 -11
- package/lib/Renderer/ColorLayersOrdering.js +14 -22
- package/lib/Renderer/CommonMaterial.js +3 -12
- package/lib/Renderer/Label2DRenderer.js +5 -16
- package/lib/Renderer/LayeredMaterial.js +27 -41
- package/lib/Renderer/OBB.js +12 -21
- package/lib/Renderer/OrientedImageCamera.js +2 -11
- package/lib/Renderer/OrientedImageMaterial.js +7 -17
- package/lib/Renderer/PointsMaterial.js +223 -84
- package/lib/Renderer/RasterTile.js +18 -30
- package/lib/Renderer/RenderMode.js +2 -9
- package/lib/Renderer/Shader/ShaderChunk.js +2 -11
- package/lib/Renderer/Shader/ShaderUtils.js +2 -9
- package/lib/Renderer/SphereHelper.js +2 -11
- package/lib/Renderer/WebXR.js +2 -11
- package/lib/Renderer/c3DEngine.js +18 -28
- package/lib/Source/C3DTilesGoogleSource.js +76 -0
- package/lib/Source/C3DTilesIonSource.js +6 -13
- package/lib/Source/C3DTilesSource.js +5 -12
- package/lib/Source/EntwinePointTileSource.js +12 -19
- package/lib/Source/FileSource.js +7 -14
- package/lib/Source/OrientedImageSource.js +6 -14
- package/lib/Source/PotreeSource.js +9 -16
- package/lib/Source/Source.js +26 -39
- package/lib/Source/TMSSource.js +11 -22
- package/lib/Source/VectorTilesSource.js +75 -34
- package/lib/Source/WFSSource.js +7 -14
- package/lib/Source/WMSSource.js +5 -12
- package/lib/Source/WMTSSource.js +3 -10
- package/lib/ThreeExtended/capabilities/WebGL.js +1 -8
- package/lib/ThreeExtended/libs/ktx-parse.module.js +2 -256
- package/lib/ThreeExtended/libs/zstddec.module.js +2 -8
- package/lib/ThreeExtended/loaders/DDSLoader.js +10 -16
- package/lib/ThreeExtended/loaders/DRACOLoader.js +14 -19
- package/lib/ThreeExtended/loaders/GLTFLoader.js +124 -129
- package/lib/ThreeExtended/loaders/KTX2Loader.js +73 -78
- package/lib/ThreeExtended/utils/BufferGeometryUtils.js +40 -59
- package/lib/ThreeExtended/utils/WorkerPool.js +2 -9
- package/lib/Utils/CameraUtils.js +32 -44
- package/lib/Utils/DEMUtils.js +8 -19
- package/lib/Utils/FeaturesUtils.js +8 -16
- package/lib/Utils/Gradients.js +16 -0
- package/lib/Utils/OrientationUtils.js +8 -18
- package/lib/Utils/ThreeUtils.js +2 -9
- package/lib/Utils/gui/C3DTilesStyle.js +7 -15
- package/lib/Utils/gui/Main.js +7 -48
- package/lib/Utils/gui/Minimap.js +12 -20
- package/lib/Utils/gui/Navigation.js +6 -14
- package/lib/Utils/gui/Scale.js +11 -19
- package/lib/Utils/gui/Searchbar.js +5 -13
- package/lib/Utils/gui/Widget.js +1 -8
- package/lib/Utils/placeObjectOnGround.js +13 -23
- package/package.json +13 -8
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _BinaryPropertyAccessor = _interopRequireDefault(require("./utils/BinaryPropertyAccessor"));
|
|
9
|
-
var _C3DTilesEnums = require("./C3DTilesEnums");
|
|
1
|
+
import binaryPropertyAccessor from "./utils/BinaryPropertyAccessor.js";
|
|
2
|
+
import { C3DTilesTypes } from "./C3DTilesEnums.js";
|
|
10
3
|
const utf8Decoder = new TextDecoder();
|
|
11
4
|
|
|
12
5
|
/** @classdesc
|
|
@@ -43,7 +36,7 @@ class C3DTBatchTable {
|
|
|
43
36
|
if (jsonLength + binaryLength !== buffer.byteLength) {
|
|
44
37
|
console.error('3DTiles batch table json length and binary length are not consistent with total buffer' + ' length. The batch table may be wrong.');
|
|
45
38
|
}
|
|
46
|
-
this.type =
|
|
39
|
+
this.type = C3DTilesTypes.batchtable;
|
|
47
40
|
this.batchLength = batchLength;
|
|
48
41
|
const jsonBuffer = buffer.slice(0, jsonLength);
|
|
49
42
|
const decodedJsonBuffer = utf8Decoder.decode(new Uint8Array(jsonBuffer));
|
|
@@ -60,7 +53,7 @@ class C3DTBatchTable {
|
|
|
60
53
|
continue;
|
|
61
54
|
}
|
|
62
55
|
if (typeof (propVal === null || propVal === void 0 ? void 0 : propVal.byteOffset) !== 'undefined' && typeof (propVal === null || propVal === void 0 ? void 0 : propVal.componentType) !== 'undefined' && typeof (propVal === null || propVal === void 0 ? void 0 : propVal.type) !== 'undefined') {
|
|
63
|
-
jsonContent[propKey] = (
|
|
56
|
+
jsonContent[propKey] = binaryPropertyAccessor(binaryBuffer, this.batchLength, propVal.byteOffset, propVal.componentType, propVal.type);
|
|
64
57
|
} else {
|
|
65
58
|
console.error('Invalid 3D Tiles batch table property that is neither a JSON array nor a valid ' + 'accessor to a binary body');
|
|
66
59
|
}
|
|
@@ -135,5 +128,4 @@ class C3DTBatchTable {
|
|
|
135
128
|
return featureDisplayableInfo;
|
|
136
129
|
}
|
|
137
130
|
}
|
|
138
|
-
|
|
139
|
-
exports.default = _default;
|
|
131
|
+
export default C3DTBatchTable;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
1
|
/**
|
|
8
2
|
* @classdesc
|
|
9
3
|
* Batch Table part of the 3D Tiles
|
|
@@ -100,5 +94,4 @@ class C3DTBatchTableHierarchyExtension {
|
|
|
100
94
|
return pickingInfo;
|
|
101
95
|
}
|
|
102
96
|
}
|
|
103
|
-
|
|
104
|
-
exports.default = _default;
|
|
97
|
+
export default C3DTBatchTableHierarchyExtension;
|
|
@@ -1,26 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
9
|
-
var _Ellipsoid = _interopRequireDefault(require("../Math/Ellipsoid"));
|
|
10
|
-
var _Coordinates = _interopRequireDefault(require("../Geographic/Coordinates"));
|
|
11
|
-
var _C3DTilesEnums = require("./C3DTilesEnums");
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
-
const ellipsoid = new _Ellipsoid.default();
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import Ellipsoid from "../Math/Ellipsoid.js";
|
|
3
|
+
import Coordinates from "../Geographic/Coordinates.js";
|
|
4
|
+
import { C3DTilesTypes, C3DTilesBoundingVolumeTypes } from "./C3DTilesEnums.js";
|
|
5
|
+
const ellipsoid = new Ellipsoid();
|
|
15
6
|
|
|
16
7
|
// bounding box scratch variables
|
|
17
8
|
const boxSize = new THREE.Vector3();
|
|
18
9
|
const boxCenter = new THREE.Vector3();
|
|
19
10
|
|
|
20
11
|
// Bounding region scratch variables
|
|
21
|
-
const southEastUpCarto = new
|
|
12
|
+
const southEastUpCarto = new Coordinates('EPSG:4326');
|
|
22
13
|
const southEastUpVec3 = new THREE.Vector3();
|
|
23
|
-
const northWestBottomCarto = new
|
|
14
|
+
const northWestBottomCarto = new Coordinates('EPSG:4326');
|
|
24
15
|
const northWestBottomVec3 = new THREE.Vector3();
|
|
25
16
|
const radiusScratch = new THREE.Vector3();
|
|
26
17
|
|
|
@@ -105,15 +96,15 @@ function initFromSphere(sphere) {
|
|
|
105
96
|
*/
|
|
106
97
|
class C3DTBoundingVolume {
|
|
107
98
|
constructor(json, tileMatrixInverse, registeredExtensions) {
|
|
108
|
-
this.type =
|
|
99
|
+
this.type = C3DTilesTypes.boundingVolume;
|
|
109
100
|
if (json.region) {
|
|
110
|
-
this.initialVolumeType =
|
|
101
|
+
this.initialVolumeType = C3DTilesBoundingVolumeTypes.region;
|
|
111
102
|
this.volume = initFromRegion(json.region, tileMatrixInverse);
|
|
112
103
|
} else if (json.box) {
|
|
113
|
-
this.initialVolumeType =
|
|
104
|
+
this.initialVolumeType = C3DTilesBoundingVolumeTypes.box;
|
|
114
105
|
this.volume = initFromBox(json.box);
|
|
115
106
|
} else if (json.sphere) {
|
|
116
|
-
this.initialVolumeType =
|
|
107
|
+
this.initialVolumeType = C3DTilesBoundingVolumeTypes.sphere;
|
|
117
108
|
this.volume = initFromSphere(json.sphere);
|
|
118
109
|
} else {
|
|
119
110
|
throw new Error(`Unknown bounding volume type: ${json}. 3D Tiles nodes must have a bounding volume of type
|
|
@@ -131,9 +122,9 @@ class C3DTBoundingVolume {
|
|
|
131
122
|
* @returns {boolean} true if the tile should be culled out (bounding volume not in camera frustum), false otherwise.
|
|
132
123
|
*/
|
|
133
124
|
boundingVolumeCulling(camera, tileMatrixWorld) {
|
|
134
|
-
if (this.initialVolumeType ===
|
|
125
|
+
if (this.initialVolumeType === C3DTilesBoundingVolumeTypes.box) {
|
|
135
126
|
return !camera.isBox3Visible(this.volume, tileMatrixWorld);
|
|
136
|
-
} else if (this.initialVolumeType ===
|
|
127
|
+
} else if (this.initialVolumeType === C3DTilesBoundingVolumeTypes.sphere || this.initialVolumeType === C3DTilesBoundingVolumeTypes.region) {
|
|
137
128
|
return !camera.isSphereVisible(this.volume, tileMatrixWorld);
|
|
138
129
|
} else {
|
|
139
130
|
throw new Error('Unknown bounding volume type.');
|
|
@@ -147,15 +138,15 @@ class C3DTBoundingVolume {
|
|
|
147
138
|
* @returns {boolean} true if the camera is outside the viewer request volume, false otherwise.
|
|
148
139
|
*/
|
|
149
140
|
viewerRequestVolumeCulling(camera, tileMatrixWorld) {
|
|
150
|
-
if (this.initialVolumeType ===
|
|
141
|
+
if (this.initialVolumeType === C3DTilesBoundingVolumeTypes.region) {
|
|
151
142
|
console.warn('Region viewerRequestVolume not yet supported');
|
|
152
143
|
return true;
|
|
153
144
|
}
|
|
154
|
-
if (this.initialVolumeType ===
|
|
145
|
+
if (this.initialVolumeType === C3DTilesBoundingVolumeTypes.box) {
|
|
155
146
|
console.warn('Bounding box viewerRequestVolume not yet supported');
|
|
156
147
|
return true;
|
|
157
148
|
}
|
|
158
|
-
if (this.initialVolumeType ===
|
|
149
|
+
if (this.initialVolumeType === C3DTilesBoundingVolumeTypes.sphere) {
|
|
159
150
|
worldCoordinateCenter.copy(this.volume.center);
|
|
160
151
|
worldCoordinateCenter.applyMatrix4(tileMatrixWorld);
|
|
161
152
|
// To check the distance between the center sphere and the camera
|
|
@@ -164,5 +155,4 @@ class C3DTBoundingVolume {
|
|
|
164
155
|
return false;
|
|
165
156
|
}
|
|
166
157
|
}
|
|
167
|
-
|
|
168
|
-
exports.default = _default;
|
|
158
|
+
export default C3DTBoundingVolume;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
1
|
/** @classdesc
|
|
8
2
|
* Class for managing
|
|
9
3
|
* [3D Tiles extensions](https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/extensions).
|
|
@@ -100,5 +94,4 @@ class C3DTExtensions {
|
|
|
100
94
|
return parsedExtensions;
|
|
101
95
|
}
|
|
102
96
|
}
|
|
103
|
-
|
|
104
|
-
exports.default = _default;
|
|
97
|
+
export default C3DTExtensions;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _three = require("three");
|
|
8
1
|
// eslint-disable-next-line no-unused-vars
|
|
2
|
+
import { Object3D, Box3 } from 'three';
|
|
9
3
|
|
|
10
4
|
/**
|
|
11
5
|
* Finds the batch table of an object in a 3D Tiles layer. This is
|
|
@@ -69,7 +63,7 @@ class C3DTFeature {
|
|
|
69
63
|
* @returns {Box3}
|
|
70
64
|
*/
|
|
71
65
|
computeWorldBox3() {
|
|
72
|
-
let target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new
|
|
66
|
+
let target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Box3();
|
|
73
67
|
// reset
|
|
74
68
|
target.max.x = -Infinity;
|
|
75
69
|
target.max.y = -Infinity;
|
|
@@ -114,5 +108,4 @@ class C3DTFeature {
|
|
|
114
108
|
return this.#info;
|
|
115
109
|
}
|
|
116
110
|
}
|
|
117
|
-
|
|
118
|
-
exports.default = _default;
|
|
111
|
+
export default C3DTFeature;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.C3DTilesTypes = exports.C3DTilesBoundingVolumeTypes = void 0;
|
|
7
1
|
/**
|
|
8
2
|
* Enumeration of implemented 3D Tiles classes. Used in C3DTExtensions to
|
|
9
3
|
* now which classes ask for extension parsing.
|
|
@@ -14,15 +8,13 @@ exports.C3DTilesTypes = exports.C3DTilesBoundingVolumeTypes = void 0;
|
|
|
14
8
|
* @property {String} batchtable - value: 'batchtable'
|
|
15
9
|
* @property {String} boundingVolume - value: 'bounding volume'
|
|
16
10
|
*/
|
|
17
|
-
const C3DTilesTypes = {
|
|
11
|
+
export const C3DTilesTypes = {
|
|
18
12
|
tileset: 'tileset',
|
|
19
13
|
batchtable: 'batchtable',
|
|
20
14
|
boundingVolume: 'boundingVolume'
|
|
21
15
|
};
|
|
22
|
-
|
|
23
|
-
const C3DTilesBoundingVolumeTypes = {
|
|
16
|
+
export const C3DTilesBoundingVolumeTypes = {
|
|
24
17
|
region: 'region',
|
|
25
18
|
box: 'box',
|
|
26
19
|
sphere: 'sphere'
|
|
27
|
-
};
|
|
28
|
-
exports.C3DTilesBoundingVolumeTypes = C3DTilesBoundingVolumeTypes;
|
|
20
|
+
};
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import C3DTBoundingVolume from "./C3DTBoundingVolume.js";
|
|
3
|
+
import { C3DTilesTypes } from "./C3DTilesEnums.js";
|
|
2
4
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
9
|
-
var _C3DTBoundingVolume = _interopRequireDefault(require("./C3DTBoundingVolume"));
|
|
10
|
-
var _C3DTilesEnums = require("./C3DTilesEnums");
|
|
11
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
5
|
// Inverse transform of a tile, computed from the tile transform and used when parsing the bounding volume of a tile
|
|
14
6
|
// if the bounding volume is a region (https://github.com/CesiumGS/3d-tiles/tree/main/specification#region) which is
|
|
15
7
|
// in global coordinates and other bounding volumes are not. To harmonize, we transform back the bounding volume region
|
|
@@ -40,7 +32,7 @@ const tileMatrixInverse = new THREE.Matrix4();
|
|
|
40
32
|
*/
|
|
41
33
|
class C3DTileset {
|
|
42
34
|
constructor(json, baseURL, registeredExtensions) {
|
|
43
|
-
this.type =
|
|
35
|
+
this.type = C3DTilesTypes.tileset;
|
|
44
36
|
this.asset = json.asset;
|
|
45
37
|
this.properties = json.properties;
|
|
46
38
|
this.geometricError = json.geometricError;
|
|
@@ -87,8 +79,8 @@ class C3DTileset {
|
|
|
87
79
|
tileMatrixInverse.identity();
|
|
88
80
|
}
|
|
89
81
|
}
|
|
90
|
-
tile.viewerRequestVolume = tile.viewerRequestVolume ? new
|
|
91
|
-
tile.boundingVolume = tile.boundingVolume ? new
|
|
82
|
+
tile.viewerRequestVolume = tile.viewerRequestVolume ? new C3DTBoundingVolume(tile.viewerRequestVolume, tileMatrixInverse, registeredExtensions) : null;
|
|
83
|
+
tile.boundingVolume = tile.boundingVolume ? new C3DTBoundingVolume(tile.boundingVolume, tileMatrixInverse, registeredExtensions) : null;
|
|
92
84
|
this.tiles.push(tile);
|
|
93
85
|
tile.tileId = this.tiles.length - 1;
|
|
94
86
|
tile.baseURL = baseURL;
|
|
@@ -104,5 +96,4 @@ class C3DTileset {
|
|
|
104
96
|
this.tiles[nodeId].isTileset = true;
|
|
105
97
|
}
|
|
106
98
|
}
|
|
107
|
-
|
|
108
|
-
exports.default = _default;
|
|
99
|
+
export default C3DTileset;
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { Vector2, Vector3, Vector4 } from 'three';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _three = require("three");
|
|
8
3
|
/**
|
|
9
4
|
* @enum {Object} componentTypeBytesSize - Size in byte of a component type.
|
|
10
5
|
*/
|
|
@@ -49,9 +44,9 @@ const typeComponentsNumber = {
|
|
|
49
44
|
*/
|
|
50
45
|
const typeConstructor = {
|
|
51
46
|
// SCALAR: no constructor, just create a value (int, float, etc. depending on componentType)
|
|
52
|
-
VEC2:
|
|
53
|
-
VEC3:
|
|
54
|
-
VEC4:
|
|
47
|
+
VEC2: Vector2,
|
|
48
|
+
VEC3: Vector3,
|
|
49
|
+
VEC4: Vector4
|
|
55
50
|
};
|
|
56
51
|
|
|
57
52
|
/**
|
|
@@ -102,5 +97,4 @@ function binaryPropertyAccessor(buffer, batchLength, byteOffset, componentType,
|
|
|
102
97
|
return array;
|
|
103
98
|
}
|
|
104
99
|
}
|
|
105
|
-
|
|
106
|
-
exports.default = _default;
|
|
100
|
+
export default binaryPropertyAccessor;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
8
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
1
|
+
import * as THREE from 'three';
|
|
10
2
|
const FRAMERATE = 60;
|
|
11
3
|
const FRAME_DURATION = 1000 / FRAMERATE;
|
|
12
4
|
|
|
@@ -147,5 +139,4 @@ class AnimationPlayer extends THREE.EventDispatcher {
|
|
|
147
139
|
}
|
|
148
140
|
}
|
|
149
141
|
}
|
|
150
|
-
|
|
151
|
-
exports.default = _default;
|
|
142
|
+
export default AnimationPlayer;
|
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.deprecatedParsingOptionsToNewOne = exports.deprecatedFeature2MeshOptions = exports.deprecatedColorLayerOptions = exports.deprecatedC3DEngineWebGLOptions = exports.default = void 0;
|
|
7
|
-
var _LayeredMaterial = require("../../Renderer/LayeredMaterial");
|
|
8
|
-
const deprecatedColorLayerOptions = options => {
|
|
1
|
+
import { colorLayerEffects } from "../../Renderer/LayeredMaterial.js";
|
|
2
|
+
export const deprecatedColorLayerOptions = options => {
|
|
9
3
|
if (options.fx) {
|
|
10
4
|
console.warn('ColorLayer fx is deprecated, use ColorLayer.effect_type and ColorLayer.effect_parameter instead.');
|
|
11
5
|
if (options.fx > 2.0) {
|
|
12
6
|
options.effect_parameter = options.fx;
|
|
13
|
-
options.effect_type =
|
|
7
|
+
options.effect_type = colorLayerEffects.removeLightColor;
|
|
14
8
|
} else if (options.fx > 0.0) {
|
|
15
9
|
options.effect_parameter = options.fx;
|
|
16
|
-
options.effect_type =
|
|
10
|
+
options.effect_type = colorLayerEffects.removeWhiteColor;
|
|
17
11
|
}
|
|
18
12
|
}
|
|
19
13
|
return options;
|
|
20
14
|
};
|
|
21
|
-
|
|
22
|
-
const deprecatedParsingOptionsToNewOne = options => {
|
|
15
|
+
export const deprecatedParsingOptionsToNewOne = options => {
|
|
23
16
|
/* istanbul ignore next */
|
|
24
17
|
if (options.crsOut || options.crsIn) {
|
|
25
18
|
console.warn('Parsing options with crsIn and crsOut are deprecated, use { in, out } structure.');
|
|
@@ -63,8 +56,7 @@ const deprecatedParsingOptionsToNewOne = options => {
|
|
|
63
56
|
}
|
|
64
57
|
return options;
|
|
65
58
|
};
|
|
66
|
-
|
|
67
|
-
const deprecatedFeature2MeshOptions = options => {
|
|
59
|
+
export const deprecatedFeature2MeshOptions = options => {
|
|
68
60
|
if (options.color) {
|
|
69
61
|
console.error('Color convert option is removed, use Style.xxx.color');
|
|
70
62
|
}
|
|
@@ -75,12 +67,9 @@ const deprecatedFeature2MeshOptions = options => {
|
|
|
75
67
|
console.error('altitude convert option is removed, use Style.xxx.base_altitude instead');
|
|
76
68
|
}
|
|
77
69
|
};
|
|
78
|
-
|
|
79
|
-
const deprecatedC3DEngineWebGLOptions = options => {
|
|
70
|
+
export const deprecatedC3DEngineWebGLOptions = options => {
|
|
80
71
|
if (options.isWebGL2 === false) {
|
|
81
72
|
console.warn('WebGL1 support (isWebGL2=false) is deprecated and will be removed in iTowns 2.43. This follows its deprecation by three.js. If you are impacted by this change, please discuss in the following issue: https://github.com/iTowns/itowns/issues/2152.');
|
|
82
73
|
}
|
|
83
74
|
};
|
|
84
|
-
|
|
85
|
-
var _default = {};
|
|
86
|
-
exports.default = _default;
|
|
75
|
+
export default {};
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
9
|
-
var _Fetcher = _interopRequireDefault(require("../Provider/Fetcher"));
|
|
10
|
-
var _PointCloudNode = _interopRequireDefault(require("./PointCloudNode"));
|
|
11
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
12
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import Fetcher from "../Provider/Fetcher.js";
|
|
3
|
+
import PointCloudNode from "./PointCloudNode.js";
|
|
13
4
|
const size = new THREE.Vector3();
|
|
14
5
|
const position = new THREE.Vector3();
|
|
15
6
|
const translation = new THREE.Vector3();
|
|
@@ -38,7 +29,7 @@ function buildId(depth, x, y, z) {
|
|
|
38
29
|
* @property {string} id - The id of the node, constituted of the four
|
|
39
30
|
* components: `depth-x-y-z`.
|
|
40
31
|
*/
|
|
41
|
-
class EntwinePointTileNode extends
|
|
32
|
+
class EntwinePointTileNode extends PointCloudNode {
|
|
42
33
|
/**
|
|
43
34
|
* Constructs a new instance of EntwinePointTileNode.
|
|
44
35
|
*
|
|
@@ -101,7 +92,7 @@ class EntwinePointTileNode extends _PointCloudNode.default {
|
|
|
101
92
|
return this.numPoints >= 0;
|
|
102
93
|
}
|
|
103
94
|
loadOctree() {
|
|
104
|
-
return
|
|
95
|
+
return Fetcher.json(`${this.layer.source.url}/ept-hierarchy/${this.id}.json`, this.layer.source.networkOptions).then(hierarchy => {
|
|
105
96
|
this.numPoints = hierarchy[this.id];
|
|
106
97
|
const stack = [];
|
|
107
98
|
stack.push(this);
|
|
@@ -132,5 +123,4 @@ class EntwinePointTileNode extends _PointCloudNode.default {
|
|
|
132
123
|
}
|
|
133
124
|
}
|
|
134
125
|
}
|
|
135
|
-
|
|
136
|
-
exports.default = _default;
|
|
126
|
+
export default EntwinePointTileNode;
|
package/lib/Core/Feature.js
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.default = exports.FeatureGeometry = exports.FeatureCollection = exports.FeatureBuildingOptions = exports.FEATURE_TYPES = void 0;
|
|
8
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
9
|
-
var _Extent = _interopRequireDefault(require("./Geographic/Extent"));
|
|
10
|
-
var _Coordinates = _interopRequireDefault(require("./Geographic/Coordinates"));
|
|
11
|
-
var _Crs = _interopRequireDefault(require("./Geographic/Crs"));
|
|
12
|
-
var _Style = _interopRequireDefault(require("./Style"));
|
|
13
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import Extent from "./Geographic/Extent.js";
|
|
3
|
+
import Coordinates from "./Geographic/Coordinates.js";
|
|
4
|
+
import CRS from "./Geographic/Crs.js";
|
|
5
|
+
import Style from "./Style.js";
|
|
15
6
|
function defaultExtent(crs) {
|
|
16
|
-
return new
|
|
7
|
+
return new Extent(crs, Infinity, -Infinity, Infinity, -Infinity);
|
|
17
8
|
}
|
|
18
9
|
function _extendBuffer(feature, size) {
|
|
19
10
|
feature.vertices.length += size * feature.size;
|
|
@@ -27,8 +18,8 @@ function _setGeometryValues(feature, coord) {
|
|
|
27
18
|
}
|
|
28
19
|
feature._pushValues(coord.x, coord.y, coord.z);
|
|
29
20
|
}
|
|
30
|
-
const coordOut = new
|
|
31
|
-
const FEATURE_TYPES = {
|
|
21
|
+
const coordOut = new Coordinates('EPSG:4326', 0, 0, 0);
|
|
22
|
+
export const FEATURE_TYPES = {
|
|
32
23
|
POINT: 0,
|
|
33
24
|
LINE: 1,
|
|
34
25
|
POLYGON: 2
|
|
@@ -52,8 +43,7 @@ const FEATURE_TYPES = {
|
|
|
52
43
|
* style for all new features.
|
|
53
44
|
*
|
|
54
45
|
*/
|
|
55
|
-
|
|
56
|
-
class FeatureBuildingOptions {}
|
|
46
|
+
export class FeatureBuildingOptions {}
|
|
57
47
|
|
|
58
48
|
/**
|
|
59
49
|
* @property {Extent} extent - The 2D extent containing all the points
|
|
@@ -65,8 +55,7 @@ class FeatureBuildingOptions {}
|
|
|
65
55
|
* @property {Object} properties - Properties of the geometry. It can be
|
|
66
56
|
* anything specified in the GeoJSON under the `properties` property.
|
|
67
57
|
*/
|
|
68
|
-
|
|
69
|
-
class FeatureGeometry {
|
|
58
|
+
export class FeatureGeometry {
|
|
70
59
|
#currentExtent;
|
|
71
60
|
/**
|
|
72
61
|
* @param {Feature} feature geometry
|
|
@@ -188,7 +177,6 @@ class FeatureGeometry {
|
|
|
188
177
|
}
|
|
189
178
|
}
|
|
190
179
|
}
|
|
191
|
-
exports.FeatureGeometry = FeatureGeometry;
|
|
192
180
|
function push2DValues(value0, value1) {
|
|
193
181
|
this.vertices[this._pos++] = value0;
|
|
194
182
|
this.vertices[this._pos++] = value1;
|
|
@@ -260,7 +248,7 @@ class Feature {
|
|
|
260
248
|
}
|
|
261
249
|
this._pos = 0;
|
|
262
250
|
this._pushValues = (this.size === 3 ? push3DValues : push2DValues).bind(this);
|
|
263
|
-
this.style =
|
|
251
|
+
this.style = Style.setFromProperties;
|
|
264
252
|
}
|
|
265
253
|
/**
|
|
266
254
|
* Instance a new {@link FeatureGeometry} and push in {@link Feature}.
|
|
@@ -288,8 +276,7 @@ class Feature {
|
|
|
288
276
|
return this.geometries.length;
|
|
289
277
|
}
|
|
290
278
|
}
|
|
291
|
-
|
|
292
|
-
exports.default = _default;
|
|
279
|
+
export default Feature;
|
|
293
280
|
const doNothing = () => {};
|
|
294
281
|
const transformToLocalSystem3D = (coord, collection) => {
|
|
295
282
|
coord.geodesicNormal.applyNormalMatrix(collection.normalMatrixInverse);
|
|
@@ -344,7 +331,7 @@ const alignYtoEast = new THREE.Quaternion();
|
|
|
344
331
|
*
|
|
345
332
|
*/
|
|
346
333
|
|
|
347
|
-
class FeatureCollection extends THREE.Object3D {
|
|
334
|
+
export class FeatureCollection extends THREE.Object3D {
|
|
348
335
|
#transformToLocalSystem = transformToLocalSystem2D;
|
|
349
336
|
#setLocalSystem = doNothing;
|
|
350
337
|
/**
|
|
@@ -354,7 +341,7 @@ class FeatureCollection extends THREE.Object3D {
|
|
|
354
341
|
var _options$source;
|
|
355
342
|
super();
|
|
356
343
|
this.isFeatureCollection = true;
|
|
357
|
-
this.crs =
|
|
344
|
+
this.crs = CRS.formatToEPSG(options.accurate || !((_options$source = options.source) !== null && _options$source !== void 0 && _options$source.crs) ? options.crs : options.source.crs);
|
|
358
345
|
this.features = [];
|
|
359
346
|
this.mergeFeatures = options.mergeFeatures === undefined ? true : options.mergeFeatures;
|
|
360
347
|
this.size = options.structure == '3d' ? 3 : 2;
|
|
@@ -362,7 +349,7 @@ class FeatureCollection extends THREE.Object3D {
|
|
|
362
349
|
this.style = options.style;
|
|
363
350
|
this.isInverted = false;
|
|
364
351
|
this.matrixWorldInverse = new THREE.Matrix4();
|
|
365
|
-
this.center = new
|
|
352
|
+
this.center = new Coordinates('EPSG:4326', 0, 0);
|
|
366
353
|
if (this.size == 2) {
|
|
367
354
|
this.extent = options.buildExtent === false ? undefined : defaultExtent(options.forcedExtentCrs || this.crs);
|
|
368
355
|
this.#setLocalSystem = center => {
|
|
@@ -501,5 +488,4 @@ class FeatureCollection extends THREE.Object3D {
|
|
|
501
488
|
this.features.push(ref);
|
|
502
489
|
return ref;
|
|
503
490
|
}
|
|
504
|
-
}
|
|
505
|
-
exports.FeatureCollection = FeatureCollection;
|
|
491
|
+
}
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _Coordinates = _interopRequireDefault(require("./Coordinates"));
|
|
9
1
|
/**
|
|
10
2
|
* Generated On: 2016-02-25
|
|
11
3
|
* Class: CoordStars
|
|
12
4
|
* Description: get coord of stars like earth...
|
|
13
5
|
*/
|
|
14
|
-
|
|
6
|
+
import Coordinates from "./Coordinates.js";
|
|
15
7
|
const CoordStars = {
|
|
16
8
|
getSunPosition() {
|
|
17
9
|
const m = Math;
|
|
@@ -82,9 +74,8 @@ const CoordStars = {
|
|
|
82
74
|
const sun = CoordStars.getSunPosition()(date, lat, lon);
|
|
83
75
|
const dayMilliSec = 24 * 3600000;
|
|
84
76
|
const longitude = sun.ascension + date % dayMilliSec / dayMilliSec * -360 + 180; // cause midday
|
|
85
|
-
const coSunCarto = new
|
|
77
|
+
const coSunCarto = new Coordinates('EPSG:4326', longitude, lat, 50000000).as('EPSG:4978').toVector3();
|
|
86
78
|
return coSunCarto;
|
|
87
79
|
}
|
|
88
80
|
};
|
|
89
|
-
|
|
90
|
-
exports.default = _default;
|
|
81
|
+
export default CoordStars;
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var THREE = _interopRequireWildcard(require("three"));
|
|
9
|
-
var _proj = _interopRequireDefault(require("proj4"));
|
|
10
|
-
var _Crs = _interopRequireDefault(require("./Crs"));
|
|
11
|
-
var _Ellipsoid = _interopRequireDefault(require("../Math/Ellipsoid"));
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
-
_proj.default.defs('EPSG:4978', '+proj=geocent +datum=WGS84 +units=m +no_defs');
|
|
15
|
-
const ellipsoid = new _Ellipsoid.default();
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import proj4 from 'proj4';
|
|
3
|
+
import CRS from "./Crs.js";
|
|
4
|
+
import Ellipsoid from "../Math/Ellipsoid.js";
|
|
5
|
+
proj4.defs('EPSG:4978', '+proj=geocent +datum=WGS84 +units=m +no_defs');
|
|
6
|
+
const ellipsoid = new Ellipsoid();
|
|
16
7
|
const projectionCache = {};
|
|
17
8
|
const v0 = new THREE.Vector3();
|
|
18
9
|
const v1 = new THREE.Vector3();
|
|
@@ -23,7 +14,7 @@ function proj4cache(crsIn, crsOut) {
|
|
|
23
14
|
projectionCache[crsIn] = {};
|
|
24
15
|
}
|
|
25
16
|
if (!projectionCache[crsIn][crsOut]) {
|
|
26
|
-
projectionCache[crsIn][crsOut] = (
|
|
17
|
+
projectionCache[crsIn][crsOut] = proj4(crsIn, crsOut);
|
|
27
18
|
}
|
|
28
19
|
return projectionCache[crsIn][crsOut];
|
|
29
20
|
}
|
|
@@ -77,7 +68,7 @@ class Coordinates {
|
|
|
77
68
|
let v1 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
78
69
|
let v2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
79
70
|
this.isCoordinates = true;
|
|
80
|
-
|
|
71
|
+
CRS.isValid(crs);
|
|
81
72
|
this.crs = crs;
|
|
82
73
|
|
|
83
74
|
// Storing the coordinates as is, not in arrays, as it is
|
|
@@ -103,7 +94,7 @@ class Coordinates {
|
|
|
103
94
|
* @param {String} crs Coordinate Reference System (e.g. 'EPSG:4978')
|
|
104
95
|
*/
|
|
105
96
|
setCrs(crs) {
|
|
106
|
-
|
|
97
|
+
CRS.isValid(crs);
|
|
107
98
|
this.crs = crs;
|
|
108
99
|
}
|
|
109
100
|
|
|
@@ -191,7 +182,7 @@ class Coordinates {
|
|
|
191
182
|
get geodesicNormal() {
|
|
192
183
|
if (this._normalNeedsUpdate) {
|
|
193
184
|
this._normalNeedsUpdate = false;
|
|
194
|
-
if (
|
|
185
|
+
if (CRS.is4326(this.crs)) {
|
|
195
186
|
ellipsoid.geodeticSurfaceNormalCartographic(this, this._normal);
|
|
196
187
|
} else if (this.crs == 'EPSG:4978') {
|
|
197
188
|
ellipsoid.geodeticSurfaceNormal(this, this._normal);
|
|
@@ -315,7 +306,7 @@ class Coordinates {
|
|
|
315
306
|
if (this.crs == crs) {
|
|
316
307
|
target.copy(this);
|
|
317
308
|
} else {
|
|
318
|
-
if (
|
|
309
|
+
if (CRS.is4326(this.crs) && crs == 'EPSG:3857') {
|
|
319
310
|
this.y = THREE.MathUtils.clamp(this.y, -89.999999, 89.999999);
|
|
320
311
|
}
|
|
321
312
|
target.setFromArray(proj4cache(this.crs, crs).forward([this.x, this.y, this.z]));
|
|
@@ -326,5 +317,4 @@ class Coordinates {
|
|
|
326
317
|
}
|
|
327
318
|
coord0 = new Coordinates('EPSG:4326', 0, 0, 0);
|
|
328
319
|
coord1 = new Coordinates('EPSG:4326', 0, 0, 0);
|
|
329
|
-
|
|
330
|
-
exports.default = _default;
|
|
320
|
+
export default Coordinates;
|