@shopware-ag/dive 1.10.0 → 1.12.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 +40 -19
- package/build/dive.cjs.map +1 -1
- package/build/dive.d.cts +7 -4
- package/build/dive.d.ts +7 -4
- package/build/dive.js +40 -19
- package/build/dive.js.map +1 -1
- package/package.json +1 -1
- package/src/com/types.ts +7 -4
- package/src/model/Model.ts +44 -15
- package/src/model/__test__/Model.test.ts +6 -3
- package/src/primitive/Primitive.ts +27 -12
- package/src/primitive/__test__/Primitive.test.ts +4 -3
package/build/dive.cjs
CHANGED
|
@@ -1272,25 +1272,42 @@ 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
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1278
|
+
if (material.vertexColors !== void 0) {
|
|
1279
|
+
this._material.vertexColors = material.vertexColors;
|
|
1280
|
+
}
|
|
1281
|
+
if (material.color !== void 0) {
|
|
1282
|
+
this._material.color = new import_three8.Color(material.color);
|
|
1283
|
+
}
|
|
1284
|
+
if (material.map !== void 0) {
|
|
1285
|
+
this._material.map = material.map;
|
|
1286
|
+
}
|
|
1287
|
+
if (material.normalMap !== void 0) {
|
|
1288
|
+
this._material.normalMap = material.normalMap;
|
|
1289
|
+
}
|
|
1290
|
+
if (material.roughness !== void 0) {
|
|
1284
1291
|
this._material.roughness = material.roughness;
|
|
1285
1292
|
}
|
|
1286
|
-
if (material.
|
|
1287
|
-
this._material.
|
|
1288
|
-
this._material.
|
|
1289
|
-
|
|
1293
|
+
if (material.roughnessMap !== void 0) {
|
|
1294
|
+
this._material.roughnessMap = material.roughnessMap;
|
|
1295
|
+
if (this._material.roughnessMap) {
|
|
1296
|
+
this._material.roughness = 1;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
if (material.metalness !== void 0) {
|
|
1290
1300
|
this._material.metalness = material.metalness;
|
|
1291
1301
|
}
|
|
1302
|
+
if (material.metalnessMap !== void 0) {
|
|
1303
|
+
this._material.metalnessMap = material.metalnessMap;
|
|
1304
|
+
if (this._material.metalnessMap) {
|
|
1305
|
+
this._material.metalness = 1;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1292
1308
|
if (this._mesh) {
|
|
1293
1309
|
this._mesh.material = this._material;
|
|
1310
|
+
this._mesh.material.needsUpdate = true;
|
|
1294
1311
|
}
|
|
1295
1312
|
}
|
|
1296
1313
|
SetToWorldOrigin() {
|
|
@@ -1484,19 +1501,23 @@ var DIVEPrimitive = class extends import_three10.Object3D {
|
|
|
1484
1501
|
}
|
|
1485
1502
|
SetMaterial(material) {
|
|
1486
1503
|
const primitiveMaterial = this._mesh.material;
|
|
1487
|
-
primitiveMaterial.color = new import_three10.Color(material.color);
|
|
1488
|
-
if (material.
|
|
1504
|
+
if (material.color !== void 0) primitiveMaterial.color = new import_three10.Color(material.color);
|
|
1505
|
+
if (material.map !== void 0) primitiveMaterial.map = material.map;
|
|
1506
|
+
if (material.roughness !== void 0) primitiveMaterial.roughness = material.roughness;
|
|
1507
|
+
if (material.roughnessMap !== void 0) {
|
|
1489
1508
|
primitiveMaterial.roughnessMap = material.roughnessMap;
|
|
1490
|
-
primitiveMaterial.
|
|
1491
|
-
|
|
1492
|
-
|
|
1509
|
+
if (primitiveMaterial.roughnessMap) {
|
|
1510
|
+
primitiveMaterial.roughness = 1;
|
|
1511
|
+
}
|
|
1493
1512
|
}
|
|
1494
|
-
if (material.
|
|
1513
|
+
if (material.metalness !== void 0) primitiveMaterial.metalness = material.metalness;
|
|
1514
|
+
if (material.metalnessMap !== void 0) {
|
|
1495
1515
|
primitiveMaterial.metalnessMap = material.metalnessMap;
|
|
1496
|
-
primitiveMaterial.
|
|
1497
|
-
|
|
1498
|
-
|
|
1516
|
+
if (primitiveMaterial.metalnessMap) {
|
|
1517
|
+
primitiveMaterial.metalness = 1;
|
|
1518
|
+
}
|
|
1499
1519
|
}
|
|
1520
|
+
if (this._mesh) this._mesh.material = primitiveMaterial;
|
|
1500
1521
|
}
|
|
1501
1522
|
SetToWorldOrigin() {
|
|
1502
1523
|
var _a;
|