@shapediver/viewer.rendering-engine.camera-engine 3.16.8 → 3.16.9

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.
Files changed (60) hide show
  1. package/dist/implementation/CameraEngine.d.ts +42 -42
  2. package/dist/implementation/CameraEngine.js +607 -607
  3. package/dist/implementation/CameraEngine.js.map +1 -1
  4. package/dist/implementation/camera/AbstractCamera.d.ts +90 -90
  5. package/dist/implementation/camera/AbstractCamera.js +354 -354
  6. package/dist/implementation/camera/AbstractCamera.js.map +1 -1
  7. package/dist/implementation/camera/OrthographicCamera.d.ts +37 -37
  8. package/dist/implementation/camera/OrthographicCamera.js +268 -268
  9. package/dist/implementation/camera/OrthographicCamera.js.map +1 -1
  10. package/dist/implementation/camera/PerspectiveCamera.d.ts +28 -28
  11. package/dist/implementation/camera/PerspectiveCamera.js +250 -250
  12. package/dist/implementation/camera/PerspectiveCamera.js.map +1 -1
  13. package/dist/implementation/controls/AbstractCameraControls.d.ts +217 -217
  14. package/dist/implementation/controls/AbstractCameraControls.js +635 -635
  15. package/dist/implementation/controls/AbstractCameraControls.js.map +1 -1
  16. package/dist/implementation/controls/CameraControlsEventDistribution.d.ts +39 -39
  17. package/dist/implementation/controls/CameraControlsEventDistribution.d.ts.map +1 -1
  18. package/dist/implementation/controls/CameraControlsEventDistribution.js +287 -287
  19. package/dist/implementation/controls/CameraControlsEventDistribution.js.map +1 -1
  20. package/dist/implementation/controls/CameraControlsLogic.d.ts +36 -36
  21. package/dist/implementation/controls/CameraControlsLogic.js +530 -530
  22. package/dist/implementation/controls/CameraControlsLogic.js.map +1 -1
  23. package/dist/implementation/controls/OrthographicCameraControls.d.ts +7 -7
  24. package/dist/implementation/controls/OrthographicCameraControls.js +34 -34
  25. package/dist/implementation/controls/PerspectiveCameraControls.d.ts +7 -7
  26. package/dist/implementation/controls/PerspectiveCameraControls.js +34 -34
  27. package/dist/implementation/interpolation/CameraInterpolationManager.d.ts +22 -22
  28. package/dist/implementation/interpolation/CameraInterpolationManager.js +165 -155
  29. package/dist/implementation/interpolation/CameraInterpolationManager.js.map +1 -1
  30. package/dist/implementation/interpolation/interpolationMethods/CameraCylindricalInterpolation.d.ts +36 -36
  31. package/dist/implementation/interpolation/interpolationMethods/CameraCylindricalInterpolation.js +57 -57
  32. package/dist/implementation/interpolation/interpolationMethods/CameraLinearInterpolation.d.ts +26 -26
  33. package/dist/implementation/interpolation/interpolationMethods/CameraLinearInterpolation.js +31 -31
  34. package/dist/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.d.ts +35 -35
  35. package/dist/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.js +45 -45
  36. package/dist/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.js.map +1 -1
  37. package/dist/implementation/interpolation/interpolationMethods/CameraOrthographicInterpolation.d.ts +26 -26
  38. package/dist/implementation/interpolation/interpolationMethods/CameraOrthographicInterpolation.js +31 -31
  39. package/dist/implementation/interpolation/interpolationMethods/CameraSphericalInterpolation.d.ts +32 -32
  40. package/dist/implementation/interpolation/interpolationMethods/CameraSphericalInterpolation.js +42 -42
  41. package/dist/index.d.ts +16 -16
  42. package/dist/index.js +18 -18
  43. package/dist/interfaces/ICameraEngine.d.ts +12 -12
  44. package/dist/interfaces/ICameraEngine.js +3 -3
  45. package/dist/interfaces/camera/ICamera.d.ts +47 -47
  46. package/dist/interfaces/camera/ICamera.js +2 -2
  47. package/dist/interfaces/camera/IOrthographicCamera.d.ts +8 -8
  48. package/dist/interfaces/camera/IOrthographicCamera.js +3 -3
  49. package/dist/interfaces/camera/IPerspectiveCamera.d.ts +7 -7
  50. package/dist/interfaces/camera/IPerspectiveCamera.js +2 -2
  51. package/dist/interfaces/controls/ICameraControls.d.ts +105 -105
  52. package/dist/interfaces/controls/ICameraControls.d.ts.map +1 -1
  53. package/dist/interfaces/controls/ICameraControls.js +3 -3
  54. package/dist/interfaces/controls/ICameraControlsEventDistribution.d.ts +6 -6
  55. package/dist/interfaces/controls/ICameraControlsEventDistribution.js +2 -2
  56. package/dist/interfaces/controls/ICameraControlsLogic.d.ts +14 -14
  57. package/dist/interfaces/controls/ICameraControlsLogic.js +2 -2
  58. package/dist/interfaces/interpolation/ICameraInterpolation.d.ts +11 -11
  59. package/dist/interfaces/interpolation/ICameraInterpolation.js +2 -2
  60. package/package.json +8 -8
