@shapediver/viewer.rendering-engine.camera-engine 2.12.7 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/implementation/CameraEngine.d.ts +5 -7
  2. package/dist/implementation/CameraEngine.d.ts.map +1 -1
  3. package/dist/implementation/CameraEngine.js +68 -27
  4. package/dist/implementation/CameraEngine.js.map +1 -1
  5. package/dist/implementation/camera/AbstractCamera.d.ts +7 -5
  6. package/dist/implementation/camera/AbstractCamera.d.ts.map +1 -1
  7. package/dist/implementation/camera/AbstractCamera.js +15 -8
  8. package/dist/implementation/camera/AbstractCamera.js.map +1 -1
  9. package/dist/implementation/camera/OrthographicCamera.d.ts +10 -13
  10. package/dist/implementation/camera/OrthographicCamera.d.ts.map +1 -1
  11. package/dist/implementation/camera/OrthographicCamera.js +53 -52
  12. package/dist/implementation/camera/OrthographicCamera.js.map +1 -1
  13. package/dist/implementation/camera/PerspectiveCamera.d.ts +9 -12
  14. package/dist/implementation/camera/PerspectiveCamera.d.ts.map +1 -1
  15. package/dist/implementation/camera/PerspectiveCamera.js +33 -38
  16. package/dist/implementation/camera/PerspectiveCamera.js.map +1 -1
  17. package/dist/implementation/controls/AbstractCameraControls.d.ts +156 -5
  18. package/dist/implementation/controls/AbstractCameraControls.d.ts.map +1 -1
  19. package/dist/implementation/controls/AbstractCameraControls.js +260 -6
  20. package/dist/implementation/controls/AbstractCameraControls.js.map +1 -1
  21. package/dist/implementation/controls/CameraControlsEventDistribution.d.ts +38 -0
  22. package/dist/implementation/controls/CameraControlsEventDistribution.d.ts.map +1 -0
  23. package/dist/implementation/controls/{perspective/CameraControlsEventDistribution.js → CameraControlsEventDistribution.js} +71 -71
  24. package/dist/implementation/controls/CameraControlsEventDistribution.js.map +1 -0
  25. package/dist/implementation/controls/{perspective/CameraControlsLogic.d.ts → CameraControlsLogic.d.ts} +5 -5
  26. package/dist/implementation/controls/CameraControlsLogic.d.ts.map +1 -0
  27. package/dist/implementation/controls/{perspective/CameraControlsLogic.js → CameraControlsLogic.js} +74 -44
  28. package/dist/implementation/controls/CameraControlsLogic.js.map +1 -0
  29. package/dist/implementation/controls/OrthographicCameraControls.d.ts +4 -67
  30. package/dist/implementation/controls/OrthographicCameraControls.d.ts.map +1 -1
  31. package/dist/implementation/controls/OrthographicCameraControls.js +22 -90
  32. package/dist/implementation/controls/OrthographicCameraControls.js.map +1 -1
  33. package/dist/implementation/controls/PerspectiveCameraControls.d.ts +4 -151
  34. package/dist/implementation/controls/PerspectiveCameraControls.d.ts.map +1 -1
  35. package/dist/implementation/controls/PerspectiveCameraControls.js +21 -247
  36. package/dist/implementation/controls/PerspectiveCameraControls.js.map +1 -1
  37. package/dist/implementation/interpolation/CameraInterpolationManager.d.ts +3 -3
  38. package/dist/implementation/interpolation/CameraInterpolationManager.d.ts.map +1 -1
  39. package/dist/implementation/interpolation/CameraInterpolationManager.js +5 -5
  40. package/dist/implementation/interpolation/CameraInterpolationManager.js.map +1 -1
  41. package/dist/implementation/interpolation/interpolationMethods/CameraCylindricalInterpolation.d.ts +3 -3
  42. package/dist/implementation/interpolation/interpolationMethods/CameraCylindricalInterpolation.d.ts.map +1 -1
  43. package/dist/implementation/interpolation/interpolationMethods/CameraCylindricalInterpolation.js +11 -11
  44. package/dist/implementation/interpolation/interpolationMethods/CameraCylindricalInterpolation.js.map +1 -1
  45. package/dist/implementation/interpolation/interpolationMethods/CameraLinearInterpolation.d.ts +3 -3
  46. package/dist/implementation/interpolation/interpolationMethods/CameraLinearInterpolation.d.ts.map +1 -1
  47. package/dist/implementation/interpolation/interpolationMethods/CameraLinearInterpolation.js +6 -6
  48. package/dist/implementation/interpolation/interpolationMethods/CameraLinearInterpolation.js.map +1 -1
  49. package/dist/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.d.ts +4 -4
  50. package/dist/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.d.ts.map +1 -1
  51. package/dist/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.js +6 -6
  52. package/dist/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.js.map +1 -1
  53. package/dist/implementation/interpolation/interpolationMethods/CameraOrthographicInterpolation.d.ts +3 -3
  54. package/dist/implementation/interpolation/interpolationMethods/CameraOrthographicInterpolation.d.ts.map +1 -1
  55. package/dist/implementation/interpolation/interpolationMethods/CameraOrthographicInterpolation.js +6 -6
  56. package/dist/implementation/interpolation/interpolationMethods/CameraOrthographicInterpolation.js.map +1 -1
  57. package/dist/implementation/interpolation/interpolationMethods/CameraSphericalInterpolation.d.ts +3 -3
  58. package/dist/implementation/interpolation/interpolationMethods/CameraSphericalInterpolation.d.ts.map +1 -1
  59. package/dist/implementation/interpolation/interpolationMethods/CameraSphericalInterpolation.js +9 -9
  60. package/dist/implementation/interpolation/interpolationMethods/CameraSphericalInterpolation.js.map +1 -1
  61. package/dist/index.d.ts +6 -8
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +6 -6
  64. package/dist/index.js.map +1 -1
  65. package/dist/interfaces/ICameraEngine.d.ts +7 -7
  66. package/dist/interfaces/ICameraEngine.d.ts.map +1 -1
  67. package/dist/interfaces/ICameraEngine.js +3 -0
  68. package/dist/interfaces/ICameraEngine.js.map +1 -1
  69. package/dist/interfaces/camera/ICamera.d.ts +23 -22
  70. package/dist/interfaces/camera/ICamera.d.ts.map +1 -1
  71. package/dist/interfaces/camera/ICamera.js +1 -0
  72. package/dist/interfaces/camera/ICamera.js.map +1 -1
  73. package/dist/interfaces/camera/IOrthographicCamera.d.ts +8 -7
  74. package/dist/interfaces/camera/IOrthographicCamera.d.ts.map +1 -1
  75. package/dist/interfaces/camera/IOrthographicCamera.js +4 -0
  76. package/dist/interfaces/camera/IOrthographicCamera.js.map +1 -1
  77. package/dist/interfaces/camera/IPerspectiveCamera.d.ts +2 -2
  78. package/dist/interfaces/camera/IPerspectiveCamera.d.ts.map +1 -1
  79. package/dist/interfaces/controls/ICameraControls.d.ts +73 -2
  80. package/dist/interfaces/controls/ICameraControls.d.ts.map +1 -1
  81. package/dist/interfaces/controls/ICameraControls.js +1 -0
  82. package/dist/interfaces/controls/ICameraControls.js.map +1 -1
  83. package/dist/interfaces/controls/ICameraControlsEventDistribution.d.ts +1 -1
  84. package/dist/interfaces/controls/ICameraControlsEventDistribution.d.ts.map +1 -1
  85. package/dist/interfaces/controls/ICameraControlsLogic.d.ts +4 -1
  86. package/dist/interfaces/controls/ICameraControlsLogic.d.ts.map +1 -1
  87. package/dist/interfaces/interpolation/ICameraInterpolation.d.ts +2 -2
  88. package/dist/interfaces/interpolation/ICameraInterpolation.d.ts.map +1 -1
  89. package/package.json +8 -8
  90. package/src/implementation/CameraEngine.ts +111 -70
  91. package/src/implementation/camera/AbstractCamera.ts +24 -16
  92. package/src/implementation/camera/OrthographicCamera.ts +84 -85
  93. package/src/implementation/camera/PerspectiveCamera.ts +64 -69
  94. package/src/implementation/controls/AbstractCameraControls.ts +303 -14
  95. package/src/implementation/controls/{perspective/CameraControlsEventDistribution.ts → CameraControlsEventDistribution.ts} +96 -75
  96. package/src/implementation/controls/{perspective/CameraControlsLogic.ts → CameraControlsLogic.ts} +90 -53
  97. package/src/implementation/controls/OrthographicCameraControls.ts +27 -121
  98. package/src/implementation/controls/PerspectiveCameraControls.ts +28 -294
  99. package/src/implementation/interpolation/CameraInterpolationManager.ts +40 -45
  100. package/src/implementation/interpolation/interpolationMethods/CameraCylindricalInterpolation.ts +19 -22
  101. package/src/implementation/interpolation/interpolationMethods/CameraLinearInterpolation.ts +15 -16
  102. package/src/implementation/interpolation/interpolationMethods/CameraMultipleInterpolation.ts +17 -19
  103. package/src/implementation/interpolation/interpolationMethods/CameraOrthographicInterpolation.ts +12 -14
  104. package/src/implementation/interpolation/interpolationMethods/CameraSphericalInterpolation.ts +18 -20
  105. package/src/index.ts +18 -21
  106. package/src/interfaces/ICameraEngine.ts +24 -11
  107. package/src/interfaces/camera/ICamera.ts +45 -41
  108. package/src/interfaces/camera/IOrthographicCamera.ts +27 -9
  109. package/src/interfaces/camera/IPerspectiveCamera.ts +13 -5
  110. package/src/interfaces/controls/ICameraControls.ts +49 -6
  111. package/src/interfaces/controls/ICameraControlsEventDistribution.ts +5 -2
  112. package/src/interfaces/controls/ICameraControlsLogic.ts +6 -3
  113. package/src/interfaces/interpolation/ICameraInterpolation.ts +6 -2
  114. package/dist/implementation/controls/orthographic/CameraControlsEventDistribution.d.ts +0 -32
  115. package/dist/implementation/controls/orthographic/CameraControlsEventDistribution.d.ts.map +0 -1
  116. package/dist/implementation/controls/orthographic/CameraControlsEventDistribution.js +0 -230
  117. package/dist/implementation/controls/orthographic/CameraControlsEventDistribution.js.map +0 -1
  118. package/dist/implementation/controls/orthographic/CameraControlsLogic.d.ts +0 -28
  119. package/dist/implementation/controls/orthographic/CameraControlsLogic.d.ts.map +0 -1
  120. package/dist/implementation/controls/orthographic/CameraControlsLogic.js +0 -243
  121. package/dist/implementation/controls/orthographic/CameraControlsLogic.js.map +0 -1
  122. package/dist/implementation/controls/perspective/CameraControlsEventDistribution.d.ts +0 -32
  123. package/dist/implementation/controls/perspective/CameraControlsEventDistribution.d.ts.map +0 -1
  124. package/dist/implementation/controls/perspective/CameraControlsEventDistribution.js.map +0 -1
  125. package/dist/implementation/controls/perspective/CameraControlsLogic.d.ts.map +0 -1
  126. package/dist/implementation/controls/perspective/CameraControlsLogic.js.map +0 -1
  127. package/dist/interfaces/controls/ICameraControlsUsage.d.ts +0 -22
  128. package/dist/interfaces/controls/ICameraControlsUsage.d.ts.map +0 -1
  129. package/dist/interfaces/controls/ICameraControlsUsage.js +0 -3
  130. package/dist/interfaces/controls/ICameraControlsUsage.js.map +0 -1
  131. package/dist/interfaces/controls/IOrthographicCameraControls.d.ts +0 -30
  132. package/dist/interfaces/controls/IOrthographicCameraControls.d.ts.map +0 -1
  133. package/dist/interfaces/controls/IOrthographicCameraControls.js +0 -3
  134. package/dist/interfaces/controls/IOrthographicCameraControls.js.map +0 -1
  135. package/dist/interfaces/controls/IPerspectiveCameraControls.d.ts +0 -65
  136. package/dist/interfaces/controls/IPerspectiveCameraControls.d.ts.map +0 -1
  137. package/dist/interfaces/controls/IPerspectiveCameraControls.js +0 -3
  138. package/dist/interfaces/controls/IPerspectiveCameraControls.js.map +0 -1
  139. package/src/implementation/controls/orthographic/CameraControlsEventDistribution.ts +0 -234
  140. package/src/implementation/controls/orthographic/CameraControlsLogic.ts +0 -271
  141. package/src/interfaces/controls/ICameraControlsUsage.ts +0 -30
  142. package/src/interfaces/controls/IOrthographicCameraControls.ts +0 -13
  143. package/src/interfaces/controls/IPerspectiveCameraControls.ts +0 -33
