Skip to content

Commit 7b47568

Browse files
committed
Merge branch 'master' into ellipsoidPrecision
Conflicts: CHANGES.md
2 parents 9f1265b + 7af95f4 commit 7b47568

15 files changed

+376
-188
lines changed

Apps/Sandcastle/gallery/Camera.html

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,12 @@
2828

2929
var ellipsoid = Cesium.Ellipsoid.WGS84;
3030

31-
function disableInput(scene) {
32-
var controller = scene.getScreenSpaceCameraController();
33-
controller.enableTranslate = false;
34-
controller.enableZoom = false;
35-
controller.enableRotate = false;
36-
controller.enableTilt = false;
37-
controller.enableLook = false;
38-
}
39-
40-
function enableInput(scene) {
41-
var controller = scene.getScreenSpaceCameraController();
42-
controller.enableTranslate = true;
43-
controller.enableZoom = true;
44-
controller.enableRotate = true;
45-
controller.enableTilt = true;
46-
controller.enableLook = true;
47-
}
48-
4931
function flyToSanDiego(scene) {
5032
Sandcastle.declare(flyToSanDiego); // For highlighting in Sandcastle.
5133
var destination = Cesium.Cartographic.fromDegrees(-117.16, 32.71, 15000.0);
5234

53-
disableInput(scene);
54-
var flight = Cesium.CameraFlightPath.createAnimationCartographic(scene.getFrameState(), {
55-
destination : destination,
56-
onComplete : function() {
57-
enableInput(scene);
58-
}
35+
var flight = Cesium.CameraFlightPath.createAnimationCartographic(scene, {
36+
destination : destination
5937
});
6038
scene.getAnimations().add(flight);
6139
}
@@ -66,12 +44,8 @@
6644
var destination = Cesium.Cartographic.fromDegrees(position.coords.longitude, position.coords.latitude, 1000.0);
6745
destination = ellipsoid.cartographicToCartesian(destination);
6846

69-
disableInput(scene);
70-
var flight = Cesium.CameraFlightPath.createAnimation(scene.getFrameState(), {
71-
destination : destination,
72-
onComplete : function() {
73-
enableInput(scene);
74-
}
47+
var flight = Cesium.CameraFlightPath.createAnimation(scene, {
48+
destination : destination
7549
});
7650
scene.getAnimations().add(flight);
7751
}
@@ -113,12 +87,8 @@
11387

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

116-
disableInput(scene);
117-
var flight = Cesium.CameraFlightPath.createAnimationExtent(scene.getFrameState(), {
118-
destination : extent,
119-
onComplete : function() {
120-
enableInput(scene);
121-
}
90+
var flight = Cesium.CameraFlightPath.createAnimationExtent(scene, {
91+
destination : extent
12292
});
12393
scene.getAnimations().add(flight);
12494

@@ -195,7 +165,6 @@
195165
function reset(scene) {
196166
scene.getPrimitives().removeAll();
197167
scene.getAnimations().removeAll();
198-
enableInput(scene);
199168

200169
var camera = scene.getCamera();
201170
if (camera.transform.equals(Cesium.Matrix4.IDENTITY)) {

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Beta Releases
99
_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))._
1010

1111
* Breaking changes:
12+
* The `CameraFlightPath` functions `createAnimation`, `createAnimationCartographic`, and `createAnimationExtent` now take the scene as their first parameter instead of the frame state.
1213
* Replaced `ExtentGeometry` parameters for extruded extent to make them consistent with other geometries.
1314
* `options.extrudedOptions.height` -> `options.extrudedHeight`
1415
* `options.extrudedOptions.closeTop` -> `options.closeBottom`
@@ -43,6 +44,7 @@ var geometry = BoxGeometry.createGeometry(box);
4344
* 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.
4445
* Added `Math.setRandomNumberSeed` and `Math.nextRandomNumber` for generating repeatable random numbers.
4546
* Added `Color.fromRandom` to generate random and partially random colors.
47+
* Added `Scene.debugShowFrustums` and `Scene.debugFrustumStatistics` for rendering debugging.
4648
* Improved geometry batching performance by moving work to a web worker.
4749
* Improved `WallGeometry` to follow the curvature of the earth.
4850
* Fixed broken surface rendering in Columbus View when using the `EllipsoidTerrainProvider`.
@@ -51,6 +53,8 @@ var geometry = BoxGeometry.createGeometry(box);
5153
* Upgraded Knockout from version 2.2.1 to 2.3.0.
5254
* Fixed triangulation for polygons that cross the international date line.
5355
* Fixed `EllipsoidPrimitive` rendering for some oblate ellipsoids. [#1067](https://github.com/AnalyticalGraphicsInc/cesium/pull/1067).
56+
* `CameraFlightPath` now automatically disables and restores mouse input for the flights it generates.
57+
* Added an `onCancel` callback to `CameraFlightPath` functions that will be executed if the flight is canceled.
5458

5559
### b19 - 2013-08-01
5660

CONTRIBUTORS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
2222
* [Chris Cooper](https://github.com/chris-cooper)
2323
* [EU Edge](http://euedge.com/)
2424
* [Ákos Maróy](https://github.com/akosmaroy)
25+
* [Evax Software](http://www.evax.fr)
26+
* [Evax Software](https://github.com/evax)
2527

2628
## [Individual CLA](http://www.agi.com/licenses/individual-cla-agi-v1.0.txt)
2729
* [Victor Berchet](https://github.com/vicb)

Source/Renderer/Context.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,7 @@ define([
21012101

21022102
var offset = command.offset;
21032103
var count = command.count;
2104-
var hasIndexBuffer = (defined(indexBuffer));
2104+
var hasIndexBuffer = defined(indexBuffer);
21052105

21062106
if (hasIndexBuffer) {
21072107
offset = (offset || 0) * indexBuffer.getBytesPerIndex(); // in bytes

Source/Renderer/DrawCommand.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ define(function() {
163163
* @see DrawCommand#boundingVolume
164164
*/
165165
this.debugShowBoundingVolume = false;
166+
167+
/**
168+
* @private
169+
*
170+
* Used to implement {@see Scene.debugShowFrustums}.
171+
*/
172+
this.debugOverlappingFrustums = 0;
166173
};
167174

168175
/**

Source/Renderer/ShaderProgram.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ define([
6363
czm_columbusViewMorph,
6464
czm_computePosition,
6565
czm_eastNorthUpToEyeCoordinates,
66-
czm_czm_ellipsoidContainsPoint,
66+
czm_ellipsoidContainsPoint,
6767
czm_ellipsoidNew,
6868
czm_ellipsoidWgs84TextureCoordinates,
6969
czm_equalsEpsilon,
@@ -2280,6 +2280,28 @@ define([
22802280
this._samplerUniforms = uniforms.samplerUniforms;
22812281
this._automaticUniforms = partitionedUniforms.automaticUniforms;
22822282
this._manualUniforms = partitionedUniforms.manualUniforms;
2283+
2284+
/**
2285+
* GLSL source for the shader program's vertex shader. This is the version of
2286+
* the source provided when the shader program was created, not the final
2287+
* source provided to WebGL, which includes Cesium bulit-ins.
2288+
*
2289+
* @type {String}
2290+
*
2291+
* @readonly
2292+
*/
2293+
this.vertexShaderSource = vertexShaderSource;
2294+
2295+
/**
2296+
* GLSL source for the shader program's fragment shader. This is the version of
2297+
* the source provided when the shader program was created, not the final
2298+
* source provided to WebGL, which includes Cesium bulit-ins.
2299+
*
2300+
* @type {String}
2301+
*
2302+
* @readonly
2303+
*/
2304+
this.fragmentShaderSource = fragmentShaderSource;
22832305
};
22842306

22852307
function extractShaderVersion(source) {
@@ -2321,7 +2343,7 @@ define([
23212343
czm_columbusViewMorph : czm_columbusViewMorph,
23222344
czm_computePosition : czm_computePosition,
23232345
czm_eastNorthUpToEyeCoordinates : czm_eastNorthUpToEyeCoordinates,
2324-
czm_czm_ellipsoidContainsPoint : czm_czm_ellipsoidContainsPoint,
2346+
czm_ellipsoidContainsPoint : czm_ellipsoidContainsPoint,
23252347
czm_ellipsoidNew : czm_ellipsoidNew,
23262348
czm_ellipsoidWgs84TextureCoordinates : czm_ellipsoidWgs84TextureCoordinates,
23272349
czm_equalsEpsilon : czm_equalsEpsilon,

Source/Scene/AnimationCollection.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ define([
4343

4444
var value = clone(options.startValue);
4545
var tween = new Tween.Tween(value);
46+
// set the callback on the instance to avoid extra bookkeeping
47+
// or patching Tween.js
48+
tween.onCancel = options.onCancel;
4649
tween.to(options.stopValue, options.duration);
4750
tween.delay(delayDuration);
4851
tween.easing(easingFunction);
@@ -233,6 +236,15 @@ define([
233236
* @memberof AnimationCollection
234237
*/
235238
AnimationCollection.prototype.removeAll = function() {
239+
var tweens = Tween.getAll();
240+
var n = tweens.length;
241+
var i = -1;
242+
while (++i < n) {
243+
var t = tweens[i];
244+
if (typeof t.onCancel === 'function') {
245+
t.onCancel();
246+
}
247+
}
236248
Tween.removeAll();
237249
};
238250

@@ -256,4 +268,4 @@ define([
256268
};
257269

258270
return AnimationCollection;
259-
});
271+
});

0 commit comments

Comments
 (0)