@shapediver/viewer.viewport 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/LICENSE +73 -0
- package/README.md +1 -0
- package/dist/implementation/PostProcessingApi.d.ts +49 -0
- package/dist/implementation/PostProcessingApi.d.ts.map +1 -0
- package/dist/implementation/PostProcessingApi.js +142 -0
- package/dist/implementation/PostProcessingApi.js.map +1 -0
- package/dist/implementation/ViewportApi.d.ts +200 -0
- package/dist/implementation/ViewportApi.d.ts.map +1 -0
- package/dist/implementation/ViewportApi.js +879 -0
- package/dist/implementation/ViewportApi.js.map +1 -0
- package/dist/implementation/camera/AbstractCameraApi.d.ts +138 -0
- package/dist/implementation/camera/AbstractCameraApi.d.ts.map +1 -0
- package/dist/implementation/camera/AbstractCameraApi.js +473 -0
- package/dist/implementation/camera/AbstractCameraApi.js.map +1 -0
- package/dist/implementation/camera/OrthographicCameraApi.d.ts +11 -0
- package/dist/implementation/camera/OrthographicCameraApi.d.ts.map +1 -0
- package/dist/implementation/camera/OrthographicCameraApi.js +48 -0
- package/dist/implementation/camera/OrthographicCameraApi.js.map +1 -0
- package/dist/implementation/camera/PerspectiveCameraApi.d.ts +11 -0
- package/dist/implementation/camera/PerspectiveCameraApi.d.ts.map +1 -0
- package/dist/implementation/camera/PerspectiveCameraApi.js +47 -0
- package/dist/implementation/camera/PerspectiveCameraApi.js.map +1 -0
- package/dist/implementation/lights/AbstractLightApi.d.ts +20 -0
- package/dist/implementation/lights/AbstractLightApi.d.ts.map +1 -0
- package/dist/implementation/lights/AbstractLightApi.js +81 -0
- package/dist/implementation/lights/AbstractLightApi.js.map +1 -0
- package/dist/implementation/lights/LightSceneApi.d.ts +69 -0
- package/dist/implementation/lights/LightSceneApi.d.ts.map +1 -0
- package/dist/implementation/lights/LightSceneApi.js +172 -0
- package/dist/implementation/lights/LightSceneApi.js.map +1 -0
- package/dist/implementation/lights/types/AmbientLightApi.d.ts +9 -0
- package/dist/implementation/lights/types/AmbientLightApi.d.ts.map +1 -0
- package/dist/implementation/lights/types/AmbientLightApi.js +27 -0
- package/dist/implementation/lights/types/AmbientLightApi.js.map +1 -0
- package/dist/implementation/lights/types/DirectionalLightApi.d.ts +18 -0
- package/dist/implementation/lights/types/DirectionalLightApi.d.ts.map +1 -0
- package/dist/implementation/lights/types/DirectionalLightApi.js +77 -0
- package/dist/implementation/lights/types/DirectionalLightApi.js.map +1 -0
- package/dist/implementation/lights/types/HemisphereLightApi.d.ts +12 -0
- package/dist/implementation/lights/types/HemisphereLightApi.d.ts.map +1 -0
- package/dist/implementation/lights/types/HemisphereLightApi.js +47 -0
- package/dist/implementation/lights/types/HemisphereLightApi.js.map +1 -0
- package/dist/implementation/lights/types/PointLightApi.d.ts +16 -0
- package/dist/implementation/lights/types/PointLightApi.d.ts.map +1 -0
- package/dist/implementation/lights/types/PointLightApi.js +67 -0
- package/dist/implementation/lights/types/PointLightApi.js.map +1 -0
- package/dist/implementation/lights/types/SpotLightApi.d.ts +22 -0
- package/dist/implementation/lights/types/SpotLightApi.d.ts.map +1 -0
- package/dist/implementation/lights/types/SpotLightApi.js +97 -0
- package/dist/implementation/lights/types/SpotLightApi.js.map +1 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +160 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/IPostProcessingApi.d.ts +229 -0
- package/dist/interfaces/IPostProcessingApi.d.ts.map +1 -0
- package/dist/interfaces/IPostProcessingApi.js +3 -0
- package/dist/interfaces/IPostProcessingApi.js.map +1 -0
- package/dist/interfaces/IViewportApi.d.ts +632 -0
- package/dist/interfaces/IViewportApi.d.ts.map +1 -0
- package/dist/interfaces/IViewportApi.js +3 -0
- package/dist/interfaces/IViewportApi.js.map +1 -0
- package/dist/interfaces/camera/ICameraApi.d.ts +249 -0
- package/dist/interfaces/camera/ICameraApi.d.ts.map +1 -0
- package/dist/interfaces/camera/ICameraApi.js +3 -0
- package/dist/interfaces/camera/ICameraApi.js.map +1 -0
- package/dist/interfaces/camera/IOrthographicCameraApi.d.ts +14 -0
- package/dist/interfaces/camera/IOrthographicCameraApi.d.ts.map +1 -0
- package/dist/interfaces/camera/IOrthographicCameraApi.js +3 -0
- package/dist/interfaces/camera/IOrthographicCameraApi.js.map +1 -0
- package/dist/interfaces/camera/IPerspectiveCameraApi.d.ts +13 -0
- package/dist/interfaces/camera/IPerspectiveCameraApi.d.ts.map +1 -0
- package/dist/interfaces/camera/IPerspectiveCameraApi.js +3 -0
- package/dist/interfaces/camera/IPerspectiveCameraApi.js.map +1 -0
- package/dist/interfaces/lights/ILightApi.d.ts +36 -0
- package/dist/interfaces/lights/ILightApi.d.ts.map +1 -0
- package/dist/interfaces/lights/ILightApi.js +3 -0
- package/dist/interfaces/lights/ILightApi.js.map +1 -0
- package/dist/interfaces/lights/ILightSceneApi.d.ts +139 -0
- package/dist/interfaces/lights/ILightSceneApi.d.ts.map +1 -0
- package/dist/interfaces/lights/ILightSceneApi.js +3 -0
- package/dist/interfaces/lights/ILightSceneApi.js.map +1 -0
- package/dist/interfaces/lights/types/IAmbientLightApi.d.ts +7 -0
- package/dist/interfaces/lights/types/IAmbientLightApi.d.ts.map +1 -0
- package/dist/interfaces/lights/types/IAmbientLightApi.js +3 -0
- package/dist/interfaces/lights/types/IAmbientLightApi.js.map +1 -0
- package/dist/interfaces/lights/types/IDirectionalLightApi.d.ts +25 -0
- package/dist/interfaces/lights/types/IDirectionalLightApi.d.ts.map +1 -0
- package/dist/interfaces/lights/types/IDirectionalLightApi.js +3 -0
- package/dist/interfaces/lights/types/IDirectionalLightApi.js.map +1 -0
- package/dist/interfaces/lights/types/IHemisphereLightApi.d.ts +13 -0
- package/dist/interfaces/lights/types/IHemisphereLightApi.d.ts.map +1 -0
- package/dist/interfaces/lights/types/IHemisphereLightApi.js +3 -0
- package/dist/interfaces/lights/types/IHemisphereLightApi.js.map +1 -0
- package/dist/interfaces/lights/types/IPointLightApi.d.ts +21 -0
- package/dist/interfaces/lights/types/IPointLightApi.d.ts.map +1 -0
- package/dist/interfaces/lights/types/IPointLightApi.js +3 -0
- package/dist/interfaces/lights/types/IPointLightApi.js.map +1 -0
- package/dist/interfaces/lights/types/ISpotLightApi.d.ts +33 -0
- package/dist/interfaces/lights/types/ISpotLightApi.d.ts.map +1 -0
- package/dist/interfaces/lights/types/ISpotLightApi.js +3 -0
- package/dist/interfaces/lights/types/ISpotLightApi.js.map +1 -0
- package/dist/main.d.ts +29 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +80 -0
- package/dist/main.js.map +1 -0
- package/package.json +78 -0
- package/src/implementation/PostProcessingApi.ts +184 -0
- package/src/implementation/ViewportApi.ts +1060 -0
- package/src/implementation/camera/AbstractCameraApi.ts +556 -0
- package/src/implementation/camera/OrthographicCameraApi.ts +43 -0
- package/src/implementation/camera/PerspectiveCameraApi.ts +43 -0
- package/src/implementation/lights/AbstractLightApi.ts +87 -0
- package/src/implementation/lights/LightSceneApi.ts +198 -0
- package/src/implementation/lights/types/AmbientLightApi.ts +24 -0
- package/src/implementation/lights/types/DirectionalLightApi.ts +80 -0
- package/src/implementation/lights/types/HemisphereLightApi.ts +44 -0
- package/src/implementation/lights/types/PointLightApi.ts +68 -0
- package/src/implementation/lights/types/SpotLightApi.ts +104 -0
- package/src/index.ts +297 -0
- package/src/interfaces/IPostProcessingApi.ts +269 -0
- package/src/interfaces/IViewportApi.ts +629 -0
- package/src/interfaces/camera/ICameraApi.ts +233 -0
- package/src/interfaces/camera/IOrthographicCameraApi.ts +18 -0
- package/src/interfaces/camera/IPerspectiveCameraApi.ts +17 -0
- package/src/interfaces/lights/ILightApi.ts +41 -0
- package/src/interfaces/lights/ILightSceneApi.ts +147 -0
- package/src/interfaces/lights/types/IAmbientLightApi.ts +7 -0
- package/src/interfaces/lights/types/IDirectionalLightApi.ts +29 -0
- package/src/interfaces/lights/types/IHemisphereLightApi.ts +17 -0
- package/src/interfaces/lights/types/IPointLightApi.ts +25 -0
- package/src/interfaces/lights/types/ISpotLightApi.ts +37 -0
- package/src/main.ts +85 -0
- package/tsconfig.json +17 -0
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
import { Box, IBox } from '@shapediver/viewer.shared.math';
|
|
2
|
+
import { CAMERA_TYPE, ICamera, ICameraOptions } from '@shapediver/viewer.rendering-engine.camera-engine';
|
|
3
|
+
import { ICameraApi } from '../../interfaces/camera/ICameraApi';
|
|
4
|
+
import { InputValidator, Logger, ShapeDiverViewerValidationError } from '@shapediver/viewer.shared.services';
|
|
5
|
+
import { IViewportApi } from '../../interfaces/IViewportApi';
|
|
6
|
+
import { vec2, vec3 } from 'gl-matrix';
|
|
7
|
+
|
|
8
|
+
export abstract class AbstractCameraApi implements ICameraApi {
|
|
9
|
+
// #region Properties (6)
|
|
10
|
+
|
|
11
|
+
readonly #camera: ICamera;
|
|
12
|
+
readonly #inputValidator: InputValidator = InputValidator.instance;
|
|
13
|
+
readonly #logger: Logger = Logger.instance;
|
|
14
|
+
readonly #validateOptions = (scope: string, options?: ICameraOptions) => {
|
|
15
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, options, 'object', false);
|
|
16
|
+
const prop = Object.assign({}, options);
|
|
17
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, prop.easing, 'string', false);
|
|
18
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, prop.duration, 'number', false);
|
|
19
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, prop.coordinates, 'string', false);
|
|
20
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, prop.interpolation, 'string', false);
|
|
21
|
+
};
|
|
22
|
+
readonly #viewportApi: IViewportApi;
|
|
23
|
+
|
|
24
|
+
protected scope: string = 'AbstractCameraApi';
|
|
25
|
+
|
|
26
|
+
// #endregion Properties (6)
|
|
27
|
+
|
|
28
|
+
// #region Constructors (1)
|
|
29
|
+
|
|
30
|
+
constructor(viewportApi: IViewportApi, camera: ICamera) {
|
|
31
|
+
this.#viewportApi = viewportApi;
|
|
32
|
+
this.#camera = camera;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// #endregion Constructors (1)
|
|
36
|
+
|
|
37
|
+
// #region Public Getters And Setters (74)
|
|
38
|
+
|
|
39
|
+
public get autoAdjust(): boolean {
|
|
40
|
+
return this.#camera.autoAdjust;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public set autoAdjust(value: boolean) {
|
|
44
|
+
const scope = 'autoAdjust';
|
|
45
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'boolean');
|
|
46
|
+
this.#camera.autoAdjust = value;
|
|
47
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
48
|
+
this.#viewportApi.update();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public get autoRotationSpeed(): number {
|
|
52
|
+
return this.#camera.controls.autoRotationSpeed;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
public set autoRotationSpeed(value: number) {
|
|
56
|
+
const scope = 'autoRotationSpeed';
|
|
57
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'number');
|
|
58
|
+
this.#camera.controls.autoRotationSpeed = value;
|
|
59
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
60
|
+
this.#viewportApi.update();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public get cameraMovementDuration(): number {
|
|
64
|
+
return this.#camera.cameraMovementDuration;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
public set cameraMovementDuration(value: number) {
|
|
68
|
+
const scope = 'cameraMovementDuration';
|
|
69
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'number');
|
|
70
|
+
this.#camera.cameraMovementDuration = value;
|
|
71
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
72
|
+
this.#viewportApi.update();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public get cubePositionRestriction(): { min: vec3; max: vec3; } {
|
|
76
|
+
return this.#camera.controls.cubePositionRestriction;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public set cubePositionRestriction(value: { min: vec3; max: vec3; }) {
|
|
80
|
+
const scope = 'cubePositionRestriction';
|
|
81
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'object');
|
|
82
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value.min, 'vec3');
|
|
83
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value.max, 'vec3');
|
|
84
|
+
this.#camera.controls.cubePositionRestriction = value;
|
|
85
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
86
|
+
this.#viewportApi.update();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public get cubeTargetRestriction(): { min: vec3; max: vec3; } {
|
|
90
|
+
return this.#camera.controls.cubeTargetRestriction;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public set cubeTargetRestriction(value: { min: vec3; max: vec3; }) {
|
|
94
|
+
const scope = 'cubeTargetRestriction';
|
|
95
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'object');
|
|
96
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value.min, 'vec3');
|
|
97
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value.max, 'vec3');
|
|
98
|
+
this.#camera.controls.cubeTargetRestriction = value;
|
|
99
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
100
|
+
this.#viewportApi.update();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public get damping(): number {
|
|
104
|
+
return this.#camera.controls.damping;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public set damping(value: number) {
|
|
108
|
+
const scope = 'damping';
|
|
109
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'number');
|
|
110
|
+
this.#camera.controls.damping = value;
|
|
111
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
112
|
+
this.#viewportApi.update();
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
public get defaultPosition(): vec3 {
|
|
116
|
+
return this.#camera.defaultPosition;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
public set defaultPosition(value: vec3) {
|
|
120
|
+
const scope = 'defaultPosition';
|
|
121
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'vec3');
|
|
122
|
+
this.#camera.defaultPosition = value;
|
|
123
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
124
|
+
this.#viewportApi.update();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
public get defaultTarget(): vec3 {
|
|
128
|
+
return this.#camera.defaultTarget;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
public set defaultTarget(value: vec3) {
|
|
132
|
+
const scope = 'defaultTarget';
|
|
133
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'vec3');
|
|
134
|
+
this.#camera.defaultTarget = value;
|
|
135
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
136
|
+
this.#viewportApi.update();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
public get enableAutoRotation(): boolean {
|
|
140
|
+
return this.#camera.controls.enableAutoRotation;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
public set enableAutoRotation(value: boolean) {
|
|
144
|
+
const scope = 'enableAutoRotation';
|
|
145
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'boolean');
|
|
146
|
+
this.#camera.controls.enableAutoRotation = value;
|
|
147
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
148
|
+
this.#viewportApi.update();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
public get enableAzimuthRotation(): boolean {
|
|
152
|
+
return this.#camera.controls.enableAzimuthRotation;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
public set enableAzimuthRotation(value: boolean) {
|
|
156
|
+
const scope = 'enableAzimuthRotation';
|
|
157
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'boolean');
|
|
158
|
+
this.#camera.controls.enableAzimuthRotation = value;
|
|
159
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
160
|
+
this.#viewportApi.update();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
public get enableKeyPan(): boolean {
|
|
164
|
+
return this.#camera.controls.enableKeyPan;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
public set enableKeyPan(value: boolean) {
|
|
168
|
+
const scope = 'enableKeyPan';
|
|
169
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'boolean');
|
|
170
|
+
this.#camera.controls.enableKeyPan = value;
|
|
171
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
172
|
+
this.#viewportApi.update();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
public get enableObjectControls(): boolean {
|
|
176
|
+
return this.#camera.controls.enableObjectControls;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
public set enableObjectControls(value: boolean) {
|
|
180
|
+
const scope = 'enableObjectControls';
|
|
181
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'boolean');
|
|
182
|
+
this.#camera.controls.enableObjectControls = value;
|
|
183
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
184
|
+
this.#viewportApi.update();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
public get enablePan(): boolean {
|
|
188
|
+
return this.#camera.controls.enablePan;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
public set enablePan(value: boolean) {
|
|
192
|
+
const scope = 'enablePan';
|
|
193
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'boolean');
|
|
194
|
+
this.#camera.controls.enablePan = value;
|
|
195
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
196
|
+
this.#viewportApi.update();
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
public get enablePolarRotation(): boolean {
|
|
200
|
+
return this.#camera.controls.enablePolarRotation;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
public set enablePolarRotation(value: boolean) {
|
|
204
|
+
const scope = 'enablePolarRotation';
|
|
205
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'boolean');
|
|
206
|
+
this.#camera.controls.enablePolarRotation = value;
|
|
207
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
208
|
+
this.#viewportApi.update();
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
public get enableRotation(): boolean {
|
|
212
|
+
return this.#camera.controls.enableRotation;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
public set enableRotation(value: boolean) {
|
|
216
|
+
const scope = 'enableRotation';
|
|
217
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'boolean');
|
|
218
|
+
this.#camera.controls.enableRotation = value;
|
|
219
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
220
|
+
this.#viewportApi.update();
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
public get enableTurntableControls(): boolean {
|
|
224
|
+
return this.#camera.controls.enableTurntableControls;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
public set enableTurntableControls(value: boolean) {
|
|
228
|
+
const scope = 'enableTurntableControls';
|
|
229
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'boolean');
|
|
230
|
+
this.#camera.controls.enableTurntableControls = value;
|
|
231
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
232
|
+
this.#viewportApi.update();
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
public get enableZoom(): boolean {
|
|
236
|
+
return this.#camera.controls.enableZoom;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
public set enableZoom(value: boolean) {
|
|
240
|
+
const scope = 'enableZoom';
|
|
241
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'boolean');
|
|
242
|
+
this.#camera.controls.enableZoom = value;
|
|
243
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
244
|
+
this.#viewportApi.update();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
public get enabled(): boolean {
|
|
248
|
+
return this.#camera.controls.enabled;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
public set enabled(value: boolean) {
|
|
252
|
+
const scope = 'enabled';
|
|
253
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'boolean');
|
|
254
|
+
this.#camera.controls.enabled = value;
|
|
255
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
256
|
+
this.#viewportApi.update();
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
public get id(): string {
|
|
260
|
+
return this.#camera.id;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
public get keyPanSpeed(): number {
|
|
264
|
+
return this.#camera.controls.keyPanSpeed;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
public set keyPanSpeed(value: number) {
|
|
268
|
+
const scope = 'keyPanSpeed';
|
|
269
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'number');
|
|
270
|
+
this.#camera.controls.keyPanSpeed = value;
|
|
271
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
272
|
+
this.#viewportApi.update();
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
public get movementSmoothness(): number {
|
|
276
|
+
return this.#camera.controls.movementSmoothness;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
public set movementSmoothness(value: number) {
|
|
280
|
+
const scope = 'movementSmoothness';
|
|
281
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'number');
|
|
282
|
+
this.#camera.controls.movementSmoothness = value;
|
|
283
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
284
|
+
this.#viewportApi.update();
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
public get name(): string | undefined {
|
|
288
|
+
return this.#camera.name;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
public set name(value: string | undefined) {
|
|
292
|
+
const scope = 'name';
|
|
293
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'string', false);
|
|
294
|
+
this.#camera.name = value;
|
|
295
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
296
|
+
this.#viewportApi.update();
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
public get objectControlsCenter(): vec3 {
|
|
300
|
+
return this.#camera.controls.objectControlsCenter;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
public set objectControlsCenter(value: vec3) {
|
|
304
|
+
const scope = 'objectControlsCenter';
|
|
305
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'vec3');
|
|
306
|
+
this.#camera.controls.objectControlsCenter = value;
|
|
307
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
308
|
+
this.#viewportApi.update();
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
public get order(): number | undefined {
|
|
312
|
+
return this.#camera.order;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
public set order(value: number | undefined) {
|
|
316
|
+
const scope = 'order';
|
|
317
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'number', false);
|
|
318
|
+
this.#camera.order = value;
|
|
319
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
320
|
+
this.#viewportApi.update();
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
public get panSpeed(): number {
|
|
324
|
+
return this.#camera.controls.panSpeed;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
public set panSpeed(value: number) {
|
|
328
|
+
const scope = 'panSpeed';
|
|
329
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'number');
|
|
330
|
+
this.#camera.controls.panSpeed = value;
|
|
331
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
332
|
+
this.#viewportApi.update();
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
public get position(): vec3 {
|
|
336
|
+
return this.#camera.position;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
public set position(value: vec3) {
|
|
340
|
+
const scope = 'position';
|
|
341
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'vec3');
|
|
342
|
+
this.#camera.position = value;
|
|
343
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
344
|
+
this.#viewportApi.update();
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
public get revertAtMouseUp(): boolean {
|
|
348
|
+
return this.#camera.revertAtMouseUp;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
public set revertAtMouseUp(value: boolean) {
|
|
352
|
+
const scope = 'revertAtMouseUp';
|
|
353
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'boolean');
|
|
354
|
+
this.#camera.revertAtMouseUp = value;
|
|
355
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
356
|
+
this.#viewportApi.update();
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
public get revertAtMouseUpDuration(): number {
|
|
360
|
+
return this.#camera.revertAtMouseUpDuration;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
public set revertAtMouseUpDuration(value: number) {
|
|
364
|
+
const scope = 'revertAtMouseUpDuration';
|
|
365
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'number');
|
|
366
|
+
this.#camera.revertAtMouseUpDuration = value;
|
|
367
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
368
|
+
this.#viewportApi.update();
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
public get rotationRestriction(): { minPolarAngle: number; maxPolarAngle: number; minAzimuthAngle: number; maxAzimuthAngle: number; } {
|
|
372
|
+
return this.#camera.controls.rotationRestriction;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
public set rotationRestriction(value: { minPolarAngle: number; maxPolarAngle: number; minAzimuthAngle: number; maxAzimuthAngle: number; }) {
|
|
376
|
+
const scope = 'rotationRestriction';
|
|
377
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'object');
|
|
378
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value.minAzimuthAngle, 'number');
|
|
379
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value.maxAzimuthAngle, 'number');
|
|
380
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value.minPolarAngle, 'number');
|
|
381
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value.maxPolarAngle, 'number');
|
|
382
|
+
this.#camera.controls.rotationRestriction = value;
|
|
383
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
384
|
+
this.#viewportApi.update();
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
public get rotationSpeed(): number {
|
|
388
|
+
return this.#camera.controls.rotationSpeed;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
public set rotationSpeed(value: number) {
|
|
392
|
+
const scope = 'rotationSpeed';
|
|
393
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'number');
|
|
394
|
+
this.#camera.controls.rotationSpeed = value;
|
|
395
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
396
|
+
this.#viewportApi.update();
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
public get spherePositionRestriction(): { center: vec3; radius: number; } {
|
|
400
|
+
return this.#camera.controls.spherePositionRestriction;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
public set spherePositionRestriction(value: { center: vec3; radius: number; }) {
|
|
404
|
+
const scope = 'spherePositionRestriction';
|
|
405
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'object');
|
|
406
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value.center, 'vec3');
|
|
407
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value.radius, 'number');
|
|
408
|
+
this.#camera.controls.spherePositionRestriction = value;
|
|
409
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
410
|
+
this.#viewportApi.update();
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
public get sphereTargetRestriction(): { center: vec3; radius: number; } {
|
|
414
|
+
return this.#camera.controls.sphereTargetRestriction;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
public set sphereTargetRestriction(value: { center: vec3; radius: number; }) {
|
|
418
|
+
const scope = 'sphereTargetRestriction';
|
|
419
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'object');
|
|
420
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value.center, 'vec3');
|
|
421
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value.radius, 'number');
|
|
422
|
+
this.#camera.controls.sphereTargetRestriction = value;
|
|
423
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
424
|
+
this.#viewportApi.update();
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
public get target(): vec3 {
|
|
428
|
+
return this.#camera.target;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
public set target(value: vec3) {
|
|
432
|
+
const scope = 'target';
|
|
433
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'vec3');
|
|
434
|
+
this.#camera.target = value;
|
|
435
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
436
|
+
this.#viewportApi.update();
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
public get turntableCenter(): vec3 {
|
|
440
|
+
return this.#camera.controls.turntableCenter;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
public set turntableCenter(value: vec3) {
|
|
444
|
+
const scope = 'turntableCenter';
|
|
445
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'vec3');
|
|
446
|
+
this.#camera.controls.turntableCenter = value;
|
|
447
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
448
|
+
this.#viewportApi.update();
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
public get type(): CAMERA_TYPE {
|
|
452
|
+
return this.#camera.type;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
public get zoomRestriction(): { minDistance: number; maxDistance: number; } {
|
|
456
|
+
return this.#camera.controls.zoomRestriction;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
public set zoomRestriction(value: { minDistance: number; maxDistance: number; }) {
|
|
460
|
+
const scope = 'zoomRestriction';
|
|
461
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'object');
|
|
462
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value.minDistance, 'number');
|
|
463
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value.maxDistance, 'number');
|
|
464
|
+
this.#camera.controls.zoomRestriction = value;
|
|
465
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
466
|
+
this.#viewportApi.update();
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
public get zoomSpeed(): number {
|
|
470
|
+
return this.#camera.controls.zoomSpeed;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
public set zoomSpeed(value: number) {
|
|
474
|
+
const scope = 'zoomSpeed';
|
|
475
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'number');
|
|
476
|
+
this.#camera.controls.zoomSpeed = value;
|
|
477
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
478
|
+
this.#viewportApi.update();
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
public get zoomToFactor(): number {
|
|
482
|
+
return this.#camera.zoomExtentsFactor;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
public set zoomToFactor(value: number) {
|
|
486
|
+
const scope = 'zoomToFactor';
|
|
487
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'number');
|
|
488
|
+
this.#camera.zoomExtentsFactor = value;
|
|
489
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
490
|
+
this.#viewportApi.update();
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// #endregion Public Getters And Setters (74)
|
|
494
|
+
|
|
495
|
+
// #region Public Methods (7)
|
|
496
|
+
|
|
497
|
+
public animate(path: { position: vec3; target: vec3; }[], options?: ICameraOptions): Promise<boolean> {
|
|
498
|
+
const scope = 'animate';
|
|
499
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, path, 'array');
|
|
500
|
+
for (let i = 0; i < path.length; i++) {
|
|
501
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, path[i].position, 'vec3');
|
|
502
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, path[i].target, 'vec3');
|
|
503
|
+
}
|
|
504
|
+
this.#validateOptions(scope, options);
|
|
505
|
+
|
|
506
|
+
return this.#camera.animate(path, options);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
public calculateZoomTo(zoomTarget?: IBox, startingPosition?: vec3, startingTarget?: vec3): { position: vec3; target: vec3; } {
|
|
510
|
+
const scope = 'calculateZoomTo';
|
|
511
|
+
if (zoomTarget !== undefined && !(zoomTarget instanceof Box))
|
|
512
|
+
throw new ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${zoomTarget} is not of type Box.`, zoomTarget, 'Box');
|
|
513
|
+
|
|
514
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, startingPosition, 'vec3', false);
|
|
515
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, startingTarget, 'vec3', false);
|
|
516
|
+
|
|
517
|
+
return this.#camera.calculateZoomTo(zoomTarget, startingPosition, startingTarget);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
public project(p: vec3): vec2 {
|
|
521
|
+
const scope = 'project';
|
|
522
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, p, 'vec3');
|
|
523
|
+
return this.#camera.project(p);
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
public reset(options?: ICameraOptions): Promise<boolean> {
|
|
527
|
+
const scope = 'reset';
|
|
528
|
+
this.#validateOptions(scope, options);
|
|
529
|
+
return this.#camera.reset(options);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
public set(position: vec3, target: vec3, options?: ICameraOptions): Promise<boolean> {
|
|
533
|
+
const scope = 'set';
|
|
534
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, position, 'vec3', false);
|
|
535
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, target, 'vec3', false);
|
|
536
|
+
this.#validateOptions(scope, options);
|
|
537
|
+
return this.#camera.set(position, target, options);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
public unproject(p: vec3): vec3 {
|
|
541
|
+
const scope = 'unproject';
|
|
542
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, p, 'vec3', false);
|
|
543
|
+
return this.#camera.unproject(p);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
public zoomTo(zoomTarget?: IBox, options?: ICameraOptions): Promise<boolean> {
|
|
547
|
+
const scope = 'zoomTo';
|
|
548
|
+
if (zoomTarget !== undefined && !(zoomTarget instanceof Box))
|
|
549
|
+
throw new ShapeDiverViewerValidationError(`${scope}: Input could not be validated. ${zoomTarget} is not of type Box.`, zoomTarget, 'Box');
|
|
550
|
+
|
|
551
|
+
this.#validateOptions(scope, options);
|
|
552
|
+
return this.#camera.zoomTo(zoomTarget, options);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// #endregion Public Methods (7)
|
|
556
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AbstractCameraApi } from './AbstractCameraApi';
|
|
2
|
+
import { InputValidator, Logger } from '@shapediver/viewer.shared.services';
|
|
3
|
+
import { IOrthographicCamera, ORTHOGRAPHIC_CAMERA_DIRECTION } from '@shapediver/viewer.rendering-engine.camera-engine';
|
|
4
|
+
import { IOrthographicCameraApi } from '../../interfaces/camera/IOrthographicCameraApi';
|
|
5
|
+
import { IViewportApi } from '../../interfaces/IViewportApi';
|
|
6
|
+
|
|
7
|
+
export class OrthographicCameraApi extends AbstractCameraApi implements IOrthographicCameraApi {
|
|
8
|
+
// #region Properties (4)
|
|
9
|
+
|
|
10
|
+
readonly #camera: IOrthographicCamera;
|
|
11
|
+
readonly #inputValidator: InputValidator = InputValidator.instance;
|
|
12
|
+
readonly #logger: Logger = Logger.instance;
|
|
13
|
+
readonly #viewportApi: IViewportApi;
|
|
14
|
+
|
|
15
|
+
// #endregion Properties (4)
|
|
16
|
+
|
|
17
|
+
// #region Constructors (1)
|
|
18
|
+
|
|
19
|
+
constructor(viewportApi: IViewportApi, camera: IOrthographicCamera) {
|
|
20
|
+
super(viewportApi, camera);
|
|
21
|
+
this.#viewportApi = viewportApi;
|
|
22
|
+
this.#camera = camera;
|
|
23
|
+
this.scope = 'OrthographicCameraApi';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// #endregion Constructors (1)
|
|
27
|
+
|
|
28
|
+
// #region Public Getters And Setters (2)
|
|
29
|
+
|
|
30
|
+
public get direction(): ORTHOGRAPHIC_CAMERA_DIRECTION {
|
|
31
|
+
return this.#camera.direction;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public set direction(value: ORTHOGRAPHIC_CAMERA_DIRECTION) {
|
|
35
|
+
const scope = 'direction';
|
|
36
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'enum', true, Object.values(ORTHOGRAPHIC_CAMERA_DIRECTION));
|
|
37
|
+
this.#camera.direction = value;
|
|
38
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
39
|
+
this.#viewportApi.update();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// #endregion Public Getters And Setters (2)
|
|
43
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AbstractCameraApi } from './AbstractCameraApi';
|
|
2
|
+
import { InputValidator, Logger } from '@shapediver/viewer.shared.services';
|
|
3
|
+
import { IPerspectiveCamera } from '@shapediver/viewer.rendering-engine.camera-engine';
|
|
4
|
+
import { IPerspectiveCameraApi } from '../../interfaces/camera/IPerspectiveCameraApi';
|
|
5
|
+
import { IViewportApi } from '../../interfaces/IViewportApi';
|
|
6
|
+
|
|
7
|
+
export class PerspectiveCameraApi extends AbstractCameraApi implements IPerspectiveCameraApi {
|
|
8
|
+
// #region Properties (4)
|
|
9
|
+
|
|
10
|
+
readonly #camera: IPerspectiveCamera;
|
|
11
|
+
readonly #inputValidator: InputValidator = InputValidator.instance;
|
|
12
|
+
readonly #logger: Logger = Logger.instance;
|
|
13
|
+
readonly #viewportApi: IViewportApi;
|
|
14
|
+
|
|
15
|
+
// #endregion Properties (4)
|
|
16
|
+
|
|
17
|
+
// #region Constructors (1)
|
|
18
|
+
|
|
19
|
+
constructor(viewportApi: IViewportApi, camera: IPerspectiveCamera) {
|
|
20
|
+
super(viewportApi, camera);
|
|
21
|
+
this.#viewportApi = viewportApi;
|
|
22
|
+
this.#camera = camera;
|
|
23
|
+
this.scope = 'PerspectiveCameraApi';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// #endregion Constructors (1)
|
|
27
|
+
|
|
28
|
+
// #region Public Getters And Setters (2)
|
|
29
|
+
|
|
30
|
+
public get fov(): number {
|
|
31
|
+
return this.#camera.fov;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public set fov(value: number) {
|
|
35
|
+
const scope = 'fov';
|
|
36
|
+
this.#inputValidator.validateAndError(`${this.scope}.${scope}`, value, 'number');
|
|
37
|
+
this.#camera.fov = value;
|
|
38
|
+
this.#logger.debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
|
|
39
|
+
this.#viewportApi.update();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// #endregion Public Getters And Setters (2)
|
|
43
|
+
}
|