人生啊人生 hai 2 semanas
pai
achega
ddee8e1c4f

+ 19 - 19
src/components/ThreeWorldEventQingXiCheAndQv/js/QingXiCheAndQvThreeWorldEventMain.js

@@ -342,29 +342,29 @@ export class QingXiCheAndQvThreeWorldEventMain {
 
         var absolutePosition = ChengGuangYuanJing.Role.find().objRole._absolutePosition;
         
-        // var positionTarget = {
-        //     'x' : 8.27173,
-        //     'y' : 1.01,
-        //     'z' : -17.70557,
-        // }
-
-        // // 得到两点之间的距离
-        // let thisVector3distanceTo = BABYLON.Vector3.Distance(
-        //     new BABYLON.Vector3(parseFloat(absolutePosition.x), parseFloat(absolutePosition.y), parseFloat(absolutePosition.z)),
-        //     new BABYLON.Vector3(parseFloat(positionTarget.x), parseFloat(positionTarget.y), parseFloat(positionTarget.z))
-        // );
-
-        // // console.log('roleAndPositionTargetBool ---', thisVector3distanceTo);
-        
-        // if (thisVector3distanceTo <= 9) {
-        //     return true;
-        // }
-        
         for (let key in QingXiCheAndQvCarEvent.find().aroundTheCarPoint) {
 
             let objAroundTheCarPoint = QingXiCheAndQvCarEvent.find().aroundTheCarPoint[key];
-            console.log("objAroundTheCarPoint", objAroundTheCarPoint);
+            // console.log("objAroundTheCarPoint", objAroundTheCarPoint);
+
+            var positionTarget = {
+                'x' : objAroundTheCarPoint["positionX"],
+                'y' : objAroundTheCarPoint["positionY"],
+                'z' : objAroundTheCarPoint["positionZ"],
+            }
+
+            // 得到两点之间的距离
+            let thisVector3distanceTo = BABYLON.Vector3.Distance(
+                new BABYLON.Vector3(parseFloat(absolutePosition.x), parseFloat(absolutePosition.y), parseFloat(absolutePosition.z)),
+                new BABYLON.Vector3(parseFloat(positionTarget.x), parseFloat(positionTarget.y), parseFloat(positionTarget.z))
+            );
 
+            console.log('aroundTheCarPointBool ---', key, thisVector3distanceTo);
+
+            // if (thisVector3distanceTo <= 9) {
+            //     return true;
+            // }
+            
         }
         
         return false;