├── .github └── PULL_REQUEST_TEMPLATE.MD ├── .gitignore ├── .ruby-gemset ├── .swiftlint.yml ├── .travis.yml ├── ARCL.podspec ├── ARCLTests ├── CLLocationExtensionsTests.swift └── Info.plist ├── ARKit+CoreLocation.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ └── ARKit+CoreLocation.xcscheme ├── ARKit+CoreLocation.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── ARKit+CoreLocation ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── 60 - iPhone@2x.png │ │ ├── 60 - iPhone@3x.png │ │ ├── 76 - iPad.png │ │ ├── 76 - iPad@2x.png │ │ ├── 83.5@2x.png │ │ ├── App Store Icon.png │ │ └── Contents.json │ ├── Contents.json │ ├── box0.imageset │ │ ├── Contents.json │ │ └── box0.png │ ├── box1.imageset │ │ ├── Contents.json │ │ └── box1.png │ ├── box2.imageset │ │ ├── Contents.json │ │ └── box2.png │ ├── box3.imageset │ │ ├── Contents.json │ │ └── box3.png │ ├── box4.imageset │ │ ├── Contents.json │ │ └── box4.png │ ├── box5.imageset │ │ ├── Contents.json │ │ └── box5.png │ ├── compass.imageset │ │ ├── Contents.json │ │ ├── compass.png │ │ ├── compass@2x.png │ │ └── compass@3x.png │ ├── pin.imageset │ │ ├── Contents.json │ │ ├── pin.png │ │ ├── pin@2x.png │ │ └── pin@3x.png │ └── user.imageset │ │ ├── Contents.json │ │ ├── user.png │ │ ├── user@2x.png │ │ └── user@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── LocationCell.swift ├── NotSupportedViewController.swift ├── OpenARCell.swift ├── POIViewController+ARSCNViewDelegate.swift ├── POIViewController.swift ├── SettingsViewController.swift ├── UIButton+Designable.swift └── Utils.swift ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── Node Demos ├── ARCLViewController.swift ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Info.plist ├── LaunchScreen.storyboard ├── Main.storyboard ├── PickerViewController.swift └── SceneDelegate.swift ├── Node DemosTests ├── Info.plist └── Node_DemosTests.swift ├── Node DemosUITests ├── Info.plist └── Node_DemosUITests.swift ├── Package.swift ├── Podfile ├── Podfile.lock ├── Pods ├── Local Podspecs │ └── ARCL.podspec.json ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj └── Target Support Files │ ├── ARCL │ ├── ARCL-Info.plist │ ├── ARCL-dummy.m │ ├── ARCL-prefix.pch │ ├── ARCL-umbrella.h │ ├── ARCL.modulemap │ └── ARCL.xcconfig │ ├── Pods-ARKit+CoreLocation-ARCLTests │ ├── Pods-ARKit+CoreLocation-ARCLTests-Info.plist │ ├── Pods-ARKit+CoreLocation-ARCLTests-acknowledgements.markdown │ ├── Pods-ARKit+CoreLocation-ARCLTests-acknowledgements.plist │ ├── Pods-ARKit+CoreLocation-ARCLTests-dummy.m │ ├── Pods-ARKit+CoreLocation-ARCLTests-frameworks.sh │ ├── Pods-ARKit+CoreLocation-ARCLTests-umbrella.h │ ├── Pods-ARKit+CoreLocation-ARCLTests.debug.xcconfig │ ├── Pods-ARKit+CoreLocation-ARCLTests.modulemap │ └── Pods-ARKit+CoreLocation-ARCLTests.release.xcconfig │ ├── Pods-ARKit+CoreLocation │ ├── Pods-ARKit+CoreLocation-Info.plist │ ├── Pods-ARKit+CoreLocation-acknowledgements.markdown │ ├── Pods-ARKit+CoreLocation-acknowledgements.plist │ ├── Pods-ARKit+CoreLocation-dummy.m │ ├── Pods-ARKit+CoreLocation-frameworks.sh │ ├── Pods-ARKit+CoreLocation-umbrella.h │ ├── Pods-ARKit+CoreLocation.debug.xcconfig │ ├── Pods-ARKit+CoreLocation.modulemap │ └── Pods-ARKit+CoreLocation.release.xcconfig │ ├── Pods-Node Demos-Node DemosTests │ ├── Pods-Node Demos-Node DemosTests-Info.plist │ ├── Pods-Node Demos-Node DemosTests-acknowledgements.markdown │ ├── Pods-Node Demos-Node DemosTests-acknowledgements.plist │ ├── Pods-Node Demos-Node DemosTests-dummy.m │ ├── Pods-Node Demos-Node DemosTests-frameworks.sh │ ├── Pods-Node Demos-Node DemosTests-umbrella.h │ ├── Pods-Node Demos-Node DemosTests.debug.xcconfig │ ├── Pods-Node Demos-Node DemosTests.modulemap │ └── Pods-Node Demos-Node DemosTests.release.xcconfig │ └── Pods-Node Demos │ ├── Pods-Node Demos-Info.plist │ ├── Pods-Node Demos-acknowledgements.markdown │ ├── Pods-Node Demos-acknowledgements.plist │ ├── Pods-Node Demos-dummy.m │ ├── Pods-Node Demos-frameworks.sh │ ├── Pods-Node Demos-umbrella.h │ ├── Pods-Node Demos.debug.xcconfig │ ├── Pods-Node Demos.modulemap │ └── Pods-Node Demos.release.xcconfig ├── Sources ├── ARCL.h ├── ARKit-CoreLocation │ ├── ARKit_CoreLocation.swift │ ├── Extensions │ │ ├── BaseTypes+Extensions.swift │ │ ├── CGPoint+Extensions.swift │ │ ├── CLLocation+Extensions.swift │ │ ├── FloatingPoint+Radians.swift │ │ ├── SCNNode+Extensions.swift │ │ └── SCNVector3+Extensions.swift │ ├── Location Manager │ │ ├── LocationManager.swift │ │ ├── SceneLocationEstimate+Extensions.swift │ │ ├── SceneLocationEstimate.swift │ │ └── SceneLocationManager.swift │ ├── Nodes │ │ ├── LocationAnnotationNode.swift │ │ ├── LocationNode.swift │ │ ├── PolylineNode.swift │ │ └── ScalingScheme.swift │ ├── SceneLocationView+ARSCNViewDelegate.swift │ ├── SceneLocationView.swift │ ├── SceneLocationViewEstimateDelegate.swift │ └── Util │ │ └── AttributedType.swift └── Info.plist ├── arkit.png ├── changelog.md ├── fastlane ├── Appfile ├── Fastfile └── README.md ├── giphy-1.gif ├── giphy-2.gif ├── readme.jp.md └── readme.md /.github/PULL_REQUEST_TEMPLATE.MD: -------------------------------------------------------------------------------- 1 | ### Background 2 | 3 | Describe the purpose of this pull request. 4 | 5 | ### Breaking Changes 6 | Describe any breaking changes that this pull request will introduce. 7 | 8 | ### Meta 9 | - Tied to Version Release(s): 10 | 11 | ### PR Checklist 12 | - [ ] CI runs clean? 13 | - [ ] Appropriate label has been added to this PR (i.e., Bug, Enhancement, etc.). 14 | - [ ] Documentation has been added to all `open`, and `public` scoped methods and properties. 15 | - [ ] Changelog has been updated 16 | - [ ] Tests have have been added to all new features. (not a requirement, but helpful) 17 | - [ ] Image/GIFs have been added for all UI related changed. 18 | 19 | 20 | 21 | 22 | ### Screenshots 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | .DS_Store 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | *.dSYM.zip 30 | *.dSYM 31 | 32 | ## Playgrounds 33 | timeline.xctimeline 34 | playground.xcworkspace 35 | 36 | # Swift Package Manager 37 | # 38 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 39 | # Packages/ 40 | # Package.pins 41 | .build/ 42 | 43 | # CocoaPods 44 | # 45 | # We recommend against adding the Pods directory to your .gitignore. However 46 | # you should judge for yourself, the pros and cons are mentioned at: 47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 48 | # 49 | # Pods/ 50 | 51 | # Carthage 52 | # 53 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 54 | # Carthage/Checkouts 55 | 56 | Carthage/Build 57 | 58 | # fastlane 59 | # 60 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 61 | # screenshots whenever they are needed. 62 | # For more information about the recommended setup visit: 63 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 64 | 65 | fastlane/report.xml 66 | fastlane/Preview.html 67 | fastlane/screenshots 68 | fastlane/test_output 69 | 70 | -------------------------------------------------------------------------------- /.ruby-gemset: -------------------------------------------------------------------------------- 1 | arcl 2 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | line_length: 130 2 | 3 | file_length: 4 | warning: 500 5 | error: 1200 6 | 7 | disabled_rules: 8 | - variable_name 9 | - todo 10 | - valid_docs 11 | 12 | excluded: # paths to ignore during linting. Takes precedence over `included`. 13 | - Carthage 14 | - Pods 15 | - ARCLTests 16 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode11.1 3 | 4 | script: 5 | - bundle install 6 | - pod lib lint 7 | - bundle exec fastlane test 8 | 9 | notifications: 10 | email: false 11 | -------------------------------------------------------------------------------- /ARCL.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "ARCL" 3 | s.version = "1.3.1" 4 | s.summary = "ARKit + CoreLocation combines the high accuracy of AR with the scale of GPS data." 5 | s.homepage = "https://github.com/ProjectDent/arkit-corelocation" 6 | s.author = { "Andrew Hart" => "Andrew@ProjectDent.com" } 7 | s.license = { :type => 'MIT', :file => 'LICENSE' } 8 | s.source = { :git => "https://ProjectDent@github.com/ProjectDent/ARKit-CoreLocation.git", :tag => s.version.to_s, :submodules => false } 9 | s.platform = :ios, '9.0' 10 | s.swift_version = "5.0" 11 | s.requires_arc = true 12 | s.source_files = 'Sources/**/*.{swift}' 13 | s.frameworks = 'Foundation', 'UIKit', 'CoreLocation', 'MapKit', 'SceneKit' 14 | s.weak_frameworks = 'ARKit' 15 | s.ios.deployment_target = '9.0' 16 | end 17 | -------------------------------------------------------------------------------- /ARCLTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ARKit+CoreLocation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ARKit+CoreLocation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ARKit+CoreLocation.xcodeproj/xcshareddata/xcschemes/ARKit+CoreLocation.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 38 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /ARKit+CoreLocation.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ARKit+CoreLocation.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ARKit+CoreLocation/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Andrew Hart on 02/07/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions 17 | launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { 18 | 19 | UIApplication.shared.isIdleTimerDisabled = true 20 | 21 | self.window = UIWindow(frame: UIScreen.main.bounds) 22 | 23 | self.window!.makeKeyAndVisible() 24 | 25 | if #available(iOS 11.0, *) { 26 | guard let vc = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() else { 27 | return false 28 | } 29 | self.window!.rootViewController = vc 30 | } else { 31 | self.window!.rootViewController = NotSupportedViewController() 32 | } 33 | 34 | return true 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/AppIcon.appiconset/60 - iPhone@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/AppIcon.appiconset/60 - iPhone@2x.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/AppIcon.appiconset/60 - iPhone@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/AppIcon.appiconset/60 - iPhone@3x.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/AppIcon.appiconset/76 - iPad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/AppIcon.appiconset/76 - iPad.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/AppIcon.appiconset/76 - iPad@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/AppIcon.appiconset/76 - iPad@2x.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/AppIcon.appiconset/83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/AppIcon.appiconset/83.5@2x.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/AppIcon.appiconset/App Store Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/AppIcon.appiconset/App Store Icon.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "60 - iPhone@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "60x60", 41 | "idiom" : "iphone", 42 | "filename" : "60 - iPhone@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "idiom" : "ipad", 47 | "size" : "20x20", 48 | "scale" : "1x" 49 | }, 50 | { 51 | "idiom" : "ipad", 52 | "size" : "20x20", 53 | "scale" : "2x" 54 | }, 55 | { 56 | "idiom" : "ipad", 57 | "size" : "29x29", 58 | "scale" : "1x" 59 | }, 60 | { 61 | "idiom" : "ipad", 62 | "size" : "29x29", 63 | "scale" : "2x" 64 | }, 65 | { 66 | "idiom" : "ipad", 67 | "size" : "40x40", 68 | "scale" : "1x" 69 | }, 70 | { 71 | "idiom" : "ipad", 72 | "size" : "40x40", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "76x76", 77 | "idiom" : "ipad", 78 | "filename" : "76 - iPad.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "76x76", 83 | "idiom" : "ipad", 84 | "filename" : "76 - iPad@2x.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "83.5x83.5", 89 | "idiom" : "ipad", 90 | "filename" : "83.5@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "1024x1024", 95 | "idiom" : "ios-marketing", 96 | "filename" : "App Store Icon.png", 97 | "scale" : "1x" 98 | } 99 | ], 100 | "info" : { 101 | "version" : 1, 102 | "author" : "xcode" 103 | } 104 | } -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/box0.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "box0.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/box0.imageset/box0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/box0.imageset/box0.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/box1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "box1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/box1.imageset/box1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/box1.imageset/box1.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/box2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "box2.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/box2.imageset/box2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/box2.imageset/box2.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/box3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "box3.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/box3.imageset/box3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/box3.imageset/box3.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/box4.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "box4.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/box4.imageset/box4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/box4.imageset/box4.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/box5.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "box5.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/box5.imageset/box5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/box5.imageset/box5.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/compass.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "compass.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "compass@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "compass@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/compass.imageset/compass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/compass.imageset/compass.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/compass.imageset/compass@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/compass.imageset/compass@2x.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/compass.imageset/compass@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/compass.imageset/compass@3x.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/pin.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "pin.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "pin@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "pin@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/pin.imageset/pin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/pin.imageset/pin.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/pin.imageset/pin@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/pin.imageset/pin@2x.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/pin.imageset/pin@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/pin.imageset/pin@3x.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/user.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "user.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "user@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "user@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/user.imageset/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/user.imageset/user.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/user.imageset/user@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/user.imageset/user@2x.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Assets.xcassets/user.imageset/user@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/ARKit+CoreLocation/Assets.xcassets/user.imageset/user@3x.png -------------------------------------------------------------------------------- /ARKit+CoreLocation/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /ARKit+CoreLocation/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSCameraUsageDescription 24 | This application will use the camera for Augmented Reality. 25 | NSLocationWhenInUseUsageDescription 26 | This application will use location for Augmented Reality. 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIStatusBarHidden 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ARKit+CoreLocation/LocationCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LocationCell.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Eric Internicola on 2/20/19. 6 | // Copyright © 2019 Project Dent. All rights reserved. 7 | // 8 | 9 | import CoreLocation 10 | import MapKit 11 | import UIKit 12 | 13 | class LocationCell: UITableViewCell { 14 | 15 | var locationManager: CLLocationManager? 16 | var locationUpdateTimer: Timer? 17 | 18 | var currentLocation: CLLocation? { 19 | return locationManager?.location 20 | } 21 | 22 | var mapItem: MKMapItem? { 23 | didSet { 24 | updateCell() 25 | } 26 | } 27 | 28 | @IBOutlet weak var distanceLabel: UILabel! 29 | @IBOutlet weak var titleLabel: UILabel! 30 | 31 | override func prepareForReuse() { 32 | super.prepareForReuse() 33 | distanceLabel.text = nil 34 | titleLabel.text = nil 35 | locationUpdateTimer?.invalidate() 36 | } 37 | 38 | } 39 | 40 | // MARK: - Implementation 41 | 42 | extension LocationCell { 43 | 44 | @objc 45 | func updateCell() { 46 | guard let mapItem = mapItem else { 47 | locationUpdateTimer?.invalidate() 48 | return 49 | } 50 | titleLabel.text = mapItem.titleLabelText 51 | 52 | guard let currentLocation = currentLocation else { 53 | distanceLabel.text = "📡" 54 | return 55 | } 56 | guard let mapItemLocation = mapItem.placemark.location else { 57 | distanceLabel.text = "🤷‍♂️" 58 | return 59 | } 60 | 61 | distanceLabel.text = String(format: "%.0f km", mapItemLocation.distance(from: currentLocation)/1000) 62 | 63 | locationUpdateTimer = Timer(timeInterval: 1, target: self, selector: #selector(updateCell), userInfo: nil, repeats: false) 64 | } 65 | 66 | } 67 | 68 | private extension MKMapItem { 69 | 70 | var titleLabelText: String { 71 | var result = "" 72 | 73 | if let name = name { 74 | result += name 75 | } 76 | if let addressDictionary = placemark.addressDictionary { 77 | if let street = addressDictionary["Street"] as? String { 78 | result += "\n\(street)" 79 | } 80 | if let city = addressDictionary["City"] as? String, 81 | let state = addressDictionary["State"] as? String, 82 | let zip = addressDictionary["ZIP"] as? String { 83 | result += "\n\(city), \(state) \(zip)" 84 | } 85 | } else if let location = placemark.location { 86 | result += "\n\(location.coordinate)" 87 | } 88 | 89 | return result 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /ARKit+CoreLocation/NotSupportedViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NotSupportedViewController.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Vihan Bhargava on 9/2/17. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class NotSupportedViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | self.view.backgroundColor = .white 17 | 18 | let label = UILabel() 19 | label.textAlignment = .center 20 | label.text = "iOS 11+ required" 21 | 22 | self.view.addSubview(label) 23 | 24 | label.translatesAutoresizingMaskIntoConstraints = false 25 | label.centerXAnchor.constraint(equalTo: self.view.centerXAnchor).isActive = true 26 | label.centerYAnchor.constraint(equalTo: self.view.centerYAnchor).isActive = true 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ARKit+CoreLocation/OpenARCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OpenARCell.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Eric Internicola on 2/20/19. 6 | // Copyright © 2019 Project Dent. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @available(iOS 11.0, *) 12 | class OpenARCell: UITableViewCell { 13 | 14 | weak var parentVC: SettingsViewController? 15 | @IBOutlet weak var openARButton: UIButton! 16 | 17 | @IBAction 18 | func tappedOpenARButton(_ sender: Any) { 19 | guard let vc = parentVC?.createARVC() else { 20 | return assertionFailure("Failed to create ARVC") 21 | } 22 | parentVC?.navigationController?.pushViewController(vc, animated: true) 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /ARKit+CoreLocation/POIViewController+ARSCNViewDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // POIViewController+ARSCNViewDelegate.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Eric Internicola on 6/23/19. 6 | // Copyright © 2019 Project Dent. All rights reserved. 7 | // 8 | 9 | import ARKit 10 | import UIKit 11 | 12 | @available(iOS 11.0, *) 13 | extension POIViewController: ARSCNViewDelegate { 14 | 15 | func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) { 16 | print("Added SCNNode: \(node)") // you probably won't see this fire 17 | } 18 | 19 | func renderer(_ renderer: SCNSceneRenderer, willUpdate node: SCNNode, for anchor: ARAnchor) { 20 | print("willUpdate: \(node)") // you probably won't see this fire 21 | } 22 | 23 | func session(_ session: ARSession, cameraDidChangeTrackingState camera: ARCamera) { 24 | print("Camera: \(camera)") 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /ARKit+CoreLocation/SettingsViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsViewController.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Eric Internicola on 2/19/19. 6 | // Copyright © 2019 Project Dent. All rights reserved. 7 | // 8 | 9 | import CoreLocation 10 | import MapKit 11 | import UIKit 12 | 13 | @available(iOS 11.0, *) 14 | class SettingsViewController: UIViewController { 15 | 16 | @IBOutlet weak var showMapSwitch: UISwitch! 17 | @IBOutlet weak var showPointsOfInterest: UISwitch! 18 | @IBOutlet weak var showRouteDirections: UISwitch! 19 | @IBOutlet weak var addressText: UITextField! 20 | @IBOutlet weak var searchResultTable: UITableView! 21 | @IBOutlet weak var refreshControl: UIActivityIndicatorView! 22 | 23 | var locationManager = CLLocationManager() 24 | 25 | var mapSearchResults: [MKMapItem]? 26 | 27 | override func viewDidLoad() { 28 | super.viewDidLoad() 29 | 30 | locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation 31 | locationManager.distanceFilter = kCLDistanceFilterNone 32 | locationManager.headingFilter = kCLHeadingFilterNone 33 | locationManager.pausesLocationUpdatesAutomatically = false 34 | locationManager.delegate = self 35 | locationManager.startUpdatingHeading() 36 | locationManager.startUpdatingLocation() 37 | 38 | locationManager.requestWhenInUseAuthorization() 39 | 40 | addressText.delegate = self 41 | } 42 | 43 | override func viewWillAppear(_ animated: Bool) { 44 | super.viewWillAppear(animated) 45 | navigationController?.setNavigationBarHidden(true, animated: animated) 46 | } 47 | 48 | @IBAction 49 | func toggledSwitch(_ sender: UISwitch) { 50 | if sender == showPointsOfInterest { 51 | showRouteDirections.isOn = !sender.isOn 52 | searchResultTable.reloadData() 53 | } else if sender == showRouteDirections { 54 | showPointsOfInterest.isOn = !sender.isOn 55 | searchResultTable.reloadData() 56 | } 57 | } 58 | 59 | @IBAction 60 | func tappedSearch(_ sender: Any) { 61 | guard let text = addressText.text, !text.isEmpty else { 62 | return 63 | } 64 | searchForLocation() 65 | } 66 | } 67 | 68 | // MARK: - UITextFieldDelegate 69 | 70 | @available(iOS 11.0, *) 71 | extension SettingsViewController: UITextFieldDelegate { 72 | 73 | func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { 74 | 75 | if string == "\n" { 76 | DispatchQueue.main.async { [weak self] in 77 | self?.searchForLocation() 78 | } 79 | } 80 | 81 | return true 82 | } 83 | 84 | } 85 | 86 | // MARK: - DataSource 87 | 88 | @available(iOS 11.0, *) 89 | extension SettingsViewController: UITableViewDataSource { 90 | 91 | func numberOfSections(in tableView: UITableView) -> Int { 92 | return 1 93 | } 94 | 95 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 96 | if showPointsOfInterest.isOn { 97 | return 1 98 | } 99 | guard let mapSearchResults = mapSearchResults else { 100 | return 0 101 | } 102 | 103 | return mapSearchResults.count 104 | } 105 | 106 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 107 | if showPointsOfInterest.isOn { 108 | let cell = tableView.dequeueReusableCell(withIdentifier: "OpenARCell", for: indexPath) 109 | guard let openARCell = cell as? OpenARCell else { 110 | return cell 111 | } 112 | openARCell.parentVC = self 113 | 114 | return openARCell 115 | } else { 116 | let cell = tableView.dequeueReusableCell(withIdentifier: "LocationCell", for: indexPath) 117 | guard let mapSearchResults = mapSearchResults, 118 | indexPath.row < mapSearchResults.count, 119 | let locationCell = cell as? LocationCell else { 120 | return cell 121 | } 122 | locationCell.locationManager = locationManager 123 | locationCell.mapItem = mapSearchResults[indexPath.row] 124 | 125 | return locationCell 126 | } 127 | } 128 | } 129 | 130 | // MARK: - UITableViewDelegate 131 | 132 | @available(iOS 11.0, *) 133 | extension SettingsViewController: UITableViewDelegate { 134 | 135 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 136 | guard let mapSearchResults = mapSearchResults, indexPath.row < mapSearchResults.count else { 137 | return 138 | } 139 | let selectedMapItem = mapSearchResults[indexPath.row] 140 | getDirections(to: selectedMapItem) 141 | } 142 | 143 | } 144 | 145 | // MARK: - CLLocationManagerDelegate 146 | 147 | @available(iOS 11.0, *) 148 | extension SettingsViewController: CLLocationManagerDelegate { 149 | 150 | func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { 151 | 152 | } 153 | } 154 | 155 | // MARK: - Implementation 156 | 157 | @available(iOS 11.0, *) 158 | extension SettingsViewController { 159 | 160 | func createARVC() -> POIViewController { 161 | let arclVC = POIViewController.loadFromStoryboard() 162 | arclVC.showMap = showMapSwitch.isOn 163 | 164 | return arclVC 165 | } 166 | 167 | func getDirections(to mapLocation: MKMapItem) { 168 | refreshControl.startAnimating() 169 | 170 | let request = MKDirections.Request() 171 | request.source = MKMapItem.forCurrentLocation() 172 | request.destination = mapLocation 173 | request.requestsAlternateRoutes = false 174 | 175 | let directions = MKDirections(request: request) 176 | 177 | directions.calculate(completionHandler: { response, error in 178 | defer { 179 | DispatchQueue.main.async { [weak self] in 180 | self?.refreshControl.stopAnimating() 181 | } 182 | } 183 | if let error = error { 184 | return print("Error getting directions: \(error.localizedDescription)") 185 | } 186 | guard let response = response else { 187 | return assertionFailure("No error, but no response, either.") 188 | } 189 | 190 | DispatchQueue.main.async { [weak self] in 191 | guard let self = self else { 192 | return 193 | } 194 | 195 | let arclVC = self.createARVC() 196 | arclVC.routes = response.routes 197 | self.navigationController?.pushViewController(arclVC, animated: true) 198 | } 199 | }) 200 | } 201 | 202 | /// Searches for the location that was entered into the address text 203 | func searchForLocation() { 204 | guard let addressText = addressText.text, !addressText.isEmpty else { 205 | return 206 | } 207 | 208 | showRouteDirections.isOn = true 209 | toggledSwitch(showRouteDirections) 210 | 211 | refreshControl.startAnimating() 212 | defer { 213 | self.addressText.resignFirstResponder() 214 | } 215 | 216 | let request = MKLocalSearch.Request() 217 | request.naturalLanguageQuery = addressText 218 | 219 | let search = MKLocalSearch(request: request) 220 | search.start { response, error in 221 | defer { 222 | DispatchQueue.main.async { [weak self] in 223 | self?.refreshControl.stopAnimating() 224 | } 225 | } 226 | if let error = error { 227 | return assertionFailure("Error searching for \(addressText): \(error.localizedDescription)") 228 | } 229 | guard let response = response, response.mapItems.count > 0 else { 230 | return assertionFailure("No response or empty response") 231 | } 232 | DispatchQueue.main.async { [weak self] in 233 | guard let self = self else { 234 | return 235 | } 236 | self.mapSearchResults = response.sortedMapItems(byDistanceFrom: self.locationManager.location) 237 | self.searchResultTable.reloadData() 238 | } 239 | } 240 | } 241 | } 242 | 243 | extension MKLocalSearch.Response { 244 | 245 | func sortedMapItems(byDistanceFrom location: CLLocation?) -> [MKMapItem] { 246 | guard let location = location else { 247 | return mapItems 248 | } 249 | 250 | return mapItems.sorted { (first, second) -> Bool in 251 | guard let d1 = first.placemark.location?.distance(from: location), 252 | let d2 = second.placemark.location?.distance(from: location) else { 253 | return true 254 | } 255 | 256 | return d1 < d2 257 | } 258 | } 259 | 260 | } 261 | -------------------------------------------------------------------------------- /ARKit+CoreLocation/UIButton+Designable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+Designable.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Eric Internicola on 2/20/19. 6 | // Copyright © 2019 Project Dent. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIButton { 12 | 13 | @IBInspectable 14 | var borderColor: UIColor? { 15 | get { 16 | guard let cgColor = layer.borderColor else { 17 | return nil 18 | } 19 | return UIColor(cgColor: cgColor) 20 | } 21 | set { 22 | layer.borderColor = newValue?.cgColor 23 | } 24 | } 25 | 26 | @IBInspectable 27 | var borderWidth: CGFloat { 28 | get { 29 | return layer.borderWidth 30 | } 31 | set { 32 | layer.borderWidth = newValue 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /ARKit+CoreLocation/Utils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Utils.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Ilya Seliverstov on 09/08/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class Utils { 12 | fileprivate init () { } 13 | 14 | class func getStoryboard(_ storyboard: String = "Main") -> UIStoryboard { 15 | return UIStoryboard(name: storyboard, bundle: Bundle.main) 16 | } 17 | 18 | class func createViewController(_ identifier: String, storyboard: String = "Main") -> T { 19 | return Utils.getStoryboard(storyboard) 20 | .instantiateViewController(withIdentifier: identifier) as! T // swiftlint:disable:this force_cast 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'bundler' 4 | gem 'cocoapods' 5 | gem 'fastlane' 6 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.0) 5 | activesupport (4.2.11.1) 6 | i18n (~> 0.7) 7 | minitest (~> 5.1) 8 | thread_safe (~> 0.3, >= 0.3.4) 9 | tzinfo (~> 1.1) 10 | addressable (2.6.0) 11 | public_suffix (>= 2.0.2, < 4.0) 12 | atomos (0.1.3) 13 | babosa (1.0.2) 14 | claide (1.0.2) 15 | cocoapods (1.7.2) 16 | activesupport (>= 4.0.2, < 5) 17 | claide (>= 1.0.2, < 2.0) 18 | cocoapods-core (= 1.7.2) 19 | cocoapods-deintegrate (>= 1.0.3, < 2.0) 20 | cocoapods-downloader (>= 1.2.2, < 2.0) 21 | cocoapods-plugins (>= 1.0.0, < 2.0) 22 | cocoapods-search (>= 1.0.0, < 2.0) 23 | cocoapods-stats (>= 1.0.0, < 2.0) 24 | cocoapods-trunk (>= 1.3.1, < 2.0) 25 | cocoapods-try (>= 1.1.0, < 2.0) 26 | colored2 (~> 3.1) 27 | escape (~> 0.0.4) 28 | fourflusher (>= 2.3.0, < 3.0) 29 | gh_inspector (~> 1.0) 30 | molinillo (~> 0.6.6) 31 | nap (~> 1.0) 32 | ruby-macho (~> 1.4) 33 | xcodeproj (>= 1.10.0, < 2.0) 34 | cocoapods-core (1.7.2) 35 | activesupport (>= 4.0.2, < 6) 36 | fuzzy_match (~> 2.0.4) 37 | nap (~> 1.0) 38 | cocoapods-deintegrate (1.0.4) 39 | cocoapods-downloader (1.2.2) 40 | cocoapods-plugins (1.0.0) 41 | nap 42 | cocoapods-search (1.0.0) 43 | cocoapods-stats (1.1.0) 44 | cocoapods-trunk (1.3.1) 45 | nap (>= 0.8, < 2.0) 46 | netrc (~> 0.11) 47 | cocoapods-try (1.1.0) 48 | colored (1.2) 49 | colored2 (3.1.2) 50 | commander-fastlane (4.4.6) 51 | highline (~> 1.7.2) 52 | concurrent-ruby (1.1.5) 53 | declarative (0.0.10) 54 | declarative-option (0.1.0) 55 | digest-crc (0.4.1) 56 | domain_name (0.5.20180417) 57 | unf (>= 0.0.5, < 1.0.0) 58 | dotenv (2.7.4) 59 | emoji_regex (1.0.1) 60 | escape (0.0.4) 61 | excon (0.64.0) 62 | faraday (0.15.4) 63 | multipart-post (>= 1.2, < 3) 64 | faraday-cookie_jar (0.0.6) 65 | faraday (>= 0.7.4) 66 | http-cookie (~> 1.0.0) 67 | faraday_middleware (0.13.1) 68 | faraday (>= 0.7.4, < 1.0) 69 | fastimage (2.1.5) 70 | fastlane (2.126.0) 71 | CFPropertyList (>= 2.3, < 4.0.0) 72 | addressable (>= 2.3, < 3.0.0) 73 | babosa (>= 1.0.2, < 2.0.0) 74 | bundler (>= 1.12.0, < 3.0.0) 75 | colored 76 | commander-fastlane (>= 4.4.6, < 5.0.0) 77 | dotenv (>= 2.1.1, < 3.0.0) 78 | emoji_regex (>= 0.1, < 2.0) 79 | excon (>= 0.45.0, < 1.0.0) 80 | faraday (~> 0.9) 81 | faraday-cookie_jar (~> 0.0.6) 82 | faraday_middleware (~> 0.9) 83 | fastimage (>= 2.1.0, < 3.0.0) 84 | gh_inspector (>= 1.1.2, < 2.0.0) 85 | google-api-client (>= 0.21.2, < 0.24.0) 86 | google-cloud-storage (>= 1.15.0, < 2.0.0) 87 | highline (>= 1.7.2, < 2.0.0) 88 | json (< 3.0.0) 89 | jwt (~> 2.1.0) 90 | mini_magick (~> 4.5.1) 91 | multi_xml (~> 0.5) 92 | multipart-post (~> 2.0.0) 93 | plist (>= 3.1.0, < 4.0.0) 94 | public_suffix (~> 2.0.0) 95 | rubyzip (>= 1.2.2, < 2.0.0) 96 | security (= 0.1.3) 97 | simctl (~> 1.6.3) 98 | slack-notifier (>= 2.0.0, < 3.0.0) 99 | terminal-notifier (>= 2.0.0, < 3.0.0) 100 | terminal-table (>= 1.4.5, < 2.0.0) 101 | tty-screen (>= 0.6.3, < 1.0.0) 102 | tty-spinner (>= 0.8.0, < 1.0.0) 103 | word_wrap (~> 1.0.0) 104 | xcodeproj (>= 1.8.1, < 2.0.0) 105 | xcpretty (~> 0.3.0) 106 | xcpretty-travis-formatter (>= 0.0.3) 107 | fourflusher (2.3.1) 108 | fuzzy_match (2.0.4) 109 | gh_inspector (1.1.3) 110 | google-api-client (0.23.9) 111 | addressable (~> 2.5, >= 2.5.1) 112 | googleauth (>= 0.5, < 0.7.0) 113 | httpclient (>= 2.8.1, < 3.0) 114 | mime-types (~> 3.0) 115 | representable (~> 3.0) 116 | retriable (>= 2.0, < 4.0) 117 | signet (~> 0.9) 118 | google-cloud-core (1.3.0) 119 | google-cloud-env (~> 1.0) 120 | google-cloud-env (1.2.0) 121 | faraday (~> 0.11) 122 | google-cloud-storage (1.16.0) 123 | digest-crc (~> 0.4) 124 | google-api-client (~> 0.23) 125 | google-cloud-core (~> 1.2) 126 | googleauth (>= 0.6.2, < 0.10.0) 127 | googleauth (0.6.7) 128 | faraday (~> 0.12) 129 | jwt (>= 1.4, < 3.0) 130 | memoist (~> 0.16) 131 | multi_json (~> 1.11) 132 | os (>= 0.9, < 2.0) 133 | signet (~> 0.7) 134 | highline (1.7.10) 135 | http-cookie (1.0.3) 136 | domain_name (~> 0.5) 137 | httpclient (2.8.3) 138 | i18n (0.9.5) 139 | concurrent-ruby (~> 1.0) 140 | json (2.2.0) 141 | jwt (2.1.0) 142 | memoist (0.16.0) 143 | mime-types (3.2.2) 144 | mime-types-data (~> 3.2015) 145 | mime-types-data (3.2019.0331) 146 | mini_magick (4.5.1) 147 | minitest (5.11.3) 148 | molinillo (0.6.6) 149 | multi_json (1.13.1) 150 | multi_xml (0.6.0) 151 | multipart-post (2.0.0) 152 | nanaimo (0.2.6) 153 | nap (1.1.0) 154 | naturally (2.2.0) 155 | netrc (0.11.0) 156 | os (1.0.1) 157 | plist (3.5.0) 158 | public_suffix (2.0.5) 159 | representable (3.0.4) 160 | declarative (< 0.1.0) 161 | declarative-option (< 0.2.0) 162 | uber (< 0.2.0) 163 | retriable (3.1.2) 164 | rouge (2.0.7) 165 | ruby-macho (1.4.0) 166 | rubyzip (1.3.0) 167 | security (0.1.3) 168 | signet (0.11.0) 169 | addressable (~> 2.3) 170 | faraday (~> 0.9) 171 | jwt (>= 1.5, < 3.0) 172 | multi_json (~> 1.10) 173 | simctl (1.6.5) 174 | CFPropertyList 175 | naturally 176 | slack-notifier (2.3.2) 177 | terminal-notifier (2.0.0) 178 | terminal-table (1.8.0) 179 | unicode-display_width (~> 1.1, >= 1.1.1) 180 | thread_safe (0.3.6) 181 | tty-cursor (0.7.0) 182 | tty-screen (0.7.0) 183 | tty-spinner (0.9.1) 184 | tty-cursor (~> 0.7) 185 | tzinfo (1.2.5) 186 | thread_safe (~> 0.1) 187 | uber (0.1.0) 188 | unf (0.1.4) 189 | unf_ext 190 | unf_ext (0.0.7.6) 191 | unicode-display_width (1.6.0) 192 | word_wrap (1.0.0) 193 | xcodeproj (1.10.0) 194 | CFPropertyList (>= 2.3.3, < 4.0) 195 | atomos (~> 0.1.3) 196 | claide (>= 1.0.2, < 2.0) 197 | colored2 (~> 3.1) 198 | nanaimo (~> 0.2.6) 199 | xcpretty (0.3.0) 200 | rouge (~> 2.0.7) 201 | xcpretty-travis-formatter (1.0.0) 202 | xcpretty (~> 0.2, >= 0.0.7) 203 | 204 | PLATFORMS 205 | ruby 206 | 207 | DEPENDENCIES 208 | bundler 209 | cocoapods 210 | fastlane 211 | 212 | BUNDLED WITH 213 | 2.0.2 214 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Project Dent (https://ProjectDent.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Node Demos/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Node Demos 4 | // 5 | // Created by Hal Mueller on 10/11/19. 6 | // Copyright © 2019 Project Dent. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // swiftlint:disable all 12 | // This file is an Apple template and it's not worth our time to make it pass swiftlint for a demo. 13 | @UIApplicationMain 14 | class AppDelegate: UIResponder, UIApplicationDelegate { 15 | 16 | 17 | 18 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 19 | // Override point for customization after application launch. 20 | return true 21 | } 22 | 23 | // MARK: UISceneSession Lifecycle 24 | 25 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 26 | // Called when a new scene session is being created. 27 | // Use this method to select a configuration to create the new scene with. 28 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 29 | } 30 | 31 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 32 | // Called when the user discards a scene session. 33 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 34 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 35 | } 36 | 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /Node Demos/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Node Demos/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Node Demos/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSCameraUsageDescription 24 | This application will use the camera for Augmented Reality. 25 | NSLocationWhenInUseUsageDescription 26 | This application will use location for Augmented Reality. 27 | UIApplicationSceneManifest 28 | 29 | UIApplicationSupportsMultipleScenes 30 | 31 | UISceneConfigurations 32 | 33 | UIWindowSceneSessionRoleApplication 34 | 35 | 36 | UISceneConfigurationName 37 | Default Configuration 38 | UISceneDelegateClassName 39 | $(PRODUCT_MODULE_NAME).SceneDelegate 40 | UISceneStoryboardFile 41 | Main 42 | 43 | 44 | 45 | 46 | UILaunchStoryboardName 47 | LaunchScreen 48 | UIMainStoryboardFile 49 | Main 50 | UIRequiredDeviceCapabilities 51 | 52 | armv7 53 | arkit 54 | 55 | UISupportedInterfaceOrientations 56 | 57 | UIInterfaceOrientationPortrait 58 | UIInterfaceOrientationLandscapeLeft 59 | UIInterfaceOrientationLandscapeRight 60 | 61 | UISupportedInterfaceOrientations~ipad 62 | 63 | UIInterfaceOrientationPortrait 64 | UIInterfaceOrientationPortraitUpsideDown 65 | UIInterfaceOrientationLandscapeLeft 66 | UIInterfaceOrientationLandscapeRight 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /Node Demos/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Node Demos/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // Node Demos 4 | // 5 | // Created by Hal Mueller on 10/11/19. 6 | // Copyright © 2019 Project Dent. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // swiftlint:disable all 12 | // This file is an Apple template and it's not worth our time to make it pass swiftlint for a demo. 13 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 14 | 15 | var window: UIWindow? 16 | 17 | 18 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 19 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 20 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 21 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 22 | guard let _ = (scene as? UIWindowScene) else { return } 23 | } 24 | 25 | func sceneDidDisconnect(_ scene: UIScene) { 26 | // Called as the scene is being released by the system. 27 | // This occurs shortly after the scene enters the background, or when its session is discarded. 28 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 29 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 30 | } 31 | 32 | func sceneDidBecomeActive(_ scene: UIScene) { 33 | // Called when the scene has moved from an inactive state to an active state. 34 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 35 | } 36 | 37 | func sceneWillResignActive(_ scene: UIScene) { 38 | // Called when the scene will move from an active state to an inactive state. 39 | // This may occur due to temporary interruptions (ex. an incoming phone call). 40 | } 41 | 42 | func sceneWillEnterForeground(_ scene: UIScene) { 43 | // Called as the scene transitions from the background to the foreground. 44 | // Use this method to undo the changes made on entering the background. 45 | } 46 | 47 | func sceneDidEnterBackground(_ scene: UIScene) { 48 | // Called as the scene transitions from the foreground to the background. 49 | // Use this method to save data, release shared resources, and store enough scene-specific state information 50 | // to restore the scene back to its current state. 51 | } 52 | 53 | 54 | } 55 | 56 | -------------------------------------------------------------------------------- /Node DemosTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Node DemosTests/Node_DemosTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Node_DemosTests.swift 3 | // Node DemosTests 4 | // 5 | // Created by Hal Mueller on 10/11/19. 6 | // Copyright © 2019 Project Dent. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import Node_Demos 11 | 12 | class NodeDemosTests: XCTestCase { 13 | 14 | override func setUp() { 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | } 21 | 22 | func testExample() { 23 | // This is an example of a functional test case. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testPerformanceExample() { 28 | // This is an example of a performance test case. 29 | self.measure { 30 | // Put the code you want to measure the time of here. 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Node DemosUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Node DemosUITests/Node_DemosUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Node_DemosUITests.swift 3 | // Node DemosUITests 4 | // 5 | // Created by Hal Mueller on 10/11/19. 6 | // Copyright © 2019 Project Dent. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class NodeDemosUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | 16 | // In UI tests it is usually best to stop immediately when a failure occurs. 17 | continueAfterFailure = false 18 | 19 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests 20 | // before they run. The setUp method is a good place to do this. 21 | } 22 | 23 | override func tearDown() { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | } 26 | 27 | func testExample() { 28 | // UI tests must launch the application that they test. 29 | let app = XCUIApplication() 30 | app.launch() 31 | 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | func testLaunchPerformance() { 37 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { 38 | // This measures how long it takes to launch your application. 39 | measure(metrics: [XCTOSSignpostMetric.applicationLaunch]) { 40 | XCUIApplication().launch() 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.0 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "ARCL", 8 | platforms: [ .iOS(.v9) ], 9 | products: [ 10 | // Products define the executables and libraries produced by a package, and make them visible to other packages. 11 | .library(name: "ARCL", targets: ["ARKit-CoreLocation"]) 12 | ], 13 | targets: [ 14 | .target(name: "ARKit-CoreLocation", dependencies: []) 15 | ] 16 | ) 17 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '11.0' 3 | use_frameworks! 4 | 5 | target 'ARKit+CoreLocation' do 6 | pod 'ARCL', :path => '.' 7 | 8 | target 'ARCLTests' do 9 | 10 | end 11 | end 12 | 13 | 14 | target 'Node Demos' do 15 | pod 'ARCL', :path => '.' 16 | 17 | target 'Node DemosTests' do 18 | 19 | end 20 | end 21 | 22 | 23 | post_install do |installer| 24 | installer.pods_project.targets.each do |target| 25 | target.build_configurations.each do |config| 26 | config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'YES' 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - ARCL (1.3.1) 3 | 4 | DEPENDENCIES: 5 | - ARCL (from `.`) 6 | 7 | EXTERNAL SOURCES: 8 | ARCL: 9 | :path: "." 10 | 11 | SPEC CHECKSUMS: 12 | ARCL: ba0770a5053d0119cf5b463cf2b6d639f41af387 13 | 14 | PODFILE CHECKSUM: 04e43f38027ede89f9e337472eda1d02b852e5c2 15 | 16 | COCOAPODS: 1.7.2 17 | -------------------------------------------------------------------------------- /Pods/Local Podspecs/ARCL.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ARCL", 3 | "version": "1.3.1", 4 | "summary": "ARKit + CoreLocation combines the high accuracy of AR with the scale of GPS data.", 5 | "homepage": "https://github.com/ProjectDent/arkit-corelocation", 6 | "authors": { 7 | "Andrew Hart": "Andrew@ProjectDent.com" 8 | }, 9 | "license": { 10 | "type": "MIT", 11 | "file": "LICENSE" 12 | }, 13 | "source": { 14 | "git": "https://ProjectDent@github.com/ProjectDent/ARKit-CoreLocation.git", 15 | "tag": "1.3.1", 16 | "submodules": false 17 | }, 18 | "platforms": { 19 | "ios": "9.0" 20 | }, 21 | "swift_versions": "5.0", 22 | "requires_arc": true, 23 | "source_files": "Sources/**/*.{swift}", 24 | "frameworks": [ 25 | "Foundation", 26 | "UIKit", 27 | "CoreLocation", 28 | "MapKit", 29 | "SceneKit" 30 | ], 31 | "weak_frameworks": "ARKit", 32 | "swift_version": "5.0" 33 | } 34 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - ARCL (1.3.1) 3 | 4 | DEPENDENCIES: 5 | - ARCL (from `.`) 6 | 7 | EXTERNAL SOURCES: 8 | ARCL: 9 | :path: "." 10 | 11 | SPEC CHECKSUMS: 12 | ARCL: ba0770a5053d0119cf5b463cf2b6d639f41af387 13 | 14 | PODFILE CHECKSUM: 04e43f38027ede89f9e337472eda1d02b852e5c2 15 | 16 | COCOAPODS: 1.7.2 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ARCL/ARCL-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.3.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ARCL/ARCL-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_ARCL : NSObject 3 | @end 4 | @implementation PodsDummy_ARCL 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ARCL/ARCL-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ARCL/ARCL-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double ARCLVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char ARCLVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ARCL/ARCL.modulemap: -------------------------------------------------------------------------------- 1 | framework module ARCL { 2 | umbrella header "ARCL-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ARCL/ARCL.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/ARCL 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "CoreLocation" -framework "Foundation" -framework "MapKit" -framework "SceneKit" -framework "UIKit" -weak_framework "ARKit" 4 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/.. 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation-ARCLTests/Pods-ARKit+CoreLocation-ARCLTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation-ARCLTests/Pods-ARKit+CoreLocation-ARCLTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## ARCL 5 | 6 | MIT License 7 | 8 | Copyright (c) 2017 Project Dent (https://ProjectDent.com) 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | Generated by CocoaPods - https://cocoapods.org 28 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation-ARCLTests/Pods-ARKit+CoreLocation-ARCLTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | MIT License 18 | 19 | Copyright (c) 2017 Project Dent (https://ProjectDent.com) 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | License 39 | MIT 40 | Title 41 | ARCL 42 | Type 43 | PSGroupSpecifier 44 | 45 | 46 | FooterText 47 | Generated by CocoaPods - https://cocoapods.org 48 | Title 49 | 50 | Type 51 | PSGroupSpecifier 52 | 53 | 54 | StringsTable 55 | Acknowledgements 56 | Title 57 | Acknowledgements 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation-ARCLTests/Pods-ARKit+CoreLocation-ARCLTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ARKit_CoreLocation_ARCLTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ARKit_CoreLocation_ARCLTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation-ARCLTests/Pods-ARKit+CoreLocation-ARCLTests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | 23 | # Used as a return value for each invocation of `strip_invalid_archs` function. 24 | STRIP_BINARY_RETVAL=0 25 | 26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 29 | 30 | # Copies and strips a vendored framework 31 | install_framework() 32 | { 33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 34 | local source="${BUILT_PRODUCTS_DIR}/$1" 35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 37 | elif [ -r "$1" ]; then 38 | local source="$1" 39 | fi 40 | 41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 42 | 43 | if [ -L "${source}" ]; then 44 | echo "Symlinked..." 45 | source="$(readlink "${source}")" 46 | fi 47 | 48 | # Use filter instead of exclude so missing patterns don't throw errors. 49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 51 | 52 | local basename 53 | basename="$(basename -s .framework "$1")" 54 | binary="${destination}/${basename}.framework/${basename}" 55 | 56 | if ! [ -r "$binary" ]; then 57 | binary="${destination}/${basename}" 58 | elif [ -L "${binary}" ]; then 59 | echo "Destination binary is symlinked..." 60 | dirname="$(dirname "${binary}")" 61 | binary="${dirname}/$(readlink "${binary}")" 62 | fi 63 | 64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 66 | strip_invalid_archs "$binary" 67 | fi 68 | 69 | # Resign the code if required by the build settings to avoid unstable apps 70 | code_sign_if_enabled "${destination}/$(basename "$1")" 71 | 72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 74 | local swift_runtime_libs 75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 76 | for lib in $swift_runtime_libs; do 77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 79 | code_sign_if_enabled "${destination}/${lib}" 80 | done 81 | fi 82 | } 83 | 84 | # Copies and strips a vendored dSYM 85 | install_dsym() { 86 | local source="$1" 87 | if [ -r "$source" ]; then 88 | # Copy the dSYM into a the targets temp dir. 89 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 90 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 91 | 92 | local basename 93 | basename="$(basename -s .framework.dSYM "$source")" 94 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 95 | 96 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 97 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then 98 | strip_invalid_archs "$binary" 99 | fi 100 | 101 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 102 | # Move the stripped file into its final destination. 103 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 104 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 105 | else 106 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 107 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 108 | fi 109 | fi 110 | } 111 | 112 | # Copies the bcsymbolmap files of a vendored framework 113 | install_bcsymbolmap() { 114 | local bcsymbolmap_path="$1" 115 | local destination="${BUILT_PRODUCTS_DIR}" 116 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" 117 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" 118 | } 119 | 120 | # Signs a framework with the provided identity 121 | code_sign_if_enabled() { 122 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 123 | # Use the current code_sign_identity 124 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 125 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 126 | 127 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 128 | code_sign_cmd="$code_sign_cmd &" 129 | fi 130 | echo "$code_sign_cmd" 131 | eval "$code_sign_cmd" 132 | fi 133 | } 134 | 135 | # Strip invalid architectures 136 | strip_invalid_archs() { 137 | binary="$1" 138 | # Get architectures for current target binary 139 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 140 | # Intersect them with the architectures we are building for 141 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 142 | # If there are no archs supported by this binary then warn the user 143 | if [[ -z "$intersected_archs" ]]; then 144 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 145 | STRIP_BINARY_RETVAL=0 146 | return 147 | fi 148 | stripped="" 149 | for arch in $binary_archs; do 150 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 151 | # Strip non-valid architectures in-place 152 | lipo -remove "$arch" -output "$binary" "$binary" 153 | stripped="$stripped $arch" 154 | fi 155 | done 156 | if [[ "$stripped" ]]; then 157 | echo "Stripped $binary of architectures:$stripped" 158 | fi 159 | STRIP_BINARY_RETVAL=1 160 | } 161 | 162 | 163 | if [[ "$CONFIGURATION" == "Debug" ]]; then 164 | install_framework "${BUILT_PRODUCTS_DIR}/ARCL/ARCL.framework" 165 | fi 166 | if [[ "$CONFIGURATION" == "Release" ]]; then 167 | install_framework "${BUILT_PRODUCTS_DIR}/ARCL/ARCL.framework" 168 | fi 169 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 170 | wait 171 | fi 172 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation-ARCLTests/Pods-ARKit+CoreLocation-ARCLTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_ARKit_CoreLocation_ARCLTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ARKit_CoreLocation_ARCLTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation-ARCLTests/Pods-ARKit+CoreLocation-ARCLTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL/ARCL.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "ARCL" -framework "CoreLocation" -framework "Foundation" -framework "MapKit" -framework "SceneKit" -framework "UIKit" -weak_framework "ARKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation-ARCLTests/Pods-ARKit+CoreLocation-ARCLTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_ARKit_CoreLocation_ARCLTests { 2 | umbrella header "Pods-ARKit+CoreLocation-ARCLTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation-ARCLTests/Pods-ARKit+CoreLocation-ARCLTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL/ARCL.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "ARCL" -framework "CoreLocation" -framework "Foundation" -framework "MapKit" -framework "SceneKit" -framework "UIKit" -weak_framework "ARKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation/Pods-ARKit+CoreLocation-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation/Pods-ARKit+CoreLocation-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## ARCL 5 | 6 | MIT License 7 | 8 | Copyright (c) 2017 Project Dent (https://ProjectDent.com) 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | Generated by CocoaPods - https://cocoapods.org 28 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation/Pods-ARKit+CoreLocation-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | MIT License 18 | 19 | Copyright (c) 2017 Project Dent (https://ProjectDent.com) 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | License 39 | MIT 40 | Title 41 | ARCL 42 | Type 43 | PSGroupSpecifier 44 | 45 | 46 | FooterText 47 | Generated by CocoaPods - https://cocoapods.org 48 | Title 49 | 50 | Type 51 | PSGroupSpecifier 52 | 53 | 54 | StringsTable 55 | Acknowledgements 56 | Title 57 | Acknowledgements 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation/Pods-ARKit+CoreLocation-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ARKit_CoreLocation : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ARKit_CoreLocation 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation/Pods-ARKit+CoreLocation-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | 23 | # Used as a return value for each invocation of `strip_invalid_archs` function. 24 | STRIP_BINARY_RETVAL=0 25 | 26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 29 | 30 | # Copies and strips a vendored framework 31 | install_framework() 32 | { 33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 34 | local source="${BUILT_PRODUCTS_DIR}/$1" 35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 37 | elif [ -r "$1" ]; then 38 | local source="$1" 39 | fi 40 | 41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 42 | 43 | if [ -L "${source}" ]; then 44 | echo "Symlinked..." 45 | source="$(readlink "${source}")" 46 | fi 47 | 48 | # Use filter instead of exclude so missing patterns don't throw errors. 49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 51 | 52 | local basename 53 | basename="$(basename -s .framework "$1")" 54 | binary="${destination}/${basename}.framework/${basename}" 55 | 56 | if ! [ -r "$binary" ]; then 57 | binary="${destination}/${basename}" 58 | elif [ -L "${binary}" ]; then 59 | echo "Destination binary is symlinked..." 60 | dirname="$(dirname "${binary}")" 61 | binary="${dirname}/$(readlink "${binary}")" 62 | fi 63 | 64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 66 | strip_invalid_archs "$binary" 67 | fi 68 | 69 | # Resign the code if required by the build settings to avoid unstable apps 70 | code_sign_if_enabled "${destination}/$(basename "$1")" 71 | 72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 74 | local swift_runtime_libs 75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 76 | for lib in $swift_runtime_libs; do 77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 79 | code_sign_if_enabled "${destination}/${lib}" 80 | done 81 | fi 82 | } 83 | 84 | # Copies and strips a vendored dSYM 85 | install_dsym() { 86 | local source="$1" 87 | if [ -r "$source" ]; then 88 | # Copy the dSYM into a the targets temp dir. 89 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 90 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 91 | 92 | local basename 93 | basename="$(basename -s .framework.dSYM "$source")" 94 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 95 | 96 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 97 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then 98 | strip_invalid_archs "$binary" 99 | fi 100 | 101 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 102 | # Move the stripped file into its final destination. 103 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 104 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 105 | else 106 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 107 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 108 | fi 109 | fi 110 | } 111 | 112 | # Copies the bcsymbolmap files of a vendored framework 113 | install_bcsymbolmap() { 114 | local bcsymbolmap_path="$1" 115 | local destination="${BUILT_PRODUCTS_DIR}" 116 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" 117 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" 118 | } 119 | 120 | # Signs a framework with the provided identity 121 | code_sign_if_enabled() { 122 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 123 | # Use the current code_sign_identity 124 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 125 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 126 | 127 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 128 | code_sign_cmd="$code_sign_cmd &" 129 | fi 130 | echo "$code_sign_cmd" 131 | eval "$code_sign_cmd" 132 | fi 133 | } 134 | 135 | # Strip invalid architectures 136 | strip_invalid_archs() { 137 | binary="$1" 138 | # Get architectures for current target binary 139 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 140 | # Intersect them with the architectures we are building for 141 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 142 | # If there are no archs supported by this binary then warn the user 143 | if [[ -z "$intersected_archs" ]]; then 144 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 145 | STRIP_BINARY_RETVAL=0 146 | return 147 | fi 148 | stripped="" 149 | for arch in $binary_archs; do 150 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 151 | # Strip non-valid architectures in-place 152 | lipo -remove "$arch" -output "$binary" "$binary" 153 | stripped="$stripped $arch" 154 | fi 155 | done 156 | if [[ "$stripped" ]]; then 157 | echo "Stripped $binary of architectures:$stripped" 158 | fi 159 | STRIP_BINARY_RETVAL=1 160 | } 161 | 162 | 163 | if [[ "$CONFIGURATION" == "Debug" ]]; then 164 | install_framework "${BUILT_PRODUCTS_DIR}/ARCL/ARCL.framework" 165 | fi 166 | if [[ "$CONFIGURATION" == "Release" ]]; then 167 | install_framework "${BUILT_PRODUCTS_DIR}/ARCL/ARCL.framework" 168 | fi 169 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 170 | wait 171 | fi 172 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation/Pods-ARKit+CoreLocation-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_ARKit_CoreLocationVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_ARKit_CoreLocationVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation/Pods-ARKit+CoreLocation.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL/ARCL.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "ARCL" -framework "CoreLocation" -framework "Foundation" -framework "MapKit" -framework "SceneKit" -framework "UIKit" -weak_framework "ARKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation/Pods-ARKit+CoreLocation.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_ARKit_CoreLocation { 2 | umbrella header "Pods-ARKit+CoreLocation-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ARKit+CoreLocation/Pods-ARKit+CoreLocation.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL/ARCL.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "ARCL" -framework "CoreLocation" -framework "Foundation" -framework "MapKit" -framework "SceneKit" -framework "UIKit" -weak_framework "ARKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos-Node DemosTests/Pods-Node Demos-Node DemosTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos-Node DemosTests/Pods-Node Demos-Node DemosTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## ARCL 5 | 6 | MIT License 7 | 8 | Copyright (c) 2017 Project Dent (https://ProjectDent.com) 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | Generated by CocoaPods - https://cocoapods.org 28 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos-Node DemosTests/Pods-Node Demos-Node DemosTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | MIT License 18 | 19 | Copyright (c) 2017 Project Dent (https://ProjectDent.com) 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | License 39 | MIT 40 | Title 41 | ARCL 42 | Type 43 | PSGroupSpecifier 44 | 45 | 46 | FooterText 47 | Generated by CocoaPods - https://cocoapods.org 48 | Title 49 | 50 | Type 51 | PSGroupSpecifier 52 | 53 | 54 | StringsTable 55 | Acknowledgements 56 | Title 57 | Acknowledgements 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos-Node DemosTests/Pods-Node Demos-Node DemosTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Node_Demos_Node_DemosTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Node_Demos_Node_DemosTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos-Node DemosTests/Pods-Node Demos-Node DemosTests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | 23 | # Used as a return value for each invocation of `strip_invalid_archs` function. 24 | STRIP_BINARY_RETVAL=0 25 | 26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 29 | 30 | # Copies and strips a vendored framework 31 | install_framework() 32 | { 33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 34 | local source="${BUILT_PRODUCTS_DIR}/$1" 35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 37 | elif [ -r "$1" ]; then 38 | local source="$1" 39 | fi 40 | 41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 42 | 43 | if [ -L "${source}" ]; then 44 | echo "Symlinked..." 45 | source="$(readlink "${source}")" 46 | fi 47 | 48 | # Use filter instead of exclude so missing patterns don't throw errors. 49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 51 | 52 | local basename 53 | basename="$(basename -s .framework "$1")" 54 | binary="${destination}/${basename}.framework/${basename}" 55 | 56 | if ! [ -r "$binary" ]; then 57 | binary="${destination}/${basename}" 58 | elif [ -L "${binary}" ]; then 59 | echo "Destination binary is symlinked..." 60 | dirname="$(dirname "${binary}")" 61 | binary="${dirname}/$(readlink "${binary}")" 62 | fi 63 | 64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 66 | strip_invalid_archs "$binary" 67 | fi 68 | 69 | # Resign the code if required by the build settings to avoid unstable apps 70 | code_sign_if_enabled "${destination}/$(basename "$1")" 71 | 72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 74 | local swift_runtime_libs 75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 76 | for lib in $swift_runtime_libs; do 77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 79 | code_sign_if_enabled "${destination}/${lib}" 80 | done 81 | fi 82 | } 83 | 84 | # Copies and strips a vendored dSYM 85 | install_dsym() { 86 | local source="$1" 87 | if [ -r "$source" ]; then 88 | # Copy the dSYM into a the targets temp dir. 89 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 90 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 91 | 92 | local basename 93 | basename="$(basename -s .framework.dSYM "$source")" 94 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 95 | 96 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 97 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then 98 | strip_invalid_archs "$binary" 99 | fi 100 | 101 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 102 | # Move the stripped file into its final destination. 103 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 104 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 105 | else 106 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 107 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 108 | fi 109 | fi 110 | } 111 | 112 | # Copies the bcsymbolmap files of a vendored framework 113 | install_bcsymbolmap() { 114 | local bcsymbolmap_path="$1" 115 | local destination="${BUILT_PRODUCTS_DIR}" 116 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" 117 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" 118 | } 119 | 120 | # Signs a framework with the provided identity 121 | code_sign_if_enabled() { 122 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 123 | # Use the current code_sign_identity 124 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 125 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 126 | 127 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 128 | code_sign_cmd="$code_sign_cmd &" 129 | fi 130 | echo "$code_sign_cmd" 131 | eval "$code_sign_cmd" 132 | fi 133 | } 134 | 135 | # Strip invalid architectures 136 | strip_invalid_archs() { 137 | binary="$1" 138 | # Get architectures for current target binary 139 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 140 | # Intersect them with the architectures we are building for 141 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 142 | # If there are no archs supported by this binary then warn the user 143 | if [[ -z "$intersected_archs" ]]; then 144 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 145 | STRIP_BINARY_RETVAL=0 146 | return 147 | fi 148 | stripped="" 149 | for arch in $binary_archs; do 150 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 151 | # Strip non-valid architectures in-place 152 | lipo -remove "$arch" -output "$binary" "$binary" 153 | stripped="$stripped $arch" 154 | fi 155 | done 156 | if [[ "$stripped" ]]; then 157 | echo "Stripped $binary of architectures:$stripped" 158 | fi 159 | STRIP_BINARY_RETVAL=1 160 | } 161 | 162 | 163 | if [[ "$CONFIGURATION" == "Debug" ]]; then 164 | install_framework "${BUILT_PRODUCTS_DIR}/ARCL/ARCL.framework" 165 | fi 166 | if [[ "$CONFIGURATION" == "Release" ]]; then 167 | install_framework "${BUILT_PRODUCTS_DIR}/ARCL/ARCL.framework" 168 | fi 169 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 170 | wait 171 | fi 172 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos-Node DemosTests/Pods-Node Demos-Node DemosTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_Node_Demos_Node_DemosTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_Node_Demos_Node_DemosTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos-Node DemosTests/Pods-Node Demos-Node DemosTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL/ARCL.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "ARCL" -framework "CoreLocation" -framework "Foundation" -framework "MapKit" -framework "SceneKit" -framework "UIKit" -weak_framework "ARKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos-Node DemosTests/Pods-Node Demos-Node DemosTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_Node_Demos_Node_DemosTests { 2 | umbrella header "Pods-Node Demos-Node DemosTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos-Node DemosTests/Pods-Node Demos-Node DemosTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL/ARCL.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "ARCL" -framework "CoreLocation" -framework "Foundation" -framework "MapKit" -framework "SceneKit" -framework "UIKit" -weak_framework "ARKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos/Pods-Node Demos-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos/Pods-Node Demos-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## ARCL 5 | 6 | MIT License 7 | 8 | Copyright (c) 2017 Project Dent (https://ProjectDent.com) 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | Generated by CocoaPods - https://cocoapods.org 28 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos/Pods-Node Demos-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | MIT License 18 | 19 | Copyright (c) 2017 Project Dent (https://ProjectDent.com) 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a copy 22 | of this software and associated documentation files (the "Software"), to deal 23 | in the Software without restriction, including without limitation the rights 24 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | copies of the Software, and to permit persons to whom the Software is 26 | furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | SOFTWARE. 38 | License 39 | MIT 40 | Title 41 | ARCL 42 | Type 43 | PSGroupSpecifier 44 | 45 | 46 | FooterText 47 | Generated by CocoaPods - https://cocoapods.org 48 | Title 49 | 50 | Type 51 | PSGroupSpecifier 52 | 53 | 54 | StringsTable 55 | Acknowledgements 56 | Title 57 | Acknowledgements 58 | 59 | 60 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos/Pods-Node Demos-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Node_Demos : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Node_Demos 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos/Pods-Node Demos-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | 23 | # Used as a return value for each invocation of `strip_invalid_archs` function. 24 | STRIP_BINARY_RETVAL=0 25 | 26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 29 | 30 | # Copies and strips a vendored framework 31 | install_framework() 32 | { 33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 34 | local source="${BUILT_PRODUCTS_DIR}/$1" 35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 37 | elif [ -r "$1" ]; then 38 | local source="$1" 39 | fi 40 | 41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 42 | 43 | if [ -L "${source}" ]; then 44 | echo "Symlinked..." 45 | source="$(readlink "${source}")" 46 | fi 47 | 48 | # Use filter instead of exclude so missing patterns don't throw errors. 49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 51 | 52 | local basename 53 | basename="$(basename -s .framework "$1")" 54 | binary="${destination}/${basename}.framework/${basename}" 55 | 56 | if ! [ -r "$binary" ]; then 57 | binary="${destination}/${basename}" 58 | elif [ -L "${binary}" ]; then 59 | echo "Destination binary is symlinked..." 60 | dirname="$(dirname "${binary}")" 61 | binary="${dirname}/$(readlink "${binary}")" 62 | fi 63 | 64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 66 | strip_invalid_archs "$binary" 67 | fi 68 | 69 | # Resign the code if required by the build settings to avoid unstable apps 70 | code_sign_if_enabled "${destination}/$(basename "$1")" 71 | 72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 74 | local swift_runtime_libs 75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 76 | for lib in $swift_runtime_libs; do 77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 79 | code_sign_if_enabled "${destination}/${lib}" 80 | done 81 | fi 82 | } 83 | 84 | # Copies and strips a vendored dSYM 85 | install_dsym() { 86 | local source="$1" 87 | if [ -r "$source" ]; then 88 | # Copy the dSYM into a the targets temp dir. 89 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 90 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 91 | 92 | local basename 93 | basename="$(basename -s .framework.dSYM "$source")" 94 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 95 | 96 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 97 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then 98 | strip_invalid_archs "$binary" 99 | fi 100 | 101 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 102 | # Move the stripped file into its final destination. 103 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 104 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 105 | else 106 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 107 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 108 | fi 109 | fi 110 | } 111 | 112 | # Copies the bcsymbolmap files of a vendored framework 113 | install_bcsymbolmap() { 114 | local bcsymbolmap_path="$1" 115 | local destination="${BUILT_PRODUCTS_DIR}" 116 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" 117 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" 118 | } 119 | 120 | # Signs a framework with the provided identity 121 | code_sign_if_enabled() { 122 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 123 | # Use the current code_sign_identity 124 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 125 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 126 | 127 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 128 | code_sign_cmd="$code_sign_cmd &" 129 | fi 130 | echo "$code_sign_cmd" 131 | eval "$code_sign_cmd" 132 | fi 133 | } 134 | 135 | # Strip invalid architectures 136 | strip_invalid_archs() { 137 | binary="$1" 138 | # Get architectures for current target binary 139 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 140 | # Intersect them with the architectures we are building for 141 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 142 | # If there are no archs supported by this binary then warn the user 143 | if [[ -z "$intersected_archs" ]]; then 144 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 145 | STRIP_BINARY_RETVAL=0 146 | return 147 | fi 148 | stripped="" 149 | for arch in $binary_archs; do 150 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 151 | # Strip non-valid architectures in-place 152 | lipo -remove "$arch" -output "$binary" "$binary" 153 | stripped="$stripped $arch" 154 | fi 155 | done 156 | if [[ "$stripped" ]]; then 157 | echo "Stripped $binary of architectures:$stripped" 158 | fi 159 | STRIP_BINARY_RETVAL=1 160 | } 161 | 162 | 163 | if [[ "$CONFIGURATION" == "Debug" ]]; then 164 | install_framework "${BUILT_PRODUCTS_DIR}/ARCL/ARCL.framework" 165 | fi 166 | if [[ "$CONFIGURATION" == "Release" ]]; then 167 | install_framework "${BUILT_PRODUCTS_DIR}/ARCL/ARCL.framework" 168 | fi 169 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 170 | wait 171 | fi 172 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos/Pods-Node Demos-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_Node_DemosVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_Node_DemosVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos/Pods-Node Demos.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL/ARCL.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "ARCL" -framework "CoreLocation" -framework "Foundation" -framework "MapKit" -framework "SceneKit" -framework "UIKit" -weak_framework "ARKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos/Pods-Node Demos.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_Node_Demos { 2 | umbrella header "Pods-Node Demos-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-Node Demos/Pods-Node Demos.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/ARCL/ARCL.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "ARCL" -framework "CoreLocation" -framework "Foundation" -framework "MapKit" -framework "SceneKit" -framework "UIKit" -weak_framework "ARKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Sources/ARCL.h: -------------------------------------------------------------------------------- 1 | // 2 | // ARCL.h 3 | // ARCL 4 | // 5 | // Created by Aaron Brethorst on 5/29/18. 6 | // Copyright © 2018 Project Dent. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for ARCL. 12 | FOUNDATION_EXPORT double ARCLVersionNumber; 13 | 14 | //! Project version string for ARCL. 15 | FOUNDATION_EXPORT const unsigned char ARCLVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/ARKit_CoreLocation.swift: -------------------------------------------------------------------------------- 1 | struct ARKit_CoreLocation { 2 | // swiftlint:disable:previous type_name 3 | var text = "Hello, World!" 4 | } 5 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Extensions/BaseTypes+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseTypes+Extensions.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Ilya Seliverstov on 08/08/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public extension Double { 12 | var short: String { return String(format: "%.02f", self) } 13 | } 14 | 15 | public extension Float { 16 | var short: String { return String(format: "%.2f", self) } 17 | } 18 | 19 | public extension Int { 20 | var short: String { return String(format: "%02d", self) } 21 | var short3: String { return String(format: "%03d", self / 1_000_000) } 22 | } 23 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Extensions/CGPoint+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CGPoint+Extensions.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Andrew Hart on 03/07/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SceneKit 11 | 12 | extension CGPoint { 13 | static func pointWithVector(vector: SCNVector3) -> CGPoint { 14 | return CGPoint(x: CGFloat(vector.x), y: CGFloat(0 - vector.z)) 15 | } 16 | 17 | func radiusContainsPoint(radius: CGFloat, point: CGPoint) -> Bool { 18 | let x = pow(point.x - self.x, 2) 19 | let y = pow(point.y - self.y, 2) 20 | let radiusSquared = pow(radius, 2) 21 | 22 | return x + y <= radiusSquared 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Extensions/CLLocation+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CLLocation+Extensions.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Andrew Hart on 02/07/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CoreLocation 11 | 12 | ///Translation in meters between 2 locations 13 | public struct LocationTranslation { 14 | public var latitudeTranslation: Double 15 | public var longitudeTranslation: Double 16 | public var altitudeTranslation: Double 17 | 18 | /// This explicit definition is needed because the "free" init function is marked fileprivate by default, 19 | /// so LocationTranslation isn't available to client apps. 20 | public init(latitudeTranslation: Double, longitudeTranslation: Double, altitudeTranslation: Double) { 21 | self.latitudeTranslation = latitudeTranslation 22 | self.longitudeTranslation = longitudeTranslation 23 | self.altitudeTranslation = altitudeTranslation 24 | } 25 | } 26 | 27 | public extension CLLocation { 28 | convenience init(coordinate: CLLocationCoordinate2D, altitude: CLLocationDistance) { 29 | self.init(coordinate: coordinate, altitude: altitude, horizontalAccuracy: 0, verticalAccuracy: 0, timestamp: Date()) 30 | } 31 | 32 | /// Translates distance in meters between two locations. 33 | /// Returns the result as the distance in latitude and distance in longitude. 34 | /// The approximation used here gives reasonable accuracy out to a radius of 50 km except at high latitudes. 35 | /// TODO: rewrite .translation(toLocation:) to improve the accuracy. See unit test notes. 36 | func translation(toLocation location: CLLocation) -> LocationTranslation { 37 | let inbetweenLocation = CLLocation(latitude: self.coordinate.latitude, longitude: location.coordinate.longitude) 38 | 39 | let distanceLatitude = location.distance(from: inbetweenLocation) 40 | 41 | let latitudeTranslation = location.coordinate.latitude > inbetweenLocation.coordinate.latitude ? distanceLatitude 42 | : -distanceLatitude 43 | 44 | let distanceLongitude = distance(from: inbetweenLocation) 45 | 46 | let longitudeTranslation = coordinate.longitude > inbetweenLocation.coordinate.longitude ? -distanceLongitude 47 | : distanceLongitude 48 | 49 | let altitudeTranslation = location.altitude - self.altitude 50 | 51 | return LocationTranslation( latitudeTranslation: latitudeTranslation, 52 | longitudeTranslation: longitudeTranslation, 53 | altitudeTranslation: altitudeTranslation) 54 | } 55 | 56 | /// TODO: rewrite .translatedLocation(with:) to improve the accuracy. See unit test notes. 57 | func translatedLocation(with translation: LocationTranslation) -> CLLocation { 58 | let latitudeCoordinate = self.coordinate.coordinateWithBearing(bearing: 0, 59 | distanceMeters: translation.latitudeTranslation) 60 | 61 | let longitudeCoordinate = self.coordinate.coordinateWithBearing(bearing: 90, 62 | distanceMeters: translation.longitudeTranslation) 63 | // NB: Great Circle geometry means that abs(longitudeCoordinate.latitude) < abs(self.coordinate.latitude) 64 | // (or equal, if self is on the equator). 65 | let coordinate = CLLocationCoordinate2D( latitude: latitudeCoordinate.latitude, longitude: longitudeCoordinate.longitude) 66 | 67 | let altitude = self.altitude + translation.altitudeTranslation 68 | 69 | return CLLocation(coordinate: coordinate, 70 | altitude: altitude, 71 | horizontalAccuracy: self.horizontalAccuracy, 72 | verticalAccuracy: self.verticalAccuracy, 73 | timestamp: self.timestamp) 74 | } 75 | 76 | /// Bearing from `self` to another point. Returns bearing in +/- degrees from north 77 | /// This function uses the haversine formula to compute a geodesic (great circle), assuming a spherical earth. 78 | /// Note that, especially at high latitudes and with relatively distant points, `a.bearing(between: b)` 79 | /// is not necessarily 180 degrees opposite to `b.bearing(between: a)`. 80 | /// - Parameter point: second point to compute bearing to. 81 | func bearing(between point: CLLocation) -> Double { 82 | let lat1 = self.coordinate.latitude.degreesToRadians 83 | let lon1 = self.coordinate.longitude.degreesToRadians 84 | 85 | let lat2 = point.coordinate.latitude.degreesToRadians 86 | let lon2 = point.coordinate.longitude.degreesToRadians 87 | 88 | let dLon = lon2 - lon1 89 | 90 | let y = sin(dLon) * cos(lat2) 91 | let x = cos(lat1) * sin(lat2) - sin(lat1) * cos(lat2) * cos(dLon) 92 | return atan2(y, x).radiansToDegrees 93 | } 94 | 95 | /// Returns the midpoint between two locations 96 | /// Note: Only usable for short distances like MKPolyline segments 97 | func approxMidpoint(to: CLLocation) -> CLLocation { 98 | return CLLocation( 99 | coordinate: CLLocationCoordinate2D( 100 | latitude: (coordinate.latitude + to.coordinate.latitude) / 2, 101 | longitude: (coordinate.longitude + to.coordinate.longitude) / 2 102 | ), 103 | altitude: (altitude + to.altitude) / 2 104 | ) 105 | } // approxMidpoint(to:) 106 | 107 | } 108 | 109 | public extension CLLocation { 110 | var debugLog: String { 111 | return "location: \(self.coordinate), accuracy: \(self.horizontalAccuracy), date: \(self.timestamp)" 112 | } 113 | } 114 | 115 | public extension CLLocationCoordinate2D { 116 | 117 | /// Returns a new `CLLocationCoordinate2D` at the given bearing and distance from the original point. 118 | /// This function uses a great circle on ellipse formula. 119 | /// - Parameter bearing: bearing in degrees clockwise from north. 120 | /// - Parameter distanceMeters: distance in meters. 121 | func coordinateWithBearing(bearing: Double, distanceMeters: Double) -> CLLocationCoordinate2D { 122 | // From https://www.movable-type.co.uk/scripts/latlong.html: 123 | // All these formulas are for calculations on the basis of a spherical earth (ignoring ellipsoidal effects) – 124 | // which is accurate enough* for most purposes… [In fact, the earth is very slightly ellipsoidal; using a 125 | // spherical model gives errors typically up to 0.3%1 – see notes for further details]. 126 | // 127 | // Destination point given distance and bearing from start point** 128 | // 129 | // Given a start point, initial bearing, and distance, this will calculate the destina­tion point and 130 | // final bearing travelling along a (shortest distance) great circle arc. 131 | // 132 | // Formula: φ2 = asin( sin φ1 ⋅ cos δ + cos φ1 ⋅ sin δ ⋅ cos θ ) 133 | // λ2 = λ1 + atan2( sin θ ⋅ sin δ ⋅ cos φ1, cos δ − sin φ1 ⋅ sin φ2 ) 134 | // where φ is latitude, λ is longitude, θ is the bearing (clockwise from north), 135 | // δ is the angular distance d/R; d being the distance travelled, R the earth’s radius 136 | // 137 | // JavaScript: (all angles in radians) 138 | // var φ2 = Math.asin( Math.sin(φ1)*Math.cos(d/R) + 139 | // Math.cos(φ1)*Math.sin(d/R)*Math.cos(brng) ); 140 | // var λ2 = λ1 + Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(φ1), 141 | // Math.cos(d/R)-Math.sin(φ1)*Math.sin(φ2)); 142 | // The longitude can be normalised to −180…+180 using (lon+540)%360-180 143 | // 144 | // Excel: 145 | // (all angles 146 | // in radians) 147 | // lat2: =ASIN(SIN(lat1)*COS(d/R) + COS(lat1)*SIN(d/R)*COS(brng)) 148 | // lon2: =lon1 + ATAN2(COS(d/R)-SIN(lat1)*SIN(lat2), SIN(brng)*SIN(d/R)*COS(lat1)) 149 | // * Remember that Excel reverses the arguments to ATAN2 – see notes below 150 | // For final bearing, simply take the initial bearing from the end point to the start point and 151 | // reverse it with (brng+180)%360. 152 | // 153 | 154 | let phi = self.latitude.degreesToRadians 155 | let lambda = self.longitude.degreesToRadians 156 | let theta = bearing.degreesToRadians 157 | 158 | let sigma = distanceMeters / self.earthRadiusMeters() 159 | 160 | let phi2 = asin(sin(phi) * cos(sigma) + cos(phi) * sin(sigma) * cos(theta)) 161 | let lambda2 = lambda + atan2(sin(theta) * sin(sigma) * cos(phi), cos(sigma) - sin(phi) * sin(phi2)) 162 | 163 | let result = CLLocationCoordinate2D(latitude: phi2.radiansToDegrees, longitude: lambda2.radiansToDegrees) 164 | return result 165 | } 166 | 167 | /// Return the WGS-84 radius of the earth, in meters, at the given point. 168 | func earthRadiusMeters() -> Double { 169 | // source: https://planetcalc.com/7721/ from https://en.wikipedia.org/wiki/Earth_radius#Geocentric_radius 170 | let WGS84EquatorialRadius = 6_378_137.0 171 | let WGS84PolarRadius = 6_356_752.3 172 | 173 | // shorter versions to make formulas easier to read 174 | let a = WGS84EquatorialRadius 175 | let b = WGS84PolarRadius 176 | let phi = self.latitude.degreesToRadians 177 | 178 | let numerator = pow(a * a * cos(phi), 2) + pow(b * b * sin(phi), 2) 179 | let denominator = pow(a * cos(phi), 2) + pow(b * sin(phi), 2) 180 | let radius = sqrt(numerator/denominator) 181 | return radius 182 | } 183 | } 184 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Extensions/FloatingPoint+Radians.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FloatingPoint+Radians.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Andrew Hart on 03/07/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public extension FloatingPoint { 12 | var degreesToRadians: Self { return self * .pi / 180 } 13 | var radiansToDegrees: Self { return self * 180 / .pi } 14 | } 15 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Extensions/SCNNode+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SCNNode+Extensions.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Andrew Hart on 09/07/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import SceneKit 10 | 11 | extension SCNNode { 12 | /// Overlapping nodes require unique renderingOrder values to avoid flicker 13 | /// This method will select random values if you don't care which node is in front of the other, 14 | /// or you can specify a particular z-order value 15 | /// Note: rendering order will be changed later based on distance from camera 16 | func removeFlicker (withRenderingOrder renderingOrder: Int = Int.random(in: 1.. SCNNode { 25 | let quiverThickness = (quiverLength / 50.0) * quiverThickness 26 | let chamferRadius = quiverThickness / 2.0 27 | 28 | let xQuiverBox = SCNBox(width: quiverLength, 29 | height: quiverThickness, 30 | length: quiverThickness, 31 | chamferRadius: chamferRadius) 32 | xQuiverBox.firstMaterial?.diffuse.contents = UIColor.red 33 | let xQuiverNode = SCNNode(geometry: xQuiverBox) 34 | xQuiverNode.position = SCNVector3Make(Float(quiverLength / 2.0), 0.0, 0.0) 35 | 36 | let yQuiverBox = SCNBox(width: quiverThickness, 37 | height: quiverLength, 38 | length: quiverThickness, 39 | chamferRadius: chamferRadius) 40 | yQuiverBox.firstMaterial?.diffuse.contents = UIColor.green 41 | let yQuiverNode = SCNNode(geometry: yQuiverBox) 42 | yQuiverNode.position = SCNVector3Make(0.0, Float(quiverLength / 2.0), 0.0) 43 | 44 | let zQuiverBox = SCNBox(width: quiverThickness, 45 | height: quiverThickness, 46 | length: quiverLength, 47 | chamferRadius: chamferRadius) 48 | zQuiverBox.firstMaterial?.diffuse.contents = UIColor.blue 49 | let zQuiverNode = SCNNode(geometry: zQuiverBox) 50 | zQuiverNode.position = SCNVector3Make(0.0, 0.0, Float(quiverLength / 2.0)) 51 | 52 | let quiverNode = SCNNode() 53 | quiverNode.addChildNode(xQuiverNode) 54 | quiverNode.addChildNode(yQuiverNode) 55 | quiverNode.addChildNode(zQuiverNode) 56 | quiverNode.name = "Axes" 57 | return quiverNode 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Extensions/SCNVector3+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SCNVecto3+Extensions.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Andrew Hart on 23/07/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import SceneKit 10 | 11 | public extension SCNVector3 { 12 | ///Calculates distance between vectors 13 | ///Doesn't include the y axis, matches functionality of CLLocation 'distance' function. 14 | func distance(to anotherVector: SCNVector3) -> Float { 15 | return sqrt(pow(anotherVector.x - x, 2) + pow(anotherVector.z - z, 2)) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Location Manager/LocationManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LocationManager.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Andrew Hart on 02/07/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CoreLocation 11 | 12 | protocol LocationManagerDelegate: class { 13 | func locationManagerDidUpdateLocation(_ locationManager: LocationManager, 14 | location: CLLocation) 15 | func locationManagerDidUpdateHeading(_ locationManager: LocationManager, 16 | heading: CLLocationDirection, 17 | accuracy: CLLocationDirection) 18 | } 19 | 20 | extension LocationManagerDelegate { 21 | func locationManagerDidUpdateLocation(_ locationManager: LocationManager, 22 | location: CLLocation) { } 23 | 24 | func locationManagerDidUpdateHeading(_ locationManager: LocationManager, 25 | heading: CLLocationDirection, 26 | accuracy: CLLocationDirection) { } 27 | } 28 | 29 | /// Handles retrieving the location and heading from CoreLocation 30 | /// Does not contain anything related to ARKit or advanced location 31 | public class LocationManager: NSObject { 32 | weak var delegate: LocationManagerDelegate? 33 | 34 | private var locationManager: CLLocationManager? 35 | 36 | var currentLocation: CLLocation? 37 | 38 | private(set) public var heading: CLLocationDirection? 39 | private(set) public var headingAccuracy: CLLocationDirection? 40 | 41 | override init() { 42 | super.init() 43 | 44 | self.locationManager = CLLocationManager() 45 | self.locationManager!.desiredAccuracy = kCLLocationAccuracyBestForNavigation 46 | self.locationManager!.distanceFilter = kCLDistanceFilterNone 47 | self.locationManager!.headingFilter = kCLHeadingFilterNone 48 | self.locationManager!.pausesLocationUpdatesAutomatically = false 49 | self.locationManager!.delegate = self 50 | self.locationManager!.startUpdatingHeading() 51 | self.locationManager!.startUpdatingLocation() 52 | 53 | self.locationManager!.requestWhenInUseAuthorization() 54 | 55 | self.currentLocation = self.locationManager!.location 56 | } 57 | 58 | func requestAuthorization() { 59 | if CLLocationManager.authorizationStatus() == .authorizedAlways || 60 | CLLocationManager.authorizationStatus() == .authorizedWhenInUse { 61 | return 62 | } 63 | 64 | if CLLocationManager.authorizationStatus() == .denied || 65 | CLLocationManager.authorizationStatus() == .restricted { 66 | return 67 | } 68 | 69 | locationManager?.requestWhenInUseAuthorization() 70 | } 71 | } 72 | 73 | // MARK: - CLLocationManagerDelegate 74 | 75 | extension LocationManager: CLLocationManagerDelegate { 76 | 77 | public func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { 78 | 79 | } 80 | 81 | public func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { 82 | locations.forEach { 83 | delegate?.locationManagerDidUpdateLocation(self, location: $0) 84 | } 85 | 86 | self.currentLocation = manager.location 87 | } 88 | 89 | public func locationManager(_ manager: CLLocationManager, didUpdateHeading newHeading: CLHeading) { 90 | heading = newHeading.headingAccuracy >= 0 ? newHeading.trueHeading : newHeading.magneticHeading 91 | headingAccuracy = newHeading.headingAccuracy 92 | 93 | delegate?.locationManagerDidUpdateHeading(self, heading: heading!, accuracy: newHeading.headingAccuracy) 94 | } 95 | 96 | public func locationManagerShouldDisplayHeadingCalibration(_ manager: CLLocationManager) -> Bool { 97 | return true 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Location Manager/SceneLocationEstimate+Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneLocationEstimate+Extensions.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Andrew Hart on 16/07/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import CoreLocation 10 | import SceneKit 11 | 12 | extension SceneLocationEstimate { 13 | ///Compares the location's position to another position, to determine the translation between them 14 | public func locationTranslation(to position: SCNVector3) -> LocationTranslation { 15 | return LocationTranslation( 16 | latitudeTranslation: Double(self.position.z - position.z), 17 | longitudeTranslation: Double(position.x - self.position.x), 18 | altitudeTranslation: Double(position.y - self.position.y)) 19 | } 20 | 21 | ///Translates the location by comparing with a given position 22 | public func translatedLocation(to position: SCNVector3) -> CLLocation { 23 | let translation = self.locationTranslation(to: position) 24 | let translatedLocation = self.location.translatedLocation(with: translation) 25 | 26 | return translatedLocation 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Location Manager/SceneLocationEstimate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneLocationEstimate.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Andrew Hart on 03/07/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CoreLocation 11 | import SceneKit 12 | 13 | public class SceneLocationEstimate { 14 | public let location: CLLocation 15 | public let position: SCNVector3 16 | 17 | init(location: CLLocation, position: SCNVector3) { 18 | self.location = location 19 | self.position = position 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Location Manager/SceneLocationManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneLocationManager.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Ilya Seliverstov on 10/08/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import ARKit 11 | import CoreLocation 12 | import MapKit 13 | 14 | ///Different methods which can be used when determining locations (such as the user's location). 15 | public enum LocationEstimateMethod { 16 | ///Only uses Core Location data. 17 | ///Not suitable for adding nodes using current position, which requires more precision. 18 | case coreLocationDataOnly 19 | 20 | ///Combines knowledge about movement through the AR world with 21 | ///the most relevant Core Location estimate (based on accuracy and time). 22 | case mostRelevantEstimate 23 | } 24 | 25 | protocol SceneLocationManagerDelegate: class { 26 | var scenePosition: SCNVector3? { get } 27 | 28 | func confirmLocationOfDistantLocationNodes() 29 | func updatePositionAndScaleOfLocationNodes() 30 | 31 | func didAddSceneLocationEstimate(position: SCNVector3, location: CLLocation) 32 | func didRemoveSceneLocationEstimate(position: SCNVector3, location: CLLocation) 33 | } 34 | 35 | public final class SceneLocationManager { 36 | weak var sceneLocationDelegate: SceneLocationManagerDelegate? 37 | 38 | public var locationEstimateMethod: LocationEstimateMethod = .mostRelevantEstimate 39 | public let locationManager = LocationManager() 40 | 41 | var sceneLocationEstimates = [SceneLocationEstimate]() 42 | 43 | var updateEstimatesTimer: Timer? 44 | 45 | /// The best estimation of location that has been taken 46 | /// This takes into account horizontal accuracy, and the time at which the estimation was taken 47 | /// favouring the most accurate, and then the most recent result. 48 | /// This doesn't indicate where the user currently is. 49 | public var bestLocationEstimate: SceneLocationEstimate? { 50 | let sortedLocationEstimates = sceneLocationEstimates.sorted(by: { 51 | if $0.location.horizontalAccuracy == $1.location.horizontalAccuracy { 52 | return $0.location.timestamp > $1.location.timestamp 53 | } 54 | 55 | return $0.location.horizontalAccuracy < $1.location.horizontalAccuracy 56 | }) 57 | 58 | return sortedLocationEstimates.first 59 | } 60 | 61 | public var currentLocation: CLLocation? { 62 | if locationEstimateMethod == .coreLocationDataOnly { return locationManager.currentLocation } 63 | 64 | guard let bestEstimate = bestLocationEstimate, 65 | let position = sceneLocationDelegate?.scenePosition else { return nil } 66 | 67 | return bestEstimate.translatedLocation(to: position) 68 | } 69 | 70 | init() { 71 | locationManager.delegate = self 72 | } 73 | 74 | deinit { 75 | pause() 76 | } 77 | 78 | @objc 79 | func updateLocationData() { 80 | removeOldLocationEstimates() 81 | 82 | sceneLocationDelegate?.confirmLocationOfDistantLocationNodes() 83 | sceneLocationDelegate?.updatePositionAndScaleOfLocationNodes() 84 | } 85 | 86 | ///Adds a scene location estimate based on current time, camera position and location from location manager 87 | func addSceneLocationEstimate(location: CLLocation) { 88 | guard let position = sceneLocationDelegate?.scenePosition else { return } 89 | 90 | sceneLocationEstimates.append(SceneLocationEstimate(location: location, position: position)) 91 | 92 | sceneLocationDelegate?.didAddSceneLocationEstimate(position: position, location: location) 93 | } 94 | 95 | func removeOldLocationEstimates() { 96 | guard let currentScenePosition = sceneLocationDelegate?.scenePosition else { return } 97 | removeOldLocationEstimates(currentScenePosition: currentScenePosition) 98 | } 99 | 100 | func removeOldLocationEstimates(currentScenePosition: SCNVector3) { 101 | let currentPoint = CGPoint.pointWithVector(vector: currentScenePosition) 102 | 103 | sceneLocationEstimates = sceneLocationEstimates.filter { 104 | if #available(iOS 11.0, *) { 105 | let radiusContainsPoint = currentPoint.radiusContainsPoint( 106 | radius: CGFloat(SceneLocationView.sceneLimit), 107 | point: CGPoint.pointWithVector(vector: $0.position)) 108 | 109 | if !radiusContainsPoint { 110 | sceneLocationDelegate?.didRemoveSceneLocationEstimate(position: $0.position, location: $0.location) 111 | } 112 | 113 | return radiusContainsPoint 114 | } else { 115 | return false 116 | } 117 | } 118 | } 119 | 120 | } 121 | 122 | public extension SceneLocationManager { 123 | func run() { 124 | pause() 125 | if #available(iOS 11.0, *) { 126 | updateEstimatesTimer = Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { [weak self] _ in 127 | self?.updateLocationData() 128 | } 129 | } else { 130 | assertionFailure("Needs iOS 9 and 10 support") 131 | } 132 | } 133 | 134 | func pause() { 135 | updateEstimatesTimer?.invalidate() 136 | updateEstimatesTimer = nil 137 | } 138 | } 139 | 140 | extension SceneLocationManager: LocationManagerDelegate { 141 | 142 | func locationManagerDidUpdateLocation(_ locationManager: LocationManager, 143 | location: CLLocation) { 144 | addSceneLocationEstimate(location: location) 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Nodes/LocationAnnotationNode.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LocationNode.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Andrew Hart on 02/07/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | import Foundation 9 | import SceneKit 10 | import CoreLocation 11 | 12 | /// A `LocationNode` which has an attached `AnnotationNode`. 13 | open class LocationAnnotationNode: LocationNode { 14 | /// Subnodes and adjustments should be applied to this subnode 15 | /// Required to allow scaling at the same time as having a 2D 'billboard' appearance 16 | public let annotationNode: AnnotationNode 17 | /// Parameter to raise or lower the label's rendering position relative to the node's actual project location. 18 | /// The default value of 1.1 places the label at a pleasing height above the node. 19 | /// To draw the label exactly on the true location, use a value of 0. To draw it below the true location, 20 | /// use a negative value. 21 | public var annotationHeightAdjustmentFactor = 1.1 22 | 23 | public init(location: CLLocation?, image: UIImage) { 24 | let plane = SCNPlane(width: image.size.width / 100, height: image.size.height / 100) 25 | plane.firstMaterial?.diffuse.contents = image 26 | plane.firstMaterial?.lightingModel = .constant 27 | 28 | annotationNode = AnnotationNode(view: nil, image: image) 29 | annotationNode.geometry = plane 30 | annotationNode.removeFlicker() 31 | 32 | super.init(location: location) 33 | 34 | let billboardConstraint = SCNBillboardConstraint() 35 | billboardConstraint.freeAxes = SCNBillboardAxis.Y 36 | constraints = [billboardConstraint] 37 | 38 | addChildNode(annotationNode) 39 | } 40 | 41 | @available(iOS 10.0, *) 42 | /// Use this constructor to add a UIView as an annotation. Keep in mind that it is not live, instead 43 | /// it's a "snapshot" of that UIView. UIView is more configurable then a UIImage, allowing you to add 44 | /// background image, labels, etc. 45 | /// 46 | /// - Parameters: 47 | /// - location:The location of the node in the world. 48 | /// - view:The view to display at the specified location. 49 | public convenience init(location: CLLocation?, view: UIView) { 50 | self.init(location: location, image: view.image) 51 | } 52 | 53 | public init(location: CLLocation?, layer: CALayer) { 54 | let plane = SCNPlane(width: layer.bounds.size.width / 100, height: layer.bounds.size.height / 100) 55 | plane.firstMaterial?.diffuse.contents = layer 56 | plane.firstMaterial?.lightingModel = .constant 57 | 58 | annotationNode = AnnotationNode(view: nil, image: nil, layer: layer) 59 | annotationNode.geometry = plane 60 | annotationNode.removeFlicker() 61 | 62 | super.init(location: location) 63 | 64 | let billboardConstraint = SCNBillboardConstraint() 65 | billboardConstraint.freeAxes = SCNBillboardAxis.Y 66 | constraints = [billboardConstraint] 67 | 68 | addChildNode(annotationNode) 69 | } 70 | 71 | required public init?(coder aDecoder: NSCoder) { 72 | fatalError("init(coder:) has not been implemented") 73 | } 74 | 75 | /// Note: we repeat code from `LocationNode`'s implementation of this function. Is this because of the use of `SCNTransaction` 76 | /// to wrap the changes? It's legal to nest the calls, should consider this if any more changes to 77 | /// `LocationNode`'s implementation are needed. 78 | override func updatePositionAndScale(setup: Bool = false, scenePosition: SCNVector3?, 79 | locationNodeLocation nodeLocation: CLLocation, 80 | locationManager: SceneLocationManager, 81 | onCompletion: (() -> Void)) { 82 | guard let position = scenePosition, let location = locationManager.currentLocation else { return } 83 | 84 | SCNTransaction.begin() 85 | SCNTransaction.animationDuration = setup ? 0.0 : 0.1 86 | 87 | let distance = self.location(locationManager.bestLocationEstimate).distance(from: location) 88 | 89 | childNodes.first?.renderingOrder = renderingOrder(fromDistance: distance) 90 | 91 | let adjustedDistance = self.adjustedDistance(setup: setup, position: position, 92 | locationNodeLocation: nodeLocation, locationManager: locationManager) 93 | 94 | // The scale of a node with a billboard constraint applied is ignored 95 | // The annotation subnode itself, as a subnode, has the scale applied to it 96 | let appliedScale = self.scale 97 | self.scale = SCNVector3(x: 1, y: 1, z: 1) 98 | 99 | var scale: Float 100 | 101 | if scaleRelativeToDistance { 102 | scale = appliedScale.y 103 | annotationNode.scale = appliedScale 104 | annotationNode.childNodes.forEach { child in 105 | child.scale = appliedScale 106 | } 107 | } else { 108 | let scaleFunc = scalingScheme.getScheme() 109 | scale = scaleFunc(distance, adjustedDistance) 110 | 111 | annotationNode.scale = SCNVector3(x: scale, y: scale, z: scale) 112 | annotationNode.childNodes.forEach { node in 113 | node.scale = SCNVector3(x: scale, y: scale, z: scale) 114 | } 115 | } 116 | 117 | // Translate the pivot's Y coordinate so the label will show above or below the actual node location. 118 | self.pivot = SCNMatrix4MakeTranslation(0, Float(-1 * annotationHeightAdjustmentFactor) * scale, 0) 119 | 120 | SCNTransaction.commit() 121 | 122 | onCompletion() 123 | } 124 | } 125 | 126 | // MARK: - Image from View 127 | 128 | public extension UIView { 129 | 130 | @available(iOS 10.0, *) 131 | /// Gets you an image from the view. 132 | var image: UIImage { 133 | let renderer = UIGraphicsImageRenderer(bounds: bounds) 134 | return renderer.image { rendererContext in 135 | layer.render(in: rendererContext.cgContext) 136 | } 137 | } 138 | 139 | } 140 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Nodes/LocationNode.swift: -------------------------------------------------------------------------------- 1 | //// 2 | //// SceneAnnotation.swift 3 | //// ARKit+CoreLocation 4 | //// 5 | //// Created by Andrew Hart on 02/07/2017. 6 | //// Copyright © 2017 Project Dent. All rights reserved. 7 | //// 8 | 9 | import Foundation 10 | import SceneKit 11 | import CoreLocation 12 | 13 | /// This node type enables the client to have access to the view or image that 14 | /// was used to initialize the `LocationAnnotationNode`. 15 | open class AnnotationNode: SCNNode { 16 | public var view: UIView? 17 | public var image: UIImage? 18 | public var layer: CALayer? 19 | 20 | public init(view: UIView?, image: UIImage?, layer: CALayer? = nil) { 21 | super.init() 22 | self.view = view 23 | self.image = image 24 | self.layer = layer 25 | } 26 | 27 | required public init?(coder aDecoder: NSCoder) { 28 | fatalError("init(coder:) has not been implemented") 29 | } 30 | } 31 | 32 | /// A location node can be added to a scene using a coordinate. 33 | /// 34 | /// Its scale and position should not be adjusted, as these are used for scene 35 | /// layout purposes. To adjust the scale and position of items within a node, 36 | /// you can add them to a child node and adjust them there 37 | open class LocationNode: SCNNode { 38 | // FIXME: figure out why this is hardcoded and why it would ever be different from the scene's sitting? 39 | /// This seems like it should be a bug? Why is it hardcoded? Why would it ever be different from the scene's setting? 40 | var locationEstimateMethod: LocationEstimateMethod = .mostRelevantEstimate 41 | 42 | /// Location can be changed and confirmed later by SceneLocationView. 43 | public var location: CLLocation! 44 | 45 | /// A general purpose tag that can be used to find nodes already added to a SceneLocationView 46 | public var tag: String? 47 | 48 | /// Whether the location of the node has been confirmed. 49 | /// This is automatically set to true when you create a node using a location. 50 | /// Otherwise, this is false, and becomes true once the user moves 100m away from the node, 51 | /// except when the locationEstimateMethod is set to use Core Location data only, 52 | /// as then it becomes true immediately. 53 | public var locationConfirmed: Bool { 54 | return location != nil 55 | } 56 | 57 | /// Whether a node's position should be adjusted on an ongoing basis 58 | /// based on its given location. 59 | /// This only occurs when a node's location is within 100m of the user. 60 | /// Adjustment doesn't apply to nodes without a confirmed location. 61 | /// When this is set to false, the result is a smoother appearance. 62 | /// When this is set to true, this means a node may appear to jump around 63 | /// as the user's location estimates update, 64 | /// but the position is generally more accurate. 65 | /// Defaults to true. 66 | public var continuallyAdjustNodePositionWhenWithinRange = true 67 | 68 | /// Whether a node's position and scale should be updated automatically on a continual basis. 69 | /// This should only be set to false if you plan to manually update position and scale 70 | /// at regular intervals. You can do this with `SceneLocationView`'s `updatePositionOfLocationNode`. 71 | public var continuallyUpdatePositionAndScale = true 72 | 73 | /// Whether the node should be scaled relative to its distance from the camera 74 | /// Default value (false) scales it to visually appear at the same size no matter the distance 75 | /// Setting to true causes annotation nodes to scale like a regular node 76 | /// Scaling relative to distance may be useful with local navigation-based uses 77 | /// For landmarks in the distance, the default is correct 78 | public var scaleRelativeToDistance = false 79 | 80 | /// Whether the node should appear at the same altitude of the user 81 | /// May be useful when you don't know the real altitude of the node 82 | /// When set to true, the node will stay at the same altitude of the user 83 | public var ignoreAltitude = false 84 | 85 | /// The scheme to use for scaling 86 | public var scalingScheme: ScalingScheme = .normal 87 | 88 | public init(location: CLLocation?, tag: String? = nil) { 89 | self.location = location 90 | self.tag = tag 91 | super.init() 92 | } 93 | 94 | required public init?(coder aDecoder: NSCoder) { 95 | fatalError("init(coder:) has not been implemented") 96 | } 97 | 98 | internal func location(_ bestLocationEstimate: SceneLocationEstimate?) -> CLLocation { 99 | if locationConfirmed || locationEstimateMethod == .coreLocationDataOnly { 100 | return location! 101 | } 102 | 103 | if let bestLocationEstimate = bestLocationEstimate, 104 | location == nil || bestLocationEstimate.location.horizontalAccuracy < location!.horizontalAccuracy { 105 | return bestLocationEstimate.translatedLocation(to: position) 106 | } else { 107 | return location! 108 | } 109 | } 110 | 111 | internal func adjustedDistance(setup: Bool, position: SCNVector3, locationNodeLocation: CLLocation, 112 | locationManager: SceneLocationManager) -> CLLocationDistance { 113 | guard let location = locationManager.currentLocation else { 114 | return 0.0 115 | } 116 | 117 | // Position is set to a position coordinated via the current position 118 | let distance = self.location(locationManager.bestLocationEstimate).distance(from: location) 119 | 120 | var locationTranslation = location.translation(toLocation: locationNodeLocation) 121 | locationTranslation.altitudeTranslation = ignoreAltitude ? 0 : locationTranslation.altitudeTranslation 122 | 123 | let adjustedDistance: CLLocationDistance 124 | if locationConfirmed && (distance > 100 || continuallyAdjustNodePositionWhenWithinRange || setup) { 125 | if distance > 100 { 126 | //If the item is too far away, bring it closer and scale it down 127 | let scale = 100 / Float(distance) 128 | 129 | adjustedDistance = distance * Double(scale) 130 | 131 | let adjustedTranslation = SCNVector3( x: Float(locationTranslation.longitudeTranslation) * scale, 132 | y: Float(locationTranslation.altitudeTranslation) * scale, 133 | z: Float(locationTranslation.latitudeTranslation) * scale) 134 | self.position = SCNVector3( x: position.x + adjustedTranslation.x, 135 | y: position.y + adjustedTranslation.y, 136 | z: position.z - adjustedTranslation.z) 137 | self.scale = SCNVector3(x: scale, y: scale, z: scale) 138 | } else { 139 | adjustedDistance = distance 140 | self.position = SCNVector3( x: position.x + Float(locationTranslation.longitudeTranslation), 141 | y: position.y + Float(locationTranslation.altitudeTranslation), 142 | z: position.z - Float(locationTranslation.latitudeTranslation)) 143 | self.scale = SCNVector3(x: 1, y: 1, z: 1) 144 | } 145 | } else { 146 | //Calculates distance based on the distance within the scene, as the location isn't yet confirmed 147 | //TODO: This yields zero, perhaps we should investigate 148 | adjustedDistance = Double(position.distance(to: position)) 149 | 150 | scale = SCNVector3(x: 1, y: 1, z: 1) 151 | } 152 | 153 | return adjustedDistance 154 | } 155 | 156 | /// See `LocationAnnotationNode`'s override of this function. Because it doesn't invoke `super`'s version, any changes 157 | /// made in this file must be repeated in `LocationAnnotationNode`. 158 | func updatePositionAndScale(setup: Bool = false, scenePosition: SCNVector3?, locationNodeLocation nodeLocation: CLLocation, 159 | locationManager: SceneLocationManager, onCompletion: (() -> Void)) { 160 | guard let position = scenePosition, locationManager.currentLocation != nil else { 161 | return 162 | } 163 | 164 | SCNTransaction.begin() 165 | SCNTransaction.animationDuration = setup ? 0.0 : 0.1 166 | 167 | let distance = self.location(locationManager.bestLocationEstimate).distance(from: 168 | locationManager.currentLocation ?? nodeLocation) 169 | 170 | childNodes.first?.renderingOrder = renderingOrder(fromDistance: distance) 171 | 172 | _ = self.adjustedDistance(setup: setup, position: position, 173 | locationNodeLocation: nodeLocation, locationManager: locationManager) 174 | 175 | SCNTransaction.commit() 176 | 177 | onCompletion() 178 | } 179 | 180 | /// Converts distance from meters to SCNKit rendering order 181 | /// Constant multiplier eliminates flicker caused by slight distance variations 182 | /// Nodes with greater rendering orders are rendered last 183 | func renderingOrder(fromDistance distance: CLLocationDistance) -> Int { 184 | return Int.max - 1000 - (Int(distance * 1000)) 185 | } 186 | } 187 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Nodes/PolylineNode.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PolylineNode.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Ilya Seliverstov on 11/08/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import SceneKit 11 | import MapKit 12 | 13 | /// A block that will build an SCNBox with the provided distance. 14 | /// Note: the distance should be assigned to the length 15 | public typealias BoxBuilder = (_ distance: CGFloat) -> SCNBox 16 | 17 | /// A Node that is used to show directions in AR-CL. 18 | public class PolylineNode: LocationNode { 19 | public private(set) var locationNodes = [LocationNode]() 20 | 21 | public let polyline: MKPolyline 22 | public let altitude: CLLocationDistance 23 | public let boxBuilder: BoxBuilder 24 | 25 | /// Creates a `PolylineNode` from the provided polyline, altitude (which is assumed to be uniform 26 | /// for all of the points) and an optional SCNBox to use as a prototype for the location boxes. 27 | /// 28 | /// - Parameters: 29 | /// - polyline: The polyline that we'll be creating location nodes for. 30 | /// - altitude: The uniform altitude to use to show the location nodes. 31 | /// - tag: a String attribute to identify the node in the scene (e.g when it's touched) 32 | /// - boxBuilder: A block that will customize how a box is built. 33 | public init(polyline: MKPolyline, 34 | altitude: CLLocationDistance, 35 | tag: String? = nil, 36 | boxBuilder: BoxBuilder? = nil) { 37 | self.polyline = polyline 38 | self.altitude = altitude 39 | self.boxBuilder = boxBuilder ?? Constants.defaultBuilder 40 | 41 | super.init(location: nil) 42 | 43 | self.tag = tag ?? Constants.defaultTag 44 | 45 | contructNodes() 46 | } 47 | 48 | required public init?(coder aDecoder: NSCoder) { 49 | fatalError("init(coder:) has not been implemented") 50 | } 51 | 52 | } 53 | 54 | // MARK: - Implementation 55 | 56 | private extension PolylineNode { 57 | 58 | struct Constants { 59 | static let defaultBuilder: BoxBuilder = { (distance) -> SCNBox in 60 | let box = SCNBox(width: 1, height: 0.2, length: distance, chamferRadius: 0) 61 | box.firstMaterial?.diffuse.contents = UIColor(red: 47.0/255.0, green: 125.0/255.0, blue: 255.0/255.0, alpha: 1.0) 62 | return box 63 | } 64 | static let defaultTag: String = "" 65 | } 66 | 67 | /// This is what actually builds the SCNNodes and appends them to the 68 | /// locationNodes collection so they can be added to the scene and shown 69 | /// to the user. If the prototype box is nil, then the default box will be used 70 | func contructNodes() { 71 | let points = polyline.points() 72 | 73 | for i in 0 ..< polyline.pointCount - 1 { 74 | let currentLocation = CLLocation(coordinate: points[i].coordinate, altitude: altitude) 75 | let nextLocation = CLLocation(coordinate: points[i + 1].coordinate, altitude: altitude) 76 | let midLocation = currentLocation.approxMidpoint(to: nextLocation) 77 | 78 | let distance = currentLocation.distance(from: nextLocation) 79 | 80 | let box = boxBuilder(CGFloat(distance)) 81 | let boxNode = SCNNode(geometry: box) 82 | boxNode.removeFlicker() 83 | 84 | let bearing = -currentLocation.bearing(between: nextLocation) 85 | 86 | // Orient the line to point from currentLoction to nextLocation 87 | boxNode.eulerAngles.y = Float(bearing).degreesToRadians 88 | 89 | let locationNode = LocationNode(location: midLocation, tag: tag) 90 | locationNode.addChildNode(boxNode) 91 | 92 | locationNodes.append(locationNode) 93 | } 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Nodes/ScalingScheme.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ScalingScheme.swift 3 | // ARCL 4 | // 5 | // Created by Eric Internicola on 5/17/19. 6 | // 7 | 8 | import Foundation 9 | 10 | /// A set of schemes that can be used to scale a LocationNode. 11 | /// 12 | /// Values: 13 | /// - normal: The default way of scaling, Hardcoded value out to 3000 meters, and then 0.75 that factor beyond 3000 m. 14 | /// - tiered (threshold, scale): Return 1.0 at distance up to `threshold` meters, or `scale` beyond. 15 | /// - doubleTiered (firstThreshold, firstCale, secondThreshold, secondScale): A way of scaling everything 16 | /// beyond 2 specific distances at two specific scales. 17 | /// - linear (threshold): linearly scales an object based on its distance. 18 | /// - linearBuffer (threshold, buffer): linearly scales an object based on its distance as long as it is 19 | /// further than the buffer distance, otherwise it just returns 100% scale. 20 | public enum ScalingScheme { 21 | 22 | case normal 23 | case tiered(threshold: Double, scale: Float) 24 | case doubleTiered(firstThreshold: Double, firstScale: Float, secondThreshold: Double, secondScale: Float) 25 | case linear(threshold: Double) 26 | case linearBuffer(threshold: Double, buffer: Double) 27 | 28 | /// Returns a closure to compute appropriate scale factor based on the current value of `self` (a `ScalingSchee`). 29 | /// The closure accepts two parameters and returns the scale factor to apply to an `AnnotationNode`. 30 | public func getScheme() -> ( (_ distance: Double, _ adjustedDistance: Double) -> Float) { 31 | switch self { 32 | case .tiered(let threshold, let scale): 33 | return { (distance, adjustedDistance) in 34 | if adjustedDistance > threshold { 35 | return scale 36 | } else { 37 | return 1.0 38 | } 39 | } 40 | case .doubleTiered(let firstThreshold, let firstScale, let secondThreshold, let secondScale): 41 | return { (distance, adjustedDistance) in 42 | if adjustedDistance > secondThreshold { 43 | return secondScale 44 | } else if adjustedDistance > firstThreshold { 45 | return firstScale 46 | } else { 47 | return 1.0 48 | } 49 | } 50 | case .linear(let threshold): 51 | return { (distance, adjustedDistance) in 52 | 53 | let maxSize = 1.0 54 | let absThreshold = abs(threshold) 55 | let absAdjDist = abs(adjustedDistance) 56 | 57 | let scaleToReturn = Float( max(maxSize - (absAdjDist / absThreshold), 0.0)) 58 | // print("threshold: \(absThreshold) adjDist: \(absAdjDist) scaleToReturn: \(scaleToReturn)") 59 | return scaleToReturn 60 | } 61 | 62 | case .linearBuffer(let threshold, let buffer): 63 | return { (distance, adjustedDistance) in 64 | let maxSize = 1.0 65 | let absThreshold = abs(threshold) 66 | let absAdjDist = abs(adjustedDistance) 67 | 68 | if absAdjDist < buffer { 69 | // print("threshold: \(absThreshold) adjDist: \(absAdjDist)") 70 | return Float(maxSize) 71 | } else { 72 | let scaleToReturn = Float( max( maxSize - (absAdjDist / absThreshold), 0.0 )) 73 | // print("threshold: \(absThreshold) adjDist: \(absAdjDist) scaleToReturn: \(scaleToReturn)") 74 | return scaleToReturn 75 | } 76 | } 77 | case .normal: 78 | return { (distance, adjustedDistance) in 79 | 80 | // Scale it to be an appropriate size so that it can be seen 81 | var scale = Float(adjustedDistance) * 0.181 82 | if distance > 3000 { 83 | scale *= 0.75 84 | } 85 | return scale 86 | } 87 | } 88 | 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/SceneLocationView+ARSCNViewDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneLocationView+ARSCNViewDelegate.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Ilya Seliverstov on 08/08/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import ARKit 11 | import CoreLocation 12 | import MapKit 13 | 14 | // MARK: - ARSCNViewDelegate 15 | 16 | @available(iOS 11.0, *) 17 | extension SceneLocationView: ARSCNViewDelegate { 18 | 19 | public func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? { 20 | return arViewDelegate?.renderer?(renderer, nodeFor: anchor) ?? nil 21 | } 22 | 23 | public func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor) { 24 | arViewDelegate?.renderer?(renderer, didAdd: node, for: anchor) 25 | } 26 | 27 | public func renderer(_ renderer: SCNSceneRenderer, willUpdate node: SCNNode, for anchor: ARAnchor) { 28 | arViewDelegate?.renderer?(renderer, willUpdate: node, for: anchor) 29 | } 30 | 31 | public func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor) { 32 | arViewDelegate?.renderer?(renderer, didUpdate: node, for: anchor) 33 | } 34 | 35 | public func renderer(_ renderer: SCNSceneRenderer, didRemove node: SCNNode, for anchor: ARAnchor) { 36 | arViewDelegate?.renderer?(renderer, didRemove: node, for: anchor) 37 | } 38 | 39 | } 40 | 41 | // MARK: - ARSessionObserver 42 | 43 | @available(iOS 11.0, *) 44 | extension SceneLocationView { 45 | 46 | public func session(_ session: ARSession, didFailWithError error: Error) { 47 | defer { 48 | arViewDelegate?.session?(session, didFailWithError: error) 49 | } 50 | print("session did fail with error: \(error)") 51 | sceneTrackingDelegate?.session(session, didFailWithError: error) 52 | } 53 | 54 | public func session(_ session: ARSession, cameraDidChangeTrackingState camera: ARCamera) { 55 | defer { 56 | arViewDelegate?.session?(session, cameraDidChangeTrackingState: camera) 57 | } 58 | switch camera.trackingState { 59 | case .limited(.insufficientFeatures): 60 | print("camera did change tracking state: limited, insufficient features") 61 | case .limited(.excessiveMotion): 62 | print("camera did change tracking state: limited, excessive motion") 63 | case .limited(.initializing): 64 | print("camera did change tracking state: limited, initializing") 65 | case .normal: 66 | print("camera did change tracking state: normal") 67 | case .notAvailable: 68 | print("camera did change tracking state: not available") 69 | case .limited(.relocalizing): 70 | print("camera did change tracking state: limited, relocalizing") 71 | default: 72 | print("camera did change tracking state: unknown...") 73 | } 74 | sceneTrackingDelegate?.session(session, cameraDidChangeTrackingState: camera) 75 | } 76 | 77 | public func sessionWasInterrupted(_ session: ARSession) { 78 | defer { 79 | arViewDelegate?.sessionWasInterrupted?(session) 80 | } 81 | print("session was interrupted") 82 | sceneTrackingDelegate?.sessionWasInterrupted(session) 83 | } 84 | 85 | public func sessionInterruptionEnded(_ session: ARSession) { 86 | defer { 87 | arViewDelegate?.sessionInterruptionEnded?(session) 88 | } 89 | print("session interruption ended") 90 | sceneTrackingDelegate?.sessionInterruptionEnded(session) 91 | } 92 | 93 | @available(iOS 11.3, *) 94 | public func sessionShouldAttemptRelocalization(_ session: ARSession) -> Bool { 95 | return arViewDelegate?.sessionShouldAttemptRelocalization?(session) ?? true 96 | } 97 | 98 | public func session(_ session: ARSession, didOutputAudioSampleBuffer audioSampleBuffer: CMSampleBuffer) { 99 | arViewDelegate?.session?(session, didOutputAudioSampleBuffer: audioSampleBuffer) 100 | } 101 | 102 | } 103 | 104 | // MARK: - SCNSceneRendererDelegate 105 | 106 | @available(iOS 11.0, *) 107 | extension SceneLocationView { 108 | 109 | public func renderer(_ renderer: SCNSceneRenderer, didRenderScene scene: SCNScene, atTime time: TimeInterval) { 110 | defer { 111 | arViewDelegate?.renderer?(renderer, didRenderScene: scene, atTime: time) 112 | } 113 | if sceneNode == nil { 114 | sceneNode = SCNNode() 115 | scene.rootNode.addChildNode(sceneNode!) 116 | 117 | if showAxesNode { 118 | let axesNode = SCNNode.axesNode(quiverLength: 0.1, quiverThickness: 0.5) 119 | sceneNode?.addChildNode(axesNode) 120 | } 121 | } 122 | 123 | if !didFetchInitialLocation { 124 | //Current frame and current location are required for this to be successful 125 | if session.currentFrame != nil, 126 | let currentLocation = sceneLocationManager.currentLocation { 127 | didFetchInitialLocation = true 128 | sceneLocationManager.addSceneLocationEstimate(location: currentLocation) 129 | } 130 | } 131 | } 132 | 133 | public func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) { 134 | arViewDelegate?.renderer?(renderer, updateAtTime: time) 135 | } 136 | 137 | public func renderer(_ renderer: SCNSceneRenderer, didApplyAnimationsAtTime time: TimeInterval) { 138 | arViewDelegate?.renderer?(renderer, didApplyAnimationsAtTime: time) 139 | } 140 | 141 | public func renderer(_ renderer: SCNSceneRenderer, didSimulatePhysicsAtTime time: TimeInterval) { 142 | arViewDelegate?.renderer?(renderer, didSimulatePhysicsAtTime: time) 143 | } 144 | 145 | public func renderer(_ renderer: SCNSceneRenderer, didApplyConstraintsAtTime time: TimeInterval) { 146 | arViewDelegate?.renderer?(renderer, didApplyConstraintsAtTime: time) 147 | } 148 | 149 | public func renderer(_ renderer: SCNSceneRenderer, willRenderScene scene: SCNScene, atTime time: TimeInterval) { 150 | arViewDelegate?.renderer?(renderer, willRenderScene: scene, atTime: time) 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/SceneLocationViewEstimateDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneLocationViewDelegate.swift 3 | // ARKit+CoreLocation 4 | // 5 | // Created by Ilya Seliverstov on 09/08/2017. 6 | // Copyright © 2017 Project Dent. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import ARKit 11 | import CoreLocation 12 | import MapKit 13 | 14 | // Delegate for touch events on LocationNode 15 | public protocol LNTouchDelegate: class { 16 | func annotationNodeTouched(node: AnnotationNode) 17 | func locationNodeTouched(node: LocationNode) 18 | } 19 | 20 | @available(iOS 11.0, *) 21 | public protocol SceneLocationViewEstimateDelegate: class { 22 | func didAddSceneLocationEstimate(sceneLocationView: SceneLocationView, position: SCNVector3, location: CLLocation) 23 | func didRemoveSceneLocationEstimate(sceneLocationView: SceneLocationView, position: SCNVector3, location: CLLocation) 24 | } 25 | 26 | @available(iOS 11.0, *) 27 | public extension SceneLocationViewEstimateDelegate { 28 | func didAddSceneLocationEstimate(sceneLocationView: SceneLocationView, position: SCNVector3, location: CLLocation) { 29 | // 30 | } 31 | func didRemoveSceneLocationEstimate(sceneLocationView: SceneLocationView, position: SCNVector3, location: CLLocation) { 32 | // 33 | } 34 | } 35 | 36 | @available(iOS 11.0, *) 37 | public protocol SceneLocationViewDelegate: class { 38 | ///After a node's location is initially set based on current location, 39 | ///it is later confirmed once the user moves far enough away from it. 40 | ///This update uses location data collected since the node was placed to give a more accurate location. 41 | func didConfirmLocationOfNode(sceneLocationView: SceneLocationView, node: LocationNode) 42 | 43 | func didSetupSceneNode(sceneLocationView: SceneLocationView, sceneNode: SCNNode) 44 | 45 | func didUpdateLocationAndScaleOfLocationNode(sceneLocationView: SceneLocationView, locationNode: LocationNode) 46 | } 47 | 48 | /// Subset of delegate methods from ARSCNViewDelegate to be notified on tracking status changes 49 | @available(iOS 11.0, *) 50 | public protocol SceneTrackingDelegate: class { 51 | 52 | func sessionWasInterrupted(_ session: ARSession) 53 | 54 | func sessionInterruptionEnded(_ session: ARSession) 55 | 56 | func session(_ session: ARSession, didFailWithError error: Error) 57 | 58 | func session(_ session: ARSession, cameraDidChangeTrackingState camera: ARCamera) 59 | 60 | } 61 | 62 | @available(iOS 11.0, *) 63 | public extension SceneLocationViewDelegate { 64 | func didAddSceneLocationEstimate(sceneLocationView: SceneLocationView, position: SCNVector3, location: CLLocation) { 65 | // 66 | } 67 | func didRemoveSceneLocationEstimate(sceneLocationView: SceneLocationView, position: SCNVector3, location: CLLocation) { 68 | // 69 | } 70 | 71 | func didConfirmLocationOfNode(sceneLocationView: SceneLocationView, node: LocationNode) { 72 | // 73 | } 74 | func didSetupSceneNode(sceneLocationView: SceneLocationView, sceneNode: SCNNode) { 75 | // 76 | } 77 | 78 | func didUpdateLocationAndScaleOfLocationNode(sceneLocationView: SceneLocationView, locationNode: LocationNode) { 79 | // 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Sources/ARKit-CoreLocation/Util/AttributedType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AttributedType.swift 3 | // ARCL 4 | // 5 | // Created by Mattia Campolese on 18/06/2019. 6 | // 7 | 8 | import Foundation 9 | 10 | /// Wrapper to decorate a type with an attribute 11 | public struct AttributedType { 12 | public let type: T 13 | public let attribute: String 14 | 15 | public init(type: T, attribute: String) { 16 | self.type = type 17 | self.attribute = attribute 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Sources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /arkit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/arkit.png -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | - 1.3.1 3 | - 1.3.0 4 | - [PR #255 - Fix minor error with placement of route steps](https://github.com/ProjectDent/ARKit-CoreLocation/pull/255) 5 | - [PR #249 - Fix Memory Leak](https://github.com/ProjectDent/ARKit-CoreLocation/pull/249) 6 | - [PR #244 - Improve geodesy calculations and test coverage](https://github.com/ProjectDent/ARKit-CoreLocation/pull/244) 7 | - [PR #240 - Fix build error, update compiler checks](https://github.com/ProjectDent/ARKit-CoreLocation/pull/240) 8 | - [PR #232 - Add new demo app to exercise node types and scene parameters](https://github.com/ProjectDent/ARKit-CoreLocation/pull/232) 9 | - [PR #230 - Expose an adjustment factor for label annotation height](https://github.com/ProjectDent/ARKit-CoreLocation/pull/230) 10 | - [PR #225 - Expose SceneLocationView.locationOfLocationNode ](https://github.com/ProjectDent/ARKit-CoreLocation/pull/225) 11 | - [PR #222 - Trigger viewWillDisappear/viewWillAppear calls when app backgrounded/foregrounded](https://github.com/ProjectDent/ARKit-CoreLocation/pull/222) 12 | - [PR #220 - Render distant nodes behind closer nodes ](https://github.com/ProjectDent/ARKit-CoreLocation/pull/220) 13 | - [PR #213 - Allows specifying CALayer as POI view](https://github.com/ProjectDent/ARKit-CoreLocation/pull/213) 14 | - [PR #224 - Enable default lighting ](https://github.com/ProjectDent/ARKit-CoreLocation/pull/224) 15 | - [PR #220 - Render distant nodes behind closer nodes ](https://github.com/ProjectDent/ARKit-CoreLocation/pull/220) 16 | - [PR #197 - Interact with location nodes](https://github.com/ProjectDent/ARKit-CoreLocation/pull/197) 17 | - [PR #215 - Allow route creation from a set of polylines](https://github.com/ProjectDent/ARKit-CoreLocation/pull/215) 18 | - 1.2.1 19 | - [PR #207 - Addresses Issue #136 - ARCL lacks CI ](https://github.com/ProjectDent/ARKit-CoreLocation/pull/207) 20 | - [PR #209 - Updates polyline position/scale when GPS location is updated](https://github.com/ProjectDent/ARKit-CoreLocation/pull/209) 21 | - [PR #206 - Addresses Issue #196 - setting the SceneLocationView delegate prevents scene rendering](https://github.com/ProjectDent/ARKit-CoreLocation/pull/206) 22 | - [PR #204 - Converts from Swift 4.2 -> Swift 5.0](https://github.com/ProjectDent/ARKit-CoreLocation/pull/204) 23 | - [PR #203 - InfoLabel includes additional heading data](https://github.com/ProjectDent/ARKit-CoreLocation/pull/203) 24 | - [PR #198 - Adds support for AR Orientation Tracking](https://github.com/ProjectDent/ARKit-CoreLocation/pull/198) 25 | - [PR #193 - Adds support for Swift Package Manager](https://github.com/ProjectDent/ARKit-CoreLocation/pull/193) 26 | - 1.2.0 27 | - [PR #185 - Custom boxes for directions](https://github.com/ProjectDent/ARKit-CoreLocation/pull/185/files) 28 | - [PR #184 - adds "ignoreAltitude" to LocationNode](https://github.com/ProjectDent/ARKit-CoreLocation/pull/184) 29 | - [PR #183 - Scaling schemes](https://github.com/ProjectDent/ARKit-CoreLocation/pull/183) 30 | - [PR #182 - child node scaling](https://github.com/ProjectDent/ARKit-CoreLocation/pull/182) 31 | - [PR #181 - Cleans up warnings](https://github.com/ProjectDent/ARKit-CoreLocation/pull/181) 32 | - [PR #177 - Fixes the workspace schemes](https://github.com/ProjectDent/ARKit-CoreLocation/pull/177) 33 | - [PR #176 - Fixes issue #164](https://github.com/ProjectDent/ARKit-CoreLocation/pull/176) 34 | - Fixes an issue where dismissing the ARCL Scene View can make other UIs unusable 35 | - Creating LocationNodes from a UIView now just creates an image from that view and uses the image. 36 | - [PR #171 - Support Carthage and open SceneLocationView for extension](https://github.com/ProjectDent/ARKit-CoreLocation/pull/171) 37 | - 1.1.0 38 | - [PR #159 - Directions (Routes) and AR Polylines](https://github.com/ProjectDent/ARKit-CoreLocation/pull/159) 39 | - Adds the ability to take an array of `MKRoute` objects and render it as a route in AR (similar to the demo gif on the README) 40 | - Updates the demo app to allow you to demonstrate this capability 41 | -------------------------------------------------------------------------------- /fastlane/Appfile: -------------------------------------------------------------------------------- 1 | # app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app 2 | # apple_id("[[APPLE_ID]]") # Your Apple email address 3 | 4 | 5 | # For more information about the Appfile, see: 6 | # https://docs.fastlane.tools/advanced/#appfile 7 | -------------------------------------------------------------------------------- /fastlane/Fastfile: -------------------------------------------------------------------------------- 1 | # This file contains the fastlane.tools configuration 2 | # You can find the documentation at https://docs.fastlane.tools 3 | # 4 | # For a list of all available actions, check out 5 | # 6 | # https://docs.fastlane.tools/actions 7 | # 8 | # For a list of all available plugins, check out 9 | # 10 | # https://docs.fastlane.tools/plugins/available-plugins 11 | # 12 | 13 | # Uncomment the line if you want fastlane to automatically update itself 14 | # update_fastlane 15 | 16 | default_platform(:ios) 17 | 18 | platform :ios do 19 | 20 | desc "Runs the tests" 21 | lane :test do 22 | cocoapods 23 | scan 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /fastlane/README.md: -------------------------------------------------------------------------------- 1 | fastlane documentation 2 | ================ 3 | # Installation 4 | 5 | Make sure you have the latest version of the Xcode command line tools installed: 6 | 7 | ``` 8 | xcode-select --install 9 | ``` 10 | 11 | Install _fastlane_ using 12 | ``` 13 | [sudo] gem install fastlane -NV 14 | ``` 15 | or alternatively using `brew cask install fastlane` 16 | 17 | # Available Actions 18 | ## iOS 19 | ### ios test 20 | ``` 21 | fastlane ios test 22 | ``` 23 | Runs the tests 24 | 25 | ---- 26 | 27 | This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run. 28 | More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). 29 | The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools). 30 | -------------------------------------------------------------------------------- /giphy-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/giphy-1.gif -------------------------------------------------------------------------------- /giphy-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AndrewHartAR/ARKit-CoreLocation/9184d9c41cf61e4b94aff8689f6383ffbe5b2dcd/giphy-2.gif -------------------------------------------------------------------------------- /readme.jp.md: -------------------------------------------------------------------------------- 1 | ![ARKit + CoreLocation](https://github.com/ProjectDent/ARKit-CoreLocation/blob/master/arkit.png) 2 | 3 | 注) 英語から翻訳したものであり、その内容が最新でない場合もあります。最新の情報はオリジナルの英語版を参照してください。 4 | 5 | **ARKit**: カメラとモーションデータを使用して、移動したときに精密に近辺の世界を映し出します。 6 | 7 | **CoreLocation**: WifiとGPSを使用して、低い精度で現在地を測定します。 8 | 9 | **ARKit + CoreLocation**: ARの高い精度とGPSのスケールを組み合わせます。 10 | 11 | ![Points of interest demo](https://github.com/ProjectDent/ARKit-CoreLocation/blob/master/giphy-1.gif) ![Navigation demo](https://github.com/ProjectDent/ARKit-CoreLocation/blob/master/giphy-2.gif) 12 | 13 | これらの技術の組み合わせには非常に大きな可能性があり、さまざまな分野に渡って多くの可能性あるアプリケーションがあります。このライブラリには2つの重要な機能が備わっています。 14 | 15 | - 現実世界の座標を用いて、ARの世界にアイテムを置けるようにする機能 16 | - ARの世界を通した動きの知識を組み合わせた最近の位置データを利用した、劇的に改善された位置精度 17 | 18 | 改善された位置精度は現在、「実験的」な段階にありますが、最も重要な要素になる可能性があります。 19 | 20 | やるべきことがまだたくさんあり、他の分野でもそうであるため、GithubのIssueで私たちがやるよりも、このプロジェクトはオープンなコミュニティで提供されるのが最善でしょう。 21 | なので、このライブラリや改善、自分たちの仕事について議論をするために 誰でも参加できるSlackのグループを開こうと思います。 22 | 23 | **[Slackのコミュニティに参加してください](https://join.slack.com/t/arcl-dev/shared_invite/enQtNTk4OTg4MzU0MTEyLTMzYTM0Mjk0YmNkMjgwYzg4OWQ1NDFjNjc3NjM1NzdkNWNkZTc2NjQ1MWFiNmI1MTZiMTA5MmNjZmRiOTk1NjI)** 24 | 25 | ## 必要条件 26 | ARKitはiOS 11が必要で、以下の端末が対応しています。 27 | - iPhone 6S and upwards 28 | - iPhone SE 29 | - iPad (2017) 30 | - All iPad Pro models 31 | 32 | iOS 11 は Apple’s Developer websiteからダウンロードできます。 33 | 34 | ## 利用方法 35 | このライブラリはARKitとCoreLocation frameworkを含んでおり、[Demo 1](https://twitter.com/AndrewProjDent/status/886916872683343872)と似たデモアプリと同様のものです。 36 | 37 | [True North calibration のセクションを必ず読んでください。](#true-north-calibration) 38 | 39 | ### Build設定: 40 | 41 | ```bash 42 | swift build \ 43 | -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" \ 44 | -Xswiftc "-target" -Xswiftc "x86_64-apple-ios12.1-simulator" 45 | ``` 46 | 47 | ### Swift Package Managerでの設定 48 | 49 | ### CocoaPodsでの設定 50 | 1. Podfileに以下を追加: 51 | 52 | `pod 'ARCL'` 53 | 54 | 2. ターミナルでプロジェクトのフォルダまで移動し、以下を入力: 55 | 56 | `pod update` 57 | 58 | `pod install` 59 | 60 | 3. `NSCameraUsageDescription` と `NSLocationWhenInUseUsageDescription` を、簡単な説明を入れてplistに追加 (例はデモをご覧ください) 61 | 62 | ### マニュアルで設定 63 | 1. `ARKit+CoreLocation/Source` からすべてのファイルをプロジェクトに追加. 64 | 2. ARKit、SceneKit、CoreLocation、MapKitをインポート 65 | 3. `NSCameraUsageDescription` と `NSLocationWhenInUseUsageDescription` を、簡単な説明を入れてplistに追加 (例はデモをご覧ください) 66 | 67 | ### クリックスタートガイド 68 | 例えばロンドンのCanary Wharfなどの、ビルの上にピンを置くためには、ARCLの構築するメインのクラスを使います。 - `SceneLocationView` 69 | 70 | まず、ARCLとCoreLocationをインポートします。それから、SceneLocationViewをプロパティとして宣言します。 71 | 72 | ```swift 73 | import ARCL 74 | import CoreLocation 75 | 76 | class ViewController: UIViewController { 77 | var sceneLocationView = SceneLocationView() 78 | } 79 | ``` 80 | 81 | ピントが合ってるときはいつでも `sceneLocationView.run()` を呼び、別のビューに移動したりアプリを閉じたりするなどで中断する場合は `sceneLocationView.pause()` を呼ぶべきです。 82 | 83 | ```swift 84 | override func viewDidLoad() { 85 | super.viewDidLoad() 86 | 87 | sceneLocationView.run() 88 | view.addSubview(sceneLocationView) 89 | } 90 | 91 | override func viewDidLayoutSubviews() { 92 | super.viewDidLayoutSubviews() 93 | 94 | sceneLocationView.frame = view.bounds 95 | } 96 | ``` 97 | 98 | `run()`を呼んだら、座標を追加することができます。ARCLは`LocationNode`という、3Dシーンのオブジェクトで、現実世界の位置を持ち、3Dの世界の中に適切に表示できるようにする他のいくつかのプロパティも持っているクラスがあります。 99 | `LocationNode` は SceneKitの`SCNNode`のサブクラスで、さらにサブクラス化できます。例えば、`LocationAnnotationNode`というサブクラスを使います。これは3Dの世界に2次元の画像を表示するために使用しますが、いつも使うことになります。 100 | 101 | ```swift 102 | let coordinate = CLLocationCoordinate2D(latitude: 51.504571, longitude: -0.019717) 103 | let location = CLLocation(coordinate: coordinate, altitude: 300) 104 | let image = UIImage(named: "pin")! 105 | 106 | let annotationNode = LocationAnnotationNode(location: location, image: image) 107 | ``` 108 | 109 | UIViewを使用して`LocationAnnotationNode`を初期化することも可能です。 110 | 内部では UIImage に変換されるため、内容を動的に更新することができませんが、UIImage を利用するよりも簡単に複雑なレイアウトを指定できます。 111 | 112 | ```swift 113 | let coordinate = CLLocationCoordinate2D(latitude: 51.504571, longitude: -0.019717) 114 | let location = CLLocation(coordinate: coordinate, altitude: 300) 115 | let view = UIView() // or a custom UIView subclass 116 | 117 | let annotationNode = LocationAnnotationNode(location: location, view: view) 118 | ``` 119 | 120 | また、CALayer を使用して`LocationAnnotationNode`を初期化することも可能です。 121 | コンテンツを動的に更新したいような場合に利用するといいでしょう。 122 | 123 | ```swift 124 | let coordinate = CLLocationCoordinate2D(latitude: 51.504571, longitude: -0.019717) 125 | let location = CLLocation(coordinate: coordinate, altitude: 300) 126 | let layer = CALayer() // or a custom CALayer subclass 127 | 128 | let annotationNode = LocationAnnotationNode(location: location, layer: layer) 129 | ``` 130 | 131 | デフォルトで、設置した画像は常に与えられたサイズで見えるべきです。例えば、100x100の画像を与えたなら、それはスクリーン上でも100x100で表示されるでしょう。 132 | 遠くにあるアノテーションノードは近くになるのと同じサイズで常に見えるということです。 133 | もし距離に応じて縮小と拡大をさせる方がいいなら、LocationAnnotationNodeの`scaleRelativeToDistance`を`true`にセットすることができます。 134 | 135 | ```swift 136 | sceneLocationView.addLocationNodeWithConfirmedLocation(locationNode: annotationNode) 137 | ``` 138 | 139 | シーンに位置ノードを追加する方法は2つあります。それは`addLocationNodeWithConfirmedLocation`と`addLocationNodeForCurrentPosition`を使う方法です。端末と同じ位置に位置ノードを3Dの世界に配置し、座標を与えてくれます。 140 | sceneLocationViewのframeを設定したら、Canary Wharfの上にピンが浮かんでるのが見えます。 141 | 142 | ノードが`sceneLocationView`によってタッチされたときに、通知を受け取るためにはViewControllerクラスの`LNTouchDelegate`に従う必要があります。`locationNodeTouched(node:AnnotationNode)`は画面に触れたノードへのアクセスを提供します。`AnnotationNode`はSCNNodeのサブクラスであり、` image:UIImage? `と` view:UIView? `の2つの追加プロパティがあります。これらのプロパティはどちらも `LocationAnnotationNode`がどのように初期化されたかに基づいて定められます(UIImageまたはUIViewどちらかのコンストラクタを使ったかによって定められます)。 143 | 144 | ```swift 145 | class ViewController: UIViewController, LNTouchDelegate { 146 | override func viewDidLoad() { 147 | super.viewDidLoad() 148 | //... 149 | self.sceneLocationView.locationNodeTouchDelegate = self 150 | //... 151 | } 152 | func locationNodeTouched(node: AnnotationNode) { 153 | // Do stuffs with the node instance 154 | 155 | // node could have either node.view or node.image 156 | if let nodeView = node.view{ 157 | // Do stuffs with the nodeView 158 | // ... 159 | } 160 | if let nodeImage = node.image{ 161 | // Do stuffs with the nodeImage 162 | // ... 163 | } 164 | } 165 | } 166 | ``` 167 | 168 | ## 追加機能 169 | ライブラリとデモには、設定のための追加の機能が用意されています。必ず一覧できるように完全に文書化されています。 170 | 171 | SceneLocationViewはARSCNViewのサブクラスです. 別の方法で完全にARSCNViewを使えるようにしてくれる一方で、別のクラスにdelegateをセットすべきではないことを留意してください。もしdelegateの機能が必要になったら、サブクラスの`SceneLocationView`を使ってください。 172 | 173 | ## True North calibration 174 | 私が個人的に解決できなかった問題は、iPhoneのTrue North calibrationが現在最高で15度の精度であるということです。これは地図のナビにとっては良いのですが、ARの世界に物体を置くときには、問題となりはじめます。 175 | 176 | 私はこの問題は、様々なARの技術によって乗り越えられると確信しています。それは共同して恩恵を受けることができると思う1つの領域です。 177 | 178 | 現在これを改善するために、私は北点を調整できるようにするいくつかの機能をライブラリに追加してきました。 179 | `sceneLocationView.useTrueNorth`を`false`に設定することでこれらを使用します。それから、最初に端末を北の一般的な方向に向けると、合理的に近づけることができます。`UseTrueNorth`をtrue(デフォルト)に設定すると、北をうまく検知できるようになるにつれて調整を続けていきます。 180 | 181 | デモアプリ内では、`adjustNorthByTappingSidesOfScreen`という利用できないプロパティがあります。これは上記の機能にアクセスできるのですが、一度利用できるようにすれば、スクリーンの左側と右側をタップすることでシーンの進行方向を調整できるようになります。 182 | 183 | 自分の位置から直接的にTrue Northとなっている近くの目印を正確にし、座標を使ってそこに物体を設置し、その物体が目印に並んで表示されるまでシーンを調整する`moveSceneHeading`を使います。 184 | 185 | ## 位置精度の改善 186 | CoreLocationは1~15秒ごとにどこでも位置の更新を伝えてくれますが、精度は150mから4mまで変化します。不正確な位置の読み取りに戻ってしまう前に、ときどき4mや8mのようにより正確な位置を取得することがあるでしょう。それと同時に、ARはモーションやカメラのデータを使ってARの世界での地図を作ります。 187 | 188 | ユーザーは4mまで正確な位置の読み取りを受信することがあります。その後、ユーザーが10m北に歩き、65mまで正確に読み取られた別の位置を取得します。この65mでの正確な読み取りはCoreLicationが提供できる最高のものなのですが、4mが読み取られたときにAR内でのユーザーの位置を把握し、そこからARを10m北に歩いたら、およそ4mの精度で新しい座標を与えてくれるデータに変換することができます。これは100mまで正確になります。 189 | 190 | [より詳細な情報はwikiにあります。](https://github.com/ProjectDent/ARKit-CoreLocation/wiki/Current-Location-Accuracy). 191 | 192 | ### 問題 193 | これは実験的だと言いましたが、現在はユーザーがARを使って歩いてるときにARKitがときどき混乱し、ユーザーの位置が不正確になるかもしれません。この問題は"オイラー角"または端末の向きの情報に影響するようにも見えます。なので、少し距離を進んだ後は、あなたが別の方角を歩いてるとARKitは思うのかもしれません。 194 | 195 | AppleがそのうちARKitを改善する一方で、それらの問題を回避するために私たちでできる改善があると思っています。例えば問題が起きたことを認識し、修正することなど。これは位置データを想定した位置と比較して、想定した範囲を超えて移動したのかどうかを判定することで実現できます。 196 | 197 | ### 位置のアルゴリスムの改善 198 | ユーザの位置を決定するためにさらなる最適化をすることができます。 199 | 200 | 例えば、最近の位置データを見て、その後のユーザーの移動をもとに各データポイントを変換し、ユーザがいそうな位置をより厳しく判定するためにそのデータポイントの重なりを使うというテクニックです。 201 | 202 | [より詳細な情報はwikiにあります。](https://github.com/ProjectDent/ARKit-CoreLocation/wiki/Current-Location-Accuracy). 203 | 204 | ## 今後 205 | 206 | 私たちは、いくつかのマイルストーンと上記に関連した問題を抱えています。議論したり貢献することは誰でも歓迎です。心おきなくプルリクエストを送ってください。新しくIssueを追加するか[the Slack community](https://join.slack.com/t/arcl-dev/shared_invite/MjE4NTQ3NzE3MzgxLTE1MDExNTAzMTUtMTIyMmNlMTkyYg)で新しい機能/拡張/バグについて議論できます。 207 | 208 | ## Thanks 209 | [@AndrewProjDent](https://twitter.com/andrewprojdent)がライブラリをつくりましたが、コミュニティの努力はここからです。 210 | 211 | [MIT License](http://opensource.org/licenses/MIT)の条件でオープンソースとして利用できます。 212 | 213 | --------------------------------------------------------------------------------