|
@@ -113,8 +113,15 @@ export default {
|
|
|
const planeMesh = new THREE.Mesh(planeGeometry, planeMaterial)
|
|
|
planeMesh.rotation.x = Math.PI / 2 ; // 旋转 180 度
|
|
|
planeMesh.position.set(positionX, 2.8, -positionY);
|
|
|
- planeMesh.userType = "mesh";
|
|
|
+ planeMesh.userType = "mesh"
|
|
|
+ const spaceObj = {
|
|
|
+ spaceId:obj.spaceId,
|
|
|
+ spaceWidth:obj.spaceWidth,
|
|
|
+ spaceHeight:obj.spaceHeight
|
|
|
+ }
|
|
|
+ planeMesh.userData = spaceObj;
|
|
|
that.scene.add(planeMesh);
|
|
|
+ that.gltfSpaceRoofs.push(planeMesh);
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -133,6 +140,11 @@ export default {
|
|
|
texture.wrapT = THREE.RepeatWrapping;
|
|
|
|
|
|
list && list.forEach(obj=>{
|
|
|
+ // 暂时手动过滤 2楼 儿童房和次卫 不添加草地
|
|
|
+ if((obj.spaceId == 582 && obj.spaceName == "儿童房") || (obj.spaceId == 388 && obj.spaceName == "次卫")){
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
let positionX = obj.centerX / 100;
|
|
|
let positionY = obj.centerY / 100;
|
|
|
let scaleX = obj.spaceWidth / 100;
|
|
@@ -322,6 +334,25 @@ export default {
|
|
|
// 开始动画
|
|
|
tween.start();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ // 屋顶尺寸调整
|
|
|
+ const cubeRoof = this.gltfSpaceRoofs.find((item)=>{
|
|
|
+ return item.userData.spaceId == curSpace.spaceId;
|
|
|
+ })
|
|
|
+ if(cubeRoof){
|
|
|
+ let roofScaleX = curSpace.spaceObj.spaceWidth / cubeRoof.userData.spaceWidth
|
|
|
+ let roofScaleY = curSpace.spaceObj.spaceHeight / cubeRoof.userData.spaceHeight
|
|
|
+ console.log("屋顶尺寸变化", curSpace.spaceObj, cubeRoof, roofScaleX, roofScaleY)
|
|
|
+ // cubeRoof.scale.x = toScaleX / scaleX;
|
|
|
+ // cubeRoof.scale.z = 0.5;
|
|
|
+ // cubeRoof.position.x = toPx;
|
|
|
+ // cubeRoof.position.z = toPz;
|
|
|
+ cubeRoof.scale.set(roofScaleX,roofScaleY,1);//缩小为原来0.5倍
|
|
|
+ cubeRoof.position.x = toPx;
|
|
|
+ cubeRoof.position.z = toPz;
|
|
|
+ // cubeRoof.position.set(toPx - x, 0, 1);
|
|
|
+ }
|
|
|
},
|
|
|
//所有空间整体缩放-同时同步到数据里面
|
|
|
allSpaceScale(){
|