             }
         }
         _setTransform(currentTransform)
+    }
+    
+    private func directionUpToHeadingPitchRoll(position: Cartesian3, orientation: Orientation) -> Orientation {
+        
+        var direction: Cartesian3
+        var up: Cartesian3
+        if case let Orientation.directionUp(directionIn, upIn) = orientation {
+            direction = directionIn
+            up = upIn
+        } else {
+            return orientation
+        }
+        
+        if _mode == .Scene3D {
+            let transform = Transforms.eastNorthUpToFixedFrame(position, ellipsoid: _projection.ellipsoid)
+            let invTransform = transform.inverse
+            
+            direction = invTransform.multiplyByPointAsVector(direction)
+            up = invTransform.multiplyByPointAsVector(up)
+        }
+        
+        let right = direction.cross(up)
+        
+        return Orientation.headingPitchRoll(
+            heading: getHeading(direction: direction, up: up),
+            pitch: getPitch(direction: direction),
+            roll: getRoll(direction: direction, up: up, right: right)
+        )
     }
     
     /**

    public func look (axis axis: Cartesian3, angle: Double? = nil) {
        
        let turnAngle = angle ?? defaultLookAmount
        let quaternion = Quaternion(fromAxis: axis, angle: -turnAngle)
        let rotation = Matrix3(fromQuaternion: quaternion)
        
        direction = rotation.multiplyByVector(direction)
        up = rotation.multiplyByVector(up)

        
        let upChanged = _up != up
        if upChanged {
            up = up.normalize()
            _up = up
        }
        