@@ -1,8 +1,7 @@
1
- import { mat4, quat, vec3 } from 'gl-matrix'
2
-
3
- import { ICamera } from '../../../interfaces/camera/ICamera'
4
- import { ICameraControlsUsage } from '../../../interfaces/controls/ICameraControlsUsage'
5
- import { ICameraInterpolation } from '../../../interfaces/interpolation/ICameraInterpolation'
1
+ import { ICamera } from '../../../interfaces/camera/ICamera';
2
+ import { ICameraControls } from '../../../interfaces/controls/ICameraControls';
3
+ import { ICameraInterpolation } from '../../../interfaces/interpolation/ICameraInterpolation';
4
+ import { quat, vec3 } from 'gl-matrix';
6
5
 
7
6
  export class CameraCylindricalInterpolation implements ICameraInterpolation {
8
7
  // #region Properties (10)
@@ -24,10 +23,9 @@ export class CameraCylindricalInterpolation implements ICameraInterpolation {
24
23
 
25
24
  constructor(
26
25
  private readonly _camera: ICamera,
27
- private readonly _cameraControls: ICameraControlsUsage,
26
+ private readonly _cameraControls: ICameraControls,
28
27
  private readonly _from: { position: vec3, target: vec3 },
29
- private readonly _to: { position: vec3, target: vec3 })
30
- {
28
+ private readonly _to: { position: vec3, target: vec3 }) {
31
29
  this._h_from = this._from.position[2] - this._from.target[2];
32
30
  this._from_position_heightAdjusted = vec3.fromValues(this._from.position[0], this._from.position[1], this._from.target[2]);
33
31
  this._r_from = vec3.distance(this._from_position_heightAdjusted, this._from.target);
@@ -39,15 +37,15 @@ export class CameraCylindricalInterpolation implements ICameraInterpolation {
39
37
  this._dir_to = vec3.normalize(vec3.create(), vec3.subtract(vec3.create(), this._to_position_heightAdjusted, this._to.target));
40
38
 
41
39
  if (this._dir_from[0] === 0 && this._dir_from[1] === 0 && this._dir_from[2] === 0)
42
- this._dir_from = vec3.fromValues(1,0,0);
40
+ this._dir_from = vec3.fromValues(1, 0, 0);
43
41
 
44
42
  if (this._dir_to[0] === 0 && this._dir_to[1] === 0 && this._dir_to[2] === 0)
45
- this._dir_to = vec3.fromValues(1,0,0);
43
+ this._dir_to = vec3.fromValues(1, 0, 0);
46
44
 
47
45
  this._lorr = vec3.cross(vec3.create(), this._dir_to, this._dir_from);
48
46
  // This is why people hate JavaScript. The dot product of two normalized vector is larger than 1 on occasion due to precision errors...
49
- let dot1 = Math.min(1, Math.max(-1, vec3.dot(this._dir_to, this._dir_from)));
50
- let dot2 = Math.min(1, Math.max(-1, vec3.dot(this._lorr, vec3.fromValues(0, 0, 1))));
47
+ const dot1 = Math.min(1, Math.max(-1, vec3.dot(this._dir_to, this._dir_from)));
48
+ const dot2 = Math.min(1, Math.max(-1, vec3.dot(this._lorr, vec3.fromValues(0, 0, 1))));
51
49
  this._shortest_angle = dot2 > 0 ? -Math.acos(dot1) : Math.acos(dot1);
52
50
  }
53
51
 
@@ -56,9 +54,9 @@ export class CameraCylindricalInterpolation implements ICameraInterpolation {
56
54
  // #region Public Methods (3)
57
55
 
58
56
  public onComplete(value: { delta: number }): void {
59
- let positionOffset = vec3.subtract(vec3.create(), vec3.fromValues(this._to.position[0], this._to.position[1], this._to.position[2]), this._cameraControls.getPositionWithUpdates());
57
+ const positionOffset = vec3.subtract(vec3.create(), vec3.fromValues(this._to.position[0], this._to.position[1], this._to.position[2]), this._cameraControls.getPositionWithUpdates());
60
58
  this._cameraControls.applyPositionVector(positionOffset);
61
- let targetOffset = vec3.subtract(vec3.create(), vec3.fromValues(this._to.target[0], this._to.target[1], this._to.target[2]), this._cameraControls.getTargetWithUpdates());
59
+ const targetOffset = vec3.subtract(vec3.create(), vec3.fromValues(this._to.target[0], this._to.target[1], this._to.target[2]), this._cameraControls.getTargetWithUpdates());
62
60
  this._cameraControls.applyTargetVector(targetOffset);
63
61
  }
64
62
 
@@ -66,19 +64,18 @@ export class CameraCylindricalInterpolation implements ICameraInterpolation {
66
64
  }
67
65
 
68
66
  public onUpdate(value: { delta: number }): void {
69
- let t = vec3.add(vec3.create(), vec3.multiply(vec3.create(), this._from.target, vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), vec3.multiply(vec3.create(), this._to.target, vec3.fromValues(value.delta, value.delta, value.delta)));
70
- let targetOffset = vec3.subtract(vec3.create(), t, this._cameraControls.getTargetWithUpdates());
67
+ const t = vec3.add(vec3.create(), vec3.multiply(vec3.create(), this._from.target, vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), vec3.multiply(vec3.create(), this._to.target, vec3.fromValues(value.delta, value.delta, value.delta)));
68
+ const targetOffset = vec3.subtract(vec3.create(), t, this._cameraControls.getTargetWithUpdates());
71
69
  this._cameraControls.applyTargetVector(targetOffset);
72
70
 
73
- let angle = this._shortest_angle * value.delta;
74
- let dir = vec3.transformQuat(vec3.create(), this._dir_from, quat.setAxisAngle(quat.create(), vec3.fromValues(0, 0, 1), angle));
75
-
71
+ const angle = this._shortest_angle * value.delta;
72
+ const dir = vec3.transformQuat(vec3.create(), this._dir_from, quat.setAxisAngle(quat.create(), vec3.fromValues(0, 0, 1), angle));
76
73
 
77
- let scalar = this._r_from * (1 - value.delta) + this._r_to * value.delta;
78
- let p = vec3.add(vec3.create(), t, vec3.multiply(vec3.create(), dir, vec3.fromValues(scalar, scalar, scalar)));
74
+ const scalar = this._r_from * (1 - value.delta) + this._r_to * value.delta;
75
+ const p = vec3.add(vec3.create(), t, vec3.multiply(vec3.create(), dir, vec3.fromValues(scalar, scalar, scalar)));
79
76
  vec3.add(p, p, vec3.fromValues(0, 0, (this._h_from * (1 - value.delta) + this._h_to * value.delta)));
80
77
 
81
- let positionOffset = vec3.subtract(vec3.create(), p, this._cameraControls.getPositionWithUpdates());
78
+ const positionOffset = vec3.subtract(vec3.create(), p, this._cameraControls.getPositionWithUpdates());
82
79
  this._cameraControls.applyPositionVector(positionOffset);
83
80
  }
84
81
 
@@ -1,27 +1,26 @@
1
- import { mat4, vec3 } from 'gl-matrix'
2
-
3
- import { ICamera } from '../../../interfaces/camera/ICamera'
4
- import { ICameraControlsUsage } from '../../../interfaces/controls/ICameraControlsUsage'
5
- import { ICameraInterpolation } from '../../../interfaces/interpolation/ICameraInterpolation'
1
+ import { ICamera } from '../../../interfaces/camera/ICamera';
2
+ import { ICameraControls } from '../../../interfaces/controls/ICameraControls';
3
+ import { ICameraInterpolation } from '../../../interfaces/interpolation/ICameraInterpolation';
4
+ import { vec3 } from 'gl-matrix';
6
5
 
7
6
  export class CameraLinearInterpolation implements ICameraInterpolation {
8
7
  // #region Constructors (1)
9
8
 
10
9
  constructor(
11
- private readonly _camera: ICamera,
12
- private readonly _cameraControls: ICameraControlsUsage,
13
- private readonly _from: { position: vec3, target: vec3 },
14
- private readonly _to: { position: vec3, target: vec3 })
15
- {
10
+ private readonly _camera: ICamera,
11
+ private readonly _cameraControls: ICameraControls,
12
+ private readonly _from: { position: vec3, target: vec3 },
13
+ private readonly _to: { position: vec3, target: vec3 }) {
16
14
  }
15
+
17
16
  // #endregion Constructors (1)
18
17
 
19
18
  // #region Public Methods (3)
20
19
 
21
20
  public onComplete(value: { delta: number }): void {
22
- let positionOffset = vec3.subtract(vec3.create(), this._to.position, this._cameraControls.getPositionWithUpdates());
21
+ const positionOffset = vec3.subtract(vec3.create(), this._to.position, this._cameraControls.getPositionWithUpdates());
23
22
  this._cameraControls.applyPositionVector(positionOffset);
24
- let targetOffset = vec3.subtract(vec3.create(), this._to.target, this._cameraControls.getTargetWithUpdates());
23
+ const targetOffset = vec3.subtract(vec3.create(), this._to.target, this._cameraControls.getTargetWithUpdates());
25
24
  this._cameraControls.applyTargetVector(targetOffset);
26
25
  }
27
26
 
@@ -29,12 +28,12 @@ export class CameraLinearInterpolation implements ICameraInterpolation {
29
28
  }
30
29
 
31
30
  public onUpdate(value: { delta: number }): void {
32
- let p = vec3.add(vec3.create(), vec3.multiply(vec3.create(), this._from.position, vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), vec3.multiply(vec3.create(), this._to.position, vec3.fromValues(value.delta, value.delta, value.delta)));
33
- let positionOffset = vec3.subtract(vec3.create(), p, this._cameraControls.getPositionWithUpdates());
31
+ const p = vec3.add(vec3.create(), vec3.multiply(vec3.create(), this._from.position, vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), vec3.multiply(vec3.create(), this._to.position, vec3.fromValues(value.delta, value.delta, value.delta)));
32
+ const positionOffset = vec3.subtract(vec3.create(), p, this._cameraControls.getPositionWithUpdates());
34
33
  this._cameraControls.applyPositionVector(positionOffset);
35
34
 
36
- let t = vec3.add(vec3.create(), vec3.multiply(vec3.create(), this._from.target, vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), vec3.multiply(vec3.create(), this._to.target, vec3.fromValues(value.delta, value.delta, value.delta)));
37
- let targetOffset = vec3.subtract(vec3.create(), t, this._cameraControls.getTargetWithUpdates());
35
+ const t = vec3.add(vec3.create(), vec3.multiply(vec3.create(), this._from.target, vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), vec3.multiply(vec3.create(), this._to.target, vec3.fromValues(value.delta, value.delta, value.delta)));
36
+ const targetOffset = vec3.subtract(vec3.create(), t, this._cameraControls.getTargetWithUpdates());
38
37
  this._cameraControls.applyTargetVector(targetOffset);
39
38
  }
40
39
 
@@ -1,8 +1,7 @@
1
- import { mat4, vec3 } from 'gl-matrix'
2
-
3
- import { ICamera } from '../../../interfaces/camera/ICamera'
4
- import { ICameraControlsUsage } from '../../../interfaces/controls/ICameraControlsUsage'
5
- import { ICameraInterpolation } from '../../../interfaces/interpolation/ICameraInterpolation'
1
+ import { ICamera } from '../../../interfaces/camera/ICamera';
2
+ import { ICameraControls } from '../../../interfaces/controls/ICameraControls';
3
+ import { ICameraInterpolation } from '../../../interfaces/interpolation/ICameraInterpolation';
4
+ import { vec3 } from 'gl-matrix';
6
5
 
7
6
  export class CameraMultipleInterpolation implements ICameraInterpolation {
8
7
  // #region Properties (1)
@@ -11,21 +10,20 @@ export class CameraMultipleInterpolation implements ICameraInterpolation {
11
10
  position: { x: number[], y: number[], z: number[] },
12
11
  target: { x: number[], y: number[], z: number[] }
13
12
  } = {
14
- position: { x: [], y: [], z: [] },
15
- target: { x: [], y: [], z: [] }
16
- };
13
+ position: { x: [], y: [], z: [] },
14
+ target: { x: [], y: [], z: [] }
15
+ };
17
16
 
18
17
  // #endregion Properties (1)
19
18
 
20
19
  // #region Constructors (1)
21
20
 
22
21
  constructor(
23
- private readonly _camera: ICamera,
24
- private readonly _cameraControls: ICameraControlsUsage,
22
+ private readonly _camera: ICamera,
23
+ private readonly _cameraControls: ICameraControls,
25
24
  private readonly _path: { position: vec3, target: vec3 }[],
26
- private readonly _interpolationFunction: Function)
27
- {
28
- for(let i = 0; i < this._path.length; i++) {
25
+ private readonly _interpolationFunction: (v: number[], k: number) => number) {
26
+ for (let i = 0; i < this._path.length; i++) {
29
27
  this.end.position.x.push(this._path[i].position[0]);
30
28
  this.end.position.y.push(this._path[i].position[1]);
31
29
  this.end.position.z.push(this._path[i].position[2]);
@@ -40,9 +38,9 @@ export class CameraMultipleInterpolation implements ICameraInterpolation {
40
38
  // #region Public Methods (3)
41
39
 
42
40
  public onComplete(value: { delta: number }): void {
43
- let positionOffset = vec3.subtract(vec3.create(), 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());
41
+ const positionOffset = vec3.subtract(vec3.create(), 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());
44
42
  this._cameraControls.applyPositionVector(positionOffset);
45
- let targetOffset = vec3.subtract(vec3.create(), 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());
43
+ const targetOffset = vec3.subtract(vec3.create(), 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());
46
44
  this._cameraControls.applyTargetVector(targetOffset);
47
45
  }
48
46
 
@@ -50,12 +48,12 @@ export class CameraMultipleInterpolation implements ICameraInterpolation {
50
48
  }
51
49
 
52
50
  public onUpdate(value: { delta: number }): void {
53
- let p: vec3 = 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));
54
- let positionOffset = vec3.subtract(vec3.create(), p, this._cameraControls.getPositionWithUpdates());
51
+ const p: vec3 = 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));
52
+ const positionOffset = vec3.subtract(vec3.create(), p, this._cameraControls.getPositionWithUpdates());
55
53
  this._cameraControls.applyPositionVector(positionOffset);
56
54
 
57
- let t: vec3 = 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));
58
- let targetOffset = vec3.subtract(vec3.create(), t, this._cameraControls.getTargetWithUpdates());
55
+ const t: vec3 = 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));
56
+ const targetOffset = vec3.subtract(vec3.create(), t, this._cameraControls.getTargetWithUpdates());
59
57
  this._cameraControls.applyTargetVector(targetOffset);
60
58
  }
61
59
 
@@ -1,18 +1,16 @@
1
- import { mat4, vec3 } from 'gl-matrix'
2
-
3
- import { ICamera } from '../../../interfaces/camera/ICamera'
4
- import { ICameraControlsUsage } from '../../../interfaces/controls/ICameraControlsUsage'
5
- import { ICameraInterpolation } from '../../../interfaces/interpolation/ICameraInterpolation'
1
+ import { ICamera } from '../../../interfaces/camera/ICamera';
2
+ import { ICameraControls } from '../../../interfaces/controls/ICameraControls';
3
+ import { ICameraInterpolation } from '../../../interfaces/interpolation/ICameraInterpolation';
4
+ import { vec3 } from 'gl-matrix';
6
5
 
7
6
  export class CameraOrthographicInterpolation implements ICameraInterpolation {
8
7
  // #region Constructors (1)
9
8
 
10
9
  constructor(
11
10
  private readonly _camera: ICamera,
12
- private readonly _cameraControls: ICameraControlsUsage,
11
+ private readonly _cameraControls: ICameraControls,
13
12
  private readonly _from: { position: vec3, target: vec3 },
14
- private readonly _to: { position: vec3, target: vec3 })
15
- {
13
+ private readonly _to: { position: vec3, target: vec3 }) {
16
14
  }
17
15
 
18
16
  // #endregion Constructors (1)
@@ -20,9 +18,9 @@ export class CameraOrthographicInterpolation implements ICameraInterpolation {
20
18
  // #region Public Methods (3)
21
19
 
22
20
  public onComplete(value: { delta: number }): void {
23
- let positionOffset = vec3.subtract(vec3.create(), vec3.fromValues(this._to.position[0], this._to.position[1], this._to.position[2]), this._cameraControls.getPositionWithUpdates());
21
+ const positionOffset = vec3.subtract(vec3.create(), vec3.fromValues(this._to.position[0], this._to.position[1], this._to.position[2]), this._cameraControls.getPositionWithUpdates());
24
22
  this._cameraControls.applyPositionVector(positionOffset);
25
- let targetOffset = vec3.subtract(vec3.create(), vec3.fromValues(this._to.target[0], this._to.target[1], this._to.target[2]), this._cameraControls.getTargetWithUpdates());
23
+ const targetOffset = vec3.subtract(vec3.create(), vec3.fromValues(this._to.target[0], this._to.target[1], this._to.target[2]), this._cameraControls.getTargetWithUpdates());
26
24
  this._cameraControls.applyTargetVector(targetOffset);
27
25
  }
28
26
 
@@ -30,12 +28,12 @@ export class CameraOrthographicInterpolation implements ICameraInterpolation {
30
28
  }
31
29
 
32
30
  public onUpdate(value: { delta: number }): void {
33
- let t: vec3 = vec3.add(vec3.create(), vec3.multiply(vec3.create(), this._from.target, vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), vec3.multiply(vec3.create(), this._to.target, vec3.fromValues(value.delta, value.delta, value.delta)));
34
- let targetOffset = vec3.subtract(vec3.create(), t, this._cameraControls.getTargetWithUpdates());
31
+ const t: vec3 = vec3.add(vec3.create(), vec3.multiply(vec3.create(), this._from.target, vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), vec3.multiply(vec3.create(), this._to.target, vec3.fromValues(value.delta, value.delta, value.delta)));
32
+ const targetOffset = vec3.subtract(vec3.create(), t, this._cameraControls.getTargetWithUpdates());
35
33
  this._cameraControls.applyTargetVector(targetOffset);
36
34
 
37
- let p: vec3 = vec3.add(vec3.create(), vec3.multiply(vec3.create(), this._from.position, vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), vec3.multiply(vec3.create(), this._to.position, vec3.fromValues(value.delta, value.delta, value.delta)));
38
- let positionOffset = vec3.subtract(vec3.create(), p, this._cameraControls.getPositionWithUpdates());
35
+ const p: vec3 = vec3.add(vec3.create(), vec3.multiply(vec3.create(), this._from.position, vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), vec3.multiply(vec3.create(), this._to.position, vec3.fromValues(value.delta, value.delta, value.delta)));
36
+ const positionOffset = vec3.subtract(vec3.create(), p, this._cameraControls.getPositionWithUpdates());
39
37
  this._cameraControls.applyPositionVector(positionOffset);
40
38
  }
41
39
 
@@ -1,8 +1,7 @@
1
- import { mat4, quat, vec3 } from 'gl-matrix'
2
-
3
- import { ICamera } from '../../../interfaces/camera/ICamera'
4
- import { ICameraControlsUsage } from '../../../interfaces/controls/ICameraControlsUsage'
5
- import { ICameraInterpolation } from '../../../interfaces/interpolation/ICameraInterpolation'
1
+ import { ICamera } from '../../../interfaces/camera/ICamera';
2
+ import { ICameraControls } from '../../../interfaces/controls/ICameraControls';
3
+ import { ICameraInterpolation } from '../../../interfaces/interpolation/ICameraInterpolation';
4
+ import { quat, vec3 } from 'gl-matrix';
6
5
 
7
6
  export class CameraSphericalInterpolation implements ICameraInterpolation {
8
7
  // #region Properties (6)
@@ -20,13 +19,12 @@ export class CameraSphericalInterpolation implements ICameraInterpolation {
20
19
 
21
20
  constructor(
22
21
  private readonly _camera: ICamera,
23
- private readonly _cameraControls: ICameraControlsUsage,
22
+ private readonly _cameraControls: ICameraControls,
24
23
  private readonly _from: { position: vec3, target: vec3 },
25
- private readonly _to: { position: vec3, target: vec3 })
26
- {
24
+ private readonly _to: { position: vec3, target: vec3 }) {
27
25
  this._radius_from = vec3.distance(this._from.position, this._from.target);
28
26
  this._direction_from = vec3.normalize(vec3.create(), vec3.subtract(vec3.create(), this._from.position, this._from.target));
29
-
27
+
30
28
  this._radius_to = vec3.distance(this._to.position, this._to.target);
31
29
  this._direction_to = vec3.normalize(vec3.create(), vec3.subtract(vec3.create(), this._to.position, this._to.target));
32
30
 
@@ -35,14 +33,14 @@ export class CameraSphericalInterpolation implements ICameraInterpolation {
35
33
  }
36
34
 
37
35
  // #endregion Constructors (1)
38
-
36
+
39
37
  // #region Public Methods (3)
40
38
 
41
39
  public onComplete(value: { delta: number }): void {
42
- let positionOffset = vec3.subtract(vec3.create(), vec3.fromValues(this._to.position[0], this._to.position[1], this._to.position[2]), this._cameraControls.getPositionWithUpdates());
40
+ const positionOffset = vec3.subtract(vec3.create(), vec3.fromValues(this._to.position[0], this._to.position[1], this._to.position[2]), this._cameraControls.getPositionWithUpdates());
43
41
  this._cameraControls.applyPositionVector(positionOffset);
44
-
45
- let targetOffset = vec3.subtract(vec3.create(), vec3.fromValues(this._to.target[0], this._to.target[1], this._to.target[2]), this._cameraControls.getTargetWithUpdates());
42
+
43
+ const targetOffset = vec3.subtract(vec3.create(), vec3.fromValues(this._to.target[0], this._to.target[1], this._to.target[2]), this._cameraControls.getTargetWithUpdates());
46
44
  this._cameraControls.applyTargetVector(targetOffset);
47
45
  }
48
46
 
@@ -50,16 +48,16 @@ export class CameraSphericalInterpolation implements ICameraInterpolation {
50
48
  }
51
49
 
52
50
  public onUpdate(value: { delta: number }): void {
53
- let t: vec3 = vec3.add(vec3.create(), vec3.multiply(vec3.create(), this._from.target, vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), vec3.multiply(vec3.create(), this._to.target, vec3.fromValues(value.delta, value.delta, value.delta)));
54
- let targetOffset = vec3.subtract(vec3.create(), t, this._cameraControls.getTargetWithUpdates());
51
+ const t: vec3 = vec3.add(vec3.create(), vec3.multiply(vec3.create(), this._from.target, vec3.fromValues(1 - value.delta, 1 - value.delta, 1 - value.delta)), vec3.multiply(vec3.create(), this._to.target, vec3.fromValues(value.delta, value.delta, value.delta)));
52
+ const targetOffset = vec3.subtract(vec3.create(), t, this._cameraControls.getTargetWithUpdates());
55
53
  this._cameraControls.applyTargetVector(targetOffset);
56
54
 
57
- let angle = this._c_angle * value.delta;
58
- let dir = vec3.normalize(vec3.create(), vec3.transformQuat(vec3.create(), this._direction_from, quat.setAxisAngle(quat.create(), this._axis, angle)));
55
+ const angle = this._c_angle * value.delta;
56
+ const dir = vec3.normalize(vec3.create(), vec3.transformQuat(vec3.create(), this._direction_from, quat.setAxisAngle(quat.create(), this._axis, angle)));
59
57
 
60
- let scalar = (this._radius_from * (1 - value.delta) + this._radius_to * value.delta);
61
- let p: vec3 = vec3.add(vec3.create(), t, vec3.multiply(vec3.create(), dir, vec3.fromValues(scalar, scalar, scalar)));
62
- let positionOffset = vec3.subtract(vec3.create(), p, this._cameraControls.getPositionWithUpdates());
58
+ const scalar = (this._radius_from * (1 - value.delta) + this._radius_to * value.delta);
59
+ const p: vec3 = vec3.add(vec3.create(), t, vec3.multiply(vec3.create(), dir, vec3.fromValues(scalar, scalar, scalar)));
60
+ const positionOffset = vec3.subtract(vec3.create(), p, this._cameraControls.getPositionWithUpdates());
63
61
  this._cameraControls.applyPositionVector(positionOffset);
64
62
  }
65
63
 
package/src/index.ts CHANGED
@@ -1,31 +1,28 @@
1
- import { ICameraControls } from './interfaces/controls/ICameraControls'
2
- import { AbstractCamera } from './implementation/camera/AbstractCamera'
3
- import { CameraEngine } from './implementation/CameraEngine'
4
- import { ICamera, ICameraOptions } from './interfaces/camera/ICamera'
5
- import { CAMERA_TYPE, ICameraEngine } from './interfaces/ICameraEngine'
6
- import { OrthographicCamera } from './implementation/camera/OrthographicCamera'
7
- import { PerspectiveCamera } from './implementation/camera/PerspectiveCamera'
8
- import { OrthographicCameraControls } from './implementation/controls/OrthographicCameraControls'
9
- import { PerspectiveCameraControls } from './implementation/controls/PerspectiveCameraControls'
10
- import { IPerspectiveCameraControls } from './interfaces/controls/IPerspectiveCameraControls'
11
- import { IOrthographicCameraControls } from './interfaces/controls/IOrthographicCameraControls'
12
- import { IOrthographicCamera, ORTHOGRAPHIC_CAMERA_DIRECTION } from './interfaces/camera/IOrthographicCamera'
13
- import { IPerspectiveCamera } from './interfaces/camera/IPerspectiveCamera'
1
+ import { AbstractCamera } from './implementation/camera/AbstractCamera';
2
+ import { CAMERA_TYPE, ICameraEngine } from './interfaces/ICameraEngine';
3
+ import { CameraEngine } from './implementation/CameraEngine';
4
+ import { ICamera, ICameraOptions } from './interfaces/camera/ICamera';
5
+ import { ICameraControls } from './interfaces/controls/ICameraControls';
6
+ import { IOrthographicCamera, ORTHOGRAPHIC_CAMERA_DIRECTION } from './interfaces/camera/IOrthographicCamera';
7
+ import { IPerspectiveCamera } from './interfaces/camera/IPerspectiveCamera';
8
+ import { OrthographicCamera } from './implementation/camera/OrthographicCamera';
9
+ import { OrthographicCameraControls } from './implementation/controls/OrthographicCameraControls';
10
+ import { PerspectiveCamera } from './implementation/camera/PerspectiveCamera';
11
+ import { PerspectiveCameraControls } from './implementation/controls/PerspectiveCameraControls';
14
12
 
15
13
  export {
16
14
  ICameraEngine, ICamera, ICameraControls
17
- }
15
+ };
18
16
 
19
17
  export {
20
18
  CameraEngine, AbstractCamera, CAMERA_TYPE, ORTHOGRAPHIC_CAMERA_DIRECTION, ICameraOptions
21
- }
19
+ };
22
20
 
23
- export {
21
+ export {
24
22
  PerspectiveCamera, OrthographicCamera,
25
23
  IPerspectiveCamera, IOrthographicCamera
26
- }
24
+ };
27
25
 
28
- export {
29
- PerspectiveCameraControls, OrthographicCameraControls,
30
- IPerspectiveCameraControls, IOrthographicCameraControls
31
- }
26
+ export {
27
+ PerspectiveCameraControls, OrthographicCameraControls
28
+ };
@@ -1,20 +1,33 @@
1
- import { vec3 } from 'gl-matrix'
1
+ import { ICamera } from './camera/ICamera';
2
2
 
3
- import { ICamera } from './camera/ICamera'
4
-
5
- export enum CAMERA_TYPE {
6
- PERSPECTIVE = 'perspective',
7
- ORTHOGRAPHIC = 'orthographic'
8
- }
3
+ // #region Interfaces (1)
9
4
 
10
5
  export interface ICameraEngine {
6
+ // #region Properties (1)
7
+
11
8
  update?: () => void;
12
9
 
10
+ // #endregion Properties (1)
11
+
12
+ // #region Public Methods (6)
13
+
14
+ activateCameraEvents(): void;
13
15
  assignCamera(id: string): boolean;
14
16
  createCamera(type: CAMERA_TYPE, id?: string): ICamera;
17
+ createDefaultCameras(): void;
18
+ deactivateCameraEvents(): void;
15
19
  removeCamera(id: string): boolean;
16
20
 
17
- activateCameraEvents(): void;
18
- deactivateCameraEvents(): void;
19
- createDefaultCameras(): void;
20
- }
21
+ // #endregion Public Methods (6)
22
+ }
23
+
24
+ // #endregion Interfaces (1)
25
+
26
+ // #region Enums (1)
27
+
28
+ export enum CAMERA_TYPE {
29
+ PERSPECTIVE = 'perspective',
30
+ ORTHOGRAPHIC = 'orthographic'
31
+ }
32
+
33
+ // #endregion Enums (1)
@@ -1,48 +1,14 @@
1
- /* eslint-disable @typescript-eslint/ban-types */
2
- import { vec2, vec3 } from 'gl-matrix';
3
- import { ITreeNode, ITreeNodeData } from '@shapediver/viewer.shared.node-tree';
4
-
5
- import { ICameraControls } from '../controls/ICameraControls';
6
1
  import { CAMERA_TYPE } from '../ICameraEngine';
7
2
  import { IBox } from '@shapediver/viewer.shared.math';
3
+ import { ICameraControls } from '../controls/ICameraControls';
4
+ import { ITreeNode, ITreeNodeData } from '@shapediver/viewer.shared.node-tree';
8
5
  import { SettingsEngine } from '@shapediver/viewer.shared.services';
6
+ import { vec2, vec3 } from 'gl-matrix';
9
7
 
10
- export interface ICameraOptions {
11
- // #region Properties (4)
12
-
13
- /**
14
- * The coordinate type of the camera interpolation. (default: 'cylindrical')
15
- */
16
- coordinates?: 'spherical' | 'linear' | 'cylindrical';
17
- /**
18
- * The duration of the camera movement. (default: cameraMovementDuration set in the settings)
19
- * When set to 0, the camera is immediately updated to the specified position and target.
20
- */
21
- duration?: number;
22
- /**
23
- * The easing type of the camera interpolation. (default: 'Quadratic.InOut')
24
- */
25
- easing?: 'Linear.None' |
26
- 'Quadratic.In' | 'Quadratic.Out' | 'Quadratic.InOut' |
27
- 'Cubic.In' | 'Cubic.Out' | 'Cubic.InOut' |
28
- 'Quartic.In' | 'Quartic.Out' | 'Quartic.InOut' |
29
- 'Quintic.In' | 'Quintic.Out' | 'Quintic.InOut' |
30
- 'Sinusoidal.In' | 'Sinusoidal.Out' | 'Sinusoidal.InOut' |
31
- 'Exponential.In' | 'Exponential.Out' | 'Exponential.InOut' |
32
- 'Circular.In' | 'Circular.Out' | 'Circular.InOut' |
33
- 'Elastic.In' | 'Elastic.Out' | 'Elastic.InOut' |
34
- 'Back.In' | 'Back.Out' | 'Back.InOut' |
35
- 'Bounce.In' | 'Bounce.Out' | 'Bounce.InOut' | Function;
36
- /**
37
- * The interpolation type of the camera interpolation. (default: 'CatmullRom')
38
- */
39
- interpolation?: 'Linear' | 'Bezier' | 'CatmullRom' | Function
40
-
41
- // #endregion Properties (4)
42
- }
8
+ // #region Interfaces (2)
43
9
 
44
10
  export interface ICamera extends ITreeNodeData {
45
- // #region Properties (20)
11
+ // #region Properties (21)
46
12
 
47
13
  readonly controls: ICameraControls;
48
14
  readonly id: string;
@@ -54,6 +20,7 @@ export interface ICamera extends ITreeNodeData {
54
20
  cameraMovementDuration: number;
55
21
  defaultPosition: vec3;
56
22
  defaultTarget: vec3;
23
+ domEventListenerToken?: string;
57
24
  enableCameraControls: boolean;
58
25
  name?: string;
59
26
  node?: ITreeNode;
@@ -66,7 +33,7 @@ export interface ICamera extends ITreeNodeData {
66
33
  useNodeData: boolean;
67
34
  zoomExtentsFactor: number;
68
35
 
69
- // #endregion Properties (20)
36
+ // #endregion Properties (21)
70
37
 
71
38
  // #region Public Methods (8)
72
39
 
@@ -80,4 +47,41 @@ export interface ICamera extends ITreeNodeData {
80
47
  zoomTo(zoomTarget?: IBox, options?: ICameraOptions): Promise<boolean>;
81
48
 
82
49
  // #endregion Public Methods (8)
83
- }
50
+ }
51
+
52
+ /* eslint-disable @typescript-eslint/ban-types */
53
+ export interface ICameraOptions {
54
+ // #region Properties (4)
55
+
56
+ /**
57
+ * The coordinate type of the camera interpolation. (default: 'cylindrical')
58
+ */
59
+ coordinates?: 'spherical' | 'linear' | 'cylindrical';
60
+ /**
61
+ * The duration of the camera movement. (default: cameraMovementDuration set in the settings)
62
+ * When set to 0, the camera is immediately updated to the specified position and target.
63
+ */
64
+ duration?: number;
65
+ /**
66
+ * The easing type of the camera interpolation. (default: 'Quadratic.InOut')
67
+ */
68
+ easing?: 'Linear.None' |
69
+ 'Quadratic.In' | 'Quadratic.Out' | 'Quadratic.InOut' |
70
+ 'Cubic.In' | 'Cubic.Out' | 'Cubic.InOut' |
71
+ 'Quartic.In' | 'Quartic.Out' | 'Quartic.InOut' |
72
+ 'Quintic.In' | 'Quintic.Out' | 'Quintic.InOut' |
73
+ 'Sinusoidal.In' | 'Sinusoidal.Out' | 'Sinusoidal.InOut' |
74
+ 'Exponential.In' | 'Exponential.Out' | 'Exponential.InOut' |
75
+ 'Circular.In' | 'Circular.Out' | 'Circular.InOut' |
76
+ 'Elastic.In' | 'Elastic.Out' | 'Elastic.InOut' |
77
+ 'Back.In' | 'Back.Out' | 'Back.InOut' |
78
+ 'Bounce.In' | 'Bounce.Out' | 'Bounce.InOut' | Function;
79
+ /**
80
+ * The interpolation type of the camera interpolation. (default: 'CatmullRom')
81
+ */
82
+ interpolation?: 'Linear' | 'Bezier' | 'CatmullRom' | Function
83
+
84
+ // #endregion Properties (4)
85
+ }
86
+
87
+ // #endregion Interfaces (2)
@@ -1,5 +1,27 @@
1
- import { IOrthographicCameraControls } from '../controls/IOrthographicCameraControls';
2
- import { ICamera } from './ICamera'
1
+ import { ICamera } from './ICamera';
2
+ import { ICameraControls } from '../controls/ICameraControls';
3
+
4
+ // #region Interfaces (1)
5
+
6
+ export interface IOrthographicCamera extends ICamera {
7
+ // #region Properties (2)
8
+
9
+ readonly controls: ICameraControls;
10
+
11
+ direction: ORTHOGRAPHIC_CAMERA_DIRECTION;
12
+
13
+ // #endregion Properties (2)
14
+
15
+ // #region Public Methods (1)
16
+
17
+ clone(): IOrthographicCamera;
18
+
19
+ // #endregion Public Methods (1)
20
+ }
21
+
22
+ // #endregion Interfaces (1)
23
+
24
+ // #region Enums (1)
3
25
 
4
26
  export enum ORTHOGRAPHIC_CAMERA_DIRECTION {
5
27
  TOP = 'top',
@@ -8,11 +30,7 @@ export enum ORTHOGRAPHIC_CAMERA_DIRECTION {
8
30
  RIGHT = 'right',
9
31
  FRONT = 'front',
10
32
  BACK = 'back',
11
- }
12
- export interface IOrthographicCamera extends ICamera {
13
- readonly controls: IOrthographicCameraControls;
14
-
15
- direction: ORTHOGRAPHIC_CAMERA_DIRECTION;
33
+ CUSTOM = 'custom'
34
+ }
16
35
 
17
- clone(): IOrthographicCamera;
18
- }
36
+ // #endregion Enums (1)
@@ -1,10 +1,18 @@
1
- import { IPerspectiveCameraControls } from '../controls/IPerspectiveCameraControls';
2
- import { ICamera } from './ICamera'
1
+ import { ICamera } from './ICamera';
2
+ import { ICameraControls } from '../controls/ICameraControls';
3
+
4
+ export interface IPerspectiveCamera extends ICamera {
5
+ // #region Properties (2)
6
+
7
+ readonly controls: ICameraControls;
3
8
 
4
- export interface IPerspectiveCamera extends ICamera {
5
- readonly controls: IPerspectiveCameraControls;
6
-
7
9
  fov: number;
8
10
 
11
+ // #endregion Properties (2)
12
+
13
+ // #region Public Methods (1)
14
+
9
15
  clone(): IPerspectiveCamera;
16
+
17
+ // #endregion Public Methods (1)
10
18
  }