Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Commit c695086

Browse files
committed
Merge tag '1.11' into terriajs
1.11 release Conflicts: Source/Scene/Model.js package.json
2 parents 0c8a232 + 5e76fa2 commit c695086

File tree

100 files changed

+3953
-1075
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+3953
-1075
lines changed

Apps/CesiumViewer/CesiumViewer.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,11 @@ define([
166166

167167
function saveCamera() {
168168
var position = camera.positionCartographic;
169-
endUserOptions.view = CesiumMath.toDegrees(position.longitude) + ',' + CesiumMath.toDegrees(position.latitude) + ',' + position.height + ',' + CesiumMath.toDegrees(camera.heading) + ',' + CesiumMath.toDegrees(camera.pitch) + ',' + CesiumMath.toDegrees(camera.roll);
169+
var hpr = '';
170+
if (defined(camera.heading)) {
171+
hpr = ',' + CesiumMath.toDegrees(camera.heading) + ',' + CesiumMath.toDegrees(camera.pitch) + ',' + CesiumMath.toDegrees(camera.roll);
172+
}
173+
endUserOptions.view = CesiumMath.toDegrees(position.longitude) + ',' + CesiumMath.toDegrees(position.latitude) + ',' + position.height + hpr;
170174
history.replaceState(undefined, '', '?' + objectToQuery(endUserOptions));
171175
}
172176

Apps/Sandcastle/gallery/ArcGIS MapServer.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// Add an ArcGIS MapServer imagery layer
3333
var imageryLayers = viewer.imageryLayers;
3434
imageryLayers.addImageryProvider(new Cesium.ArcGisMapServerImageryProvider({
35-
url : 'http://www.ga.gov.au/gis/rest/services/earth_science/GA_Surface_Geology_of_Australia_WM/MapServer'
35+
url : '//nationalmap.gov.au/proxy/http://www.ga.gov.au/gis/rest/services/earth_science/GA_Surface_Geology_of_Australia_WM/MapServer'
3636
}));
3737

3838
// Start off looking at Australia.

Apps/Sandcastle/gallery/Camera.html

+27
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,35 @@
189189
});
190190
}
191191

