Skip to content

Commit

Permalink
Removed the incomplete roll support and related Cesium interaction us…
Browse files Browse the repository at this point in the history
…ed to create roll
  • Loading branch information
petrsloup committed Aug 6, 2014
1 parent 883e877 commit f2b68b0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 38 deletions.
2 changes: 0 additions & 2 deletions examples/exports.html
Expand Up @@ -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 />';
};
Expand Down Expand Up @@ -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 />
Expand Down
33 changes: 1 addition & 32 deletions src/camera.js
Expand Up @@ -59,12 +59,6 @@ olcs.Camera = function(scene, view) {
*/
this.tilt_ = 0;

/**
* @type {number}
* @private
*/
this.roll_ = 0;

/**
* @type {number}
* @private
Expand Down Expand Up @@ -125,23 +119,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.
*/
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand Down Expand Up @@ -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',
Expand Down
5 changes: 1 addition & 4 deletions src/ol3cesium.js
Expand Up @@ -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;

Expand Down

0 comments on commit f2b68b0

Please sign in to comment.