Skip to content

Commit

Permalink
Merge branch 'master' into ellipsoidPrecision
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGES.md
  • Loading branch information
bagnell committed Aug 27, 2013
2 parents 9f1265b + 7af95f4 commit 7b47568
Show file tree
Hide file tree
Showing 15 changed files with 376 additions and 188 deletions.
43 changes: 6 additions & 37 deletions Apps/Sandcastle/gallery/Camera.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,12 @@

var ellipsoid = Cesium.Ellipsoid.WGS84;

function disableInput(scene) {
var controller = scene.getScreenSpaceCameraController();
controller.enableTranslate = false;
controller.enableZoom = false;
controller.enableRotate = false;
controller.enableTilt = false;
controller.enableLook = false;
}

function enableInput(scene) {
var controller = scene.getScreenSpaceCameraController();
controller.enableTranslate = true;
controller.enableZoom = true;
controller.enableRotate = true;
controller.enableTilt = true;
controller.enableLook = true;
}

function flyToSanDiego(scene) {
Sandcastle.declare(flyToSanDiego); // For highlighting in Sandcastle.
var destination = Cesium.Cartographic.fromDegrees(-117.16, 32.71, 15000.0);

disableInput(scene);
var flight = Cesium.CameraFlightPath.createAnimationCartographic(scene.getFrameState(), {
destination : destination,
onComplete : function() {
enableInput(scene);
}
var flight = Cesium.CameraFlightPath.createAnimationCartographic(scene, {
destination : destination
});
scene.getAnimations().add(flight);
}
Expand All @@ -66,12 +44,8 @@
var destination = Cesium.Cartographic.fromDegrees(position.coords.longitude, position.coords.latitude, 1000.0);
destination = ellipsoid.cartographicToCartesian(destination);

disableInput(scene);
var flight = Cesium.CameraFlightPath.createAnimation(scene.getFrameState(), {
destination : destination,
onComplete : function() {
enableInput(scene);
}
var flight = Cesium.CameraFlightPath.createAnimation(scene, {
destination : destination
});
scene.getAnimations().add(flight);
}
Expand Down Expand Up @@ -113,12 +87,8 @@

var extent = new Cesium.Extent(west, south, east, north);

disableInput(scene);
var flight = Cesium.CameraFlightPath.createAnimationExtent(scene.getFrameState(), {
destination : extent,
onComplete : function() {
enableInput(scene);
}
var flight = Cesium.CameraFlightPath.createAnimationExtent(scene, {
destination : extent
});
scene.getAnimations().add(flight);

Expand Down Expand Up @@ -195,7 +165,6 @@
function reset(scene) {
scene.getPrimitives().removeAll();
scene.getAnimations().removeAll();
enableInput(scene);

var camera = scene.getCamera();
if (camera.transform.equals(Cesium.Matrix4.IDENTITY)) {
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Beta Releases
_This releases fixes 2D and other issues with Chrome 29.0.1547.57 ([#1002](https://github.com/AnalyticalGraphicsInc/cesium/issues/1002) and [#1047](https://github.com/AnalyticalGraphicsInc/cesium/issues/1047))._

* Breaking changes:
* The `CameraFlightPath` functions `createAnimation`, `createAnimationCartographic`, and `createAnimationExtent` now take the scene as their first parameter instead of the frame state.
* Replaced `ExtentGeometry` parameters for extruded extent to make them consistent with other geometries.
* `options.extrudedOptions.height` -> `options.extrudedHeight`
* `options.extrudedOptions.closeTop` -> `options.closeBottom`
Expand Down Expand Up @@ -43,6 +44,7 @@ var geometry = BoxGeometry.createGeometry(box);
* Added the ability to specify a `minimumTerrainLevel` and `maximumTerrainLevel` when constructing an `ImageryLayer`. The layer will only be shown for terrain tiles within the specified range.
* Added `Math.setRandomNumberSeed` and `Math.nextRandomNumber` for generating repeatable random numbers.
* Added `Color.fromRandom` to generate random and partially random colors.
* Added `Scene.debugShowFrustums` and `Scene.debugFrustumStatistics` for rendering debugging.
* Improved geometry batching performance by moving work to a web worker.
* Improved `WallGeometry` to follow the curvature of the earth.
* Fixed broken surface rendering in Columbus View when using the `EllipsoidTerrainProvider`.
Expand All @@ -51,6 +53,8 @@ var geometry = BoxGeometry.createGeometry(box);
* Upgraded Knockout from version 2.2.1 to 2.3.0.
* Fixed triangulation for polygons that cross the international date line.
* Fixed `EllipsoidPrimitive` rendering for some oblate ellipsoids. [#1067](https://github.com/AnalyticalGraphicsInc/cesium/pull/1067).
* `CameraFlightPath` now automatically disables and restores mouse input for the flights it generates.
* Added an `onCancel` callback to `CameraFlightPath` functions that will be executed if the flight is canceled.

### b19 - 2013-08-01

Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Chris Cooper](https://github.com/chris-cooper)
* [EU Edge](http://euedge.com/)
* [Ákos Maróy](https://github.com/akosmaroy)
* [Evax Software](http://www.evax.fr)
* [Evax Software](https://github.com/evax)

## [Individual CLA](http://www.agi.com/licenses/individual-cla-agi-v1.0.txt)
* [Victor Berchet](https://github.com/vicb)
Expand Down
2 changes: 1 addition & 1 deletion Source/Renderer/Context.js
Original file line number Diff line number Diff line change
Expand Up @@ -2101,7 +2101,7 @@ define([

var offset = command.offset;
var count = command.count;
var hasIndexBuffer = (defined(indexBuffer));
var hasIndexBuffer = defined(indexBuffer);

if (hasIndexBuffer) {
offset = (offset || 0) * indexBuffer.getBytesPerIndex(); // in bytes
Expand Down
7 changes: 7 additions & 0 deletions Source/Renderer/DrawCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ define(function() {
* @see DrawCommand#boundingVolume
*/
this.debugShowBoundingVolume = false;

/**
* @private
*
* Used to implement {@see Scene.debugShowFrustums}.
*/
this.debugOverlappingFrustums = 0;
};

/**
Expand Down
26 changes: 24 additions & 2 deletions Source/Renderer/ShaderProgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ define([
czm_columbusViewMorph,
czm_computePosition,
czm_eastNorthUpToEyeCoordinates,
czm_czm_ellipsoidContainsPoint,
czm_ellipsoidContainsPoint,
czm_ellipsoidNew,
czm_ellipsoidWgs84TextureCoordinates,
czm_equalsEpsilon,
Expand Down Expand Up @@ -2280,6 +2280,28 @@ define([
this._samplerUniforms = uniforms.samplerUniforms;
this._automaticUniforms = partitionedUniforms.automaticUniforms;
this._manualUniforms = partitionedUniforms.manualUniforms;

/**
* GLSL source for the shader program's vertex shader. This is the version of
* the source provided when the shader program was created, not the final
* source provided to WebGL, which includes Cesium bulit-ins.
*
* @type {String}
*
* @readonly
*/
this.vertexShaderSource = vertexShaderSource;

/**
* GLSL source for the shader program's fragment shader. This is the version of
* the source provided when the shader program was created, not the final
* source provided to WebGL, which includes Cesium bulit-ins.
*
* @type {String}
*
* @readonly
*/
this.fragmentShaderSource = fragmentShaderSource;
};

function extractShaderVersion(source) {
Expand Down Expand Up @@ -2321,7 +2343,7 @@ define([
czm_columbusViewMorph : czm_columbusViewMorph,
czm_computePosition : czm_computePosition,
czm_eastNorthUpToEyeCoordinates : czm_eastNorthUpToEyeCoordinates,
czm_czm_ellipsoidContainsPoint : czm_czm_ellipsoidContainsPoint,
czm_ellipsoidContainsPoint : czm_ellipsoidContainsPoint,
czm_ellipsoidNew : czm_ellipsoidNew,
czm_ellipsoidWgs84TextureCoordinates : czm_ellipsoidWgs84TextureCoordinates,
czm_equalsEpsilon : czm_equalsEpsilon,
Expand Down
14 changes: 13 additions & 1 deletion Source/Scene/AnimationCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ define([

var value = clone(options.startValue);
var tween = new Tween.Tween(value);
// set the callback on the instance to avoid extra bookkeeping
// or patching Tween.js
tween.onCancel = options.onCancel;
tween.to(options.stopValue, options.duration);
tween.delay(delayDuration);
tween.easing(easingFunction);
Expand Down Expand Up @@ -233,6 +236,15 @@ define([
* @memberof AnimationCollection
*/
AnimationCollection.prototype.removeAll = function() {
var tweens = Tween.getAll();
var n = tweens.length;
var i = -1;
while (++i < n) {
var t = tweens[i];
if (typeof t.onCancel === 'function') {
t.onCancel();
}
}
Tween.removeAll();
};

Expand All @@ -256,4 +268,4 @@ define([
};

return AnimationCollection;
});
});
Loading

0 comments on commit 7b47568

Please sign in to comment.