|
@@ -5295,17 +5295,38 @@ var VisiSet = {
|
|
|
green: "#00c8ae"
|
|
|
},
|
|
|
init: function() {
|
|
|
- this.footIconSizeRatio = Math.max(player.model.size.x, player.model.size.z) / 30;
|
|
|
+ this.footIconSizeRatio = Math.max(player.model.size.x, player.model.size.z) / 25;
|
|
|
|
|
|
this.meshGroup = new THREE.Object3D;
|
|
|
this.meshGroup.name = "setVisible-group"
|
|
|
|
|
|
player.model.add(this.meshGroup)
|
|
|
$("#hotVisible button").on("click", ()=>{
|
|
|
- VisiSet.enterSet(VisiSet.beginSetTagVisible.bind(VisiSet))
|
|
|
-
|
|
|
+ VisiSet.enterSet(VisiSet.beginSetTagVisible.bind(VisiSet))
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ player.on("mode.changing",(from,to)=>{
|
|
|
+ if(to == "panorama" && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)){
|
|
|
+ VisiSet.finishSetPanoVisible()
|
|
|
+ VisiSet.finishSetTagVisible()
|
|
|
+ VisiSet.finishSetPanoLog()
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ player.model.on("floor.changed",(toFloor)=>{
|
|
|
+ if (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog ){
|
|
|
+ VisiSet.changePanoVisi(true, toFloor)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ player.on("view.changed",(e)=>{
|
|
|
+ if(e.cameraChanged && (VisiSet.setPanoVisible || VisiSet.setTagVisible || VisiSet.setPanoLog)){
|
|
|
+ VisiSet.updateFootIconSize();
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
+
|
|
|
this.changeBtn.on("click",()=>{//隐藏与显示该点
|
|
|
if(this.changeBtn.attr("function") == "hide"){
|
|
|
for(let i in this.panoVLines){
|
|
@@ -5330,7 +5351,7 @@ var VisiSet = {
|
|
|
var s = Math.max(-list[1].score*2, 4); //i==1的一定显示
|
|
|
for(var i=1;i<list.length;i++){
|
|
|
if(-list[i].score < s){
|
|
|
- if(ifBlock(this.panoVsetting, list[i].pano)){
|
|
|
+ if(ifBlock(this.panoVsetting, list[i].item)){
|
|
|
list[i].block = true //有阻挡
|
|
|
}
|
|
|
list[i].good = true
|
|
@@ -5338,12 +5359,12 @@ var VisiSet = {
|
|
|
okList || (okList = list.filter(e=>e.good && !e.block));//绝对可以使用的
|
|
|
|
|
|
if(okList.length <2 ){
|
|
|
- if(!ifBlock(this.panoVsetting, list[i].pano)){
|
|
|
+ if(!ifBlock(this.panoVsetting, list[i].item)){
|
|
|
if(okList.length == 0){
|
|
|
okList.push(list[i])
|
|
|
}else{//1
|
|
|
- var lastPos = okList[0].pano.position.clone().sub(this.panoVsetting.position).setY(0);
|
|
|
- var thisPos = list[i].pano.position.clone().sub(this.panoVsetting.position).setY(0);
|
|
|
+ var lastPos = okList[0].item.position.clone().sub(this.panoVsetting.position).setY(0);
|
|
|
+ var thisPos = list[i].item.position.clone().sub(this.panoVsetting.position).setY(0);
|
|
|
if(lastPos.angleTo(thisPos) > Math.PI / 2){
|
|
|
console.log('再加一个 角度'+THREE.Math.radToDeg(lastPos.angleTo(thisPos)))
|
|
|
break;
|
|
@@ -5357,9 +5378,9 @@ var VisiSet = {
|
|
|
}
|
|
|
}
|
|
|
if(okList.length==0){//如果length为0,至少加一个pano, 虽然是遮挡的
|
|
|
- okList.push(list[0].pano)
|
|
|
+ okList.push(list[0].item)
|
|
|
}
|
|
|
- okList.forEach(e=>this.dealPanoVisible(e.pano.id))
|
|
|
+ okList.forEach(e=>this.dealPanoVisible(e.item.id))
|
|
|
|
|
|
console.log(okList)
|
|
|
|
|
@@ -5379,8 +5400,8 @@ var VisiSet = {
|
|
|
player.flyToMode("floorplan", fun);
|
|
|
}
|
|
|
|
|
|
- permitTranMode(false)
|
|
|
- if (!player.modeTran) {
|
|
|
+ permitTranMode(['dollhouse','floorplan'])
|
|
|
+ if ( player.modeTran == void 0) {
|
|
|
player.afterCModeFuc = ()=>{
|
|
|
enter()
|
|
|
}
|
|
@@ -5407,8 +5428,8 @@ var VisiSet = {
|
|
|
this.changePanoVisi(true)
|
|
|
},
|
|
|
|
|
|
- changePanoVisi:function(state){
|
|
|
- var floor = player.model.allFloorsVisible ? 'all' : player.model.currentFloor
|
|
|
+ changePanoVisi:function(state, toFloor){
|
|
|
+ var floor = player.model.allFloorsVisible ? 'all' : (toFloor || player.model.currentFloor)
|
|
|
if(this.setPanoVisible){
|
|
|
if(floor != 'all' && this.panoVsetting && floor != this.panoVsetting.floor){//如果切换到其他楼,取消选中该pano
|
|
|
this.pauseSetPanoVisible('unsaved')
|
|
@@ -5762,43 +5783,7 @@ var VisiSet = {
|
|
|
alert("保存漫游可行失败")
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
- /* var o = {
|
|
|
- name_t: "panoVisible",
|
|
|
- f: this.pauseSetPanoVisible,
|
|
|
- url: Config.prefixEditProPCApi+"/saveLinkPano",
|
|
|
- dialog: i18n.get('设置'),
|
|
|
- data: { data: JSON.stringify(PanoData) }
|
|
|
- }
|
|
|
-
|
|
|
- var dataDeal = uploadsSaving.saveFucforPC(o);
|
|
|
- dataDeal.group[0] = function () {
|
|
|
- //实施:
|
|
|
-
|
|
|
- for (var i in player.panoVTemp) {
|
|
|
- var pano = player.model.panos.index[i];
|
|
|
- pano.seeMarkers = player.panoVTemp[i].seeMarkers;
|
|
|
- pano.neighbourUUIDs = player.panoVTemp[i].neighbourUUIDs;
|
|
|
- pano.neighbourPanos = player.panoVTemp[i].neighbourPanos;
|
|
|
- }
|
|
|
-
|
|
|
- if(!player.model.checkHasNeighbor(player.currentPano)){//currentPano变为孤立点 就要换一个防止飞入
|
|
|
- var list = player.model.panos.sortByScore([function(pano){return player.model.checkHasNeighbor(pano)}],
|
|
|
- [function(pano){return -pano.position.distanceTo(player.currentPano.position)}])
|
|
|
- if(list && list.length){
|
|
|
- player.currentPano = list[0].pano;//找最近的一非孤立点
|
|
|
- player.model.noPanoHasNeighbor = false; //更新状态
|
|
|
- }else{
|
|
|
- player.model.noPanoHasNeighbor = true; //更新状态
|
|
|
- }
|
|
|
- }else{
|
|
|
- player.model.noPanoHasNeighbor = false; //更新状态
|
|
|
- }
|
|
|
-
|
|
|
- dataDeal.done();
|
|
|
- player.model.updateFootIconSize(player.cameraControls.activeControl)//更新一下center大小 写在最后
|
|
|
- } */
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
|
|
|
searchNeib: function(panoId) {
|
|
@@ -5939,10 +5924,9 @@ var VisiSet = {
|
|
|
|
|
|
showFootIcons: function(pano, isPanovisible) {
|
|
|
if (!this.footIcons) {
|
|
|
- footTex1 = Texture.load("images/edit/End_128.png");
|
|
|
- //Store.FootIcon);
|
|
|
+ footTex1 = Texture.load("images/edit/End_128.png");
|
|
|
footTex2 = Texture.load("images/edit/End_unable_128.png");
|
|
|
- //Store.FootIcon_unable);
|
|
|
+ footTex1.anisotropy = footTex2.anisotropy = 4
|
|
|
this.footIcons = [];
|
|
|
var scale = 0.4;
|
|
|
|
|
@@ -5971,7 +5955,7 @@ var VisiSet = {
|
|
|
name: "footIcon"
|
|
|
})
|
|
|
var foot = new THREE.Mesh(geo,mat)
|
|
|
- foot.position.copy( panos.index[r].position.clone().setY(player.model.center.y) ) /* panos.index[r].floorPosition.clone() *///不用floorPosition是因为有出现和position的水平位置不一样的点,一般是偏移很远的不可见点,拍摄的bug
|
|
|
+ foot.position.copy( panos.index[r].floorPosition.clone() ) /* panos.index[r].floorPosition.clone() *///不用floorPosition是因为有出现和position的水平位置不一样的点,一般是偏移很远的不可见点,拍摄的bug
|
|
|
|
|
|
foot.lookAt(foot.position.clone().add(new THREE.Vector3(0,1,0)));
|
|
|
foot.name = panos.index[r].id;
|
|
@@ -5982,9 +5966,8 @@ var VisiSet = {
|
|
|
this.footIcons.push(foot)
|
|
|
}
|
|
|
}
|
|
|
- //this.changePanoVisi(true)
|
|
|
- for (var i = 0; i < this.footIcons.length; i++) {
|
|
|
- //this.footIcons[i].visible = true;
|
|
|
+
|
|
|
+ for (var i = 0; i < this.footIcons.length; i++) {
|
|
|
this.changeFIconState(this.footIcons[i], false)
|
|
|
var panos = player.model.panos;
|
|
|
if (isPanovisible) {
|
|
@@ -6085,19 +6068,29 @@ var VisiSet = {
|
|
|
|
|
|
updateFootIconSize: function() {
|
|
|
//根据相机位置 改变footIcon大小,使在范围内看到的热点大小一致,防止太小点击不到
|
|
|
- if (!this.footIcons)
|
|
|
- return;
|
|
|
- var s = player.cameraControls.controls.floorplan.absoluteScale * 2.8
|
|
|
- s = THREE.Math.clamp(s, 0.5 * this.footIconSizeRatio, 1.4 * this.footIconSizeRatio);
|
|
|
- this.footIcons.forEach(function(f) {
|
|
|
- try {
|
|
|
-
|
|
|
+ if (!this.footIcons) return;
|
|
|
+
|
|
|
+ if(player.mode == 'floorplan'){
|
|
|
+ var s = player.cameraControls.controls.floorplan.absoluteScale * 2.8
|
|
|
+ s = THREE.Math.clamp(s, 0.5 * this.footIconSizeRatio, 1.4 * this.footIconSizeRatio);
|
|
|
+ this.footIcons.forEach(function(f) {
|
|
|
+ try {
|
|
|
+ f.scale.copy(f.oriScale).multiplyScalar(s);
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ let maxDis = 7, maxScale = 2 * this.footIconSizeRatio, k = maxScale / maxDis
|
|
|
+ this.footIcons.forEach(function(f) {
|
|
|
+ let s
|
|
|
+ let dis = f.position.distanceTo(player.position)
|
|
|
+ if(dis >= maxDis) s = maxScale
|
|
|
+ else s = dis * k
|
|
|
f.scale.copy(f.oriScale).multiplyScalar(s);
|
|
|
-
|
|
|
- } catch (e) {
|
|
|
- console.log(e)
|
|
|
- }
|
|
|
- })
|
|
|
+ //f.quaternion.copy(player.camera.quaternion)
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
|
|
@@ -6122,9 +6115,7 @@ var VisiSet = {
|
|
|
|
|
|
player.model.panos.list.forEach(pano2=>{
|
|
|
if(pano1 == pano2)return
|
|
|
- if(pano1.id == '9'&& pano2.id == '0'){
|
|
|
- console.log(1)
|
|
|
- }
|
|
|
+
|
|
|
var visiNew = !ifBlock(pano1,pano2)
|
|
|
var visiOld = !!(this.panoVLines[pano2.id] && this.panoVLines[pano2.id].visible)
|
|
|
if(visiNew != visiOld){
|
|
@@ -6262,28 +6253,7 @@ var VisiSet = {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- /* saveTagVisibles : function () { //保存到服务器
|
|
|
- if (this.tagVsetting) this.saveLastTagVi(this.tagVsetting); //获取最后设置的那个热点的改动
|
|
|
- //可能出现数据没变但保存的情况。比如先改变了然后切换别的热点但切换回来时又改回来。
|
|
|
- var tags = [];
|
|
|
- for (var i in this.tagVTemp) {
|
|
|
- tags.push({
|
|
|
- sid: i,
|
|
|
- value: this.tagVTemp[i]//turnToPanoIndex(this.tagVTemp[i])
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if (tags.length == 0) {//没有需要保存的改动
|
|
|
-
|
|
|
- this.finishSetTagVisible()
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- return tags;
|
|
|
- } */
|
|
|
-
|
|
|
- //afterSaveTagVisibles : function(){
|
|
|
+
|
|
|
saveTagVisibles: function() {
|
|
|
if (this.tagVsetting)
|
|
|
this.saveLastTagVi(this.tagVsetting);
|
|
@@ -6387,8 +6357,26 @@ var VisiSet = {
|
|
|
|
|
|
|
|
|
|
|
|
-function permitTranMode(state) {
|
|
|
- state ? $(".pinBottom.left").removeClass('hide') : $(".pinBottom.left").addClass('hide');
|
|
|
+function permitTranMode(state ) {
|
|
|
+ if(state instanceof Array){//仅显示state包含的模式
|
|
|
+ $(".pinBottom.left").removeClass('hide')
|
|
|
+ $(".pinBottom.left .viewContainer>*:not(#gui-modes-map)").addClass('hide');
|
|
|
+ $(".pinBottom.left #gui-modes-map>*").addClass('hide');
|
|
|
+ //注:panorama需转为inside
|
|
|
+ state.forEach(m=> $(".pinBottom.left #gui-modes-"+m).removeClass('hide'))
|
|
|
+ player.roomLebelClickUnabled = true
|
|
|
+ }else{
|
|
|
+ if(state){
|
|
|
+ player.roomLebelClickUnabled = false
|
|
|
+ $(".pinBottom.left").removeClass('hide'),
|
|
|
+ $(".pinBottom.left .viewContainer>*").removeClass('hide') ,
|
|
|
+ $(".pinBottom.left #gui-modes-map>*").removeClass('hide')
|
|
|
+ }else{
|
|
|
+ player.roomLebelClickUnabled = true
|
|
|
+ $(".pinBottom.left").addClass('hide');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //一旦存在有隐藏的模式,必定会隐藏导览等其他按钮。
|
|
|
}
|
|
|
|
|
|
|