Created
August 7, 2014 07:04
-
-
Save klokan/99a3be6a193a71ac4157 to your computer and use it in GitHub Desktop.
Removed the incomplete roll support and related Cesium interaction used to create roll (ol3-cesium@f2b68b0ol3)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/examples/exports.html b/examples/exports.html | |
index 04e46f1..18b565a 100644 | |
--- a/examples/exports.html | |
+++ b/examples/exports.html | |
@@ -35,7 +35,6 @@ | |
'Distance: ' + camera.getDistance() + '<br />' + | |
'Heading: ' + camera.getHeading() + '<br />' + | |
'Tilt: ' + camera.getTilt() + '<br />' + | |
- //'Roll: ' + camera.getRoll() + '<br />' + | |
'<i>Position:</i> ' + camera.getPosition() + '<br />' + | |
'<i>Altitude:</i> ' + camera.getAltitude() + '<br />'; | |
}; | |
@@ -65,7 +64,6 @@ | |
<br /> | |
<input type="button" value="setHeading(Math.PI / 6)" onclick="javascript:camera.setHeading(Math.PI / 6)" /> | |
<input type="button" value="setTilt(Math.PI / 8)" onclick="javascript:camera.setTilt(Math.PI / 8)" /> | |
- <!-- <input type="button" value="setRoll(Math.PI / 2)" onclick="javascript:camera.setRoll(Math.PI / 2)" /> --> | |
<input type="button" value="setDistance(10 000 000)" onclick="javascript:camera.setDistance(10000000)" /> | |
<input type="button" value="setAltitude(10 000 000)" onclick="javascript:camera.setAltitude(10000000)" /> | |
<br /> | |
diff --git a/src/camera.js b/src/camera.js | |
index af15564..5df00fe 100644 | |
--- a/src/camera.js | |
+++ b/src/camera.js | |
@@ -63,12 +63,6 @@ olcs.Camera = function(scene, view) { | |
* @type {number} | |
* @private | |
*/ | |
- this.roll_ = 0; | |
- | |
- /** | |
- * @type {number} | |
- * @private | |
- */ | |
this.distance_ = 0; | |
/** | |
@@ -126,23 +120,6 @@ olcs.Camera.prototype.getTilt = function() { | |
/** | |
- * @param {number} roll In radians. | |
- */ | |
-olcs.Camera.prototype.setRoll = function(roll) { | |
- this.roll_ = roll; | |
- this.updateCamera(); | |
-}; | |
- | |
- | |
-/** | |
- * @return {number} Roll in radians. | |
- */ | |
-olcs.Camera.prototype.getRoll = function() { | |
- return this.roll_; | |
-}; | |
- | |
- | |
-/** | |
* @param {number} distance In meters. | |
*/ | |
olcs.Camera.prototype.setDistance = function(distance) { | |
@@ -266,7 +243,6 @@ olcs.Camera.prototype.updateCamera = function() { | |
this.cam_.twistLeft(this.view_.getRotation() || 0); | |
if (this.tilt_) this.cam_.lookUp(this.tilt_); | |
- if (this.roll_) this.cam_.twistLeft(this.roll_); | |
this.cam_.moveBackward(this.distance_); | |
this.checkCameraChange(true); | |
@@ -321,7 +297,7 @@ olcs.Camera.prototype.updateView = function() { | |
/* | |
- * Since we are positioning the target, the values of heading, tilt and roll | |
+ * Since we are positioning the target, the values of heading and tilt | |
* need to be calculated _at the target_. | |
*/ | |
if (target) { | |
@@ -348,9 +324,6 @@ olcs.Camera.prototype.updateView = function() { | |
// TILT | |
this.tilt_ = Math.acos(Cesium.Cartesian3.dot(targetNormal, | |
targetToCamera)) || 0; | |
- | |
- // TODO: ROLL | |
- this.roll_ = 0; | |
} else { | |
// fallback when there is no target | |
this.view_.setRotation(this.cam_.heading); | |
@@ -439,10 +412,6 @@ goog.exportSymbol('olcs.Camera.prototype.getTilt', | |
olcs.Camera.prototype.getTilt); | |
goog.exportSymbol('olcs.Camera.prototype.setTilt', | |
olcs.Camera.prototype.setTilt); | |
-goog.exportSymbol('olcs.Camera.prototype.getRoll', | |
- olcs.Camera.prototype.getRoll); | |
-goog.exportSymbol('olcs.Camera.prototype.setRoll', | |
- olcs.Camera.prototype.setRoll); | |
goog.exportSymbol('olcs.Camera.prototype.getDistance', | |
olcs.Camera.prototype.getDistance); | |
goog.exportSymbol('olcs.Camera.prototype.setDistance', | |
diff --git a/src/ol3cesium.js b/src/ol3cesium.js | |
index 67857b6..3cf7142 100644 | |
--- a/src/ol3cesium.js | |
+++ b/src/ol3cesium.js | |
@@ -82,10 +82,7 @@ olcs.OLCesium = function(map, opt_target) { | |
'modifier': Cesium.KeyboardEventModifier.SHIFT | |
}); | |
- sscc.lookEventTypes = { | |
- 'eventType': Cesium.CameraEventType.LEFT_DRAG, | |
- 'modifier': Cesium.KeyboardEventModifier.ALT | |
- }; | |
+ sscc.enableLook = false; | |
this.scene_.camera.constrainedAxis = Cesium.Cartesian3.UNIT_Z; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment