@shapediver/viewer.rendering-engine.camera-engine 2.12.7 → 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/dist/implementation/CameraEngine.d.ts +5 -7
- package/dist/implementation/CameraEngine.d.ts.map +1 -1
- package/dist/implementation/CameraEngine.js +68 -27
- package/dist/implementation/CameraEngine.js.map +1 -1
- package/dist/implementation/camera/AbstractCamera.d.ts +7 -5
- package/dist/implementation/camera/AbstractCamera.d.ts.map +1 -1
- package/dist/implementation/camera/AbstractCamera.js +15 -8
- package/dist/implementation/camera/AbstractCamera.js.map +1 -1
- package/dist/implementation/camera/OrthographicCamera.d.ts +10 -13
- package/dist/implementation/camera/OrthographicCamera.d.ts.map +1 -1
- package/dist/implementation/camera/OrthographicCamera.js +53 -52
- package/dist/implementation/camera/OrthographicCamera.js.map +1 -1
- package/dist/implementation/camera/PerspectiveCamera.d.ts +9 -12
- package/dist/implementation/camera/PerspectiveCamera.d.ts.map +1 -1
- package/dist/implementation/camera/PerspectiveCamera.js +33 -38
- package/dist/implementation/camera/PerspectiveCamera.js.map +1 -1
- package/dist/implementation/controls/AbstractCameraControls.d.ts +156 -5
- package/dist/implementation/controls/AbstractCameraControls.d.ts.map +1 -1
- package/dist/implementation/controls/AbstractCameraControls.js +260 -6
- package/dist/implementation/controls/AbstractCameraControls.js.map +1 -1
- package/dist/implementation/controls/CameraControlsEventDistribution.d.ts +38 -0
- package/dist/implementation/controls/CameraControlsEventDistribution.d.ts.map +1 -0
- package/dist/implementation/controls/{perspective/CameraControlsEventDistribution.js → CameraControlsEventDistribution.js} +71 -71
- package/dist/implementation/controls/CameraControlsEventDistribution.js.map +1 -0
- package/dist/implementation/controls/{perspective/CameraControlsLogic.d.ts → CameraControlsLogic.d.ts} +5 -5
- package/dist/implementation/controls/CameraControlsLogic.d.ts.map +1 -0
- package/dist/implementation/controls/{perspective/CameraControlsLogic.js → CameraControlsLogic.js} +74 -44
- package/dist/implementation/controls/CameraControlsLogic.js.map +1 -0
- package/dist/implementation/controls/OrthographicCameraControls.d.ts +4 -67
- package/dist/implementation/controls/OrthographicCameraControls.d.ts.map +1 -1
- package/dist/implementation/controls/OrthographicCameraControls.js +22 -90
- package/dist/implementation/controls/OrthographicCameraControls.js.map +1 -1
- package/dist/implementation/controls/PerspectiveCameraControls.d.ts +4 -151
- package/dist/implementation/controls/PerspectiveCameraControls.d.ts.map +1 -1
- package/dist/implementation/controls/PerspectiveCameraControls.js +21 -247
- package/dist/implementation/controls/PerspectiveCameraControls.js.map +1 -1
- package/dist/implementation/interpolation/CameraInterpolationManager.d.ts +3 -3
- package/dist/implementation/interpolation/CameraInterpolationManager.d.ts.map +1 -1
- package/dist/implementation/interpolation/CameraInterpolationManager.js +5 -5
- package/dist/implementation/interpolation/CameraInterpolationManager.js.map +1 -1
- package/dist/implementation/interpolation/interpolationMethods/CameraCylindricalInterpolation.d.ts +3 -3
- package/dist/implementation/interpolation/interpolationMethods/CameraCylindricalInterpolation.d.ts.map +1 -1
- package/dist/implementation/interpolation/interpolationMethods/CameraCylindricalInterpolation.js +11 -11
- package/dist/implementation/interpolation/interpolationMethods/CameraCylindricalInterpolation.js.map +1 -1
- package/dist/implementation/interpolation/interpolationMethods/CameraLinearInterpolation.d.ts +3 -3
- package/dist/implementation/interpolation/interpolationMethods/CameraLinearInterpolation.d.ts.map +1 -1
- package/dist/implementation/interpolation/interpolationMethods/CameraLinearInterpolation.js +6 -6
- package/dist/implementation/interpolation/interpolationMethods/CameraLinearInterpolation.js.map +1 -1
- package/dist/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.d.ts +4 -4
- package/dist/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.d.ts.map +1 -1
- package/dist/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.js +6 -6
- package/dist/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.js.map +1 -1
- package/dist/implementation/interpolation/interpolationMethods/CameraOrthographicInterpolation.d.ts +3 -3
- package/dist/implementation/interpolation/interpolationMethods/CameraOrthographicInterpolation.d.ts.map +1 -1
- package/dist/implementation/interpolation/interpolationMethods/CameraOrthographicInterpolation.js +6 -6
- package/dist/implementation/interpolation/interpolationMethods/CameraOrthographicInterpolation.js.map +1 -1
- package/dist/implementation/interpolation/interpolationMethods/CameraSphericalInterpolation.d.ts +3 -3
- package/dist/implementation/interpolation/interpolationMethods/CameraSphericalInterpolation.d.ts.map +1 -1
- package/dist/implementation/interpolation/interpolationMethods/CameraSphericalInterpolation.js +9 -9
- package/dist/implementation/interpolation/interpolationMethods/CameraSphericalInterpolation.js.map +1 -1
- package/dist/index.d.ts +6 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/interfaces/ICameraEngine.d.ts +7 -7
- package/dist/interfaces/ICameraEngine.d.ts.map +1 -1
- package/dist/interfaces/ICameraEngine.js +3 -0
- package/dist/interfaces/ICameraEngine.js.map +1 -1
- package/dist/interfaces/camera/ICamera.d.ts +23 -22
- package/dist/interfaces/camera/ICamera.d.ts.map +1 -1
- package/dist/interfaces/camera/ICamera.js +1 -0
- package/dist/interfaces/camera/ICamera.js.map +1 -1
- package/dist/interfaces/camera/IOrthographicCamera.d.ts +8 -7
- package/dist/interfaces/camera/IOrthographicCamera.d.ts.map +1 -1
- package/dist/interfaces/camera/IOrthographicCamera.js +4 -0
- package/dist/interfaces/camera/IOrthographicCamera.js.map +1 -1
- package/dist/interfaces/camera/IPerspectiveCamera.d.ts +2 -2
- package/dist/interfaces/camera/IPerspectiveCamera.d.ts.map +1 -1
- package/dist/interfaces/controls/ICameraControls.d.ts +73 -2
- package/dist/interfaces/controls/ICameraControls.d.ts.map +1 -1
- package/dist/interfaces/controls/ICameraControls.js +1 -0
- package/dist/interfaces/controls/ICameraControls.js.map +1 -1
- package/dist/interfaces/controls/ICameraControlsEventDistribution.d.ts +1 -1
- package/dist/interfaces/controls/ICameraControlsEventDistribution.d.ts.map +1 -1
- package/dist/interfaces/controls/ICameraControlsLogic.d.ts +4 -1
- package/dist/interfaces/controls/ICameraControlsLogic.d.ts.map +1 -1
- package/dist/interfaces/interpolation/ICameraInterpolation.d.ts +2 -2
- package/dist/interfaces/interpolation/ICameraInterpolation.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/implementation/CameraEngine.ts +111 -70
- package/src/implementation/camera/AbstractCamera.ts +24 -16
- package/src/implementation/camera/OrthographicCamera.ts +84 -85
- package/src/implementation/camera/PerspectiveCamera.ts +64 -69
- package/src/implementation/controls/AbstractCameraControls.ts +303 -14
- package/src/implementation/controls/{perspective/CameraControlsEventDistribution.ts → CameraControlsEventDistribution.ts} +96 -75
- package/src/implementation/controls/{perspective/CameraControlsLogic.ts → CameraControlsLogic.ts} +90 -53
- package/src/implementation/controls/OrthographicCameraControls.ts +27 -121
- package/src/implementation/controls/PerspectiveCameraControls.ts +28 -294
- package/src/implementation/interpolation/CameraInterpolationManager.ts +40 -45
- package/src/implementation/interpolation/interpolationMethods/CameraCylindricalInterpolation.ts +19 -22
- package/src/implementation/interpolation/interpolationMethods/CameraLinearInterpolation.ts +15 -16
- package/src/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.ts +17 -19
- package/src/implementation/interpolation/interpolationMethods/CameraOrthographicInterpolation.ts +12 -14
- package/src/implementation/interpolation/interpolationMethods/CameraSphericalInterpolation.ts +18 -20
- package/src/index.ts +18 -21
- package/src/interfaces/ICameraEngine.ts +24 -11
- package/src/interfaces/camera/ICamera.ts +45 -41
- package/src/interfaces/camera/IOrthographicCamera.ts +27 -9
- package/src/interfaces/camera/IPerspectiveCamera.ts +13 -5
- package/src/interfaces/controls/ICameraControls.ts +49 -6
- package/src/interfaces/controls/ICameraControlsEventDistribution.ts +5 -2
- package/src/interfaces/controls/ICameraControlsLogic.ts +6 -3
- package/src/interfaces/interpolation/ICameraInterpolation.ts +6 -2
- package/dist/implementation/controls/orthographic/CameraControlsEventDistribution.d.ts +0 -32
- package/dist/implementation/controls/orthographic/CameraControlsEventDistribution.d.ts.map +0 -1
- package/dist/implementation/controls/orthographic/CameraControlsEventDistribution.js +0 -230
- package/dist/implementation/controls/orthographic/CameraControlsEventDistribution.js.map +0 -1
- package/dist/implementation/controls/orthographic/CameraControlsLogic.d.ts +0 -28
- package/dist/implementation/controls/orthographic/CameraControlsLogic.d.ts.map +0 -1
- package/dist/implementation/controls/orthographic/CameraControlsLogic.js +0 -243
- package/dist/implementation/controls/orthographic/CameraControlsLogic.js.map +0 -1
- package/dist/implementation/controls/perspective/CameraControlsEventDistribution.d.ts +0 -32
- package/dist/implementation/controls/perspective/CameraControlsEventDistribution.d.ts.map +0 -1
- package/dist/implementation/controls/perspective/CameraControlsEventDistribution.js.map +0 -1
- package/dist/implementation/controls/perspective/CameraControlsLogic.d.ts.map +0 -1
- package/dist/implementation/controls/perspective/CameraControlsLogic.js.map +0 -1
- package/dist/interfaces/controls/ICameraControlsUsage.d.ts +0 -22
- package/dist/interfaces/controls/ICameraControlsUsage.d.ts.map +0 -1
- package/dist/interfaces/controls/ICameraControlsUsage.js +0 -3
- package/dist/interfaces/controls/ICameraControlsUsage.js.map +0 -1
- package/dist/interfaces/controls/IOrthographicCameraControls.d.ts +0 -30
- package/dist/interfaces/controls/IOrthographicCameraControls.d.ts.map +0 -1
- package/dist/interfaces/controls/IOrthographicCameraControls.js +0 -3
- package/dist/interfaces/controls/IOrthographicCameraControls.js.map +0 -1
- package/dist/interfaces/controls/IPerspectiveCameraControls.d.ts +0 -65
- package/dist/interfaces/controls/IPerspectiveCameraControls.d.ts.map +0 -1
- package/dist/interfaces/controls/IPerspectiveCameraControls.js +0 -3
- package/dist/interfaces/controls/IPerspectiveCameraControls.js.map +0 -1
- package/src/implementation/controls/orthographic/CameraControlsEventDistribution.ts +0 -234
- package/src/implementation/controls/orthographic/CameraControlsLogic.ts +0 -271
- package/src/interfaces/controls/ICameraControlsUsage.ts +0 -30
- package/src/interfaces/controls/IOrthographicCameraControls.ts +0 -13
- package/src/interfaces/controls/IPerspectiveCameraControls.ts +0 -33
|
@@ -1,71 +1,8 @@
|
|
|
1
|
-
import { SettingsEngine } from '@shapediver/viewer.shared.services';
|
|
2
|
-
import { ICamera } from '../..';
|
|
3
|
-
import { IOrthographicCameraControls } from '../../interfaces/controls/IOrthographicCameraControls';
|
|
4
1
|
import { AbstractCameraControls } from './AbstractCameraControls';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
private
|
|
8
|
-
private
|
|
9
|
-
private _enableZoom;
|
|
10
|
-
private _input;
|
|
11
|
-
private _keyPanSpeed;
|
|
12
|
-
private _movementSmoothness;
|
|
13
|
-
private _panSpeed;
|
|
14
|
-
private _zoomSpeed;
|
|
15
|
-
private readonly _stateEngine;
|
|
2
|
+
import { ICamera } from '../..';
|
|
3
|
+
export declare class OrthographicCameraControls extends AbstractCameraControls {
|
|
4
|
+
private _settingsAdjustments;
|
|
5
|
+
private _touchAdjustments;
|
|
16
6
|
constructor(camera: ICamera, enabled: boolean);
|
|
17
|
-
applySettings(settingsEngine: SettingsEngine): void;
|
|
18
|
-
get damping(): number;
|
|
19
|
-
set damping(value: number);
|
|
20
|
-
get enableKeyPan(): boolean;
|
|
21
|
-
set enableKeyPan(value: boolean);
|
|
22
|
-
get enablePan(): boolean;
|
|
23
|
-
set enablePan(value: boolean);
|
|
24
|
-
get enableZoom(): boolean;
|
|
25
|
-
set enableZoom(value: boolean);
|
|
26
|
-
get input(): {
|
|
27
|
-
keys: {
|
|
28
|
-
up: number;
|
|
29
|
-
down: number;
|
|
30
|
-
left: number;
|
|
31
|
-
right: number;
|
|
32
|
-
};
|
|
33
|
-
mouse: {
|
|
34
|
-
rotate: number;
|
|
35
|
-
zoom: number;
|
|
36
|
-
pan: number;
|
|
37
|
-
};
|
|
38
|
-
touch: {
|
|
39
|
-
rotate: number;
|
|
40
|
-
zoom: number;
|
|
41
|
-
pan: number;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
set input(value: {
|
|
45
|
-
keys: {
|
|
46
|
-
up: number;
|
|
47
|
-
down: number;
|
|
48
|
-
left: number;
|
|
49
|
-
right: number;
|
|
50
|
-
};
|
|
51
|
-
mouse: {
|
|
52
|
-
rotate: number;
|
|
53
|
-
zoom: number;
|
|
54
|
-
pan: number;
|
|
55
|
-
};
|
|
56
|
-
touch: {
|
|
57
|
-
rotate: number;
|
|
58
|
-
zoom: number;
|
|
59
|
-
pan: number;
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
get keyPanSpeed(): number;
|
|
63
|
-
set keyPanSpeed(value: number);
|
|
64
|
-
get movementSmoothness(): number;
|
|
65
|
-
set movementSmoothness(value: number);
|
|
66
|
-
get panSpeed(): number;
|
|
67
|
-
set panSpeed(value: number);
|
|
68
|
-
get zoomSpeed(): number;
|
|
69
|
-
set zoomSpeed(value: number);
|
|
70
7
|
}
|
|
71
8
|
//# sourceMappingURL=OrthographicCameraControls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrthographicCameraControls.d.ts","sourceRoot":"","sources":["../../../src/implementation/controls/OrthographicCameraControls.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OrthographicCameraControls.d.ts","sourceRoot":"","sources":["../../../src/implementation/controls/OrthographicCameraControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,qBAAa,0BAA2B,SAAQ,sBAAsB;IAGlE,OAAO,CAAC,oBAAoB,CAO1B;IACF,OAAO,CAAC,iBAAiB,CAOvB;gBAMU,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;CAOhD"}
|
|
@@ -1,102 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OrthographicCameraControls = void 0;
|
|
4
|
-
const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
|
|
5
|
-
const __1 = require("../..");
|
|
6
4
|
const AbstractCameraControls_1 = require("./AbstractCameraControls");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
5
|
+
const CameraControlsLogic_1 = require("./CameraControlsLogic");
|
|
6
|
+
const CameraControlsEventDistribution_1 = require("./CameraControlsEventDistribution");
|
|
9
7
|
class OrthographicCameraControls extends AbstractCameraControls_1.AbstractCameraControls {
|
|
10
|
-
// #endregion Properties (
|
|
8
|
+
// #endregion Properties (2)
|
|
11
9
|
// #region Constructors (1)
|
|
12
10
|
constructor(camera, enabled) {
|
|
13
|
-
super(camera, enabled
|
|
14
|
-
// #region Properties (
|
|
15
|
-
this.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
this.
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
super(camera, enabled);
|
|
12
|
+
// #region Properties (2)
|
|
13
|
+
this._settingsAdjustments = {
|
|
14
|
+
autoRotationSpeed: 2 * Math.PI / 60 / 60,
|
|
15
|
+
damping: 1.0,
|
|
16
|
+
movementSmoothness: 1.0,
|
|
17
|
+
panSpeed: 1.75,
|
|
18
|
+
rotationSpeed: Math.PI,
|
|
19
|
+
zoomSpeed: 0.025,
|
|
20
|
+
};
|
|
21
|
+
this._touchAdjustments = {
|
|
22
|
+
autoRotationSpeed: 1.0,
|
|
23
|
+
damping: 1.0,
|
|
24
|
+
movementSmoothness: 1.0,
|
|
25
|
+
panSpeed: 4.0 / 1.75,
|
|
26
|
+
rotationSpeed: 1.5,
|
|
27
|
+
zoomSpeed: 100.0,
|
|
28
|
+
};
|
|
29
|
+
this._cameraLogic = new CameraControlsLogic_1.CameraControlsLogic(this, this._settingsAdjustments, this._touchAdjustments);
|
|
26
30
|
this._cameraControlsEventDistribution = new CameraControlsEventDistribution_1.CameraControlsEventDistribution(this, this._cameraLogic);
|
|
27
31
|
}
|
|
28
|
-
applySettings(settingsEngine) {
|
|
29
|
-
const cameraSetting = settingsEngine.camera.cameras[this.camera.id];
|
|
30
|
-
if (!cameraSetting)
|
|
31
|
-
return;
|
|
32
|
-
this.reset();
|
|
33
|
-
const controlsSettings = cameraSetting.controls;
|
|
34
|
-
this.damping = controlsSettings.damping;
|
|
35
|
-
this.enableKeyPan = controlsSettings.enableKeyPan;
|
|
36
|
-
this.enablePan = controlsSettings.enablePan;
|
|
37
|
-
this.enableZoom = controlsSettings.enableZoom;
|
|
38
|
-
// this.input = controlsSettings.input;
|
|
39
|
-
this.keyPanSpeed = controlsSettings.keyPanSpeed;
|
|
40
|
-
this.movementSmoothness = controlsSettings.movementSmoothness;
|
|
41
|
-
this.panSpeed = controlsSettings.panSpeed;
|
|
42
|
-
this.zoomSpeed = controlsSettings.zoomSpeed;
|
|
43
|
-
}
|
|
44
|
-
// #endregion Constructors (1)
|
|
45
|
-
// #region Public Accessors (18)
|
|
46
|
-
get damping() {
|
|
47
|
-
return this._damping;
|
|
48
|
-
}
|
|
49
|
-
set damping(value) {
|
|
50
|
-
this._damping = value;
|
|
51
|
-
}
|
|
52
|
-
get enableKeyPan() {
|
|
53
|
-
return this._enableKeyPan;
|
|
54
|
-
}
|
|
55
|
-
set enableKeyPan(value) {
|
|
56
|
-
this._enableKeyPan = value;
|
|
57
|
-
}
|
|
58
|
-
get enablePan() {
|
|
59
|
-
return this._enablePan;
|
|
60
|
-
}
|
|
61
|
-
set enablePan(value) {
|
|
62
|
-
this._enablePan = value;
|
|
63
|
-
}
|
|
64
|
-
get enableZoom() {
|
|
65
|
-
return this._enableZoom;
|
|
66
|
-
}
|
|
67
|
-
set enableZoom(value) {
|
|
68
|
-
this._enableZoom = value;
|
|
69
|
-
}
|
|
70
|
-
get input() {
|
|
71
|
-
return this._input;
|
|
72
|
-
}
|
|
73
|
-
set input(value) {
|
|
74
|
-
this._input = value;
|
|
75
|
-
}
|
|
76
|
-
get keyPanSpeed() {
|
|
77
|
-
return this._keyPanSpeed;
|
|
78
|
-
}
|
|
79
|
-
set keyPanSpeed(value) {
|
|
80
|
-
this._keyPanSpeed = value;
|
|
81
|
-
}
|
|
82
|
-
get movementSmoothness() {
|
|
83
|
-
return this._movementSmoothness;
|
|
84
|
-
}
|
|
85
|
-
set movementSmoothness(value) {
|
|
86
|
-
this._movementSmoothness = value;
|
|
87
|
-
}
|
|
88
|
-
get panSpeed() {
|
|
89
|
-
return this._panSpeed;
|
|
90
|
-
}
|
|
91
|
-
set panSpeed(value) {
|
|
92
|
-
this._panSpeed = value;
|
|
93
|
-
}
|
|
94
|
-
get zoomSpeed() {
|
|
95
|
-
return this._zoomSpeed;
|
|
96
|
-
}
|
|
97
|
-
set zoomSpeed(value) {
|
|
98
|
-
this._zoomSpeed = value;
|
|
99
|
-
}
|
|
100
32
|
}
|
|
101
33
|
exports.OrthographicCameraControls = OrthographicCameraControls;
|
|
102
34
|
//# sourceMappingURL=OrthographicCameraControls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrthographicCameraControls.js","sourceRoot":"","sources":["../../../src/implementation/controls/OrthographicCameraControls.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"OrthographicCameraControls.js","sourceRoot":"","sources":["../../../src/implementation/controls/OrthographicCameraControls.ts"],"names":[],"mappings":";;;AAAA,qEAAkE;AAElE,+DAA4D;AAC5D,uFAAqF;AACrF,MAAa,0BAA2B,SAAQ,+CAAsB;IAoBlE,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,MAAe,EAAE,OAAgB;QACzC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAxB3B,yBAAyB;QAEjB,yBAAoB,GAAG;YAC3B,iBAAiB,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE;YACxC,OAAO,EAAE,GAAG;YACZ,kBAAkB,EAAE,GAAG;YACvB,QAAQ,EAAE,IAAI;YACd,aAAa,EAAE,IAAI,CAAC,EAAE;YACtB,SAAS,EAAE,KAAK;SACnB,CAAC;QACM,sBAAiB,GAAG;YACxB,iBAAiB,EAAE,GAAG;YACtB,OAAO,EAAE,GAAG;YACZ,kBAAkB,EAAE,GAAG;YACvB,QAAQ,EAAE,GAAG,GAAG,IAAI;YACpB,aAAa,EAAE,GAAG;YAClB,SAAS,EAAE,KAAK;SACnB,CAAC;QAQE,IAAI,CAAC,YAAY,GAAG,IAAI,yCAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,oBAAoB,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACrG,IAAI,CAAC,gCAAgC,GAAG,IAAI,iEAA+B,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IACzG,CAAC;CAGJ;AA/BD,gEA+BC"}
|
|
@@ -1,155 +1,8 @@
|
|
|
1
|
-
import { SettingsEngine } from '@shapediver/viewer.shared.services';
|
|
2
|
-
import { vec3 } from 'gl-matrix';
|
|
3
|
-
import { ICamera } from '../..';
|
|
4
|
-
import { IPerspectiveCameraControls } from '../../interfaces/controls/IPerspectiveCameraControls';
|
|
5
1
|
import { AbstractCameraControls } from './AbstractCameraControls';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
private
|
|
9
|
-
private
|
|
10
|
-
private _cubePositionRestriction;
|
|
11
|
-
private _cubeTargetRestriction;
|
|
12
|
-
private _damping;
|
|
13
|
-
private _enableAutoRotation;
|
|
14
|
-
private _enableAzimuthRotation;
|
|
15
|
-
private _enableKeyPan;
|
|
16
|
-
private _enablePan;
|
|
17
|
-
private _enablePolarRotation;
|
|
18
|
-
private _enableRotation;
|
|
19
|
-
private _enableTurntableControls;
|
|
20
|
-
private _enableZoom;
|
|
21
|
-
private _input;
|
|
22
|
-
private _keyPanSpeed;
|
|
23
|
-
private _movementSmoothness;
|
|
24
|
-
private _panSpeed;
|
|
25
|
-
private _rotationRestriction;
|
|
26
|
-
private _rotationSpeed;
|
|
27
|
-
private _spherePositionRestriction;
|
|
28
|
-
private _sphereTargetRestriction;
|
|
29
|
-
private _turntableCenter;
|
|
30
|
-
private _zoomRestriction;
|
|
31
|
-
private _zoomSpeed;
|
|
2
|
+
import { ICamera } from '../..';
|
|
3
|
+
export declare class PerspectiveCameraControls extends AbstractCameraControls {
|
|
4
|
+
private _settingsAdjustments;
|
|
5
|
+
private _touchAdjustments;
|
|
32
6
|
constructor(camera: ICamera, enabled: boolean);
|
|
33
|
-
get autoRotationSpeed(): number;
|
|
34
|
-
set autoRotationSpeed(value: number);
|
|
35
|
-
get cubePositionRestriction(): {
|
|
36
|
-
min: vec3;
|
|
37
|
-
max: vec3;
|
|
38
|
-
};
|
|
39
|
-
set cubePositionRestriction(value: {
|
|
40
|
-
min: vec3;
|
|
41
|
-
max: vec3;
|
|
42
|
-
});
|
|
43
|
-
get cubeTargetRestriction(): {
|
|
44
|
-
min: vec3;
|
|
45
|
-
max: vec3;
|
|
46
|
-
};
|
|
47
|
-
set cubeTargetRestriction(value: {
|
|
48
|
-
min: vec3;
|
|
49
|
-
max: vec3;
|
|
50
|
-
});
|
|
51
|
-
get damping(): number;
|
|
52
|
-
set damping(value: number);
|
|
53
|
-
get enableAutoRotation(): boolean;
|
|
54
|
-
set enableAutoRotation(value: boolean);
|
|
55
|
-
get enableAzimuthRotation(): boolean;
|
|
56
|
-
set enableAzimuthRotation(value: boolean);
|
|
57
|
-
get enableKeyPan(): boolean;
|
|
58
|
-
set enableKeyPan(value: boolean);
|
|
59
|
-
get enablePan(): boolean;
|
|
60
|
-
set enablePan(value: boolean);
|
|
61
|
-
get enablePolarRotation(): boolean;
|
|
62
|
-
set enablePolarRotation(value: boolean);
|
|
63
|
-
get enableRotation(): boolean;
|
|
64
|
-
set enableRotation(value: boolean);
|
|
65
|
-
get enableTurntableControls(): boolean;
|
|
66
|
-
set enableTurntableControls(value: boolean);
|
|
67
|
-
get enableZoom(): boolean;
|
|
68
|
-
set enableZoom(value: boolean);
|
|
69
|
-
get input(): {
|
|
70
|
-
keys: {
|
|
71
|
-
up: number;
|
|
72
|
-
down: number;
|
|
73
|
-
left: number;
|
|
74
|
-
right: number;
|
|
75
|
-
};
|
|
76
|
-
mouse: {
|
|
77
|
-
rotate: number;
|
|
78
|
-
zoom: number;
|
|
79
|
-
pan: number;
|
|
80
|
-
};
|
|
81
|
-
touch: {
|
|
82
|
-
rotate: number;
|
|
83
|
-
zoom: number;
|
|
84
|
-
pan: number;
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
set input(value: {
|
|
88
|
-
keys: {
|
|
89
|
-
up: number;
|
|
90
|
-
down: number;
|
|
91
|
-
left: number;
|
|
92
|
-
right: number;
|
|
93
|
-
};
|
|
94
|
-
mouse: {
|
|
95
|
-
rotate: number;
|
|
96
|
-
zoom: number;
|
|
97
|
-
pan: number;
|
|
98
|
-
};
|
|
99
|
-
touch: {
|
|
100
|
-
rotate: number;
|
|
101
|
-
zoom: number;
|
|
102
|
-
pan: number;
|
|
103
|
-
};
|
|
104
|
-
});
|
|
105
|
-
get keyPanSpeed(): number;
|
|
106
|
-
set keyPanSpeed(value: number);
|
|
107
|
-
get movementSmoothness(): number;
|
|
108
|
-
set movementSmoothness(value: number);
|
|
109
|
-
get panSpeed(): number;
|
|
110
|
-
set panSpeed(value: number);
|
|
111
|
-
get rotationRestriction(): {
|
|
112
|
-
minPolarAngle: number;
|
|
113
|
-
maxPolarAngle: number;
|
|
114
|
-
minAzimuthAngle: number;
|
|
115
|
-
maxAzimuthAngle: number;
|
|
116
|
-
};
|
|
117
|
-
set rotationRestriction(value: {
|
|
118
|
-
minPolarAngle: number;
|
|
119
|
-
maxPolarAngle: number;
|
|
120
|
-
minAzimuthAngle: number;
|
|
121
|
-
maxAzimuthAngle: number;
|
|
122
|
-
});
|
|
123
|
-
get rotationSpeed(): number;
|
|
124
|
-
set rotationSpeed(value: number);
|
|
125
|
-
get spherePositionRestriction(): {
|
|
126
|
-
center: vec3;
|
|
127
|
-
radius: number;
|
|
128
|
-
};
|
|
129
|
-
set spherePositionRestriction(value: {
|
|
130
|
-
center: vec3;
|
|
131
|
-
radius: number;
|
|
132
|
-
});
|
|
133
|
-
get sphereTargetRestriction(): {
|
|
134
|
-
center: vec3;
|
|
135
|
-
radius: number;
|
|
136
|
-
};
|
|
137
|
-
set sphereTargetRestriction(value: {
|
|
138
|
-
center: vec3;
|
|
139
|
-
radius: number;
|
|
140
|
-
});
|
|
141
|
-
get turntableCenter(): vec3;
|
|
142
|
-
set turntableCenter(value: vec3);
|
|
143
|
-
get zoomRestriction(): {
|
|
144
|
-
minDistance: number;
|
|
145
|
-
maxDistance: number;
|
|
146
|
-
};
|
|
147
|
-
set zoomRestriction(value: {
|
|
148
|
-
minDistance: number;
|
|
149
|
-
maxDistance: number;
|
|
150
|
-
});
|
|
151
|
-
get zoomSpeed(): number;
|
|
152
|
-
set zoomSpeed(value: number);
|
|
153
|
-
applySettings(settingsEngine: SettingsEngine): void;
|
|
154
7
|
}
|
|
155
8
|
//# sourceMappingURL=PerspectiveCameraControls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PerspectiveCameraControls.d.ts","sourceRoot":"","sources":["../../../src/implementation/controls/PerspectiveCameraControls.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PerspectiveCameraControls.d.ts","sourceRoot":"","sources":["../../../src/implementation/controls/PerspectiveCameraControls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,qBAAa,yBAA0B,SAAQ,sBAAsB;IAGjE,OAAO,CAAC,oBAAoB,CAO1B;IACF,OAAO,CAAC,iBAAiB,CAOvB;gBAMU,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;CAOhD"}
|
|
@@ -1,259 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PerspectiveCameraControls = void 0;
|
|
4
|
-
const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
|
|
5
|
-
const gl_matrix_1 = require("gl-matrix");
|
|
6
|
-
const __1 = require("../..");
|
|
7
4
|
const AbstractCameraControls_1 = require("./AbstractCameraControls");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
5
|
+
const CameraControlsLogic_1 = require("./CameraControlsLogic");
|
|
6
|
+
const CameraControlsEventDistribution_1 = require("./CameraControlsEventDistribution");
|
|
10
7
|
class PerspectiveCameraControls extends AbstractCameraControls_1.AbstractCameraControls {
|
|
11
|
-
// #endregion Properties (
|
|
8
|
+
// #endregion Properties (3)
|
|
12
9
|
// #region Constructors (1)
|
|
13
10
|
constructor(camera, enabled) {
|
|
14
|
-
super(camera, enabled
|
|
15
|
-
// #region Properties (
|
|
16
|
-
this.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
this._enableAzimuthRotation = true;
|
|
24
|
-
this._enableKeyPan = false;
|
|
25
|
-
this._enablePan = true;
|
|
26
|
-
this._enablePolarRotation = true;
|
|
27
|
-
this._enableRotation = true;
|
|
28
|
-
this._enableTurntableControls = false;
|
|
29
|
-
this._enableZoom = true;
|
|
30
|
-
this._input = { keys: { up: 38, down: 40, left: 37, right: 39 }, mouse: { rotate: 0, zoom: 1, pan: 2 }, touch: { rotate: 1, zoom: 2, pan: 2 }, };
|
|
31
|
-
this._keyPanSpeed = 0.5;
|
|
32
|
-
this._movementSmoothness = 0.5;
|
|
33
|
-
this._panSpeed = 0.5;
|
|
34
|
-
this._rotationRestriction = { minPolarAngle: 0, maxPolarAngle: 180, minAzimuthAngle: -Infinity, maxAzimuthAngle: Infinity };
|
|
35
|
-
this._rotationSpeed = 0.5;
|
|
36
|
-
this._spherePositionRestriction = { center: gl_matrix_1.vec3.create(), radius: Infinity };
|
|
37
|
-
this._sphereTargetRestriction = { center: gl_matrix_1.vec3.create(), radius: Infinity };
|
|
38
|
-
this._turntableCenter = gl_matrix_1.vec3.create();
|
|
39
|
-
this._zoomRestriction = { minDistance: 0, maxDistance: Infinity };
|
|
40
|
-
this._zoomSpeed = 0.5;
|
|
41
|
-
this._cameraLogic = new CameraControlsLogic_1.CameraControlsLogic(this);
|
|
42
|
-
this._cameraControlsEventDistribution = new CameraControlsEventDistribution_1.CameraControlsEventDistribution(this, this._cameraLogic);
|
|
43
|
-
}
|
|
44
|
-
// #endregion Constructors (1)
|
|
45
|
-
// #region Public Accessors (46)
|
|
46
|
-
get autoRotationSpeed() {
|
|
47
|
-
return this._autoRotationSpeed;
|
|
48
|
-
}
|
|
49
|
-
set autoRotationSpeed(value) {
|
|
50
|
-
this._autoRotationSpeed = value;
|
|
51
|
-
}
|
|
52
|
-
get cubePositionRestriction() {
|
|
53
|
-
return this._cubePositionRestriction;
|
|
54
|
-
}
|
|
55
|
-
set cubePositionRestriction(value) {
|
|
56
|
-
this._cubePositionRestriction = value;
|
|
57
|
-
}
|
|
58
|
-
get cubeTargetRestriction() {
|
|
59
|
-
return this._cubeTargetRestriction;
|
|
60
|
-
}
|
|
61
|
-
set cubeTargetRestriction(value) {
|
|
62
|
-
this._cubeTargetRestriction = value;
|
|
63
|
-
}
|
|
64
|
-
get damping() {
|
|
65
|
-
return this._damping;
|
|
66
|
-
}
|
|
67
|
-
set damping(value) {
|
|
68
|
-
this._damping = value;
|
|
69
|
-
}
|
|
70
|
-
get enableAutoRotation() {
|
|
71
|
-
return this._enableAutoRotation;
|
|
72
|
-
}
|
|
73
|
-
set enableAutoRotation(value) {
|
|
74
|
-
this._enableAutoRotation = value;
|
|
75
|
-
}
|
|
76
|
-
get enableAzimuthRotation() {
|
|
77
|
-
return this._enableAzimuthRotation;
|
|
78
|
-
}
|
|
79
|
-
set enableAzimuthRotation(value) {
|
|
80
|
-
this._enableAzimuthRotation = value;
|
|
81
|
-
}
|
|
82
|
-
get enableKeyPan() {
|
|
83
|
-
return this._enableKeyPan;
|
|
84
|
-
}
|
|
85
|
-
set enableKeyPan(value) {
|
|
86
|
-
this._enableKeyPan = value;
|
|
87
|
-
}
|
|
88
|
-
get enablePan() {
|
|
89
|
-
return this._enablePan;
|
|
90
|
-
}
|
|
91
|
-
set enablePan(value) {
|
|
92
|
-
this._enablePan = value;
|
|
93
|
-
}
|
|
94
|
-
get enablePolarRotation() {
|
|
95
|
-
return this._enablePolarRotation;
|
|
96
|
-
}
|
|
97
|
-
set enablePolarRotation(value) {
|
|
98
|
-
this._enablePolarRotation = value;
|
|
99
|
-
}
|
|
100
|
-
get enableRotation() {
|
|
101
|
-
return this._enableRotation;
|
|
102
|
-
}
|
|
103
|
-
set enableRotation(value) {
|
|
104
|
-
this._enableRotation = value;
|
|
105
|
-
}
|
|
106
|
-
get enableTurntableControls() {
|
|
107
|
-
return this._enableTurntableControls;
|
|
108
|
-
}
|
|
109
|
-
set enableTurntableControls(value) {
|
|
110
|
-
this._enableTurntableControls = value;
|
|
111
|
-
}
|
|
112
|
-
get enableZoom() {
|
|
113
|
-
return this._enableZoom;
|
|
114
|
-
}
|
|
115
|
-
set enableZoom(value) {
|
|
116
|
-
this._enableZoom = value;
|
|
117
|
-
}
|
|
118
|
-
get input() {
|
|
119
|
-
return this._input;
|
|
120
|
-
}
|
|
121
|
-
set input(value) {
|
|
122
|
-
this._input = value;
|
|
123
|
-
}
|
|
124
|
-
get keyPanSpeed() {
|
|
125
|
-
return this._keyPanSpeed;
|
|
126
|
-
}
|
|
127
|
-
set keyPanSpeed(value) {
|
|
128
|
-
this._keyPanSpeed = value;
|
|
129
|
-
}
|
|
130
|
-
get movementSmoothness() {
|
|
131
|
-
return this._movementSmoothness;
|
|
132
|
-
}
|
|
133
|
-
set movementSmoothness(value) {
|
|
134
|
-
this._movementSmoothness = value;
|
|
135
|
-
}
|
|
136
|
-
get panSpeed() {
|
|
137
|
-
return this._panSpeed;
|
|
138
|
-
}
|
|
139
|
-
set panSpeed(value) {
|
|
140
|
-
this._panSpeed = value;
|
|
141
|
-
}
|
|
142
|
-
get rotationRestriction() {
|
|
143
|
-
return this._rotationRestriction;
|
|
144
|
-
}
|
|
145
|
-
set rotationRestriction(value) {
|
|
146
|
-
this._rotationRestriction = value;
|
|
147
|
-
}
|
|
148
|
-
get rotationSpeed() {
|
|
149
|
-
return this._rotationSpeed;
|
|
150
|
-
}
|
|
151
|
-
set rotationSpeed(value) {
|
|
152
|
-
this._rotationSpeed = value;
|
|
153
|
-
}
|
|
154
|
-
get spherePositionRestriction() {
|
|
155
|
-
return this._spherePositionRestriction;
|
|
156
|
-
}
|
|
157
|
-
set spherePositionRestriction(value) {
|
|
158
|
-
this._spherePositionRestriction = value;
|
|
159
|
-
}
|
|
160
|
-
get sphereTargetRestriction() {
|
|
161
|
-
return this._sphereTargetRestriction;
|
|
162
|
-
}
|
|
163
|
-
set sphereTargetRestriction(value) {
|
|
164
|
-
this._sphereTargetRestriction = value;
|
|
165
|
-
}
|
|
166
|
-
get turntableCenter() {
|
|
167
|
-
return this._turntableCenter;
|
|
168
|
-
}
|
|
169
|
-
set turntableCenter(value) {
|
|
170
|
-
this._turntableCenter = value;
|
|
171
|
-
}
|
|
172
|
-
get zoomRestriction() {
|
|
173
|
-
return this._zoomRestriction;
|
|
174
|
-
}
|
|
175
|
-
set zoomRestriction(value) {
|
|
176
|
-
this._zoomRestriction = value;
|
|
177
|
-
}
|
|
178
|
-
get zoomSpeed() {
|
|
179
|
-
return this._zoomSpeed;
|
|
180
|
-
}
|
|
181
|
-
set zoomSpeed(value) {
|
|
182
|
-
this._zoomSpeed = value;
|
|
183
|
-
}
|
|
184
|
-
// #endregion Public Accessors (46)
|
|
185
|
-
// #region Public Methods (1)
|
|
186
|
-
applySettings(settingsEngine) {
|
|
187
|
-
const cameraSetting = settingsEngine.camera.cameras[this.camera.id];
|
|
188
|
-
if (!cameraSetting)
|
|
189
|
-
return;
|
|
190
|
-
this.reset();
|
|
191
|
-
const controlsSettings = cameraSetting.controls;
|
|
192
|
-
this.autoRotationSpeed = controlsSettings.autoRotationSpeed;
|
|
193
|
-
this.damping = controlsSettings.damping;
|
|
194
|
-
this.enableAutoRotation = controlsSettings.enableAutoRotation;
|
|
195
|
-
this.enableKeyPan = controlsSettings.enableKeyPan;
|
|
196
|
-
this.enablePan = controlsSettings.enablePan;
|
|
197
|
-
this.enableRotation = controlsSettings.enableRotation;
|
|
198
|
-
this.enableZoom = controlsSettings.enableZoom;
|
|
199
|
-
// this.input = controlsSettings.input;
|
|
200
|
-
this.keyPanSpeed = controlsSettings.keyPanSpeed;
|
|
201
|
-
this.movementSmoothness = controlsSettings.movementSmoothness;
|
|
202
|
-
this.rotationSpeed = controlsSettings.rotationSpeed;
|
|
203
|
-
this.panSpeed = controlsSettings.panSpeed;
|
|
204
|
-
this.zoomSpeed = controlsSettings.zoomSpeed;
|
|
205
|
-
if (controlsSettings.restrictions.position.cube.min.x === null)
|
|
206
|
-
controlsSettings.restrictions.position.cube.min.x = -Infinity;
|
|
207
|
-
if (controlsSettings.restrictions.position.cube.min.y === null)
|
|
208
|
-
controlsSettings.restrictions.position.cube.min.y = -Infinity;
|
|
209
|
-
if (controlsSettings.restrictions.position.cube.min.z === null)
|
|
210
|
-
controlsSettings.restrictions.position.cube.min.z = -Infinity;
|
|
211
|
-
if (controlsSettings.restrictions.position.cube.max.x === null)
|
|
212
|
-
controlsSettings.restrictions.position.cube.max.x = Infinity;
|
|
213
|
-
if (controlsSettings.restrictions.position.cube.max.y === null)
|
|
214
|
-
controlsSettings.restrictions.position.cube.max.y = Infinity;
|
|
215
|
-
if (controlsSettings.restrictions.position.cube.max.z === null)
|
|
216
|
-
controlsSettings.restrictions.position.cube.max.z = Infinity;
|
|
217
|
-
if (controlsSettings.restrictions.position.sphere.radius === null)
|
|
218
|
-
controlsSettings.restrictions.position.sphere.radius = Infinity;
|
|
219
|
-
if (controlsSettings.restrictions.target.cube.min.x === null)
|
|
220
|
-
controlsSettings.restrictions.target.cube.min.x = -Infinity;
|
|
221
|
-
if (controlsSettings.restrictions.target.cube.min.y === null)
|
|
222
|
-
controlsSettings.restrictions.target.cube.min.y = -Infinity;
|
|
223
|
-
if (controlsSettings.restrictions.target.cube.min.z === null)
|
|
224
|
-
controlsSettings.restrictions.target.cube.min.z = -Infinity;
|
|
225
|
-
if (controlsSettings.restrictions.target.cube.max.x === null)
|
|
226
|
-
controlsSettings.restrictions.target.cube.max.x = Infinity;
|
|
227
|
-
if (controlsSettings.restrictions.target.cube.max.y === null)
|
|
228
|
-
controlsSettings.restrictions.target.cube.max.y = Infinity;
|
|
229
|
-
if (controlsSettings.restrictions.target.cube.max.z === null)
|
|
230
|
-
controlsSettings.restrictions.target.cube.max.z = Infinity;
|
|
231
|
-
if (controlsSettings.restrictions.target.sphere.radius === null)
|
|
232
|
-
controlsSettings.restrictions.target.sphere.radius = Infinity;
|
|
233
|
-
if (controlsSettings.restrictions.rotation.minAzimuthAngle === null)
|
|
234
|
-
controlsSettings.restrictions.rotation.minAzimuthAngle = -Infinity;
|
|
235
|
-
if (controlsSettings.restrictions.rotation.maxAzimuthAngle === null)
|
|
236
|
-
controlsSettings.restrictions.rotation.maxAzimuthAngle = Infinity;
|
|
237
|
-
if (controlsSettings.restrictions.zoom.maxDistance === null)
|
|
238
|
-
controlsSettings.restrictions.zoom.maxDistance = Infinity;
|
|
239
|
-
this.cubePositionRestriction = {
|
|
240
|
-
min: this._converter.toVec3(controlsSettings.restrictions.position.cube.min),
|
|
241
|
-
max: this._converter.toVec3(controlsSettings.restrictions.position.cube.max)
|
|
11
|
+
super(camera, enabled);
|
|
12
|
+
// #region Properties (3)
|
|
13
|
+
this._settingsAdjustments = {
|
|
14
|
+
autoRotationSpeed: 2 * Math.PI / 60 / 60,
|
|
15
|
+
damping: 1.0,
|
|
16
|
+
movementSmoothness: 1.0,
|
|
17
|
+
panSpeed: 1.75,
|
|
18
|
+
rotationSpeed: Math.PI,
|
|
19
|
+
zoomSpeed: 0.025,
|
|
242
20
|
};
|
|
243
|
-
this.
|
|
244
|
-
|
|
245
|
-
|
|
21
|
+
this._touchAdjustments = {
|
|
22
|
+
autoRotationSpeed: 1.0,
|
|
23
|
+
damping: 1.0,
|
|
24
|
+
movementSmoothness: 1.0,
|
|
25
|
+
panSpeed: 1.0 / 1.75,
|
|
26
|
+
rotationSpeed: 1.5,
|
|
27
|
+
zoomSpeed: 100.0,
|
|
246
28
|
};
|
|
247
|
-
this.
|
|
248
|
-
|
|
249
|
-
max: this._converter.toVec3(controlsSettings.restrictions.target.cube.max)
|
|
250
|
-
};
|
|
251
|
-
this.sphereTargetRestriction = {
|
|
252
|
-
center: this._converter.toVec3(controlsSettings.restrictions.target.sphere.center),
|
|
253
|
-
radius: controlsSettings.restrictions.target.sphere.radius
|
|
254
|
-
};
|
|
255
|
-
this.rotationRestriction = controlsSettings.restrictions.rotation;
|
|
256
|
-
this.zoomRestriction = controlsSettings.restrictions.zoom;
|
|
29
|
+
this._cameraLogic = new CameraControlsLogic_1.CameraControlsLogic(this, this._settingsAdjustments, this._touchAdjustments);
|
|
30
|
+
this._cameraControlsEventDistribution = new CameraControlsEventDistribution_1.CameraControlsEventDistribution(this, this._cameraLogic);
|
|
257
31
|
}
|
|
258
32
|
}
|
|
259
33
|
exports.PerspectiveCameraControls = PerspectiveCameraControls;
|