@@ -1,32 +1,32 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CameraLinearInterpolation = void 0;
4
- const gl_matrix_1 = require("gl-matrix");
5
- class CameraLinearInterpolation {
6
- // #region Constructors (1)
7
- constructor(_camera, _cameraControls, _from, _to) {
8
- this._camera = _camera;
9
- this._cameraControls = _cameraControls;
10
- this._from = _from;
11
- this._to = _to;
12
- }
13
- // #endregion Constructors (1)
14
- // #region Public Methods (3)
15
- onComplete(value) {
16
- const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), this._to.position, this._cameraControls.getPositionWithUpdates());
17
- this._cameraControls.applyPositionVector(positionOffset);
18
- const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), this._to.target, this._cameraControls.getTargetWithUpdates());
19
- this._cameraControls.applyTargetVector(targetOffset);
20
- }
21
- onStop(value) { }
22
- onUpdate(value) {
23
- const p = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._from.position, gl_matrix_1.vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._to.position, gl_matrix_1.vec3.fromValues(value.delta, value.delta, value.delta)));
24
- const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), p, this._cameraControls.getPositionWithUpdates());
25
- this._cameraControls.applyPositionVector(positionOffset);
26
- const t = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._from.target, gl_matrix_1.vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._to.target, gl_matrix_1.vec3.fromValues(value.delta, value.delta, value.delta)));
27
- const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), t, this._cameraControls.getTargetWithUpdates());
28
- this._cameraControls.applyTargetVector(targetOffset);
29
- }
30
- }
31
- exports.CameraLinearInterpolation = CameraLinearInterpolation;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CameraLinearInterpolation = void 0;
4
+ const gl_matrix_1 = require("gl-matrix");
5
+ class CameraLinearInterpolation {
6
+ // #region Constructors (1)
7
+ constructor(_camera, _cameraControls, _from, _to) {
8
+ this._camera = _camera;
9
+ this._cameraControls = _cameraControls;
10
+ this._from = _from;
11
+ this._to = _to;
12
+ }
13
+ // #endregion Constructors (1)
14
+ // #region Public Methods (3)
15
+ onComplete(value) {
16
+ const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), this._to.position, this._cameraControls.getPositionWithUpdates());
17
+ this._cameraControls.applyPositionVector(positionOffset);
18
+ const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), this._to.target, this._cameraControls.getTargetWithUpdates());
19
+ this._cameraControls.applyTargetVector(targetOffset);
20
+ }
21
+ onStop(value) { }
22
+ onUpdate(value) {
23
+ const p = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._from.position, gl_matrix_1.vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._to.position, gl_matrix_1.vec3.fromValues(value.delta, value.delta, value.delta)));
24
+ const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), p, this._cameraControls.getPositionWithUpdates());
25
+ this._cameraControls.applyPositionVector(positionOffset);
26
+ const t = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._from.target, gl_matrix_1.vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._to.target, gl_matrix_1.vec3.fromValues(value.delta, value.delta, value.delta)));
27
+ const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), t, this._cameraControls.getTargetWithUpdates());
28
+ this._cameraControls.applyTargetVector(targetOffset);
29
+ }
30
+ }
31
+ exports.CameraLinearInterpolation = CameraLinearInterpolation;
32
32
  //# sourceMappingURL=CameraLinearInterpolation.js.map
@@ -1,36 +1,36 @@
1
- import { vec3 } from "gl-matrix";
2
- import { ICamera } from "../../../interfaces/camera/ICamera";
3
- import { ICameraControls } from "../../../interfaces/controls/ICameraControls";
4
- import { ICameraInterpolation } from "../../../interfaces/interpolation/ICameraInterpolation";
5
- export declare class CameraMultipleInterpolation implements ICameraInterpolation {
6
- private readonly _camera;
7
- private readonly _cameraControls;
8
- private readonly _path;
9
- private readonly _interpolationFunction;
10
- end: {
11
- position: {
12
- x: number[];
13
- y: number[];
14
- z: number[];
15
- };
16
- target: {
17
- x: number[];
18
- y: number[];
19
- z: number[];
20
- };
21
- };
22
- constructor(_camera: ICamera, _cameraControls: ICameraControls, _path: {
23
- position: vec3;
24
- target: vec3;
25
- }[], _interpolationFunction: (v: number[], k: number) => number);
26
- onComplete(value: {
27
- delta: number;
28
- }): void;
29
- onStop(value: {
30
- delta: number;
31
- }): void;
32
- onUpdate(value: {
33
- delta: number;
34
- }): void;
35
- }
1
+ import { vec3 } from "gl-matrix";
2
+ import { ICamera } from "../../../interfaces/camera/ICamera";
3
+ import { ICameraControls } from "../../../interfaces/controls/ICameraControls";
4
+ import { ICameraInterpolation } from "../../../interfaces/interpolation/ICameraInterpolation";
5
+ export declare class CameraMultipleInterpolation implements ICameraInterpolation {
6
+ private readonly _camera;
7
+ private readonly _cameraControls;
8
+ private readonly _path;
9
+ private readonly _interpolationFunction;
10
+ end: {
11
+ position: {
12
+ x: number[];
13
+ y: number[];
14
+ z: number[];
15
+ };
16
+ target: {
17
+ x: number[];
18
+ y: number[];
19
+ z: number[];
20
+ };
21
+ };
22
+ constructor(_camera: ICamera, _cameraControls: ICameraControls, _path: {
23
+ position: vec3;
24
+ target: vec3;
25
+ }[], _interpolationFunction: (v: number[], k: number) => number);
26
+ onComplete(value: {
27
+ delta: number;
28
+ }): void;
29
+ onStop(value: {
30
+ delta: number;
31
+ }): void;
32
+ onUpdate(value: {
33
+ delta: number;
34
+ }): void;
35
+ }
36
36
  //# sourceMappingURL=CameraMultipleInterpolation.d.ts.map
