- Install XCode from the App Store
- Clone this repository
- Open the .xcodeproj file
- Plug in an iOS device
- Select the iOS device from the drop down next to the target at the top of XCode
- Build the project by clicking the play button in xcode
-
Navigate to the folder containing the .metal file
-
Run
xcrun -sdk iphoneos metal -c lightanchorkernels.metal -o lightanchorkernels.air
xcrun -sdk iphoneos metallib lightanchorkernels.air -o lightanchorkernels.metallib
-
Install cocoapods by running "sudo gem install cocoapods" in the terminal
-
Create a new xcode project
-
Quit the xcode project
-
Navigate in a terminal to the project folder
-
Run "pod init" Cocoapods is a package manager for iOS
-
Add 'pod "LASwift"' after the first target line in the "podfile" that was created when "pod init" was run
-
Run "pod install"
-
Open the white .xcworkspace file (not the blue .xcodeproj file)
-
Drag the framework file from "products" in the framework project into "frameworks" of the app project. Select "Copy items if needed" when copying.
-
Drag the .metallib file into the new project. Select "Copy items if needed" when copying.
-
Within xcode drag the framework from the left side into "Embedded Binaries" in the general tab of your target's settings
-
Plug in an iOS device
-
Select the iOS device from the drop down next to the target at the top of XCode
-
Click the play button
Create an instance of LightAnchorPoseManager
Set a class to be the delegate of LightAnchorPoseManager
Implement the LightAnchorPoseManagerDelegate methods
@objc public protocol LightAnchorPoseManagerDelegate {
func lightAnchorPoseManager(_ :LightAnchorPoseManager, didUpdate transform: SCNMatrix4)
func lightAnchorPoseManager(_ :LightAnchorPoseManager, didUpdatePointsFor codeIndex: Int, displayMeanX:Float, displayMeanY: Float, displayStdDevX: Float, displayStdDevY: Float)
func lightAnchorPoseManager(_ :LightAnchorPoseManager, didUpdateResultImage resultImage: UIImage)
}
Example usage can be found here: