@shopware-ag/dive 1.10.0 → 1.11.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.
- package/build/dive.cjs +26 -22
- package/build/dive.cjs.map +1 -1
- package/build/dive.d.cts +5 -4
- package/build/dive.d.ts +5 -4
- package/build/dive.js +26 -22
- package/build/dive.js.map +1 -1
- package/package.json +1 -1
- package/src/com/types.ts +5 -4
- package/src/model/Model.ts +25 -18
- package/src/model/__test__/Model.test.ts +4 -3
- package/src/primitive/Primitive.ts +27 -12
- package/src/primitive/__test__/Primitive.test.ts +4 -3
package/build/dive.cjs
CHANGED
|
@@ -1272,26 +1272,26 @@ var DIVEModel = class extends import_three8.Object3D {
|
|
|
1272
1272
|
});
|
|
1273
1273
|
}
|
|
1274
1274
|
SetMaterial(material) {
|
|
1275
|
-
console.error("HERE", this._mesh);
|
|
1276
1275
|
if (!this._material) {
|
|
1277
1276
|
this._material = new import_three8.MeshStandardMaterial();
|
|
1278
1277
|
}
|
|
1279
|
-
this._material.color = new import_three8.Color(material.color);
|
|
1280
|
-
if (material.
|
|
1278
|
+
if (material.color !== void 0) this._material.color = new import_three8.Color(material.color);
|
|
1279
|
+
if (material.map !== void 0) this._material.map = material.map;
|
|
1280
|
+
if (material.roughness !== void 0) this._material.roughness = material.roughness;
|
|
1281
|
+
if (material.roughnessMap !== void 0) {
|
|
1281
1282
|
this._material.roughnessMap = material.roughnessMap;
|
|
1282
|
-
this._material.
|
|
1283
|
-
|
|
1284
|
-
|
|
1283
|
+
if (this._material.roughnessMap) {
|
|
1284
|
+
this._material.roughness = 1;
|
|
1285
|
+
}
|
|
1285
1286
|
}
|
|
1286
|
-
if (material.
|
|
1287
|
+
if (material.metalness !== void 0) this._material.metalness = material.metalness;
|
|
1288
|
+
if (material.metalnessMap !== void 0) {
|
|
1287
1289
|
this._material.metalnessMap = material.metalnessMap;
|
|
1288
|
-
this._material.
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
}
|
|
1292
|
-
if (this._mesh) {
|
|
1293
|
-
this._mesh.material = this._material;
|
|
1290
|
+
if (this._material.metalnessMap) {
|
|
1291
|
+
this._material.metalness = 1;
|
|
1292
|
+
}
|
|
1294
1293
|
}
|
|
1294
|
+
if (this._mesh) this._mesh.material = this._material;
|
|
1295
1295
|
}
|
|
1296
1296
|
SetToWorldOrigin() {
|
|
1297
1297
|
var _a;
|
|
@@ -1484,19 +1484,23 @@ var DIVEPrimitive = class extends import_three10.Object3D {
|
|
|
1484
1484
|
}
|
|
1485
1485
|
SetMaterial(material) {
|
|
1486
1486
|
const primitiveMaterial = this._mesh.material;
|
|
1487
|
-
primitiveMaterial.color = new import_three10.Color(material.color);
|
|
1488
|
-
if (material.
|
|
1487
|
+
if (material.color !== void 0) primitiveMaterial.color = new import_three10.Color(material.color);
|
|
1488
|
+
if (material.map !== void 0) primitiveMaterial.map = material.map;
|
|
1489
|
+
if (material.roughness !== void 0) primitiveMaterial.roughness = material.roughness;
|
|
1490
|
+
if (material.roughnessMap !== void 0) {
|
|
1489
1491
|
primitiveMaterial.roughnessMap = material.roughnessMap;
|
|
1490
|
-
primitiveMaterial.
|
|
1491
|
-
|
|
1492
|
-
|
|
1492
|
+
if (primitiveMaterial.roughnessMap) {
|
|
1493
|
+
primitiveMaterial.roughness = 1;
|
|
1494
|
+
}
|
|
1493
1495
|
}
|
|
1494
|
-
if (material.
|
|
1496
|
+
if (material.metalness !== void 0) primitiveMaterial.metalness = material.metalness;
|
|
1497
|
+
if (material.metalnessMap !== void 0) {
|
|
1495
1498
|
primitiveMaterial.metalnessMap = material.metalnessMap;
|
|
1496
|
-
primitiveMaterial.
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
+
if (primitiveMaterial.metalnessMap) {
|
|
1500
|
+
primitiveMaterial.metalness = 1;
|
|
1501
|
+
}
|
|
1499
1502
|
}
|
|
1503
|
+
if (this._mesh) this._mesh.material = primitiveMaterial;
|
|
1500
1504
|
}
|
|
1501
1505
|
SetToWorldOrigin() {
|
|
1502
1506
|
var _a;
|