@shapediver/viewer.rendering-engine.light-engine 2.12.8 → 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 (36) hide show
  1. package/dist/implementation/AbstractLight.d.ts +4 -4
  2. package/dist/implementation/AbstractLight.d.ts.map +1 -1
  3. package/dist/implementation/AbstractLight.js +13 -13
  4. package/dist/implementation/AbstractLight.js.map +1 -1
  5. package/dist/implementation/LightEngine.d.ts +1 -1
  6. package/dist/implementation/LightEngine.d.ts.map +1 -1
  7. package/dist/implementation/LightEngine.js +15 -15
  8. package/dist/implementation/LightEngine.js.map +1 -1
  9. package/dist/implementation/types/AmbientLight.d.ts +1 -5
  10. package/dist/implementation/types/AmbientLight.d.ts.map +1 -1
  11. package/dist/implementation/types/AmbientLight.js +1 -16
  12. package/dist/implementation/types/AmbientLight.js.map +1 -1
  13. package/dist/implementation/types/DirectionalLight.d.ts +2 -5
  14. package/dist/implementation/types/DirectionalLight.d.ts.map +1 -1
  15. package/dist/implementation/types/DirectionalLight.js +6 -10
  16. package/dist/implementation/types/DirectionalLight.js.map +1 -1
  17. package/dist/implementation/types/HemisphereLight.d.ts +1 -4
  18. package/dist/implementation/types/HemisphereLight.d.ts.map +1 -1
  19. package/dist/implementation/types/HemisphereLight.js +5 -9
  20. package/dist/implementation/types/HemisphereLight.js.map +1 -1
  21. package/dist/implementation/types/PointLight.d.ts +2 -5
  22. package/dist/implementation/types/PointLight.d.ts.map +1 -1
  23. package/dist/implementation/types/PointLight.js +6 -10
  24. package/dist/implementation/types/PointLight.js.map +1 -1
  25. package/dist/implementation/types/SpotLight.d.ts +2 -5
  26. package/dist/implementation/types/SpotLight.d.ts.map +1 -1
  27. package/dist/implementation/types/SpotLight.js +6 -10
  28. package/dist/implementation/types/SpotLight.js.map +1 -1
  29. package/package.json +7 -7
  30. package/src/implementation/AbstractLight.ts +21 -23
  31. package/src/implementation/LightEngine.ts +98 -83
  32. package/src/implementation/types/AmbientLight.ts +6 -22
  33. package/src/implementation/types/DirectionalLight.ts +15 -22
  34. package/src/implementation/types/HemisphereLight.ts +5 -13
  35. package/src/implementation/types/PointLight.ts +8 -15
  36. package/src/implementation/types/SpotLight.ts +11 -18
@@ -1,10 +1,8 @@
1
- import { ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
2
- import { vec3 } from 'gl-matrix'
1
+ import { AbstractLight } from '../AbstractLight';
3
2
  import { Color } from '@shapediver/viewer.shared.types';
4
-
5
- import { LIGHT_TYPE } from '../../interface/ILight'
6
3
  import { ISpotLight } from '../../interface/types/ISpotLight';
7
- import { AbstractLight } from '../AbstractLight'
4
+ import { LIGHT_TYPE } from '../../interface/ILight';
5
+ import { vec3 } from 'gl-matrix';
8
6
 
9
7
  export class SpotLight extends AbstractLight implements ISpotLight {
10
8
  // #region Properties (6)
@@ -15,7 +13,6 @@ export class SpotLight extends AbstractLight implements ISpotLight {
15
13
  #penumbra: number = 0.5;
16
14
  #position: vec3 = vec3.fromValues(-1, 0, 1);
17
15
  #target: vec3 = vec3.fromValues(0, 0, 0);
18
- #threeJsObject: { [key: string]: THREE.SpotLight } = {};
19
16
 
20
17
  // #endregion Properties (6)
21
18
 
@@ -54,7 +51,7 @@ export class SpotLight extends AbstractLight implements ISpotLight {
54
51
 
55
52
  // #endregion Constructors (1)
56
53
 
57
- // #region Public Accessors (12)
54
+ // #region Public Getters And Setters (12)
58
55
 
59
56
  public get angle(): number {
60
57
  return this.#angle;
@@ -63,7 +60,7 @@ export class SpotLight extends AbstractLight implements ISpotLight {
63
60
  public set angle(value: number) {
64
61
  this.#angle = value;
65
62
  this.updateVersion();
66
- if(this.parentNode) this.parentNode.updateVersion();
63
+ if (this.parentNode) this.parentNode.updateVersion();
67
64
  }
68
65
 
69
66
  public get decay(): number {
@@ -73,7 +70,7 @@ export class SpotLight extends AbstractLight implements ISpotLight {
73
70
  public set decay(value: number) {
74
71
  this.#decay = value;
75
72
  this.updateVersion();
76
- if(this.parentNode) this.parentNode.updateVersion();
73
+ if (this.parentNode) this.parentNode.updateVersion();
77
74
  }
78
75
 
79
76
  public get distance(): number {
@@ -83,7 +80,7 @@ export class SpotLight extends AbstractLight implements ISpotLight {
83
80
  public set distance(value: number) {
84
81
  this.#distance = value;
85
82
  this.updateVersion();
86
- if(this.parentNode) this.parentNode.updateVersion();
83
+ if (this.parentNode) this.parentNode.updateVersion();
87
84
  }
88
85
 
89
86
  public get penumbra(): number {
@@ -93,7 +90,7 @@ export class SpotLight extends AbstractLight implements ISpotLight {
93
90
  public set penumbra(value: number) {
94
91
  this.#penumbra = value;
95
92
  this.updateVersion();
96
- if(this.parentNode) this.parentNode.updateVersion();
93
+ if (this.parentNode) this.parentNode.updateVersion();
97
94
  }
98
95
 
99
96
  public get position(): vec3 {
@@ -103,7 +100,7 @@ export class SpotLight extends AbstractLight implements ISpotLight {
103
100
  public set position(value: vec3) {
104
101
  this.#position = value;
105
102
  this.updateVersion();
106
- if(this.parentNode) this.parentNode.updateVersion();
103
+ if (this.parentNode) this.parentNode.updateVersion();
107
104
  }
108
105
 
109
106
  public get target(): vec3 {
@@ -113,14 +110,10 @@ export class SpotLight extends AbstractLight implements ISpotLight {
113
110
  public set target(value: vec3) {
114
111
  this.#target = value;
115
112
  this.updateVersion();
116
- if(this.parentNode) this.parentNode.updateVersion();
117
- }
118
-
119
- public get threeJsObject(): { [key: string]: THREE.SpotLight } {
120
- return this.#threeJsObject;
113
+ if (this.parentNode) this.parentNode.updateVersion();
121
114
  }
122
115
 
123
- // #endregion Public Accessors (12)
116
+ // #endregion Public Getters And Setters (12)
124
117
 
125
118
  // #region Public Methods (1)
126
119