Browse Source

fix: 导航bug

ShangHai_LongXiang
高志龙 2 years ago
parent
commit
7b6259ad05
  1. 13
      public/static/qm/MainMap_QM_go.js

13
public/static/qm/MainMap_QM_go.js

@ -3880,12 +3880,7 @@ MainMap_QM.prototype = {
} }
}, },
getlocaleToScreen:function(object,vect){ getlocaleToScreen:function(object,vect){
let standardVec;
if(vect){
standardVec = object.localToWorld(vect).project(Map_QM.camera);
}else{
standardVec = object.localToWorld(new THREE.Vector3()).project(Map_QM.camera);
}
let standardVec = object.localToWorld(vect).project(Map_QM.camera);
const screenX = Math.round(Map_QM.w/2 * standardVec.x + Map_QM.w/2); const screenX = Math.round(Map_QM.w/2 * standardVec.x + Map_QM.w/2);
const screenY = Math.round(Map_QM.h/-2 * standardVec.y + Map_QM.h/2); const screenY = Math.round(Map_QM.h/-2 * standardVec.y + Map_QM.h/2);
return {x:screenX, y:screenY}; return {x:screenX, y:screenY};
@ -5519,7 +5514,6 @@ MainMap_QM.prototype = {
* @param {Object} endN * @param {Object} endN
*/ */
onFindPath: function () { onFindPath: function () {
console.log(Map_QM.forShopArr);
TweenMax.killAll(true); TweenMax.killAll(true);
if (Map_QM.util.overObj.floor == Map_QM.util.selectFloor && Map_QM.util.overObj.xaxis) { if (Map_QM.util.overObj.floor == Map_QM.util.selectFloor && Map_QM.util.overObj.xaxis) {
Map_QM.mapArr[Map_QM.util.overObj.build][Map_QM.util.overObj.floor].setOverSite(Map_QM.util.overObj.xaxis, Map_QM.util.overObj.yaxis,parseInt(Map_QM.util.shopHeight)); Map_QM.mapArr[Map_QM.util.overObj.build][Map_QM.util.overObj.floor].setOverSite(Map_QM.util.overObj.xaxis, Map_QM.util.overObj.yaxis,parseInt(Map_QM.util.shopHeight));
@ -5528,6 +5522,8 @@ MainMap_QM.prototype = {
Map_QM.endIcon && (Map_QM.endIcon.visible = false); Map_QM.endIcon && (Map_QM.endIcon.visible = false);
} }
if (Map_QM.forShopArr.length > 0) { if (Map_QM.forShopArr.length > 0) {
if(pathCameraState == "3D"){
Map_QM.controls.reset();
const postArr = Map_QM.forShopArr[Map_QM.util._indexPathFloor].PathPoint; const postArr = Map_QM.forShopArr[Map_QM.util._indexPathFloor].PathPoint;
const len = postArr.length; const len = postArr.length;
let leftX = 50000, rightX=-50000, topY=50000, bottomY = -50000; let leftX = 50000, rightX=-50000, topY=50000, bottomY = -50000;
@ -5546,6 +5542,9 @@ MainMap_QM.prototype = {
}else{ //按宽度计算 }else{ //按宽度计算
Map_QM.setCameraDist((disc*vw/Map_QM.w)+20, Map_QM.moveMapPosition, Map_QM.drawPathStart); Map_QM.setCameraDist((disc*vw/Map_QM.w)+20, Map_QM.moveMapPosition, Map_QM.drawPathStart);
} }
}else{
Map_QM.drawPathStart();
}
} }
}, },
drawPathStart:function(){ drawPathStart:function(){

Loading…
Cancel
Save