             _setTransform(endTransform)
         }
         
-        var convert = convert
+        var convert = true
         var destination = destination ?? .cartesian(positionWC)
         
         if case let Destination.rectangle(rectangle) = destination {
-            destination = getRectangleCameraCoordinates(destination)
+            destination = Destination.cartesian(getRectangleCameraCoordinates(rectangle))
             convert = false
         }
-        
-        
-        if (defined(orientation.direction)) {
-            orientation = directionUpToHeadingPitchRoll(this, destination, orientation, scratchSetViewOptions.orientation);
-        }
-        
-        var heading = defaultValue(orientation.heading, 0.0);
-        var pitch = defaultValue(orientation.pitch, -CesiumMath.PI_OVER_TWO);
-        var roll = defaultValue(orientation.roll, 0.0);
-        
-        let projection = _projection
-        let ellipsoid = _projection.ellipsoid
-        
+        var orientation = orientation
+        if orientation != nil {
+            if case Orientation.directionUp(direction: _, up: _) = orientation! {
+                orientation = directionUpToHeadingPitchRoll(destination.cartesian!, orientation: orientation!)
+            }
+        }
+        
+        var heading = 0.0
+        var pitch = -M_PI_2
+        var roll = 0.0
+        
+        if let orientation = orientation {
+            if case let Orientation.headingPitchRoll(headingIn, pitchIn, rollIn) = orientation {
+                heading = headingIn
+                pitch = pitchIn
+                roll = rollIn
+            }
+        }
+
         if _mode == .Scene3D {
-            setView3D(position: cartesianIn, positionCartographic: cartographicIn, heading: heading, pitch: pitch, roll: roll)
+            setView3D(destination.cartesian!, heading: heading, pitch: pitch, roll: roll)
         } else if _mode == SceneMode.Scene2D {
-            setView2D(position: cartesianIn, positionCartographic: cartographicIn, heading: heading, pitch: pitch, roll: roll, ellipsoid: ellipsoid, projection: projection)
+            setView2D(destination.cartesian!, convert: convert)
         } else {
-            setViewCV(position: cartesianIn, positionCartographic: cartographicIn, heading: heading, pitch: pitch, roll: roll, ellipsoid: ellipsoid, projection: projection)
+            setViewCV(destination.cartesian!, heading: heading, pitch: pitch, roll: roll, convert: convert)
         }
     }
     

    Cartesian3.clone(Cartesian3.UNIT_X, camera.right);
    Cartesian3.clone(Cartesian3.UNIT_Y, camera.up);
    }
    */
    return result;
    }
    /**
    * Get the camera position needed to view an rectangle on an ellipsoid or map
    *

        }
    }
    
    func _setTransform (transform: Matrix4) {
        let position = positionWC
        let up = upWC
        let direction = directionWC