192+
function flyInACity() {
193+
Sandcastle.declare(flyInACity);
194+
195+
var camera = scene.camera;
196+
camera.flyTo({
197+
destination : Cesium.Cartesian3.fromDegrees(-73.98580932617188, 40.74843406689482, 363.34038727246224),
198+
complete : function() {
199+
setTimeout(function() {
200+
camera.flyTo({
201+
destination : Cesium.Cartesian3.fromDegrees(-73.98585975679403, 40.75759944127251, 186.50838555841779),
202+
orientation : {
203+
heading : Cesium.Math.toRadians(200.0),
204+
pitch : Cesium.Math.toRadians(-50.0)
205+
},
206+
easingFunction : Cesium.EasingFunction.LINEAR_NONE
207+
});
208+
}, 3000);
209+
}
210+
});
211+
}
212+
192213
Sandcastle.addToolbarMenu([{
193214
text : 'Camera Options'
215+
}, {
216+
text : 'Fly in a city',
217+
onselect : function() {
218+
flyInACity();
219+
Sandcastle.highlight(flyInACity);
220+
}
194221
}, {
195222
text : 'Fly to San Diego',
196223
onselect : function() {

Apps/Sandcastle/gallery/Interpolation.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
//Use STK World Terrain
4242
viewer.terrainProvider = new Cesium.CesiumTerrainProvider({
43-
url : '//cesiumjs.org/stk-terrain/world',
43+
url : '//assets.agi.com/stk-terrain/world',
4444
requestWaterMask : true,
4545
requestVertexNormals : true
4646
});

Apps/Sandcastle/gallery/Web Map Service (WMS).html

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// Add a WMS imagery layer
3333
var imageryLayers = viewer.imageryLayers;
3434
imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
35-
url : 'http://nationalmap.nicta.com.au/proxy/http://geoserver.nationalmap.nicta.com.au/geotopo_250k/ows',
35+
url : '//nationalmap.gov.au/proxy/http://geoserver.nationalmap.nicta.com.au/geotopo_250k/ows',
3636
layers : 'Hydrography:bores',
3737
parameters : {
3838
transparent : true,

CHANGES.md

+39-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,45 @@
11
Change Log
22
==========
33

4+
### 1.11 - 2015-07-01
5+
6+
* Breaking changes
7+
* Removed `Scene.fxaaOrderIndependentTranslucency`, which was deprecated in 1.10. Use `Scene.fxaa` which is now `true` by default.
8+
* Removed `Camera.clone`, which was deprecated in 1.10.
9+
* Deprecated
10+
* The STK World Terrain url `cesiumjs.org/stk-terrain/world` has been deprecated, use `assets.agi.com/stk-terrain/world` instead. A redirect will be in place until 1.14.
11+
* Deprecated `AxisAlignedBoundingBox.intersect` and `BoundingSphere.intersect`. These will be removed in 1.13. Use `AxisAlignedBoundingBox.intersectPlane` and `BoundingSphere.intersectPlane` instead.
12+
* Deprecated `ObjectOrientedBoundingBox`. It will be removed in 1.12. Use `OrientedBoundingBox` instead.
13+
* Improved camera flights. [#2825](https://github.com/AnalyticalGraphicsInc/cesium/pull/2825)
14+
* The camera now zooms to the point under the mouse cursor.
15+
* Added a new camera mode for horizon views. When the camera is looking at the horizon and a point on terrain above the camera is picked, the camera moves in the plane containing the camera position, up and right vectors.
16+
* Improved terrain and imagery performance and reduced tile loading by up to 50%, depending on the camera view, by using the new `OrientedBoundingBox` for view frustum culling. See [Terrain Culling with Oriented Bounding Boxes](http://cesiumjs.org/2015/06/24/Oriented-Bounding-Boxes/).
17+
* Added `UrlTemplateImageryProvider`. This new imagery provider allows access to a wide variety of imagery sources, including OpenStreetMap, TMS, WMTS, WMS, WMS-C, and various custom schemes, by specifying a URL template to use to request imagery tiles.
18+
* Fixed flash/streak rendering artifacts when picking. [#2790](https://github.com/AnalyticalGraphicsInc/cesium/issues/2790), [#2811](https://github.com/AnalyticalGraphicsInc/cesium/issues/2811)
19+
* Fixed 2D and Columbus view lighting issue. [#2635](https://github.com/AnalyticalGraphicsInc/cesium/issues/2635).
20+
* Fixed issues with material caching which resulted in the inability to use an image-based material multiple times. [#2821](https://github.com/AnalyticalGraphicsInc/cesium/issues/2821)
21+
* Improved `Camera.viewRectangle` so that the specified rectangle is now better centered on the screen. [#2764](https://github.com/AnalyticalGraphicsInc/cesium/issues/2764)
22+
* Fixed a crash when `viewer.zoomTo` or `viewer.flyTo` were called immediately before or during a scene morph. [#2775](https://github.com/AnalyticalGraphicsInc/cesium/issues/2775)
23+
* Fixed an issue where `Camera` functions would throw an exception if used from within a `Scene.morphComplete` callback. [#2776](https://github.com/AnalyticalGraphicsInc/cesium/issues/2776)
24+
* Fixed camera flights that ended up at the wrong position in Columbus view. [#802](https://github.com/AnalyticalGraphicsInc/cesium/issues/802)
25+
* Fixed camera flights through the map in 2D. [#804](https://github.com/AnalyticalGraphicsInc/cesium/issues/804)
26+
* Fixed strange camera flights from opposite sides of the globe. [#1158](https://github.com/AnalyticalGraphicsInc/cesium/issues/1158)
27+
* Fixed camera flights that wouldn't fly to the home view after zooming out past it. [#1400](https://github.com/AnalyticalGraphicsInc/cesium/issues/1400)
28+
* Fixed flying to rectangles that cross the IDL in Columbus view and 2D. [#2093](https://github.com/AnalyticalGraphicsInc/cesium/issues/2093)
29+
* Fixed flights with a pitch of -90 degrees. [#2468](https://github.com/AnalyticalGraphicsInc/cesium/issues/2468)
30+
* `Model` can now load Binary glTF from a `Uint8Array`.
31+
* Fixed a bug in `ImageryLayer` that could cause an exception and the render loop to stop when the base layer did not cover the entire globe.
32+
* The performance statistics displayed when `scene.debugShowFramesPerSecond === true` can now be styled using the `cesium-performanceDisplay` CSS classes in `shared.css` [#2779](https://github.com/AnalyticalGraphicsInc/cesium/issues/2779).
33+
* Added `Plane.fromCartesian4`.
34+
* Added `Plane.ORIGIN_XY_PLANE`/`ORIGIN_YZ_PLANE`/`ORIGIN_ZX_PLANE` constants for commonly-used planes.
35+
* Added `Matrix2`/`Matrix3`/`Matrix4.ZERO` constants.
36+
* Added `Matrix2`/`Matrix3.multiplyByScale` for multiplying against non-uniform scales.
37+
* Added `projectPointToNearestOnPlane` and `projectPointsToNearestOnPlane` to `EllipsoidTangentPlane` to project 3D points to the nearest 2D point on an `EllipsoidTangentPlane`.
38+
* Added `EllipsoidTangentPlane.plane` property to get the `Plane` for the tangent plane.
39+
* Added `EllipsoidTangentPlane.xAxis`/`yAxis`/`zAxis` properties to get the local coordinate system of the tangent plane.
40+
* Add `QuantizedMeshTerrainData` constructor argument `orientedBoundingBox`.
41+
* Add `TerrainMesh.orientedBoundingBox` which holds the `OrientedBoundingBox` for the mesh for a single terrain tile.
42+
443
### 1.10 - 2015-06-01
544

645
* Breaking changes
@@ -52,7 +91,6 @@ Change Log
5291
* Added debug option to `Scene` to show the depth buffer information for a specified view frustum slice and exposed capability in `CesiumInspector` widget.
5392
* Added new leap second for 30 June 2015 at UTC 23:59:60.
5493
* Upgraded Autolinker from version 0.15.2 to 0.17.1.
55-
* Improved the algorithm that `Camera.viewRectangle` uses to select the position of the camera, so that the specified rectangle is now better centered on the screen.
5694

5795
### 1.9 - 2015-05-01
5896

CONTRIBUTORS.md

+1
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
5959
* [Ayush Khandelwal](https://github.com/ayk115)
6060
* [Aditya Raisinghani](https://github.com/adi2412)
6161
* [Ilia Choly](https://github.com/icholy)
62+
* [Farouk Abdou](https://github.com/kaktus40)
6263

6364
Also see [our contributors page](http://cesiumjs.org/contributors.html) for more information.

Source/Core/AxisAlignedBoundingBox.js

+45-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ define([
33
'./Cartesian3',
44
'./defaultValue',
55
'./defined',
6+
'./deprecationWarning',
67
'./DeveloperError',
7-
'./Intersect'
8+
'./Intersect',
9+
'./Plane'
810
], function(
911
Cartesian3,
1012
defaultValue,
1113
defined,
14+
deprecationWarning,
1215
DeveloperError,
13-
Intersect) {
16+
Intersect,
17+
Plane) {
1418
"use strict";
1519

1620
/**
@@ -162,15 +166,13 @@ define([
162166
* Determines which side of a plane a box is located.
163167
*
164168
* @param {AxisAlignedBoundingBox} box The bounding box to test.
165-
* @param {Cartesian4} plane The coefficients of the plane in the form <code>ax + by + cz + d = 0</code>
166-
* where the coefficients a, b, c, and d are the components x, y, z, and w
167-
* of the {@link Cartesian4}, respectively.
169+
* @param {Plane} plane The plane to test against.
168170
* @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane
169171
* the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
170172
* on the opposite side, and {@link Intersect.INTERSECTING} if the box
171173
* intersects the plane.
172174
*/
173-
AxisAlignedBoundingBox.intersect = function(box, plane) {
175+
AxisAlignedBoundingBox.intersectPlane = function(box, plane) {
174176
//>>includeStart('debug', pragmas.debug);
175177
if (!defined(box)) {
176178
throw new DeveloperError('box is required.');
@@ -182,8 +184,9 @@ define([
182184

183185
intersectScratch = Cartesian3.subtract(box.maximum, box.minimum, intersectScratch);
184186
var h = Cartesian3.multiplyByScalar(intersectScratch, 0.5, intersectScratch); //The positive half diagonal
185-
var e = h.x * Math.abs(plane.x) + h.y * Math.abs(plane.y) + h.z * Math.abs(plane.z);
186-
var s = Cartesian3.dot(box.center, plane) + plane.w; //signed distance from center
187+
var normal = plane.normal;
188+
var e = h.x * Math.abs(normal.x) + h.y * Math.abs(normal.y) + h.z * Math.abs(normal.z);
189+
var s = Cartesian3.dot(box.center, normal) + plane.distance; //signed distance from center
187190

188191
if (s - e > 0) {
189192
return Intersect.INSIDE;
@@ -197,6 +200,26 @@ define([
197200
return Intersect.INTERSECTING;
198201
};
199202

203+
var scratchPlane = new Plane(new Cartesian3(), 0.0);
204+
/**
205+
* Determines which side of a plane a box is located.
206+
*
207+
* @deprecated
208+
* @param {AxisAlignedBoundingBox} box The bounding box to test.
209+
* @param {Cartesian4} plane The coefficients of the plane in the form <code>ax + by + cz + d = 0</code>
210+
* where the coefficients a, b, c, and d are the components x, y, z, and w
211+
* of the {@link Cartesian4}, respectively.
212+
* @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane
213+
* the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
214+
* on the opposite side, and {@link Intersect.INTERSECTING} if the box
215+
* intersects the plane.
216+
*/
217+
AxisAlignedBoundingBox.intersect = function(box, plane) {
218+
deprecationWarning('AxisAlignedBoundingBox.intersect', 'AxisAlignedBoundingBox.intersect() was deprecated in Cesium 1.11. It will be removed in 1.12. Use AxisAlignedBoundingBox.intersectPlane() instead.');
219+
var p = Plane.fromCartesian4(plane, scratchPlane);
220+
return AxisAlignedBoundingBox.intersectPlane(box, p);
221+
};
222+
200223
/**
201224
* Duplicates this AxisAlignedBoundingBox instance.
202225
*
@@ -210,6 +233,20 @@ define([
210233
/**
211234
* Determines which side of a plane this box is located.
212235
*
236+
* @param {Plane} plane The plane to test against.
237+
* @returns {Intersect} {@link Intersect.INSIDE} if the entire box is on the side of the plane
238+
* the normal is pointing, {@link Intersect.OUTSIDE} if the entire box is
239+
* on the opposite side, and {@link Intersect.INTERSECTING} if the box
240+
* intersects the plane.
241+
*/
242+
AxisAlignedBoundingBox.prototype.intersectPlane = function(plane) {
243+
return AxisAlignedBoundingBox.intersectPlane(this, plane);
244+
};
245+
246+
/**
247+
* Determines which side of a plane this box is located.
248+
*
249+
* @deprecated
213250
* @param {Cartesian4} plane The coefficients of the plane in the form <code>ax + by + cz + d = 0</code>
214251
* where the coefficients a, b, c, and d are the components x, y, z, and w
215252
* of the {@link Cartesian4}, respectively.

Source/Core/BoundingSphere.js

+66-10
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,28 @@ define([
44
'./Cartographic',
55
'./defaultValue',
66
'./defined',
7+
'./deprecationWarning',
78
'./DeveloperError',
89
'./Ellipsoid',
910
'./GeographicProjection',
1011
'./Intersect',
1112
'./Interval',
1213
'./Matrix4',
14+
'./Plane',
1315
'./Rectangle'
1416
], function(
1517
Cartesian3,
1618
Cartographic,
1719
defaultValue,
1820
defined,
21+
deprecationWarning,
1922
DeveloperError,
2023
Ellipsoid,
2124
GeographicProjection,
2225
Intersect,
2326
Interval,
2427
Matrix4,
28+
Plane,
2529
Rectangle) {
2630
"use strict";
2731

@@ -694,16 +698,34 @@ define([
694698
}
695699

696700
var leftCenter = left.center;
701+
var leftRadius = left.radius;
697702
var rightCenter = right.center;
703+
var rightRadius = right.radius;
698704

699-
Cartesian3.add(leftCenter, rightCenter, unionScratchCenter);
700-
var center = Cartesian3.multiplyByScalar(unionScratchCenter, 0.5, unionScratchCenter);
705+
var toRightCenter = Cartesian3.subtract(rightCenter, leftCenter, unionScratch);
706+
var centerSeparation = Cartesian3.magnitude(toRightCenter);
701707

702-
var radius1 = Cartesian3.magnitude(Cartesian3.subtract(leftCenter, center, unionScratch)) + left.radius;
703-
var radius2 = Cartesian3.magnitude(Cartesian3.subtract(rightCenter, center, unionScratch)) + right.radius;
708+
if (leftRadius >= (centerSeparation + rightRadius)) {
709+
// Left sphere wins.
710+
left.clone(result);
711+
return result;
712+
}
713+
714+
if (rightRadius >= (centerSeparation + leftRadius)) {
715+
// Right sphere wins.
716+
right.clone(result);
717+
return result;
718+
}
704719

705-
result.radius = Math.max(radius1, radius2);
720+
// There are two tangent points, one on far side of each sphere.
721+
var halfDistanceBetweenTangentPoints = (leftRadius + centerSeparation + rightRadius) * 0.5;
722+
723+
// Compute the center point halfway between the two tangent points.
724+
var center = Cartesian3.multiplyByScalar(toRightCenter,
725+
(-leftRadius + halfDistanceBetweenTangentPoints) / centerSeparation, unionScratchCenter);
726+
Cartesian3.add(center, leftCenter, center);
706727
Cartesian3.clone(center, result.center);
728+
result.radius = halfDistanceBetweenTangentPoints;
707729

708730
return result;
709731
};
@@ -742,15 +764,13 @@ define([
742764
* Determines which side of a plane a sphere is located.
743765
*
744766
* @param {BoundingSphere} sphere The bounding sphere to test.
745-
* @param {Cartesian4} plane The coefficients of the plane in the for ax + by + cz + d = 0
746-
* where the coefficients a, b, c, and d are the components x, y, z,
747-
* and w of the {@link Cartesian4}, respectively.
767+
* @param {Plane} plane The plane to test against.
748768
* @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
749769
* the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
750770
* on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
751771
* intersects the plane.
752772
*/
753-
BoundingSphere.intersect = function(sphere, plane) {
773+
BoundingSphere.intersectPlane = function(sphere, plane) {
754774
//>>includeStart('debug', pragmas.debug);
755775
if (!defined(sphere)) {
756776
throw new DeveloperError('sphere is required.');
@@ -763,7 +783,8 @@ define([
763783

764784
var center = sphere.center;
765785
var radius = sphere.radius;
766-
var distanceToPlane = Cartesian3.dot(plane, center) + plane.w;
786+
var normal = plane.normal;
787+
var distanceToPlane = Cartesian3.dot(normal, center) + plane.distance;
767788

768789
if (distanceToPlane < -radius) {
769790
// The center point is negative side of the plane normal
@@ -775,6 +796,27 @@ define([
775796
return Intersect.INSIDE;
776797
};
777798

799+
var scratchPlane = new Plane(new Cartesian3(), 0.0);
800+
/**
801+
* Determines which side of a plane a sphere is located.
802+
*
803+
* @deprecated
804+
* @param {BoundingSphere} sphere The bounding sphere to test.
805+
* @param {Cartesian4} plane The coefficients of the plane in Hessian Normal Form, as `ax + by + cz + d = 0`,
806+
* where (a, b, c) must be a unit normal vector.
807+
* The coefficients a, b, c, and d are the components x, y, z,
808+
* and w of the {@link Cartesian4}, respectively.
809+
* @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
810+
* the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
811+
* on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
812+
* intersects the plane.
813+
*/
814+
BoundingSphere.intersect = function(sphere, plane) {
815+
deprecationWarning('BoundingSphere.intersect', 'BoundingSphere.intersect() was deprecated in Cesium 1.11. It will be removed in 1.12. Use BoundingSphere.intersectPlane() instead.');
816+
var p = Plane.fromCartesian4(plane, scratchPlane);
817+
return BoundingSphere.intersectPlane(sphere, p);
818+
};
819+
778820
/**
779821
* Applies a 4x4 affine transformation matrix to a bounding sphere.
780822
*
@@ -1041,6 +1083,20 @@ define([
10411083
/**
10421084
* Determines which side of a plane the sphere is located.
10431085
*
1086+
* @param {Plane} plane The plane to test against.
1087+
* @returns {Intersect} {@link Intersect.INSIDE} if the entire sphere is on the side of the plane
1088+
* the normal is pointing, {@link Intersect.OUTSIDE} if the entire sphere is
1089+
* on the opposite side, and {@link Intersect.INTERSECTING} if the sphere
1090+
* intersects the plane.
1091+
*/
1092+
BoundingSphere.prototype.intersectPlane = function(plane) {
1093+
return BoundingSphere.intersectPlane(this, plane);
1094+
};
1095+
1096+
/**
1097+
* Determines which side of a plane the sphere is located.
1098+
*
1099+
* @deprecated
10441100
* @param {Cartesian4} plane The coefficients of the plane in the for ax + by + cz + d = 0
10451101
* where the coefficients a, b, c, and d are the components x, y, z,
10461102
* and w of the {@link Cartesian4}, respectively.

0 commit comments

Comments
 (0)