@configura/web-core 1.3.0-alpha.1 → 1.3.0-alpha.2

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 (166) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +1 -1
  3. package/dist/cm/basic/Color.d.ts +16 -16
  4. package/dist/cm/basic/Color.js +18 -18
  5. package/dist/cm/basic/ColorF.d.ts +9 -9
  6. package/dist/cm/basic/ColorF.js +10 -10
  7. package/dist/cm/basic/boolean.d.ts +2 -2
  8. package/dist/cm/basic/boolean.js +11 -11
  9. package/dist/cm/basic/number.d.ts +3 -3
  10. package/dist/cm/basic/number.js +18 -18
  11. package/dist/cm/basic/string.d.ts +2 -2
  12. package/dist/cm/basic/string.js +11 -11
  13. package/dist/cm/core3D/ATriMeshF.d.ts +90 -90
  14. package/dist/cm/core3D/ATriMeshF.js +193 -193
  15. package/dist/cm/core3D/DummyUVMapper.d.ts +6 -6
  16. package/dist/cm/core3D/DummyUVMapper.js +6 -6
  17. package/dist/cm/core3D/GMaterial3D.d.ts +58 -58
  18. package/dist/cm/core3D/GMaterial3D.js +112 -112
  19. package/dist/cm/core3D/GMaterialClassic.d.ts +55 -55
  20. package/dist/cm/core3D/GMaterialClassic.js +171 -171
  21. package/dist/cm/core3D/GMaterialPBR.d.ts +71 -71
  22. package/dist/cm/core3D/GMaterialPBR.js +288 -288
  23. package/dist/cm/core3D/MultiGMaterial3D.d.ts +8 -8
  24. package/dist/cm/core3D/MultiGMaterial3D.js +17 -17
  25. package/dist/cm/core3D/UVMapEnv.d.ts +17 -17
  26. package/dist/cm/core3D/UVMapEnv.js +35 -35
  27. package/dist/cm/core3D/UVTransformer.d.ts +5 -5
  28. package/dist/cm/core3D/UVTransformer.js +5 -5
  29. package/dist/cm/core3D/instantiateUVMapper.d.ts +3 -3
  30. package/dist/cm/core3D/instantiateUVMapper.js +5 -5
  31. package/dist/cm/format/cmsym/InvalidationEnv.d.ts +9 -9
  32. package/dist/cm/format/cmsym/InvalidationEnv.js +13 -13
  33. package/dist/cm/format/cmsym/SymImportEnv.d.ts +9 -9
  34. package/dist/cm/format/cmsym/SymImportEnv.js +9 -9
  35. package/dist/cm/format/cmsym/SymInv.d.ts +8 -8
  36. package/dist/cm/format/cmsym/SymInv.js +15 -15
  37. package/dist/cm/format/cmsym/SymNode.d.ts +85 -85
  38. package/dist/cm/format/cmsym/SymNode.js +577 -577
  39. package/dist/cm/format/cmsym/components/SymBox.d.ts +14 -14
  40. package/dist/cm/format/cmsym/components/SymBox.js +34 -34
  41. package/dist/cm/format/cmsym/components/SymComponent.d.ts +29 -29
  42. package/dist/cm/format/cmsym/components/SymComponent.js +54 -54
  43. package/dist/cm/format/cmsym/components/SymConnector.d.ts +5 -5
  44. package/dist/cm/format/cmsym/components/SymConnector.js +10 -10
  45. package/dist/cm/format/cmsym/components/SymDexObj.d.ts +11 -11
  46. package/dist/cm/format/cmsym/components/SymDexObj.js +10 -10
  47. package/dist/cm/format/cmsym/components/SymGFX.d.ts +11 -11
  48. package/dist/cm/format/cmsym/components/SymGFX.js +20 -20
  49. package/dist/cm/format/cmsym/components/SymGMaterial.d.ts +19 -19
  50. package/dist/cm/format/cmsym/components/SymGMaterial.js +88 -88
  51. package/dist/cm/format/cmsym/components/SymGMaterialSelector.d.ts +12 -12
  52. package/dist/cm/format/cmsym/components/SymGMaterialSelector.js +20 -20
  53. package/dist/cm/format/cmsym/components/SymGetMeshEnv.d.ts +9 -9
  54. package/dist/cm/format/cmsym/components/SymGetMeshEnv.js +9 -9
  55. package/dist/cm/format/cmsym/components/SymLODGroup.d.ts +9 -9
  56. package/dist/cm/format/cmsym/components/SymLODGroup.js +11 -11
  57. package/dist/cm/format/cmsym/components/SymLight.d.ts +8 -8
  58. package/dist/cm/format/cmsym/components/SymLight.js +10 -10
  59. package/dist/cm/format/cmsym/components/SymLines2D.d.ts +5 -5
  60. package/dist/cm/format/cmsym/components/SymLines2D.js +7 -7
  61. package/dist/cm/format/cmsym/components/SymMeasure.d.ts +34 -34
  62. package/dist/cm/format/cmsym/components/SymMeasure.js +158 -158
  63. package/dist/cm/format/cmsym/components/SymMesh.d.ts +29 -29
  64. package/dist/cm/format/cmsym/components/SymMesh.js +130 -130
  65. package/dist/cm/format/cmsym/components/SymMeshLight.d.ts +8 -8
  66. package/dist/cm/format/cmsym/components/SymMeshLight.js +10 -10
  67. package/dist/cm/format/cmsym/components/SymMultiSelector.d.ts +13 -13
  68. package/dist/cm/format/cmsym/components/SymMultiSelector.js +49 -49
  69. package/dist/cm/format/cmsym/components/SymParams.d.ts +4 -4
  70. package/dist/cm/format/cmsym/components/SymParams.js +7 -7
  71. package/dist/cm/format/cmsym/components/SymPlane.d.ts +14 -14
  72. package/dist/cm/format/cmsym/components/SymPlane.js +27 -27
  73. package/dist/cm/format/cmsym/components/SymPlaneDivider.d.ts +4 -4
  74. package/dist/cm/format/cmsym/components/SymPlaneDivider.js +7 -7
  75. package/dist/cm/format/cmsym/components/SymPrimitive2D.d.ts +3 -3
  76. package/dist/cm/format/cmsym/components/SymPrimitive2D.js +3 -3
  77. package/dist/cm/format/cmsym/components/SymProgs.d.ts +4 -4
  78. package/dist/cm/format/cmsym/components/SymProgs.js +7 -7
  79. package/dist/cm/format/cmsym/components/SymProps.d.ts +54 -54
  80. package/dist/cm/format/cmsym/components/SymProps.js +170 -170
  81. package/dist/cm/format/cmsym/components/SymRep.d.ts +13 -13
  82. package/dist/cm/format/cmsym/components/SymRep.js +28 -28
  83. package/dist/cm/format/cmsym/components/SymReps.d.ts +36 -36
  84. package/dist/cm/format/cmsym/components/SymReps.js +229 -229
  85. package/dist/cm/format/cmsym/components/SymShape.d.ts +10 -10
  86. package/dist/cm/format/cmsym/components/SymShape.js +14 -14
  87. package/dist/cm/format/cmsym/components/SymSphere.d.ts +16 -16
  88. package/dist/cm/format/cmsym/components/SymSphere.js +30 -30
  89. package/dist/cm/format/cmsym/components/SymSpotlight.d.ts +8 -8
  90. package/dist/cm/format/cmsym/components/SymSpotlight.js +10 -10
  91. package/dist/cm/format/cmsym/components/SymTags.d.ts +11 -11
  92. package/dist/cm/format/cmsym/components/SymTags.js +20 -20
  93. package/dist/cm/format/cmsym/components/SymText2D.d.ts +4 -4
  94. package/dist/cm/format/cmsym/components/SymText2D.js +8 -8
  95. package/dist/cm/format/cmsym/components/SymText3D.d.ts +4 -4
  96. package/dist/cm/format/cmsym/components/SymText3D.js +8 -8
  97. package/dist/cm/format/cmsym/components/SymTransform.d.ts +23 -23
  98. package/dist/cm/format/cmsym/components/SymTransform.js +101 -101
  99. package/dist/cm/format/cmsym/components/SymUVMapper.d.ts +13 -13
  100. package/dist/cm/format/cmsym/components/SymUVMapper.js +50 -50
  101. package/dist/cm/format/cmsym/components/instantiate.d.ts +2 -2
  102. package/dist/cm/format/cmsym/components/instantiate.js +121 -121
  103. package/dist/cm/format/cmsym/components/legacy.d.ts +7 -7
  104. package/dist/cm/format/cmsym/components/legacy.js +27 -27
  105. package/dist/cm/format/cmsym/components/mesh.d.ts +8 -8
  106. package/dist/cm/format/cmsym/components/mesh.js +28 -28
  107. package/dist/cm/format/cmsym/invalidation.d.ts +4 -4
  108. package/dist/cm/format/cmsym/invalidation.js +72 -72
  109. package/dist/cm/format/dex/DexIRef.d.ts +9 -9
  110. package/dist/cm/format/dex/DexIRef.js +18 -18
  111. package/dist/cm/format/dex/DexInt.d.ts +11 -11
  112. package/dist/cm/format/dex/DexInt.js +18 -18
  113. package/dist/cm/format/dex/DexInternalizedXRef.d.ts +19 -19
  114. package/dist/cm/format/dex/DexInternalizedXRef.js +64 -64
  115. package/dist/cm/format/dex/DexLoader.d.ts +8 -8
  116. package/dist/cm/format/dex/DexLoader.js +12 -12
  117. package/dist/cm/format/dex/DexManager.d.ts +20 -20
  118. package/dist/cm/format/dex/DexManager.js +78 -78
  119. package/dist/cm/format/dex/DexObj.d.ts +15 -15
  120. package/dist/cm/format/dex/DexObj.js +86 -86
  121. package/dist/cm/format/dex/DexReader.d.ts +86 -86
  122. package/dist/cm/format/dex/DexReader.js +492 -492
  123. package/dist/cm/format/dex/DexRef.d.ts +6 -6
  124. package/dist/cm/format/dex/DexRef.js +8 -8
  125. package/dist/cm/format/dex/DexReplacedXRefs.d.ts +8 -8
  126. package/dist/cm/format/dex/DexReplacedXRefs.js +22 -22
  127. package/dist/cm/format/dex/DexURL.d.ts +4 -4
  128. package/dist/cm/format/dex/DexURL.js +5 -5
  129. package/dist/cm/format/dex/DexVersion.d.ts +15 -15
  130. package/dist/cm/format/dex/DexVersion.js +53 -53
  131. package/dist/cm/format/dex/DexXRef.d.ts +18 -18
  132. package/dist/cm/format/dex/DexXRef.js +51 -51
  133. package/dist/cm/format/dex/DexXRefTargetFilter.d.ts +4 -4
  134. package/dist/cm/format/dex/DexXRefTargetFilter.js +5 -5
  135. package/dist/cm/geometry/Angle.d.ts +9 -9
  136. package/dist/cm/geometry/Angle.js +18 -18
  137. package/dist/cm/geometry/AngleF.d.ts +5 -5
  138. package/dist/cm/geometry/AngleF.js +8 -8
  139. package/dist/cm/geometry/Box.d.ts +7 -7
  140. package/dist/cm/geometry/Box.js +9 -9
  141. package/dist/cm/geometry/DetailMask.d.ts +32 -32
  142. package/dist/cm/geometry/DetailMask.js +112 -112
  143. package/dist/cm/geometry/LayerExpr.d.ts +2 -2
  144. package/dist/cm/geometry/LayerExpr.js +2 -2
  145. package/dist/cm/geometry/Matrix22.d.ts +6 -6
  146. package/dist/cm/geometry/Matrix22.js +6 -6
  147. package/dist/cm/geometry/Matrix33.d.ts +42 -42
  148. package/dist/cm/geometry/Matrix33.js +124 -124
  149. package/dist/cm/geometry/Orientation.d.ts +7 -7
  150. package/dist/cm/geometry/Orientation.js +7 -7
  151. package/dist/cm/geometry/Plane.d.ts +8 -8
  152. package/dist/cm/geometry/Plane.js +14 -14
  153. package/dist/cm/geometry/Point.d.ts +18 -18
  154. package/dist/cm/geometry/Point.js +56 -56
  155. package/dist/cm/geometry/Point2D.d.ts +8 -8
  156. package/dist/cm/geometry/Point2D.js +20 -20
  157. package/dist/cm/geometry/PointF.d.ts +11 -11
  158. package/dist/cm/geometry/PointF.js +27 -27
  159. package/dist/cm/geometry/Transform.d.ts +11 -11
  160. package/dist/cm/geometry/Transform.js +61 -61
  161. package/dist/cm/geometry/Transform2D.d.ts +7 -7
  162. package/dist/cm/geometry/Transform2D.js +6 -6
  163. package/dist/cm/io/Semver.d.ts +17 -17
  164. package/dist/cm/io/Semver.js +58 -58
  165. package/dist/index.js +1 -1
  166. package/package.json +4 -4
