@shapediver/viewer.shared.types 3.3.3 → 3.3.6

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 (78) hide show
  1. package/dist/implementation/data/GeometryData.d.ts.map +1 -1
  2. package/dist/implementation/data/GeometryData.js +1 -0
  3. package/dist/implementation/data/GeometryData.js.map +1 -1
  4. package/dist/index.d.ts +5 -4
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +4 -5
  7. package/dist/index.js.map +1 -1
  8. package/dist/interfaces/parameter/IDrawingParametersSettings.d.ts +121 -0
  9. package/dist/interfaces/parameter/IDrawingParametersSettings.d.ts.map +1 -0
  10. package/dist/interfaces/parameter/IDrawingParametersSettings.js +22 -0
  11. package/dist/interfaces/parameter/IDrawingParametersSettings.js.map +1 -0
  12. package/dist/interfaces/parameter/IDrawingToolsParametersSettings.d.ts +159 -0
  13. package/dist/interfaces/parameter/IDrawingToolsParametersSettings.d.ts.map +1 -0
  14. package/dist/interfaces/parameter/IDrawingToolsParametersSettings.js +29 -0
  15. package/dist/interfaces/parameter/IDrawingToolsParametersSettings.js.map +1 -0
  16. package/dist/interfaces/parameter/IGumballParameterSettings.d.ts +1 -5
  17. package/dist/interfaces/parameter/IGumballParameterSettings.d.ts.map +1 -1
  18. package/dist/interfaces/parameter/IGumballParameterSettings.js +0 -7
  19. package/dist/interfaces/parameter/IGumballParameterSettings.js.map +1 -1
  20. package/dist/interfaces/parameter/ISelectionParameterSettings.d.ts +1 -5
  21. package/dist/interfaces/parameter/ISelectionParameterSettings.d.ts.map +1 -1
  22. package/dist/interfaces/parameter/ISelectionParameterSettings.js +0 -7
  23. package/dist/interfaces/parameter/ISelectionParameterSettings.js.map +1 -1
  24. package/package.json +7 -8
  25. package/src/implementation/data/AnimationData.ts +0 -310
  26. package/src/implementation/data/BoneData.ts +0 -32
  27. package/src/implementation/data/CustomData.ts +0 -52
  28. package/src/implementation/data/GeometryData.ts +0 -426
  29. package/src/implementation/data/HTMLElementAnchorData.ts +0 -365
  30. package/src/implementation/material/AbstractMaterialData.ts +0 -268
  31. package/src/implementation/material/MapData.ts +0 -218
  32. package/src/implementation/material/MaterialBasicLineData.ts +0 -99
  33. package/src/implementation/material/MaterialGemData.ts +0 -310
  34. package/src/implementation/material/MaterialMultiPointData.ts +0 -659
  35. package/src/implementation/material/MaterialPointData.ts +0 -136
  36. package/src/implementation/material/MaterialShadowData.ts +0 -45
  37. package/src/implementation/material/MaterialSpecularGlossinessData.ts +0 -191
  38. package/src/implementation/material/MaterialStandardData.ts +0 -502
  39. package/src/implementation/material/MaterialUnlitData.ts +0 -122
  40. package/src/implementation/material/MaterialVariantsData.ts +0 -60
  41. package/src/implementation/sdtf/SDTFAttributesData.ts +0 -128
  42. package/src/implementation/sdtf/SDTFItemData.ts +0 -72
  43. package/src/implementation/sdtf/SDTFOverviewData.ts +0 -80
  44. package/src/index.ts +0 -141
  45. package/src/interfaces/data/IAnimationData.ts +0 -42
  46. package/src/interfaces/data/IBoneData.ts +0 -9
  47. package/src/interfaces/data/ICustomData.ts +0 -15
  48. package/src/interfaces/data/IGeometryData.ts +0 -87
  49. package/src/interfaces/data/IHTMLElementAnchorData.ts +0 -68
  50. package/src/interfaces/data/material/IMapData.ts +0 -64
  51. package/src/interfaces/data/material/IMaterialAbstractData.ts +0 -86
  52. package/src/interfaces/data/material/IMaterialBasicLineData.ts +0 -21
  53. package/src/interfaces/data/material/IMaterialGemDataProperties.ts +0 -46
  54. package/src/interfaces/data/material/IMaterialMultiPointData.ts +0 -72
  55. package/src/interfaces/data/material/IMaterialPointData.ts +0 -31
  56. package/src/interfaces/data/material/IMaterialShadowData.ts +0 -21
  57. package/src/interfaces/data/material/IMaterialSpecularGlossinessDataProperties.ts +0 -36
  58. package/src/interfaces/data/material/IMaterialStandardData.ts +0 -60
  59. package/src/interfaces/data/material/IMaterialUnlitData.ts +0 -30
  60. package/src/interfaces/data/material/IMaterialVariantsData.ts +0 -19
  61. package/src/interfaces/events/EventResponseMapping.ts +0 -53
  62. package/src/interfaces/events/ICameraEvent.ts +0 -16
  63. package/src/interfaces/events/IOutputEvent.ts +0 -29
  64. package/src/interfaces/events/IParameterEvent.ts +0 -21
  65. package/src/interfaces/events/IRenderingEvent.ts +0 -7
  66. package/src/interfaces/events/ISceneEvent.ts +0 -17
  67. package/src/interfaces/events/ISessionEvent.ts +0 -16
  68. package/src/interfaces/events/ITaskEvent.ts +0 -61
  69. package/src/interfaces/events/IViewportEvent.ts +0 -13
  70. package/src/interfaces/parameter/IGumballParameterSettings.ts +0 -44
  71. package/src/interfaces/parameter/IInteractionParameterSettings.ts +0 -85
  72. package/src/interfaces/parameter/ISelectionParameterSettings.ts +0 -37
  73. package/src/interfaces/sdtf/ISDTFAttributeVisualizationData.ts +0 -7
  74. package/src/interfaces/sdtf/ISDTFAttributesData.ts +0 -27
  75. package/src/interfaces/sdtf/ISDTFItemData.ts +0 -23
  76. package/src/interfaces/sdtf/ISDTFOverviewData.ts +0 -31
  77. package/src/types.ts +0 -68
  78. package/tsconfig.json +0 -17
