[
  {
    "path": "HeatMap/AppDelegate.swift",
    "content": "//\n//  AppDelegate.swift\n//  HeatMap\n//\n//  Created by Andrew Zimmer on 6/11/18.\n//  Copyright © 2018 AndrewZimmer. All rights reserved.\n//\n\nimport UIKit\n\n@UIApplicationMain\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n\n    var window: UIWindow?\n\n\n    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {\n        // Override point for customization after application launch.\n        return true\n    }\n\n    func applicationWillResignActive(_ application: UIApplication) {\n        // 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.\n        // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.\n    }\n\n    func applicationDidEnterBackground(_ application: UIApplication) {\n        // 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.\n        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.\n    }\n\n    func applicationWillEnterForeground(_ application: UIApplication) {\n        // 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.\n    }\n\n    func applicationDidBecomeActive(_ application: UIApplication) {\n        // 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.\n    }\n\n    func applicationWillTerminate(_ application: UIApplication) {\n        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.\n    }\n\n\n}\n\n"
  },
  {
    "path": "HeatMap/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"20x20\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"20x20\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"60x60\",\n      \"scale\" : \"3x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"20x20\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"20x20\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"40x40\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"76x76\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"76x76\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"ipad\",\n      \"size\" : \"83.5x83.5\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"ios-marketing\",\n      \"size\" : \"1024x1024\",\n      \"scale\" : \"1x\"\n    }\n  ],\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "HeatMap/Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"version\" : 1,\n    \"author\" : \"xcode\"\n  }\n}"
  },
  {
    "path": "HeatMap/Base.lproj/LaunchScreen.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"13122.16\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" launchScreen=\"YES\" useTraitCollections=\"YES\" useSafeAreas=\"YES\" colorMatched=\"YES\" initialViewController=\"01J-lp-oVM\">\n    <dependencies>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"13104.12\"/>\n        <capability name=\"Safe area layout guides\" minToolsVersion=\"9.0\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"EHf-IW-A2E\">\n            <objects>\n                <viewController id=\"01J-lp-oVM\" sceneMemberID=\"viewController\">\n                    <view key=\"view\" contentMode=\"scaleToFill\" id=\"Ze5-6b-2t3\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\n                        <autoresizingMask key=\"autoresizingMask\" widthSizable=\"YES\" heightSizable=\"YES\"/>\n                        <color key=\"backgroundColor\" red=\"1\" green=\"1\" blue=\"1\" alpha=\"1\" colorSpace=\"custom\" customColorSpace=\"sRGB\"/>\n                        <viewLayoutGuide key=\"safeArea\" id=\"6Tk-OE-BBY\"/>\n                    </view>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"iYj-Kq-Ea1\" userLabel=\"First Responder\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n            <point key=\"canvasLocation\" x=\"53\" y=\"375\"/>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "HeatMap/Base.lproj/Main.storyboard",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3.0\" toolsVersion=\"14269.12\" targetRuntime=\"iOS.CocoaTouch\" propertyAccessControl=\"none\" useAutolayout=\"YES\" useTraitCollections=\"YES\" useSafeAreas=\"YES\" colorMatched=\"YES\" initialViewController=\"BV1-FR-VrT\">\n    <device id=\"retina4_7\" orientation=\"portrait\">\n        <adaptation id=\"fullscreen\"/>\n    </device>\n    <dependencies>\n        <plugIn identifier=\"com.apple.InterfaceBuilder.IBCocoaTouchPlugin\" version=\"14252.5\"/>\n        <capability name=\"documents saved in the Xcode 8 format\" minToolsVersion=\"8.0\"/>\n    </dependencies>\n    <scenes>\n        <!--View Controller-->\n        <scene sceneID=\"tXr-a1-R10\">\n            <objects>\n                <viewController id=\"BV1-FR-VrT\" customClass=\"ViewController\" customModule=\"HeatMap\" customModuleProvider=\"target\" sceneMemberID=\"viewController\">\n                    <arscnView key=\"view\" clipsSubviews=\"YES\" multipleTouchEnabled=\"YES\" contentMode=\"scaleToFill\" id=\"BrB-h1-WRS\">\n                        <rect key=\"frame\" x=\"0.0\" y=\"0.0\" width=\"375\" height=\"667\"/>\n                        <autoresizingMask key=\"autoresizingMask\" flexibleMaxX=\"YES\" flexibleMaxY=\"YES\"/>\n                    </arscnView>\n                    <connections>\n                        <outlet property=\"sceneView\" destination=\"BrB-h1-WRS\" id=\"5nT-qQ-ynl\"/>\n                    </connections>\n                </viewController>\n                <placeholder placeholderIdentifier=\"IBFirstResponder\" id=\"SZV-WD-TEh\" sceneMemberID=\"firstResponder\"/>\n            </objects>\n        </scene>\n    </scenes>\n</document>\n"
  },
  {
    "path": "HeatMap/EyeLasers.swift",
    "content": "//\n//  EyeLasers.swift\n//  HeatMap\n//\n//  Created by Andrew Zimmer on 6/11/18.\n//  Copyright © 2018 AndrewZimmer. All rights reserved.\n//\n\nimport Foundation\nimport ARKit\nimport SceneKit\n\nclass EyeLasers : SCNNode {\n    var startLeftEye : simd_float3?;\n    var endLeftEye : simd_float3?;\n    \n    var startRightEye : simd_float3?;\n    var endRightEye : simd_float3?;\n    \n    let leftEyeCylinder: SCNNode\n    let rightEyeCylinder: SCNNode\n    \n    init(geometry: ARSCNFaceGeometry) {\n        leftEyeCylinder = SCNNode(geometry: SCNCylinder(radius: 0.005, height: 0.1))\n        rightEyeCylinder = SCNNode(geometry: SCNCylinder(radius: 0.005, height: 0.1))\n        \n        leftEyeCylinder.geometry?.firstMaterial?.diffuse.contents = UIColor.green\n        rightEyeCylinder.geometry?.firstMaterial?.diffuse.contents = UIColor.red\n        leftEyeCylinder.opacity = 0.5\n        rightEyeCylinder.opacity = 0.5\n        \n        rightEyeCylinder.renderingOrder = 100;\n        leftEyeCylinder.renderingOrder = 100;\n        rightEyeCylinder.geometry?.firstMaterial?.readsFromDepthBuffer = false;\n        leftEyeCylinder.geometry?.firstMaterial?.readsFromDepthBuffer = false;\n        \n        super.init()\n\n        addChildNode(leftEyeCylinder)\n        addChildNode(rightEyeCylinder)\n    }\n    \n    required init?(coder aDecoder: NSCoder) {\n        fatalError(\"\\(#function) has not been implemented\")\n    }\n    \n    \n    // MARK: ARKit Updates\n    func update(withFaceAnchor anchor: ARFaceAnchor) {\n        if #available(iOS 12.0, *) {\n            let leftEyeTransform = anchor.leftEyeTransform\n            let rotate:matrix_float4x4 =\n                simd_float4x4(SCNMatrix4Mult(SCNMatrix4MakeRotation(-Float.pi / 2.0, 1, 0, 0), SCNMatrix4MakeTranslation(0, 0, 0.1/2)))\n            \n            leftEyeCylinder.simdTransform = leftEyeTransform * rotate;\n            rightEyeCylinder.simdTransform = anchor.rightEyeTransform * rotate;\n        } else {\n            \n        };\n    }\n}\n"
  },
  {
    "path": "HeatMap/HeatMap.metal",
    "content": "//\n//  HeatMap.metal\n//  HeatMap\n//\n//  Created by Andrew Zimmer on 6/18/18.\n//  Copyright © 2018 AndrewZimmer. All rights reserved.\n//\n\n#include <metal_stdlib>\nusing namespace metal;\n#include <SceneKit/scn_metal>\n\nstruct MyNodeBuffer {\n    float4x4 modelTransform;\n    float4x4 modelViewTransform;\n    float4x4 normalTransform;\n    float4x4 modelViewProjectionTransform;\n};\n\ntypedef struct {\n    float3 position [[ attribute(SCNVertexSemanticPosition) ]];\n    float2 uv [[ attribute(SCNVertexSemanticTexcoord0)]];\n} MyVertexInput;\n\nstruct SimpleVertex\n{\n    float4 position [[position]];\n    float2 uv [[texcoord0]];\n};\n\nhalf4 ColorForHeat(float heat) {\n    float pval = 4.0 * (1.0 - heat) + 0.99;\n    float lb = pval - floor (pval);\n    int pvalCategory = abs(int(floor(pval)));\n    \n    switch (pvalCategory) {\n        case 0:\n            return half4(1.0, 1.0 - lb, 1.0 - lb, heat);\n            \n        case 1:\n            return half4(1.0, lb, 0.0, heat);\n            \n        case 2:\n            return half4(1.0 - lb, 1.0, 0.0, heat);\n            \n        case 3:\n            return half4(0.0, 1.0, lb, heat);\n            \n        case 4:\n            return half4(0.0, 1.0 - lb, 1.0, heat);\n            \n        case 5:\n            return half4(0.0, 0.0, 1.0 - lb, heat);\n    }\n    \n    return half4(1.0, 1.0, 1.0, heat);\n}\n\nvertex SimpleVertex heatMapVert(MyVertexInput in [[ stage_in ]],\n                             constant SCNSceneBuffer& scn_frame [[buffer(0)]],\n                             constant MyNodeBuffer& scn_node [[buffer(1)]])\n{\n    SimpleVertex vert;\n    vert.position = float4(in.position, 1.0);\n    vert.uv = in.uv;\n    \n    return vert;\n}\n\nfragment half4 heatMapFrag(SimpleVertex in [[stage_in]],\n                           device r8unorm<float> *heatmapTexture [[buffer(0)]])\n{\n    // This has a rounding error. Fix by using a real texture2D for displaying the heatmap instead of a dang buffer.    \n    int x = round(in.uv.x * 375 * 3);\n    int y = round(in.uv.y * 812 * 3);\n    int index = x + y * 375 * 3;\n    \n    float value = heatmapTexture[index];\n    return ColorForHeat(value);\n}\n\n\n"
  },
  {
    "path": "HeatMap/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDevelopmentRegion</key>\n\t<string>$(DEVELOPMENT_LANGUAGE)</string>\n\t<key>CFBundleExecutable</key>\n\t<string>$(EXECUTABLE_NAME)</string>\n\t<key>CFBundleIdentifier</key>\n\t<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>\n\t<key>CFBundleInfoDictionaryVersion</key>\n\t<string>6.0</string>\n\t<key>CFBundleName</key>\n\t<string>$(PRODUCT_NAME)</string>\n\t<key>CFBundlePackageType</key>\n\t<string>APPL</string>\n\t<key>CFBundleShortVersionString</key>\n\t<string>1.0</string>\n\t<key>CFBundleVersion</key>\n\t<string>1</string>\n\t<key>LSRequiresIPhoneOS</key>\n\t<true/>\n\t<key>NSCameraUsageDescription</key>\n\t<string>This application will use the camera for Augmented Reality.</string>\n\t<key>UILaunchStoryboardName</key>\n\t<string>LaunchScreen</string>\n\t<key>UIMainStoryboardFile</key>\n\t<string>Main</string>\n\t<key>UIRequiredDeviceCapabilities</key>\n\t<array>\n\t\t<string>armv7</string>\n\t\t<string>arkit</string>\n\t</array>\n\t<key>UIStatusBarHidden</key>\n\t<true/>\n\t<key>UISupportedInterfaceOrientations</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n\t<key>UISupportedInterfaceOrientations~ipad</key>\n\t<array>\n\t\t<string>UIInterfaceOrientationPortrait</string>\n\t\t<string>UIInterfaceOrientationPortraitUpsideDown</string>\n\t\t<string>UIInterfaceOrientationLandscapeLeft</string>\n\t\t<string>UIInterfaceOrientationLandscapeRight</string>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "HeatMap/RaycastData.swift",
    "content": "//\n//  RaycastData.swift\n//  HeatMap\n//\n//  Created by Andrew Zimmer on 6/12/18.\n//  Copyright © 2018 AndrewZimmer. All rights reserved.\n//\n\nimport Foundation\nimport ARKit\nimport SceneKit\n\nclass RaycastData : SCNNode {\n    let floatRaycastDistance:Float = 1;\n    let leftEye: SCNNode\n    let rightEye: SCNNode\n    \n    let leftEyeEnd : SCNNode\n    let rightEyeEnd : SCNNode\n    \n    init(geometry: ARSCNFaceGeometry) {\n        leftEye = SCNNode()\n        rightEye = SCNNode()\n        \n        leftEye.opacity = 0\n        rightEye.opacity = 0\n        \n        leftEyeEnd = SCNNode();\n        leftEye.addChildNode(leftEyeEnd)\n        leftEyeEnd.simdPosition = simd_float3(0,0, floatRaycastDistance);\n        \n        rightEyeEnd = SCNNode();\n        rightEye.addChildNode(rightEyeEnd)\n        rightEyeEnd.simdPosition = simd_float3(0,0, floatRaycastDistance);\n        \n        super.init()\n        \n        addChildNode(leftEye)\n        addChildNode(rightEye)\n    }\n    \n    required init?(coder aDecoder: NSCoder) {\n        fatalError(\"\\(#function) has not been implemented\")\n    }\n    \n    \n    // MARK: ARKit Updates\n    func update(withFaceAnchor anchor: ARFaceAnchor) {\n        if #available(iOS 12.0, *) {\n            leftEye.simdTransform = anchor.leftEyeTransform;\n            rightEye.simdTransform = anchor.rightEyeTransform;\n        } else {\n            \n        };\n    }\n}\n"
  },
  {
    "path": "HeatMap/ViewController.swift",
    "content": "//\n//  ViewController.swift\n//  HeatMap\n//\n//  Created by Andrew Zimmer on 6/11/18.\n//  Copyright © 2018 AndrewZimmer. All rights reserved.\n//\n\nimport UIKit\nimport SceneKit\nimport ARKit\n\nclass ViewController: UIViewController, ARSCNViewDelegate {\n\n    @IBOutlet var sceneView: ARSCNView!\n    \n    let phoneWidth = 375 * 3;\n    let phoneHeight = 812 * 3;\n    \n    var m_data : [UInt8] = [UInt8](repeating: 0, count: 375*3 * 812*3)\n    \n    var positions: Array<simd_float2> = Array()\n    let numPositions = 10;\n    \n    var eyeLasers : EyeLasers?\n    var eyeRaycastData : RaycastData?\n    var virtualPhoneNode: SCNNode = SCNNode()\n    \n    var virtualScreenNode: SCNNode = {\n        \n        let screenGeometry = SCNPlane(width: 1, height: 1)\n        screenGeometry.firstMaterial?.isDoubleSided = true\n        screenGeometry.firstMaterial?.diffuse.contents = UIColor.green\n        \n        return SCNNode(geometry: screenGeometry)\n    }()\n    \n    var testSphereStart : SCNNode = {\n        let node = SCNNode(geometry: SCNSphere(radius: 0.01))\n        node.geometry?.firstMaterial?.diffuse.contents = UIColor.purple\n        return node\n    }()\n    \n    var testSphereEnd : SCNNode = {\n        let node = SCNNode(geometry: SCNSphere(radius: 0.01))\n        node.geometry?.firstMaterial?.diffuse.contents = UIColor.yellow\n        return node\n    }()\n    \n    var heatMapNode:SCNNode = {\n        let node = SCNNode(geometry:SCNPlane(width: 2, height: 2))  // -1 to 1\n        \n        let program = SCNProgram()\n        program.vertexFunctionName = \"heatMapVert\"\n        program.fragmentFunctionName = \"heatMapFrag\"\n        \n        node.geometry?.firstMaterial?.program = program;\n        node.geometry?.firstMaterial?.blendMode = SCNBlendMode.add;\n        \n        return node;\n    } ()\n    \n    var target : UIView = UIView()\n    \n    override func viewDidLoad() {\n        super.viewDidLoad()\n        \n        target.backgroundColor = UIColor.red\n        target.frame = CGRect.init(x: 0,y:0 ,width:25 ,height:25)\n        target.layer.cornerRadius = 12.5\n        sceneView.addSubview(target)\n        \n        // Set the view's delegate\n        sceneView.delegate = self\n        //sceneView.session.delegate = self\n        sceneView.automaticallyUpdatesLighting = true\n        \n        // Show statistics such as fps and timing information\n        sceneView.showsStatistics = true\n        \n        let device = sceneView.device!\n        let eyeGeometry = ARSCNFaceGeometry(device: device)!\n        eyeLasers = EyeLasers(geometry: eyeGeometry)\n        eyeRaycastData = RaycastData(geometry: eyeGeometry)\n        sceneView.scene.rootNode.addChildNode(eyeLasers!)\n        sceneView.scene.rootNode.addChildNode(eyeRaycastData!)\n        \n        virtualPhoneNode.geometry?.firstMaterial?.isDoubleSided = true\n        virtualPhoneNode.addChildNode(virtualScreenNode)\n\n        sceneView.scene.rootNode.addChildNode(heatMapNode)\n        \n        //sceneView.scene.rootNode.addChildNode(testSphereStart)\n        //sceneView.scene.rootNode.addChildNode(testSphereEnd)\n        self.sceneView.scene.rootNode.addChildNode(virtualPhoneNode)\n    }\n    \n    override func viewWillAppear(_ animated: Bool) {\n        super.viewWillAppear(animated)\n        \n        // Create a session configuration\n        let configuration = ARFaceTrackingConfiguration()\n\n        // Run the view's session\n        sceneView.session.run(configuration)\n    }\n    \n    override func viewWillDisappear(_ animated: Bool) {\n        super.viewWillDisappear(animated)\n        \n        // Pause the view's session\n        sceneView.session.pause()\n    }\n\n    // MARK: - ARSCNViewDelegate\n    \n\n    // Override to create and configure nodes for anchors added to the view's session.\n    func renderer(_ renderer: SCNSceneRenderer, nodeFor anchor: ARAnchor) -> SCNNode? {\n        let node = SCNNode()\n     \n        return node\n    }\n    \n    func session(_ session: ARSession, didFailWithError error: Error) {\n        // Present an error message to the user\n    }\n    \n    func sessionWasInterrupted(_ session: ARSession) {\n        // Inform the user that the session has been interrupted, for example, by presenting an overlay\n        \n    }\n    \n    func sessionInterruptionEnded(_ session: ARSession) {\n        // Reset tracking and/or remove existing anchors if consistent tracking is required\n    }\n    \n    func renderer(_ renderer: SCNSceneRenderer, didUpdate node: SCNNode, for anchor: ARAnchor) {\n        guard let faceAnchor = anchor as? ARFaceAnchor else { return }\n        eyeLasers?.transform = node.transform;\n        eyeRaycastData?.transform = node.transform;\n        eyeLasers?.update(withFaceAnchor: faceAnchor)\n        eyeRaycastData?.update(withFaceAnchor: faceAnchor)\n    }\n    \n    func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) {\n        virtualPhoneNode.transform = (sceneView.pointOfView?.transform)!\n        \n        let options : [String: Any] = [SCNHitTestOption.backFaceCulling.rawValue: false,\n                                       SCNHitTestOption.searchMode.rawValue: 1,\n                                       SCNHitTestOption.ignoreChildNodes.rawValue : false,\n                                       SCNHitTestOption.ignoreHiddenNodes.rawValue : false]\n        \n        testSphereStart.worldPosition = self.eyeRaycastData!.leftEye.worldPosition\n        testSphereEnd.worldPosition = self.eyeRaycastData!.leftEyeEnd.worldPosition\n        \n        let hitTestLeftEye = virtualPhoneNode.hitTestWithSegment(\n            from: virtualPhoneNode.convertPosition(self.eyeRaycastData!.leftEye.worldPosition, from:nil),\n            to:  virtualPhoneNode.convertPosition(self.eyeRaycastData!.leftEyeEnd.worldPosition, from:nil),\n            //from: self.eyeRaycastData!.leftEye.worldPosition,\n            //to:  self.eyeRaycastData!.leftEyeEnd.worldPosition,\n            options: options)\n        \n        let hitTestRightEye = virtualPhoneNode.hitTestWithSegment(\n            from: virtualPhoneNode.convertPosition(self.eyeRaycastData!.rightEye.worldPosition, from:nil),\n            to:  virtualPhoneNode.convertPosition(self.eyeRaycastData!.rightEyeEnd.worldPosition, from:nil),\n            //from: self.eyeRaycastData!.rightEye.worldPosition,\n            //to:  self.eyeRaycastData!.rightEyeEnd.worldPosition,\n            options: options)\n        \n        if (hitTestLeftEye.count > 0 && hitTestRightEye.count > 0) {\n            \n            var coords = screenPositionFromHittest(hitTestLeftEye[0], secondResult:hitTestRightEye[0])\n            //print(\"x:\\(coords.x) y: \\(coords.y)\")\n            \n            incrementHeatMapAtPosition(x:Int(coords.x * 3), y:Int(coords.y * 3))  // convert from points to pixels here\n            \n            let nsdata = NSData.init(bytes: &m_data, length: phoneWidth * phoneHeight)\n            heatMapNode.geometry?.firstMaterial?.setValue(nsdata, forKey: \"heatmapTexture\")\n            \n            DispatchQueue.main.async(execute: {() -> Void in\n                self.target.center = CGPoint.init(x: CGFloat(coords.x), y:CGFloat(coords.y))\n            })\n        }\n    }\n    \n    func screenPositionFromHittest(_ result1: SCNHitTestResult, secondResult result2: SCNHitTestResult) -> simd_float2 {\n        let iPhoneXPointSize = simd_float2(375, 812)  // size of iPhoneX in points\n        let iPhoneXMeterSize = simd_float2(0.0623908297, 0.135096943231532)\n\n        let xLC = ((result1.localCoordinates.x + result2.localCoordinates.x) / 2.0)\n        var x = xLC / (iPhoneXMeterSize.x / 2.0) * iPhoneXPointSize.x\n        \n        let yLC = -((result1.localCoordinates.y + result2.localCoordinates.y) / 2.0);\n        var y = yLC / (iPhoneXMeterSize.y / 2.0) * iPhoneXPointSize.y + 312\n        \n        // The 312 points adjustment above is presumably to adjust for the Extrinsics on the iPhone camera.\n        // I didn't calculate them and instead ripped them from :\n        // https://github.com/virakri/eye-tracking-ios-prototype/blob/master/Eyes%20Tracking/ViewController.swift\n        // Probably better to get real values from measuring the camera position to the center of the screen.\n        \n        x = Float.maximum(Float.minimum(x, iPhoneXPointSize.x-1), 0)\n        y = Float.maximum(Float.minimum(y, iPhoneXPointSize.y-1), 0)\n        \n        // Do just a bit of smoothing. Nothing crazy.\n        positions.append(simd_float2(x,y));\n        if positions.count > numPositions {\n            positions.removeFirst()\n        }\n        \n        var total = simd_float2(0,0);\n        for pos in positions {\n            total.x += pos.x\n            total.y += pos.y\n        }\n        \n        total.x /= Float(positions.count)\n        total.y /= Float(positions.count)\n        \n        return total\n    }\n\n    /** Note. I'm not using this because I couldn't figure out how to set an MTLTexture to an SCNProgram because Scenekit has terrible\n        documentation. That said you should DEFINITELY fix this if you ever plan to use something like this in production.\n        So I left it in for reference. */\n    func metalTextureFromArray(_ array:[UInt8], width:Int, height:Int) -> MTLTexture {\n        let textureDescriptor = MTLTextureDescriptor.texture2DDescriptor(pixelFormat: MTLPixelFormat.a8Unorm, width: width, height: height, mipmapped: false)\n        \n        let texture = self.sceneView.device?.makeTexture(descriptor: textureDescriptor)\n        let region = MTLRegion(origin: MTLOriginMake(0, 0, 0), size: MTLSizeMake(width, height, 1))\n        texture?.replace(region: region, mipmapLevel: 0, withBytes: array, bytesPerRow: width)\n        \n        return texture!\n    }\n    \n    func incrementHeatMapAtPosition(x: Int, y: Int) {\n        let radius:Int = 46; // in pixels\n        let maxIncrement:Float = 25;\n        \n        for curX in x - radius ... x + radius {\n            for curY in y - radius ... y + radius {\n                let idx = posToIndex(x:curX, y:curY)\n                \n                if (idx != -1) {\n                    let offset = simd_float2(Float(curX - x), Float(curY - y));\n                    let len = simd_length(offset)\n                    \n                    if (len >= Float(radius)) {\n                        continue;\n                    }\n\n                    let incrementValue = Int((1 - (len / Float(radius))) * maxIncrement);\n                    if (255 - m_data[idx] > incrementValue) {\n                        m_data[idx] = UInt8(Int(m_data[idx]) + incrementValue)\n                    } else {\n                        m_data[idx] = 255\n                    }\n                }\n            }\n        }\n    }\n    \n    func posToIndex(x:Int, y:Int) -> Int {\n        if (x < 0 || x >= phoneWidth ||\n            y < 0 || y >= phoneHeight) {\n            return -1;\n        }\n        \n        return x + y * phoneWidth;\n    }\n}\n"
  },
  {
    "path": "HeatMap.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 50;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t5A92A71D20CEECB9002C1111 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A92A71C20CEECB9002C1111 /* AppDelegate.swift */; };\n\t\t5A92A72120CEECB9002C1111 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A92A72020CEECB9002C1111 /* ViewController.swift */; };\n\t\t5A92A72420CEECB9002C1111 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5A92A72220CEECB9002C1111 /* Main.storyboard */; };\n\t\t5A92A72620CEECBA002C1111 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5A92A72520CEECBA002C1111 /* Assets.xcassets */; };\n\t\t5A92A72920CEECBB002C1111 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5A92A72720CEECBB002C1111 /* LaunchScreen.storyboard */; };\n\t\t5A92A73320CEF604002C1111 /* EyeLasers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A92A73220CEF604002C1111 /* EyeLasers.swift */; };\n\t\t5A92A73520D02EE2002C1111 /* RaycastData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A92A73420D02EE2002C1111 /* RaycastData.swift */; };\n\t\t5ACC4C6620D85D5000B91E25 /* HeatMap.metal in Sources */ = {isa = PBXBuildFile; fileRef = 5ACC4C6520D85D5000B91E25 /* HeatMap.metal */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t5A92A71920CEECB9002C1111 /* HeatMap.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HeatMap.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t5A92A71C20CEECB9002C1111 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = \"<group>\"; };\n\t\t5A92A72020CEECB9002C1111 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = \"<group>\"; };\n\t\t5A92A72320CEECB9002C1111 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = \"<group>\"; };\n\t\t5A92A72520CEECBA002C1111 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t5A92A72820CEECBB002C1111 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = \"<group>\"; };\n\t\t5A92A72A20CEECBB002C1111 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t5A92A73220CEF604002C1111 /* EyeLasers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EyeLasers.swift; sourceTree = \"<group>\"; };\n\t\t5A92A73420D02EE2002C1111 /* RaycastData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RaycastData.swift; sourceTree = \"<group>\"; };\n\t\t5ACC4C6520D85D5000B91E25 /* HeatMap.metal */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.metal; path = HeatMap.metal; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t5A92A71620CEECB9002C1111 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t5A92A71020CEECB9002C1111 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5A92A71B20CEECB9002C1111 /* HeatMap */,\n\t\t\t\t5A92A71A20CEECB9002C1111 /* Products */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t5A92A71A20CEECB9002C1111 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5A92A71920CEECB9002C1111 /* HeatMap.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t5A92A71B20CEECB9002C1111 /* HeatMap */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t5A92A73220CEF604002C1111 /* EyeLasers.swift */,\n\t\t\t\t5A92A73420D02EE2002C1111 /* RaycastData.swift */,\n\t\t\t\t5A92A71C20CEECB9002C1111 /* AppDelegate.swift */,\n\t\t\t\t5A92A72020CEECB9002C1111 /* ViewController.swift */,\n\t\t\t\t5A92A72520CEECBA002C1111 /* Assets.xcassets */,\n\t\t\t\t5A92A72220CEECB9002C1111 /* Main.storyboard */,\n\t\t\t\t5A92A72720CEECBB002C1111 /* LaunchScreen.storyboard */,\n\t\t\t\t5A92A72A20CEECBB002C1111 /* Info.plist */,\n\t\t\t\t5ACC4C6520D85D5000B91E25 /* HeatMap.metal */,\n\t\t\t);\n\t\t\tpath = HeatMap;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t5A92A71820CEECB9002C1111 /* HeatMap */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 5A92A72D20CEECBB002C1111 /* Build configuration list for PBXNativeTarget \"HeatMap\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t5A92A71520CEECB9002C1111 /* Sources */,\n\t\t\t\t5A92A71620CEECB9002C1111 /* Frameworks */,\n\t\t\t\t5A92A71720CEECB9002C1111 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = HeatMap;\n\t\t\tproductName = HeatMap;\n\t\t\tproductReference = 5A92A71920CEECB9002C1111 /* HeatMap.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t5A92A71120CEECB9002C1111 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tLastSwiftUpdateCheck = 1000;\n\t\t\t\tLastUpgradeCheck = 1000;\n\t\t\t\tORGANIZATIONNAME = AndrewZimmer;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t5A92A71820CEECB9002C1111 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 10.0;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 5A92A71420CEECB9002C1111 /* Build configuration list for PBXProject \"HeatMap\" */;\n\t\t\tcompatibilityVersion = \"Xcode 9.3\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t);\n\t\t\tmainGroup = 5A92A71020CEECB9002C1111;\n\t\t\tproductRefGroup = 5A92A71A20CEECB9002C1111 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t5A92A71820CEECB9002C1111 /* HeatMap */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t5A92A71720CEECB9002C1111 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t5A92A72920CEECBB002C1111 /* LaunchScreen.storyboard in Resources */,\n\t\t\t\t5A92A72620CEECBA002C1111 /* Assets.xcassets in Resources */,\n\t\t\t\t5A92A72420CEECB9002C1111 /* Main.storyboard in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t5A92A71520CEECB9002C1111 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t5A92A72120CEECB9002C1111 /* ViewController.swift in Sources */,\n\t\t\t\t5ACC4C6620D85D5000B91E25 /* HeatMap.metal in Sources */,\n\t\t\t\t5A92A73520D02EE2002C1111 /* RaycastData.swift in Sources */,\n\t\t\t\t5A92A71D20CEECB9002C1111 /* AppDelegate.swift in Sources */,\n\t\t\t\t5A92A73320CEF604002C1111 /* EyeLasers.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXVariantGroup section */\n\t\t5A92A72220CEECB9002C1111 /* Main.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t5A92A72320CEECB9002C1111 /* Base */,\n\t\t\t);\n\t\t\tname = Main.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t5A92A72720CEECBB002C1111 /* LaunchScreen.storyboard */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t5A92A72820CEECBB002C1111 /* Base */,\n\t\t\t);\n\t\t\tname = LaunchScreen.storyboard;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t5A92A72B20CEECBB002C1111 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++14\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu11;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t5A92A72C20CEECBB002C1111 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++14\";\n\t\t\t\tCLANG_CXX_LIBRARY = \"libc++\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCODE_SIGN_IDENTITY = \"iPhone Developer\";\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu11;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tIPHONEOS_DEPLOYMENT_TARGET = 12.0;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tSDKROOT = iphoneos;\n\t\t\t\tSWIFT_COMPILATION_MODE = wholemodule;\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-O\";\n\t\t\t\tVALIDATE_PRODUCT = YES;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t5A92A72E20CEECBB002C1111 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tDEVELOPMENT_TEAM = NLASH8BTJ5;\n\t\t\t\tINFOPLIST_FILE = HeatMap/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = AZ.HeatMap;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_VERSION = 4.2;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t5A92A72F20CEECBB002C1111 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tCODE_SIGN_STYLE = Automatic;\n\t\t\t\tDEVELOPMENT_TEAM = NLASH8BTJ5;\n\t\t\t\tINFOPLIST_FILE = HeatMap/Info.plist;\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/Frameworks\",\n\t\t\t\t);\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = AZ.HeatMap;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tSWIFT_VERSION = 4.2;\n\t\t\t\tTARGETED_DEVICE_FAMILY = \"1,2\";\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t5A92A71420CEECB9002C1111 /* Build configuration list for PBXProject \"HeatMap\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t5A92A72B20CEECBB002C1111 /* Debug */,\n\t\t\t\t5A92A72C20CEECBB002C1111 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t5A92A72D20CEECBB002C1111 /* Build configuration list for PBXNativeTarget \"HeatMap\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t5A92A72E20CEECBB002C1111 /* Debug */,\n\t\t\t\t5A92A72F20CEECBB002C1111 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\t};\n\trootObject = 5A92A71120CEECB9002C1111 /* Project object */;\n}\n"
  },
  {
    "path": "HeatMap.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:HeatMap.xcodeproj\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "HeatMap.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IDEDidComputeMac32BitWarning</key>\n\t<true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "HeatMap.xcodeproj/xcuserdata/andrewzimmer.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Bucket\n   type = \"1\"\n   version = \"2.0\">\n   <Breakpoints>\n      <BreakpointProxy\n         BreakpointExtensionID = \"Xcode.Breakpoint.FileBreakpoint\">\n         <BreakpointContent\n            shouldBeEnabled = \"No\"\n            ignoreCount = \"0\"\n            continueAfterRunningActions = \"No\"\n            filePath = \"HeatMap/ViewController.swift\"\n            timestampString = \"551227566.357581\"\n            startingColumnNumber = \"9223372036854775807\"\n            endingColumnNumber = \"9223372036854775807\"\n            startingLineNumber = \"139\"\n            endingLineNumber = \"139\"\n            landmarkName = \"renderer(_:didUpdate:for:)\"\n            landmarkType = \"7\">\n         </BreakpointContent>\n      </BreakpointProxy>\n      <BreakpointProxy\n         BreakpointExtensionID = \"Xcode.Breakpoint.FileBreakpoint\">\n         <BreakpointContent\n            shouldBeEnabled = \"No\"\n            ignoreCount = \"0\"\n            continueAfterRunningActions = \"No\"\n            filePath = \"HeatMap/ViewController.swift\"\n            timestampString = \"551227566.358811\"\n            startingColumnNumber = \"9223372036854775807\"\n            endingColumnNumber = \"9223372036854775807\"\n            startingLineNumber = \"147\"\n            endingLineNumber = \"147\"\n            landmarkName = \"renderer(_:updateAtTime:)\"\n            landmarkType = \"7\">\n         </BreakpointContent>\n      </BreakpointProxy>\n      <BreakpointProxy\n         BreakpointExtensionID = \"Xcode.Breakpoint.FileBreakpoint\">\n         <BreakpointContent\n            shouldBeEnabled = \"No\"\n            ignoreCount = \"0\"\n            continueAfterRunningActions = \"No\"\n            filePath = \"HeatMap/ViewController.swift\"\n            timestampString = \"551227566.359816\"\n            startingColumnNumber = \"9223372036854775807\"\n            endingColumnNumber = \"9223372036854775807\"\n            startingLineNumber = \"138\"\n            endingLineNumber = \"138\"\n            landmarkName = \"renderer(_:didUpdate:for:)\"\n            landmarkType = \"7\">\n         </BreakpointContent>\n      </BreakpointProxy>\n      <BreakpointProxy\n         BreakpointExtensionID = \"Xcode.Breakpoint.FileBreakpoint\">\n         <BreakpointContent\n            shouldBeEnabled = \"No\"\n            ignoreCount = \"0\"\n            continueAfterRunningActions = \"No\"\n            filePath = \"HeatMap/ViewController.swift\"\n            timestampString = \"551227566.360821\"\n            startingColumnNumber = \"9223372036854775807\"\n            endingColumnNumber = \"9223372036854775807\"\n            startingLineNumber = \"157\"\n            endingLineNumber = \"157\"\n            landmarkName = \"renderer(_:updateAtTime:)\"\n            landmarkType = \"7\">\n         </BreakpointContent>\n      </BreakpointProxy>\n      <BreakpointProxy\n         BreakpointExtensionID = \"Xcode.Breakpoint.FileBreakpoint\">\n         <BreakpointContent\n            shouldBeEnabled = \"No\"\n            ignoreCount = \"0\"\n            continueAfterRunningActions = \"No\"\n            filePath = \"HeatMap/ViewController.swift\"\n            timestampString = \"551227566.361791\"\n            startingColumnNumber = \"9223372036854775807\"\n            endingColumnNumber = \"9223372036854775807\"\n            startingLineNumber = \"154\"\n            endingLineNumber = \"154\"\n            landmarkName = \"renderer(_:updateAtTime:)\"\n            landmarkType = \"7\">\n         </BreakpointContent>\n      </BreakpointProxy>\n      <BreakpointProxy\n         BreakpointExtensionID = \"Xcode.Breakpoint.FileBreakpoint\">\n         <BreakpointContent\n            shouldBeEnabled = \"No\"\n            ignoreCount = \"0\"\n            continueAfterRunningActions = \"No\"\n            filePath = \"HeatMap/ViewController.swift\"\n            timestampString = \"551227566.362821\"\n            startingColumnNumber = \"9223372036854775807\"\n            endingColumnNumber = \"9223372036854775807\"\n            startingLineNumber = \"149\"\n            endingLineNumber = \"149\"\n            landmarkName = \"renderer(_:updateAtTime:)\"\n            landmarkType = \"7\">\n         </BreakpointContent>\n      </BreakpointProxy>\n      <BreakpointProxy\n         BreakpointExtensionID = \"Xcode.Breakpoint.FileBreakpoint\">\n         <BreakpointContent\n            shouldBeEnabled = \"No\"\n            ignoreCount = \"0\"\n            continueAfterRunningActions = \"No\"\n            filePath = \"HeatMap/ViewController.swift\"\n            timestampString = \"551227566.363716\"\n            startingColumnNumber = \"9223372036854775807\"\n            endingColumnNumber = \"9223372036854775807\"\n            startingLineNumber = \"231\"\n            endingLineNumber = \"231\"\n            landmarkName = \"metalTextureFromArray(_:width:height:)\"\n            landmarkType = \"7\">\n         </BreakpointContent>\n      </BreakpointProxy>\n      <BreakpointProxy\n         BreakpointExtensionID = \"Xcode.Breakpoint.FileBreakpoint\">\n         <BreakpointContent\n            shouldBeEnabled = \"No\"\n            ignoreCount = \"0\"\n            continueAfterRunningActions = \"No\"\n            filePath = \"HeatMap/ViewController.swift\"\n            timestampString = \"551227674.978737\"\n            startingColumnNumber = \"9223372036854775807\"\n            endingColumnNumber = \"9223372036854775807\"\n            startingLineNumber = \"14\"\n            endingLineNumber = \"14\"\n            landmarkName = \"ViewController\"\n            landmarkType = \"3\">\n         </BreakpointContent>\n      </BreakpointProxy>\n   </Breakpoints>\n</Bucket>\n"
  },
  {
    "path": "HeatMap.xcodeproj/xcuserdata/andrewzimmer.xcuserdatad/xcschemes/xcschememanagement.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>SchemeUserState</key>\n\t<dict>\n\t\t<key>HeatMap.xcscheme</key>\n\t\t<dict>\n\t\t\t<key>orderHint</key>\n\t\t\t<integer>0</integer>\n\t\t</dict>\n\t</dict>\n</dict>\n</plist>\n"
  },
  {
    "path": "README.md",
    "content": "# HeatMapEyeTracking\nA quick test with ARKit 2 implementing a heatmap for eye tracking\n"
  }
]