lythreeframe 1.1.8 → 1.1.10
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
|
@@ -880,11 +880,31 @@ class MaterialAssetPointer extends TAssetPointer {
|
|
|
880
880
|
super(value, referenceCount);
|
|
881
881
|
this.textures = usedTextures;
|
|
882
882
|
}
|
|
883
|
-
|
|
884
|
-
return
|
|
883
|
+
get texturePointers() {
|
|
884
|
+
return this.textures;
|
|
885
885
|
}
|
|
886
|
-
|
|
887
|
-
|
|
886
|
+
setTexture(name, texturePtr) {
|
|
887
|
+
let mat = this.getValue();
|
|
888
|
+
let texture = texturePtr.getValue();
|
|
889
|
+
if (!texture) {
|
|
890
|
+
throw new Error("Texture is null");
|
|
891
|
+
}
|
|
892
|
+
if (!mat) {
|
|
893
|
+
throw new Error("Material is null");
|
|
894
|
+
}
|
|
895
|
+
if (this.textures.has(name)) {
|
|
896
|
+
this.textures.get(name).release();
|
|
897
|
+
this.textures.delete(name);
|
|
898
|
+
}
|
|
899
|
+
try {
|
|
900
|
+
this.textures.set(name, texturePtr);
|
|
901
|
+
this.getValue()[name] = texture;
|
|
902
|
+
texture.addRef();
|
|
903
|
+
mat.needsUpdate = true;
|
|
904
|
+
}
|
|
905
|
+
catch (e) {
|
|
906
|
+
throw e;
|
|
907
|
+
}
|
|
888
908
|
}
|
|
889
909
|
release() {
|
|
890
910
|
for (let texture of this.textures.values()) {
|
package/dist/bundle.esm.js
CHANGED
|
@@ -878,11 +878,31 @@ class MaterialAssetPointer extends TAssetPointer {
|
|
|
878
878
|
super(value, referenceCount);
|
|
879
879
|
this.textures = usedTextures;
|
|
880
880
|
}
|
|
881
|
-
|
|
882
|
-
return
|
|
881
|
+
get texturePointers() {
|
|
882
|
+
return this.textures;
|
|
883
883
|
}
|
|
884
|
-
|
|
885
|
-
|
|
884
|
+
setTexture(name, texturePtr) {
|
|
885
|
+
let mat = this.getValue();
|
|
886
|
+
let texture = texturePtr.getValue();
|
|
887
|
+
if (!texture) {
|
|
888
|
+
throw new Error("Texture is null");
|
|
889
|
+
}
|
|
890
|
+
if (!mat) {
|
|
891
|
+
throw new Error("Material is null");
|
|
892
|
+
}
|
|
893
|
+
if (this.textures.has(name)) {
|
|
894
|
+
this.textures.get(name).release();
|
|
895
|
+
this.textures.delete(name);
|
|
896
|
+
}
|
|
897
|
+
try {
|
|
898
|
+
this.textures.set(name, texturePtr);
|
|
899
|
+
this.getValue()[name] = texture;
|
|
900
|
+
texture.addRef();
|
|
901
|
+
mat.needsUpdate = true;
|
|
902
|
+
}
|
|
903
|
+
catch (e) {
|
|
904
|
+
throw e;
|
|
905
|
+
}
|
|
886
906
|
}
|
|
887
907
|
release() {
|
|
888
908
|
for (let texture of this.textures.values()) {
|
|
@@ -4,8 +4,8 @@ import { TextureAssetPointer } from "./TextureAssetPointer";
|
|
|
4
4
|
export declare class MaterialAssetPointer extends TAssetPointer<Material> {
|
|
5
5
|
protected textures: Map<string, TextureAssetPointer>;
|
|
6
6
|
constructor(value: Material, usedTextures: Map<string, TextureAssetPointer>, referenceCount?: number);
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
get texturePointers(): Map<string, TextureAssetPointer>;
|
|
8
|
+
setTexture(name: string, texturePtr: TextureAssetPointer): void;
|
|
9
9
|
release(): void;
|
|
10
10
|
forceRelease(): void;
|
|
11
11
|
}
|