@@ -1,46 +1,46 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CameraMultipleInterpolation = void 0;
4
- const gl_matrix_1 = require("gl-matrix");
5
- class CameraMultipleInterpolation {
6
- // #endregion Properties (1)
7
- // #region Constructors (1)
8
- constructor(_camera, _cameraControls, _path, _interpolationFunction) {
9
- this._camera = _camera;
10
- this._cameraControls = _cameraControls;
11
- this._path = _path;
12
- this._interpolationFunction = _interpolationFunction;
13
- // #region Properties (1)
14
- this.end = {
15
- position: { x: [], y: [], z: [] },
16
- target: { x: [], y: [], z: [] },
17
- };
18
- for (let i = 0; i < this._path.length; i++) {
19
- this.end.position.x.push(this._path[i].position[0]);
20
- this.end.position.y.push(this._path[i].position[1]);
21
- this.end.position.z.push(this._path[i].position[2]);
22
- this.end.target.x.push(this._path[i].target[0]);
23
- this.end.target.y.push(this._path[i].target[1]);
24
- this.end.target.z.push(this._path[i].target[2]);
25
- }
26
- }
27
- // #endregion Constructors (1)
28
- // #region Public Methods (3)
29
- onComplete(value) {
30
- const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.fromValues(this._path[this._path.length - 1].position[0], this._path[this._path.length - 1].position[1], this._path[this._path.length - 1].position[2]), this._cameraControls.getPositionWithUpdates());
31
- this._cameraControls.applyPositionVector(positionOffset);
32
- const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.fromValues(this._path[this._path.length - 1].target[0], this._path[this._path.length - 1].target[1], this._path[this._path.length - 1].target[2]), this._cameraControls.getTargetWithUpdates());
33
- this._cameraControls.applyTargetVector(targetOffset);
34
- }
35
- onStop(value) { }
36
- onUpdate(value) {
37
- const p = gl_matrix_1.vec3.fromValues(this._interpolationFunction(this.end.position.x, value.delta), this._interpolationFunction(this.end.position.y, value.delta), this._interpolationFunction(this.end.position.z, value.delta));
38
- const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), p, this._cameraControls.getPositionWithUpdates());
39
- this._cameraControls.applyPositionVector(positionOffset);
40
- const t = gl_matrix_1.vec3.fromValues(this._interpolationFunction(this.end.target.x, value.delta), this._interpolationFunction(this.end.target.y, value.delta), this._interpolationFunction(this.end.target.z, value.delta));
41
- const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), t, this._cameraControls.getTargetWithUpdates());
42
- this._cameraControls.applyTargetVector(targetOffset);
43
- }
44
- }
45
- exports.CameraMultipleInterpolation = CameraMultipleInterpolation;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CameraMultipleInterpolation = void 0;
4
+ const gl_matrix_1 = require("gl-matrix");
5
+ class CameraMultipleInterpolation {
6
+ // #endregion Properties (1)
7
+ // #region Constructors (1)
8
+ constructor(_camera, _cameraControls, _path, _interpolationFunction) {
9
+ this._camera = _camera;
10
+ this._cameraControls = _cameraControls;
11
+ this._path = _path;
12
+ this._interpolationFunction = _interpolationFunction;
13
+ // #region Properties (1)
14
+ this.end = {
15
+ position: { x: [], y: [], z: [] },
16
+ target: { x: [], y: [], z: [] },
17
+ };
18
+ for (let i = 0; i < this._path.length; i++) {
19
+ this.end.position.x.push(this._path[i].position[0]);
20
+ this.end.position.y.push(this._path[i].position[1]);
21
+ this.end.position.z.push(this._path[i].position[2]);
22
+ this.end.target.x.push(this._path[i].target[0]);
23
+ this.end.target.y.push(this._path[i].target[1]);
24
+ this.end.target.z.push(this._path[i].target[2]);
25
+ }
26
+ }
27
+ // #endregion Constructors (1)
28
+ // #region Public Methods (3)
29
+ onComplete(value) {
30
+ const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.fromValues(this._path[this._path.length - 1].position[0], this._path[this._path.length - 1].position[1], this._path[this._path.length - 1].position[2]), this._cameraControls.getPositionWithUpdates());
31
+ this._cameraControls.applyPositionVector(positionOffset);
32
+ const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.fromValues(this._path[this._path.length - 1].target[0], this._path[this._path.length - 1].target[1], this._path[this._path.length - 1].target[2]), this._cameraControls.getTargetWithUpdates());
33
+ this._cameraControls.applyTargetVector(targetOffset);
34
+ }
35
+ onStop(value) { }
36
+ onUpdate(value) {
37
+ const p = gl_matrix_1.vec3.fromValues(this._interpolationFunction(this.end.position.x, value.delta), this._interpolationFunction(this.end.position.y, value.delta), this._interpolationFunction(this.end.position.z, value.delta));
38
+ const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), p, this._cameraControls.getPositionWithUpdates());
39
+ this._cameraControls.applyPositionVector(positionOffset);
40
+ const t = gl_matrix_1.vec3.fromValues(this._interpolationFunction(this.end.target.x, value.delta), this._interpolationFunction(this.end.target.y, value.delta), this._interpolationFunction(this.end.target.z, value.delta));
41
+ const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), t, this._cameraControls.getTargetWithUpdates());
42
+ this._cameraControls.applyTargetVector(targetOffset);
43
+ }
44
+ }
45
+ exports.CameraMultipleInterpolation = CameraMultipleInterpolation;
46
46
  //# sourceMappingURL=CameraMultipleInterpolation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CameraMultipleInterpolation.js","sourceRoot":"","sources":["../../../../src/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.ts"],"names":[],"mappings":";;;AAAA,yCAA+B;AAK/B,MAAa,2BAA2B;IAWvC,4BAA4B;IAE5B,2BAA2B;IAE3B,YACkB,OAAgB,EAChB,eAAgC,EAChC,KAAuC,EACvC,sBAGN;QANM,YAAO,GAAP,OAAO,CAAS;QAChB,oBAAe,GAAf,eAAe,CAAiB;QAChC,UAAK,GAAL,KAAK,CAAkC;QACvC,2BAAsB,GAAtB,sBAAsB,CAG5B;QArBZ,yBAAyB;QAElB,QAAG,GAGN;YACH,QAAQ,EAAE,EAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAC;YAC/B,MAAM,EAAE,EAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAC;SAC7B,CAAC;QAeD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC3C,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACpD,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACpD,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACpD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,C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sB,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAC3D,CAAC;QACF,MAAM,YAAY,GAAG,gBAAI,CAAC,QAAQ,CACjC,gBAAI,CAAC,MAAM,EAAE,EACb,CAAC,EACD,IAAI,CAAC,eAAe,CAAC,oBAAoB,EAAE,CAC3C,CAAC;QACF,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACtD,CAAC;CAGD;AA1FD,kEA0FC"}
