Skip to content

Commit

Permalink
Merge branch 'master' into texture-transform
Browse files Browse the repository at this point in the history
  • Loading branch information
bagnell committed Mar 21, 2019
2 parents 4001a86 + ead9f36 commit 8b20b14
Show file tree
Hide file tree
Showing 150 changed files with 8,344 additions and 2,238 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
Loading

0 comments on commit 8b20b14

Please sign in to comment.