|
@@ -256,17 +256,17 @@ export default {
|
|
|
|
|
|
// console.log("要加载的模型数据", item.modelName, layoutModel)
|
|
|
if (layoutModel && layoutModel.url) {//该数据存在模型地址
|
|
|
- let object = realFurnitureArr.find(it=>it.url==layoutModel.url);
|
|
|
+ //说明当前模型存在精简模型对象,则应该使用精简模型数据
|
|
|
+ if(this.type ==2 && globlShowModel.includes(layoutModel.modelName + this.nextString)){
|
|
|
+ if(!layoutModel.url.includes(this.nextString)){
|
|
|
+ let idx = layoutModel.url.lastIndexOf('.');
|
|
|
+ layoutModel.url = layoutModel.url.substr(0,idx) + this.nextString + layoutModel.url.substr(idx);//修改为精简模型地址
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let object = realFurnitureArr.find(it=>(it.url==layoutModel.url));
|
|
|
//列表中还没有这个数据
|
|
|
if(!object){
|
|
|
let url = layoutModel.url;
|
|
|
- if(this.type==2){//全局精简模型;需要的是所有空间的模型
|
|
|
- //说明当前模型存在精简模型对象,则应该使用精简模型数据
|
|
|
- if(globlShowModel.includes(layoutModel.modelName + this.nextString)){
|
|
|
- let idx = layoutModel.url.lastIndexOf('.');
|
|
|
- url = url.substr(0,idx) + this.nextString + url.substr(idx)
|
|
|
- }
|
|
|
- }
|
|
|
let it = {
|
|
|
url:url,
|
|
|
name:layoutModel.modelName,
|
|
@@ -307,9 +307,12 @@ export default {
|
|
|
resolve();
|
|
|
}else{
|
|
|
//不在白名单里面的,不加载
|
|
|
- if(this.type==2 && !globlShowModel.includes(realData.name)){
|
|
|
- resolve();
|
|
|
- return false;
|
|
|
+ if(this.type==2){
|
|
|
+ if(!globlShowModel.includes(realData.name)
|
|
|
+ && !globlShowModel.includes(realData.name + this.nextString)){
|
|
|
+ resolve();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
that.loader.setDRACOLoader(this.dracoLoader);
|
|
|
that.loader.load(realData.url, ( gltf ) => {
|
|
@@ -707,7 +710,7 @@ export default {
|
|
|
|
|
|
}
|
|
|
|
|
|
- console.log("模型计算位置x--", cubeInfo.isStepAsideLeft, cubeInfo.isStepAsideRight)
|
|
|
+ // console.log("模型计算位置x--", cubeInfo.isStepAsideLeft, cubeInfo.isStepAsideRight)
|
|
|
|
|
|
if (cubeInfo.isStepAsideLeft == 'true' && cubeInfo.isStepAsideRight == 'true') {
|
|
|
// console.log("宽度拉伸11111", spaceWidth / modelWidth)
|
|
@@ -732,9 +735,8 @@ export default {
|
|
|
positionX += parseFloat(cubeInfo.marginLeft) / 2;
|
|
|
positionX -= parseFloat(cubeInfo.marginRight) / 2;
|
|
|
}
|
|
|
- // console.log("模型计算位置" , parseFloat(cubeInfo.rotation))
|
|
|
|
|
|
- console.log("模型计算位置--", spaceWidth, modelWidth, scaleX, cubeInfo)
|
|
|
+ // console.log("模型计算位置--", spaceWidth, modelWidth, scaleX, cubeInfo)
|
|
|
// 计算缩放
|
|
|
if (parseFloat(cubeInfo.rotation) == 90 || parseFloat(cubeInfo.rotation) == -90) {
|
|
|
scaleX = spaceWidth / modelWidth;
|
|
@@ -743,7 +745,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
|
|
|
- console.log("模型计算位置--", spaceWidth, modelWidth, scaleX, cubeInfo)
|
|
|
+ // console.log("模型计算位置--", spaceWidth, modelWidth, scaleX, cubeInfo)
|
|
|
|
|
|
}
|
|
|
|
|
@@ -902,7 +904,7 @@ export default {
|
|
|
|
|
|
}
|
|
|
// console.log("模型计算位置--", positionX, positionY)
|
|
|
- console.log("模型计算位置", cubeInfo, centerX, centerY, spaceWidth, spaceHeight, modelWidth, modelHeight, spaceId, scaleX, scaleY, positionX, positionY, cubeInfo.modelName)
|
|
|
+ // console.log("模型计算位置", cubeInfo, centerX, centerY, spaceWidth, spaceHeight, modelWidth, modelHeight, spaceId, scaleX, scaleY, positionX, positionY, cubeInfo.modelName)
|
|
|
let oldPosition = new THREE.Vector3();//当前几何体的位置参数
|
|
|
oldPosition.copy(cube.position);
|
|
|
let oldScale = new THREE.Vector3();//当前几何体的位置参数
|
|
@@ -939,7 +941,7 @@ export default {
|
|
|
//更新家具模型到页面中
|
|
|
updateInfo(cube,oldPosition,oldScale){
|
|
|
const ssss = cube.scale.x / oldScale.x
|
|
|
- console.log("XXXXXXXXXXXXXXXXX", cube, oldPosition,oldScale, ssss)
|
|
|
+ // console.log("XXXXXXXXXXXXXXXXX", cube, oldPosition,oldScale, ssss)
|
|
|
let lay = this.gltfLayouts.find(it=>it.uniId==cube.uniId);
|
|
|
if(cube.instancedMeshIndexList && cube.instancedMeshIndexList.length>0){
|
|
|
cube.instancedMeshIndexList.forEach(item=>{
|