1
+ {"version":3,"file":"CameraMultipleInterpolation.js","sourceRoot":"","sources":["../../../../src/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.ts"],"names":[],"mappings":";;;AAAA,yCAA+B;AAK/B,MAAa,2BAA2B;IAWvC,4BAA4B;IAE5B,2BAA2B;IAE3B,YACkB,OAAgB,EAChB,eAAgC,EAChC,KAAuC,EACvC,sBAGN;QANM,YAAO,GAAP,OAAO,CAAS;QAChB,oBAAe,GAAf,eAAe,CAAiB;QAChC,UAAK,GAAL,KAAK,CAAkC;QACvC,2BAAsB,GAAtB,sBAAsB,CAG5B;QArBZ,yBAAyB;QAElB,QAAG,GAGN;YACH,QAAQ,EAAE,EAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAC;YAC/B,MAAM,EAAE,EAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAC;SAC7B,CAAC;QAeD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC5C,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACpD,IAAI,CAAC,GAAG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,EAAE,CAC7C,CAAC;QACF,IAAI,CAAC,eAAe,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QAEzD,MAAM,CAAC,GAAS,gBAAI,CAAC,UAAU,CAC9B,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,EAC3D,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,EAC3D,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAC3D,CAAC;QACF,MAAM,YAAY,GAAG,gBAAI,CAAC,QAAQ,CACjC,gBAAI,CAAC,MAAM,EAAE,EACb,CAAC,EACD,IAAI,CAAC,eAAe,CAAC,oBAAoB,EAAE,CAC3C,CAAC;QACF,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACtD,CAAC;CAGD;AA1FD,kEA0FC"}
@@ -1,27 +1,27 @@
1
- import { vec3 } from "gl-matrix";
2
- import { ICamera } from "../../../interfaces/camera/ICamera";
3
- import { ICameraControls } from "../../../interfaces/controls/ICameraControls";
4
- import { ICameraInterpolation } from "../../../interfaces/interpolation/ICameraInterpolation";
5
- export declare class CameraOrthographicInterpolation implements ICameraInterpolation {
6
- private readonly _camera;
7
- private readonly _cameraControls;
8
- private readonly _from;
9
- private readonly _to;
10
- constructor(_camera: ICamera, _cameraControls: ICameraControls, _from: {
11
- position: vec3;
12
- target: vec3;
13
- }, _to: {
14
- position: vec3;
15
- target: vec3;
16
- });
17
- onComplete(value: {
18
- delta: number;
19
- }): void;
20
- onStop(value: {
21
- delta: number;
22
- }): void;
23
- onUpdate(value: {
24
- delta: number;
25
- }): void;
26
- }
1
+ import { vec3 } from "gl-matrix";
2
+ import { ICamera } from "../../../interfaces/camera/ICamera";
3
+ import { ICameraControls } from "../../../interfaces/controls/ICameraControls";
4
+ import { ICameraInterpolation } from "../../../interfaces/interpolation/ICameraInterpolation";
5
+ export declare class CameraOrthographicInterpolation implements ICameraInterpolation {
6
+ private readonly _camera;
7
+ private readonly _cameraControls;
8
+ private readonly _from;
9
+ private readonly _to;
10
+ constructor(_camera: ICamera, _cameraControls: ICameraControls, _from: {
11
+ position: vec3;
12
+ target: vec3;
13
+ }, _to: {
14
+ position: vec3;
15
+ target: vec3;
16
+ });
17
+ onComplete(value: {
18
+ delta: number;
19
+ }): void;
20
+ onStop(value: {
21
+ delta: number;
22
+ }): void;
23
+ onUpdate(value: {
24
+ delta: number;
25
+ }): void;
26
+ }
27
27
  //# sourceMappingURL=CameraOrthographicInterpolation.d.ts.map
