diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..dc8c9a6 Binary files /dev/null and b/.DS_Store differ diff --git a/Turbah.xcodeproj/project.xcworkspace/xcuserdata/momo.xcuserdatad/UserInterfaceState.xcuserstate b/Turbah.xcodeproj/project.xcworkspace/xcuserdata/momo.xcuserdatad/UserInterfaceState.xcuserstate index 5f38557..a1c32c7 100644 Binary files a/Turbah.xcodeproj/project.xcworkspace/xcuserdata/momo.xcuserdatad/UserInterfaceState.xcuserstate and b/Turbah.xcodeproj/project.xcworkspace/xcuserdata/momo.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Turbah/.DS_Store b/Turbah/.DS_Store new file mode 100644 index 0000000..c78290f Binary files /dev/null and b/Turbah/.DS_Store differ diff --git a/Turbah/Controllers/ViewController.swift b/Turbah/Controllers/ViewController.swift index c065ec4..3489c93 100644 --- a/Turbah/Controllers/ViewController.swift +++ b/Turbah/Controllers/ViewController.swift @@ -39,11 +39,12 @@ class ViewController: UIViewController, CLLocationManagerDelegate, ARCoachingOve setupUI() showCalibrateView() initManager() + addCoaching() } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - if didAddCoaching { arView.run() } + if didRun { arView.run() } } override func viewWillDisappear(_ animated: Bool) { @@ -97,16 +98,12 @@ class ViewController: UIViewController, CLLocationManagerDelegate, ARCoachingOve let decreaseValue = 6 - save.distance - anchor.position.z = -1 * cos(Float(bearingOfKabah)) / decreaseValue + cameraAngles.z - anchor.position.x = sin(Float(bearingOfKabah)) / decreaseValue + cameraAngles.x - // Is Y adjustment needed? - //anchor.position.y += cameraAngles.y + anchor.position.z = -1 * cos(Float(bearingOfKabah)) / decreaseValue + anchor.position.x = sin(Float(bearingOfKabah)) / decreaseValue + anchor.position.y = 0 print("after", anchor.position) - let x = sin(Float(bearingOfKabah)) / decreaseValue + cameraAngles.z - let z = -1 * cos(Float(bearingOfKabah)) / decreaseValue + cameraAngles.x - - print("angle", atan(x/z) * 180 / .pi) + print("angle", atan(anchor.position.x/anchor.position.z) * 180 / .pi) let anchorAngles = anchor.transform.matrix.columns.3 @@ -157,7 +154,7 @@ class ViewController: UIViewController, CLLocationManagerDelegate, ARCoachingOve return } - if !didAddCoaching { addCoaching() } + if !didRun { arView.run() } arView.run() } @@ -343,7 +340,7 @@ class ViewController: UIViewController, CLLocationManagerDelegate, ARCoachingOve } var didSendFeedback = false - var didAddCoaching = false + var didRun = false func locationManager(_ manager: CLLocationManager, didUpdateHeading heading: CLHeading) { let chosenHeading = save.trueNorth ? heading.trueHeading : heading.magneticHeading @@ -371,7 +368,7 @@ class ViewController: UIViewController, CLLocationManagerDelegate, ARCoachingOve } else { if !didSendFeedback { hapticFeedback(style: .medium) - if !didAddCoaching { addCoaching(); didAddCoaching = true } + if !didRun { arView.run(); didRun = true } didSendFeedback = true } leftImage.alpha = 0 @@ -390,12 +387,10 @@ class ViewController: UIViewController, CLLocationManagerDelegate, ARCoachingOve view.addSubview(coachingOverlay) coachingOverlay.fillSuperview() - - arView.run() } public func coachingOverlayViewWillActivate(_ coachingOverlayView: ARCoachingOverlayView) { - didAddCoaching = true + didRun = true UIView.animate(withDuration: 0.2) { self.compassView.alpha = 0 self.settingsButton.alpha = 0 @@ -411,7 +406,7 @@ class ViewController: UIViewController, CLLocationManagerDelegate, ARCoachingOve self.locationButton.alpha = 1 } - guard didSendFeedback, selectedLocation == .kabah else { return } + //guard didSendFeedback, selectedLocation == .kabah else { return } placeTurbah() } } diff --git a/Turbah/ar.lproj/InfoPlist.strings b/Turbah/ar.lproj/InfoPlist.strings index 2d7269b..5934adf 100644 --- a/Turbah/ar.lproj/InfoPlist.strings +++ b/Turbah/ar.lproj/InfoPlist.strings @@ -7,5 +7,5 @@ */ "CFBundleDisplayName" = "تربة"; -"NSCameraUsageDescription" = ""; -"NSLocationWhenInUseUsageDescription" = ""; +"NSCameraUsageDescription" = "منح الصلاححية لتشغيل الواقع المعزز"; +"NSLocationWhenInUseUsageDescription" = "منح الصلاححية لتشغيل البوصلة"; diff --git a/Turbah/ar.lproj/Localizable.strings b/Turbah/ar.lproj/Localizable.strings index c24637c..1fb2ee2 100644 --- a/Turbah/ar.lproj/Localizable.strings +++ b/Turbah/ar.lproj/Localizable.strings @@ -24,18 +24,18 @@ "OurApps" = "تطبيقاتنا"; "TermsPrivacy" = "الشروط وسياسة الخصوصية"; "Share" = "المشاركة"; -"EmailTitle" = "تربة AR قبلة"; +"EmailTitle" = "تربة"; "UnableSendTitle" = "لا يمكن إرسال الرسالة"; "UnableSendMessage" = "لا يمكن إرسال الرسالة. الرجاء التأكد من اتصال الإنترنت، ثم حاول مرة اخرى."; "Settings" = "الإعدادات"; "Retry" = "إعادة المحاولة"; -"FaceQiblaMessage" = "يرجى مواجهة القبلة ثم اضغط"; +"FaceQiblaMessage" = "رجاء واجه القبلة ثم اضغط"; -"RerunTitle" = ""; -"RerunMessage" = ""; +"RerunTitle" = "اضغط لإعادة التشغيل"; +"RerunMessage" = "سيؤدي النقر على هذا الزر إلى المعايرة ثم وضع التربة"; "Ok" = "حسنا"; -"LocationDisabled" = ""; -"CameraDisabled" = ""; +"LocationDisabled" = "خدمات الموقع معطلة"; +"CameraDisabled" = "صلاحيات الكامرة معطلة"; diff --git a/Turbah/en.lproj/Localizable.strings b/Turbah/en.lproj/Localizable.strings index b9e368e..f00e89e 100644 --- a/Turbah/en.lproj/Localizable.strings +++ b/Turbah/en.lproj/Localizable.strings @@ -17,8 +17,6 @@ "SayedahMasumaShrine" = "Sayedah Ma'suma Shrine"; "SayedahZainabShrine" = "Sayedah Zainab Shrine"; - -"Settings" = "Settings"; "Contact" = "Contact"; "TurbahDistance" = "Turbah distance"; "TrueNorth" = "True North"; @@ -26,7 +24,7 @@ "OurApps" = "Our apps"; "TermsPrivacy" = "Terms and Privacy Policy"; "Share" = "Share"; -"EmailTitle" = "Turbah AR Qibla"; +"EmailTitle" = "Turbah"; "UnableSendTitle" = "Unable to send message"; "UnableSendMessage" = "Unable to send message. Please check your internet connection and try again.";