lythreeframe 1.0.36 → 1.0.37
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/bundle.cjs.js
CHANGED
|
@@ -709,7 +709,7 @@ class MeshComponent extends SceneComponent {
|
|
|
709
709
|
if (mat)
|
|
710
710
|
mats.push(mat);
|
|
711
711
|
});
|
|
712
|
-
return mats;
|
|
712
|
+
return mats.length > 1 ? mats : mats[0];
|
|
713
713
|
}
|
|
714
714
|
get materialPtr() {
|
|
715
715
|
return this.materialPtr;
|
|
@@ -740,7 +740,8 @@ class MeshComponent extends SceneComponent {
|
|
|
740
740
|
elem.addRef();
|
|
741
741
|
});
|
|
742
742
|
if (this.threeObject) {
|
|
743
|
-
|
|
743
|
+
if (mats.length > 0)
|
|
744
|
+
this.threeObject.material = Array.isArray(newMat) ? mats[0] : mats;
|
|
744
745
|
}
|
|
745
746
|
this._materialPtr = matPtrs;
|
|
746
747
|
}
|
|
@@ -752,7 +753,7 @@ class MeshComponent extends SceneComponent {
|
|
|
752
753
|
if (ptr)
|
|
753
754
|
matPtrs.push(ptr);
|
|
754
755
|
});
|
|
755
|
-
let newMesh = new webgpu.Mesh(geometry,
|
|
756
|
+
let newMesh = new webgpu.Mesh(geometry, material);
|
|
756
757
|
super(app, newMesh);
|
|
757
758
|
this.obj = null;
|
|
758
759
|
this._geometryPtr = app.assetManager.addGeometryAsset(geometry);
|
package/dist/bundle.esm.js
CHANGED
|
@@ -707,7 +707,7 @@ class MeshComponent extends SceneComponent {
|
|
|
707
707
|
if (mat)
|
|
708
708
|
mats.push(mat);
|
|
709
709
|
});
|
|
710
|
-
return mats;
|
|
710
|
+
return mats.length > 1 ? mats : mats[0];
|
|
711
711
|
}
|
|
712
712
|
get materialPtr() {
|
|
713
713
|
return this.materialPtr;
|
|
@@ -738,7 +738,8 @@ class MeshComponent extends SceneComponent {
|
|
|
738
738
|
elem.addRef();
|
|
739
739
|
});
|
|
740
740
|
if (this.threeObject) {
|
|
741
|
-
|
|
741
|
+
if (mats.length > 0)
|
|
742
|
+
this.threeObject.material = Array.isArray(newMat) ? mats[0] : mats;
|
|
742
743
|
}
|
|
743
744
|
this._materialPtr = matPtrs;
|
|
744
745
|
}
|
|
@@ -750,7 +751,7 @@ class MeshComponent extends SceneComponent {
|
|
|
750
751
|
if (ptr)
|
|
751
752
|
matPtrs.push(ptr);
|
|
752
753
|
});
|
|
753
|
-
let newMesh = new Mesh(geometry,
|
|
754
|
+
let newMesh = new Mesh(geometry, material);
|
|
754
755
|
super(app, newMesh);
|
|
755
756
|
this.obj = null;
|
|
756
757
|
this._geometryPtr = app.assetManager.addGeometryAsset(geometry);
|
|
@@ -10,7 +10,7 @@ export declare class MeshComponent extends SceneComponent {
|
|
|
10
10
|
set geometry(geo: BufferGeometry);
|
|
11
11
|
get geometryPtr(): TAssetPointer<BufferGeometry>;
|
|
12
12
|
set geometryPtr(geo: TAssetPointer<BufferGeometry>);
|
|
13
|
-
get material(): Material[];
|
|
13
|
+
get material(): Material | Material[];
|
|
14
14
|
get materialPtr(): TAssetPointer<Material>[];
|
|
15
15
|
set material(newMat: Material | Material[]);
|
|
16
16
|
set materialPtr(newMat: TAssetPointer<Material> | TAssetPointer<Material>[]);
|