瓶中沙 2024-01-09 19:37:29 +08:00
parent aa332f38c6
commit 3b8d73a47b
1 changed files with 7 additions and 9 deletions

View File

@ -685,24 +685,21 @@ const check = () => {
duration: 10,
ease: 'power1.inOut',
onComplete: () => {
if (checkindex == romeObj.length) { //
checkComplete();
}
check()
}
});
var pos1 = new THREE.Vector3( camera.position );
console.log(12354, pos1);
var pos2 = new THREE.Vector3( checkPosition );
console.log(54321, pos2);
var distance = pos1.distanceTo(pos2);
console.log(12354, distance);
console.log(0, distance);
let nextObj;
if (checkindex == checkArr.length - 1) {
nextObj = checkArr[0].getWorldPosition(new THREE.Vector3())
return;
} else if (checkindex < checkArr.length) {
} else if (checkindex < checkArr.length - 1) {
nextObj = checkArr[checkindex + 1].getWorldPosition(new THREE.Vector3())
}
gsap.to(controls.target, {
@ -710,9 +707,11 @@ const check = () => {
y: nextObj.y + 5.2,
z: nextObj.z,
duration: 10,
ease: "power1.inOut",
onComplete: () => {
if (checkindex == romeObj.length) { //
checkComplete();
}
//
// addLabel(checkArr[checkindex], checkArr[checkindex].isPass);
},
@ -724,7 +723,6 @@ const check = () => {
//
const checkComplete = () => {
toHomeView();
checkindex = 0;
bimStore().setCheckArr(romeObj);
emit('checkComplete', romeObj);
return;