Skip to content

Commit

Permalink
Merge branch 'master' into touch-events
Browse files Browse the repository at this point in the history
  • Loading branch information
Hannah authored Mar 18, 2019
2 parents 2e93362 + 464d2cd commit 5ad60e2
Show file tree
Hide file tree
Showing 92 changed files with 1,674 additions and 443 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ script:

- npm --silent run test -- --browsers FirefoxHeadless --failTaskOnError --webgl-stub --release --suppressPassed

# Various Node.js smoke-screen tests
- node -e "const Cesium = require('./');"
- NODE_ENV=development node index.js

- NODE_ENV=production node index.js

- npm --silent run cloc
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@
"boundingVolume": {
"region": [
0.05106109590840974,
0.8096200283483473,
0.8096200283483475,
0.05108367303398731,
0.8096426054739249,
-100,
100
0.809642605473925,
313.24,
513.24
]
},
"transform": [
-0.051050184597015554,
0.9986960892346635,
-0.05105018459701556,
0.9986960892346634,
0,
0,
-0.723088844421502,
-0.03696201415592677,
0.6897654185175668,
-0.7230889943688711,
-0.036962021820761914,
0.6897652609152887,
0,
0.6888660259628047,
0.035212651943959464,
0.7240329187387035,
0.6888658685660259,
0.03521264389833409,
0.7240330688818458,
0,
4401411.72835101,
224986.24320435512,
4595136.691084024,
4401696.395347578,
225000.79448064446,
4595435.890447363,
1
],
"geometricError": 0,
Expand Down
6 changes: 3 additions & 3 deletions Apps/SampleData/simple.czml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
}
}
},
"followSurface":false,
"arcType":"NONE",
"positions":{
"references":[
"Satellite/Geoeye1#position","Satellite/ISS#position"
Expand Down Expand Up @@ -207,7 +207,7 @@
}
}
},
"followSurface":false,
"arcType":"NONE",
"positions":{
"references":[
"Facility/AGI#position","Satellite/ISS#position"
Expand All @@ -232,7 +232,7 @@
}
}
},
"followSurface":false,
"arcType":"NONE",
"positions":{
"references":[
"Facility/AGI#position","Satellite/Geoeye1/Sensor/Sensor#position"
Expand Down
17 changes: 14 additions & 3 deletions Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@

var viewer = new Cesium.Viewer('cesiumContainer', {
infoBox: false,
selectionIndicator: false
selectionIndicator: false,
terrainProvider: Cesium.createWorldTerrain()
});
var scene = viewer.scene;

Expand Down Expand Up @@ -132,6 +133,14 @@

viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0.5, -0.2, radius * 4.0));

if (!Cesium.Matrix4.equals(tileset.root.transform, Cesium.Matrix4.IDENTITY)) {
// The clipping plane is initially positioned at the tileset's root transform.
// Apply an additional matrix to center the clipping plane on the bounding sphere center.
var transformCenter = Cesium.Matrix4.getTranslation(tileset.root.transform, new Cesium.Cartesian3());
var height = Cesium.Cartesian3.distance(transformCenter, tileset.boundingSphere.center);
clippingPlanes.modelMatrix = Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0.0, 0.0, height));
}

for (var i = 0; i < clippingPlanes.length; ++i) {
var plane = clippingPlanes.get(i);
var planeEntity = viewer.entities.add({
Expand Down Expand Up @@ -161,7 +170,7 @@
edgeWidth : viewModel.edgeStylingEnabled ? 1.0 : 0.0
});

var position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 100.0);
var position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 300.0);
var heading = Cesium.Math.toRadians(135.0);
var pitch = 0.0;
var roll = 0.0;
Expand Down Expand Up @@ -200,7 +209,7 @@

// Power Plant design model provided by Bentley Systems
var bimUrl = Cesium.IonResource.fromAssetId(8564);
var pointCloudUrl = Cesium.IonResource.fromAssetId(5714);
var pointCloudUrl = Cesium.IonResource.fromAssetId(16421);
var instancedUrl = '../../SampleData/Cesium3DTiles/Instanced/InstancedOrientation/tileset.json';
var modelUrl = '../../SampleData/models/CesiumAir/Cesium_Air.glb';

Expand All @@ -220,6 +229,8 @@
loadTileset(pointCloudUrl);
} else if (newValue === clipObjects[2]) {
loadTileset(instancedUrl);
// Position the instanced tileset above terrain
tileset.modelMatrix = new Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(15.0, -58.6, 50.825));
} else {
loadModel(modelUrl);
}
Expand Down
13 changes: 6 additions & 7 deletions Apps/Sandcastle/gallery/3D Tiles Point Cloud Classification.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@
'use strict';
//Sandcastle_Begin
// An example showing a point cloud tileset classified by a Geometry tileset.
var viewer = new Cesium.Viewer('cesiumContainer');
var viewer = new Cesium.Viewer('cesiumContainer', {
terrainProvider : Cesium.createWorldTerrain()
});

