     /// The pan gesture used for navigation.
     var panGestureRecognizer: UIPanGestureRecognizer!
     
-    /// The camera node's euler angles when a pan gesture begins. These are reset to nil when a pan gesture ends.
-    var initialEulerAngles: SCNVector3?
-    
-    /// The camera node's euler angles as adjusted by a pan gesture. They will be applied at the next renderer:updateAtTime: call. These are reset to nil when a pan gesture ends.
-    var currentEulerAngles: SCNVector3?
-
+    // TODO: Add doc
+    var previousPanTranslation: CGPoint?
+    
     /// The motion manager used to adjust camera position based on device motion.
     let motionManager = CMMotionManager()
     

            switch strongSelf.navigationMode
            {
            case .PanGesture:
                if let currentEulerAngles = strongSelf.currentEulerAngles // This is nil when there is no active gesture.
                {
                    strongSelf.cameraNode.eulerAngles = currentEulerAngles
                }
                
            case .DeviceMotion:
                guard strongSelf.motionManager.deviceMotionAvailable == true else

        switch recognizer.state
        {
        case .Began:
            self.previousPanTranslation = .zero
            
            let glkOrientation = GLKQuaternionMake(self.cameraNode.orientation.x, self.cameraNode.orientation.y, self.cameraNode.orientation.z, self.cameraNode.orientation.w)
            let orientation = NSStringFromGLKQuaternion(glkOrientation)
            print("Begin orientation: \(orientation)")
            
            let glkAngles = GLKVector3Make(self.cameraNode.eulerAngles.x, self.cameraNode.eulerAngles.y, self.cameraNode.eulerAngles.z)
            let angles = NSStringFromGLKVector3(glkAngles)
            print("Begin angles: \(angles)")
            
        case .Changed:
            guard let previous = self.previousPanTranslation else
            {
                assertionFailure("Attempt to unwrap previous pan translation failed.")
                
                return
            }

            let translation = recognizer.translationInView(recognizer.view)
            let translationDelta = CGPoint(x: translation.x - previous.x, y: translation.y - previous.y)
            
            // Use the pan translation along the x axis to adjust the camera's rotation about the y axis.
            let yScalar = Float(translationDelta.x / self.view.bounds.size.width)
            let yRadians = yScalar * self.dynamicType.MaxPanGestureRotation
            
            // Use the pan translation along the y axis to adjust the camera's rotation about the x axis.
            let xScalar = Float(translationDelta.y / self.view.bounds.size.height)
            let xRadians = xScalar * self.dynamicType.MaxPanGestureRotation
            
            let x = GLKQuaternionMakeWithAngleAndAxis(xRadians, 1, 0, 0)
            let y = GLKQuaternionMakeWithAngleAndAxis(yRadians, 0, 1, 0)
            let z = GLKQuaternionMakeWithAngleAndAxis(0, 0, 0, 1) // TODO: ???
            let q = GLKQuaternionMultiply(z, GLKQuaternionMultiply(y, x))

            self.cameraNode.orientation = SCNQuaternion(x: q.x, y: q.y, z: q.z, w: q.w)
            
        case .Ended, .Cancelled, .Failed:
            self.previousPanTranslation = nil
            
            let glkOrientation = GLKQuaternionMake(self.cameraNode.orientation.x, self.cameraNode.orientation.y, self.cameraNode.orientation.z, self.cameraNode.orientation.w)
            let orientation = NSStringFromGLKQuaternion(glkOrientation)
            print("End orientation: \(orientation)")
            
            let glkAngles = GLKVector3Make(self.cameraNode.eulerAngles.x, self.cameraNode.eulerAngles.y, self.cameraNode.eulerAngles.z)
            let angles = NSStringFromGLKVector3(glkAngles)
            print("End angles: \(angles)")

        case .Possible:
            break
        }
