@shapediver/viewer.shared.types 2.4.1 → 2.5.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 (45) hide show
  1. package/dist/implementation/data/HTMLElementAnchorData.d.ts +3 -0
  2. package/dist/implementation/data/HTMLElementAnchorData.d.ts.map +1 -1
  3. package/dist/implementation/data/HTMLElementAnchorData.js +1 -1
  4. package/dist/implementation/data/HTMLElementAnchorData.js.map +1 -1
  5. package/dist/implementation/material/MaterialGemData.d.ts +2 -0
  6. package/dist/implementation/material/MaterialGemData.d.ts.map +1 -1
  7. package/dist/implementation/material/MaterialGemData.js +14 -2
  8. package/dist/implementation/material/MaterialGemData.js.map +1 -1
  9. package/dist/implementation/material/MaterialSpecularGlossinessData.d.ts +2 -0
  10. package/dist/implementation/material/MaterialSpecularGlossinessData.d.ts.map +1 -1
  11. package/dist/implementation/material/MaterialSpecularGlossinessData.js +14 -2
  12. package/dist/implementation/material/MaterialSpecularGlossinessData.js.map +1 -1
  13. package/dist/implementation/material/MaterialStandardData.d.ts +2 -0
  14. package/dist/implementation/material/MaterialStandardData.d.ts.map +1 -1
  15. package/dist/implementation/material/MaterialStandardData.js +14 -2
  16. package/dist/implementation/material/MaterialStandardData.js.map +1 -1
  17. package/dist/implementation/material/MaterialUnlitData.d.ts +4 -1
  18. package/dist/implementation/material/MaterialUnlitData.d.ts.map +1 -1
  19. package/dist/implementation/material/MaterialUnlitData.js +48 -19
  20. package/dist/implementation/material/MaterialUnlitData.js.map +1 -1
  21. package/dist/interfaces/data/IHTMLElementAnchorData.d.ts +1 -0
  22. package/dist/interfaces/data/IHTMLElementAnchorData.d.ts.map +1 -1
  23. package/dist/interfaces/data/material/IMaterialGemDataProperties.d.ts +22 -20
  24. package/dist/interfaces/data/material/IMaterialGemDataProperties.d.ts.map +1 -1
  25. package/dist/interfaces/data/material/IMaterialGemDataProperties.js.map +1 -1
  26. package/dist/interfaces/data/material/IMaterialSpecularGlossinessDataProperties.d.ts +2 -0
  27. package/dist/interfaces/data/material/IMaterialSpecularGlossinessDataProperties.d.ts.map +1 -1
  28. package/dist/interfaces/data/material/IMaterialSpecularGlossinessDataProperties.js.map +1 -1
  29. package/dist/interfaces/data/material/IMaterialStandardData.d.ts +2 -0
  30. package/dist/interfaces/data/material/IMaterialStandardData.d.ts.map +1 -1
  31. package/dist/interfaces/data/material/IMaterialStandardData.js.map +1 -1
  32. package/dist/interfaces/data/material/IMaterialUnlitData.d.ts +2 -0
  33. package/dist/interfaces/data/material/IMaterialUnlitData.d.ts.map +1 -1
  34. package/dist/interfaces/data/material/IMaterialUnlitData.js.map +1 -1
  35. package/package.json +6 -6
  36. package/src/implementation/data/HTMLElementAnchorData.ts +6 -5
  37. package/src/implementation/material/MaterialGemData.ts +13 -0
  38. package/src/implementation/material/MaterialSpecularGlossinessData.ts +16 -2
  39. package/src/implementation/material/MaterialStandardData.ts +13 -0
  40. package/src/implementation/material/MaterialUnlitData.ts +42 -21
  41. package/src/interfaces/data/IHTMLElementAnchorData.ts +2 -1
  42. package/src/interfaces/data/material/IMaterialGemDataProperties.ts +29 -23
  43. package/src/interfaces/data/material/IMaterialSpecularGlossinessDataProperties.ts +9 -3
  44. package/src/interfaces/data/material/IMaterialStandardData.ts +9 -3
  45. package/src/interfaces/data/material/IMaterialUnlitData.ts +13 -1