@@ -1,32 +1,32 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CameraOrthographicInterpolation = void 0;
4
- const gl_matrix_1 = require("gl-matrix");
5
- class CameraOrthographicInterpolation {
6
- // #region Constructors (1)
7
- constructor(_camera, _cameraControls, _from, _to) {
8
- this._camera = _camera;
9
- this._cameraControls = _cameraControls;
10
- this._from = _from;
11
- this._to = _to;
12
- }
13
- // #endregion Constructors (1)
14
- // #region Public Methods (3)
15
- onComplete(value) {
16
- const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.fromValues(this._to.position[0], this._to.position[1], this._to.position[2]), this._cameraControls.getPositionWithUpdates());
17
- this._cameraControls.applyPositionVector(positionOffset);
18
- const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.fromValues(this._to.target[0], this._to.target[1], this._to.target[2]), this._cameraControls.getTargetWithUpdates());
19
- this._cameraControls.applyTargetVector(targetOffset);
20
- }
21
- onStop(value) { }
22
- onUpdate(value) {
23
- const t = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._from.target, gl_matrix_1.vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._to.target, gl_matrix_1.vec3.fromValues(value.delta, value.delta, value.delta)));
24
- const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), t, this._cameraControls.getTargetWithUpdates());
25
- this._cameraControls.applyTargetVector(targetOffset);
26
- const p = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._from.position, gl_matrix_1.vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._to.position, gl_matrix_1.vec3.fromValues(value.delta, value.delta, value.delta)));
27
- const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), p, this._cameraControls.getPositionWithUpdates());
28
- this._cameraControls.applyPositionVector(positionOffset);
29
- }
30
- }
31
- exports.CameraOrthographicInterpolation = CameraOrthographicInterpolation;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CameraOrthographicInterpolation = void 0;
4
+ const gl_matrix_1 = require("gl-matrix");
5
+ class CameraOrthographicInterpolation {
6
+ // #region Constructors (1)
7
+ constructor(_camera, _cameraControls, _from, _to) {
8
+ this._camera = _camera;
9
+ this._cameraControls = _cameraControls;
10
+ this._from = _from;
11
+ this._to = _to;
12
+ }
13
+ // #endregion Constructors (1)
14
+ // #region Public Methods (3)
15
+ onComplete(value) {
16
+ const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.fromValues(this._to.position[0], this._to.position[1], this._to.position[2]), this._cameraControls.getPositionWithUpdates());
17
+ this._cameraControls.applyPositionVector(positionOffset);
18
+ const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.fromValues(this._to.target[0], this._to.target[1], this._to.target[2]), this._cameraControls.getTargetWithUpdates());
19
+ this._cameraControls.applyTargetVector(targetOffset);
20
+ }
21
+ onStop(value) { }
22
+ onUpdate(value) {
23
+ const t = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._from.target, gl_matrix_1.vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._to.target, gl_matrix_1.vec3.fromValues(value.delta, value.delta, value.delta)));
24
+ const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), t, this._cameraControls.getTargetWithUpdates());
25
+ this._cameraControls.applyTargetVector(targetOffset);
26
+ const p = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._from.position, gl_matrix_1.vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._to.position, gl_matrix_1.vec3.fromValues(value.delta, value.delta, value.delta)));
27
+ const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), p, this._cameraControls.getPositionWithUpdates());
28
+ this._cameraControls.applyPositionVector(positionOffset);
29
+ }
30
+ }
31
+ exports.CameraOrthographicInterpolation = CameraOrthographicInterpolation;
32
32
  //# sourceMappingURL=CameraOrthographicInterpolation.js.map
