修改三维vr下gui面板点击

This commit is contained in:
sunzhenyu 2020-08-13 15:58:40 +08:00
parent 165a84da5a
commit 6294b02990

View File

@ -594,6 +594,62 @@ export function Jl3dfaultdeviceVR(dom,group,token,skinCode) {
if(vrPlaneStatus){
var intersection = clickGui[ 0 ];
var object = intersection.object;
if(object.name == "buttonHome"){
vrPlane.homeButtonClick();
}
if(object.name == "buttonStationList"){
vrPlane.stationListButtonClick();
}
if(object.name == "buttonFaultList"){
vrPlane.faultListButtonClick();
}
// if(object.name == "buttonPrevious"){
// vrPlane.previousButtonClick();
// }
//
// if(object.name == "buttonNext"){
// vrPlane.nextButtonClick();
// }
if(object.name == "stationList"){
for(let i=0,leni=stationList.length;i<leni;i++){
if(stationList[i].code == object.code){
if(scope.nowstation.inside != stationList[i].inside){
if(stationList[i].inside == true){
scope.scene.remove(scope.nowStationModel);
scope.nowStationModel = scope.modelmanager.stationOut.mesh;
scope.scene.add(scope.nowStationModel);
}else{
scope.scene.remove(scope.nowStationModel);
scope.nowStationModel = scope.modelmanager.stationIn.mesh;
scope.scene.add(scope.nowStationModel);
}
}
scope.nowstation = stationList[i];
vrPlane.updataStationMsg(scope.nowstation);
scope.nowStationModel.getObjectByName("zhantaiming").material.map = scope.stationtexture[scope.nowstation.code];
scope.nowStationModel.getObjectByName("zhantaiming").material.map.needsUpdate = true;
i = leni;
}
}
}
if(object.name == "faultList"){
for(let i=0,leni=faultList.length;i<leni;i++){
if(faultList[i].code == object.code){
nowdevice = faultList[i];
vrPlane.updataDeviceFaultMsg(faultList[i]);
i = leni;
}
}
}
if(object.name == "shebeijian"){
human.position.set( -199.90, 0.20+0.6, -5.76 );
}