This commit is contained in:
@@ -64,7 +64,7 @@ export default{
|
|||||||
},
|
},
|
||||||
computed:{
|
computed:{
|
||||||
forRendering() {
|
forRendering() {
|
||||||
return this.$p.objectTypes.find(t=> t.value == this.obj?.type)?.render
|
return this.$p.objectTypes.find(t=> t.value == this.obj?.type)?.render || this.obj?.asset?.name?.endsWith('ktx2')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
@@ -74,7 +74,12 @@ export default{
|
|||||||
engine.ambientLight.intensity = 25;
|
engine.ambientLight.intensity = 25;
|
||||||
if (this.obj.type == 'panorama2d') {
|
if (this.obj.type == 'panorama2d') {
|
||||||
await engine.loadPanorama(this.obj.asset.name);
|
await engine.loadPanorama(this.obj.asset.name);
|
||||||
} else {
|
} else if(this.obj.asset.name.endsWith('ktx2')){
|
||||||
|
let tx = await engine.loadTexture(this.obj.asset.name);
|
||||||
|
let k = Math.min(window.innerHeight / tx.image.height, 1);
|
||||||
|
engine.resize(tx.image.width * k, tx.image.height * k);
|
||||||
|
engine.scene.background = tx;
|
||||||
|
}else{
|
||||||
let gltf = await engine.load(this.obj.asset.name);
|
let gltf = await engine.load(this.obj.asset.name);
|
||||||
this.loadedAsset = gltf;
|
this.loadedAsset = gltf;
|
||||||
this.animations = gltf.animations.map(a => ({
|
this.animations = gltf.animations.map(a => ({
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export default {
|
|||||||
return this.$route.params?.id;
|
return this.$route.params?.id;
|
||||||
},
|
},
|
||||||
forRendering() {
|
forRendering() {
|
||||||
return this.$p.objectTypes.find(t=> t.value == this.object?.type)?.render
|
return this.$p.objectTypes.find(t=> t.value == this.object?.type)?.render || this.object?.asset?.name?.endsWith('ktx2')
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
Reference in New Issue
Block a user