itowns 2.45.1 → 2.45.2-next.1
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/455.js +1 -1
- package/dist/455.js.map +1 -1
- package/dist/debug.js +1 -1
- package/dist/debug.js.LICENSE.txt +8 -2
- package/dist/debug.js.map +1 -1
- package/dist/itowns.js +1 -1
- package/dist/itowns.js.LICENSE.txt +1 -1
- package/dist/itowns.js.map +1 -1
- package/dist/itowns_lasparser.js +1 -1
- package/dist/itowns_lasparser.js.map +1 -1
- package/dist/itowns_lasworker.js +1 -1
- package/dist/itowns_lasworker.js.map +1 -1
- package/dist/itowns_potree2worker.js +1 -1
- package/dist/itowns_potree2worker.js.map +1 -1
- package/dist/itowns_widgets.js +1 -1
- package/dist/itowns_widgets.js.map +1 -1
- package/examples/copc_simple_loader.html +3 -3
- package/examples/entwine_3d_loader.html +2 -2
- package/examples/entwine_simple_loader.html +10 -6
- package/examples/potree2_25d_map.html +2 -2
- package/examples/potree_25d_map.html +2 -2
- package/examples/potree_3d_map.html +2 -2
- package/examples/view_3d_map_webxr.html +2 -5
- package/lib/Controls/FirstPersonControls.d.ts +90 -0
- package/lib/Controls/FlyControls.d.ts +36 -0
- package/lib/Controls/GlobeControls.d.ts +274 -0
- package/lib/Controls/PlanarControls.d.ts +339 -0
- package/lib/Controls/StateControl.d.ts +140 -0
- package/lib/Controls/StreetControls.d.ts +134 -0
- package/lib/Controls/VRControls.d.ts +56 -0
- package/lib/Controls/VRControls.js +409 -0
- package/lib/Converter/Feature2Mesh.d.ts +42 -0
- package/lib/Converter/Feature2Texture.d.ts +5 -0
- package/lib/Converter/convertToTile.d.ts +5 -0
- package/lib/Converter/convertToTile.js +2 -2
- package/lib/Converter/textureConverter.d.ts +4 -0
- package/lib/Core/3DTiles/C3DTBatchTable.d.ts +49 -0
- package/lib/Core/3DTiles/C3DTBatchTableHierarchyExtension.d.ts +37 -0
- package/lib/Core/3DTiles/C3DTBoundingVolume.d.ts +39 -0
- package/lib/Core/3DTiles/C3DTExtensions.d.ts +75 -0
- package/lib/Core/3DTiles/C3DTFeature.d.ts +47 -0
- package/lib/Core/3DTiles/C3DTilesEnums.d.ts +14 -0
- package/lib/Core/3DTiles/C3DTileset.d.ts +46 -0
- package/lib/Core/3DTiles/utils/BinaryPropertyAccessor.d.ts +14 -0
- package/lib/Core/AnimationPlayer.d.ts +53 -0
- package/lib/Core/CopcNode.d.ts +68 -0
- package/lib/Core/CopcNode.js +57 -74
- package/lib/Core/Deprecated/Undeprecator.d.ts +6 -0
- package/lib/Core/EntwinePointTileNode.d.ts +59 -0
- package/lib/Core/EntwinePointTileNode.js +16 -41
- package/lib/Core/Feature.d.ts +323 -0
- package/lib/Core/Geographic/GeoidGrid.d.ts +86 -0
- package/lib/Core/Label.d.ts +86 -0
- package/lib/Core/MainLoop.d.ts +23 -0
- package/lib/Core/Picking.d.ts +6 -0
- package/lib/Core/Picking.js +4 -0
- package/lib/Core/PointCloudNode.d.ts +16 -0
- package/lib/Core/PointCloudNode.js +34 -4
- package/lib/Core/Potree2Node.d.ts +11 -0
- package/lib/Core/Potree2Node.js +5 -60
- package/lib/Core/Potree2PointAttributes.d.ts +97 -0
- package/lib/Core/PotreeNode.d.ts +14 -0
- package/lib/Core/PotreeNode.js +28 -18
- package/lib/Core/Prefab/Globe/Atmosphere.d.ts +66 -0
- package/lib/Core/Prefab/Globe/Atmosphere.js +10 -5
- package/lib/Core/Prefab/Globe/GlobeLayer.d.ts +48 -0
- package/lib/Core/Prefab/Globe/GlobeTileBuilder.d.ts +38 -0
- package/lib/Core/Prefab/Globe/SkyShader.d.ts +5 -0
- package/lib/Core/Prefab/Globe/SkyShader.js +3 -3
- package/lib/Core/Prefab/GlobeView.d.ts +65 -0
- package/lib/Core/Prefab/GlobeView.js +9 -0
- package/lib/Core/Prefab/Planar/PlanarLayer.d.ts +38 -0
- package/lib/Core/Prefab/Planar/PlanarTileBuilder.d.ts +32 -0
- package/lib/Core/Prefab/PlanarView.d.ts +33 -0
- package/lib/Core/Prefab/TileBuilder.d.ts +63 -0
- package/lib/Core/Prefab/computeBufferTileGeometry.d.ts +17 -0
- package/lib/Core/Scheduler/Cache.d.ts +25 -0
- package/lib/Core/Scheduler/CancelledCommandException.d.ts +12 -0
- package/lib/Core/Scheduler/Scheduler.d.ts +106 -0
- package/lib/Core/Style.d.ts +248 -0
- package/lib/Core/StyleOptions.d.ts +455 -0
- package/lib/Core/System/Capabilities.d.ts +9 -0
- package/lib/Core/Tile/Tile.d.ts +70 -0
- package/lib/Core/Tile/TileGrid.d.ts +12 -0
- package/lib/Core/TileGeometry.d.ts +46 -0
- package/lib/Core/TileMesh.d.ts +50 -0
- package/lib/Core/TileMesh.js +2 -4
- package/lib/Core/View.d.ts +403 -0
- package/lib/Core/View.js +1 -7
- package/lib/Layer/C3DTilesLayer.d.ts +140 -0
- package/lib/Layer/ColorLayer.d.ts +128 -0
- package/lib/Layer/ColorLayer.js +4 -4
- package/lib/Layer/CopcLayer.d.ts +42 -0
- package/lib/Layer/CopcLayer.js +3 -6
- package/lib/Layer/ElevationLayer.d.ts +96 -0
- package/lib/Layer/ElevationLayer.js +3 -3
- package/lib/Layer/EntwinePointTileLayer.d.ts +56 -0
- package/lib/Layer/EntwinePointTileLayer.js +4 -3
- package/lib/Layer/FeatureGeometryLayer.d.ts +62 -0
- package/lib/Layer/GeoidLayer.d.ts +41 -0
- package/lib/Layer/GeometryLayer.d.ts +120 -0
- package/lib/Layer/InfoLayer.d.ts +24 -0
- package/lib/Layer/InfoLayer.js +1 -1
- package/lib/Layer/LabelLayer.d.ts +93 -0
- package/lib/Layer/LabelLayer.js +2 -2
- package/lib/Layer/Layer.d.ts +185 -0
- package/lib/Layer/LayerUpdateState.d.ts +24 -0
- package/lib/Layer/LayerUpdateStrategy.d.ts +11 -0
- package/lib/Layer/LayerUpdateStrategy.js +2 -7
- package/lib/Layer/OGC3DTilesLayer.d.ts +277 -0
- package/lib/Layer/OGC3DTilesLayer.js +21 -0
- package/lib/Layer/OrientedImageLayer.d.ts +53 -0
- package/lib/Layer/PointCloudLayer.d.ts +103 -0
- package/lib/Layer/PointCloudLayer.js +8 -11
- package/lib/Layer/Potree2Layer.d.ts +56 -0
- package/lib/Layer/Potree2Layer.js +0 -2
- package/lib/Layer/PotreeLayer.d.ts +55 -0
- package/lib/Layer/RasterLayer.d.ts +8 -0
- package/lib/Layer/RasterLayer.js +2 -2
- package/lib/Layer/ReferencingLayerProperties.d.ts +2 -0
- package/lib/Layer/ReferencingLayerProperties.js +0 -12
- package/lib/Layer/TiledGeometryLayer.d.ts +192 -0
- package/lib/Layer/TiledGeometryLayer.js +4 -3
- package/lib/Main.d.ts +89 -0
- package/lib/Main.js +3 -1
- package/lib/Parser/B3dmParser.d.ts +26 -0
- package/lib/Parser/CameraCalibrationParser.d.ts +32 -0
- package/lib/Parser/GDFParser.d.ts +24 -0
- package/lib/Parser/GTXParser.d.ts +28 -0
- package/lib/Parser/GeoJsonParser.d.ts +12 -0
- package/lib/Parser/GpxParser.d.ts +12 -0
- package/lib/Parser/ISGParser.d.ts +23 -0
- package/lib/Parser/KMLParser.d.ts +12 -0
- package/lib/Parser/LASParser.d.ts +61 -0
- package/lib/Parser/MapBoxUrlParser.d.ts +9 -0
- package/lib/Parser/PntsParser.d.ts +4 -0
- package/lib/Parser/Potree2BinParser.d.ts +8 -0
- package/lib/Parser/PotreeBinParser.d.ts +4 -0
- package/lib/Parser/PotreeCinParser.d.ts +4 -0
- package/lib/Parser/ShapefileParser.d.ts +25 -0
- package/lib/Parser/VectorTileParser.d.ts +34 -0
- package/lib/Parser/XbilParser.d.ts +18 -0
- package/lib/Parser/deprecated/LegacyGLTFLoader.d.ts +32 -0
- package/lib/Parser/iGLTFLoader.d.ts +104 -0
- package/lib/Process/3dTilesProcessing.d.ts +43 -0
- package/lib/Process/FeatureProcessing.d.ts +4 -0
- package/lib/Process/LayeredMaterialNodeProcessing.d.ts +3 -0
- package/lib/Process/LayeredMaterialNodeProcessing.js +12 -12
- package/lib/Process/ObjectRemovalHelper.d.ts +32 -0
- package/lib/Process/handlerNodeError.d.ts +1 -0
- package/lib/Provider/3dTilesProvider.d.ts +7 -0
- package/lib/Provider/DataSourceProvider.d.ts +4 -0
- package/lib/Provider/Fetcher.d.ts +101 -0
- package/lib/Provider/PointCloudProvider.d.ts +4 -0
- package/lib/Provider/TileProvider.d.ts +4 -0
- package/lib/Provider/URLBuilder.d.ts +28 -0
- package/lib/Renderer/Camera.d.ts +95 -0
- package/lib/Renderer/Color.d.ts +3 -0
- package/lib/Renderer/ColorLayersOrdering.d.ts +38 -0
- package/lib/Renderer/ColorLayersOrdering.js +2 -2
- package/lib/Renderer/CommonMaterial.d.ts +6 -0
- package/lib/Renderer/Label2DRenderer.d.ts +31 -0
- package/lib/Renderer/LayeredMaterial.d.ts +121 -0
- package/lib/Renderer/LayeredMaterial.js +221 -141
- package/lib/Renderer/OBB.d.ts +65 -0
- package/lib/Renderer/OrientedImageCamera.d.ts +36 -0
- package/lib/Renderer/OrientedImageMaterial.d.ts +68 -0
- package/lib/Renderer/PointsMaterial.d.ts +226 -0
- package/lib/Renderer/PointsMaterial.js +60 -22
- package/lib/Renderer/RasterTile.d.ts +53 -0
- package/lib/Renderer/RasterTile.js +8 -9
- package/lib/Renderer/RenderMode.d.ts +11 -0
- package/lib/Renderer/RenderMode.js +1 -0
- package/lib/Renderer/Shader/ShaderChunk.d.ts +78 -0
- package/lib/Renderer/Shader/ShaderUtils.d.ts +5 -0
- package/lib/Renderer/WebXR.d.ts +33 -0
- package/lib/Renderer/WebXR.js +128 -47
- package/lib/Renderer/c3DEngine.d.ts +55 -0
- package/lib/Renderer/c3DEngine.js +5 -1
- package/lib/Source/C3DTilesGoogleSource.d.ts +38 -0
- package/lib/Source/C3DTilesIonSource.d.ts +31 -0
- package/lib/Source/C3DTilesSource.d.ts +17 -0
- package/lib/Source/CopcSource.d.ts +79 -0
- package/lib/Source/EntwinePointTileSource.d.ts +40 -0
- package/lib/Source/EntwinePointTileSource.js +0 -5
- package/lib/Source/FileSource.d.ts +118 -0
- package/lib/Source/OGC3DTilesGoogleSource.d.ts +24 -0
- package/lib/Source/OGC3DTilesIonSource.d.ts +26 -0
- package/lib/Source/OGC3DTilesSource.d.ts +21 -0
- package/lib/Source/OrientedImageSource.d.ts +48 -0
- package/lib/Source/Potree2Source.d.ts +157 -0
- package/lib/Source/PotreeSource.d.ts +69 -0
- package/lib/Source/Source.d.ts +122 -0
- package/lib/Source/TMSSource.d.ts +77 -0
- package/lib/Source/VectorTilesSource.d.ts +56 -0
- package/lib/Source/WFSSource.d.ts +110 -0
- package/lib/Source/WMSSource.d.ts +85 -0
- package/lib/Source/WMTSSource.d.ts +65 -0
- package/lib/ThreeExtended/capabilities/WebGL.d.ts +9 -0
- package/lib/ThreeExtended/libs/ktx-parse.module.d.ts +274 -0
- package/lib/ThreeExtended/libs/motion-controllers.module.d.ts +64 -0
- package/lib/ThreeExtended/libs/motion-controllers.module.js +375 -0
- package/lib/ThreeExtended/libs/zstddec.module.d.ts +6 -0
- package/lib/ThreeExtended/loaders/DDSLoader.js +40 -1
- package/lib/ThreeExtended/loaders/DRACOLoader.d.ts +41 -0
- package/lib/ThreeExtended/loaders/GLTFLoader.d.ts +16 -0
- package/lib/ThreeExtended/loaders/GLTFLoader.js +22 -3
- package/lib/ThreeExtended/loaders/KTX2Loader.d.ts +116 -0
- package/lib/ThreeExtended/loaders/KTX2Loader.js +9 -2
- package/lib/ThreeExtended/math/ColorSpaces.d.ts +56 -0
- package/lib/ThreeExtended/utils/BufferGeometryUtils.d.ts +62 -0
- package/lib/ThreeExtended/utils/BufferGeometryUtils.js +2 -2
- package/lib/ThreeExtended/utils/WorkerPool.d.ts +19 -0
- package/lib/ThreeExtended/webxr/XRControllerModelFactory.d.ts +25 -0
- package/lib/ThreeExtended/webxr/XRControllerModelFactory.js +209 -0
- package/lib/Utils/CameraUtils.d.ts +132 -0
- package/lib/Utils/DEMUtils.d.ts +84 -0
- package/lib/Utils/DEMUtils.js +2 -2
- package/lib/Utils/FeaturesUtils.d.ts +17 -0
- package/lib/Utils/Gradients.d.ts +13 -0
- package/lib/Utils/ThreeUtils.d.ts +14 -0
- package/lib/Utils/placeObjectOnGround.d.ts +28 -0
- package/lib/global.d.js +0 -0
- package/package.json +18 -15
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
export namespace keys {
|
|
2
|
+
let CTRL: number;
|
|
3
|
+
let SPACE: number;
|
|
4
|
+
let T: number;
|
|
5
|
+
let Y: number;
|
|
6
|
+
}
|
|
7
|
+
export namespace STATE {
|
|
8
|
+
let NONE: number;
|
|
9
|
+
let DRAG: number;
|
|
10
|
+
let PAN: number;
|
|
11
|
+
let ROTATE: number;
|
|
12
|
+
let TRAVEL: number;
|
|
13
|
+
let ORTHO_ZOOM: number;
|
|
14
|
+
}
|
|
15
|
+
export namespace PLANAR_CONTROL_EVENT {
|
|
16
|
+
let MOVED: string;
|
|
17
|
+
}
|
|
18
|
+
export default PlanarControls;
|
|
19
|
+
/**
|
|
20
|
+
* Planar controls is a camera controller adapted for a planar view, with animated movements.
|
|
21
|
+
* Usage is as follow :
|
|
22
|
+
* <ul>
|
|
23
|
+
* <li><b>Left mouse button:</b> drag the camera (translation on the (xy) world plane).</li>
|
|
24
|
+
* <li><b>Right mouse button:</b> pan the camera (translation on the vertical (z) axis of the world plane).</li>
|
|
25
|
+
* <li><b>CTRL + Left mouse button:</b> rotate the camera around the focus point.</li>
|
|
26
|
+
* <li><b>Wheel scrolling:</b> zoom toward the cursor position.</li>
|
|
27
|
+
* <li><b>Wheel clicking:</b> smart zoom toward the cursor position (animated).</li>
|
|
28
|
+
* <li><b>Y key:</b> go to the starting view (animated).</li>
|
|
29
|
+
* <li><b>T key:</b> go to the top view (animated).</li>
|
|
30
|
+
* </ul>
|
|
31
|
+
*
|
|
32
|
+
* @class PlanarControls
|
|
33
|
+
* @param {PlanarView} view the view where the controls will be used
|
|
34
|
+
* @param {object} options
|
|
35
|
+
* @param {boolean} [options.enabled=true] Set to false to disable this control
|
|
36
|
+
* @param {boolean} [options.enableRotation=true] Enable the rotation with the `CTRL + Left mouse button`
|
|
37
|
+
* and in animations, like the smart zoom.
|
|
38
|
+
* @param {boolean} [options.enableSmartTravel=true] Enable smart travel with the `wheel-click / space-bar`.
|
|
39
|
+
* @param {boolean} [options.enablePan=true] Enable pan movements with the `right-click`.
|
|
40
|
+
* @param {number} [options.rotateSpeed=2.0] Rotate speed.
|
|
41
|
+
* @param {number} [options.maxPanSpeed=15] Pan speed when close to maxAltitude.
|
|
42
|
+
* @param {number} [options.minPanSpeed=0.05] Pan speed when close to the ground.
|
|
43
|
+
* @param {number} [options.zoomTravelTime=0.2] Animation time when zooming.
|
|
44
|
+
* @param {number} [options.zoomFactor=2] The factor the scale is multiplied by when zooming
|
|
45
|
+
* in and divided by when zooming out. This factor can't be null.
|
|
46
|
+
* @param {number} [options.maxResolution=0] The smallest size in meters a pixel at the center of the
|
|
47
|
+
* view can represent.
|
|
48
|
+
* @param {number} [options.minResolution=Infinity] The biggest size in meters a pixel at the center of the
|
|
49
|
+
* view can represent.
|
|
50
|
+
* @param {number} [options.maxAltitude=12000] Maximum altitude reachable when panning or zooming out.
|
|
51
|
+
* @param {number} [options.groundLevel=200] Minimum altitude reachable when panning.
|
|
52
|
+
* @param {number} [options.autoTravelTimeMin=1.5] Minimum duration for animated travels with the `auto`
|
|
53
|
+
* parameter.
|
|
54
|
+
* @param {number} [options.autoTravelTimeMax=4] Maximum duration for animated travels with the `auto`
|
|
55
|
+
* parameter.
|
|
56
|
+
* @param {number} [options.autoTravelTimeDist=20000] Maximum travel distance for animated travel with the
|
|
57
|
+
* `auto` parameter.
|
|
58
|
+
* @param {number} [options.smartTravelHeightMin=75] Minimum height above ground reachable after a smart
|
|
59
|
+
* travel.
|
|
60
|
+
* @param {number} [options.smartTravelHeightMax=500] Maximum height above ground reachable after a smart
|
|
61
|
+
* travel.
|
|
62
|
+
* @param {boolean} [options.instantTravel=false] If set to true, animated travels will have no duration.
|
|
63
|
+
* @param {number} [options.minZenithAngle=0] The minimum reachable zenith angle for a camera
|
|
64
|
+
* rotation, in degrees.
|
|
65
|
+
* @param {number} [options.maxZenithAngle=82.5] The maximum reachable zenith angle for a camera
|
|
66
|
+
* rotation, in degrees.
|
|
67
|
+
* @param {boolean} [options.handleCollision=true]
|
|
68
|
+
*/
|
|
69
|
+
declare class PlanarControls extends THREE.EventDispatcher<any> {
|
|
70
|
+
constructor(view: any, options?: {});
|
|
71
|
+
view: any;
|
|
72
|
+
camera: any;
|
|
73
|
+
enabled: any;
|
|
74
|
+
enableRotation: any;
|
|
75
|
+
enablePan: any;
|
|
76
|
+
maxAltitude: any;
|
|
77
|
+
zoomTravelTime: any;
|
|
78
|
+
rotateSpeed: any;
|
|
79
|
+
minPanSpeed: any;
|
|
80
|
+
maxPanSpeed: any;
|
|
81
|
+
zoomInFactor: any;
|
|
82
|
+
zoomOutFactor: number;
|
|
83
|
+
maxResolution: any;
|
|
84
|
+
minResolution: any;
|
|
85
|
+
groundLevel: any;
|
|
86
|
+
autoTravelTimeMin: any;
|
|
87
|
+
autoTravelTimeMax: any;
|
|
88
|
+
autoTravelTimeDist: any;
|
|
89
|
+
smartTravelHeightMin: any;
|
|
90
|
+
smartTravelHeightMax: any;
|
|
91
|
+
instantTravel: any;
|
|
92
|
+
minZenithAngle: number;
|
|
93
|
+
maxZenithAngle: number;
|
|
94
|
+
handleCollision: any;
|
|
95
|
+
minDistanceCollision: number;
|
|
96
|
+
enableSmartTravel: any;
|
|
97
|
+
state: number;
|
|
98
|
+
cursor: {
|
|
99
|
+
default: string;
|
|
100
|
+
drag: string;
|
|
101
|
+
pan: string;
|
|
102
|
+
travel: string;
|
|
103
|
+
rotate: string;
|
|
104
|
+
ortho_zoom: string;
|
|
105
|
+
};
|
|
106
|
+
_handlerOnKeyDown: (event: Event) => void;
|
|
107
|
+
_handlerOnMouseDown: (event: Event) => void;
|
|
108
|
+
_handlerOnMouseUp: (event: Event) => void;
|
|
109
|
+
_handlerOnMouseMove: (event: Event) => void;
|
|
110
|
+
_handlerOnMouseWheel: (event: Event) => void;
|
|
111
|
+
_handlerContextMenu: (event: Event) => void;
|
|
112
|
+
_handlerUpdate: (dt: number, updateLoopRestarted: boolean) => void;
|
|
113
|
+
dispose(): void;
|
|
114
|
+
/**
|
|
115
|
+
* update the view and camera if needed, and handles the animated travel
|
|
116
|
+
* @param {number} dt the delta time between two updates in millisecond
|
|
117
|
+
* @param {boolean} updateLoopRestarted true if we just started rendering
|
|
118
|
+
* @ignore
|
|
119
|
+
*/
|
|
120
|
+
update(dt: number, updateLoopRestarted: boolean): void;
|
|
121
|
+
/**
|
|
122
|
+
* Initiate a drag movement (translation on (xy) plane). The movement value is derived from the actual world
|
|
123
|
+
* point under the mouse cursor. This allows user to 'grab' a world point and drag it to move.
|
|
124
|
+
*
|
|
125
|
+
* @ignore
|
|
126
|
+
*/
|
|
127
|
+
initiateDrag(): void;
|
|
128
|
+
/**
|
|
129
|
+
* Handle the drag movement (translation on (xy) plane) when user moves the mouse while in STATE.DRAG. The
|
|
130
|
+
* drag movement is previously initiated by [initiateDrag]{@link PlanarControls#initiateDrag}. Compute the
|
|
131
|
+
* drag value and update the camera controls. The movement value is derived from the actual world point under
|
|
132
|
+
* the mouse cursor. This allows the user to 'grab' a world point and drag it to move.
|
|
133
|
+
*
|
|
134
|
+
* @ignore
|
|
135
|
+
*/
|
|
136
|
+
handleDragMovement(): void;
|
|
137
|
+
/**
|
|
138
|
+
* Initiate a pan movement (local translation on (xz) plane).
|
|
139
|
+
*
|
|
140
|
+
* @ignore
|
|
141
|
+
*/
|
|
142
|
+
initiatePan(): void;
|
|
143
|
+
/**
|
|
144
|
+
* Handle the pan movement (translation on local x / world z plane) when user moves the mouse while
|
|
145
|
+
* STATE.PAN. The drag movement is previously initiated by [initiatePan]{@link PlanarControls#initiatePan}.
|
|
146
|
+
* Compute the pan value and update the camera controls.
|
|
147
|
+
*
|
|
148
|
+
* @ignore
|
|
149
|
+
*/
|
|
150
|
+
handlePanMovement(): void;
|
|
151
|
+
/**
|
|
152
|
+
* Initiate a rotate (orbit) movement.
|
|
153
|
+
*
|
|
154
|
+
* @ignore
|
|
155
|
+
*/
|
|
156
|
+
initiateRotation(): void;
|
|
157
|
+
/**
|
|
158
|
+
* Handle the rotate movement (orbit) when user moves the mouse while in STATE.ROTATE. The movement is an
|
|
159
|
+
* orbit around `centerPoint`, the camera focus point (ground point at screen center). The rotate movement
|
|
160
|
+
* is previously initiated in [initiateRotation]{@link PlanarControls#initiateRotation}.
|
|
161
|
+
* Compute the new position value and update the camera controls.
|
|
162
|
+
*
|
|
163
|
+
* @ignore
|
|
164
|
+
*/
|
|
165
|
+
handleRotation(): void;
|
|
166
|
+
/**
|
|
167
|
+
* Triggers a Zoom animated movement (travel) toward / away from the world point under the mouse cursor. The
|
|
168
|
+
* zoom intensity varies according to the distance between the camera and the point. The closer to the ground,
|
|
169
|
+
* the lower the intensity. Orientation will not change (null parameter in the call to
|
|
170
|
+
* [initiateTravel]{@link PlanarControls#initiateTravel} function).
|
|
171
|
+
*
|
|
172
|
+
* @param {Event} event the mouse wheel event.
|
|
173
|
+
* @ignore
|
|
174
|
+
*/
|
|
175
|
+
initiateZoom(event: Event): void;
|
|
176
|
+
/**
|
|
177
|
+
* Handle the animated zoom change for an orthographic camera, when state is `ZOOM`.
|
|
178
|
+
*
|
|
179
|
+
* @param {number} dt the delta time between two updates in milliseconds
|
|
180
|
+
* @ignore
|
|
181
|
+
*/
|
|
182
|
+
handleZoomOrtho(dt: number): void;
|
|
183
|
+
/**
|
|
184
|
+
* Triggers a 'smart zoom' animated movement (travel) toward the point under mouse cursor. The camera will be
|
|
185
|
+
* smoothly moved and oriented close to the target, at a determined height and distance.
|
|
186
|
+
*
|
|
187
|
+
* @ignore
|
|
188
|
+
*/
|
|
189
|
+
initiateSmartTravel(): void;
|
|
190
|
+
/**
|
|
191
|
+
* Triggers an animated movement and rotation for the camera.
|
|
192
|
+
*
|
|
193
|
+
* @param {THREE.Vector3} targetPos The target position of the camera (reached at the end).
|
|
194
|
+
* @param {number|string} travelTime Set to `auto` or set to a duration in seconds. If set to `auto`,
|
|
195
|
+
* travel time will be set to a duration between `autoTravelTimeMin` and `autoTravelTimeMax` according to
|
|
196
|
+
* the distance and the angular difference between start and finish.
|
|
197
|
+
* @param {(string|THREE.Vector3|THREE.Quaternion)} targetOrientation define the target rotation of
|
|
198
|
+
* the camera :
|
|
199
|
+
* <ul>
|
|
200
|
+
* <li>if targetOrientation is a world point (Vector3) : the camera will lookAt() this point</li>
|
|
201
|
+
* <li>if targetOrientation is a quaternion : this quaternion will define the final camera orientation </li>
|
|
202
|
+
* <li>if targetOrientation is neither a world point nor a quaternion : the camera will keep its starting
|
|
203
|
+
* orientation</li>
|
|
204
|
+
* </ul>
|
|
205
|
+
* @param {boolean} useSmooth animation is smoothed using the `smooth(value)` function (slower
|
|
206
|
+
* at start and finish).
|
|
207
|
+
*
|
|
208
|
+
* @ignore
|
|
209
|
+
*/
|
|
210
|
+
initiateTravel(targetPos: THREE.Vector3, travelTime: number | string, targetOrientation: (string | THREE.Vector3 | THREE.Quaternion), useSmooth: boolean): void;
|
|
211
|
+
/**
|
|
212
|
+
* Handle the animated movement and rotation of the camera in `travel` state.
|
|
213
|
+
*
|
|
214
|
+
* @param {number} dt the delta time between two updates in milliseconds
|
|
215
|
+
* @ignore
|
|
216
|
+
*/
|
|
217
|
+
handleTravel(dt: number): void;
|
|
218
|
+
/**
|
|
219
|
+
* Test if the currently running animation is finished (travelAlpha reached 1).
|
|
220
|
+
* If it is, reset controls to state NONE.
|
|
221
|
+
*
|
|
222
|
+
* @ignore
|
|
223
|
+
*/
|
|
224
|
+
testAnimationEnd(): void;
|
|
225
|
+
/**
|
|
226
|
+
* Triggers an animated movement (travel) to set the camera to top view, above the focus point,
|
|
227
|
+
* at altitude = distanceToFocusPoint.
|
|
228
|
+
*
|
|
229
|
+
* @ignore
|
|
230
|
+
*/
|
|
231
|
+
goToTopView(): void;
|
|
232
|
+
/**
|
|
233
|
+
* Triggers an animated movement (travel) to set the camera to starting view
|
|
234
|
+
*
|
|
235
|
+
* @ignore
|
|
236
|
+
*/
|
|
237
|
+
goToStartView(): void;
|
|
238
|
+
/**
|
|
239
|
+
* Returns the world point (xyz) under the posXY screen point. The point belong to an abstract mathematical
|
|
240
|
+
* plane of specified altitude (does not us actual geometry).
|
|
241
|
+
*
|
|
242
|
+
* @param {THREE.Vector2} posXY the mouse position in screen space (unit : pixel)
|
|
243
|
+
* @param {number} altitude the altitude (z) of the mathematical plane
|
|
244
|
+
* @param {THREE.Vector3} target the target vector3
|
|
245
|
+
* @return {THREE.Vector3}
|
|
246
|
+
* @ignore
|
|
247
|
+
*/
|
|
248
|
+
getWorldPointFromMathPlaneAtScreenXY(posXY: THREE.Vector2, altitude: number, target?: THREE.Vector3): THREE.Vector3;
|
|
249
|
+
/**
|
|
250
|
+
* Returns the world point (xyz) under the posXY screen point. If geometry is under the cursor, the point is
|
|
251
|
+
* obtained with getPickingPositionFromDepth. If no geometry is under the cursor, the point is obtained with
|
|
252
|
+
* [getWorldPointFromMathPlaneAtScreenXY]{@link PlanarControls#getWorldPointFromMathPlaneAtScreenXY}.
|
|
253
|
+
*
|
|
254
|
+
* @param {THREE.Vector2} posXY the mouse position in screen space (unit : pixel)
|
|
255
|
+
* @param {THREE.Vector3} target the target World coordinates.
|
|
256
|
+
* @return {THREE.Vector3}
|
|
257
|
+
* @ignore
|
|
258
|
+
*/
|
|
259
|
+
getWorldPointAtScreenXY(posXY: THREE.Vector2, target?: THREE.Vector3): THREE.Vector3;
|
|
260
|
+
/**
|
|
261
|
+
* Add all the input event listeners (activate the controls).
|
|
262
|
+
*
|
|
263
|
+
* @ignore
|
|
264
|
+
*/
|
|
265
|
+
addInputListeners(): void;
|
|
266
|
+
/**
|
|
267
|
+
* Removes all the input listeners (deactivate the controls).
|
|
268
|
+
*
|
|
269
|
+
* @ignore
|
|
270
|
+
*/
|
|
271
|
+
removeInputListeners(): void;
|
|
272
|
+
/**
|
|
273
|
+
* Update the cursor image according to the control state.
|
|
274
|
+
*
|
|
275
|
+
* @ignore
|
|
276
|
+
*/
|
|
277
|
+
updateMouseCursorType(): void;
|
|
278
|
+
updateMousePositionAndDelta(event: any): void;
|
|
279
|
+
/**
|
|
280
|
+
* cursor modification for a specifique state.
|
|
281
|
+
*
|
|
282
|
+
* @param {string} state the state in which we want to change the cursor ('default', 'drag', 'pan', 'travel', 'rotate').
|
|
283
|
+
* @param {string} newCursor the css cursor we want to have for the specified state.
|
|
284
|
+
* @ignore
|
|
285
|
+
*/
|
|
286
|
+
setCursor(state: string, newCursor: string): void;
|
|
287
|
+
/**
|
|
288
|
+
* Catch and manage the event when a touch on the mouse is downs.
|
|
289
|
+
*
|
|
290
|
+
* @param {Event} event the current event (mouse left or right button clicked, mouse wheel button actioned).
|
|
291
|
+
* @ignore
|
|
292
|
+
*/
|
|
293
|
+
onMouseDown(event: Event): void;
|
|
294
|
+
/**
|
|
295
|
+
* Catch and manage the event when a touch on the mouse is released.
|
|
296
|
+
*
|
|
297
|
+
* @param {Event} event the current event
|
|
298
|
+
* @ignore
|
|
299
|
+
*/
|
|
300
|
+
onMouseUp(event: Event): void;
|
|
301
|
+
/**
|
|
302
|
+
* Catch and manage the event when the mouse is moved.
|
|
303
|
+
*
|
|
304
|
+
* @param {Event} event the current event.
|
|
305
|
+
* @ignore
|
|
306
|
+
*/
|
|
307
|
+
onMouseMove(event: Event): void;
|
|
308
|
+
/**
|
|
309
|
+
* Catch and manage the event when a key is down.
|
|
310
|
+
*
|
|
311
|
+
* @param {Event} event the current event
|
|
312
|
+
* @ignore
|
|
313
|
+
*/
|
|
314
|
+
onKeyDown(event: Event): void;
|
|
315
|
+
/**
|
|
316
|
+
* Catch and manage the event when the mouse wheel is rolled.
|
|
317
|
+
*
|
|
318
|
+
* @param {Event} event the current event
|
|
319
|
+
* @ignore
|
|
320
|
+
*/
|
|
321
|
+
onMouseWheel(event: Event): void;
|
|
322
|
+
/**
|
|
323
|
+
* Catch and manage the event when the context menu is called (by a right-click on the window). We use this
|
|
324
|
+
* to prevent the context menu from appearing so we can use right click for other inputs.
|
|
325
|
+
*
|
|
326
|
+
* @param {Event} event the current event
|
|
327
|
+
* @ignore
|
|
328
|
+
*/
|
|
329
|
+
onContextMenu(event: Event): void;
|
|
330
|
+
/**
|
|
331
|
+
* Smoothing function (sigmoid) : based on h01 Hermite function.
|
|
332
|
+
*
|
|
333
|
+
* @param {number} value the value to be smoothed, between 0 and 1.
|
|
334
|
+
* @return {number} a value between 0 and 1.
|
|
335
|
+
* @ignore
|
|
336
|
+
*/
|
|
337
|
+
smooth(value: number): number;
|
|
338
|
+
}
|
|
339
|
+
import * as THREE from 'three';
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
export default StateControl;
|
|
2
|
+
/**
|
|
3
|
+
* ~State
|
|
4
|
+
*/
|
|
5
|
+
export type StateControl = {
|
|
6
|
+
/**
|
|
7
|
+
* =true Indicate whether the state is enabled or not.
|
|
8
|
+
*/
|
|
9
|
+
enable: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The mouse button bound to this state.
|
|
12
|
+
*/
|
|
13
|
+
mouseButton?: number | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* The keyCode of the keyboard input bound to this state.
|
|
16
|
+
*/
|
|
17
|
+
keyboard?: number | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The number of fingers on the pad bound to this state.
|
|
20
|
+
*/
|
|
21
|
+
finger?: number | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* True if the mouse button bound to this state must be pressed twice. For
|
|
24
|
+
* * example, if `double` is set to true with a `mouseButton` set to left click,
|
|
25
|
+
* * the State will be bound to a double click mouse button.
|
|
26
|
+
*/
|
|
27
|
+
double?: boolean | undefined;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* @typedef {Object} StateControl~State
|
|
31
|
+
* @property {boolean} enable=true Indicate whether the state is enabled or not.
|
|
32
|
+
* @property {Number} [mouseButton] The mouse button bound to this state.
|
|
33
|
+
* @property {Number} [keyboard] The keyCode of the keyboard input bound to this state.
|
|
34
|
+
* @property {Number} [finger] The number of fingers on the pad bound to this state.
|
|
35
|
+
* @property {boolean} [double] True if the mouse button bound to this state must be pressed twice. For
|
|
36
|
+
* example, if `double` is set to true with a `mouseButton` set to left click,
|
|
37
|
+
* the State will be bound to a double click mouse button.
|
|
38
|
+
*/
|
|
39
|
+
/**
|
|
40
|
+
* It represents the control's states.
|
|
41
|
+
* Each {@link State} is a control mode of the camera and how to interact with
|
|
42
|
+
* the interface to activate this mode.
|
|
43
|
+
* @class StateControl
|
|
44
|
+
*
|
|
45
|
+
* @property {State} NONE {@link State} when camera is idle.
|
|
46
|
+
* @property {State} ORBIT {@link State} describing camera orbiting movement : the camera moves around its
|
|
47
|
+
* target at a constant distance from it.
|
|
48
|
+
* @property {State} DOLLY {@link State} describing camera dolly movement : the camera moves forward or
|
|
49
|
+
* backward from its target.
|
|
50
|
+
* @property {State} PAN {@link State} describing camera pan movement : the camera moves parallel to the
|
|
51
|
+
* current view plane.
|
|
52
|
+
* @property {State} MOVE_GLOBE {@link State} describing camera drag movement : the camera is moved around the view
|
|
53
|
+
* to give the feeling that the view is dragged under a static camera.
|
|
54
|
+
* @property {State} PANORAMIC {@link State} describing camera panoramic movement : the camera is rotated around
|
|
55
|
+
* its own position.
|
|
56
|
+
* @property {State} TRAVEL_IN {@link State} describing camera travel in movement : the camera is zoomed in toward
|
|
57
|
+
* a given position. The target position depends on the key/mouse binding of this
|
|
58
|
+
* state. If bound to a mouse button, the target position is the mouse position.
|
|
59
|
+
* Otherwise, it is the center of the screen.
|
|
60
|
+
* @property {State} TRAVEL_OUT {@link State} describing camera travel out movement : the camera is zoomed out from
|
|
61
|
+
* a given position. The target position depends on the key/mouse binding of this
|
|
62
|
+
* state. If bound to a mouse button, the target position is the mouse position.
|
|
63
|
+
* Otherwise, it is the center of the screen. It is disabled by default.
|
|
64
|
+
* @property {State} ZOOM {@link State} describing camera zoom in and out movement.
|
|
65
|
+
* @property {boolean} enable Defines whether all input will be communicated to the associated `Controls` or not.
|
|
66
|
+
* Default is true.
|
|
67
|
+
* @property {boolean} enableKeys Defines whether keyboard input will be communicated to the associated `Controls` or
|
|
68
|
+
* not. Default is true.
|
|
69
|
+
*/
|
|
70
|
+
declare class StateControl extends THREE.EventDispatcher<any> {
|
|
71
|
+
constructor(view: any, options?: {});
|
|
72
|
+
_view: any;
|
|
73
|
+
_domElement: any;
|
|
74
|
+
NONE: {};
|
|
75
|
+
_clickTimeStamp: number;
|
|
76
|
+
_lastMousePressed: {
|
|
77
|
+
viewCoords: THREE.Vector2;
|
|
78
|
+
};
|
|
79
|
+
_currentMousePressed: any;
|
|
80
|
+
_currentKeyPressed: any;
|
|
81
|
+
_onPointerDown: (event: any) => void;
|
|
82
|
+
_onPointerMove: (event: any) => void;
|
|
83
|
+
_onPointerUp: () => void;
|
|
84
|
+
_onMouseWheel: (event: any) => void;
|
|
85
|
+
_onKeyDown: (event: any) => void;
|
|
86
|
+
_onKeyUp: () => void;
|
|
87
|
+
_onBlur: () => void;
|
|
88
|
+
_onContextMenu: (event: any) => void;
|
|
89
|
+
/**
|
|
90
|
+
* get the state corresponding to the mouse button and the keyboard key. If the input relates to a trigger - a
|
|
91
|
+
* single event which triggers movement, without the move of the mouse for instance -, dispatch a relevant event.
|
|
92
|
+
* @param {Number} mouseButton The mouse button
|
|
93
|
+
* @param {Number} keyboard The keyboard
|
|
94
|
+
* @param {Boolean} [double] Value of the searched state `double` property
|
|
95
|
+
* @return {State} the state corresponding
|
|
96
|
+
*/
|
|
97
|
+
inputToState(mouseButton: number, keyboard: number, double?: boolean): State;
|
|
98
|
+
/**
|
|
99
|
+
* get the state corresponding to the number of finger on the pad
|
|
100
|
+
*
|
|
101
|
+
* @param {Number} finger The number of finger
|
|
102
|
+
* @return {state} the state corresponding
|
|
103
|
+
*/
|
|
104
|
+
touchToState(finger: number): state;
|
|
105
|
+
/**
|
|
106
|
+
* Set the current StateControl {@link State} properties to given values.
|
|
107
|
+
* @param {Object} options Object containing the `State` values to set current `StateControl` properties to.
|
|
108
|
+
* The `enable` property do not necessarily need to be specified. In that case, the
|
|
109
|
+
* previous value of this property will be kept for the new {@link State}.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* // Switch bindings for PAN and MOVE_GLOBE actions, and disabling PANORAMIC movement :
|
|
113
|
+
* view.controls.states.setFromOptions({
|
|
114
|
+
* PAN: {
|
|
115
|
+
* mouseButton: itowns.THREE.MOUSE.LEFT,
|
|
116
|
+
* },
|
|
117
|
+
* MOVE_GLOBE: {
|
|
118
|
+
* mouseButton: itowns.THREE.MOUSE.RIGHT,
|
|
119
|
+
* },
|
|
120
|
+
* PANORAMIC: {
|
|
121
|
+
* enable: false,
|
|
122
|
+
* },
|
|
123
|
+
* };
|
|
124
|
+
*/
|
|
125
|
+
setFromOptions(options: Object): void;
|
|
126
|
+
onPointerDown(event: any): void;
|
|
127
|
+
currentState: any;
|
|
128
|
+
onPointerMove(event: any): void;
|
|
129
|
+
onPointerUp(): void;
|
|
130
|
+
onMouseWheel(event: any): void;
|
|
131
|
+
onKeyDown(event: any): void;
|
|
132
|
+
onKeyUp(): void;
|
|
133
|
+
onBlur(): void;
|
|
134
|
+
onContextMenu(event: any): void;
|
|
135
|
+
/**
|
|
136
|
+
* Remove all event listeners created within this instance of `StateControl`
|
|
137
|
+
*/
|
|
138
|
+
dispose(): void;
|
|
139
|
+
}
|
|
140
|
+
import * as THREE from 'three';
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
export default StreetControls;
|
|
2
|
+
/**
|
|
3
|
+
* Camera controls that can follow a path.
|
|
4
|
+
* It is used to simulate a street view.
|
|
5
|
+
* It stores a currentPosition and nextPosition, and do a camera traveling to go to next position.
|
|
6
|
+
* It also manages picking on the ground and on other object, like building.
|
|
7
|
+
* <ul> It manages 2 surfaces, used as helpers for the end user :
|
|
8
|
+
* <li> a circle is shown when mouse is moving on the ground </li>
|
|
9
|
+
* <li> a rectangle is shown when mouse is moving on other 3d object </li>
|
|
10
|
+
* </ul>
|
|
11
|
+
* <ul>
|
|
12
|
+
* This controls is designed
|
|
13
|
+
* <li> to move forward when user click on the ground (click and go) </li>
|
|
14
|
+
* <li> to rotate the camera when user click on other object (click to look at) </li>
|
|
15
|
+
* </ul>
|
|
16
|
+
* <ul> Bindings inherited from FirstPersonControls
|
|
17
|
+
* <li><b> up + down keys : </b> forward/backward </li>
|
|
18
|
+
* <li><b> left + right keys: </b> strafing movements </li>
|
|
19
|
+
* <li><b> pageUp + pageDown: </b> vertical movements </li>
|
|
20
|
+
* <li><b> mouse click+drag: </b> pitch and yaw movements (as looking at a panorama) </li>
|
|
21
|
+
* </ul>
|
|
22
|
+
* <ul> Bindings added
|
|
23
|
+
* <li><b> keys Z : </b> Move camera to the next position </li>
|
|
24
|
+
* <li><b> keys S : </b> Move camera to the previous position </li>
|
|
25
|
+
* <li><b> keys A : </b> Set camera to current position and look at next position</li>
|
|
26
|
+
* <li><b> keys Q : </b> Set camera to current position and look at previous position</li>
|
|
27
|
+
* </ul>
|
|
28
|
+
* Note that it only works in globe view.
|
|
29
|
+
* @property {number} keyGoToNextPosition key code to go to next position, default to 90 for key Z
|
|
30
|
+
* @property {number} keyGoToPreviousPosition key code to go to previous position, default to 83 for key S
|
|
31
|
+
* @property {number} keySetCameraToCurrentPositionAndLookAtNext key code set camera to current position, default to 65 for key A
|
|
32
|
+
* @property {number} keySetCameraToCurrentPositionAndLookAtPrevious key code set camera to current position, default to 81 for key Q
|
|
33
|
+
* @extends FirstPersonControls
|
|
34
|
+
*/
|
|
35
|
+
declare class StreetControls extends FirstPersonControls {
|
|
36
|
+
/**
|
|
37
|
+
* @param { View } view - View where this control will be used
|
|
38
|
+
* @param { Object } options - Configuration of this controls
|
|
39
|
+
* @param { number } [options.wallMaxDistance=1000] - Maximum distance to click on a wall, in meter.
|
|
40
|
+
* @param { number } [options.animationDurationWall=200] - Time in millis for the animation when clicking on a wall.
|
|
41
|
+
* @param { THREE.Mesh } [options.surfaceGround] - Surface helper to see when mouse is on the ground, default is a transparent circle.
|
|
42
|
+
* @param { THREE.Mesh } [options.surfaceWall] - Surface helper to see when mouse is on a wall, default is a transparent rectangle.
|
|
43
|
+
* @param { string } [options.buildingsLayer='Buildings'] - Name of the building layer (used to pick on wall).
|
|
44
|
+
* @param { function } [options.computeTime] - Function to compute time (in millis), used for the animation to move to a distance (in meter)
|
|
45
|
+
* @param { number } [options.offset=4] - Altitude in meter up to the ground to move to when click on a target on the ground.
|
|
46
|
+
*/
|
|
47
|
+
constructor(view: View, options?: {
|
|
48
|
+
wallMaxDistance?: number | undefined;
|
|
49
|
+
animationDurationWall?: number | undefined;
|
|
50
|
+
surfaceGround?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap> | undefined;
|
|
51
|
+
surfaceWall?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap> | undefined;
|
|
52
|
+
buildingsLayer?: string | undefined;
|
|
53
|
+
computeTime?: Function | undefined;
|
|
54
|
+
offset?: number | undefined;
|
|
55
|
+
});
|
|
56
|
+
isStreetControls: boolean;
|
|
57
|
+
_onMouseOut: () => void;
|
|
58
|
+
previousPosition: any;
|
|
59
|
+
currentPosition: any;
|
|
60
|
+
nextPosition: any;
|
|
61
|
+
keyGoToNextPosition: number;
|
|
62
|
+
keyGoToPreviousPosition: number;
|
|
63
|
+
keySetCameraToCurrentPositionAndLookAtNext: number;
|
|
64
|
+
keySetCameraToCurrentPositionAndLookAtPrevious: number;
|
|
65
|
+
tweenGroup: import("@tweenjs/tween.js").Group;
|
|
66
|
+
surfaceGround: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
67
|
+
surfaceWall: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>;
|
|
68
|
+
surfaces: THREE.Object3D<THREE.Object3DEventMap>;
|
|
69
|
+
wallMaxDistance: number;
|
|
70
|
+
animationDurationWall: number;
|
|
71
|
+
buildingsLayer: string | undefined;
|
|
72
|
+
computeTime: Function;
|
|
73
|
+
offset: number;
|
|
74
|
+
transformationPositionPickOnTheGround: any;
|
|
75
|
+
end: any;
|
|
76
|
+
setCurrentPosition(newCurrentPosition: any): void;
|
|
77
|
+
setNextPosition(newNextPosition: any): void;
|
|
78
|
+
setPreviousPosition(newPreviousPosition: any): void;
|
|
79
|
+
onMouseUp(event: any): void;
|
|
80
|
+
_stateOnMouseDrag: boolean | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Sets the camera to the current position (stored in this controls), looking at the next position (also stored in this controls).
|
|
83
|
+
*
|
|
84
|
+
* @param { boolean } lookAtPrevious look at the previous position rather than the next one
|
|
85
|
+
*/
|
|
86
|
+
setCameraToCurrentPosition(lookAtPrevious: boolean): void;
|
|
87
|
+
/**
|
|
88
|
+
* Set the camera on a position, looking at another position.
|
|
89
|
+
*
|
|
90
|
+
* @param { THREE.Vector3 } position The position to set the camera
|
|
91
|
+
* @param { THREE.Vector3 } lookAt The position where the camera look at.
|
|
92
|
+
*/
|
|
93
|
+
setCameraOnPosition(position: THREE.Vector3, lookAt: THREE.Vector3): void;
|
|
94
|
+
/**
|
|
95
|
+
* Method called when user click on the ground.</br>
|
|
96
|
+
* Note that this funtion contains default values that can be overrided, by overriding this class.
|
|
97
|
+
*
|
|
98
|
+
* @param {THREE.Vector3} position - The position
|
|
99
|
+
*/
|
|
100
|
+
onClickOnGround(position: THREE.Vector3): void;
|
|
101
|
+
/**
|
|
102
|
+
* Method called when user click on oject that is not the ground.</br>
|
|
103
|
+
* Note that this function contains default values that can be overrided, by overriding this class.
|
|
104
|
+
*
|
|
105
|
+
* @param {THREE.Vector3} position - The position
|
|
106
|
+
*/
|
|
107
|
+
onClickOnWall(position: THREE.Vector3): void;
|
|
108
|
+
/**
|
|
109
|
+
* Animate the camera to make it look at a position, in a given time
|
|
110
|
+
*
|
|
111
|
+
* @param { THREE.Vector3 } position - Position to look at
|
|
112
|
+
* @param { number } time - Time in millisecond
|
|
113
|
+
*/
|
|
114
|
+
animateCameraLookAt(position: THREE.Vector3, time: number): void;
|
|
115
|
+
tween: import("@tweenjs/tween.js").Tween<{
|
|
116
|
+
t: number;
|
|
117
|
+
}> | import("@tweenjs/tween.js").Tween<any> | undefined;
|
|
118
|
+
animationFrameRequester: (() => void) | (() => void) | null | undefined;
|
|
119
|
+
/**
|
|
120
|
+
* Move the camera smoothly to the position, in a given time.
|
|
121
|
+
*
|
|
122
|
+
* @param { THREE.Vector3 } position - Destination of the movement.
|
|
123
|
+
* @param { number } time - Time in millisecond
|
|
124
|
+
* @return { Promise }
|
|
125
|
+
*/
|
|
126
|
+
moveCameraTo(position: THREE.Vector3, time?: number): Promise<any>;
|
|
127
|
+
stopAnimations(): void;
|
|
128
|
+
/**
|
|
129
|
+
* Move the camera to the 'currentPosition' stored in this control.
|
|
130
|
+
*/
|
|
131
|
+
moveCameraToCurrentPosition(): void;
|
|
132
|
+
}
|
|
133
|
+
import FirstPersonControls from '../Controls/FirstPersonControls';
|
|
134
|
+
import * as THREE from 'three';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export default VRControls;
|
|
2
|
+
/**
|
|
3
|
+
* @property {Array} controllers - WebXR controllers list
|
|
4
|
+
* */
|
|
5
|
+
declare class VRControls {
|
|
6
|
+
static MIN_DELTA_ALTITUDE: number;
|
|
7
|
+
static MAX_NUMBER_CONTROLLERS: number;
|
|
8
|
+
static init(view: any, vrHeadSet: any): VRControls;
|
|
9
|
+
/**
|
|
10
|
+
* Requires a contextXR variable.
|
|
11
|
+
* @param {*} _view itowns view object
|
|
12
|
+
* @param {*} _groupXR XR 3D object group
|
|
13
|
+
*/
|
|
14
|
+
constructor(_view: any, _groupXR?: any);
|
|
15
|
+
view: any;
|
|
16
|
+
groupXR: any;
|
|
17
|
+
webXRManager: any;
|
|
18
|
+
rightButtonPressed: boolean;
|
|
19
|
+
controllers: any[];
|
|
20
|
+
initControllers(): void;
|
|
21
|
+
bindGripController(controllerModelFactory: any, gripController: any, vrHeadSet: any): void;
|
|
22
|
+
setupEventListeners(controller: any): void;
|
|
23
|
+
listenGamepad(): void;
|
|
24
|
+
clampAndApplyTransformationToXR(trans: any, offsetRotation: any): void;
|
|
25
|
+
applyTransformationToXR(trans: any, offsetRotation: any): void;
|
|
26
|
+
/**
|
|
27
|
+
* Clamp the given translation vector so that the camera remains at or above ground level.
|
|
28
|
+
* @param {THREE.Vector3} trans - The translation vector.
|
|
29
|
+
* @returns {THREE.Vector3} The clamped coordinates as a Vector3.
|
|
30
|
+
*/
|
|
31
|
+
clampToGround(trans: THREE.Vector3): THREE.Vector3;
|
|
32
|
+
getSpeedFactor(): number;
|
|
33
|
+
getRotationYaw(axisValue: any): any;
|
|
34
|
+
getRotationPitch(axisValue: any): any;
|
|
35
|
+
getTranslationElevation(axisValue: any, speedFactor: any): any;
|
|
36
|
+
cameraOnFly(ctrl: any): void;
|
|
37
|
+
onSelectRightEnd(): void;
|
|
38
|
+
onSelectRightStart(): void;
|
|
39
|
+
onSelectLeftStart(): void;
|
|
40
|
+
onSelectLeftEnd(): void;
|
|
41
|
+
onSelectStart(data: any): void;
|
|
42
|
+
onSelectEnd(data: any): void;
|
|
43
|
+
onButtonPressed(data: any): void;
|
|
44
|
+
onRightButtonPressed(data: any): void;
|
|
45
|
+
onLeftButtonPressed(): void;
|
|
46
|
+
onAxisChanged(data: any): void;
|
|
47
|
+
onRightAxisChanged(ctrl: any): void;
|
|
48
|
+
onLeftAxisChanged(ctrl: any): void;
|
|
49
|
+
onAxisStop(data: any): void;
|
|
50
|
+
onRightAxisStop(): void;
|
|
51
|
+
onLeftAxisStop(): void;
|
|
52
|
+
onButtonReleased(data: any): void;
|
|
53
|
+
onRightButtonReleased(): void;
|
|
54
|
+
onLeftButtonReleased(): void;
|
|
55
|
+
}
|
|
56
|
+
import * as THREE from 'three';
|