itowns 2.44.3-next.8 → 2.45.0
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/README.md +3 -129
- package/examples/3dtiles_loader.html +123 -48
- package/examples/config.json +3 -10
- package/examples/copc_simple_loader.html +15 -5
- package/examples/effects_stereo.html +2 -2
- package/examples/entwine_3d_loader.html +3 -1
- package/examples/entwine_simple_loader.html +1 -1
- package/examples/images/itowns_logo.svg +123 -0
- package/examples/js/plugins/COGParser.js +1 -1
- package/examples/jsm/OGC3DTilesHelper.js +6 -1
- package/examples/layers/JSONLayers/GeoidMNT.json +3 -1
- package/examples/misc_collada.html +2 -2
- package/examples/source_file_geojson_3d.html +0 -1
- package/examples/source_file_kml_raster_usgs.html +0 -1
- package/examples/source_stream_wfs_raster.html +0 -7
- package/examples/vector_tile_mapbox_raster.html +91 -0
- package/examples/view_3d_map_webxr.html +3 -1
- package/examples/view_multi_25d.html +2 -2
- package/package.json +21 -75
- package/CODING.md +0 -120
- package/CONTRIBUTING.md +0 -150
- package/CONTRIBUTORS.md +0 -55
- package/LICENSE.md +0 -44
- package/changelog.md +0 -1361
- package/dist/455.js +0 -2
- package/dist/455.js.map +0 -1
- package/dist/debug.js +0 -3
- package/dist/debug.js.LICENSE.txt +0 -13
- package/dist/debug.js.map +0 -1
- package/dist/itowns.js +0 -3
- package/dist/itowns.js.LICENSE.txt +0 -7
- package/dist/itowns.js.map +0 -1
- package/dist/itowns_lasparser.js +0 -2
- package/dist/itowns_lasparser.js.map +0 -1
- package/dist/itowns_lasworker.js +0 -2
- package/dist/itowns_lasworker.js.map +0 -1
- package/dist/itowns_potree2worker.js +0 -2
- package/dist/itowns_potree2worker.js.map +0 -1
- package/dist/itowns_widgets.js +0 -2
- package/dist/itowns_widgets.js.map +0 -1
- package/examples/.eslintrc.cjs +0 -35
- package/examples/3dtiles_25d.html +0 -120
- package/examples/3dtiles_basic.html +0 -94
- package/examples/3dtiles_batch_table.html +0 -86
- package/examples/3dtiles_ion.html +0 -126
- package/examples/3dtiles_pointcloud.html +0 -95
- package/examples/jsm/.eslintrc.cjs +0 -38
- package/lib/Controls/FirstPersonControls.js +0 -308
- package/lib/Controls/FlyControls.js +0 -175
- package/lib/Controls/GlobeControls.js +0 -1162
- package/lib/Controls/PlanarControls.js +0 -1025
- package/lib/Controls/StateControl.js +0 -429
- package/lib/Controls/StreetControls.js +0 -392
- package/lib/Converter/Feature2Mesh.js +0 -615
- package/lib/Converter/Feature2Texture.js +0 -170
- package/lib/Converter/convertToTile.js +0 -75
- package/lib/Converter/textureConverter.js +0 -44
- package/lib/Core/3DTiles/C3DTBatchTable.js +0 -131
- package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.js +0 -96
- package/lib/Core/3DTiles/C3DTBoundingVolume.js +0 -157
- package/lib/Core/3DTiles/C3DTExtensions.js +0 -97
- package/lib/Core/3DTiles/C3DTFeature.js +0 -110
- package/lib/Core/3DTiles/C3DTilesEnums.js +0 -20
- package/lib/Core/3DTiles/C3DTileset.js +0 -99
- package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.js +0 -100
- package/lib/Core/AnimationPlayer.js +0 -142
- package/lib/Core/CopcNode.js +0 -174
- package/lib/Core/Deprecated/Undeprecator.js +0 -75
- package/lib/Core/EntwinePointTileNode.js +0 -126
- package/lib/Core/Feature.js +0 -490
- package/lib/Core/Geographic/CoordStars.js +0 -80
- package/lib/Core/Geographic/Coordinates.js +0 -320
- package/lib/Core/Geographic/Crs.js +0 -175
- package/lib/Core/Geographic/Extent.js +0 -534
- package/lib/Core/Geographic/GeoidGrid.js +0 -109
- package/lib/Core/Label.js +0 -222
- package/lib/Core/MainLoop.js +0 -211
- package/lib/Core/Math/Ellipsoid.js +0 -144
- package/lib/Core/Picking.js +0 -255
- package/lib/Core/PointCloudNode.js +0 -42
- package/lib/Core/Potree2Node.js +0 -206
- package/lib/Core/Potree2PointAttributes.js +0 -139
- package/lib/Core/PotreeNode.js +0 -101
- package/lib/Core/Prefab/Globe/Atmosphere.js +0 -299
- package/lib/Core/Prefab/Globe/BuilderEllipsoidTile.js +0 -110
- package/lib/Core/Prefab/Globe/GlobeLayer.js +0 -145
- package/lib/Core/Prefab/Globe/SkyShader.js +0 -78
- package/lib/Core/Prefab/GlobeView.js +0 -161
- package/lib/Core/Prefab/Planar/PlanarLayer.js +0 -53
- package/lib/Core/Prefab/Planar/PlanarTileBuilder.js +0 -72
- package/lib/Core/Prefab/PlanarView.js +0 -62
- package/lib/Core/Prefab/TileBuilder.js +0 -80
- package/lib/Core/Prefab/computeBufferTileGeometry.js +0 -183
- package/lib/Core/Scheduler/Cache.js +0 -256
- package/lib/Core/Scheduler/CancelledCommandException.js +0 -15
- package/lib/Core/Scheduler/Scheduler.js +0 -294
- package/lib/Core/Style.js +0 -1121
- package/lib/Core/System/Capabilities.js +0 -63
- package/lib/Core/Tile/Tile.js +0 -219
- package/lib/Core/Tile/TileGrid.js +0 -46
- package/lib/Core/TileGeometry.js +0 -40
- package/lib/Core/TileMesh.js +0 -109
- package/lib/Core/View.js +0 -1109
- package/lib/Layer/C3DTilesLayer.js +0 -455
- package/lib/Layer/ColorLayer.js +0 -128
- package/lib/Layer/CopcLayer.js +0 -58
- package/lib/Layer/ElevationLayer.js +0 -107
- package/lib/Layer/EntwinePointTileLayer.js +0 -64
- package/lib/Layer/FeatureGeometryLayer.js +0 -63
- package/lib/Layer/GeoidLayer.js +0 -80
- package/lib/Layer/GeometryLayer.js +0 -202
- package/lib/Layer/InfoLayer.js +0 -64
- package/lib/Layer/LabelLayer.js +0 -456
- package/lib/Layer/Layer.js +0 -304
- package/lib/Layer/LayerUpdateState.js +0 -89
- package/lib/Layer/LayerUpdateStrategy.js +0 -80
- package/lib/Layer/OGC3DTilesLayer.js +0 -387
- package/lib/Layer/OrientedImageLayer.js +0 -222
- package/lib/Layer/PointCloudLayer.js +0 -359
- package/lib/Layer/Potree2Layer.js +0 -164
- package/lib/Layer/PotreeLayer.js +0 -65
- package/lib/Layer/RasterLayer.js +0 -27
- package/lib/Layer/ReferencingLayerProperties.js +0 -62
- package/lib/Layer/TiledGeometryLayer.js +0 -403
- package/lib/Loader/LASLoader.js +0 -193
- package/lib/Loader/Potree2BrotliLoader.js +0 -261
- package/lib/Loader/Potree2Loader.js +0 -207
- package/lib/Main.js +0 -115
- package/lib/MainBundle.js +0 -4
- package/lib/Parser/B3dmParser.js +0 -174
- package/lib/Parser/CameraCalibrationParser.js +0 -94
- package/lib/Parser/GDFParser.js +0 -72
- package/lib/Parser/GTXParser.js +0 -75
- package/lib/Parser/GeoJsonParser.js +0 -212
- package/lib/Parser/GpxParser.js +0 -25
- package/lib/Parser/ISGParser.js +0 -71
- package/lib/Parser/KMLParser.js +0 -25
- package/lib/Parser/LASParser.js +0 -137
- package/lib/Parser/MapBoxUrlParser.js +0 -83
- package/lib/Parser/PntsParser.js +0 -131
- package/lib/Parser/Potree2BinParser.js +0 -92
- package/lib/Parser/PotreeBinParser.js +0 -106
- package/lib/Parser/PotreeCinParser.js +0 -29
- package/lib/Parser/ShapefileParser.js +0 -78
- package/lib/Parser/VectorTileParser.js +0 -202
- package/lib/Parser/XbilParser.js +0 -119
- package/lib/Parser/deprecated/LegacyGLTFLoader.js +0 -1386
- package/lib/Parser/iGLTFLoader.js +0 -168
- package/lib/Process/3dTilesProcessing.js +0 -304
- package/lib/Process/FeatureProcessing.js +0 -76
- package/lib/Process/LayeredMaterialNodeProcessing.js +0 -221
- package/lib/Process/ObjectRemovalHelper.js +0 -97
- package/lib/Process/handlerNodeError.js +0 -23
- package/lib/Provider/3dTilesProvider.js +0 -149
- package/lib/Provider/DataSourceProvider.js +0 -8
- package/lib/Provider/Fetcher.js +0 -229
- package/lib/Provider/PointCloudProvider.js +0 -45
- package/lib/Provider/TileProvider.js +0 -16
- package/lib/Provider/URLBuilder.js +0 -116
- package/lib/Renderer/Camera.js +0 -281
- package/lib/Renderer/Color.js +0 -56
- package/lib/Renderer/ColorLayersOrdering.js +0 -115
- package/lib/Renderer/CommonMaterial.js +0 -31
- package/lib/Renderer/Label2DRenderer.js +0 -190
- package/lib/Renderer/LayeredMaterial.js +0 -243
- package/lib/Renderer/OBB.js +0 -153
- package/lib/Renderer/OrientedImageCamera.js +0 -118
- package/lib/Renderer/OrientedImageMaterial.js +0 -167
- package/lib/Renderer/PointsMaterial.js +0 -485
- package/lib/Renderer/RasterTile.js +0 -209
- package/lib/Renderer/RenderMode.js +0 -31
- package/lib/Renderer/Shader/ShaderChunk.js +0 -160
- package/lib/Renderer/Shader/ShaderUtils.js +0 -47
- package/lib/Renderer/SphereHelper.js +0 -23
- package/lib/Renderer/WebXR.js +0 -51
- package/lib/Renderer/c3DEngine.js +0 -214
- package/lib/Source/C3DTilesGoogleSource.js +0 -74
- package/lib/Source/C3DTilesIonSource.js +0 -54
- package/lib/Source/C3DTilesSource.js +0 -30
- package/lib/Source/CopcSource.js +0 -115
- package/lib/Source/EntwinePointTileSource.js +0 -62
- package/lib/Source/FileSource.js +0 -189
- package/lib/Source/OGC3DTilesGoogleSource.js +0 -29
- package/lib/Source/OGC3DTilesIonSource.js +0 -34
- package/lib/Source/OGC3DTilesSource.js +0 -21
- package/lib/Source/OrientedImageSource.js +0 -59
- package/lib/Source/Potree2Source.js +0 -167
- package/lib/Source/PotreeSource.js +0 -82
- package/lib/Source/Source.js +0 -223
- package/lib/Source/TMSSource.js +0 -145
- package/lib/Source/VectorTilesSource.js +0 -178
- package/lib/Source/WFSSource.js +0 -168
- package/lib/Source/WMSSource.js +0 -133
- package/lib/Source/WMTSSource.js +0 -86
- package/lib/ThreeExtended/capabilities/WebGL.js +0 -69
- package/lib/ThreeExtended/libs/ktx-parse.module.js +0 -470
- package/lib/ThreeExtended/libs/zstddec.module.js +0 -29
- package/lib/ThreeExtended/loaders/DDSLoader.js +0 -200
- package/lib/ThreeExtended/loaders/DRACOLoader.js +0 -399
- package/lib/ThreeExtended/loaders/GLTFLoader.js +0 -2876
- package/lib/ThreeExtended/loaders/KTX2Loader.js +0 -625
- package/lib/ThreeExtended/utils/BufferGeometryUtils.js +0 -846
- package/lib/ThreeExtended/utils/WorkerPool.js +0 -70
- package/lib/Utils/CameraUtils.js +0 -555
- package/lib/Utils/DEMUtils.js +0 -350
- package/lib/Utils/FeaturesUtils.js +0 -156
- package/lib/Utils/Gradients.js +0 -16
- package/lib/Utils/OrientationUtils.js +0 -457
- package/lib/Utils/ThreeUtils.js +0 -115
- package/lib/Utils/gui/C3DTilesStyle.js +0 -215
- package/lib/Utils/gui/Main.js +0 -7
- package/lib/Utils/gui/Minimap.js +0 -154
- package/lib/Utils/gui/Navigation.js +0 -245
- package/lib/Utils/gui/Scale.js +0 -107
- package/lib/Utils/gui/Searchbar.js +0 -234
- package/lib/Utils/gui/Widget.js +0 -80
- package/lib/Utils/placeObjectOnGround.js +0 -137
- package/lib/Worker/LASLoaderWorker.js +0 -19
- package/lib/Worker/Potree2Worker.js +0 -21
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import * as THREE from 'three';
|
|
2
|
-
import { MAIN_LOOP_EVENTS } from "../Core/MainLoop.js";
|
|
3
|
-
const MOVEMENTS = {
|
|
4
|
-
38: {
|
|
5
|
-
method: 'translateZ',
|
|
6
|
-
sign: -1
|
|
7
|
-
},
|
|
8
|
-
// FORWARD: up key
|
|
9
|
-
40: {
|
|
10
|
-
method: 'translateZ',
|
|
11
|
-
sign: 1
|
|
12
|
-
},
|
|
13
|
-
// BACKWARD: down key
|
|
14
|
-
37: {
|
|
15
|
-
method: 'translateX',
|
|
16
|
-
sign: -1
|
|
17
|
-
},
|
|
18
|
-
// STRAFE_LEFT: left key
|
|
19
|
-
39: {
|
|
20
|
-
method: 'translateX',
|
|
21
|
-
sign: 1
|
|
22
|
-
},
|
|
23
|
-
// STRAFE_RIGHT: right key
|
|
24
|
-
33: {
|
|
25
|
-
method: 'rotateZ',
|
|
26
|
-
sign: 1,
|
|
27
|
-
noSpeed: true
|
|
28
|
-
},
|
|
29
|
-
// UP: PageUp key
|
|
30
|
-
34: {
|
|
31
|
-
method: 'rotateZ',
|
|
32
|
-
sign: -1,
|
|
33
|
-
noSpeed: true
|
|
34
|
-
},
|
|
35
|
-
// DOWN: PageDown key
|
|
36
|
-
wheelup: {
|
|
37
|
-
method: 'translateZ',
|
|
38
|
-
sign: 1,
|
|
39
|
-
oneshot: true
|
|
40
|
-
},
|
|
41
|
-
// WHEEL up
|
|
42
|
-
wheeldown: {
|
|
43
|
-
method: 'translateZ',
|
|
44
|
-
sign: -1,
|
|
45
|
-
oneshot: true
|
|
46
|
-
} // WHEEL down
|
|
47
|
-
};
|
|
48
|
-
function onDocumentMouseDown(event) {
|
|
49
|
-
event.preventDefault();
|
|
50
|
-
this._isMouseDown = true;
|
|
51
|
-
const coords = this.view.eventToViewCoords(event);
|
|
52
|
-
this._onMouseDownMouseX = coords.x;
|
|
53
|
-
this._onMouseDownMouseY = coords.y;
|
|
54
|
-
}
|
|
55
|
-
function onTouchStart(event) {
|
|
56
|
-
event.preventDefault();
|
|
57
|
-
this._isMouseDown = true;
|
|
58
|
-
this._onMouseDownMouseX = event.touches[0].pageX;
|
|
59
|
-
this._onMouseDownMouseY = event.touches[0].pageY;
|
|
60
|
-
}
|
|
61
|
-
function onPointerMove(event) {
|
|
62
|
-
if (this._isMouseDown === true) {
|
|
63
|
-
const coords = this.view.eventToViewCoords(event);
|
|
64
|
-
|
|
65
|
-
// in rigor we have tan(theta) = tan(cameraFOV) * deltaH / H
|
|
66
|
-
// (where deltaH is the vertical amount we moved, and H the renderer height)
|
|
67
|
-
// we loosely approximate tan(x) by x
|
|
68
|
-
const pxToAngleRatio = THREE.MathUtils.degToRad(this._camera3D.fov) / this.view.mainLoop.gfxEngine.height;
|
|
69
|
-
this._camera3D.rotateY((coords.x - this._onMouseDownMouseX) * pxToAngleRatio);
|
|
70
|
-
this._camera3D.rotateX((coords.y - this._onMouseDownMouseY) * pxToAngleRatio);
|
|
71
|
-
this._onMouseDownMouseX = coords.x;
|
|
72
|
-
this._onMouseDownMouseY = coords.y;
|
|
73
|
-
this.view.notifyChange(this._camera3D, false);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function onDocumentMouseUp() {
|
|
77
|
-
this._isMouseDown = false;
|
|
78
|
-
}
|
|
79
|
-
function onKeyUp(e) {
|
|
80
|
-
const move = MOVEMENTS[e.keyCode];
|
|
81
|
-
if (move) {
|
|
82
|
-
this.moves.delete(move);
|
|
83
|
-
e.preventDefault();
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function onKeyDown(e) {
|
|
87
|
-
const move = MOVEMENTS[e.keyCode];
|
|
88
|
-
if (move) {
|
|
89
|
-
this.moves.add(move);
|
|
90
|
-
this.view.notifyChange(this._camera3D, false);
|
|
91
|
-
e.preventDefault();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
function onDocumentMouseWheel(event) {
|
|
95
|
-
const delta = -event.deltaY;
|
|
96
|
-
if (delta < 0) {
|
|
97
|
-
this.moves.add(MOVEMENTS.wheelup);
|
|
98
|
-
} else {
|
|
99
|
-
this.moves.add(MOVEMENTS.wheeldown);
|
|
100
|
-
}
|
|
101
|
-
this.view.notifyChange(this._camera3D, false);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* First-Person controls (at least a possible declination of it).
|
|
106
|
-
*
|
|
107
|
-
* Bindings:
|
|
108
|
-
* - up + down keys: forward/backward
|
|
109
|
-
* - left + right keys: strafing movements
|
|
110
|
-
* - PageUp + PageDown: roll movement
|
|
111
|
-
* - mouse click+drag: pitch and yaw movements (as looking at a panorama, not as in FPS games for instance)
|
|
112
|
-
*/
|
|
113
|
-
class FlyControls extends THREE.EventDispatcher {
|
|
114
|
-
/**
|
|
115
|
-
* @param {View} view
|
|
116
|
-
* @param {object} options
|
|
117
|
-
* @param {boolean} options.focusOnClick - whether or not to focus the renderer domElement on click
|
|
118
|
-
* @param {boolean} options.focusOnMouseOver - whether or not to focus when the mouse is over the domElement
|
|
119
|
-
*/
|
|
120
|
-
constructor(view) {
|
|
121
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
122
|
-
super();
|
|
123
|
-
this.view = view;
|
|
124
|
-
this.options = options;
|
|
125
|
-
this._camera3D = view.camera3D;
|
|
126
|
-
this.moves = new Set();
|
|
127
|
-
this.moveSpeed = 10; // backward or forward move speed in m/s
|
|
128
|
-
|
|
129
|
-
this._onMouseDownMouseX = 0;
|
|
130
|
-
this._onMouseDownMouseY = 0;
|
|
131
|
-
this._isMouseDown = false;
|
|
132
|
-
view.domElement.addEventListener('mousedown', onDocumentMouseDown.bind(this), false);
|
|
133
|
-
view.domElement.addEventListener('touchstart', onTouchStart.bind(this), false);
|
|
134
|
-
const bindedPM = onPointerMove.bind(this);
|
|
135
|
-
view.domElement.addEventListener('mousemove', bindedPM, false);
|
|
136
|
-
view.domElement.addEventListener('touchmove', bindedPM, false);
|
|
137
|
-
view.domElement.addEventListener('mouseup', onDocumentMouseUp.bind(this), false);
|
|
138
|
-
view.domElement.addEventListener('touchend', onDocumentMouseUp.bind(this), false);
|
|
139
|
-
view.domElement.addEventListener('wheel', onDocumentMouseWheel.bind(this), false);
|
|
140
|
-
view.domElement.addEventListener('keyup', onKeyUp.bind(this), true);
|
|
141
|
-
view.domElement.addEventListener('keydown', onKeyDown.bind(this), true);
|
|
142
|
-
this.view.addFrameRequester(MAIN_LOOP_EVENTS.AFTER_CAMERA_UPDATE, this.update.bind(this));
|
|
143
|
-
|
|
144
|
-
// focus policy
|
|
145
|
-
if (options.focusOnMouseOver) {
|
|
146
|
-
view.domElement.addEventListener('mouseover', () => view.domElement.focus());
|
|
147
|
-
}
|
|
148
|
-
if (options.focusOnClick) {
|
|
149
|
-
view.domElement.addEventListener('click', () => view.domElement.focus());
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
isUserInteracting() {
|
|
153
|
-
return this.moves.size !== 0 || this._isMouseDown;
|
|
154
|
-
}
|
|
155
|
-
update(dt, updateLoopRestarted) {
|
|
156
|
-
// if we are in a keypressed state, then update position
|
|
157
|
-
|
|
158
|
-
// dt will not be relevant when we just started rendering, we consider a 1-frame move in this case
|
|
159
|
-
if (updateLoopRestarted) {
|
|
160
|
-
dt = 16;
|
|
161
|
-
}
|
|
162
|
-
for (const move of this.moves) {
|
|
163
|
-
this._camera3D[move.method](move.sign * (move.noSpeed ? 1 : this.moveSpeed) * dt / 1000);
|
|
164
|
-
}
|
|
165
|
-
if (this.moves.size > 0 || this._isMouseDown) {
|
|
166
|
-
this.view.notifyChange(this._camera3D);
|
|
167
|
-
for (const move of this.moves) {
|
|
168
|
-
if (move.oneshot) {
|
|
169
|
-
this.moves.delete(move);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
export default FlyControls;
|