@@ -1,33 +1,33 @@
1
- import { vec3 } from "gl-matrix";
2
- import { ICamera } from "../../../interfaces/camera/ICamera";
3
- import { ICameraControls } from "../../../interfaces/controls/ICameraControls";
4
- import { ICameraInterpolation } from "../../../interfaces/interpolation/ICameraInterpolation";
5
- export declare class CameraSphericalInterpolation implements ICameraInterpolation {
6
- private readonly _camera;
7
- private readonly _cameraControls;
8
- private readonly _from;
9
- private readonly _to;
10
- private _axis;
11
- private _c_angle;
12
- private _direction_from;
13
- private _direction_to;
14
- private _radius_from;
15
- private _radius_to;
16
- constructor(_camera: ICamera, _cameraControls: ICameraControls, _from: {
17
- position: vec3;
18
- target: vec3;
19
- }, _to: {
20
- position: vec3;
21
- target: vec3;
22
- });
23
- onComplete(value: {
24
- delta: number;
25
- }): void;
26
- onStop(value: {
27
- delta: number;
28
- }): void;
29
- onUpdate(value: {
30
- delta: number;
31
- }): void;
32
- }
1
+ import { vec3 } from "gl-matrix";
2
+ import { ICamera } from "../../../interfaces/camera/ICamera";
3
+ import { ICameraControls } from "../../../interfaces/controls/ICameraControls";
4
+ import { ICameraInterpolation } from "../../../interfaces/interpolation/ICameraInterpolation";
5
+ export declare class CameraSphericalInterpolation implements ICameraInterpolation {
6
+ private readonly _camera;
7
+ private readonly _cameraControls;
8
+ private readonly _from;
9
+ private readonly _to;
10
+ private _axis;
11
+ private _c_angle;
12
+ private _direction_from;
13
+ private _direction_to;
14
+ private _radius_from;
15
+ private _radius_to;
16
+ constructor(_camera: ICamera, _cameraControls: ICameraControls, _from: {
17
+ position: vec3;
18
+ target: vec3;
19
+ }, _to: {
20
+ position: vec3;
21
+ target: vec3;
22
+ });
23
+ onComplete(value: {
24
+ delta: number;
25
+ }): void;
26
+ onStop(value: {
27
+ delta: number;
28
+ }): void;
29
+ onUpdate(value: {
30
+ delta: number;
31
+ }): void;
32
+ }
33
33
  //# sourceMappingURL=CameraSphericalInterpolation.d.ts.map
@@ -1,43 +1,43 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CameraSphericalInterpolation = void 0;
4
- const gl_matrix_1 = require("gl-matrix");
5
- class CameraSphericalInterpolation {
6
- // #endregion Properties (6)
7
- // #region Constructors (1)
8
- constructor(_camera, _cameraControls, _from, _to) {
9
- this._camera = _camera;
10
- this._cameraControls = _cameraControls;
11
- this._from = _from;
12
- this._to = _to;
13
- this._radius_from = gl_matrix_1.vec3.distance(this._from.position, this._from.target);
14
- this._direction_from = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), this._from.position, this._from.target));
15
- this._radius_to = gl_matrix_1.vec3.distance(this._to.position, this._to.target);
16
- this._direction_to = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), this._to.position, this._to.target));
17
- this._axis = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), this._direction_to, this._direction_from));
18
- this._c_angle = -Math.acos(Math.min(1, Math.max(-1, gl_matrix_1.vec3.dot(this._direction_to, this._direction_from))));
19
- }
20
- // #endregion Constructors (1)
21
- // #region Public Methods (3)
22
- onComplete(value) {
23
- const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.fromValues(this._to.position[0], this._to.position[1], this._to.position[2]), this._cameraControls.getPositionWithUpdates());
24
- this._cameraControls.applyPositionVector(positionOffset);
25
- const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.fromValues(this._to.target[0], this._to.target[1], this._to.target[2]), this._cameraControls.getTargetWithUpdates());
26
- this._cameraControls.applyTargetVector(targetOffset);
27
- }
28
- onStop(value) { }
29
- onUpdate(value) {
30
- const t = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._from.target, gl_matrix_1.vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._to.target, gl_matrix_1.vec3.fromValues(value.delta, value.delta, value.delta)));
31
- const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), t, this._cameraControls.getTargetWithUpdates());
32
- this._cameraControls.applyTargetVector(targetOffset);
33
- const angle = this._c_angle * value.delta;
34
- const dir = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.transformQuat(gl_matrix_1.vec3.create(), this._direction_from, gl_matrix_1.quat.setAxisAngle(gl_matrix_1.quat.create(), this._axis, angle)));
35
- const scalar = this._radius_from * (1 - value.delta) +
36
- this._radius_to * value.delta;
37
- const p = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), t, gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), dir, gl_matrix_1.vec3.fromValues(scalar, scalar, scalar)));
38
- const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), p, this._cameraControls.getPositionWithUpdates());
39
- this._cameraControls.applyPositionVector(positionOffset);
40
- }
41
- }
42
- exports.CameraSphericalInterpolation = CameraSphericalInterpolation;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CameraSphericalInterpolation = void 0;
4
+ const gl_matrix_1 = require("gl-matrix");
5
+ class CameraSphericalInterpolation {
6
+ // #endregion Properties (6)
7
+ // #region Constructors (1)
8
+ constructor(_camera, _cameraControls, _from, _to) {
9
+ this._camera = _camera;
10
+ this._cameraControls = _cameraControls;
11
+ this._from = _from;
12
+ this._to = _to;
13
+ this._radius_from = gl_matrix_1.vec3.distance(this._from.position, this._from.target);
14
+ this._direction_from = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), this._from.position, this._from.target));
15
+ this._radius_to = gl_matrix_1.vec3.distance(this._to.position, this._to.target);
16
+ this._direction_to = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), this._to.position, this._to.target));
17
+ this._axis = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), this._direction_to, this._direction_from));
18
+ this._c_angle = -Math.acos(Math.min(1, Math.max(-1, gl_matrix_1.vec3.dot(this._direction_to, this._direction_from))));
19
+ }
20
+ // #endregion Constructors (1)
21
+ // #region Public Methods (3)
22
+ onComplete(value) {
23
+ const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.fromValues(this._to.position[0], this._to.position[1], this._to.position[2]), this._cameraControls.getPositionWithUpdates());
24
+ this._cameraControls.applyPositionVector(positionOffset);
25
+ const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.fromValues(this._to.target[0], this._to.target[1], this._to.target[2]), this._cameraControls.getTargetWithUpdates());
26
+ this._cameraControls.applyTargetVector(targetOffset);
27
+ }
28
+ onStop(value) { }
29
+ onUpdate(value) {
30
+ const t = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._from.target, gl_matrix_1.vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), this._to.target, gl_matrix_1.vec3.fromValues(value.delta, value.delta, value.delta)));
31
+ const targetOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), t, this._cameraControls.getTargetWithUpdates());
32
+ this._cameraControls.applyTargetVector(targetOffset);
33
+ const angle = this._c_angle * value.delta;
34
+ const dir = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.transformQuat(gl_matrix_1.vec3.create(), this._direction_from, gl_matrix_1.quat.setAxisAngle(gl_matrix_1.quat.create(), this._axis, angle)));
35
+ const scalar = this._radius_from * (1 - value.delta) +
36
+ this._radius_to * value.delta;
37
+ const p = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), t, gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), dir, gl_matrix_1.vec3.fromValues(scalar, scalar, scalar)));
38
+ const positionOffset = gl_matrix_1.vec3.subtract(gl_matrix_1.vec3.create(), p, this._cameraControls.getPositionWithUpdates());
39
+ this._cameraControls.applyPositionVector(positionOffset);
40
+ }
41
+ }
42
+ exports.CameraSphericalInterpolation = CameraSphericalInterpolation;
43
43
  //# sourceMappingURL=CameraSphericalInterpolation.js.map