@@ -3,8 +3,13 @@ import { MATERIAL_ALPHA, MATERIAL_SHADING, MATERIAL_SIDE } from "../../interface
3
3
  import { IMaterialUnlitData, IMaterialUnlitDataProperties } from "../../interfaces/data/material/IMaterialUnlitData";
4
4
  import { AbstractMaterialData } from "./AbstractMaterialData";
5
5
 
6
-
7
6
  export class MaterialUnlitData extends AbstractMaterialData implements IMaterialUnlitData {
7
+ // #region Properties (1)
8
+
9
+ #envMap?: string | string[];
10
+
11
+ // #endregion Properties (1)
12
+
8
13
  // #region Constructors (1)
9
14
 
10
15
  /**
@@ -19,32 +24,25 @@ export class MaterialUnlitData extends AbstractMaterialData implements IMaterial
19
24
  ) {
20
25
  super(properties, id);
21
26
  if (!properties) return;
27
+ if (properties.envMap !== undefined) this.envMap = properties.envMap;
22
28
  }
23
29
 
24
30
  // #endregion Constructors (1)
25
31
 
26
- // #region Public Methods (1)
32
+ // #region Public Accessors (2)
27
33
 
28
- public reset(): void {
29
- this.alphaCutoff = 0;
30
- this.alphaMap = undefined;
31
- this.alphaMode = MATERIAL_ALPHA.OPAQUE;
32
- this.aoMap = undefined;
33
- this.aoMapIntensity = 1.0;
34
- this.bumpMap = undefined;
35
- this.bumpScale = 1.0;
36
- this.color = '#ffffff';
37
- this.emissiveMap = undefined;
38
- this.emissiveness = '#000000';
39
- this.materialOutput = false;
40
- this.map = undefined;
41
- this.normalMap = undefined;
42
- this.normalScale = 1.0;
43
- this.opacity = 1.0;
44
- this.shading = MATERIAL_SHADING.SMOOTH;
45
- this.side = MATERIAL_SIDE.DOUBLE;
34
+ public get envMap(): string | string[] | undefined {
35
+ return this.#envMap;
36
+ }
37
+
38
+ public set envMap(value: string | string[] | undefined) {
39
+ this.#envMap = value;
46
40
  }
47
41
 
42
+ // #endregion Public Accessors (2)
43
+
44
+ // #region Public Methods (3)
45
+
48
46
  public clone(): IMaterialUnlitData {
49
47
  return new MaterialUnlitData({
50
48
  alphaMap: this.alphaMap,
@@ -64,6 +62,7 @@ export class MaterialUnlitData extends AbstractMaterialData implements IMaterial
64
62
  normalScale: this.normalScale,
65
63
  opacity: this.opacity,
66
64
  side: this.side,
65
+ envMap: this.envMap
67
66
  }, this.id);
68
67
  }
69
68
 
@@ -85,7 +84,29 @@ export class MaterialUnlitData extends AbstractMaterialData implements IMaterial
85
84
  this.opacity = source.opacity;
86
85
  this.shading = source.shading;
87
86
  this.side = source.side;
87
+ this.envMap = source.envMap;
88
+ }
89
+
90
+ public reset(): void {
91
+ this.alphaCutoff = 0;
92
+ this.alphaMap = undefined;
93
+ this.alphaMode = MATERIAL_ALPHA.OPAQUE;
94
+ this.aoMap = undefined;
95
+ this.aoMapIntensity = 1.0;
96
+ this.bumpMap = undefined;
97
+ this.bumpScale = 1.0;
98
+ this.color = '#ffffff';
99
+ this.emissiveMap = undefined;
100
+ this.emissiveness = '#000000';
101
+ this.materialOutput = false;
102
+ this.map = undefined;
103
+ this.normalMap = undefined;
104
+ this.normalScale = 1.0;
105
+ this.opacity = 1.0;
106
+ this.shading = MATERIAL_SHADING.SMOOTH;
107
+ this.side = MATERIAL_SIDE.DOUBLE;
108
+ this.envMap = undefined;
88
109
  }
89
110
 
90
- // #endregion Public Methods (1)
111
+ // #endregion Public Methods (3)
91
112
  }
@@ -59,7 +59,8 @@ export interface IHTMLElementAnchorData extends ITreeNodeData {
59
59
  container: vec2,
60
60
  client: vec2,
61
61
  scale: vec2,
62
- hidden: boolean
62
+ hidden: boolean,
63
+ visible: boolean
63
64
  }): void;
64
65
 
65
66
  // #endregion Public Methods (5)
@@ -3,47 +3,53 @@ import { IMapData } from "./IMapData";
3
3
  import { IMaterialAbstractData, IMaterialAbstractDataProperties } from "./IMaterialAbstractData";
4
4
 
5
5
  export interface IMaterialGemDataProperties extends IMaterialAbstractDataProperties {
6
- // #region Properties (5)
6
+ // #region Properties (17)
7
7
 
8
- refractionIndex?: number;
9
- impurityMap?: IMapData;
10
- impurityScale?: number;
8
+ brightness?: number;
9
+ center?: vec3;
11
10
  colorTransferBegin?: string;
12
11
  colorTransferEnd?: string;
13
- center?: vec3;
14
- radius?: number;
15
- sphericalNormalMap?: IMapData;
16
- gamma?: number;
17
12
  contrast?: number;
18
- brightness?: number;
19
13
  dispersion?: number;
20
- tracingDepth?: number;
21
- tracingOpacity?: number;
14
+ envMap?: string | string[];
15
+ gamma?: number;
16
+ impurityMap?: IMapData;
17
+ impurityScale?: number;
22
18
  inverseModelMatrix?: mat4;
23
19
  inverseTransposeModelMatrix?: mat3;
20
+ radius?: number;
21
+ refractionIndex?: number;
22
+ sphericalNormalMap?: IMapData;
23
+ tracingDepth?: number;
24
+ tracingOpacity?: number;
24
25
 
25
- // #endregion Properties (5)
26
+ // #endregion Properties (17)
26
27
  };
27
28
 
28
29
  export interface IMaterialGemData extends IMaterialAbstractData {
29
- // #region Public Methods (2)
30
+ // #region Properties (17)
30
31
 
31
- refractionIndex?: number;
32
- impurityMap?: IMapData;
33
- impurityScale?: number;
32
+ brightness?: number;
33
+ center?: vec3;
34
34
  colorTransferBegin?: string;
35
35
  colorTransferEnd?: string;
36
- center?: vec3;
37
- radius?: number;
38
- sphericalNormalMap?: IMapData;
39
- gamma?: number;
40
36
  contrast?: number;
41
- brightness?: number;
42
37
  dispersion?: number;
43
- tracingDepth?: number;
44
- tracingOpacity?: number;
38
+ envMap?: string | string[];
39
+ gamma?: number;
40
+ impurityMap?: IMapData;
41
+ impurityScale?: number;
45
42
  inverseModelMatrix?: mat4;
46
43
  inverseTransposeModelMatrix?: mat3;
44
+ radius?: number;
45
+ refractionIndex?: number;
46
+ sphericalNormalMap?: IMapData;
47
+ tracingDepth?: number;
48
+ tracingOpacity?: number;
49
+
50
+ // #endregion Properties (17)
51
+
52
+ // #region Public Methods (2)
47
53
 
48
54
  clone(): IMaterialGemData;
49
55
  copy(source: IMaterialGemData): void;
@@ -2,26 +2,32 @@ import { IMapData } from "./IMapData";
2
2
  import { IMaterialAbstractData, IMaterialAbstractDataProperties } from "./IMaterialAbstractData";
3
3
 
4
4
  export interface IMaterialSpecularGlossinessDataProperties extends IMaterialAbstractDataProperties {
5
- // #region Properties (5)
5
+ // #region Properties (6)
6
6
 
7
+ envMap?: string | string[];
7
8
  glossiness?: number,
8
9
  glossinessMap?: IMapData,
9
10
  specular?: string,
10
11
  specularGlossinessMap?: IMapData,
11
12
  specularMap?: IMapData,
12
13
 
13
- // #endregion Properties (5)
14
+ // #endregion Properties (6)
14
15
  };
15
16
 
16
17
  export interface IMaterialSpecularGlossinessData extends IMaterialAbstractData {
17
- // #region Public Methods (2)
18
+ // #region Properties (6)
18
19
 
20
+ envMap?: string | string[];
19
21
  glossiness: number,
20
22
  glossinessMap?: IMapData,
21
23
  specular: string,
22
24
  specularGlossinessMap?: IMapData,
23
25
  specularMap?: IMapData,
24
26
 
27
+ // #endregion Properties (6)
28
+
29
+ // #region Public Methods (2)
30
+
25
31
  clone(): IMaterialSpecularGlossinessData;
26
32
  copy(source: IMaterialSpecularGlossinessData): void;
27
33
 
@@ -2,7 +2,7 @@ import { IMapData } from "./IMapData";
2
2
  import { IMaterialAbstractData, IMaterialAbstractDataProperties } from "./IMaterialAbstractData";
3
3
 
4
4
  export interface IMaterialStandardDataProperties extends IMaterialAbstractDataProperties {
5
- // #region Properties (29)
5
+ // #region Properties (30)
6
6
 
7
7
  attenuationColor?: string,
8
8
  attenuationDistance?: number;
@@ -14,6 +14,7 @@ export interface IMaterialStandardDataProperties extends IMaterialAbstractDataPr
14
14
  displacementBias?: number;
15
15
  displacementMap?: IMapData;
16
16
  displacementScale?: number;
17
+ envMap?: string | string[];
17
18
  ior?: number;
18
19
  metalness?: number,
19
20
  metalnessMap?: IMapData,
@@ -34,11 +35,11 @@ export interface IMaterialStandardDataProperties extends IMaterialAbstractDataPr
34
35
  transmission?: number;
35
36
  transmissionMap?: IMapData;
36
37
 
37
- // #endregion Properties (29)
38
+ // #endregion Properties (30)
38
39
  };
39
40
 
40
41
  export interface IMaterialStandardData extends IMaterialAbstractData {
41
- // #region Public Methods (2)
42
+ // #region Properties (30)
42
43
 
43
44
  attenuationColor: string,
44
45
  attenuationDistance: number;
@@ -50,6 +51,7 @@ export interface IMaterialStandardData extends IMaterialAbstractData {
50
51
  displacementBias: number;
51
52
  displacementMap?: IMapData;
52
53
  displacementScale: number;
54
+ envMap?: string | string[];
53
55
  ior: number;
54
56
  metalness: number,
55
57
  metalnessMap?: IMapData,
@@ -70,6 +72,10 @@ export interface IMaterialStandardData extends IMaterialAbstractData {
70
72
  transmission: number;
71
73
  transmissionMap?: IMapData;
72
74
 
75
+ // #endregion Properties (30)
76
+
77
+ // #region Public Methods (2)
78
+
73
79
  clone(): IMaterialStandardData;
74
80
  copy(source: IMaterialStandardData): void;
75
81
 
@@ -1,8 +1,20 @@
1
1
  import { IMaterialAbstractData, IMaterialAbstractDataProperties } from "./IMaterialAbstractData";
2
2
 
3
- export interface IMaterialUnlitDataProperties extends IMaterialAbstractDataProperties {};
3
+ export interface IMaterialUnlitDataProperties extends IMaterialAbstractDataProperties {
4
+ // #region Properties (1)
5
+
6
+ envMap?: string | string[];
7
+
8
+ // #endregion Properties (1)
9
+ };
4
10
 
5
11
  export interface IMaterialUnlitData extends IMaterialAbstractData {
12
+ // #region Properties (1)
13
+
14
+ envMap?: string | string[];
15
+
16
+ // #endregion Properties (1)
17
+
6
18
  // #region Public Methods (2)
7
19
 
8
20
  clone(): IMaterialUnlitData;