@cognite/reveal 3.0.0-alpha.2 → 3.0.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/core/cad.d.ts +4 -4
- package/core/index.d.ts +6 -7
- package/core/src/index.d.ts +13 -19
- package/core/src/internals.d.ts +10 -15
- package/core/src/public/RevealManager.d.ts +61 -64
- package/core/src/public/createRevealManager.d.ts +23 -23
- package/core/src/public/migration/Cognite3DViewer.d.ts +485 -559
- package/core/src/public/migration/NotSupportedInMigrationWrapperError.d.ts +11 -11
- package/core/src/public/migration/RenderController.d.ts +4 -4
- package/core/src/public/migration/types.d.ts +199 -253
- package/core/src/public/types.d.ts +25 -47
- package/core/src/storage/RevealManagerHelper.d.ts +59 -58
- package/core/src/utilities/Spinner.d.ts +27 -27
- package/core/src/utilities/ViewStateHelper.d.ts +49 -37
- package/core/src/utilities/index.d.ts +6 -8
- package/core/src/utilities/reflection.d.ts +7 -7
- package/core/utilities.d.ts +4 -4
- package/extensions/datasource.d.ts +9 -9
- package/extensions/datasource.js +5 -8
- package/extensions/datasource.map +1 -1
- package/index.d.ts +13 -9
- package/index.js +195 -167
- package/index.map +1 -1
- package/package.json +18 -17
- package/packages/cad-geometry-loaders/index.d.ts +7 -13
- package/packages/cad-geometry-loaders/src/CadLoadingHints.d.ts +11 -11
- package/packages/cad-geometry-loaders/src/CadModelBudget.d.ts +21 -19
- package/packages/cad-geometry-loaders/src/CadModelUpdateHandler.d.ts +44 -42
- package/packages/cad-geometry-loaders/src/sector/ModelStateHandler.d.ts +12 -12
- package/packages/cad-geometry-loaders/src/sector/SectorDownloadScheduler.d.ts +22 -22
- package/packages/cad-geometry-loaders/src/sector/SectorLoader.d.ts +32 -31
- package/packages/cad-geometry-loaders/src/sector/culling/ByScreenSizeSectorCuller.d.ts +23 -23
- package/packages/cad-geometry-loaders/src/sector/culling/ByVisibilityGpuSectorCuller.d.ts +51 -51
- package/packages/cad-geometry-loaders/src/sector/culling/OrderSectorsByVisibilityCoverage.d.ts +106 -107
- package/packages/cad-geometry-loaders/src/sector/culling/RenderAlreadyLoadedGeometryProvider.d.ts +9 -0
- package/packages/cad-geometry-loaders/src/sector/culling/SectorCuller.d.ts +33 -33
- package/packages/cad-geometry-loaders/src/sector/culling/WeightFunctionsHelper.d.ts +50 -50
- package/packages/cad-geometry-loaders/src/sector/culling/computeNdcAreaOfBox.d.ts +12 -12
- package/packages/cad-geometry-loaders/src/sector/culling/computeSectorCost.d.ts +7 -7
- package/packages/cad-geometry-loaders/src/sector/culling/createV8SectorCuller.d.ts +7 -7
- package/packages/cad-geometry-loaders/src/sector/culling/takensectors/TakenSectorMapBase.d.ts +11 -11
- package/packages/cad-geometry-loaders/src/sector/culling/takensectors/TakenV8SectorMap.d.ts +17 -17
- package/packages/cad-geometry-loaders/src/sector/culling/takensectors/TakenV8SectorTree.d.ts +24 -24
- package/packages/cad-geometry-loaders/src/sector/culling/takensectors/TakenV9SectorMap.d.ts +20 -20
- package/packages/cad-geometry-loaders/src/sector/culling/takensectors/index.d.ts +5 -5
- package/packages/cad-geometry-loaders/src/sector/culling/transformBoxToNDC.d.ts +5 -5
- package/packages/cad-geometry-loaders/src/sector/culling/types.d.ts +83 -83
- package/packages/cad-geometry-loaders/src/sector/rxSectorUtilities.d.ts +12 -12
- package/packages/cad-geometry-loaders/src/utilities/PromiseUtils.d.ts +28 -28
- package/packages/cad-geometry-loaders/src/utilities/rxOperations.d.ts +6 -6
- package/packages/cad-model/index.d.ts +12 -0
- package/{core/src/utilities → packages/cad-model/src}/BoundingBoxClipper.d.ts +23 -23
- package/{core/src/datamodels/cad → packages/cad-model/src}/CadManager.d.ts +48 -43
- package/packages/cad-model/src/CadModelFactory.d.ts +16 -0
- package/{core/src/datamodels/cad → packages/cad-model/src}/CadModelSectorLoadStatistics.d.ts +38 -38
- package/{core/src/public/migration → packages/cad-model/src}/Cognite3DModel.d.ts +337 -340
- package/packages/cad-model/src/GeometryFilter.d.ts +20 -0
- package/packages/cad-model/src/InternalRevealCadOptions.d.ts +13 -0
- package/packages/cad-model/src/WellKnownUnit.d.ts +7 -0
- package/{core/src/utilities → packages/cad-model/src}/callActionWithIndicesAsync.d.ts +4 -4
- package/{core/src/datamodels/cad → packages/cad-model/src}/createCadManager.d.ts +10 -9
- package/{core/src/datamodels/cad → packages/cad-model/src}/picking.d.ts +28 -28
- package/packages/cad-parsers/index.d.ts +20 -21
- package/packages/cad-parsers/src/cad/CadSectorParser.d.ts +15 -15
- package/packages/cad-parsers/src/cad/LevelOfDetail.d.ts +8 -8
- package/packages/cad-parsers/src/cad/filterInstanceMesh.d.ts +6 -6
- package/packages/cad-parsers/src/cad/filterPrimitivesCommon.d.ts +5 -5
- package/packages/cad-parsers/src/cad/filterPrimitivesV8.d.ts +9 -9
- package/packages/cad-parsers/src/cad/filterPrimitivesV9.d.ts +6 -6
- package/packages/cad-parsers/src/cad/primitiveGeometries.d.ts +30 -31
- package/packages/cad-parsers/src/cad/triangleMeshes.d.ts +6 -6
- package/packages/cad-parsers/src/cad/types.d.ts +56 -56
- package/packages/cad-parsers/src/metadata/CadMetadataParser.d.ts +7 -7
- package/{core/src/datamodels/cad/sector → packages/cad-parsers/src/metadata}/CadModelClipper.d.ts +10 -10
- package/packages/cad-parsers/src/metadata/CadModelMetadata.d.ts +54 -54
- package/packages/cad-parsers/src/metadata/CadModelMetadataRepository.d.ts +16 -16
- package/packages/cad-parsers/src/metadata/parsers/CadMetadataParserGltf.d.ts +8 -6
- package/packages/cad-parsers/src/metadata/parsers/CadMetadataParserV8.d.ts +6 -6
- package/packages/cad-parsers/src/metadata/parsers/types.d.ts +62 -60
- package/packages/cad-parsers/src/metadata/types.d.ts +53 -52
- package/packages/cad-parsers/src/sector/RootSectorNode.d.ts +13 -12
- package/packages/cad-parsers/src/sector/SectorNode.d.ts +22 -21
- package/packages/cad-parsers/src/utilities/SectorScene.d.ts +23 -21
- package/packages/cad-parsers/src/utilities/SectorSceneFactory.d.ts +9 -9
- package/packages/cad-parsers/src/utilities/computeBoundingBoxFromAttributes.d.ts +10 -10
- package/packages/cad-parsers/src/utilities/float32BufferToMatrix.d.ts +12 -12
- package/packages/cad-parsers/src/utilities/types.d.ts +71 -74
- package/packages/cad-styling/index.d.ts +20 -13
- package/{core/src/datamodels/cad/styling → packages/cad-styling/src}/AssetNodeCollection.d.ts +47 -45
- package/packages/cad-styling/src/CdfModelNodeCollectionDataProvider.d.ts +26 -0
- package/packages/cad-styling/src/CombineNodeCollectionBase.d.ts +34 -33
- package/packages/cad-styling/src/IntersectionNodeCollection.d.ts +20 -19
- package/{core/src/datamodels/cad/styling → packages/cad-styling/src}/InvertedNodeCollection.d.ts +27 -25
- package/packages/cad-styling/src/NodeAppearance.d.ts +85 -85
- package/packages/cad-styling/src/NodeAppearanceProvider.d.ts +38 -36
- package/packages/cad-styling/src/NodeCollection.d.ts +26 -0
- package/packages/cad-styling/src/NodeCollectionDeserializer.d.ts +26 -0
- package/{core/src/datamodels/cad/styling → packages/cad-styling/src}/PopulateIndexSetFromPagedResponseHelper.d.ts +30 -30
- package/{core/src/datamodels/cad/styling → packages/cad-styling/src}/PropertyFilterNodeCollection.d.ts +57 -55
- package/packages/cad-styling/src/SerializedNodeCollection.d.ts +8 -0
- package/{core/src/datamodels/cad/styling → packages/cad-styling/src}/SinglePropertyFilterNodeCollection.d.ts +53 -51
- package/packages/cad-styling/src/TreeIndexNodeCollection.d.ts +40 -39
- package/packages/cad-styling/src/UnionNodeCollection.d.ts +19 -18
- package/packages/cad-styling/src/prioritized/AreaCollection.d.ts +39 -39
- package/packages/cad-styling/src/prioritized/BoxClusterer.d.ts +29 -29
- package/packages/cad-styling/src/prioritized/ClusteredAreaCollection.d.ts +17 -17
- package/packages/cad-styling/src/prioritized/EmptyAreaCollection.d.ts +18 -18
- package/packages/cad-styling/src/prioritized/types.d.ts +7 -7
- package/packages/camera-manager/index.d.ts +8 -6
- package/packages/camera-manager/src/CameraManager.d.ts +73 -84
- package/packages/camera-manager/src/CameraManagerHelper.d.ts +42 -0
- package/packages/camera-manager/src/ComboControls.d.ts +112 -101
- package/packages/camera-manager/src/DefaultCameraManager.d.ts +136 -0
- package/packages/camera-manager/src/Keyboard.d.ts +17 -17
- package/packages/camera-manager/src/types.d.ts +75 -64
- package/packages/data-source/index.d.ts +6 -6
- package/packages/data-source/src/CdfDataSource.d.ts +19 -19
- package/packages/data-source/src/DataSource.d.ts +25 -25
- package/packages/data-source/src/LocalDataSource.d.ts +15 -15
- package/packages/logger/index.d.ts +5 -5
- package/packages/logger/src/Log.d.ts +5 -5
- package/packages/metrics/index.d.ts +4 -5
- package/packages/metrics/src/MetricsLogger.d.ts +21 -21
- package/packages/metrics/src/types.d.ts +7 -7
- package/packages/model-base/index.d.ts +8 -0
- package/{core/src/public/migration → packages/model-base/src}/CogniteModelBase.d.ts +17 -17
- package/packages/{cad-parsers/src/metadata → model-base/src}/MetadataRepository.d.ts +7 -7
- package/{core/src/public/migration → packages/model-base/src}/NodeIdAndTreeIndexMaps.d.ts +4 -4
- package/{core/src/datamodels/base → packages/model-base/src}/SupportedModelTypes.d.ts +4 -4
- package/packages/{cad-geometry-loaders/src/utilities → model-base/src}/types.d.ts +36 -25
- package/packages/modeldata-api/index.d.ts +12 -13
- package/packages/modeldata-api/src/CdfModelDataProvider.d.ts +17 -17
- package/packages/modeldata-api/src/CdfModelIdentifier.d.ts +15 -15
- package/packages/modeldata-api/src/CdfModelMetadataProvider.d.ts +20 -20
- package/packages/modeldata-api/src/LocalModelDataProvider.d.ts +10 -10
- package/packages/modeldata-api/src/LocalModelIdentifier.d.ts +14 -14
- package/packages/modeldata-api/src/LocalModelMetadataProvider.d.ts +16 -16
- package/packages/modeldata-api/src/ModelIdentifier.d.ts +12 -12
- package/packages/modeldata-api/src/ModelMetadataProvider.d.ts +18 -18
- package/packages/modeldata-api/src/applyDefaultModelTransformation.d.ts +6 -6
- package/packages/modeldata-api/src/types.d.ts +47 -47
- package/packages/modeldata-api/src/utilities.d.ts +7 -7
- package/packages/nodes-api/index.d.ts +6 -6
- package/packages/nodes-api/src/NodesApiClient.d.ts +50 -50
- package/packages/nodes-api/src/NodesCdfClient.d.ts +24 -24
- package/packages/nodes-api/src/NodesLocalClient.d.ts +30 -30
- package/packages/nodes-api/src/types.d.ts +10 -10
- package/packages/pointclouds/index.d.ts +13 -0
- package/{core/src/public/migration → packages/pointclouds/src}/CognitePointCloudModel.d.ts +120 -121
- package/packages/pointclouds/src/PointCloudBudget.d.ts +14 -0
- package/{core/src/datamodels/pointcloud → packages/pointclouds/src}/PointCloudFactory.d.ts +9 -9
- package/packages/pointclouds/src/PointCloudIntersection.d.ts +26 -0
- package/{core/src/datamodels/pointcloud → packages/pointclouds/src}/PointCloudManager.d.ts +26 -26
- package/{core/src/datamodels/pointcloud → packages/pointclouds/src}/PointCloudMetadata.d.ts +14 -14
- package/{core/src/datamodels/pointcloud → packages/pointclouds/src}/PointCloudMetadataRepository.d.ts +14 -14
- package/{core/src/datamodels/pointcloud → packages/pointclouds/src}/PointCloudNode.d.ts +62 -62
- package/{core/src/datamodels/pointcloud → packages/pointclouds/src}/PotreeGroupWrapper.d.ts +39 -39
- package/{core/src/datamodels/pointcloud → packages/pointclouds/src}/PotreeNodeWrapper.d.ts +38 -38
- package/{core/src/datamodels/pointcloud → packages/pointclouds/src}/createPointCloudManager.d.ts +6 -6
- package/{core/src/datamodels/pointcloud → packages/pointclouds/src}/picking.d.ts +29 -29
- package/{core/src/datamodels/pointcloud → packages/pointclouds/src}/types.d.ts +114 -114
- package/packages/rendering/index.d.ts +14 -17
- package/packages/rendering/src/CadMaterialManager.d.ts +39 -37
- package/packages/rendering/src/GeometryBatchingManager.d.ts +31 -30
- package/packages/rendering/src/InstancedMeshManager.d.ts +20 -20
- package/packages/rendering/src/rendering/EffectRenderManager.d.ts +99 -99
- package/packages/rendering/src/rendering/NodeAppearanceTextureBuilder.d.ts +51 -51
- package/packages/rendering/src/rendering/RenderMode.d.ts +15 -15
- package/packages/rendering/src/rendering/createSimpleGeometryMesh.d.ts +6 -6
- package/packages/rendering/src/rendering/matCapTextureData.d.ts +5 -5
- package/packages/rendering/src/rendering/materials.d.ts +23 -23
- package/packages/rendering/src/rendering/primitives.d.ts +12 -12
- package/packages/rendering/src/rendering/shaders.d.ts +101 -101
- package/packages/rendering/src/rendering/types.d.ts +76 -76
- package/packages/rendering/src/sector/CadNode.d.ts +57 -63
- package/packages/rendering/src/transform/NodeTransformProvider.d.ts +13 -13
- package/packages/rendering/src/transform/NodeTransformTextureBuilder.d.ts +23 -23
- package/packages/rendering/src/transform/TransformOverrideBuffer.d.ts +21 -21
- package/packages/rendering/src/utilities/types.d.ts +26 -26
- package/packages/sector-loader/index.d.ts +6 -6
- package/packages/sector-loader/src/GltfSectorLoader.d.ts +12 -0
- package/packages/sector-loader/src/GltfSectorRepository.d.ts +19 -14
- package/packages/sector-loader/src/SectorRepository.d.ts +10 -9
- package/packages/sector-loader/src/V8SectorRepository.d.ts +26 -25
- package/packages/sector-loader/src/v8/SimpleAndDetailedToSector3D.d.ts +20 -20
- package/packages/sector-loader/src/v8/arrays.d.ts +5 -5
- package/packages/sector-loader/src/v8/groupMeshesByNumber.d.ts +8 -8
- package/packages/sector-loader/src/v8/sectorUtilities.d.ts +16 -16
- package/packages/sector-parser/index.d.ts +5 -5
- package/packages/sector-parser/src/DracoDecoderHelper.d.ts +32 -0
- package/packages/sector-parser/src/GltfSectorParser.d.ts +19 -18
- package/packages/sector-parser/src/constants.d.ts +6 -0
- package/packages/sector-parser/src/reveal-glb-parser/GlbMetadataParser.d.ts +14 -14
- package/packages/sector-parser/src/reveal-glb-parser/primitiveGeometries.d.ts +12 -12
- package/packages/sector-parser/src/types.d.ts +106 -98
- package/packages/tools/index.d.ts +15 -15
- package/packages/tools/src/AxisView/AxisViewTool.d.ts +32 -32
- package/packages/tools/src/AxisView/types.d.ts +98 -98
- package/packages/tools/src/Cognite3DViewerToolBase.d.ts +25 -25
- package/packages/tools/src/DebugCameraTool.d.ts +20 -20
- package/packages/tools/src/DebugLoadedSectorsTool.d.ts +23 -23
- package/packages/tools/src/ExplodedViewTool.d.ts +12 -12
- package/packages/tools/src/Geomap/Geomap.d.ts +17 -17
- package/packages/tools/src/Geomap/GeomapTool.d.ts +23 -23
- package/packages/tools/src/Geomap/MapConfig.d.ts +195 -195
- package/packages/tools/src/HtmlOverlay/BucketGrid2D.d.ts +28 -28
- package/packages/tools/src/HtmlOverlay/HtmlOverlayTool.d.ts +160 -160
- package/packages/tools/src/Timeline/Keyframe.d.ts +39 -39
- package/packages/tools/src/Timeline/TimelineTool.d.ts +79 -79
- package/packages/tools/src/Timeline/types.d.ts +13 -13
- package/packages/tools/src/types.d.ts +4 -4
- package/packages/utilities/index.d.ts +32 -28
- package/packages/utilities/src/CameraConfiguration.d.ts +10 -10
- package/packages/utilities/src/DeferredPromise.d.ts +17 -17
- package/packages/utilities/src/IndexSet.d.ts +1 -1
- package/packages/utilities/src/NumericRange.d.ts +22 -22
- package/packages/utilities/src/RandomColors.d.ts +34 -34
- package/packages/utilities/src/WebGLRendererStateHelper.d.ts +15 -15
- package/packages/utilities/src/assertNever.d.ts +7 -7
- package/packages/utilities/src/cache/MemoryRequestCache.d.ts +24 -22
- package/packages/utilities/src/cache/MostFrequentlyUsedCache.d.ts +19 -19
- package/packages/utilities/src/cache/RequestCache.d.ts +13 -13
- package/packages/utilities/src/calculateVolumeOfMesh.d.ts +4 -0
- package/packages/utilities/src/counterMap.d.ts +5 -5
- package/packages/utilities/src/datastructures/DynamicDefragmentedBuffer.d.ts +33 -35
- package/packages/utilities/src/determinePowerOfTwoDimensions.d.ts +11 -11
- package/packages/utilities/src/disposeAttributeArrayOnUpload.d.ts +17 -17
- package/packages/utilities/src/events/EventTrigger.d.ts +13 -13
- package/packages/utilities/src/events/InputHandler.d.ts +34 -25
- package/packages/utilities/src/events/clickOrTouchEventOffset.d.ts +13 -13
- package/packages/utilities/src/events/index.d.ts +6 -6
- package/packages/utilities/src/indexset/IndexSet.d.ts +26 -26
- package/packages/utilities/src/indexset/IntermediateIndexNode.d.ts +26 -26
- package/packages/utilities/src/indexset/LeafIndexNode.d.ts +16 -16
- package/packages/utilities/src/isMobileOrTablet.d.ts +4 -4
- package/packages/utilities/src/networking/isTheSameDomain.d.ts +11 -11
- package/packages/utilities/src/objectTraversal.d.ts +8 -8
- package/packages/utilities/src/packFloat.d.ts +6 -6
- package/packages/utilities/src/revealEnv.d.ts +10 -10
- package/packages/utilities/src/three/AutoDisposeGroup.d.ts +17 -17
- package/packages/utilities/src/three/BoundingBoxLOD.d.ts +27 -27
- package/packages/utilities/src/three/isBox3OnPositiveSideOfPlane.d.ts +10 -10
- package/packages/utilities/src/three/toThreeBox3.d.ts +6 -6
- package/packages/utilities/src/three/unionBoxes.d.ts +5 -0
- package/packages/utilities/src/three/visitBox3CornerPoints.d.ts +12 -12
- package/packages/utilities/src/transformCameraConfiguration.d.ts +6 -6
- package/packages/utilities/src/types.d.ts +11 -11
- package/packages/utilities/src/workers/WorkerPool.d.ts +14 -14
- package/{core/src/utilities → packages/utilities/src}/worldToViewport.d.ts +30 -30
- package/tools.d.ts +7 -7
- package/tools.js +98 -74
- package/tools.map +1 -1
- package/core/src/datamodels/base/index.d.ts +0 -6
- package/core/src/datamodels/base/types.d.ts +0 -14
- package/core/src/datamodels/cad/CadModelFactory.d.ts +0 -13
- package/core/src/datamodels/cad/rendering/RenderAlreadyLoadedGeometryProvider.d.ts +0 -10
- package/core/src/datamodels/cad/styling/NodeCollectionDeserializer.d.ts +0 -26
- package/core/src/datamodels/cad/styling/index.d.ts +0 -8
- package/core/src/datamodels/pointcloud/index.d.ts +0 -5
- package/core/src/migration.d.ts +0 -8
- package/packages/cad-geometry-loaders/src/sector/culling/OccludingGeometryProvider.d.ts +0 -6
- package/packages/cad-styling/src/NodeCollectionBase.d.ts +0 -54
- package/packages/modeldata-api/src/CdfModelOutputsProvider.d.ts +0 -16
- package/packages/modeldata-api/src/Model3DOutputList.d.ts +0 -17
- package/packages/rendering/src/cameraconfig.d.ts +0 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
export declare type PrioritizedArea = {
|
|
5
|
-
area: THREE.Box3;
|
|
6
|
-
extraPriority: number;
|
|
7
|
-
};
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
export declare type PrioritizedArea = {
|
|
5
|
+
area: THREE.Box3;
|
|
6
|
+
extraPriority: number;
|
|
7
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
export { DefaultCameraManager } from './src/DefaultCameraManager';
|
|
5
|
+
export { CameraManagerHelper } from './src/CameraManagerHelper';
|
|
6
|
+
export { CameraManager } from './src/CameraManager';
|
|
7
|
+
export { ComboControls } from './src/ComboControls';
|
|
8
|
+
export * from './src/types';
|
|
@@ -1,84 +1,73 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright
|
|
3
|
-
*/
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
*
|
|
58
|
-
* @param
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
*
|
|
65
|
-
* @param
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
* Method for setting up camera controls listeners and values inside current controls class.
|
|
75
|
-
*/
|
|
76
|
-
private setupControls;
|
|
77
|
-
/**
|
|
78
|
-
* Convert pixel coordinates of the cursor to [-1,1]^2 coordinates.
|
|
79
|
-
* @param pixelX
|
|
80
|
-
* @param pixelY
|
|
81
|
-
*/
|
|
82
|
-
private convertPixelCoordinatesToNormalized;
|
|
83
|
-
private calculateDefaultDuration;
|
|
84
|
-
}
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { CameraChangeDelegate, CameraState } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Interface for manager responsible for all manipulations to the camera,
|
|
7
|
+
* including animations and modification of state. Implementations are responsible for
|
|
8
|
+
* providing a `THREE.PerspectiveCamera` instance to {@link Cognite3DViewer}. Implementations
|
|
9
|
+
* must trigger the `cameraChange`-event when camera is changed.
|
|
10
|
+
* The default implementation is {@link DefaultCameraManager}.
|
|
11
|
+
*/
|
|
12
|
+
export interface CameraManager {
|
|
13
|
+
/**
|
|
14
|
+
* Returns the camera used for rendering in {@link Cognite3DViewer}.
|
|
15
|
+
* Note that the camera will not be modified directly by Reveal.
|
|
16
|
+
* Implementations must trigger the `cameraChange`-event whenever the
|
|
17
|
+
* camera changes.
|
|
18
|
+
*/
|
|
19
|
+
getCamera(): THREE.PerspectiveCamera;
|
|
20
|
+
/**
|
|
21
|
+
* Set camera's state. Rotation and target can't be set at the same time as they could conflict,
|
|
22
|
+
* should throw an error if both are passed with non-zero value inside state.
|
|
23
|
+
*
|
|
24
|
+
* @param state Camera state, all fields are optional.
|
|
25
|
+
* @param state.position Camera position in world space.
|
|
26
|
+
* @param state.target Camera target in world space.
|
|
27
|
+
* @param state.rotation Camera local rotation in quaternion form.
|
|
28
|
+
* @example
|
|
29
|
+
* ```js
|
|
30
|
+
* // store position, target
|
|
31
|
+
* const { position, target } = cameraManager.getCameraState();
|
|
32
|
+
* // restore position, target
|
|
33
|
+
* cameraManager.setCameraState({ position, target });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
setCameraState(state: CameraState): void;
|
|
37
|
+
/**
|
|
38
|
+
* Get camera's state
|
|
39
|
+
* @returns Camera state: position, target and rotation.
|
|
40
|
+
*/
|
|
41
|
+
getCameraState(): Required<CameraState>;
|
|
42
|
+
/**
|
|
43
|
+
* Subscribes to changes of the camera event. This is used by Reveal to react on changes of the camera.
|
|
44
|
+
* @param event Name of the event.
|
|
45
|
+
* @param callback Callback to be called when the event is fired.
|
|
46
|
+
*/
|
|
47
|
+
on(event: 'cameraChange', callback: CameraChangeDelegate): void;
|
|
48
|
+
/**
|
|
49
|
+
* Unsubscribes from changes of the camera event.
|
|
50
|
+
* @param event Name of the event.
|
|
51
|
+
* @param callback Callback function to be unsubscribed.
|
|
52
|
+
*/
|
|
53
|
+
off(event: 'cameraChange', callback: CameraChangeDelegate): void;
|
|
54
|
+
/**
|
|
55
|
+
* Moves camera to a place where the content of a bounding box is visible to the camera.
|
|
56
|
+
* @param box The bounding box in world space.
|
|
57
|
+
* @param duration The duration of the animation moving the camera.
|
|
58
|
+
* @param radiusFactor The ratio of the distance from camera to center of box and radius of the box.
|
|
59
|
+
*/
|
|
60
|
+
fitCameraToBoundingBox(boundingBox: THREE.Box3, duration?: number, radiusFactor?: number): void;
|
|
61
|
+
/**
|
|
62
|
+
* Updates internal state of camera manager. Expected to update visual state of the camera
|
|
63
|
+
* as well as it's near and far planes if needed. Called in `requestAnimationFrame`-loop.
|
|
64
|
+
* Reveal performance affects frequency with which this method is called.
|
|
65
|
+
* @param deltaTime Delta time since last update in seconds.
|
|
66
|
+
* @param boundingBox Global bounding box of the model(s) and any custom objects added to the scene.
|
|
67
|
+
*/
|
|
68
|
+
update(deltaTime: number, boundingBox: THREE.Box3): void;
|
|
69
|
+
/**
|
|
70
|
+
* @obvious
|
|
71
|
+
*/
|
|
72
|
+
dispose(): void;
|
|
73
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
/**
|
|
6
|
+
* Helper methods for implementing a camera manager.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CameraManagerHelper {
|
|
9
|
+
/**
|
|
10
|
+
* Reusable buffers used by updateNearAndFarPlane function to avoid allocations.
|
|
11
|
+
*/
|
|
12
|
+
private static readonly _updateNearAndFarPlaneBuffers;
|
|
13
|
+
private static readonly _calculateCameraFarBuffers;
|
|
14
|
+
/**
|
|
15
|
+
* Calculates camera target based on new camera rotation.
|
|
16
|
+
* @param camera Used camera instance.
|
|
17
|
+
* @param rotation New camera rotation in quaternion form.
|
|
18
|
+
* @param currentTarget Current camera target.
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
static calculateNewTargetFromRotation(camera: THREE.PerspectiveCamera, rotation: THREE.Quaternion, currentTarget: THREE.Vector3): THREE.Vector3;
|
|
22
|
+
/**
|
|
23
|
+
* Updates near and far plane of the camera based on the bounding box.
|
|
24
|
+
* @param camera Used camera instance.
|
|
25
|
+
* @param combinedBbox Bounding box of all objects on the scene.
|
|
26
|
+
*/
|
|
27
|
+
static updateCameraNearAndFar(camera: THREE.PerspectiveCamera, combinedBbox: THREE.Box3): void;
|
|
28
|
+
/**
|
|
29
|
+
* Calculates camera position and target that allows to see the content of provided bounding box.
|
|
30
|
+
* @param camera Used camera instance.
|
|
31
|
+
* @param box Bounding box to be fitted.
|
|
32
|
+
* @param radiusFactor The ratio of the distance from camera to center of box and radius of the box.
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
static calculateCameraStateToFitBoundingBox(camera: THREE.PerspectiveCamera, box: THREE.Box3, radiusFactor?: number): {
|
|
36
|
+
position: THREE.Vector3;
|
|
37
|
+
target: THREE.Vector3;
|
|
38
|
+
};
|
|
39
|
+
private static calculateCameraFar;
|
|
40
|
+
private static calculateCameraNear;
|
|
41
|
+
private static getBoundingBoxCorners;
|
|
42
|
+
}
|
|
@@ -1,101 +1,112 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
import { EventDispatcher, Vector3, PerspectiveCamera, OrthographicCamera } from 'three';
|
|
5
|
-
export declare class ComboControls extends EventDispatcher {
|
|
6
|
-
enabled: boolean;
|
|
7
|
-
enableDamping: boolean;
|
|
8
|
-
dampingFactor: number;
|
|
9
|
-
dynamicTarget: boolean;
|
|
10
|
-
minDistance: number;
|
|
11
|
-
minZoomDistance: number;
|
|
12
|
-
dollyFactor: number;
|
|
13
|
-
minPolarAngle: number;
|
|
14
|
-
maxPolarAngle: number;
|
|
15
|
-
minAzimuthAngle: number;
|
|
16
|
-
maxAzimuthAngle: number;
|
|
17
|
-
panDollyMinDistanceFactor: number;
|
|
18
|
-
firstPersonRotationFactor: number;
|
|
19
|
-
pointerRotationSpeedAzimuth: number;
|
|
20
|
-
pointerRotationSpeedPolar: number;
|
|
21
|
-
enableKeyboardNavigation: boolean;
|
|
22
|
-
keyboardRotationSpeedAzimuth: number;
|
|
23
|
-
keyboardRotationSpeedPolar: number;
|
|
24
|
-
mouseFirstPersonRotationSpeed: number;
|
|
25
|
-
keyboardDollySpeed: number;
|
|
26
|
-
keyboardPanSpeed: number;
|
|
27
|
-
keyboardSpeedFactor: number;
|
|
28
|
-
pinchEpsilon: number;
|
|
29
|
-
pinchPanSpeed: number;
|
|
30
|
-
EPSILON: number;
|
|
31
|
-
dispose: () => void;
|
|
32
|
-
minZoom: number;
|
|
33
|
-
maxZoom: number;
|
|
34
|
-
orthographicCameraDollyFactor: number;
|
|
35
|
-
lookAtViewTarget: boolean;
|
|
36
|
-
useScrollTarget: boolean;
|
|
37
|
-
zoomToCursor: boolean;
|
|
38
|
-
minDeltaRatio: number;
|
|
39
|
-
maxDeltaRatio: number;
|
|
40
|
-
minDeltaDownscaleCoefficient: number;
|
|
41
|
-
maxDeltaDownscaleCoefficient: number;
|
|
42
|
-
private _temporarilyDisableDamping;
|
|
43
|
-
private readonly _camera;
|
|
44
|
-
private _firstPersonMode;
|
|
45
|
-
private readonly _reusableCamera;
|
|
46
|
-
private readonly _reusableVector3;
|
|
47
|
-
private readonly _accumulatedMouseMove;
|
|
48
|
-
private readonly _domElement;
|
|
49
|
-
private readonly _target;
|
|
50
|
-
private readonly _viewTarget;
|
|
51
|
-
private readonly _scrollTarget;
|
|
52
|
-
private readonly _targetEnd;
|
|
53
|
-
private readonly _spherical;
|
|
54
|
-
private _sphericalEnd;
|
|
55
|
-
private readonly _deltaTarget;
|
|
56
|
-
private
|
|
57
|
-
private
|
|
58
|
-
private readonly
|
|
59
|
-
private readonly
|
|
60
|
-
private readonly
|
|
61
|
-
private
|
|
62
|
-
private
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
private
|
|
83
|
-
private readonly
|
|
84
|
-
private readonly
|
|
85
|
-
private readonly
|
|
86
|
-
private readonly
|
|
87
|
-
private readonly
|
|
88
|
-
private readonly
|
|
89
|
-
private readonly
|
|
90
|
-
private readonly
|
|
91
|
-
private readonly
|
|
92
|
-
private readonly
|
|
93
|
-
private readonly
|
|
94
|
-
private readonly
|
|
95
|
-
private readonly
|
|
96
|
-
private readonly
|
|
97
|
-
private readonly
|
|
98
|
-
private readonly
|
|
99
|
-
private readonly
|
|
100
|
-
private readonly
|
|
101
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import { EventDispatcher, Vector3, PerspectiveCamera, OrthographicCamera, Quaternion } from 'three';
|
|
5
|
+
export declare class ComboControls extends EventDispatcher {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
enableDamping: boolean;
|
|
8
|
+
dampingFactor: number;
|
|
9
|
+
dynamicTarget: boolean;
|
|
10
|
+
minDistance: number;
|
|
11
|
+
minZoomDistance: number;
|
|
12
|
+
dollyFactor: number;
|
|
13
|
+
minPolarAngle: number;
|
|
14
|
+
maxPolarAngle: number;
|
|
15
|
+
minAzimuthAngle: number;
|
|
16
|
+
maxAzimuthAngle: number;
|
|
17
|
+
panDollyMinDistanceFactor: number;
|
|
18
|
+
firstPersonRotationFactor: number;
|
|
19
|
+
pointerRotationSpeedAzimuth: number;
|
|
20
|
+
pointerRotationSpeedPolar: number;
|
|
21
|
+
enableKeyboardNavigation: boolean;
|
|
22
|
+
keyboardRotationSpeedAzimuth: number;
|
|
23
|
+
keyboardRotationSpeedPolar: number;
|
|
24
|
+
mouseFirstPersonRotationSpeed: number;
|
|
25
|
+
keyboardDollySpeed: number;
|
|
26
|
+
keyboardPanSpeed: number;
|
|
27
|
+
keyboardSpeedFactor: number;
|
|
28
|
+
pinchEpsilon: number;
|
|
29
|
+
pinchPanSpeed: number;
|
|
30
|
+
EPSILON: number;
|
|
31
|
+
dispose: () => void;
|
|
32
|
+
minZoom: number;
|
|
33
|
+
maxZoom: number;
|
|
34
|
+
orthographicCameraDollyFactor: number;
|
|
35
|
+
lookAtViewTarget: boolean;
|
|
36
|
+
useScrollTarget: boolean;
|
|
37
|
+
zoomToCursor: boolean;
|
|
38
|
+
minDeltaRatio: number;
|
|
39
|
+
maxDeltaRatio: number;
|
|
40
|
+
minDeltaDownscaleCoefficient: number;
|
|
41
|
+
maxDeltaDownscaleCoefficient: number;
|
|
42
|
+
private _temporarilyDisableDamping;
|
|
43
|
+
private readonly _camera;
|
|
44
|
+
private _firstPersonMode;
|
|
45
|
+
private readonly _reusableCamera;
|
|
46
|
+
private readonly _reusableVector3;
|
|
47
|
+
private readonly _accumulatedMouseMove;
|
|
48
|
+
private readonly _domElement;
|
|
49
|
+
private readonly _target;
|
|
50
|
+
private readonly _viewTarget;
|
|
51
|
+
private readonly _scrollTarget;
|
|
52
|
+
private readonly _targetEnd;
|
|
53
|
+
private readonly _spherical;
|
|
54
|
+
private _sphericalEnd;
|
|
55
|
+
private readonly _deltaTarget;
|
|
56
|
+
private readonly _rawCameraRotation;
|
|
57
|
+
private _keyboard;
|
|
58
|
+
private readonly _offsetVector;
|
|
59
|
+
private readonly _panVector;
|
|
60
|
+
private readonly _raycaster;
|
|
61
|
+
private readonly _targetFPS;
|
|
62
|
+
private _targetFPSOverActualFPS;
|
|
63
|
+
private _isFocused;
|
|
64
|
+
constructor(camera: PerspectiveCamera | OrthographicCamera, domElement: HTMLElement);
|
|
65
|
+
update: (deltaTime: number) => boolean;
|
|
66
|
+
getState: () => {
|
|
67
|
+
target: Vector3;
|
|
68
|
+
position: Vector3;
|
|
69
|
+
};
|
|
70
|
+
setState: (position: Vector3, target: Vector3) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Camera rotation to be used by the camera instead of target-based rotation.
|
|
73
|
+
* This rotation is used only when set to non-default quaternion value (not identity rotation quaternion).
|
|
74
|
+
* Externally, value is updated by `CameraManager` when `setState` method with non-zero rotation is called. Automatically
|
|
75
|
+
* resets to default value when `setState` method is called with no rotation value.
|
|
76
|
+
*/
|
|
77
|
+
get cameraRawRotation(): Quaternion;
|
|
78
|
+
setViewTarget: (target: Vector3) => void;
|
|
79
|
+
setScrollTarget: (target: Vector3) => void;
|
|
80
|
+
getScrollTarget: () => Vector3;
|
|
81
|
+
triggerCameraChangeEvent: () => void;
|
|
82
|
+
private calculateShortestDeltaTheta;
|
|
83
|
+
private readonly convertPixelCoordinatesToNormalized;
|
|
84
|
+
private readonly onPointerDown;
|
|
85
|
+
private readonly onMouseDown;
|
|
86
|
+
private readonly onMouseUp;
|
|
87
|
+
private readonly onMouseWheel;
|
|
88
|
+
private readonly onTouchStart;
|
|
89
|
+
private readonly onFocusChanged;
|
|
90
|
+
private readonly isDescendant;
|
|
91
|
+
private readonly onContextMenu;
|
|
92
|
+
private readonly rotate;
|
|
93
|
+
private readonly startMouseRotation;
|
|
94
|
+
private readonly startMousePan;
|
|
95
|
+
private readonly startTouchRotation;
|
|
96
|
+
private readonly startTouchPinch;
|
|
97
|
+
private readonly handleKeyboard;
|
|
98
|
+
private readonly rotateSpherical;
|
|
99
|
+
private readonly rotateFirstPersonMode;
|
|
100
|
+
private readonly pan;
|
|
101
|
+
private readonly dollyOrthographicCamera;
|
|
102
|
+
private readonly calculateNewRadiusAndTargetOffsetLerp;
|
|
103
|
+
private readonly clampedMap;
|
|
104
|
+
private readonly calculateNewRadiusAndTargetOffsetScrollTarget;
|
|
105
|
+
private readonly dollyWithWheelScroll;
|
|
106
|
+
private readonly dollyPerspectiveCamera;
|
|
107
|
+
private readonly dolly;
|
|
108
|
+
private readonly getDollyDeltaDistance;
|
|
109
|
+
private readonly panLeft;
|
|
110
|
+
private readonly panUp;
|
|
111
|
+
private isIdentityQuaternion;
|
|
112
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { ComboControls } from './ComboControls';
|
|
6
|
+
import { CameraControlsOptions, CameraChangeDelegate, CameraState } from './types';
|
|
7
|
+
import { CameraManager } from './CameraManager';
|
|
8
|
+
/**
|
|
9
|
+
* Default implementation of {@link CameraManager}. Uses target-based orbit controls combined with
|
|
10
|
+
* keyboard and mouse navigation possibility. Supports automatic update of camera near and far
|
|
11
|
+
* planes and animated change of camera position and target.
|
|
12
|
+
*/
|
|
13
|
+
export declare class DefaultCameraManager implements CameraManager {
|
|
14
|
+
private readonly _events;
|
|
15
|
+
private readonly _controls;
|
|
16
|
+
private readonly _camera;
|
|
17
|
+
private readonly _domElement;
|
|
18
|
+
private readonly _inputHandler;
|
|
19
|
+
private readonly _raycaster;
|
|
20
|
+
private isDisposed;
|
|
21
|
+
private _nearAndFarNeedsUpdate;
|
|
22
|
+
private readonly _modelRaycastCallback;
|
|
23
|
+
private _onClick;
|
|
24
|
+
private _onWheel;
|
|
25
|
+
private static readonly DefaultAnimationDuration;
|
|
26
|
+
private static readonly DefaultMinAnimationDuration;
|
|
27
|
+
private static readonly DefaultMaxAnimationDuration;
|
|
28
|
+
private static readonly DefaultMinDistance;
|
|
29
|
+
private static readonly DefaultMinZoomDistance;
|
|
30
|
+
private static readonly DefaultMinimalTimeBetweenRaycasts;
|
|
31
|
+
private static readonly DefaultCameraControlsOptions;
|
|
32
|
+
private _cameraControlsOptions;
|
|
33
|
+
private readonly _currentBoundingBox;
|
|
34
|
+
/**
|
|
35
|
+
* When false, camera near and far planes will not be updated automatically (defaults to true).
|
|
36
|
+
* This can be useful when you have custom content in the 3D view and need to better
|
|
37
|
+
* control the view frustum.
|
|
38
|
+
*
|
|
39
|
+
* When automatic camera near/far planes are disabled, you are responsible for setting
|
|
40
|
+
* this on your own.
|
|
41
|
+
* @example
|
|
42
|
+
* ```
|
|
43
|
+
* viewer.camera.near = 0.1;
|
|
44
|
+
* viewer.camera.far = 1000.0;
|
|
45
|
+
* viewer.camera.updateProjectionMatrix();
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
automaticNearFarPlane: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* When false, the sensitivity of the camera controls will not be updated automatically.
|
|
51
|
+
* This can be useful to better control the sensitivity of the 3D navigation.
|
|
52
|
+
*
|
|
53
|
+
* When not set, control the sensitivity of the camera using `viewer.cameraManager.cameraControls.minDistance`
|
|
54
|
+
* and `viewer.cameraManager.cameraControls.maxDistance`.
|
|
55
|
+
*/
|
|
56
|
+
automaticControlsSensitivity: boolean;
|
|
57
|
+
on(event: 'cameraChange', callback: CameraChangeDelegate): void;
|
|
58
|
+
off(event: 'cameraChange', callback: CameraChangeDelegate): void;
|
|
59
|
+
fitCameraToBoundingBox(box: THREE.Box3, duration?: number, radiusFactor?: number): void;
|
|
60
|
+
/**
|
|
61
|
+
* Gets instance of camera controls that are used by camera manager. See {@link ComboControls} for more
|
|
62
|
+
* information on all adjustable properties.
|
|
63
|
+
*/
|
|
64
|
+
get cameraControls(): ComboControls;
|
|
65
|
+
/**
|
|
66
|
+
* Sets whether camera controls through mouse, touch and keyboard are enabled.
|
|
67
|
+
* This can be useful to e.g. temporarily disable navigation when manipulating other
|
|
68
|
+
* objects in the scene or when implementing a "cinematic" viewer.
|
|
69
|
+
*/
|
|
70
|
+
set cameraControlsEnabled(enabled: boolean);
|
|
71
|
+
/**
|
|
72
|
+
* Gets whether camera controls through mouse, touch and keyboard are enabled.
|
|
73
|
+
*/
|
|
74
|
+
get cameraControlsEnabled(): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Sets whether keyboard control of the camera is enabled/disabled.
|
|
77
|
+
*/
|
|
78
|
+
set keyboardNavigationEnabled(enabled: boolean);
|
|
79
|
+
/**
|
|
80
|
+
* Whether keyboard control of the camera is enabled/disabled.
|
|
81
|
+
*/
|
|
82
|
+
get keyboardNavigationEnabled(): boolean;
|
|
83
|
+
getCamera(): THREE.PerspectiveCamera;
|
|
84
|
+
/**
|
|
85
|
+
* Sets camera state. All parameters are optional. Rotation and target can't be set at the same time,
|
|
86
|
+
* if so, error will be thrown. Set rotation is preserved until next call of setCameraState with
|
|
87
|
+
* empty rotation field.
|
|
88
|
+
* @param state Camera state.
|
|
89
|
+
* **/
|
|
90
|
+
setCameraState(state: CameraState): void;
|
|
91
|
+
getCameraState(): Required<CameraState>;
|
|
92
|
+
/**
|
|
93
|
+
* Gets current camera controls options.
|
|
94
|
+
*/
|
|
95
|
+
getCameraControlsOptions(): CameraControlsOptions;
|
|
96
|
+
/**
|
|
97
|
+
* Sets camera controls options to customize camera controls modes. See {@link CameraControlsOptions}.
|
|
98
|
+
* @param controlsOptions JSON object with camera controls options.
|
|
99
|
+
*/
|
|
100
|
+
setCameraControlsOptions(controlsOptions: CameraControlsOptions): void;
|
|
101
|
+
update(deltaTime: number, boundingBox: THREE.Box3): void;
|
|
102
|
+
dispose(): void;
|
|
103
|
+
private moveCameraTo;
|
|
104
|
+
private moveCameraTargetTo;
|
|
105
|
+
private updateCameraNearAndFar;
|
|
106
|
+
private calculateAnimationStartTarget;
|
|
107
|
+
private createTweenAnimation;
|
|
108
|
+
/**
|
|
109
|
+
* Calculates new target when raycaster doesn't have any intersections with the model.
|
|
110
|
+
* @param cursorPosition Cursor position for desired calculations.
|
|
111
|
+
* @param cursorPosition.x
|
|
112
|
+
* @param cursorPosition.y
|
|
113
|
+
*/
|
|
114
|
+
private calculateNewTargetWithoutModel;
|
|
115
|
+
/**
|
|
116
|
+
* Calculates new camera target based on cursor position.
|
|
117
|
+
* @param event MouseEvent that contains pointer location data.
|
|
118
|
+
*/
|
|
119
|
+
private calculateNewTarget;
|
|
120
|
+
/**
|
|
121
|
+
* Removes controls event listeners if they are defined.
|
|
122
|
+
*/
|
|
123
|
+
private teardownControls;
|
|
124
|
+
private handleMouseWheelActionChange;
|
|
125
|
+
/**
|
|
126
|
+
* Method for setting up camera controls listeners and values inside current controls class.
|
|
127
|
+
*/
|
|
128
|
+
private setupControls;
|
|
129
|
+
/**
|
|
130
|
+
* Convert pixel coordinates of the cursor to [-1,1]^2 coordinates.
|
|
131
|
+
* @param pixelX
|
|
132
|
+
* @param pixelY
|
|
133
|
+
*/
|
|
134
|
+
private convertPixelCoordinatesToNormalized;
|
|
135
|
+
private calculateDefaultDuration;
|
|
136
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright 2021 Cognite AS
|
|
3
|
-
*/
|
|
4
|
-
export default class Keyboard {
|
|
5
|
-
private keys;
|
|
6
|
-
private _disabled;
|
|
7
|
-
get disabled(): boolean;
|
|
8
|
-
set disabled(isDisabled: boolean);
|
|
9
|
-
constructor();
|
|
10
|
-
isPressed(key: string): boolean;
|
|
11
|
-
comsumePressed(key: string): boolean;
|
|
12
|
-
private readonly addEventListeners;
|
|
13
|
-
private readonly removeEventListeners;
|
|
14
|
-
private readonly onKeydown;
|
|
15
|
-
private readonly onKeyup;
|
|
16
|
-
private readonly clearPressedKeys;
|
|
17
|
-
}
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 Cognite AS
|
|
3
|
+
*/
|
|
4
|
+
export default class Keyboard {
|
|
5
|
+
private keys;
|
|
6
|
+
private _disabled;
|
|
7
|
+
get disabled(): boolean;
|
|
8
|
+
set disabled(isDisabled: boolean);
|
|
9
|
+
constructor();
|
|
10
|
+
isPressed(key: string): boolean;
|
|
11
|
+
comsumePressed(key: string): boolean;
|
|
12
|
+
private readonly addEventListeners;
|
|
13
|
+
private readonly removeEventListeners;
|
|
14
|
+
private readonly onKeydown;
|
|
15
|
+
private readonly onKeyup;
|
|
16
|
+
private readonly clearPressedKeys;
|
|
17
|
+
}
|