package/dist/index.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- import { CAMERA_TYPE, ICameraOptions, OrthographicCameraProperties, ORTHOGRAPHIC_CAMERA_DIRECTION, PerspectiveCameraProperties } from "@shapediver/viewer.shared.types";
2
- import { AbstractCamera } from "./implementation/camera/AbstractCamera";
3
- import { OrthographicCamera } from "./implementation/camera/OrthographicCamera";
4
- import { PerspectiveCamera } from "./implementation/camera/PerspectiveCamera";
5
- import { CameraEngine } from "./implementation/CameraEngine";
6
- import { OrthographicCameraControls } from "./implementation/controls/OrthographicCameraControls";
7
- import { PerspectiveCameraControls } from "./implementation/controls/PerspectiveCameraControls";
8
- import { ICamera } from "./interfaces/camera/ICamera";
9
- import { IOrthographicCamera } from "./interfaces/camera/IOrthographicCamera";
10
- import { IPerspectiveCamera } from "./interfaces/camera/IPerspectiveCamera";
11
- import { ICameraControls } from "./interfaces/controls/ICameraControls";
12
- import { ICameraEngine } from "./interfaces/ICameraEngine";
13
- export { ICameraEngine, ICamera, ICameraControls };
14
- export { CameraEngine, AbstractCamera, CAMERA_TYPE, ORTHOGRAPHIC_CAMERA_DIRECTION, ICameraOptions, };
15
- export { PerspectiveCamera, OrthographicCamera, IPerspectiveCamera, IOrthographicCamera, OrthographicCameraProperties, PerspectiveCameraProperties, };
16
- export { PerspectiveCameraControls, OrthographicCameraControls };
1
+ import { CAMERA_TYPE, ICameraOptions, OrthographicCameraProperties, ORTHOGRAPHIC_CAMERA_DIRECTION, PerspectiveCameraProperties } from "@shapediver/viewer.shared.types";
2
+ import { AbstractCamera } from "./implementation/camera/AbstractCamera";
3
+ import { OrthographicCamera } from "./implementation/camera/OrthographicCamera";
4
+ import { PerspectiveCamera } from "./implementation/camera/PerspectiveCamera";
5
+ import { CameraEngine } from "./implementation/CameraEngine";
6
+ import { OrthographicCameraControls } from "./implementation/controls/OrthographicCameraControls";
7
+ import { PerspectiveCameraControls } from "./implementation/controls/PerspectiveCameraControls";
8
+ import { ICamera } from "./interfaces/camera/ICamera";
9
+ import { IOrthographicCamera } from "./interfaces/camera/IOrthographicCamera";
10
+ import { IPerspectiveCamera } from "./interfaces/camera/IPerspectiveCamera";
11
+ import { ICameraControls } from "./interfaces/controls/ICameraControls";
12
+ import { ICameraEngine } from "./interfaces/ICameraEngine";
13
+ export { ICameraEngine, ICamera, ICameraControls };
14
+ export { CameraEngine, AbstractCamera, CAMERA_TYPE, ORTHOGRAPHIC_CAMERA_DIRECTION, ICameraOptions, };
15
+ export { PerspectiveCamera, OrthographicCamera, IPerspectiveCamera, IOrthographicCamera, OrthographicCameraProperties, PerspectiveCameraProperties, };
16
+ export { PerspectiveCameraControls, OrthographicCameraControls };
17
17
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,19 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OrthographicCameraControls = exports.PerspectiveCameraControls = exports.OrthographicCamera = exports.PerspectiveCamera = exports.ORTHOGRAPHIC_CAMERA_DIRECTION = exports.CAMERA_TYPE = exports.AbstractCamera = exports.CameraEngine = void 0;
4
- const viewer_shared_types_1 = require("@shapediver/viewer.shared.types");
5
- Object.defineProperty(exports, "CAMERA_TYPE", { enumerable: true, get: function () { return viewer_shared_types_1.CAMERA_TYPE; } });
6
- Object.defineProperty(exports, "ORTHOGRAPHIC_CAMERA_DIRECTION", { enumerable: true, get: function () { return viewer_shared_types_1.ORTHOGRAPHIC_CAMERA_DIRECTION; } });
7
- const AbstractCamera_1 = require("./implementation/camera/AbstractCamera");
8
- Object.defineProperty(exports, "AbstractCamera", { enumerable: true, get: function () { return AbstractCamera_1.AbstractCamera; } });
9
- const OrthographicCamera_1 = require("./implementation/camera/OrthographicCamera");
10
- Object.defineProperty(exports, "OrthographicCamera", { enumerable: true, get: function () { return OrthographicCamera_1.OrthographicCamera; } });
11
- const PerspectiveCamera_1 = require("./implementation/camera/PerspectiveCamera");
12
- Object.defineProperty(exports, "PerspectiveCamera", { enumerable: true, get: function () { return PerspectiveCamera_1.PerspectiveCamera; } });
13
- const CameraEngine_1 = require("./implementation/CameraEngine");
14
- Object.defineProperty(exports, "CameraEngine", { enumerable: true, get: function () { return CameraEngine_1.CameraEngine; } });
15
- const OrthographicCameraControls_1 = require("./implementation/controls/OrthographicCameraControls");
16
- Object.defineProperty(exports, "OrthographicCameraControls", { enumerable: true, get: function () { return OrthographicCameraControls_1.OrthographicCameraControls; } });
17
- const PerspectiveCameraControls_1 = require("./implementation/controls/PerspectiveCameraControls");
18
- Object.defineProperty(exports, "PerspectiveCameraControls", { enumerable: true, get: function () { return PerspectiveCameraControls_1.PerspectiveCameraControls; } });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrthographicCameraControls = exports.PerspectiveCameraControls = exports.OrthographicCamera = exports.PerspectiveCamera = exports.ORTHOGRAPHIC_CAMERA_DIRECTION = exports.CAMERA_TYPE = exports.AbstractCamera = exports.CameraEngine = void 0;
4
+ const viewer_shared_types_1 = require("@shapediver/viewer.shared.types");
5
+ Object.defineProperty(exports, "CAMERA_TYPE", { enumerable: true, get: function () { return viewer_shared_types_1.CAMERA_TYPE; } });
6
+ Object.defineProperty(exports, "ORTHOGRAPHIC_CAMERA_DIRECTION", { enumerable: true, get: function () { return viewer_shared_types_1.ORTHOGRAPHIC_CAMERA_DIRECTION; } });
7
+ const AbstractCamera_1 = require("./implementation/camera/AbstractCamera");
8
+ Object.defineProperty(exports, "AbstractCamera", { enumerable: true, get: function () { return AbstractCamera_1.AbstractCamera; } });
9
+ const OrthographicCamera_1 = require("./implementation/camera/OrthographicCamera");
10
+ Object.defineProperty(exports, "OrthographicCamera", { enumerable: true, get: function () { return OrthographicCamera_1.OrthographicCamera; } });
11
+ const PerspectiveCamera_1 = require("./implementation/camera/PerspectiveCamera");
12
+ Object.defineProperty(exports, "PerspectiveCamera", { enumerable: true, get: function () { return PerspectiveCamera_1.PerspectiveCamera; } });
13
+ const CameraEngine_1 = require("./implementation/CameraEngine");
14
+ Object.defineProperty(exports, "CameraEngine", { enumerable: true, get: function () { return CameraEngine_1.CameraEngine; } });
15
+ const OrthographicCameraControls_1 = require("./implementation/controls/OrthographicCameraControls");
16
+ Object.defineProperty(exports, "OrthographicCameraControls", { enumerable: true, get: function () { return OrthographicCameraControls_1.OrthographicCameraControls; } });
17
+ const PerspectiveCameraControls_1 = require("./implementation/controls/PerspectiveCameraControls");
18
+ Object.defineProperty(exports, "PerspectiveCameraControls", { enumerable: true, get: function () { return PerspectiveCameraControls_1.PerspectiveCameraControls; } });
19
19
  //# sourceMappingURL=index.js.map