@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.
- package/dist/implementation/data/GeometryData.d.ts.map +1 -1
- package/dist/implementation/data/GeometryData.js +1 -0
- package/dist/implementation/data/GeometryData.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/interfaces/parameter/IDrawingParametersSettings.d.ts +121 -0
- package/dist/interfaces/parameter/IDrawingParametersSettings.d.ts.map +1 -0
- package/dist/interfaces/parameter/IDrawingParametersSettings.js +22 -0
- package/dist/interfaces/parameter/IDrawingParametersSettings.js.map +1 -0
- package/dist/interfaces/parameter/IDrawingToolsParametersSettings.d.ts +159 -0
- package/dist/interfaces/parameter/IDrawingToolsParametersSettings.d.ts.map +1 -0
- package/dist/interfaces/parameter/IDrawingToolsParametersSettings.js +29 -0
- package/dist/interfaces/parameter/IDrawingToolsParametersSettings.js.map +1 -0
- package/dist/interfaces/parameter/IGumballParameterSettings.d.ts +1 -5
- package/dist/interfaces/parameter/IGumballParameterSettings.d.ts.map +1 -1
- package/dist/interfaces/parameter/IGumballParameterSettings.js +0 -7
- package/dist/interfaces/parameter/IGumballParameterSettings.js.map +1 -1
- package/dist/interfaces/parameter/ISelectionParameterSettings.d.ts +1 -5
- package/dist/interfaces/parameter/ISelectionParameterSettings.d.ts.map +1 -1
- package/dist/interfaces/parameter/ISelectionParameterSettings.js +0 -7
- package/dist/interfaces/parameter/ISelectionParameterSettings.js.map +1 -1
- package/package.json +7 -8
- package/src/implementation/data/AnimationData.ts +0 -310
- package/src/implementation/data/BoneData.ts +0 -32
- package/src/implementation/data/CustomData.ts +0 -52
- package/src/implementation/data/GeometryData.ts +0 -426
- package/src/implementation/data/HTMLElementAnchorData.ts +0 -365
- package/src/implementation/material/AbstractMaterialData.ts +0 -268
- package/src/implementation/material/MapData.ts +0 -218
- package/src/implementation/material/MaterialBasicLineData.ts +0 -99
- package/src/implementation/material/MaterialGemData.ts +0 -310
- package/src/implementation/material/MaterialMultiPointData.ts +0 -659
- package/src/implementation/material/MaterialPointData.ts +0 -136
- package/src/implementation/material/MaterialShadowData.ts +0 -45
- package/src/implementation/material/MaterialSpecularGlossinessData.ts +0 -191
- package/src/implementation/material/MaterialStandardData.ts +0 -502
- package/src/implementation/material/MaterialUnlitData.ts +0 -122
- package/src/implementation/material/MaterialVariantsData.ts +0 -60
- package/src/implementation/sdtf/SDTFAttributesData.ts +0 -128
- package/src/implementation/sdtf/SDTFItemData.ts +0 -72
- package/src/implementation/sdtf/SDTFOverviewData.ts +0 -80
- package/src/index.ts +0 -141
- package/src/interfaces/data/IAnimationData.ts +0 -42
- package/src/interfaces/data/IBoneData.ts +0 -9
- package/src/interfaces/data/ICustomData.ts +0 -15
- package/src/interfaces/data/IGeometryData.ts +0 -87
- package/src/interfaces/data/IHTMLElementAnchorData.ts +0 -68
- package/src/interfaces/data/material/IMapData.ts +0 -64
- package/src/interfaces/data/material/IMaterialAbstractData.ts +0 -86
- package/src/interfaces/data/material/IMaterialBasicLineData.ts +0 -21
- package/src/interfaces/data/material/IMaterialGemDataProperties.ts +0 -46
- package/src/interfaces/data/material/IMaterialMultiPointData.ts +0 -72
- package/src/interfaces/data/material/IMaterialPointData.ts +0 -31
- package/src/interfaces/data/material/IMaterialShadowData.ts +0 -21
- package/src/interfaces/data/material/IMaterialSpecularGlossinessDataProperties.ts +0 -36
- package/src/interfaces/data/material/IMaterialStandardData.ts +0 -60
- package/src/interfaces/data/material/IMaterialUnlitData.ts +0 -30
- package/src/interfaces/data/material/IMaterialVariantsData.ts +0 -19
- package/src/interfaces/events/EventResponseMapping.ts +0 -53
- package/src/interfaces/events/ICameraEvent.ts +0 -16
- package/src/interfaces/events/IOutputEvent.ts +0 -29
- package/src/interfaces/events/IParameterEvent.ts +0 -21
- package/src/interfaces/events/IRenderingEvent.ts +0 -7
- package/src/interfaces/events/ISceneEvent.ts +0 -17
- package/src/interfaces/events/ISessionEvent.ts +0 -16
- package/src/interfaces/events/ITaskEvent.ts +0 -61
- package/src/interfaces/events/IViewportEvent.ts +0 -13
- package/src/interfaces/parameter/IGumballParameterSettings.ts +0 -44
- package/src/interfaces/parameter/IInteractionParameterSettings.ts +0 -85
- package/src/interfaces/parameter/ISelectionParameterSettings.ts +0 -37
- package/src/interfaces/sdtf/ISDTFAttributeVisualizationData.ts +0 -7
- package/src/interfaces/sdtf/ISDTFAttributesData.ts +0 -27
- package/src/interfaces/sdtf/ISDTFItemData.ts +0 -23
- package/src/interfaces/sdtf/ISDTFOverviewData.ts +0 -31
- package/src/types.ts +0 -68
- package/tsconfig.json +0 -17
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { vec2 } from 'gl-matrix';
|
|
2
|
-
import { AbstractTreeNodeData } from '@shapediver/viewer.shared.node-tree';
|
|
3
|
-
import { IMapData, TEXTURE_FILTERING, TEXTURE_WRAPPING } from '../../interfaces/data/material/IMapData';
|
|
4
|
-
import { Color } from '../../types';
|
|
5
|
-
|
|
6
|
-
export class MapData extends AbstractTreeNodeData implements IMapData {
|
|
7
|
-
// #region Properties (15)
|
|
8
|
-
|
|
9
|
-
#asData: boolean = false;
|
|
10
|
-
#blob?: Blob;
|
|
11
|
-
#center: vec2 = vec2.fromValues(0, 0);
|
|
12
|
-
#color?: Color;
|
|
13
|
-
#data?: number[];
|
|
14
|
-
#flipY: boolean = true;
|
|
15
|
-
#image: HTMLImageElement | ArrayBuffer;
|
|
16
|
-
#magFilter: TEXTURE_FILTERING = TEXTURE_FILTERING.NONE;
|
|
17
|
-
#minFilter: TEXTURE_FILTERING = TEXTURE_FILTERING.NONE;
|
|
18
|
-
#offset: vec2 = vec2.fromValues(0, 0);
|
|
19
|
-
#repeat: vec2 = vec2.fromValues(1, 1);
|
|
20
|
-
#rotation: number = 0;
|
|
21
|
-
#texCoord?: number;
|
|
22
|
-
#wrapS: TEXTURE_WRAPPING = TEXTURE_WRAPPING.REPEAT;
|
|
23
|
-
#wrapT: TEXTURE_WRAPPING = TEXTURE_WRAPPING.REPEAT;
|
|
24
|
-
|
|
25
|
-
// #endregion Properties (15)
|
|
26
|
-
|
|
27
|
-
// #region Constructors (1)
|
|
28
|
-
|
|
29
|
-
constructor(
|
|
30
|
-
image: HTMLImageElement | ArrayBuffer,
|
|
31
|
-
properties?: {
|
|
32
|
-
asData?: boolean,
|
|
33
|
-
data?: number[],
|
|
34
|
-
blob?: Blob,
|
|
35
|
-
wrapS?: TEXTURE_WRAPPING,
|
|
36
|
-
wrapT?: TEXTURE_WRAPPING,
|
|
37
|
-
minFilter?: TEXTURE_FILTERING,
|
|
38
|
-
magFilter?: TEXTURE_FILTERING,
|
|
39
|
-
center?: vec2,
|
|
40
|
-
color?: Color,
|
|
41
|
-
offset?: vec2,
|
|
42
|
-
repeat?: vec2,
|
|
43
|
-
rotation?: number,
|
|
44
|
-
texCoord?: number,
|
|
45
|
-
flipY?: boolean,
|
|
46
|
-
},
|
|
47
|
-
id?: string,
|
|
48
|
-
version?: string
|
|
49
|
-
) {
|
|
50
|
-
super(id, version);
|
|
51
|
-
this.#image = image;
|
|
52
|
-
this.#asData = properties && properties.asData !== undefined ? properties.asData : false;
|
|
53
|
-
this.#data = properties ? properties.data : undefined;
|
|
54
|
-
this.#blob = properties ? properties.blob : undefined;
|
|
55
|
-
this.#wrapS = properties && properties.wrapS !== undefined ? properties.wrapS : TEXTURE_WRAPPING.REPEAT;
|
|
56
|
-
this.#wrapT = properties && properties.wrapT !== undefined ? properties.wrapT : TEXTURE_WRAPPING.REPEAT;
|
|
57
|
-
this.#minFilter = properties && properties.minFilter !== undefined ? properties.minFilter : TEXTURE_FILTERING.NONE;
|
|
58
|
-
this.#magFilter = properties && properties.magFilter !== undefined ? properties.magFilter : TEXTURE_FILTERING.NONE;
|
|
59
|
-
this.#center = properties && properties.center !== undefined ? properties.center : vec2.fromValues(0, 0);
|
|
60
|
-
this.#color = properties ? properties.color : undefined;
|
|
61
|
-
this.#offset = properties && properties.offset !== undefined ? properties.offset : vec2.fromValues(0, 0);
|
|
62
|
-
this.#repeat = properties && properties.repeat !== undefined ? properties.repeat : vec2.fromValues(1, 1);
|
|
63
|
-
this.#rotation = properties && properties.rotation !== undefined ? properties.rotation : 0;
|
|
64
|
-
this.#texCoord = properties ? properties.texCoord : undefined;
|
|
65
|
-
this.#flipY = properties && properties.flipY !== undefined ? properties.flipY : true;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// #endregion Constructors (1)
|
|
69
|
-
|
|
70
|
-
// #region Public Getters And Setters (30)
|
|
71
|
-
|
|
72
|
-
public get asData(): boolean {
|
|
73
|
-
return this.#asData;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
public set asData(value: boolean) {
|
|
77
|
-
this.#asData = value;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
public get blob(): Blob | undefined {
|
|
81
|
-
return this.#blob;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
public set blob(value: Blob | undefined) {
|
|
85
|
-
this.#blob = value;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
public get center(): vec2 {
|
|
89
|
-
return this.#center;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
public set center(value: vec2) {
|
|
93
|
-
this.#center = value;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
public get color(): Color | undefined {
|
|
97
|
-
return this.#color;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
public set color(value: Color | undefined) {
|
|
101
|
-
this.#color = value;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
public get data(): number[] | undefined {
|
|
105
|
-
return this.#data;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
public set data(value: number[] | undefined) {
|
|
109
|
-
this.#data = value;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
public get flipY(): boolean {
|
|
113
|
-
return this.#flipY;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
public set flipY(value: boolean) {
|
|
117
|
-
this.#flipY = value;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
public get image(): HTMLImageElement | ArrayBuffer {
|
|
121
|
-
return this.#image;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
public set image(value: HTMLImageElement | ArrayBuffer) {
|
|
125
|
-
this.#image = value;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
public get magFilter(): TEXTURE_FILTERING {
|
|
129
|
-
return this.#magFilter;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
public set magFilter(value: TEXTURE_FILTERING) {
|
|
133
|
-
this.#magFilter = value;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
public get minFilter(): TEXTURE_FILTERING {
|
|
137
|
-
return this.#minFilter;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
public set minFilter(value: TEXTURE_FILTERING) {
|
|
141
|
-
this.#minFilter = value;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
public get offset(): vec2 {
|
|
145
|
-
return this.#offset;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
public set offset(value: vec2) {
|
|
149
|
-
this.#offset = value;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
public get repeat(): vec2 {
|
|
153
|
-
return this.#repeat;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
public set repeat(value: vec2) {
|
|
157
|
-
this.#repeat = value;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
public get rotation(): number {
|
|
161
|
-
return this.#rotation;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
public set rotation(value: number) {
|
|
165
|
-
this.#rotation = value;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
public get texCoord(): number | undefined {
|
|
169
|
-
return this.#texCoord;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
public set texCoord(value: number | undefined) {
|
|
173
|
-
this.#texCoord = value;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
public get wrapS(): TEXTURE_WRAPPING {
|
|
177
|
-
return this.#wrapS;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
public set wrapS(value: TEXTURE_WRAPPING) {
|
|
181
|
-
this.#wrapS = value;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
public get wrapT(): TEXTURE_WRAPPING {
|
|
185
|
-
return this.#wrapT;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
public set wrapT(value: TEXTURE_WRAPPING) {
|
|
189
|
-
this.#wrapT = value;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// #endregion Public Getters And Setters (30)
|
|
193
|
-
|
|
194
|
-
// #region Public Methods (1)
|
|
195
|
-
|
|
196
|
-
public clone(): IMapData {
|
|
197
|
-
return new MapData(
|
|
198
|
-
<HTMLImageElement>this.image,
|
|
199
|
-
{
|
|
200
|
-
asData: this.asData,
|
|
201
|
-
data: this.data,
|
|
202
|
-
blob: this.blob,
|
|
203
|
-
wrapS: this.wrapS,
|
|
204
|
-
wrapT: this.wrapT,
|
|
205
|
-
minFilter: this.minFilter,
|
|
206
|
-
magFilter: this.magFilter,
|
|
207
|
-
center: this.center,
|
|
208
|
-
color: this.color,
|
|
209
|
-
offset: this.offset,
|
|
210
|
-
repeat: this.repeat,
|
|
211
|
-
rotation: this.rotation,
|
|
212
|
-
texCoord: this.texCoord,
|
|
213
|
-
flipY: this.flipY
|
|
214
|
-
}, this.id, this.version);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// #endregion Public Methods (1)
|
|
218
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { AbstractMaterialData } from './AbstractMaterialData';
|
|
2
|
-
import { IMaterialBasicLineData, IMaterialBasicLineDataProperties } from '../../interfaces/data/material/IMaterialBasicLineData';
|
|
3
|
-
import { MATERIAL_ALPHA, MATERIAL_SHADING, MATERIAL_SIDE } from '../../interfaces/data/material/IMaterialAbstractData';
|
|
4
|
-
|
|
5
|
-
export class MaterialBasicLineData extends AbstractMaterialData implements IMaterialBasicLineData {
|
|
6
|
-
// #region Constructors (1)
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Creates a material data object.
|
|
10
|
-
*
|
|
11
|
-
* @param _attributes the attributes of the material
|
|
12
|
-
* @param id the id
|
|
13
|
-
*/
|
|
14
|
-
constructor(
|
|
15
|
-
properties?: IMaterialBasicLineDataProperties,
|
|
16
|
-
id?: string,
|
|
17
|
-
version?: string
|
|
18
|
-
) {
|
|
19
|
-
super(properties, id, version);
|
|
20
|
-
if (!properties) return;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// #endregion Constructors (1)
|
|
24
|
-
|
|
25
|
-
// #region Public Methods (3)
|
|
26
|
-
|
|
27
|
-
public clone(): IMaterialBasicLineData {
|
|
28
|
-
return new MaterialBasicLineData({
|
|
29
|
-
alphaMap: this.alphaMap,
|
|
30
|
-
alphaCutoff: this.alphaCutoff,
|
|
31
|
-
alphaMode: this.alphaMode,
|
|
32
|
-
aoMap: this.aoMap,
|
|
33
|
-
aoMapIntensity: this.aoMapIntensity,
|
|
34
|
-
bumpMap: this.bumpMap,
|
|
35
|
-
bumpScale: this.bumpScale,
|
|
36
|
-
color: this.color,
|
|
37
|
-
depthTest: this.depthTest,
|
|
38
|
-
depthWrite: this.depthWrite,
|
|
39
|
-
emissiveMap: this.emissiveMap,
|
|
40
|
-
emissiveness: this.emissiveness,
|
|
41
|
-
shading: this.shading,
|
|
42
|
-
map: this.map,
|
|
43
|
-
name: this.name,
|
|
44
|
-
normalMap: this.normalMap,
|
|
45
|
-
normalScale: this.normalScale,
|
|
46
|
-
opacity: this.opacity,
|
|
47
|
-
side: this.side,
|
|
48
|
-
transparent: this.transparent
|
|
49
|
-
}, this.id, this.version);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
public copy(source: MaterialBasicLineData): void {
|
|
53
|
-
this.alphaCutoff = source.alphaCutoff;
|
|
54
|
-
this.alphaMap = source.alphaMap;
|
|
55
|
-
this.alphaMode = source.alphaMode;
|
|
56
|
-
this.aoMap = source.aoMap;
|
|
57
|
-
this.aoMapIntensity = source.aoMapIntensity;
|
|
58
|
-
this.bumpMap = source.bumpMap;
|
|
59
|
-
this.bumpScale = source.bumpScale;
|
|
60
|
-
this.color = source.color;
|
|
61
|
-
this.depthTest = source.depthTest;
|
|
62
|
-
this.depthWrite = source.depthWrite;
|
|
63
|
-
this.emissiveMap = source.emissiveMap;
|
|
64
|
-
this.emissiveness = source.emissiveness;
|
|
65
|
-
this.materialOutput = source.materialOutput;
|
|
66
|
-
this.map = source.map;
|
|
67
|
-
this.normalMap = source.normalMap;
|
|
68
|
-
this.normalScale = source.normalScale;
|
|
69
|
-
this.opacity = source.opacity;
|
|
70
|
-
this.shading = source.shading;
|
|
71
|
-
this.side = source.side;
|
|
72
|
-
this.transparent = source.transparent;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
public reset(): void {
|
|
76
|
-
this.alphaCutoff = 0;
|
|
77
|
-
this.alphaMap = undefined;
|
|
78
|
-
this.alphaMode = MATERIAL_ALPHA.OPAQUE;
|
|
79
|
-
this.aoMap = undefined;
|
|
80
|
-
this.aoMapIntensity = 1.0;
|
|
81
|
-
this.bumpMap = undefined;
|
|
82
|
-
this.bumpScale = 1.0;
|
|
83
|
-
this.color = '#ffffff';
|
|
84
|
-
this.depthTest = undefined;
|
|
85
|
-
this.depthWrite = undefined;
|
|
86
|
-
this.emissiveMap = undefined;
|
|
87
|
-
this.emissiveness = '#000000';
|
|
88
|
-
this.materialOutput = false;
|
|
89
|
-
this.map = undefined;
|
|
90
|
-
this.normalMap = undefined;
|
|
91
|
-
this.normalScale = 1.0;
|
|
92
|
-
this.opacity = 1.0;
|
|
93
|
-
this.shading = MATERIAL_SHADING.SMOOTH;
|
|
94
|
-
this.side = MATERIAL_SIDE.DOUBLE;
|
|
95
|
-
this.transparent = undefined;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// #endregion Public Methods (3)
|
|
99
|
-
}
|
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
import { AbstractMaterialData } from './AbstractMaterialData';
|
|
2
|
-
import { IMaterialGemData, IMaterialGemDataProperties } from '../../interfaces/data/material/IMaterialGemDataProperties';
|
|
3
|
-
import { MATERIAL_ALPHA, MATERIAL_SHADING, MATERIAL_SIDE } from '../../interfaces/data/material/IMaterialAbstractData';
|
|
4
|
-
import { IMapData } from '../../interfaces/data/material/IMapData';
|
|
5
|
-
import { mat3, mat4, vec3 } from 'gl-matrix';
|
|
6
|
-
import { Color } from '../../types';
|
|
7
|
-
|
|
8
|
-
export class MaterialGemData extends AbstractMaterialData implements IMaterialGemData {
|
|
9
|
-
// #region Properties (5)
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
#refractionIndex: number = 2.4;
|
|
13
|
-
#impurityMap?: IMapData;
|
|
14
|
-
#impurityScale: number = 1.0;
|
|
15
|
-
#colorTransferBegin: Color = '#ffffff';
|
|
16
|
-
#colorTransferEnd: Color = '#ffffff';
|
|
17
|
-
#center: vec3 = vec3.create();
|
|
18
|
-
#radius: number = 1;
|
|
19
|
-
#sphericalNormalMap?: IMapData;
|
|
20
|
-
#gamma: number = 1;
|
|
21
|
-
#contrast: number = 1;
|
|
22
|
-
#brightness: number = 0;
|
|
23
|
-
#dispersion: number = 0;
|
|
24
|
-
#tracingDepth: number = 5;
|
|
25
|
-
#tracingOpacity: number = 0;
|
|
26
|
-
#envMap?: string | string[];
|
|
27
|
-
|
|
28
|
-
// #endregion Properties (5)
|
|
29
|
-
|
|
30
|
-
// #region Constructors (1)
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Creates a material data object.
|
|
34
|
-
*
|
|
35
|
-
* @param _attributes the attributes of the material
|
|
36
|
-
* @param id the id
|
|
37
|
-
*/
|
|
38
|
-
constructor(
|
|
39
|
-
properties?: IMaterialGemDataProperties,
|
|
40
|
-
id?: string,
|
|
41
|
-
version?: string
|
|
42
|
-
) {
|
|
43
|
-
super(properties, id, version);
|
|
44
|
-
if (!properties) return;
|
|
45
|
-
|
|
46
|
-
if (properties.refractionIndex !== undefined) this.refractionIndex = properties.refractionIndex;
|
|
47
|
-
if (properties.impurityMap !== undefined) this.impurityMap = properties.impurityMap;
|
|
48
|
-
if (properties.impurityScale !== undefined) this.impurityScale = properties.impurityScale;
|
|
49
|
-
if (properties.colorTransferBegin !== undefined) this.colorTransferBegin = properties.colorTransferBegin;
|
|
50
|
-
if (properties.colorTransferEnd !== undefined) this.colorTransferEnd = properties.colorTransferEnd;
|
|
51
|
-
if (properties.center !== undefined) this.center = properties.center;
|
|
52
|
-
if (properties.tracingDepth !== undefined) this.tracingDepth = properties.tracingDepth;
|
|
53
|
-
if (properties.radius !== undefined) this.radius = properties.radius;
|
|
54
|
-
if (properties.sphericalNormalMap !== undefined) this.sphericalNormalMap = properties.sphericalNormalMap;
|
|
55
|
-
if (properties.gamma !== undefined) this.gamma = properties.gamma;
|
|
56
|
-
if (properties.contrast !== undefined) this.contrast = properties.contrast;
|
|
57
|
-
if (properties.brightness !== undefined) this.brightness = properties.brightness;
|
|
58
|
-
if (properties.dispersion !== undefined) this.dispersion = properties.dispersion;
|
|
59
|
-
if (properties.tracingOpacity !== undefined) this.tracingOpacity = properties.tracingOpacity;
|
|
60
|
-
if (properties.envMap !== undefined) this.envMap = properties.envMap;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// #endregion Constructors (1)
|
|
64
|
-
|
|
65
|
-
// #region Public Accessors (10)
|
|
66
|
-
|
|
67
|
-
public get refractionIndex(): number {
|
|
68
|
-
return this.#refractionIndex;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
public set refractionIndex(value: number) {
|
|
72
|
-
this.#refractionIndex = value;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
public get impurityMap(): IMapData | undefined {
|
|
76
|
-
return this.#impurityMap;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public set impurityMap(value: IMapData | undefined) {
|
|
80
|
-
this.#impurityMap = value;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
public get impurityScale(): number {
|
|
84
|
-
return this.#impurityScale;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
public set impurityScale(value: number) {
|
|
88
|
-
this.#impurityScale = value;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
public get colorTransferBegin(): Color {
|
|
92
|
-
return this.#colorTransferBegin;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
public set colorTransferBegin(value: Color) {
|
|
96
|
-
this.#colorTransferBegin = value;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
public get colorTransferEnd(): Color {
|
|
100
|
-
return this.#colorTransferEnd;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
public set colorTransferEnd(value: Color) {
|
|
104
|
-
this.#colorTransferEnd = value;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
public get center(): vec3 {
|
|
108
|
-
return this.#center;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
public set center(value: vec3) {
|
|
112
|
-
this.#center = value;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
public get tracingDepth(): number {
|
|
116
|
-
return this.#tracingDepth;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
public set tracingDepth(value: number) {
|
|
120
|
-
this.#tracingDepth = value;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
public get radius(): number {
|
|
124
|
-
return this.#radius;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
public set radius(value: number) {
|
|
128
|
-
this.#radius = value;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
public get sphericalNormalMap(): IMapData | undefined {
|
|
132
|
-
return this.#sphericalNormalMap;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
public set sphericalNormalMap(value: IMapData | undefined) {
|
|
136
|
-
this.#sphericalNormalMap = value;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
public get gamma(): number {
|
|
140
|
-
return this.#gamma;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
public set gamma(value: number) {
|
|
144
|
-
this.#gamma = value;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
public get contrast(): number {
|
|
148
|
-
return this.#contrast;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
public set contrast(value: number) {
|
|
152
|
-
this.#contrast = value;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
public get brightness(): number {
|
|
156
|
-
return this.#brightness;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
public set brightness(value: number) {
|
|
160
|
-
this.#brightness = value;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
public get dispersion(): number {
|
|
164
|
-
return this.#dispersion;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
public set dispersion(value: number) {
|
|
168
|
-
this.#dispersion = value;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
public get tracingOpacity(): number {
|
|
172
|
-
return this.#tracingOpacity;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
public set tracingOpacity(value: number) {
|
|
176
|
-
this.#tracingOpacity = value;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
public get envMap(): string | string[] | undefined {
|
|
180
|
-
return this.#envMap;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
public set envMap(value: string | string[] | undefined) {
|
|
184
|
-
this.#envMap = value;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// #endregion Public Accessors (10)
|
|
188
|
-
|
|
189
|
-
// #region Public Methods (3)
|
|
190
|
-
|
|
191
|
-
public clone(): IMaterialGemData {
|
|
192
|
-
return new MaterialGemData({
|
|
193
|
-
alphaMap: this.alphaMap,
|
|
194
|
-
alphaCutoff: this.alphaCutoff,
|
|
195
|
-
alphaMode: this.alphaMode,
|
|
196
|
-
aoMap: this.aoMap,
|
|
197
|
-
aoMapIntensity: this.aoMapIntensity,
|
|
198
|
-
bumpMap: this.bumpMap,
|
|
199
|
-
bumpScale: this.bumpScale,
|
|
200
|
-
color: this.color,
|
|
201
|
-
depthTest: this.depthTest,
|
|
202
|
-
depthWrite: this.depthWrite,
|
|
203
|
-
emissiveMap: this.emissiveMap,
|
|
204
|
-
emissiveness: this.emissiveness,
|
|
205
|
-
shading: this.shading,
|
|
206
|
-
map: this.map,
|
|
207
|
-
name: this.name,
|
|
208
|
-
normalMap: this.normalMap,
|
|
209
|
-
normalScale: this.normalScale,
|
|
210
|
-
opacity: this.opacity,
|
|
211
|
-
side: this.side,
|
|
212
|
-
transparent: this.transparent,
|
|
213
|
-
refractionIndex: this.refractionIndex,
|
|
214
|
-
impurityMap: this.impurityMap,
|
|
215
|
-
impurityScale: this.impurityScale,
|
|
216
|
-
colorTransferBegin: this.colorTransferBegin,
|
|
217
|
-
colorTransferEnd: this.colorTransferEnd,
|
|
218
|
-
center: this.center,
|
|
219
|
-
tracingDepth: this.tracingDepth,
|
|
220
|
-
radius: this.radius,
|
|
221
|
-
sphericalNormalMap: this.sphericalNormalMap,
|
|
222
|
-
gamma: this.gamma,
|
|
223
|
-
contrast: this.contrast,
|
|
224
|
-
brightness: this.brightness,
|
|
225
|
-
dispersion: this.dispersion,
|
|
226
|
-
tracingOpacity: this.tracingOpacity,
|
|
227
|
-
envMap: this.envMap,
|
|
228
|
-
}, this.id, this.version);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
public copy(source: MaterialGemData): void {
|
|
232
|
-
this.alphaCutoff = source.alphaCutoff;
|
|
233
|
-
this.alphaMap = source.alphaMap;
|
|
234
|
-
this.alphaMode = source.alphaMode;
|
|
235
|
-
this.aoMap = source.aoMap;
|
|
236
|
-
this.aoMapIntensity = source.aoMapIntensity;
|
|
237
|
-
this.bumpMap = source.bumpMap;
|
|
238
|
-
this.bumpScale = source.bumpScale;
|
|
239
|
-
this.color = source.color;
|
|
240
|
-
this.depthTest = source.depthTest;
|
|
241
|
-
this.depthWrite = source.depthWrite;
|
|
242
|
-
this.emissiveMap = source.emissiveMap;
|
|
243
|
-
this.emissiveness = source.emissiveness;
|
|
244
|
-
this.materialOutput = source.materialOutput;
|
|
245
|
-
this.map = source.map;
|
|
246
|
-
this.normalMap = source.normalMap;
|
|
247
|
-
this.normalScale = source.normalScale;
|
|
248
|
-
this.opacity = source.opacity;
|
|
249
|
-
this.shading = source.shading;
|
|
250
|
-
this.side = source.side;
|
|
251
|
-
this.transparent = source.transparent;
|
|
252
|
-
|
|
253
|
-
this.refractionIndex = source.refractionIndex;
|
|
254
|
-
this.impurityMap = source.impurityMap;
|
|
255
|
-
this.impurityScale = source.impurityScale;
|
|
256
|
-
this.colorTransferBegin = source.colorTransferBegin;
|
|
257
|
-
this.colorTransferEnd = source.colorTransferEnd;
|
|
258
|
-
this.center = source.center;
|
|
259
|
-
this.tracingDepth = source.tracingDepth;
|
|
260
|
-
this.radius = source.radius;
|
|
261
|
-
this.sphericalNormalMap = source.sphericalNormalMap;
|
|
262
|
-
this.gamma = source.gamma;
|
|
263
|
-
this.contrast = source.contrast;
|
|
264
|
-
this.brightness = source.brightness;
|
|
265
|
-
this.dispersion = source.dispersion;
|
|
266
|
-
this.tracingOpacity = source.tracingOpacity;
|
|
267
|
-
this.envMap = source.envMap;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
public reset(): void {
|
|
271
|
-
this.alphaCutoff = 0;
|
|
272
|
-
this.alphaMap = undefined;
|
|
273
|
-
this.alphaMode = MATERIAL_ALPHA.OPAQUE;
|
|
274
|
-
this.aoMap = undefined;
|
|
275
|
-
this.aoMapIntensity = 1.0;
|
|
276
|
-
this.bumpMap = undefined;
|
|
277
|
-
this.bumpScale = 1.0;
|
|
278
|
-
this.color = '#ffffff';
|
|
279
|
-
this.depthTest = undefined;
|
|
280
|
-
this.depthWrite = undefined;
|
|
281
|
-
this.emissiveMap = undefined;
|
|
282
|
-
this.emissiveness = '#000000';
|
|
283
|
-
this.materialOutput = false;
|
|
284
|
-
this.map = undefined;
|
|
285
|
-
this.normalMap = undefined;
|
|
286
|
-
this.normalScale = 1.0;
|
|
287
|
-
this.opacity = 1.0;
|
|
288
|
-
this.shading = MATERIAL_SHADING.SMOOTH;
|
|
289
|
-
this.side = MATERIAL_SIDE.DOUBLE;
|
|
290
|
-
this.transparent = undefined;
|
|
291
|
-
|
|
292
|
-
this.refractionIndex = 2.4;
|
|
293
|
-
this.impurityMap = undefined;
|
|
294
|
-
this.impurityScale = 1.0;
|
|
295
|
-
this.colorTransferBegin = '#ffffff';
|
|
296
|
-
this.colorTransferEnd = '#ffffff';
|
|
297
|
-
this.center = vec3.create();
|
|
298
|
-
this.radius = 1;
|
|
299
|
-
this.sphericalNormalMap = undefined;
|
|
300
|
-
this.gamma = 1;
|
|
301
|
-
this.contrast = 1;
|
|
302
|
-
this.brightness = 0;
|
|
303
|
-
this.dispersion = 0;
|
|
304
|
-
this.tracingDepth = 5;
|
|
305
|
-
this.tracingOpacity = 0;
|
|
306
|
-
this.envMap = undefined;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
// #endregion Public Methods (3)
|
|
310
|
-
}
|