|
@@ -121,12 +121,13 @@
|
|
isIos:false, //是否ios手机。默认不是
|
|
isIos:false, //是否ios手机。默认不是
|
|
currentChangeSpaceId:null, //当前变化的空间id
|
|
currentChangeSpaceId:null, //当前变化的空间id
|
|
styleType:1,
|
|
styleType:1,
|
|
|
|
+ sumArea:0, //总面积
|
|
|
|
+ changeArea:0, //当次变化的面积
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
cancelAnimationFrame(requestId, this.canvas)
|
|
cancelAnimationFrame(requestId, this.canvas)
|
|
this.worker && this.worker.terminate()
|
|
this.worker && this.worker.terminate()
|
|
- // setTimeout(() => {
|
|
|
|
if (this.renderer instanceof THREE.WebGLRenderer) {
|
|
if (this.renderer instanceof THREE.WebGLRenderer) {
|
|
this.renderer.dispose()
|
|
this.renderer.dispose()
|
|
this.renderer.forceContextLoss()
|
|
this.renderer.forceContextLoss()
|
|
@@ -144,7 +145,7 @@
|
|
this.instancedFurList = [];
|
|
this.instancedFurList = [];
|
|
this.wallList = [];
|
|
this.wallList = [];
|
|
TWEEN && TWEEN.removeAll();//清除所有的tween;
|
|
TWEEN && TWEEN.removeAll();//清除所有的tween;
|
|
- // }, 0)
|
|
|
|
|
|
+ console.warn("***beforeDestroy-webgl_rxdz***");
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
console.log("***onLoad-webgl_rxdz***", this.$route.query)
|
|
console.log("***onLoad-webgl_rxdz***", this.$route.query)
|
|
@@ -366,7 +367,7 @@
|
|
cameraNewPosition = {
|
|
cameraNewPosition = {
|
|
x:spaceObj.centerX/100,
|
|
x:spaceObj.centerX/100,
|
|
y:camera.position.y,
|
|
y:camera.position.y,
|
|
- z:-spaceObj.centerY/100,
|
|
|
|
|
|
+ z:-spaceObj.centerY/100 + 0.5,//增加偏差,防止极点翻转问题?不知道为啥会有用
|
|
}
|
|
}
|
|
//新的观察点的位置-取模型的中心点坐标,加上高度,由于模型都是贴地的,所以高度设置为0
|
|
//新的观察点的位置-取模型的中心点坐标,加上高度,由于模型都是贴地的,所以高度设置为0
|
|
targetNewPosition = {
|
|
targetNewPosition = {
|
|
@@ -375,15 +376,20 @@
|
|
z:-spaceObj.centerY/100,
|
|
z:-spaceObj.centerY/100,
|
|
}
|
|
}
|
|
oldUp = camera.up;//俯视状态
|
|
oldUp = camera.up;//俯视状态
|
|
- newUp = camera.up
|
|
|
|
|
|
+ newUp = camera.up;
|
|
|
|
+ // newUp = new THREE.Vector3(0,0,-1);
|
|
// that.cameraLastPosition = cameraNewPosition;//记录下上一次摄像头位置
|
|
// that.cameraLastPosition = cameraNewPosition;//记录下上一次摄像头位置
|
|
// that.controlLastPosition = targetNewPosition;//记录下上一次观察点位置
|
|
// that.controlLastPosition = targetNewPosition;//记录下上一次观察点位置
|
|
|
|
+ // if(cameraNewPosition.x<0){
|
|
|
|
+ // cameraNewPosition.x = 0;
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
console.warn("**moveMeshCenter***",isUserContorl,spaceObj,JSON.stringify(camera.position),JSON.stringify(controls.target)
|
|
console.warn("**moveMeshCenter***",isUserContorl,spaceObj,JSON.stringify(camera.position),JSON.stringify(controls.target)
|
|
,cameraNewPosition,targetNewPosition,JSON.stringify(camera.up))
|
|
,cameraNewPosition,targetNewPosition,JSON.stringify(camera.up))
|
|
tweenCamera(camera.position,controls.target,cameraNewPosition,targetNewPosition,oldUp,newUp,1000);
|
|
tweenCamera(camera.position,controls.target,cameraNewPosition,targetNewPosition,oldUp,newUp,1000);
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
that.showLables = true;
|
|
that.showLables = true;
|
|
|
|
+ // camera.up = new THREE.Vector3(0,1,0);
|
|
// updateLables();
|
|
// updateLables();
|
|
},1001);//动画结束后回复原始状态
|
|
},1001);//动画结束后回复原始状态
|
|
}
|
|
}
|
|
@@ -866,7 +872,10 @@
|
|
// area:12, //正负值 单位平方米
|
|
// area:12, //正负值 单位平方米
|
|
// }
|
|
// }
|
|
curSpaceChange(data){
|
|
curSpaceChange(data){
|
|
- console.warn("***空间面积变化***",this.overChange,data)
|
|
|
|
|
|
+ console.warn("***空间面积变化***",this.overChange,data);
|
|
|
|
+ // let changArea = data.isZoomIn ? parseFloat(data.area.toFixed(2)) : -parseFloat(data.area.toFixed(2));
|
|
|
|
+ // this.changeArea = changArea;//当次变化的面积,有正负值
|
|
|
|
+ // this.sumArea = parseFloat((this.sumArea + changArea).toFixed(2));
|
|
this.overChange = true;//变形开始 防止在形变结束前,再次形变
|
|
this.overChange = true;//变形开始 防止在形变结束前,再次形变
|
|
this.currentChangeSpaceId = data.spaceId
|
|
this.currentChangeSpaceId = data.spaceId
|
|
this.changCurSpaceArea(data);
|
|
this.changCurSpaceArea(data);
|
|
@@ -1581,6 +1590,15 @@
|
|
|
|
|
|
//空间面积等变更后-同步更新其他数据对象
|
|
//空间面积等变更后-同步更新其他数据对象
|
|
updataPageData(){
|
|
updataPageData(){
|
|
|
|
+ let sumArea = 0;
|
|
|
|
+ this.spaceList.forEach(space=>{
|
|
|
|
+ let curSpaceArea = parseFloat((
|
|
|
|
+ (space.spaceWidth * space.spaceHeight) / 10000
|
|
|
|
+ ).toFixed(2));
|
|
|
|
+ sumArea +=curSpaceArea;
|
|
|
|
+ })
|
|
|
|
+ this.changeArea = parseFloat((sumArea - this.sumArea).toFixed(2));
|
|
|
|
+ this.sumArea = parseFloat(sumArea.toFixed(2));
|
|
let str = JSON.stringify(this.spaceList)
|
|
let str = JSON.stringify(this.spaceList)
|
|
//更新当前空间对象
|
|
//更新当前空间对象
|
|
this.curHouseObj.houseJson = str;
|
|
this.curHouseObj.houseJson = str;
|
|
@@ -1590,7 +1608,7 @@
|
|
})
|
|
})
|
|
layoutStruct.houseJson = str;
|
|
layoutStruct.houseJson = str;
|
|
this.currentChangeSpaceId = null;//变化结束后
|
|
this.currentChangeSpaceId = null;//变化结束后
|
|
- console.warn("***curLayoutStruct-updataPageData***",this.curHouseFloor,this.curHouseObj,layoutStruct)
|
|
|
|
|
|
+ console.warn("***curLayoutStruct-updataPageData***",this.changeArea,this.sumArea,this.curHouseFloor,this.curHouseObj,layoutStruct)
|
|
},
|
|
},
|
|
//户型大类发生了变更
|
|
//户型大类发生了变更
|
|
curHouseTypeChange(item){
|
|
curHouseTypeChange(item){
|
|
@@ -1632,8 +1650,9 @@
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
that.loadSpace();
|
|
that.loadSpace();
|
|
}, 100);
|
|
}, 100);
|
|
- console.warn("***curHouseObj***",this.curHouseObj,that.aiData)
|
|
|
|
- this.navbar.title = this.curHouseObj.name + " " + this.curHouseObj.houseArea + "㎡"
|
|
|
|
|
|
+ console.warn("***curHouseObj***",this.curHouseObj,this.aiData)
|
|
|
|
+ this.navbar.title = this.curHouseObj.name + " " + this.curHouseObj.houseArea + "㎡";
|
|
|
|
+ this.sumArea = this.curHouseObj.houseArea;
|
|
},
|
|
},
|
|
async getInitData(){
|
|
async getInitData(){
|
|
let parmas = {
|
|
let parmas = {
|