@shapediver/viewer.rendering-engine.camera-engine 2.11.0 → 2.12.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/implementation/camera/AbstractCamera.d.ts +5 -3
- package/dist/implementation/camera/AbstractCamera.d.ts.map +1 -1
- package/dist/implementation/camera/AbstractCamera.js +26 -18
- package/dist/implementation/camera/AbstractCamera.js.map +1 -1
- package/dist/implementation/controls/AbstractCameraControls.d.ts +13 -7
- package/dist/implementation/controls/AbstractCameraControls.d.ts.map +1 -1
- package/dist/implementation/controls/AbstractCameraControls.js +71 -38
- package/dist/implementation/controls/AbstractCameraControls.js.map +1 -1
- package/dist/implementation/controls/OrthographicCameraControls.d.ts.map +1 -1
- package/dist/implementation/controls/OrthographicCameraControls.js +2 -2
- package/dist/implementation/controls/OrthographicCameraControls.js.map +1 -1
- package/dist/implementation/controls/PerspectiveCameraControls.d.ts +15 -3
- package/dist/implementation/controls/PerspectiveCameraControls.d.ts.map +1 -1
- package/dist/implementation/controls/PerspectiveCameraControls.js +108 -78
- package/dist/implementation/controls/PerspectiveCameraControls.js.map +1 -1
- package/dist/implementation/controls/orthographic/CameraControlsEventDistribution.d.ts +3 -3
- package/dist/implementation/controls/orthographic/CameraControlsEventDistribution.d.ts.map +1 -1
- package/dist/implementation/controls/orthographic/CameraControlsEventDistribution.js +31 -23
- package/dist/implementation/controls/orthographic/CameraControlsEventDistribution.js.map +1 -1
- package/dist/implementation/controls/orthographic/CameraControlsLogic.d.ts.map +1 -1
- package/dist/implementation/controls/orthographic/CameraControlsLogic.js +36 -38
- package/dist/implementation/controls/orthographic/CameraControlsLogic.js.map +1 -1
- package/dist/implementation/controls/perspective/CameraControlsEventDistribution.d.ts +4 -4
- package/dist/implementation/controls/perspective/CameraControlsEventDistribution.d.ts.map +1 -1
- package/dist/implementation/controls/perspective/CameraControlsEventDistribution.js +39 -32
- package/dist/implementation/controls/perspective/CameraControlsEventDistribution.js.map +1 -1
- package/dist/implementation/controls/perspective/CameraControlsLogic.d.ts +3 -2
- package/dist/implementation/controls/perspective/CameraControlsLogic.d.ts.map +1 -1
- package/dist/implementation/controls/perspective/CameraControlsLogic.js +88 -66
- package/dist/implementation/controls/perspective/CameraControlsLogic.js.map +1 -1
- package/dist/interfaces/camera/ICamera.d.ts +9 -8
- package/dist/interfaces/camera/ICamera.d.ts.map +1 -1
- package/dist/interfaces/controls/ICameraControls.d.ts +4 -3
- package/dist/interfaces/controls/ICameraControls.d.ts.map +1 -1
- package/dist/interfaces/controls/ICameraControlsLogic.d.ts +3 -2
- package/dist/interfaces/controls/ICameraControlsLogic.d.ts.map +1 -1
- package/dist/interfaces/controls/IPerspectiveCameraControls.d.ts +4 -0
- package/dist/interfaces/controls/IPerspectiveCameraControls.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/implementation/camera/AbstractCamera.ts +44 -37
- package/src/implementation/controls/AbstractCameraControls.ts +113 -70
- package/src/implementation/controls/OrthographicCameraControls.ts +9 -9
- package/src/implementation/controls/PerspectiveCameraControls.ts +114 -73
- package/src/implementation/controls/orthographic/CameraControlsEventDistribution.ts +61 -56
- package/src/implementation/controls/orthographic/CameraControlsLogic.ts +45 -53
- package/src/implementation/controls/perspective/CameraControlsEventDistribution.ts +83 -80
- package/src/implementation/controls/perspective/CameraControlsLogic.ts +100 -81
- package/src/interfaces/camera/ICamera.ts +31 -26
- package/src/interfaces/controls/ICameraControls.ts +5 -5
- package/src/interfaces/controls/ICameraControlsLogic.ts +6 -2
- package/src/interfaces/controls/IPerspectiveCameraControls.ts +10 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrthographicCameraControls.js","sourceRoot":"","sources":["../../../src/implementation/controls/OrthographicCameraControls.ts"],"names":[],"mappings":";;;AACA,+
|
|
1
|
+
{"version":3,"file":"OrthographicCameraControls.js","sourceRoot":"","sources":["../../../src/implementation/controls/OrthographicCameraControls.ts"],"names":[],"mappings":";;;AACA,+EAAiF;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AAW,KAAK;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED,IAAW,KAAK,CAAC,KAAsL;QACnM,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAED,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,IAAW,WAAW,CAAC,KAAa;QAChC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC9B,CAAC;IAED,IAAW,kBAAkB;QACzB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IACpC,CAAC;IAED,IAAW,kBAAkB,CAAC,KAAa;QACvC,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;IACrC,CAAC;IAED,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,IAAW,QAAQ,CAAC,KAAa;QAC7B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,IAAW,SAAS,CAAC,KAAa;QAC9B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC5B,CAAC;CAGJ;AAtHD,gEAsHC"}
|
|
@@ -4,14 +4,19 @@ import { ICamera } from '../..';
|
|
|
4
4
|
import { IPerspectiveCameraControls } from '../../interfaces/controls/IPerspectiveCameraControls';
|
|
5
5
|
import { AbstractCameraControls } from './AbstractCameraControls';
|
|
6
6
|
export declare class PerspectiveCameraControls extends AbstractCameraControls implements IPerspectiveCameraControls {
|
|
7
|
+
private readonly _converter;
|
|
8
|
+
private readonly _stateEngine;
|
|
7
9
|
private _autoRotationSpeed;
|
|
8
10
|
private _cubePositionRestriction;
|
|
9
11
|
private _cubeTargetRestriction;
|
|
10
12
|
private _damping;
|
|
11
13
|
private _enableAutoRotation;
|
|
14
|
+
private _enableAzimuthRotation;
|
|
12
15
|
private _enableKeyPan;
|
|
13
16
|
private _enablePan;
|
|
17
|
+
private _enablePolarRotation;
|
|
14
18
|
private _enableRotation;
|
|
19
|
+
private _enableTurntableControls;
|
|
15
20
|
private _enableZoom;
|
|
16
21
|
private _input;
|
|
17
22
|
private _keyPanSpeed;
|
|
@@ -21,12 +26,10 @@ export declare class PerspectiveCameraControls extends AbstractCameraControls im
|
|
|
21
26
|
private _rotationSpeed;
|
|
22
27
|
private _spherePositionRestriction;
|
|
23
28
|
private _sphereTargetRestriction;
|
|
29
|
+
private _turntableCenter;
|
|
24
30
|
private _zoomRestriction;
|
|
25
31
|
private _zoomSpeed;
|
|
26
|
-
private readonly _converter;
|
|
27
|
-
private readonly _stateEngine;
|
|
28
32
|
constructor(camera: ICamera, enabled: boolean);
|
|
29
|
-
applySettings(settingsEngine: SettingsEngine): void;
|
|
30
33
|
get autoRotationSpeed(): number;
|
|
31
34
|
set autoRotationSpeed(value: number);
|
|
32
35
|
get cubePositionRestriction(): {
|
|
@@ -49,12 +52,18 @@ export declare class PerspectiveCameraControls extends AbstractCameraControls im
|
|
|
49
52
|
set damping(value: number);
|
|
50
53
|
get enableAutoRotation(): boolean;
|
|
51
54
|
set enableAutoRotation(value: boolean);
|
|
55
|
+
get enableAzimuthRotation(): boolean;
|
|
56
|
+
set enableAzimuthRotation(value: boolean);
|
|
52
57
|
get enableKeyPan(): boolean;
|
|
53
58
|
set enableKeyPan(value: boolean);
|
|
54
59
|
get enablePan(): boolean;
|
|
55
60
|
set enablePan(value: boolean);
|
|
61
|
+
get enablePolarRotation(): boolean;
|
|
62
|
+
set enablePolarRotation(value: boolean);
|
|
56
63
|
get enableRotation(): boolean;
|
|
57
64
|
set enableRotation(value: boolean);
|
|
65
|
+
get enableTurntableControls(): boolean;
|
|
66
|
+
set enableTurntableControls(value: boolean);
|
|
58
67
|
get enableZoom(): boolean;
|
|
59
68
|
set enableZoom(value: boolean);
|
|
60
69
|
get input(): {
|
|
@@ -129,6 +138,8 @@ export declare class PerspectiveCameraControls extends AbstractCameraControls im
|
|
|
129
138
|
center: vec3;
|
|
130
139
|
radius: number;
|
|
131
140
|
});
|
|
141
|
+
get turntableCenter(): vec3;
|
|
142
|
+
set turntableCenter(value: vec3);
|
|
132
143
|
get zoomRestriction(): {
|
|
133
144
|
minDistance: number;
|
|
134
145
|
maxDistance: number;
|
|
@@ -139,5 +150,6 @@ export declare class PerspectiveCameraControls extends AbstractCameraControls im
|
|
|
139
150
|
});
|
|
140
151
|
get zoomSpeed(): number;
|
|
141
152
|
set zoomSpeed(value: number);
|
|
153
|
+
applySettings(settingsEngine: SettingsEngine): void;
|
|
142
154
|
}
|
|
143
155
|
//# sourceMappingURL=PerspectiveCameraControls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PerspectiveCameraControls.d.ts","sourceRoot":"","sources":["../../../src/implementation/controls/PerspectiveCameraControls.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAA0B,MAAM,oCAAoC,
|
|
1
|
+
{"version":3,"file":"PerspectiveCameraControls.d.ts","sourceRoot":"","sources":["../../../src/implementation/controls/PerspectiveCameraControls.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAA0B,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAe,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sDAAsD,CAAC;AAClG,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAMlE,qBAAa,yBAA0B,SAAQ,sBAAuB,YAAW,0BAA0B;IAGvG,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAiC;IAC5D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAqC;IAElE,OAAO,CAAC,kBAAkB,CAAa;IACvC,OAAO,CAAC,wBAAwB,CAA2I;IAC3K,OAAO,CAAC,sBAAsB,CAA2I;IACzK,OAAO,CAAC,QAAQ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AE,EAE3E;IAED,IAAW,uBAAuB,IAAI;QAAE,MAAM,EAAE,IAAI,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAErE;IAED,IAAW,uBAAuB,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,IAAI,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAEzE;IAED,IAAW,eAAe,IAAI,IAAI,CAEjC;IAED,IAAW,eAAe,CAAC,KAAK,EAAE,IAAI,EAErC;IAED,IAAW,eAAe,IAAI;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAEzE;IAED,IAAW,eAAe,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,EAE7E;IAED,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED,IAAW,SAAS,CAAC,KAAK,EAAE,MAAM,EAEjC;IAMM,aAAa,CAAC,cAAc,EAAE,cAAc;CA0DtD"}
|
|
@@ -8,21 +8,26 @@ const AbstractCameraControls_1 = require("./AbstractCameraControls");
|
|
|
8
8
|
const CameraControlsEventDistribution_1 = require("./perspective/CameraControlsEventDistribution");
|
|
9
9
|
const CameraControlsLogic_1 = require("./perspective/CameraControlsLogic");
|
|
10
10
|
class PerspectiveCameraControls extends AbstractCameraControls_1.AbstractCameraControls {
|
|
11
|
-
// #endregion Properties (
|
|
11
|
+
// #endregion Properties (25)
|
|
12
12
|
// #region Constructors (1)
|
|
13
13
|
constructor(camera, enabled) {
|
|
14
14
|
super(camera, enabled, __1.CAMERA_TYPE.PERSPECTIVE);
|
|
15
|
-
// #region Properties (
|
|
15
|
+
// #region Properties (25)
|
|
16
|
+
this._converter = viewer_shared_services_1.Converter.instance;
|
|
17
|
+
this._stateEngine = viewer_shared_services_1.StateEngine.instance;
|
|
16
18
|
this._autoRotationSpeed = 0;
|
|
17
19
|
this._cubePositionRestriction = { min: gl_matrix_1.vec3.fromValues(-Infinity, -Infinity, -Infinity), max: gl_matrix_1.vec3.fromValues(Infinity, Infinity, Infinity) };
|
|
18
20
|
this._cubeTargetRestriction = { min: gl_matrix_1.vec3.fromValues(-Infinity, -Infinity, -Infinity), max: gl_matrix_1.vec3.fromValues(Infinity, Infinity, Infinity) };
|
|
19
21
|
this._damping = 0.1;
|
|
20
22
|
this._enableAutoRotation = false;
|
|
23
|
+
this._enableAzimuthRotation = true;
|
|
21
24
|
this._enableKeyPan = false;
|
|
22
25
|
this._enablePan = true;
|
|
26
|
+
this._enablePolarRotation = true;
|
|
23
27
|
this._enableRotation = true;
|
|
28
|
+
this._enableTurntableControls = false;
|
|
24
29
|
this._enableZoom = true;
|
|
25
|
-
this._input = { keys: { up: 38, down: 40, left: 37, right: 39 }, mouse: { rotate: 0, zoom: 1, pan: 2 }, touch: { rotate: 1, zoom: 2, pan:
|
|
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 }, };
|
|
26
31
|
this._keyPanSpeed = 0.5;
|
|
27
32
|
this._movementSmoothness = 0.5;
|
|
28
33
|
this._panSpeed = 0.5;
|
|
@@ -30,87 +35,14 @@ class PerspectiveCameraControls extends AbstractCameraControls_1.AbstractCameraC
|
|
|
30
35
|
this._rotationSpeed = 0.5;
|
|
31
36
|
this._spherePositionRestriction = { center: gl_matrix_1.vec3.create(), radius: Infinity };
|
|
32
37
|
this._sphereTargetRestriction = { center: gl_matrix_1.vec3.create(), radius: Infinity };
|
|
38
|
+
this._turntableCenter = gl_matrix_1.vec3.create();
|
|
33
39
|
this._zoomRestriction = { minDistance: 0, maxDistance: Infinity };
|
|
34
40
|
this._zoomSpeed = 0.5;
|
|
35
|
-
this._converter = viewer_shared_services_1.Converter.instance;
|
|
36
|
-
this._stateEngine = viewer_shared_services_1.StateEngine.instance;
|
|
37
41
|
this._cameraLogic = new CameraControlsLogic_1.CameraControlsLogic(this);
|
|
38
42
|
this._cameraControlsEventDistribution = new CameraControlsEventDistribution_1.CameraControlsEventDistribution(this, this._cameraLogic);
|
|
39
43
|
}
|
|
40
|
-
applySettings(settingsEngine) {
|
|
41
|
-
const cameraSetting = settingsEngine.camera.cameras[this.camera.id];
|
|
42
|
-
if (!cameraSetting)
|
|
43
|
-
return;
|
|
44
|
-
this.reset();
|
|
45
|
-
const controlsSettings = cameraSetting.controls;
|
|
46
|
-
this.autoRotationSpeed = controlsSettings.autoRotationSpeed;
|
|
47
|
-
this.damping = controlsSettings.damping;
|
|
48
|
-
this.enableAutoRotation = controlsSettings.enableAutoRotation;
|
|
49
|
-
this.enableKeyPan = controlsSettings.enableKeyPan;
|
|
50
|
-
this.enablePan = controlsSettings.enablePan;
|
|
51
|
-
this.enableRotation = controlsSettings.enableRotation;
|
|
52
|
-
this.enableZoom = controlsSettings.enableZoom;
|
|
53
|
-
this.input = controlsSettings.input;
|
|
54
|
-
this.keyPanSpeed = controlsSettings.keyPanSpeed;
|
|
55
|
-
this.movementSmoothness = controlsSettings.movementSmoothness;
|
|
56
|
-
this.rotationSpeed = controlsSettings.rotationSpeed;
|
|
57
|
-
this.panSpeed = controlsSettings.panSpeed;
|
|
58
|
-
this.zoomSpeed = controlsSettings.zoomSpeed;
|
|
59
|
-
if (controlsSettings.restrictions.position.cube.min.x === null)
|
|
60
|
-
controlsSettings.restrictions.position.cube.min.x = -Infinity;
|
|
61
|
-
if (controlsSettings.restrictions.position.cube.min.y === null)
|
|
62
|
-
controlsSettings.restrictions.position.cube.min.y = -Infinity;
|
|
63
|
-
if (controlsSettings.restrictions.position.cube.min.z === null)
|
|
64
|
-
controlsSettings.restrictions.position.cube.min.z = -Infinity;
|
|
65
|
-
if (controlsSettings.restrictions.position.cube.max.x === null)
|
|
66
|
-
controlsSettings.restrictions.position.cube.max.x = Infinity;
|
|
67
|
-
if (controlsSettings.restrictions.position.cube.max.y === null)
|
|
68
|
-
controlsSettings.restrictions.position.cube.max.y = Infinity;
|
|
69
|
-
if (controlsSettings.restrictions.position.cube.max.z === null)
|
|
70
|
-
controlsSettings.restrictions.position.cube.max.z = Infinity;
|
|
71
|
-
if (controlsSettings.restrictions.position.sphere.radius === null)
|
|
72
|
-
controlsSettings.restrictions.position.sphere.radius = Infinity;
|
|
73
|
-
if (controlsSettings.restrictions.target.cube.min.x === null)
|
|
74
|
-
controlsSettings.restrictions.target.cube.min.x = -Infinity;
|
|
75
|
-
if (controlsSettings.restrictions.target.cube.min.y === null)
|
|
76
|
-
controlsSettings.restrictions.target.cube.min.y = -Infinity;
|
|
77
|
-
if (controlsSettings.restrictions.target.cube.min.z === null)
|
|
78
|
-
controlsSettings.restrictions.target.cube.min.z = -Infinity;
|
|
79
|
-
if (controlsSettings.restrictions.target.cube.max.x === null)
|
|
80
|
-
controlsSettings.restrictions.target.cube.max.x = Infinity;
|
|
81
|
-
if (controlsSettings.restrictions.target.cube.max.y === null)
|
|
82
|
-
controlsSettings.restrictions.target.cube.max.y = Infinity;
|
|
83
|
-
if (controlsSettings.restrictions.target.cube.max.z === null)
|
|
84
|
-
controlsSettings.restrictions.target.cube.max.z = Infinity;
|
|
85
|
-
if (controlsSettings.restrictions.target.sphere.radius === null)
|
|
86
|
-
controlsSettings.restrictions.target.sphere.radius = Infinity;
|
|
87
|
-
if (controlsSettings.restrictions.rotation.minAzimuthAngle === null)
|
|
88
|
-
controlsSettings.restrictions.rotation.minAzimuthAngle = -Infinity;
|
|
89
|
-
if (controlsSettings.restrictions.rotation.maxAzimuthAngle === null)
|
|
90
|
-
controlsSettings.restrictions.rotation.maxAzimuthAngle = Infinity;
|
|
91
|
-
if (controlsSettings.restrictions.zoom.maxDistance === null)
|
|
92
|
-
controlsSettings.restrictions.zoom.maxDistance = Infinity;
|
|
93
|
-
this.cubePositionRestriction = {
|
|
94
|
-
min: this._converter.toVec3(controlsSettings.restrictions.position.cube.min),
|
|
95
|
-
max: this._converter.toVec3(controlsSettings.restrictions.position.cube.max)
|
|
96
|
-
};
|
|
97
|
-
this.spherePositionRestriction = {
|
|
98
|
-
center: this._converter.toVec3(controlsSettings.restrictions.position.sphere.center),
|
|
99
|
-
radius: controlsSettings.restrictions.position.sphere.radius
|
|
100
|
-
};
|
|
101
|
-
this.cubeTargetRestriction = {
|
|
102
|
-
min: this._converter.toVec3(controlsSettings.restrictions.target.cube.min),
|
|
103
|
-
max: this._converter.toVec3(controlsSettings.restrictions.target.cube.max)
|
|
104
|
-
};
|
|
105
|
-
this.sphereTargetRestriction = {
|
|
106
|
-
center: this._converter.toVec3(controlsSettings.restrictions.target.sphere.center),
|
|
107
|
-
radius: controlsSettings.restrictions.target.sphere.radius
|
|
108
|
-
};
|
|
109
|
-
this.rotationRestriction = controlsSettings.restrictions.rotation;
|
|
110
|
-
this.zoomRestriction = controlsSettings.restrictions.zoom;
|
|
111
|
-
}
|
|
112
44
|
// #endregion Constructors (1)
|
|
113
|
-
// #region Public Accessors (
|
|
45
|
+
// #region Public Accessors (46)
|
|
114
46
|
get autoRotationSpeed() {
|
|
115
47
|
return this._autoRotationSpeed;
|
|
116
48
|
}
|
|
@@ -141,6 +73,12 @@ class PerspectiveCameraControls extends AbstractCameraControls_1.AbstractCameraC
|
|
|
141
73
|
set enableAutoRotation(value) {
|
|
142
74
|
this._enableAutoRotation = value;
|
|
143
75
|
}
|
|
76
|
+
get enableAzimuthRotation() {
|
|
77
|
+
return this._enableAzimuthRotation;
|
|
78
|
+
}
|
|
79
|
+
set enableAzimuthRotation(value) {
|
|
80
|
+
this._enableAzimuthRotation = value;
|
|
81
|
+
}
|
|
144
82
|
get enableKeyPan() {
|
|
145
83
|
return this._enableKeyPan;
|
|
146
84
|
}
|
|
@@ -153,12 +91,24 @@ class PerspectiveCameraControls extends AbstractCameraControls_1.AbstractCameraC
|
|
|
153
91
|
set enablePan(value) {
|
|
154
92
|
this._enablePan = value;
|
|
155
93
|
}
|
|
94
|
+
get enablePolarRotation() {
|
|
95
|
+
return this._enablePolarRotation;
|
|
96
|
+
}
|
|
97
|
+
set enablePolarRotation(value) {
|
|
98
|
+
this._enablePolarRotation = value;
|
|
99
|
+
}
|
|
156
100
|
get enableRotation() {
|
|
157
101
|
return this._enableRotation;
|
|
158
102
|
}
|
|
159
103
|
set enableRotation(value) {
|
|
160
104
|
this._enableRotation = value;
|
|
161
105
|
}
|
|
106
|
+
get enableTurntableControls() {
|
|
107
|
+
return this._enableTurntableControls;
|
|
108
|
+
}
|
|
109
|
+
set enableTurntableControls(value) {
|
|
110
|
+
this._enableTurntableControls = value;
|
|
111
|
+
}
|
|
162
112
|
get enableZoom() {
|
|
163
113
|
return this._enableZoom;
|
|
164
114
|
}
|
|
@@ -213,6 +163,12 @@ class PerspectiveCameraControls extends AbstractCameraControls_1.AbstractCameraC
|
|
|
213
163
|
set sphereTargetRestriction(value) {
|
|
214
164
|
this._sphereTargetRestriction = value;
|
|
215
165
|
}
|
|
166
|
+
get turntableCenter() {
|
|
167
|
+
return this._turntableCenter;
|
|
168
|
+
}
|
|
169
|
+
set turntableCenter(value) {
|
|
170
|
+
this._turntableCenter = value;
|
|
171
|
+
}
|
|
216
172
|
get zoomRestriction() {
|
|
217
173
|
return this._zoomRestriction;
|
|
218
174
|
}
|
|
@@ -225,6 +181,80 @@ class PerspectiveCameraControls extends AbstractCameraControls_1.AbstractCameraC
|
|
|
225
181
|
set zoomSpeed(value) {
|
|
226
182
|
this._zoomSpeed = value;
|
|
227
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)
|
|
242
|
+
};
|
|
243
|
+
this.spherePositionRestriction = {
|
|
244
|
+
center: this._converter.toVec3(controlsSettings.restrictions.position.sphere.center),
|
|
245
|
+
radius: controlsSettings.restrictions.position.sphere.radius
|
|
246
|
+
};
|
|
247
|
+
this.cubeTargetRestriction = {
|
|
248
|
+
min: this._converter.toVec3(controlsSettings.restrictions.target.cube.min),
|
|
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;
|
|
257
|
+
}
|
|
228
258
|
}
|
|
229
259
|
exports.PerspectiveCameraControls = PerspectiveCameraControls;
|
|
230
260
|
//# sourceMappingURL=PerspectiveCameraControls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PerspectiveCameraControls.js","sourceRoot":"","sources":["../../../src/implementation/controls/PerspectiveCameraControls.ts"],"names":[],"mappings":";;;AACA,+
|
|
1
|
+
{"version":3,"file":"PerspectiveCameraControls.js","sourceRoot":"","sources":["../../../src/implementation/controls/PerspectiveCameraControls.ts"],"names":[],"mappings":";;;AACA,+EAA4F;AAC5F,yCAAiC;AAEjC,6BAA6C;AAE7C,qEAAkE;AAClE,mGAEuD;AACvD,2EAAoG;AAEpG,MAAa,yBAA0B,SAAQ,+CAAsB;IA8BjE,6BAA6B;IAE7B,2BAA2B;IAE3B,YAAY,MAAe,EAAE,OAAgB;QACzC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,eAAW,CAAC,WAAW,CAAC,CAAC;QAlCpD,0BAA0B;QAET,eAAU,GAAc,kCAAS,CAAC,QAAQ,CAAC;QAC3C,iBAAY,GAAgB,oCAAW,CAAC,QAAQ,CAAC;QAE1D,uBAAkB,GAAW,CAAC,CAAC;QAC/B,6BAAwB,GAA6B,EAAE,GAAG,EAAE,gBAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,gBAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;QACnK,2BAAsB,GAA6B,EAAE,GAAG,EAAE,gBAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAA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AC,IAAI,CAAC,GAAG,CAAC;YAC1E,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;SAC7E,CAAC;QACF,IAAI,CAAC,uBAAuB,GAAG;YAC3B,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;YAClF,MAAM,EAAE,gBAAgB,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM;SAC7D,CAAC;QACF,IAAI,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,YAAY,CAAC,QAAQ,CAAC;QAClE,IAAI,CAAC,eAAe,GAAG,gBAAgB,CAAC,YAAY,CAAC,IAAI,CAAC;IAC9D,CAAC;CAGJ;AAlSD,8DAkSC"}
|
|
@@ -13,16 +13,16 @@ export declare class CameraControlsEventDistribution implements ICameraControlsE
|
|
|
13
13
|
onKey(event: KeyboardEvent): void;
|
|
14
14
|
onKeyDown(event: KeyboardEvent): void;
|
|
15
15
|
onMouseDown(event: MouseEvent): void;
|
|
16
|
-
onMouseMove(event: MouseEvent): void;
|
|
17
16
|
onMouseEnd(event: MouseEvent): void;
|
|
18
|
-
|
|
17
|
+
onMouseMove(event: MouseEvent): void;
|
|
19
18
|
onMouseOut(event: WheelEvent): void;
|
|
19
|
+
onMouseUp(event: WheelEvent): void;
|
|
20
20
|
onMouseWheel(event: WheelEvent): void;
|
|
21
21
|
onMove(event: MouseEvent | TouchEvent): void;
|
|
22
|
+
onTouchCancel(event: TouchEvent): void;
|
|
22
23
|
onTouchEnd(event: TouchEvent): void;
|
|
23
24
|
onTouchMove(event: TouchEvent): void;
|
|
24
25
|
onTouchStart(event: TouchEvent): void;
|
|
25
|
-
onTouchCancel(event: TouchEvent): void;
|
|
26
26
|
onTouchUp(event: TouchEvent): void;
|
|
27
27
|
onUp(event: MouseEvent | TouchEvent): void;
|
|
28
28
|
onWheel(event: WheelEvent): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraControlsEventDistribution.d.ts","sourceRoot":"","sources":["../../../../src/implementation/controls/orthographic/CameraControlsEventDistribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"CameraControlsEventDistribution.d.ts","sourceRoot":"","sources":["../../../../src/implementation/controls/orthographic/CameraControlsEventDistribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,gCAAgC,EAAE,MAAM,+DAA+D,CAAC;AACjH,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE3E,qBAAa,+BAAgC,YAAW,gCAAgC;IAaxE,OAAO,CAAC,QAAQ,CAAC,SAAS;IAA8B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAVjG,OAAO,CAAC,OAAO,CAGb;IACF,OAAO,CAAC,aAAa,CAAQ;gBAMA,SAAS,EAAE,0BAA0B,EAAmB,YAAY,EAAE,mBAAmB;IAM/G,oBAAoB,IAAI,IAAI;IAI5B,sBAAsB,IAAI,IAAI;IAI9B,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI;IA2B5C,KAAK,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAmCjC,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAMrC,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAMpC,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAMnC,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAMpC,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAInC,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAIlC,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAMrC,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI;IAiB5C,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAItC,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAMnC,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAMpC,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAMrC,SAAS,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAIlC,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI;IAM1C,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAqBhC,KAAK;IAWZ,OAAO,CAAC,YAAY;CAqBvB"}
|
|
@@ -15,7 +15,7 @@ class CameraControlsEventDistribution {
|
|
|
15
15
|
this._activeEvents = true;
|
|
16
16
|
}
|
|
17
17
|
// #endregion Constructors (1)
|
|
18
|
-
// #region Public Methods (
|
|
18
|
+
// #region Public Methods (20)
|
|
19
19
|
activateCameraEvents() {
|
|
20
20
|
this._activeEvents = true;
|
|
21
21
|
}
|
|
@@ -25,13 +25,15 @@ class CameraControlsEventDistribution {
|
|
|
25
25
|
onDown(event) {
|
|
26
26
|
if (this._controls.camera.active === false)
|
|
27
27
|
return;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const { x, y } = this.convertInput(event);
|
|
29
|
+
const input = window.TouchEvent && event instanceof TouchEvent ? event.touches.length : event.button;
|
|
30
|
+
const mapping = window.TouchEvent && event instanceof TouchEvent ? this._controls.input.touch : this._controls.input.mouse;
|
|
31
31
|
if (input === mapping.pan && this._controls.enablePan) {
|
|
32
32
|
this._cameraLogic.pan(x, y, this._active.pan, window.TouchEvent && event instanceof TouchEvent);
|
|
33
33
|
this._active.pan = true;
|
|
34
|
-
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
this._active.pan = false;
|
|
35
37
|
}
|
|
36
38
|
if (input === mapping.zoom && this._controls.enableZoom) {
|
|
37
39
|
let x1 = x, y1 = y;
|
|
@@ -40,9 +42,11 @@ class CameraControlsEventDistribution {
|
|
|
40
42
|
y1 = (event.touches[0].pageY - event.touches[1].pageY) / window.innerHeight;
|
|
41
43
|
}
|
|
42
44
|
this._cameraLogic.zoom(x1, y1, this._active.zoom, window.TouchEvent && event instanceof TouchEvent);
|
|
43
|
-
this._active.pan = false;
|
|
44
45
|
this._active.zoom = true;
|
|
45
46
|
}
|
|
47
|
+
else {
|
|
48
|
+
this._active.zoom = false;
|
|
49
|
+
}
|
|
46
50
|
}
|
|
47
51
|
onKey(event) {
|
|
48
52
|
if (this._controls.camera.active === false)
|
|
@@ -90,25 +94,25 @@ class CameraControlsEventDistribution {
|
|
|
90
94
|
return;
|
|
91
95
|
this.onDown(event);
|
|
92
96
|
}
|
|
93
|
-
|
|
97
|
+
onMouseEnd(event) {
|
|
94
98
|
if (this._controls.camera.active === false)
|
|
95
99
|
return;
|
|
96
100
|
if (!this._activeEvents)
|
|
97
101
|
return;
|
|
98
|
-
this.
|
|
102
|
+
this.onUp(event);
|
|
99
103
|
}
|
|
100
|
-
|
|
104
|
+
onMouseMove(event) {
|
|
101
105
|
if (this._controls.camera.active === false)
|
|
102
106
|
return;
|
|
103
107
|
if (!this._activeEvents)
|
|
104
108
|
return;
|
|
105
|
-
this.
|
|
109
|
+
this.onMove(event);
|
|
106
110
|
}
|
|
107
|
-
|
|
111
|
+
onMouseOut(event) {
|
|
108
112
|
if (this._controls.camera.active === false)
|
|
109
113
|
return;
|
|
110
114
|
}
|
|
111
|
-
|
|
115
|
+
onMouseUp(event) {
|
|
112
116
|
if (this._controls.camera.active === false)
|
|
113
117
|
return;
|
|
114
118
|
}
|
|
@@ -122,7 +126,7 @@ class CameraControlsEventDistribution {
|
|
|
122
126
|
onMove(event) {
|
|
123
127
|
if (this._controls.camera.active === false)
|
|
124
128
|
return;
|
|
125
|
-
|
|
129
|
+
const { x, y } = this.convertInput(event);
|
|
126
130
|
if (this._controls.enablePan && this._active.pan)
|
|
127
131
|
this._cameraLogic.pan(x, y, this._active.pan, window.TouchEvent && event instanceof TouchEvent);
|
|
128
132
|
if (this._controls.enableZoom && this._active.zoom) {
|
|
@@ -134,6 +138,10 @@ class CameraControlsEventDistribution {
|
|
|
134
138
|
this._cameraLogic.zoom(x1, y1, this._active.zoom, window.TouchEvent && event instanceof TouchEvent);
|
|
135
139
|
}
|
|
136
140
|
}
|
|
141
|
+
onTouchCancel(event) {
|
|
142
|
+
if (this._controls.camera.active === false)
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
137
145
|
onTouchEnd(event) {
|
|
138
146
|
if (this._controls.camera.active === false)
|
|
139
147
|
return;
|
|
@@ -155,10 +163,6 @@ class CameraControlsEventDistribution {
|
|
|
155
163
|
return;
|
|
156
164
|
this.onDown(event);
|
|
157
165
|
}
|
|
158
|
-
onTouchCancel(event) {
|
|
159
|
-
if (this._controls.camera.active === false)
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
166
|
onTouchUp(event) {
|
|
163
167
|
if (this._controls.camera.active === false)
|
|
164
168
|
return;
|
|
@@ -198,22 +202,26 @@ class CameraControlsEventDistribution {
|
|
|
198
202
|
pan: false
|
|
199
203
|
};
|
|
200
204
|
}
|
|
201
|
-
// #endregion Public Methods (
|
|
205
|
+
// #endregion Public Methods (20)
|
|
202
206
|
// #region Private Methods (1)
|
|
203
207
|
convertInput(event) {
|
|
204
|
-
let aspect = window.innerWidth / window.innerHeight;
|
|
205
208
|
if (event instanceof MouseEvent) {
|
|
206
209
|
return {
|
|
207
|
-
x: event.clientX
|
|
208
|
-
y: event.clientY
|
|
210
|
+
x: event.clientX,
|
|
211
|
+
y: event.clientY
|
|
209
212
|
};
|
|
210
213
|
}
|
|
211
214
|
else {
|
|
212
215
|
if (event.touches.length < 1)
|
|
213
216
|
return { x: 0, y: 0 };
|
|
217
|
+
if (event.touches.length === 1)
|
|
218
|
+
return {
|
|
219
|
+
x: event.touches[0].pageX,
|
|
220
|
+
y: event.touches[0].pageY
|
|
221
|
+
};
|
|
214
222
|
return {
|
|
215
|
-
x: event.touches[0].pageX
|
|
216
|
-
y: event.touches[0].pageY /
|
|
223
|
+
x: (event.touches[0].pageX + event.touches[1].pageX) / 2,
|
|
224
|
+
y: (event.touches[0].pageY + event.touches[1].pageY) / 2
|
|
217
225
|
};
|
|
218
226
|
}
|
|
219
227
|
}
|