@@ -1,502 +0,0 @@
1
- import { AbstractMaterialData } from './AbstractMaterialData';
2
- import { IMaterialStandardData, IMaterialStandardDataProperties } from '../../interfaces/data/material/IMaterialStandardData';
3
- import { IMapData } from '../../interfaces/data/material/IMapData';
4
- import { MATERIAL_ALPHA, MATERIAL_SHADING, MATERIAL_SIDE } from '../../interfaces/data/material/IMaterialAbstractData';
5
- import { Color } from '../../types';
6
-
7
- export class MaterialStandardData extends AbstractMaterialData implements IMaterialStandardData {
8
- // #region Properties (26)
9
-
10
- #attenuationColor: Color = '#ffffff';
11
- #attenuationDistance = Infinity;
12
- #clearcoat: number = 0;
13
- #clearcoatMap?: IMapData;
14
- #clearcoatNormalMap?: IMapData;
15
- #clearcoatRoughness: number = 0;
16
- #clearcoatRoughnessMap?: IMapData;
17
- #displacementMap?: IMapData;
18
- #displacementScale: number = 1;
19
- #displacementBias: number = 0;
20
- #envMap?: string | string[];
21
- #ior: number = 1.5;
22
- #metalness = 1.0;
23
- #metalnessMap?: IMapData;
24
- #metalnessRoughnessMap?: IMapData;
25
- #roughness = 1.0;
26
- #roughnessMap?: IMapData;
27
- #sheen = 0.0;
28
- #sheenColor: Color = '#ffffff';
29
- #sheenColorMap?: IMapData;
30
- #sheenRoughness = 1.0;
31
- #sheenRoughnessMap?: IMapData;
32
- #specularColor: Color = '#ffffff';
33
- #specularColorMap?: IMapData;
34
- #specularIntensity = 1.0;
35
- #specularIntensityMap?: IMapData;
36
- #thickness = 0.0;
37
- #thicknessMap?: IMapData;
38
- #transmission = 0.0;
39
- #transmissionMap?: IMapData;
40
-
41
- // #endregion Properties (26)
42
-
43
- // #region Constructors (1)
44
-
45
- /**
46
- * Creates a material data object.
47
- *
48
- * @param _attributes the attributes of the material
49
- * @param id the id
50
- */
51
- constructor(
52
- properties?: IMaterialStandardDataProperties,
53
- id?: string,
54
- version?: string
55
- ) {
56
- super(properties, id, version);
57
- if (!properties) return;
58
- if (properties.metalness !== undefined) this.metalness = properties.metalness;
59
- if (properties.metalnessMap !== undefined) this.metalnessMap = properties.metalnessMap;
60
- if (properties.metalnessRoughnessMap !== undefined) this.metalnessRoughnessMap = properties.metalnessRoughnessMap;
61
- if (properties.roughness !== undefined) this.roughness = properties.roughness;
62
- if (properties.roughnessMap !== undefined) this.roughnessMap = properties.roughnessMap;
63
- if (properties.clearcoat !== undefined) this.clearcoat = properties.clearcoat;
64
- if (properties.clearcoatMap !== undefined) this.clearcoatMap = properties.clearcoatMap;
65
- if (properties.clearcoatNormalMap !== undefined) this.clearcoatNormalMap = properties.clearcoatNormalMap;
66
- if (properties.clearcoatRoughness !== undefined) this.clearcoatRoughness = properties.clearcoatRoughness;
67
- if (properties.clearcoatRoughnessMap !== undefined) this.clearcoatRoughnessMap = properties.clearcoatRoughnessMap;
68
- if (properties.displacementMap !== undefined) this.displacementMap = properties.displacementMap;
69
- if (properties.displacementScale !== undefined) this.displacementScale = properties.displacementScale;
70
- if (properties.displacementBias !== undefined) this.displacementBias = properties.displacementBias;
71
- if (properties.ior !== undefined) this.ior = properties.ior;
72
- if (properties.transmission !== undefined) this.transmission = properties.transmission;
73
- if (properties.transmissionMap !== undefined) this.transmissionMap = properties.transmissionMap;
74
- if (properties.thickness !== undefined) this.thickness = properties.thickness;
75
- if (properties.thicknessMap !== undefined) this.thicknessMap = properties.thicknessMap;
76
- if (properties.attenuationDistance !== undefined) this.attenuationDistance = properties.attenuationDistance;
77
- if (properties.attenuationColor !== undefined) this.attenuationColor = properties.attenuationColor;
78
- if (properties.sheen !== undefined) this.sheen = properties.sheen;
79
- if (properties.sheenColor !== undefined) this.sheenColor = properties.sheenColor;
80
- if (properties.sheenRoughness !== undefined) this.sheenRoughness = properties.sheenRoughness;
81
- if (properties.sheenColorMap !== undefined) this.sheenColorMap = properties.sheenColorMap;
82
- if (properties.sheenRoughnessMap !== undefined) this.sheenRoughnessMap = properties.sheenRoughnessMap;
83
- if (properties.specularColor !== undefined) this.specularColor = properties.specularColor;
84
- if (properties.specularColorMap !== undefined) this.specularColorMap = properties.specularColorMap;
85
- if (properties.specularIntensity !== undefined) this.specularIntensity = properties.specularIntensity;
86
- if (properties.specularIntensityMap !== undefined) this.specularIntensityMap = properties.specularIntensityMap;
87
- if (properties.envMap !== undefined) this.envMap = properties.envMap;
88
- }
89
-
90
- // #endregion Constructors (1)
91
-
92
- // #region Public Accessors (52)
93
-
94
- public get attenuationColor(): Color {
95
- return this.#attenuationColor;
96
- }
97
-
98
- public set attenuationColor(value: Color) {
99
- this.#attenuationColor = value;
100
- }
101
-
102
- public get attenuationDistance(): number {
103
- return this.#attenuationDistance;
104
- }
105
-
106
- public set attenuationDistance(value: number) {
107
- this.#attenuationDistance = value;
108
- }
109
-
110
- public get clearcoat(): number {
111
- return this.#clearcoat;
112
- }
113
-
114
- public set clearcoat(value: number) {
115
- this.#clearcoat = value;
116
- }
117
-
118
- public get clearcoatMap(): IMapData | undefined {
119
- return this.#clearcoatMap;
120
- }
121
-
122
- public set clearcoatMap(value: IMapData | undefined) {
123
- this.#clearcoatMap = value;
124
- }
125
-
126
- public get clearcoatNormalMap(): IMapData | undefined {
127
- return this.#clearcoatNormalMap;
128
- }
129
-
130
- public set clearcoatNormalMap(value: IMapData | undefined) {
131
- this.#clearcoatNormalMap = value;
132
- }
133
-
134
- public get clearcoatRoughness(): number {
135
- return this.#clearcoatRoughness;
136
- }
137
-
138
- public set clearcoatRoughness(value: number) {
139
- this.#clearcoatRoughness = value;
140
- }
141
-
142
- public get clearcoatRoughnessMap(): IMapData | undefined {
143
- return this.#clearcoatRoughnessMap;
144
- }
145
-
146
- public set clearcoatRoughnessMap(value: IMapData | undefined) {
147
- this.#clearcoatRoughnessMap = value;
148
- }
149
-
150
- public get displacementMap(): IMapData | undefined {
151
- return this.#displacementMap;
152
- }
153
-
154
- public set displacementMap(value: IMapData | undefined) {
155
- this.#displacementMap = value;
156
- }
157
-
158
- public get displacementScale(): number {
159
- return this.#displacementScale;
160
- }
161
-
162
- public set displacementScale(value: number) {
163
- this.#displacementScale = value;
164
- }
165
-
166
- public get displacementBias(): number {
167
- return this.#displacementBias;
168
- }
169
-
170
- public set displacementBias(value: number) {
171
- this.#displacementBias = value;
172
- }
173
-
174
- public get envMap(): string | string[] | undefined {
175
- return this.#envMap;
176
- }
177
-
178
- public set envMap(value: string | string[] | undefined) {
179
- this.#envMap = value;
180
- }
181
-
182
- public get ior(): number {
183
- return this.#ior;
184
- }
185
-
186
- public set ior(value: number) {
187
- this.#ior = value;
188
- }
189
-
190
- public get metalness(): number {
191
- return this.#metalness;
192
- }
193
-
194
- public set metalness(value: number) {
195
- this.#metalness = value;
196
- }
197
-
198
- public get metalnessMap(): IMapData | undefined {
199
- return this.#metalnessMap;
200
- }
201
-
202
- public set metalnessMap(value: IMapData | undefined) {
203
- this.#metalnessMap = value;
204
- }
205
-
206
- public get metalnessRoughnessMap(): IMapData | undefined {
207
- return this.#metalnessRoughnessMap;
208
- }
209
-
210
- public set metalnessRoughnessMap(value: IMapData | undefined) {
211
- this.#metalnessRoughnessMap = value;
212
- }
213
-
214
- public get roughness(): number {
215
- return this.#roughness;
216
- }
217
-
218
- public set roughness(value: number) {
219
- this.#roughness = value;
220
- }
221
-
222
- public get roughnessMap(): IMapData | undefined {
223
- return this.#roughnessMap;
224
- }
225
-
226
- public set roughnessMap(value: IMapData | undefined) {
227
- this.#roughnessMap = value;
228
- }
229
-
230
- public get sheen(): number {
231
- return this.#sheen;
232
- }
233
-
234
- public set sheen(value: number) {
235
- this.#sheen = value;
236
- }
237
-
238
- public get sheenColor(): Color {
239
- return this.#sheenColor;
240
- }
241
-
242
- public set sheenColor(value: Color) {
243
- this.#sheenColor = value;
244
- }
245
-
246
- public get sheenColorMap(): IMapData | undefined {
247
- return this.#sheenColorMap;
248
- }
249
-
250
- public set sheenColorMap(value: IMapData | undefined) {
251
- this.#sheenColorMap = value;
252
- }
253
-
254
- public get sheenRoughness(): number {
255
- return this.#sheenRoughness;
256
- }
257
-
258
- public set sheenRoughness(value: number) {
259
- this.#sheenRoughness = value;
260
- }
261
-
262
- public get sheenRoughnessMap(): IMapData | undefined {
263
- return this.#sheenRoughnessMap;
264
- }
265
-
266
- public set sheenRoughnessMap(value: IMapData | undefined) {
267
- this.#sheenRoughnessMap = value;
268
- }
269
-
270
- public get specularColor(): Color {
271
- return this.#specularColor;
272
- }
273
-
274
- public set specularColor(value: Color) {
275
- this.#specularColor = value;
276
- }
277
-
278
- public get specularColorMap(): IMapData | undefined {
279
- return this.#specularColorMap;
280
- }
281
-
282
- public set specularColorMap(value: IMapData | undefined) {
283
- this.#specularColorMap = value;
284
- }
285
-
286
- public get specularIntensity(): number {
287
- return this.#specularIntensity;
288
- }
289
-
290
- public set specularIntensity(value: number) {
291
- this.#specularIntensity = value;
292
- }
293
-
294
- public get specularIntensityMap(): IMapData | undefined {
295
- return this.#specularIntensityMap;
296
- }
297
-
298
- public set specularIntensityMap(value: IMapData | undefined) {
299
- this.#specularIntensityMap = value;
300
- }
301
-
302
- public get thickness(): number {
303
- return this.#thickness;
304
- }
305
-
306
- public set thickness(value: number) {
307
- this.#thickness = value;
308
- }
309
-
310
- public get thicknessMap(): IMapData | undefined {
311
- return this.#thicknessMap;
312
- }
313
-
314
- public set thicknessMap(value: IMapData | undefined) {
315
- this.#thicknessMap = value;
316
- }
317
-
318
- public get transmission(): number {
319
- return this.#transmission;
320
- }
321
-
322
- public set transmission(value: number) {
323
- this.#transmission = value;
324
- }
325
-
326
- public get transmissionMap(): IMapData | undefined {
327
- return this.#transmissionMap;
328
- }
329
-
330
- public set transmissionMap(value: IMapData | undefined) {
331
- this.#transmissionMap = value;
332
- }
333
-
334
- // #endregion Public Accessors (52)
335
-
336
- // #region Public Methods (1)
337
-
338
- public reset(): void {
339
- this.alphaCutoff = 0;
340
- this.alphaMap = undefined;
341
- this.alphaMode = MATERIAL_ALPHA.OPAQUE;
342
- this.aoMap = undefined;
343
- this.aoMapIntensity = 1.0;
344
- this.bumpMap = undefined;
345
- this.bumpScale = 1.0;
346
- this.color = '#ffffff';
347
- this.depthTest = undefined;
348
- this.depthWrite = undefined;
349
- this.emissiveMap = undefined;
350
- this.emissiveness = '#000000';
351
- this.materialOutput = false;
352
- this.map = undefined;
353
- this.normalMap = undefined;
354
- this.normalScale = 1.0;
355
- this.opacity = 1.0;
356
- this.shading = MATERIAL_SHADING.SMOOTH;
357
- this.side = MATERIAL_SIDE.DOUBLE;
358
- this.transparent = undefined;
359
-
360
- this.attenuationColor = '#ffffff';
361
- this.attenuationDistance = Infinity;
362
- this.clearcoat = 0;
363
- this.clearcoatMap = undefined;
364
- this.clearcoatNormalMap = undefined;
365
- this.clearcoatRoughness = 0;
366
- this.clearcoatRoughnessMap = undefined;
367
- this.displacementMap = undefined;
368
- this.displacementScale = 1;
369
- this.displacementBias = 0;
370
- this.envMap = undefined;
371
- this.ior = 1;
372
- this.metalness = 0;
373
- this.metalnessMap = undefined;
374
- this.metalnessRoughnessMap = undefined;
375
- this.roughness = 0.5;
376
- this.roughnessMap = undefined;
377
- this.sheen = 0;
378
- this.sheenColor = '#ffffff';
379
- this.sheenColorMap = undefined;
380
- this.sheenRoughness = 0;
381
- this.sheenRoughnessMap = undefined;
382
- this.specularColor = '#ffffff';
383
- this.specularColorMap = undefined;
384
- this.specularIntensity = 1;
385
- this.specularIntensityMap = undefined;
386
- this.thickness = 0.1;
387
- this.thicknessMap = undefined;
388
- this.transmission = 0;
389
- this.transmissionMap = undefined;
390
- }
391
-
392
- public clone(): IMaterialStandardData {
393
- return new MaterialStandardData({
394
- alphaMap: this.alphaMap,
395
- alphaCutoff: this.alphaCutoff,
396
- alphaMode: this.alphaMode,
397
- aoMap: this.aoMap,
398
- aoMapIntensity: this.aoMapIntensity,
399
- bumpMap: this.bumpMap,
400
- bumpScale: this.bumpScale,
401
- color: this.color,
402
- depthTest: this.depthTest,
403
- depthWrite: this.depthWrite,
404
- emissiveMap: this.emissiveMap,
405
- emissiveness: this.emissiveness,
406
- shading: this.shading,
407
- map: this.map,
408
- metalness: this.metalness,
409
- metalnessMap: this.metalnessMap,
410
- metalnessRoughnessMap: this.metalnessRoughnessMap,
411
- name: this.name,
412
- normalMap: this.normalMap,
413
- normalScale: this.normalScale,
414
- opacity: this.opacity,
415
- roughness: this.roughness,
416
- roughnessMap: this.roughnessMap,
417
- side: this.side,
418
- transparent: this.transparent,
419
- clearcoat: this.clearcoat,
420
- clearcoatMap: this.clearcoatMap,
421
- clearcoatNormalMap: this.clearcoatNormalMap,
422
- clearcoatRoughness: this.clearcoatRoughness,
423
- clearcoatRoughnessMap: this.clearcoatRoughnessMap,
424
- displacementMap: this.displacementMap,
425
- displacementScale: this.displacementScale,
426
- displacementBias: this.displacementBias,
427
- envMap: this.envMap,
428
- ior: this.ior,
429
- transmission: this.transmission,
430
- transmissionMap: this.transmissionMap,
431
- thickness: this.thickness,
432
- thicknessMap: this.thicknessMap,
433
- attenuationDistance: this.attenuationDistance,
434
- attenuationColor: this.attenuationColor,
435
- sheen: this.sheen,
436
- sheenColor: this.sheenColor,
437
- sheenColorMap: this.sheenColorMap,
438
- sheenRoughness: this.sheenRoughness,
439
- sheenRoughnessMap: this.sheenRoughnessMap,
440
- specularColor: this.specularColor,
441
- specularColorMap: this.specularColorMap,
442
- specularIntensity: this.specularIntensity,
443
- specularIntensityMap: this.specularIntensityMap,
444
- }, this.id, this.version);
445
- }
446
-
447
- public copy(source: MaterialStandardData): void {
448
- this.alphaCutoff = source.alphaCutoff;
449
- this.alphaMap = source.alphaMap;
450
- this.alphaMode = source.alphaMode;
451
- this.aoMap = source.aoMap;
452
- this.aoMapIntensity = source.aoMapIntensity;
453
- this.bumpMap = source.bumpMap;
454
- this.bumpScale = source.bumpScale;
455
- this.color = source.color;
456
- this.depthTest = source.depthTest;
457
- this.depthWrite = source.depthWrite;
458
- this.emissiveMap = source.emissiveMap;
459
- this.emissiveness = source.emissiveness;
460
- this.materialOutput = source.materialOutput;
461
- this.map = source.map;
462
- this.normalMap = source.normalMap;
463
- this.normalScale = source.normalScale;
464
- this.opacity = source.opacity;
465
- this.shading = source.shading;
466
- this.side = source.side;
467
- this.transparent = source.transparent;
468
-
469
- this.attenuationColor = source.attenuationColor;
470
- this.attenuationDistance = source.attenuationDistance;
471
- this.clearcoat = source.clearcoat;
472
- this.clearcoatMap = source.clearcoatMap;
473
- this.clearcoatNormalMap = source.clearcoatNormalMap;
474
- this.clearcoatRoughness = source.clearcoatRoughness;
475
- this.clearcoatRoughnessMap = source.clearcoatRoughnessMap;
476
- this.displacementMap = source.displacementMap;
477
- this.displacementScale = source.displacementScale;
478
- this.displacementBias = source.displacementBias;
479
- this.envMap = source.envMap;
480
- this.ior = source.ior;
481
- this.metalness = source.metalness;
482
- this.metalnessMap = source.metalnessMap;
483
- this.metalnessRoughnessMap = source.metalnessRoughnessMap;
484
- this.roughness = source.roughness;
485
- this.roughnessMap = source.roughnessMap;
486
- this.sheen = source.sheen;
487
- this.sheenColor = source.sheenColor;
488
- this.sheenColorMap = source.sheenColorMap;
489
- this.sheenRoughness = source.sheenRoughness;
490
- this.sheenRoughnessMap = source.sheenRoughnessMap;
491
- this.specularColor = source.specularColor;
492
- this.specularColorMap = source.specularColorMap;
493
- this.specularIntensity = source.specularIntensity;
494
- this.specularIntensityMap = source.specularIntensityMap;
495
- this.thickness = source.thickness;
496
- this.thicknessMap = source.thicknessMap;
497
- this.transmission = source.transmission;
498
- this.transmissionMap = source.transmissionMap;
499
- }
500
-
501
- // #endregion Public Methods (1)
502
- }
@@ -1,122 +0,0 @@
1
- import { ITreeNodeData } from "@shapediver/viewer.shared.node-tree";
2
- import { MATERIAL_ALPHA, MATERIAL_SHADING, MATERIAL_SIDE } from "../../interfaces/data/material/IMaterialAbstractData";
3
- import { IMaterialUnlitData, IMaterialUnlitDataProperties } from "../../interfaces/data/material/IMaterialUnlitData";
4
- import { AbstractMaterialData } from "./AbstractMaterialData";
5
-
6
- export class MaterialUnlitData extends AbstractMaterialData implements IMaterialUnlitData {
7
- // #region Properties (1)
8
-
9
- #envMap?: string | string[];
10
-
11
- // #endregion Properties (1)
12
-
13
- // #region Constructors (1)
14
-
15
- /**
16
- * Creates a material data object.
17
- *
18
- * @param _attributes the attributes of the material
19
- * @param id the id
20
- */
21
- constructor(
22
- properties?: IMaterialUnlitDataProperties,
23
- id?: string,
24
- version?: string
25
- ) {
26
- super(properties, id, version);
27
- if (!properties) return;
28
- if (properties.envMap !== undefined) this.envMap = properties.envMap;
29
- }
30
-
31
- // #endregion Constructors (1)
32
-
33
- // #region Public Accessors (2)
34
-
35
- public get envMap(): string | string[] | undefined {
36
- return this.#envMap;
37
- }
38
-
39
- public set envMap(value: string | string[] | undefined) {
40
- this.#envMap = value;
41
- }
42
-
43
- // #endregion Public Accessors (2)
44
-
45
- // #region Public Methods (3)
46
-
47
- public clone(): IMaterialUnlitData {
48
- return new MaterialUnlitData({
49
- alphaMap: this.alphaMap,
50
- alphaCutoff: this.alphaCutoff,
51
- alphaMode: this.alphaMode,
52
- aoMap: this.aoMap,
53
- aoMapIntensity: this.aoMapIntensity,
54
- bumpMap: this.bumpMap,
55
- bumpScale: this.bumpScale,
56
- color: this.color,
57
- depthTest: this.depthTest,
58
- depthWrite: this.depthWrite,
59
- emissiveMap: this.emissiveMap,
60
- emissiveness: this.emissiveness,
61
- shading: this.shading,
62
- map: this.map,
63
- name: this.name,
64
- normalMap: this.normalMap,
65
- normalScale: this.normalScale,
66
- opacity: this.opacity,
67
- side: this.side,
68
- transparent: this.transparent,
69
- envMap: this.envMap
70
- }, this.id, this.version);
71
- }
72
-
73
- public copy(source: MaterialUnlitData): void {
74
- this.alphaCutoff = source.alphaCutoff;
75
- this.alphaMap = source.alphaMap;
76
- this.alphaMode = source.alphaMode;
77
- this.aoMap = source.aoMap;
78
- this.aoMapIntensity = source.aoMapIntensity;
79
- this.bumpMap = source.bumpMap;
80
- this.bumpScale = source.bumpScale;
81
- this.color = source.color;
82
- this.depthTest = source.depthTest;
83
- this.depthWrite = source.depthWrite;
84
- this.emissiveMap = source.emissiveMap;
85
- this.emissiveness = source.emissiveness;
86
- this.materialOutput = source.materialOutput;
87
- this.map = source.map;
88
- this.normalMap = source.normalMap;
89
- this.normalScale = source.normalScale;
90
- this.opacity = source.opacity;
91
- this.shading = source.shading;
92
- this.side = source.side;
93
- this.envMap = source.envMap;
94
- this.transparent = source.transparent;
95
- }
96
-
97
- public reset(): void {
98
- this.alphaCutoff = 0;
99
- this.alphaMap = undefined;
100
- this.alphaMode = MATERIAL_ALPHA.OPAQUE;
101
- this.aoMap = undefined;
102
- this.aoMapIntensity = 1.0;
103
- this.bumpMap = undefined;
104
- this.bumpScale = 1.0;
105
- this.color = '#ffffff';
106
- this.depthTest = undefined;
107
- this.depthWrite = undefined;
108
- this.emissiveMap = undefined;
109
- this.emissiveness = '#000000';
110
- this.materialOutput = false;
111
- this.map = undefined;
112
- this.normalMap = undefined;
113
- this.normalScale = 1.0;
114
- this.opacity = 1.0;
115
- this.shading = MATERIAL_SHADING.SMOOTH;
116
- this.side = MATERIAL_SIDE.DOUBLE;
117
- this.transparent = undefined;
118
- this.envMap = undefined;
119
- }
120
-
121
- // #endregion Public Methods (3)
122
- }
@@ -1,60 +0,0 @@
1
- import { AbstractTreeNodeData, ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
2
- import { IMaterialVariantsData } from '../../interfaces/data/material/IMaterialVariantsData';
3
- import { GeometryData, PrimitiveData } from '../data/GeometryData';
4
-
5
- export class MaterialVariantsData extends AbstractTreeNodeData implements IMaterialVariantsData {
6
- // #region Properties (1)
7
-
8
- readonly #variants: string[] = [];
9
- readonly #geometryData: GeometryData[] = [];
10
- #variantIndex?: number;
11
-
12
- // #endregion Properties (1)
13
-
14
- // #region Constructors (1)
15
-
16
- constructor(id?: string, version?: string) {
17
- super(id, version);
18
- }
19
-
20
- // #endregion Constructors (1)
21
-
22
- // #region Public Accessors (2)
23
-
24
- public get geometryData(): GeometryData[] {
25
- return this.#geometryData;
26
- }
27
-
28
- public get variants(): string[] {
29
- return this.#variants;
30
- }
31
-
32
- public get variantIndex(): number | undefined {
33
- return this.#variantIndex;
34
- }
35
-
36
- public set variantIndex(value: number | undefined) {
37
- this.#variantIndex = value;
38
- for(let i = 0; i < this.geometryData.length; i++) {
39
- const variant = this.geometryData[i].materialVariants.find(v => v.variant === this.#variantIndex);
40
- if(variant) {
41
- this.geometryData[i].material = variant.material;
42
- } else {
43
- this.geometryData[i].material = this.geometryData[i].standardMaterial;
44
- }
45
- }
46
- }
47
-
48
- // #endregion Public Accessors (2)
49
-
50
- // #region Public Methods (1)
51
-
52
- /**
53
- * Clones the scene graph data.
54
- */
55
- public clone(): IMaterialVariantsData {
56
- return new MaterialVariantsData(this.id, this.version);
57
- }
58
-
59
- // #endregion Public Methods (1)
60
- }