Repository: andrewzimmer906/HeatMapEyeTracking Branch: master Commit: b35ccaa68862 Files: 17 Total size: 43.9 KB Directory structure: gitextract_ft8wb4sx/ ├── HeatMap/ │ ├── AppDelegate.swift │ ├── Assets.xcassets/ │ │ ├── AppIcon.appiconset/ │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Base.lproj/ │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── EyeLasers.swift │ ├── HeatMap.metal │ ├── Info.plist │ ├── RaycastData.swift │ └── ViewController.swift ├── HeatMap.xcodeproj/ │ ├── project.pbxproj │ ├── project.xcworkspace/ │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata/ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata/ │ │ └── andrewzimmer.xcuserdatad/ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata/ │ └── andrewzimmer.xcuserdatad/ │ ├── xcdebugger/ │ │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes/ │ └── xcschememanagement.plist └── README.md ================================================ FILE CONTENTS ================================================ ================================================ FILE: HeatMap/AppDelegate.swift ================================================ // // AppDelegate.swift // HeatMap // // Created by Andrew Zimmer on 6/11/18. // Copyright © 2018 AndrewZimmer. All rights reserved. // import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. } func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } } ================================================ FILE: HeatMap/Assets.xcassets/AppIcon.appiconset/Contents.json ================================================ { "images" : [ { "idiom" : "iphone", "size" : "20x20", "scale" : "2x" }, { "idiom" : "iphone", "size" : "20x20", "scale" : "3x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "2x" }, { "idiom" : "iphone", "size" : "29x29", "scale" : "3x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "2x" }, { "idiom" : "iphone", "size" : "40x40", "scale" : "3x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "2x" }, { "idiom" : "iphone", "size" : "60x60", "scale" : "3x" }, { "idiom" : "ipad", "size" : "20x20", "scale" : "1x" }, { "idiom" : "ipad", "size" : "20x20", "scale" : "2x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "1x" }, { "idiom" : "ipad", "size" : "29x29", "scale" : "2x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "1x" }, { "idiom" : "ipad", "size" : "40x40", "scale" : "2x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "1x" }, { "idiom" : "ipad", "size" : "76x76", "scale" : "2x" }, { "idiom" : "ipad", "size" : "83.5x83.5", "scale" : "2x" }, { "idiom" : "ios-marketing", "size" : "1024x1024", "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: HeatMap/Assets.xcassets/Contents.json ================================================ { "info" : { "version" : 1, "author" : "xcode" } } ================================================ FILE: HeatMap/Base.lproj/LaunchScreen.storyboard ================================================ ================================================ FILE: HeatMap/Base.lproj/Main.storyboard ================================================ ================================================ FILE: HeatMap/EyeLasers.swift ================================================ // // EyeLasers.swift // HeatMap // // Created by Andrew Zimmer on 6/11/18. // Copyright © 2018 AndrewZimmer. All rights reserved. // import Foundation import ARKit import SceneKit class EyeLasers : SCNNode { var startLeftEye : simd_float3?; var endLeftEye : simd_float3?; var startRightEye : simd_float3?; var endRightEye : simd_float3?; let leftEyeCylinder: SCNNode let rightEyeCylinder: SCNNode init(geometry: ARSCNFaceGeometry) { leftEyeCylinder = SCNNode(geometry: SCNCylinder(radius: 0.005, height: 0.1)) rightEyeCylinder = SCNNode(geometry: SCNCylinder(radius: 0.005, height: 0.1)) leftEyeCylinder.geometry?.firstMaterial?.diffuse.contents = UIColor.green rightEyeCylinder.geometry?.firstMaterial?.diffuse.contents = UIColor.red leftEyeCylinder.opacity = 0.5 rightEyeCylinder.opacity = 0.5 rightEyeCylinder.renderingOrder = 100; leftEyeCylinder.renderingOrder = 100; rightEyeCylinder.geometry?.firstMaterial?.readsFromDepthBuffer = false; leftEyeCylinder.geometry?.firstMaterial?.readsFromDepthBuffer = false; super.init() addChildNode(leftEyeCylinder) addChildNode(rightEyeCylinder) } required init?(coder aDecoder: NSCoder) { fatalError("\(#function) has not been implemented") } // MARK: ARKit Updates func update(withFaceAnchor anchor: ARFaceAnchor) { if #available(iOS 12.0, *) { let leftEyeTransform = anchor.leftEyeTransform let rotate:matrix_float4x4 = simd_float4x4(SCNMatrix4Mult(SCNMatrix4MakeRotation(-Float.pi / 2.0, 1, 0, 0), SCNMatrix4MakeTranslation(0, 0, 0.1/2))) leftEyeCylinder.simdTransform = leftEyeTransform * rotate; rightEyeCylinder.simdTransform = anchor.rightEyeTransform * rotate; } else { }; } } ================================================ FILE: HeatMap/HeatMap.metal ================================================ // // HeatMap.metal // HeatMap // // Created by Andrew Zimmer on 6/18/18. // Copyright © 2018 AndrewZimmer. All rights reserved. // #include using namespace metal; #include struct MyNodeBuffer { float4x4 modelTransform; float4x4 modelViewTransform; float4x4 normalTransform; float4x4 modelViewProjectionTransform; }; typedef struct { float3 position [[ attribute(SCNVertexSemanticPosition) ]]; float2 uv [[ attribute(SCNVertexSemanticTexcoord0)]]; } MyVertexInput; struct SimpleVertex { float4 position [[position]]; float2 uv [[texcoord0]]; }; half4 ColorForHeat(float heat) { float pval = 4.0 * (1.0 - heat) + 0.99; float lb = pval - floor (pval); int pvalCategory = abs(int(floor(pval))); switch (pvalCategory) { case 0: return half4(1.0, 1.0 - lb, 1.0 - lb, heat); case 1: return half4(1.0, lb, 0.0, heat); case 2: return half4(1.0 - lb, 1.0, 0.0, heat); case 3: return half4(0.0, 1.0, lb, heat); case 4: return half4(0.0, 1.0 - lb, 1.0, heat); case 5: return half4(0.0, 0.0, 1.0 - lb, heat); } return half4(1.0, 1.0, 1.0, heat); } vertex SimpleVertex heatMapVert(MyVertexInput in [[ stage_in ]], constant SCNSceneBuffer& scn_frame [[buffer(0)]], constant MyNodeBuffer& scn_node [[buffer(1)]]) { SimpleVertex vert; vert.position = float4(in.position, 1.0); vert.uv = in.uv; return vert; } fragment half4 heatMapFrag(SimpleVertex in [[stage_in]], device r8unorm *heatmapTexture [[buffer(0)]]) { // This has a rounding error. Fix by using a real texture2D for displaying the heatmap instead of a dang buffer. int x = round(in.uv.x * 375 * 3); int y = round(in.uv.y * 812 * 3); int index = x + y * 375 * 3; float value = heatmapTexture[index]; return ColorForHeat(value); } ================================================ FILE: HeatMap/Info.plist ================================================ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName $(PRODUCT_NAME) CFBundlePackageType APPL CFBundleShortVersionString 1.0 CFBundleVersion 1 LSRequiresIPhoneOS NSCameraUsageDescription This application will use the camera for Augmented Reality. UILaunchStoryboardName LaunchScreen UIMainStoryboardFile Main UIRequiredDeviceCapabilities armv7 arkit UIStatusBarHidden UISupportedInterfaceOrientations UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight ================================================ FILE: HeatMap/RaycastData.swift ================================================ // // RaycastData.swift // HeatMap // // Created by Andrew Zimmer on 6/12/18. // Copyright © 2018 AndrewZimmer. All rights reserved. // import Foundation import ARKit import SceneKit class RaycastData : SCNNode { let floatRaycastDistance:Float = 1; let leftEye: SCNNode let rightEye: SCNNode let leftEyeEnd : SCNNode let rightEyeEnd : SCNNode init(geometry: ARSCNFaceGeometry) { leftEye = SCNNode() rightEye = SCNNode() leftEye.opacity = 0 rightEye.opacity = 0 leftEyeEnd = SCNNode(); leftEye.addChildNode(leftEyeEnd) leftEyeEnd.simdPosition = simd_float3(0,0, floatRaycastDistance); rightEyeEnd = SCNNode(); rightEye.addChildNode(rightEyeEnd) rightEyeEnd.simdPosition = simd_float3(0,0, floatRaycastDistance); super.init() addChildNode(leftEye) addChildNode(rightEye) } required init?(coder aDecoder: NSCoder) { fatalError("\(#function) has not been implemented") } // MARK: ARKit Updates func update(withFaceAnchor anchor: ARFaceAnchor) { if #available(iOS 12.0, *) { leftEye.simdTransform = anchor.leftEyeTransform; rightEye.simdTransform = anchor.rightEyeTransform; } else { }; } } ================================================ FILE: HeatMap/ViewController.swift ================================================ // // ViewController.swift // HeatMap // // Created by Andrew Zimmer on 6/11/18. // Copyright © 2018 AndrewZimmer. All rights reserved. // import UIKit import SceneKit import ARKit class ViewController: UIViewController, ARSCNViewDelegate { @IBOutlet var sceneView: ARSCNView! let phoneWidth = 375 * 3; let phoneHeight = 812 * 3; var m_data : [UInt8] = [UInt8](repeating: 0, count: 375*3 * 812*3) var positions: Array = Array() let numPositions = 10; var eyeLasers : EyeLasers? var eyeRaycastData : RaycastData? var virtualPhoneNode: SCNNode = SCNNode() var virtualScreenNode: SCNNode = { let screenGeometry = SCNPlane(width: 1, height: 1) screenGeometry.firstMaterial?.isDoubleSided = true screenGeometry.firstMaterial?.diffuse.contents = UIColor.green return SCNNode(geometry: screenGeometry) }() var testSphereStart : SCNNode = { let node = SCNNode(geometry: SCNSphere(radius: 0.01)) node.geometry?.firstMaterial?.diffuse.contents = UIColor.purple return node }() var testSphereEnd : SCNNode = { let node = SCNNode(geometry: SCNSphere(radius: 0.01)) node.geometry?.firstMaterial?.diffuse.contents = UIColor.yellow return node }() var heatMapNode:SCNNode = { let node = SCNNode(geometry:SCNPlane(width: 2, height: 2)) // -1 to 1 let program = SCNProgram() program.vertexFunctionName = "heatMapVert" program.fragmentFunctionName = "heatMapFrag" node.geometry?.firstMaterial?.program = program; node.geometry?.firstMaterial?.blendMode = SCNBlendMode.add; return node; } () var target : UIView = UIView() override func viewDidLoad() { super.viewDidLoad() target.backgroundColor = UIColor.red target.frame = CGRect.init(x: 0,y:0 ,width:25 ,height:25) target.layer.cornerRadius = 12.5 sceneView.addSubview(target) // Set the view's delegate sceneView.delegate = self //sceneView.session.delegate = self sceneView.automaticallyUpdatesLighting = true // Show statistics such as fps and timing information sceneView.showsStatistics = true let device = sceneView.device! let eyeGeometry = ARSCNFaceGeometry(device: device)! eyeLasers = EyeLasers(geometry: eyeGeometry) eyeRaycastData = RaycastData(geometry: eyeGeometry) sceneView.scene.rootNode.addChildNode(eyeLasers!) sceneView.scene.rootNode.addChildNode(eyeRaycastData!) virtualPhoneNode.geometry?.firstMaterial?.isDoubleSided = true virtualPhoneNode.addChildNode(virtualScreenNode) sceneView.scene.rootNode.addChildNode(heatMapNode) //sceneView.scene.rootNode.addChildNode(testSphereStart) //sceneView.scene.rootNode.addChildNode(testSphereEnd) self.sceneView.scene.rootNode.addChildNode(virtualPhoneNode) } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) // Create a session configuration let configuration = ARFaceTrackingConfiguration() // Run the view's session sceneView.session.run(configuration) } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) // Pause the view's session sceneView.session.pause() } // MARK: - ARSCNViewDelegate // Override to create and configure nodes for anchors added to the view's session. func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? { let node = SCNNode() return node } func session(_ session: ARSession, didFailWithError error: Error) { // Present an error message to the user } func sessionWasInterrupted(_ session: ARSession) { // Inform the user that the session has been interrupted, for example, by presenting an overlay } func sessionInterruptionEnded(_ session: ARSession) { // Reset tracking and/or remove existing anchors if consistent tracking is required } func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor) { guard let faceAnchor = anchor as? ARFaceAnchor else { return } eyeLasers?.transform = node.transform; eyeRaycastData?.transform = node.transform; eyeLasers?.update(withFaceAnchor: faceAnchor) eyeRaycastData?.update(withFaceAnchor: faceAnchor) } func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) { virtualPhoneNode.transform = (sceneView.pointOfView?.transform)! let options : [String: Any] = [SCNHitTestOption.backFaceCulling.rawValue: false, SCNHitTestOption.searchMode.rawValue: 1, SCNHitTestOption.ignoreChildNodes.rawValue : false, SCNHitTestOption.ignoreHiddenNodes.rawValue : false] testSphereStart.worldPosition = self.eyeRaycastData!.leftEye.worldPosition testSphereEnd.worldPosition = self.eyeRaycastData!.leftEyeEnd.worldPosition let hitTestLeftEye = virtualPhoneNode.hitTestWithSegment( from: virtualPhoneNode.convertPosition(self.eyeRaycastData!.leftEye.worldPosition, from:nil), to: virtualPhoneNode.convertPosition(self.eyeRaycastData!.leftEyeEnd.worldPosition, from:nil), //from: self.eyeRaycastData!.leftEye.worldPosition, //to: self.eyeRaycastData!.leftEyeEnd.worldPosition, options: options) let hitTestRightEye = virtualPhoneNode.hitTestWithSegment( from: virtualPhoneNode.convertPosition(self.eyeRaycastData!.rightEye.worldPosition, from:nil), to: virtualPhoneNode.convertPosition(self.eyeRaycastData!.rightEyeEnd.worldPosition, from:nil), //from: self.eyeRaycastData!.rightEye.worldPosition, //to: self.eyeRaycastData!.rightEyeEnd.worldPosition, options: options) if (hitTestLeftEye.count > 0 && hitTestRightEye.count > 0) { var coords = screenPositionFromHittest(hitTestLeftEye[0], secondResult:hitTestRightEye[0]) //print("x:\(coords.x) y: \(coords.y)") incrementHeatMapAtPosition(x:Int(coords.x * 3), y:Int(coords.y * 3)) // convert from points to pixels here let nsdata = NSData.init(bytes: &m_data, length: phoneWidth * phoneHeight) heatMapNode.geometry?.firstMaterial?.setValue(nsdata, forKey: "heatmapTexture") DispatchQueue.main.async(execute: {() -> Void in self.target.center = CGPoint.init(x: CGFloat(coords.x), y:CGFloat(coords.y)) }) } } func screenPositionFromHittest(_ result1: SCNHitTestResult, secondResult result2: SCNHitTestResult) -> simd_float2 { let iPhoneXPointSize = simd_float2(375, 812) // size of iPhoneX in points let iPhoneXMeterSize = simd_float2(0.0623908297, 0.135096943231532) let xLC = ((result1.localCoordinates.x + result2.localCoordinates.x) / 2.0) var x = xLC / (iPhoneXMeterSize.x / 2.0) * iPhoneXPointSize.x let yLC = -((result1.localCoordinates.y + result2.localCoordinates.y) / 2.0); var y = yLC / (iPhoneXMeterSize.y / 2.0) * iPhoneXPointSize.y + 312 // The 312 points adjustment above is presumably to adjust for the Extrinsics on the iPhone camera. // I didn't calculate them and instead ripped them from : // https://github.com/virakri/eye-tracking-ios-prototype/blob/master/Eyes%20Tracking/ViewController.swift // Probably better to get real values from measuring the camera position to the center of the screen. x = Float.maximum(Float.minimum(x, iPhoneXPointSize.x-1), 0) y = Float.maximum(Float.minimum(y, iPhoneXPointSize.y-1), 0) // Do just a bit of smoothing. Nothing crazy. positions.append(simd_float2(x,y)); if positions.count > numPositions { positions.removeFirst() } var total = simd_float2(0,0); for pos in positions { total.x += pos.x total.y += pos.y } total.x /= Float(positions.count) total.y /= Float(positions.count) return total } /** Note. I'm not using this because I couldn't figure out how to set an MTLTexture to an SCNProgram because Scenekit has terrible documentation. That said you should DEFINITELY fix this if you ever plan to use something like this in production. So I left it in for reference. */ func metalTextureFromArray(_ array:[UInt8], width:Int, height:Int) -> MTLTexture { let textureDescriptor = MTLTextureDescriptor.texture2DDescriptor(pixelFormat: MTLPixelFormat.a8Unorm, width: width, height: height, mipmapped: false) let texture = self.sceneView.device?.makeTexture(descriptor: textureDescriptor) let region = MTLRegion(origin: MTLOriginMake(0, 0, 0), size: MTLSizeMake(width, height, 1)) texture?.replace(region: region, mipmapLevel: 0, withBytes: array, bytesPerRow: width) return texture! } func incrementHeatMapAtPosition(x: Int, y: Int) { let radius:Int = 46; // in pixels let maxIncrement:Float = 25; for curX in x - radius ... x + radius { for curY in y - radius ... y + radius { let idx = posToIndex(x:curX, y:curY) if (idx != -1) { let offset = simd_float2(Float(curX - x), Float(curY - y)); let len = simd_length(offset) if (len >= Float(radius)) { continue; } let incrementValue = Int((1 - (len / Float(radius))) * maxIncrement); if (255 - m_data[idx] > incrementValue) { m_data[idx] = UInt8(Int(m_data[idx]) + incrementValue) } else { m_data[idx] = 255 } } } } } func posToIndex(x:Int, y:Int) -> Int { if (x < 0 || x >= phoneWidth || y < 0 || y >= phoneHeight) { return -1; } return x + y * phoneWidth; } } ================================================ FILE: HeatMap.xcodeproj/project.pbxproj ================================================ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 50; objects = { /* Begin PBXBuildFile section */ 5A92A71D20CEECB9002C1111 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A92A71C20CEECB9002C1111 /* AppDelegate.swift */; }; 5A92A72120CEECB9002C1111 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A92A72020CEECB9002C1111 /* ViewController.swift */; }; 5A92A72420CEECB9002C1111 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5A92A72220CEECB9002C1111 /* Main.storyboard */; }; 5A92A72620CEECBA002C1111 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5A92A72520CEECBA002C1111 /* Assets.xcassets */; }; 5A92A72920CEECBB002C1111 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5A92A72720CEECBB002C1111 /* LaunchScreen.storyboard */; }; 5A92A73320CEF604002C1111 /* EyeLasers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A92A73220CEF604002C1111 /* EyeLasers.swift */; }; 5A92A73520D02EE2002C1111 /* RaycastData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A92A73420D02EE2002C1111 /* RaycastData.swift */; }; 5ACC4C6620D85D5000B91E25 /* HeatMap.metal in Sources */ = {isa = PBXBuildFile; fileRef = 5ACC4C6520D85D5000B91E25 /* HeatMap.metal */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 5A92A71920CEECB9002C1111 /* HeatMap.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HeatMap.app; sourceTree = BUILT_PRODUCTS_DIR; }; 5A92A71C20CEECB9002C1111 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 5A92A72020CEECB9002C1111 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 5A92A72320CEECB9002C1111 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 5A92A72520CEECBA002C1111 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 5A92A72820CEECBB002C1111 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 5A92A72A20CEECBB002C1111 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 5A92A73220CEF604002C1111 /* EyeLasers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EyeLasers.swift; sourceTree = ""; }; 5A92A73420D02EE2002C1111 /* RaycastData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RaycastData.swift; sourceTree = ""; }; 5ACC4C6520D85D5000B91E25 /* HeatMap.metal */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.metal; path = HeatMap.metal; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 5A92A71620CEECB9002C1111 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 5A92A71020CEECB9002C1111 = { isa = PBXGroup; children = ( 5A92A71B20CEECB9002C1111 /* HeatMap */, 5A92A71A20CEECB9002C1111 /* Products */, ); sourceTree = ""; }; 5A92A71A20CEECB9002C1111 /* Products */ = { isa = PBXGroup; children = ( 5A92A71920CEECB9002C1111 /* HeatMap.app */, ); name = Products; sourceTree = ""; }; 5A92A71B20CEECB9002C1111 /* HeatMap */ = { isa = PBXGroup; children = ( 5A92A73220CEF604002C1111 /* EyeLasers.swift */, 5A92A73420D02EE2002C1111 /* RaycastData.swift */, 5A92A71C20CEECB9002C1111 /* AppDelegate.swift */, 5A92A72020CEECB9002C1111 /* ViewController.swift */, 5A92A72520CEECBA002C1111 /* Assets.xcassets */, 5A92A72220CEECB9002C1111 /* Main.storyboard */, 5A92A72720CEECBB002C1111 /* LaunchScreen.storyboard */, 5A92A72A20CEECBB002C1111 /* Info.plist */, 5ACC4C6520D85D5000B91E25 /* HeatMap.metal */, ); path = HeatMap; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 5A92A71820CEECB9002C1111 /* HeatMap */ = { isa = PBXNativeTarget; buildConfigurationList = 5A92A72D20CEECBB002C1111 /* Build configuration list for PBXNativeTarget "HeatMap" */; buildPhases = ( 5A92A71520CEECB9002C1111 /* Sources */, 5A92A71620CEECB9002C1111 /* Frameworks */, 5A92A71720CEECB9002C1111 /* Resources */, ); buildRules = ( ); dependencies = ( ); name = HeatMap; productName = HeatMap; productReference = 5A92A71920CEECB9002C1111 /* HeatMap.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 5A92A71120CEECB9002C1111 /* Project object */ = { isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1000; LastUpgradeCheck = 1000; ORGANIZATIONNAME = AndrewZimmer; TargetAttributes = { 5A92A71820CEECB9002C1111 = { CreatedOnToolsVersion = 10.0; }; }; }; buildConfigurationList = 5A92A71420CEECB9002C1111 /* Build configuration list for PBXProject "HeatMap" */; compatibilityVersion = "Xcode 9.3"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 5A92A71020CEECB9002C1111; productRefGroup = 5A92A71A20CEECB9002C1111 /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 5A92A71820CEECB9002C1111 /* HeatMap */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 5A92A71720CEECB9002C1111 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 5A92A72920CEECBB002C1111 /* LaunchScreen.storyboard in Resources */, 5A92A72620CEECBA002C1111 /* Assets.xcassets in Resources */, 5A92A72420CEECB9002C1111 /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 5A92A71520CEECB9002C1111 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 5A92A72120CEECB9002C1111 /* ViewController.swift in Sources */, 5ACC4C6620D85D5000B91E25 /* HeatMap.metal in Sources */, 5A92A73520D02EE2002C1111 /* RaycastData.swift in Sources */, 5A92A71D20CEECB9002C1111 /* AppDelegate.swift in Sources */, 5A92A73320CEF604002C1111 /* EyeLasers.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXVariantGroup section */ 5A92A72220CEECB9002C1111 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( 5A92A72320CEECB9002C1111 /* Base */, ); name = Main.storyboard; sourceTree = ""; }; 5A92A72720CEECBB002C1111 /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( 5A92A72820CEECBB002C1111 /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ 5A92A72B20CEECBB002C1111 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; 5A92A72C20CEECBB002C1111 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; }; 5A92A72E20CEECBB002C1111 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = NLASH8BTJ5; INFOPLIST_FILE = HeatMap/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = AZ.HeatMap; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; 5A92A72F20CEECBB002C1111 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = NLASH8BTJ5; INFOPLIST_FILE = HeatMap/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = AZ.HeatMap; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 5A92A71420CEECB9002C1111 /* Build configuration list for PBXProject "HeatMap" */ = { isa = XCConfigurationList; buildConfigurations = ( 5A92A72B20CEECBB002C1111 /* Debug */, 5A92A72C20CEECBB002C1111 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 5A92A72D20CEECBB002C1111 /* Build configuration list for PBXNativeTarget "HeatMap" */ = { isa = XCConfigurationList; buildConfigurations = ( 5A92A72E20CEECBB002C1111 /* Debug */, 5A92A72F20CEECBB002C1111 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 5A92A71120CEECB9002C1111 /* Project object */; } ================================================ FILE: HeatMap.xcodeproj/project.xcworkspace/contents.xcworkspacedata ================================================ ================================================ FILE: HeatMap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist ================================================ IDEDidComputeMac32BitWarning ================================================ FILE: HeatMap.xcodeproj/xcuserdata/andrewzimmer.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist ================================================ ================================================ FILE: HeatMap.xcodeproj/xcuserdata/andrewzimmer.xcuserdatad/xcschemes/xcschememanagement.plist ================================================ SchemeUserState HeatMap.xcscheme orderHint 0 ================================================ FILE: README.md ================================================ # HeatMapEyeTracking A quick test with ARKit 2 implementing a heatmap for eye tracking