//Point Cloud by Prof. Peter Allen, Columbia University Robotics Lab. Scanning by Alejandro Troccoli and Matei Ciocarlie.
var tileset = new Cesium.Cesium3DTileset({
url: Cesium.IonResource.fromAssetId(5714)
url: Cesium.IonResource.fromAssetId(16421)
});
viewer.scene.primitives.add(tileset);

Expand Down Expand Up @@ -59,11 +61,8 @@
});

viewer.scene.camera.setView({
destination : new Cesium.Cartesian3(4401448.974612145, 225038.45962842644, 4595135.776680152),
orientation : {
heading : 5.36861655457269,
pitch : -0.4029289137364358
}
destination: new Cesium.Cartesian3(4401744.644145314, 225051.41078911052, 4595420.374784433),
orientation: new Cesium.HeadingPitchRoll(5.646733805039757, -0.276607153839886, 6.281110875400085)
});

// Information about the currently highlighted feature
Expand Down
18 changes: 11 additions & 7 deletions Apps/Sandcastle/gallery/3D Tiles Point Cloud Shading.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@
function startup(Cesium) {
'use strict';
//Sandcastle_Begin
var viewer = new Cesium.Viewer('cesiumContainer');
var viewer = new Cesium.Viewer('cesiumContainer', {
terrainProvider: Cesium.createWorldTerrain()
});

var scene = viewer.scene;
var viewModelTileset;
Expand Down Expand Up @@ -158,18 +160,20 @@
function loadChurch() {
// Point Cloud by Prof. Peter Allen, Columbia University Robotics Lab. Scanning by Alejandro Troccoli and Matei Ciocarlie.
// This tileset uses additive refinement and has geometric error based on the bounding box size for each tile.
var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5714) });
var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(16421) });
viewer.scene.primitives.add(tileset);

tileset.maximumScreenSpaceError = 1024.0; // For better performance, due to how this tileset treats geometric error.
tileset.pointCloudShading.maximumAttenuation = 8.0; // Don't allow points larger than 8 pixels.
tileset.maximumScreenSpaceError = 16.0;
tileset.pointCloudShading.maximumAttenuation = 4.0; // Don't allow points larger than 4 pixels.
tileset.pointCloudShading.baseResolution = 0.05; // Assume an original capture resolution of 5 centimeters between neighboring points.
tileset.pointCloudShading.geometricErrorScale = 1.0; // Applies to both geometric error and the base resolution.
tileset.pointCloudShading.geometricErrorScale = 0.5; // Applies to both geometric error and the base resolution.
tileset.pointCloudShading.attenuation = true;
tileset.pointCloudShading.eyeDomeLighting = true;

tilesetToViewModel(tileset);
viewer.zoomTo(tileset);
viewer.scene.camera.setView({
destination: new Cesium.Cartesian3(4401744.644145314, 225051.41078911052, 4595420.374784433),
orientation: new Cesium.HeadingPitchRoll(5.646733805039757, -0.276607153839886, 6.281110875400085)
});
}

function checkZero(newValue) {
Expand Down
13 changes: 10 additions & 3 deletions Apps/Sandcastle/gallery/3D Tiles Point Cloud.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@
'use strict';
//Sandcastle_Begin
//Point Cloud by Prof. Peter Allen, Columbia University Robotics Lab. Scanning by Alejandro Troccoli and Matei Ciocarlie.
var viewer = new Cesium.Viewer('cesiumContainer');
var viewer = new Cesium.Viewer('cesiumContainer', {
terrainProvider : Cesium.createWorldTerrain()
});

var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(5714) });
var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(16421) });
viewer.scene.primitives.add(tileset);
viewer.zoomTo(tileset);

viewer.scene.camera.setView({
destination: new Cesium.Cartesian3(4401744.644145314, 225051.41078911052, 4595420.374784433),
orientation: new Cesium.HeadingPitchRoll(5.646733805039757, -0.276607153839886, 6.281110875400085)
});

