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