修改三维vr列车模型移动范围贴图,限制vr移动射线范围,修改声音触发

This commit is contained in:
sunzhenyu 2020-10-16 11:34:54 +08:00
parent 9b3ce6f8b7
commit aca48cfbc3
4 changed files with 54 additions and 45 deletions

View File

@ -284,12 +284,7 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
let voicetext = scope.nowstation.name.split(""); let voicetext = scope.nowstation.name.split("");
voiceModel.localVoicePlay("列车即将进站"+voicetext[0]); voiceModel.localVoicePlay("列车即将进站"+voicetext[0]);
if(positionStatus == "topfloor"){
trainControl.sound.pause();
}
if(positionStatus == "downfloor"){
trainControl.sound.pause();
}
vrwebworker.postMessage(stationworket); vrwebworker.postMessage(stationworket);
vrPlane.updataStationMsg(scope.nowstation); vrPlane.updataStationMsg(scope.nowstation);
trainControl.toptrain.position.x = 20000; trainControl.toptrain.position.x = 20000;
@ -326,6 +321,10 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
trainControl.closetraindoor(trainControl.toptrain,event.data.doorCode,positionStatus,"top"); trainControl.closetraindoor(trainControl.toptrain,event.data.doorCode,positionStatus,"top");
// trainLeaveStation("top"); // trainLeaveStation("top");
}else{ }else{
if(positionStatus == "topfloor"){
trainControl.sound.pause();
}
trainControl.toptrain.position.copy(trainControl.toptrain.curve.getPointAt(0.0365)); trainControl.toptrain.position.copy(trainControl.toptrain.curve.getPointAt(0.0365));
trainControl.opentraindoor(trainControl.toptrain,event.data.doorCode,"top"); trainControl.opentraindoor(trainControl.toptrain,event.data.doorCode,"top");
trainControl.toptrain.status = 1; trainControl.toptrain.status = 1;
@ -338,6 +337,9 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
trainControl.closetraindoor(trainControl.downtrain,event.data.doorCode,positionStatus,"down"); trainControl.closetraindoor(trainControl.downtrain,event.data.doorCode,positionStatus,"down");
// trainLeaveStation("down"); // trainLeaveStation("down");
}else{ }else{
if(positionStatus == "downfloor"){
trainControl.sound.pause();
}
trainControl.downtrain.position.copy(trainControl.downtrain.curve.getPointAt(0.961)); trainControl.downtrain.position.copy(trainControl.downtrain.curve.getPointAt(0.961));
trainControl.opentraindoor(trainControl.downtrain,event.data.doorCode,"down"); trainControl.opentraindoor(trainControl.downtrain,event.data.doorCode,"down");
trainControl.downtrain.status = 1; trainControl.downtrain.status = 1;
@ -854,12 +856,13 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
if ( intersections) { if ( intersections) {
// console.log(intersections); // console.log(intersections);
var intersection = intersections[ 0 ]; var intersection = intersections[ 0 ];
if(intersection.distance <3.5){
if(positionStatus != intersection.object.name){ if(positionStatus != intersection.object.name){
positionStatus = intersection.object.name; positionStatus = intersection.object.name;
if(positionStatus == "dm"){ if(positionStatus == "dm"){
scope.scene.add(human); scope.scene.add(human);
trainControl.sound.pause();
vrwebworker.postMessage("takeStation"); vrwebworker.postMessage("takeStation");
} }
if(positionStatus == "topfloor"){ if(positionStatus == "topfloor"){
@ -902,6 +905,8 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
vrwebworker.postMessage(postData); vrwebworker.postMessage(postData);
} }
}
} }
} }
@ -1067,8 +1072,13 @@ export function jl3dFaultDeviceVr(dom,group,skinCode) {
var intersection = intersections[ 0 ]; var intersection = intersections[ 0 ];
// console.log(intersection); // console.log(intersection);
if(intersection.distance <3.5){
var object = intersection.object; var object = intersection.object;
circle.position.set( intersection.point.x, intersection.point.y+0.05, intersection.point.z ); circle.position.set( intersection.point.x, intersection.point.y+0.05, intersection.point.z );
}else{
circle.position.set( 0, 10000, 0 );
}
} }
} }

View File

@ -108,7 +108,6 @@ export function PassflowConnect(jl3dpass,deviceaction,toptrain,downtrain,routegr
if(downtrain.nowcode != data.body[i].code){ if(downtrain.nowcode != data.body[i].code){
downtrain.nowcode = data.body[i].code; downtrain.nowcode = data.body[i].code;
} }
downtrain.position.copy(downtrain.curve.getPointAt(data.body[i].offset)); downtrain.position.copy(downtrain.curve.getPointAt(data.body[i].offset));
}else{ }else{

Binary file not shown.

Binary file not shown.