@@ -1,171 +1,171 @@
1
- import { DexObj } from "../format/dex/DexObj.js";
2
- import { GMaterial3D, GMaterial3DTexture, imageUrlFromDex, textureWrapFromDex } from "./GMaterial3D.js";
3
- // tslint:disable:max-classes-per-file
4
- export class GMaterialClassic extends GMaterial3D {
5
- constructor(log, obj) {
6
- super(log, obj);
7
- if (obj === undefined) {
8
- return;
9
- }
10
- let property = obj.get("diffuse");
11
- if (property instanceof DexObj) {
12
- this.diffuse = new Diffuse3D();
13
- readBaseMaterialProps(log, this.diffuse, property);
14
- const amount = property.get("amount");
15
- if (typeof amount === "number") {
16
- this.diffuse.amount = amount;
17
- }
18
- }
19
- property = obj.get("ambient");
20
- if (property instanceof DexObj) {
21
- this.ambient = new Ambient3D();
22
- readBaseMaterialProps(log, this.ambient, property);
23
- const amount = property.get("amount");
24
- if (typeof amount === "number") {
25
- this.ambient.amount = amount;
26
- }
27
- }
28
- property = obj.get("specular");
29
- if (property instanceof DexObj) {
30
- this.specular = new Specular3D();
31
- readBaseMaterialProps(log, this.specular, property);
32
- const amount = property.get("amount");
33
- const exponent = property.get("exponent");
34
- if (typeof amount === "number") {
35
- this.specular.amount = amount;
36
- }
37
- if (typeof exponent === "number") {
38
- this.specular.exponent = exponent;
39
- }
40
- }
41
- property = obj.get("transparency");
42
- if (property instanceof DexObj) {
43
- const alpha = property.get("alphaThreshold");
44
- if (alpha !== undefined && typeof alpha !== "number") {
45
- throw log.errorAsObject("bad alpha:", alpha);
46
- }
47
- const opacity = property.get("opacity");
48
- if (opacity !== undefined && typeof opacity !== "number") {
49
- throw log.errorAsObject("bad opacity:", opacity);
50
- }
51
- this.transparency = new Transparency3D(alpha, opacity);
52
- readBaseMaterialProps(log, this.transparency, property);
53
- }
54
- property = obj.get("reflection");
55
- if (property instanceof DexObj) {
56
- this.reflection = new Reflection3D();
57
- readBaseMaterialProps(log, this.reflection, property);
58
- const amount = property.get("amount");
59
- if (typeof amount === "number") {
60
- this.reflection.amount = amount;
61
- }
62
- }
63
- property = obj.get("refraction");
64
- if (property instanceof DexObj) {
65
- this.refraction = new Refraction3D();
66
- readBaseMaterialProps(log, this.refraction, property);
67
- const index = property.get("index");
68
- if (typeof index === "number") {
69
- this.refraction.index = index;
70
- }
71
- }
72
- else if (property !== undefined) {
73
- log.warn("material property 'refraction' is of an unexpected type", property);
74
- }
75
- property = obj.get("bump");
76
- if (property instanceof DexObj) {
77
- this.bump = new Bump3D();
78
- readBaseMaterialProps(log, this.bump, property);
79
- const amount = property.get("amount");
80
- const bumpEffectRR = property.get("effectRR");
81
- const texturePrepared = property.get("prepared");
82
- if (typeof amount === "number") {
83
- this.bump.amount = amount;
84
- }
85
- if (typeof bumpEffectRR === "number") {
86
- this.bump.effectRR = bumpEffectRR;
87
- }
88
- if (typeof texturePrepared === "boolean") {
89
- this.bump.prepared = texturePrepared;
90
- }
91
- }
92
- else if (property !== undefined) {
93
- log.warn("material property 'bump' is of an unexpected type", property);
94
- }
95
- }
96
- }
97
- export class GMaterialProp3D extends GMaterial3DTexture {
98
- setTextureUrl(url) {
99
- if (url !== this.textureUrl) {
100
- this._avgTextureColor = undefined;
101
- this.textureUrl = url;
102
- }
103
- }
104
- }
105
- export class Diffuse3D extends GMaterialProp3D {
106
- constructor(amount = 1) {
107
- super(0 /* classicDiffuse */);
108
- this.amount = amount;
109
- }
110
- }
111
- export class Ambient3D extends GMaterialProp3D {
112
- constructor(amount = 1) {
113
- super(1 /* classicAmbient */);
114
- this.amount = amount;
115
- }
116
- }
117
- export class Emission3D extends GMaterialProp3D {
118
- }
119
- export class Specular3D extends GMaterialProp3D {
120
- constructor(exponent, amount = 1) {
121
- super(3 /* classicSpecular */);
122
- this.exponent = exponent;
123
- this.amount = amount;
124
- }
125
- }
126
- export class Transparency3D extends GMaterialProp3D {
127
- constructor(alphaThreshold, opacity) {
128
- super(4 /* classicTransparency */);
129
- this.alphaThreshold = alphaThreshold;
130
- this.opacity = opacity;
131
- }
132
- }
133
- export class Reflection3D extends GMaterialProp3D {
134
- constructor(amount) {
135
- super(5 /* classicReflection */);
136
- this.amount = amount;
137
- }
138
- }
139
- export class Refraction3D extends GMaterialProp3D {
140
- constructor(index) {
141
- super(6 /* classicRefraction */);
142
- this.index = index;
143
- }
144
- }
145
- export class Bump3D extends GMaterialProp3D {
146
- constructor(amount, effectRR, prepared) {
147
- super(7 /* classicBump */);
148
- this.amount = amount;
149
- this.effectRR = effectRR;
150
- this.prepared = prepared;
151
- }
152
- }
153
- function readBaseMaterialProps(log, prop, obj) {
154
- var _a, _b, _c, _d;
155
- const imageUrl = imageUrlFromDex(log, obj);
156
- if (imageUrl !== undefined) {
157
- prop.setTextureUrl(imageUrl);
158
- }
159
- prop.c = obj.get("c");
160
- prop.uScale = (_a = obj.get("uScale")) !== null && _a !== void 0 ? _a : prop.uScale;
161
- prop.vScale = (_b = obj.get("vScale")) !== null && _b !== void 0 ? _b : prop.vScale;
162
- prop.uOffset = (_c = obj.get("uOffset")) !== null && _c !== void 0 ? _c : prop.uOffset;
163
- prop.vOffset = (_d = obj.get("vOffset")) !== null && _d !== void 0 ? _d : prop.vOffset;
164
- const angleF = obj.get("rot");
165
- if (angleF !== undefined) {
166
- prop.rot = angleF.radians;
167
- }
168
- const wrap = textureWrapFromDex(obj);
169
- if (wrap !== undefined)
170
- prop.wrapU = prop.wrapV = wrap;
171
- }
1
+ import { DexObj } from "../format/dex/DexObj.js";
2
+ import { GMaterial3D, GMaterial3DTexture, imageUrlFromDex, textureWrapFromDex } from "./GMaterial3D.js";
3
+ // tslint:disable:max-classes-per-file
4
+ export class GMaterialClassic extends GMaterial3D {
5
+ constructor(log, obj) {
6
+ super(log, obj);
7
+ if (obj === undefined) {
8
+ return;
9
+ }
10
+ let property = obj.get("diffuse");
11
+ if (property instanceof DexObj) {
12
+ this.diffuse = new Diffuse3D();
13
+ readBaseMaterialProps(log, this.diffuse, property);
14
+ const amount = property.get("amount");
15
+ if (typeof amount === "number") {
16
+ this.diffuse.amount = amount;
17
+ }
18
+ }
19
+ property = obj.get("ambient");
20
+ if (property instanceof DexObj) {
21
+ this.ambient = new Ambient3D();
22
+ readBaseMaterialProps(log, this.ambient, property);
23
+ const amount = property.get("amount");
24
+ if (typeof amount === "number") {
25
+ this.ambient.amount = amount;
26
+ }
27
+ }
28
+ property = obj.get("specular");
29
+ if (property instanceof DexObj) {
30
+ this.specular = new Specular3D();
31
+ readBaseMaterialProps(log, this.specular, property);
32
+ const amount = property.get("amount");
33
+ const exponent = property.get("exponent");
34
+ if (typeof amount === "number") {
35
+ this.specular.amount = amount;
36
+ }
37
+ if (typeof exponent === "number") {
38
+ this.specular.exponent = exponent;
39
+ }
40
+ }
41
+ property = obj.get("transparency");
42
+ if (property instanceof DexObj) {
43
+ const alpha = property.get("alphaThreshold");
44
+ if (alpha !== undefined && typeof alpha !== "number") {
45
+ throw log.errorAsObject("bad alpha:", alpha);
46
+ }
47
+ const opacity = property.get("opacity");
48
+ if (opacity !== undefined && typeof opacity !== "number") {
49
+ throw log.errorAsObject("bad opacity:", opacity);
50
+ }
51
+ this.transparency = new Transparency3D(alpha, opacity);
52
+ readBaseMaterialProps(log, this.transparency, property);
53
+ }
54
+ property = obj.get("reflection");
55
+ if (property instanceof DexObj) {
56
+ this.reflection = new Reflection3D();
57
+ readBaseMaterialProps(log, this.reflection, property);
58
+ const amount = property.get("amount");
59
+ if (typeof amount === "number") {
60
+ this.reflection.amount = amount;
61
+ }
62
+ }
63
+ property = obj.get("refraction");
64
+ if (property instanceof DexObj) {
65
+ this.refraction = new Refraction3D();
66
+ readBaseMaterialProps(log, this.refraction, property);
67
+ const index = property.get("index");
68
+ if (typeof index === "number") {
69
+ this.refraction.index = index;
70
+ }
71
+ }
72
+ else if (property !== undefined) {
73
+ log.warn("material property 'refraction' is of an unexpected type", property);
74
+ }
75
+ property = obj.get("bump");
76
+ if (property instanceof DexObj) {
77
+ this.bump = new Bump3D();
78
+ readBaseMaterialProps(log, this.bump, property);
79
+ const amount = property.get("amount");
80
+ const bumpEffectRR = property.get("effectRR");
81
+ const texturePrepared = property.get("prepared");
82
+ if (typeof amount === "number") {
83
+ this.bump.amount = amount;
84
+ }
85
+ if (typeof bumpEffectRR === "number") {
86
+ this.bump.effectRR = bumpEffectRR;
87
+ }
88
+ if (typeof texturePrepared === "boolean") {
89
+ this.bump.prepared = texturePrepared;
90
+ }
91
+ }
92
+ else if (property !== undefined) {
93
+ log.warn("material property 'bump' is of an unexpected type", property);
94
+ }
95
+ }
96
+ }
97
+ export class GMaterialProp3D extends GMaterial3DTexture {
98
+ setTextureUrl(url) {
99
+ if (url !== this.textureUrl) {
100
+ this._avgTextureColor = undefined;
101
+ this.textureUrl = url;
102
+ }
103
+ }
104
+ }
105
+ export class Diffuse3D extends GMaterialProp3D {
106
+ constructor(amount = 1) {
107
+ super(0 /* classicDiffuse */);
108
+ this.amount = amount;
109
+ }
110
+ }
111
+ export class Ambient3D extends GMaterialProp3D {
112
+ constructor(amount = 1) {
113
+ super(1 /* classicAmbient */);
114
+ this.amount = amount;
115
+ }
116
+ }
117
+ export class Emission3D extends GMaterialProp3D {
118
+ }
119
+ export class Specular3D extends GMaterialProp3D {
120
+ constructor(exponent, amount = 1) {
121
+ super(3 /* classicSpecular */);
122
+ this.exponent = exponent;
123
+ this.amount = amount;
124
+ }
125
+ }
126
+ export class Transparency3D extends GMaterialProp3D {
127
+ constructor(alphaThreshold, opacity) {
128
+ super(4 /* classicTransparency */);
129
+ this.alphaThreshold = alphaThreshold;
130
+ this.opacity = opacity;
131
+ }
132
+ }
133
+ export class Reflection3D extends GMaterialProp3D {
134
+ constructor(amount) {
135
+ super(5 /* classicReflection */);
136
+ this.amount = amount;
137
+ }
138
+ }
139
+ export class Refraction3D extends GMaterialProp3D {
140
+ constructor(index) {
141
+ super(6 /* classicRefraction */);
142
+ this.index = index;
143
+ }
144
+ }
145
+ export class Bump3D extends GMaterialProp3D {
146
+ constructor(amount, effectRR, prepared) {
147
+ super(7 /* classicBump */);
148
+ this.amount = amount;
149
+ this.effectRR = effectRR;
150
+ this.prepared = prepared;
151
+ }
152
+ }
153
+ function readBaseMaterialProps(log, prop, obj) {
154
+ var _a, _b, _c, _d;
155
+ const imageUrl = imageUrlFromDex(log, obj);
156
+ if (imageUrl !== undefined) {
157
+ prop.setTextureUrl(imageUrl);
158
+ }
159
+ prop.c = obj.get("c");
160
+ prop.uScale = (_a = obj.get("uScale")) !== null && _a !== void 0 ? _a : prop.uScale;
161
+ prop.vScale = (_b = obj.get("vScale")) !== null && _b !== void 0 ? _b : prop.vScale;
162
+ prop.uOffset = (_c = obj.get("uOffset")) !== null && _c !== void 0 ? _c : prop.uOffset;
163
+ prop.vOffset = (_d = obj.get("vOffset")) !== null && _d !== void 0 ? _d : prop.vOffset;
164
+ const angleF = obj.get("rot");
165
+ if (angleF !== undefined) {
166
+ prop.rot = angleF.radians;
167
+ }
168
+ const wrap = textureWrapFromDex(obj);
169
+ if (wrap !== undefined)
170
+ prop.wrapU = prop.wrapV = wrap;
171
+ }
@@ -1,72 +1,72 @@
1
- import { Logger } from "@configura/web-utilities";
2
- import { ColorF } from "../basic/ColorF.js";
3
- import { DexObj } from "../format/dex/DexObj.js";
4
- import { DexURL } from "../format/dex/DexURL.js";
5
- import { GMaterial3D, GMaterial3DTexture, TextureType } from "./GMaterial3D.js";
6
- export declare class GMaterialPBR extends GMaterial3D {
7
- base?: PBRBase;
8
- emissive?: PBREmissive;
9
- metallic?: PBRMetallic;
10
- normal?: PBRNormal;
11
- occlusion?: PBROcclusion;
12
- opacity?: PBROpacity;
13
- refraction?: PBRRefraction;
14
- roughness?: PBRRoughness;
15
- constructor(log: Logger, obj?: DexObj);
16
- }
17
- export declare type PBRTextureChannel = "r" | "g" | "b" | "a";
18
- export declare type PBRTextureChannels = PBRTextureChannel | "rgb" | "rgba";
19
- export declare type PBROpacityMode = "opaque" | "mask" | "translucent" | "translucentAndMask";
20
- export declare type PBRTextureFilter = "linear" | "nearest";
21
- export declare class PBRTexture extends GMaterial3DTexture {
22
- constructor(type: TextureType, imageUrl: DexURL);
23
- textureUrl: DexURL;
24
- }
25
- export declare class PBRBase {
26
- readonly factor: ColorF;
27
- readonly texture?: PBRTexture | undefined;
28
- constructor(factor: ColorF, texture?: PBRTexture | undefined);
29
- }
30
- export declare class PBREmissive {
31
- readonly factor: ColorF;
32
- readonly texture?: PBRTexture | undefined;
33
- constructor(factor: ColorF, texture?: PBRTexture | undefined);
34
- }
35
- export declare class PBRMetallic {
36
- readonly factor: number;
37
- readonly texture?: PBRTexture | undefined;
38
- readonly channel?: "b" | "r" | undefined;
39
- constructor(factor: number, texture?: PBRTexture | undefined, channel?: "b" | "r" | undefined);
40
- }
41
- export declare class PBRNormal {
42
- readonly scale: number;
43
- readonly texture?: PBRTexture | undefined;
44
- readonly channels?: PBRTextureChannels | undefined;
45
- constructor(scale: number, texture?: PBRTexture | undefined, channels?: PBRTextureChannels | undefined);
46
- }
47
- export declare class PBROcclusion {
48
- readonly strength: number;
49
- readonly texture?: PBRTexture | undefined;
50
- readonly channel?: "a" | "r" | undefined;
51
- constructor(strength: number, // default 0
52
- texture?: PBRTexture | undefined, channel?: "a" | "r" | undefined);
53
- }
54
- export declare class PBROpacity {
55
- readonly factor: number;
56
- readonly mode: PBROpacityMode;
57
- maskThreshold: number;
58
- readonly texture?: PBRTexture | undefined;
59
- readonly channels?: "a" | "r" | undefined;
60
- constructor(factor: number, mode: PBROpacityMode, maskThreshold: number, texture?: PBRTexture | undefined, channels?: "a" | "r" | undefined);
61
- }
62
- export declare class PBRRefraction {
63
- readonly ior: number;
64
- constructor(ior: number);
65
- }
66
- export declare class PBRRoughness {
67
- readonly factor: number;
68
- readonly texture?: PBRTexture | undefined;
69
- readonly channel?: "a" | "g" | undefined;
70
- constructor(factor: number, texture?: PBRTexture | undefined, channel?: "a" | "g" | undefined);
71
- }
1
+ import { Logger } from "@configura/web-utilities";
2
+ import { ColorF } from "../basic/ColorF.js";
3
+ import { DexObj } from "../format/dex/DexObj.js";
4
+ import { DexURL } from "../format/dex/DexURL.js";
5
+ import { GMaterial3D, GMaterial3DTexture, TextureType } from "./GMaterial3D.js";
6
+ export declare class GMaterialPBR extends GMaterial3D {
7
+ base?: PBRBase;
8
+ emissive?: PBREmissive;
9
+ metallic?: PBRMetallic;
10
+ normal?: PBRNormal;
11
+ occlusion?: PBROcclusion;
12
+ opacity?: PBROpacity;
13
+ refraction?: PBRRefraction;
14
+ roughness?: PBRRoughness;
15
+ constructor(log: Logger, obj?: DexObj);
16
+ }
17
+ export declare type PBRTextureChannel = "r" | "g" | "b" | "a";
18
+ export declare type PBRTextureChannels = PBRTextureChannel | "rgb" | "rgba";
19
+ export declare type PBROpacityMode = "opaque" | "mask" | "translucent" | "translucentAndMask";
20
+ export declare type PBRTextureFilter = "linear" | "nearest";
21
+ export declare class PBRTexture extends GMaterial3DTexture {
22
+ constructor(type: TextureType, imageUrl: DexURL);
23
+ textureUrl: DexURL;
24
+ }
25
+ export declare class PBRBase {
26
+ readonly factor: ColorF;
27
+ readonly texture?: PBRTexture | undefined;
28
+ constructor(factor: ColorF, texture?: PBRTexture | undefined);
29
+ }
30
+ export declare class PBREmissive {
31
+ readonly factor: ColorF;
32
+ readonly texture?: PBRTexture | undefined;
33
+ constructor(factor: ColorF, texture?: PBRTexture | undefined);
34
+ }
35
+ export declare class PBRMetallic {
36
+ readonly factor: number;
37
+ readonly texture?: PBRTexture | undefined;
38
+ readonly channel?: "b" | "r" | undefined;
39
+ constructor(factor: number, texture?: PBRTexture | undefined, channel?: "b" | "r" | undefined);
40
+ }
41
+ export declare class PBRNormal {
42
+ readonly scale: number;
43
+ readonly texture?: PBRTexture | undefined;
44
+ readonly channels?: PBRTextureChannels | undefined;
45
+ constructor(scale: number, texture?: PBRTexture | undefined, channels?: PBRTextureChannels | undefined);
46
+ }
47
+ export declare class PBROcclusion {
48
+ readonly strength: number;
49
+ readonly texture?: PBRTexture | undefined;
50
+ readonly channel?: "a" | "r" | undefined;
51
+ constructor(strength: number, // default 0
52
+ texture?: PBRTexture | undefined, channel?: "a" | "r" | undefined);
53
+ }
54
+ export declare class PBROpacity {
55
+ readonly factor: number;
56
+ readonly mode: PBROpacityMode;
57
+ maskThreshold: number;
58
+ readonly texture?: PBRTexture | undefined;
59
+ readonly channels?: "a" | "r" | undefined;
60
+ constructor(factor: number, mode: PBROpacityMode, maskThreshold: number, texture?: PBRTexture | undefined, channels?: "a" | "r" | undefined);
61
+ }
62
+ export declare class PBRRefraction {
63
+ readonly ior: number;
64
+ constructor(ior: number);
65
+ }
66
+ export declare class PBRRoughness {
67
+ readonly factor: number;
68
+ readonly texture?: PBRTexture | undefined;
69
+ readonly channel?: "a" | "g" | undefined;
70
+ constructor(factor: number, texture?: PBRTexture | undefined, channel?: "a" | "g" | undefined);
71
+ }
72
72
  //# sourceMappingURL=GMaterialPBR.d.ts.map