|
3 | 3 | */
|
4 | 4 |
|
5 | 5 | import * as THREE from 'three';
|
| 6 | + |
6 | 7 | import TWEEN from '@tweenjs/tween.js';
|
7 | 8 | import debounce from 'lodash/debounce';
|
8 | 9 | import omit from 'lodash/omit';
|
@@ -664,6 +665,24 @@ export class Cognite3DViewer {
|
664 | 665 | this.controls.setState(this.getCameraPosition(), target);
|
665 | 666 | }
|
666 | 667 |
|
| 668 | + /** |
| 669 | + * Gets wheter camera controls through mouse, touch and keyboard are enabled. |
| 670 | + * @version new in 1.2.0 |
| 671 | + */ |
| 672 | + get cameraControlsEnabled(): boolean { |
| 673 | + return this.controls.enabled; |
| 674 | + } |
| 675 | + |
| 676 | + /** |
| 677 | + * Sets wheter camera controls through mouse, touch and keyboard are enabled. |
| 678 | + * This can be useful to e.g. temporarily disable navigation when manipulating other |
| 679 | + * objects in the scene or when implementing a "cinematic" viewer. |
| 680 | + * @version new in 1.2.0 |
| 681 | + */ |
| 682 | + set cameraControlsEnabled(enabled: boolean) { |
| 683 | + this.controls.enabled = enabled; |
| 684 | + } |
| 685 | + |
667 | 686 | /**
|
668 | 687 | * Attempts to load the camera settings from the settings stored for the
|
669 | 688 | * provided model. See {@link https://docs.cognite.com/api/v1/#operation/get3DRevision}
|
@@ -1258,11 +1277,11 @@ export class Cognite3DViewer {
|
1258 | 1277 | };
|
1259 | 1278 |
|
1260 | 1279 | // down
|
1261 |
| - canvas.addEventListener('mousedown', onDown); |
1262 |
| - canvas.addEventListener('touchstart', onDown); |
| 1280 | + // canvas.addEventListener('mousedown', onDown); |
| 1281 | + // canvas.addEventListener('touchstart', onDown); |
1263 | 1282 |
|
1264 | 1283 | // on hover callback
|
1265 |
| - canvas.addEventListener('mousemove', onHoverCallback); |
| 1284 | + // canvas.addEventListener('mousemove', onHoverCallback); |
1266 | 1285 | };
|
1267 | 1286 | }
|
1268 | 1287 |
|
|
0 commit comments