//Sandcastle_End
Sandcastle.finishedLoading();
}
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/CZML Polyline.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
}
}
},
"followSurface" : false,
"arcType" : "NONE",
"width" : 10
}
}, {
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Clamp to Terrain.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
viewer.entities.add({
polyline : {
positions : Cesium.Ellipsoid.WGS84.cartographicArrayToCartesianArray(samples),
followSurface : false,
arcType : Cesium.ArcType.NONE,
width : 5,
material : new Cesium.PolylineOutlineMaterialProperty({
color : Cesium.Color.ORANGE,
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Custom DataSource.html
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@
var polyline = new Cesium.PolylineGraphics();
polyline.material = new Cesium.ColorMaterialProperty(color);
polyline.width = new Cesium.ConstantProperty(2);
polyline.followSurface = new Cesium.ConstantProperty(false);
polyline.arcType = new Cesium.ConstantProperty(Cesium.ArcType.NONE);
polyline.positions = new Cesium.ConstantProperty([surfacePosition, heightPosition]);

//The polyline instance itself needs to be on an entity.
Expand Down
8 changes: 4 additions & 4 deletions Apps/Sandcastle/gallery/Globe Materials.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@
if (selectedShading === 'elevation') {
material = getElevationContourMaterial();
shadingUniforms = material.materials.elevationRampMaterial.uniforms;
shadingUniforms.minHeight = minHeight;
shadingUniforms.maxHeight = maxHeight;
shadingUniforms.minimumHeight = minHeight;
shadingUniforms.maximumHeight = maxHeight;
contourUniforms = material.materials.contourMaterial.uniforms;
} else if (selectedShading === 'slope') {
material = getSlopeContourMaterial();
Expand All @@ -221,8 +221,8 @@
} else if (selectedShading === 'elevation') {
material = Cesium.Material.fromType('ElevationRamp');
shadingUniforms = material.uniforms;
shadingUniforms.minHeight = minHeight;
shadingUniforms.maxHeight = maxHeight;
shadingUniforms.minimumHeight = minHeight;
shadingUniforms.maximumHeight = maxHeight;
} else if (selectedShading === 'slope') {
material = Cesium.Material.fromType('SlopeRamp');
shadingUniforms = material.uniforms;
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Sample Height from 3D Tiles.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
viewer.entities.add({
polyline : {
positions : clampedCartesians,
followSurface : false,
arcType : Cesium.ArcType.NONE,
width : 2,
material : new Cesium.PolylineOutlineMaterialProperty({
color : Cesium.Color.YELLOW
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Star Burst.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
instances.push(new Cesium.GeometryInstance({
geometry : new Cesium.SimplePolylineGeometry({
positions : [starBurstState.center, lines[i]],
followSurface : false,
arcType : Cesium.ArcType.NONE,
granularity : Cesium.Math.PI_OVER_FOUR
}),
attributes : {
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/development/Pick From Ray.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
polyline : {
positions : arrowPositions,
width : 10,
followSurface : false,
arcType : Cesium.ArcType.NONE,
material : new Cesium.PolylineArrowMaterialProperty(Cesium.Color.YELLOW)
}
});
Expand Down
4 changes: 2 additions & 2 deletions Apps/Sandcastle/gallery/development/Polyline.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

// Example 2: Draw a straight blue polyline

// Setting the followSurface option to false will allow
// Setting the arcType option to ArcType.NONE will allow
// you to draw a straight polyline. Otherwise, it will
// curve to the globe surface.
scene.primitives.add(new Cesium.Primitive({
Expand All @@ -64,7 +64,7 @@
]),
width : 5.0,
vertexFormat : Cesium.PolylineColorAppearance.VERTEX_FORMAT,
followSurface: false
arcType: Cesium.ArcType.NONE
}),
attributes: {
color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.BLUE)
Expand Down
4 changes: 2 additions & 2 deletions Apps/Sandcastle/gallery/development/Simple Polyline.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
}
// For per segment coloring, provide the colors options with an
// array of colors where the length is equal to the number of positions.
// Setting followSurface to false will draw straight lines.
// Setting arcType to ArcType.NONE will draw straight lines.
// Otherwise, the polyline curves to the surface of the globe.
var perSegmentPolyline = new Cesium.GeometryInstance({
geometry : new Cesium.SimplePolylineGeometry({
positions : positions,
colors : colors,
followSurface: false
arcType: Cesium.ArcType.NONE
})
});

Expand Down
25 changes: 24 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,45 @@
Change Log
==========

### 1.56 - 2019-04-01

##### Breaking Changes :mega:
* `Resource.fetchImage` now returns an `ImageBitmap` instead of `Image` when supported. This allows for decoding images while fetching using `createImageBitmap` to greatly speed up texture upload and decrease frame drops when loading models with large textures. [#7579](https://github.com/AnalyticalGraphicsInc/cesium/pull/7579)

##### Deprecated :hourglass_flowing_sand:
* `Resource.fetchImage` now takes an options object. Use `resource.fetchImage({ preferBlob: true })` instead of `resource.fetchImage(true)`. The previous function definition will no longer work in 1.57. [#7579](https://github.com/AnalyticalGraphicsInc/cesium/pull/7579)

##### Additions :tada:
* `Resource.fetchImage` now has a `flipY` option to vertically flip an image during fetch & decode. It is only valid when `ImageBitmapOptions` is supported by the browser. [#7579](https://github.com/AnalyticalGraphicsInc/cesium/pull/7579)
* Added `backFaceCulling` and `normalShading` options to `PointCloudShading`. Both options are only applicable for point clouds containing normals. [#7399](https://github.com/AnalyticalGraphicsInc/cesium/pull/7399)
* Added support for touch and hold gesture. The touch and hold delay can be customized by updating `ScreenSpaceEventHandler.touchHoldDelayMilliseconds`. [#7286](https://github.com/AnalyticalGraphicsInc/cesium/pull/7286)

##### Fixes :wrench:
* Fixed the value for `BlendFunction.ONE_MINUS_CONSTANT_COLOR`. [#7624](https://github.com/AnalyticalGraphicsInc/cesium/pull/7624)
* Fixed `HeadingPitchRoll.pitch` being `NaN` when using `.fromQuaternion` do to a rounding error
for pitches close to +/- 90°. [#7654](https://github.com/AnalyticalGraphicsInc/cesium/pull/7654)

### 1.55 - 2019-03-01

##### Breaking Changes :mega:
* `czm_materialInput.slope` is now an angle in radians between 0 and pi/2 (flat to vertical), rather than a projected length 1 to 0 (flat to vertical).

##### Additions :tada:
* Updated terrain and imagery rendering, resulting in terrain/imagery loading ~33% faster and using ~33% less data [#7061](https://github.com/AnalyticalGraphicsInc/cesium/pull/7061)
* `czm_materialInput.aspect` was added as an angle in radians between 0 and 2pi (east, north, west to south).
* Added support for touch and hold gesture. The touch and hold delay can be customized by updating `ScreenSpaceEventHandler.touchHoldDelayMilliseconds`. [#7286](https://github.com/AnalyticalGraphicsInc/cesium/pull/7286)
* Added CZML `arcType` support for `polyline` and `polygon`, which supersedes `followSurface`. `followSurface` is still supported for compatibility with existing documents. [#7582](https://github.com/AnalyticalGraphicsInc/cesium/pull/7582)

##### Fixes :wrench:
* Fixed an issue where models would cause a crash on load if some primitives were Draco encoded and others were not. [#7383](https://github.com/AnalyticalGraphicsInc/cesium/issues/7383)
* Fixed an issue where RTL labels not reversing correctly non alphabetic characters [#7501](https://github.com/AnalyticalGraphicsInc/cesium/pull/7501)
* Fixed Node.js support for the `Resource` class and any functionality using it internally.
* Fixed an issue where some ground polygons crossing the Prime Meridian would have incorrect bounding rectangles. [#7533](https://github.com/AnalyticalGraphicsInc/cesium/pull/7533)
* Fixed an issue where polygons on terrain using rhumb lines where being rendered incorrectly. [#7538](https://github.com/AnalyticalGraphicsInc/cesium/pulls/7538)
* Fixed an issue with `EllipsoidRhumbLines.findIntersectionWithLongitude` when longitude was IDL. [#7551](https://github.com/AnalyticalGraphicsInc/cesium/issues/7551)
* Fixed model silhouette colors when rendering with high dynamic range. [#7563](https://github.com/AnalyticalGraphicsInc/cesium/pull/7563)
* Fixed an issue with ground polylines on globes that use ellipsoids other than WGS84. [#7552](https://github.com/AnalyticalGraphicsInc/cesium/issues/7552)
* Fixed an issue where Draco compressed models with RGB per-vertex color would not load in Cesium. [#7576](https://github.com/AnalyticalGraphicsInc/cesium/issues/7576)
* Fixed an issue where the outline geometry for extruded Polygons didn't calculate the correct indices. [#7599](https://github.com/AnalyticalGraphicsInc/cesium/issues/7599)

### 1.54 - 2019-02-01

Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Jannes Bolling](https://github.com/jbo023)
* [Arne Schilling](https://github.com/arneschilling)
* [Ben Kuster](https://github.com/bkuster)
* [Zhihang Yao](https://github.com/yaozhihang)
* [Logilab](https://www.logilab.fr/)
* [Florent Cayré](https://github.com/fcayre/)
* [webiks](https://www.webiks.com)
Expand Down Expand Up @@ -203,3 +204,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Mirco Kroon](https://github.com/mircokroon)
* [Rikku-x](https://github.com/Rikku-x)
* [Adrien David](https://github.com/adridavid)
* [Alexander Popiak](https://github.com/apopiak)
Loading

0 comments on commit 5ad60e2

Please sign in to comment.