Skip to content

Commit

Permalink
Merge branch 'master' into draco
Browse files Browse the repository at this point in the history
  • Loading branch information
ggetz committed Mar 1, 2018
2 parents 147ea11 + 0e84ac1 commit f516ed7
Show file tree
Hide file tree
Showing 235 changed files with 9,367 additions and 13,452 deletions.
15 changes: 14 additions & 1 deletion Apps/CesiumViewer/CesiumViewer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
define([
'Cesium/Core/Cartesian3',
'Cesium/Core/createWorldTerrain',
'Cesium/Core/defined',
'Cesium/Core/formatError',
'Cesium/Core/Math',
Expand All @@ -15,6 +16,7 @@ define([
'domReady!'
], function(
Cartesian3,
createWorldTerrain,
defined,
formatError,
CesiumMath,
Expand Down Expand Up @@ -52,12 +54,23 @@ define([
var loadingIndicator = document.getElementById('loadingIndicator');
var viewer;
try {
var hasBaseLayerPicker = !defined(imageryProvider);
viewer = new Viewer('cesiumContainer', {
imageryProvider : imageryProvider,
baseLayerPicker : !defined(imageryProvider),
baseLayerPicker : hasBaseLayerPicker,
scene3DOnly : endUserOptions.scene3DOnly,
requestRenderMode : true
});

if (hasBaseLayerPicker) {
var viewModel = viewer.baseLayerPicker.viewModel;
viewModel.selectedTerrain = viewModel.terrainProviderViewModels[1];
} else {
viewer.terrainProvider = createWorldTerrain({
requestWaterMask: true,
requestVertexNormals: true
});
}
} catch (exception) {
loadingIndicator.style.display = 'none';
var message = formatError(exception);
Expand Down
17 changes: 8 additions & 9 deletions Apps/Sandcastle/gallery/3D Tiles Adjust Height.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,13 @@
var toolbar = document.getElementById('toolbar');
Cesium.knockout.applyBindings(viewModel, toolbar);

var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url : '../../../Specs/Data/Cesium3DTiles/Tilesets/Tileset'
}));

tileset.readyPromise.then(function() {
viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0.0, -0.5, tileset.boundingSphere.radius * 2.0));
}).otherwise(function(error) {
throw(error);
});
var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(3883) });
tileset.readyPromise.then(function(tileset) {
viewer.scene.primitives.add(tileset);
viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0.0, -0.5, tileset.boundingSphere.radius * 2.0));
}).otherwise(function(error) {
console.log(error);
});

Cesium.knockout.getObservable(viewModel, 'height').subscribe(function(height) {
height = Number(height);
Expand All @@ -78,6 +76,7 @@
var translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
tileset.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
});

//Sandcastle_End
Sandcastle.finishedLoading();
}
Expand Down
15 changes: 8 additions & 7 deletions Apps/Sandcastle/gallery/3D Tiles BIM.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@
// Power Plant design model provided by Bentley Systems
var viewer = new Cesium.Viewer('cesiumContainer');

Cesium.CesiumIon.create3DTileset(1459, { accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzNjUyM2I5Yy01YmRhLTQ0MjktOGI0Zi02MDdmYzBjMmY0MjYiLCJpZCI6NDQsImFzc2V0cyI6WzE0NTldLCJpYXQiOjE0OTkyNjQ3ODF9.SW_rwY-ic0TwQBeiweXNqFyywoxnnUBtcVjeCmDGef4' })
.then(function(tileset) {
viewer.scene.primitives.add(tileset);
viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0.5, -0.2, tileset.boundingSphere.radius * 4.0));
}).otherwise(function(error) {
console.log(error);
});
var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(3837) });

tileset.readyPromise.then(function(tileset) {
viewer.scene.primitives.add(tileset);
viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0.5, -0.2, tileset.boundingSphere.radius * 4.0));
}).otherwise(function(error) {
console.log(error);
});
//Sandcastle_End
Sandcastle.finishedLoading();
}
Expand Down
10 changes: 3 additions & 7 deletions Apps/Sandcastle/gallery/3D Tiles Batch Table Hierarchy.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,10 @@
var viewer = new Cesium.Viewer('cesiumContainer');
viewer.clock.currentTime = new Cesium.JulianDate(2457522.154792);

var tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url : '../../../Specs/Data/Cesium3DTiles/Hierarchy/BatchTableHierarchy'
}));
var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(3875) });

viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0.0, -0.3, 0.0)).otherwise(function(error) {
throw(error);
});
viewer.scene.primitives.add(tileset);
viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0.0, -0.3, 0.0));

var styles = [];
function addStyle(name, style) {
Expand Down Expand Up @@ -200,7 +197,6 @@
}
feature.show = false;
}, Cesium.ScreenSpaceEventType.MIDDLE_CLICK);

//Sandcastle_End
Sandcastle.finishedLoading();
}
Expand Down
21 changes: 8 additions & 13 deletions Apps/Sandcastle/gallery/3D Tiles Clipping Planes.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@

planeEntities.push(planeEntity);
}
return tileset;
}).otherwise(function(error) {
console.log(error);
});
Expand Down Expand Up @@ -205,14 +206,12 @@
}

// Power Plant design model provided by Bentley Systems
var bimUrl = Cesium.CesiumIon.createResource(1459, { accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzNjUyM2I5Yy01YmRhLTQ0MjktOGI0Zi02MDdmYzBjMmY0MjYiLCJpZCI6NDQsImFzc2V0cyI6WzE0NTldLCJpYXQiOjE0OTkyNjQ3ODF9.SW_rwY-ic0TwQBeiweXNqFyywoxnnUBtcVjeCmDGef4' });
var pointCloudUrl = Cesium.CesiumIon.createResource(1460, { accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIyMzk2YzJiOS1jZGFmLTRlZmYtYmQ4MS00NTA3NjEwMzViZTkiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjBdLCJpYXQiOjE0OTkyNjQ3NTV9.oWjvN52CRQ-dk3xtvD4e8ZnOHZhoWSpJLlw115mbQJM' });
var instancedUrl = '../../../Specs/Data/Cesium3DTiles/Instanced/InstancedOrientation/';
var bimUrl = Cesium.IonResource.fromAssetId(3837);
var pointCloudUrl = Cesium.IonResource.fromAssetId(3838);
var instancedUrl = Cesium.IonResource.fromAssetId(3876);
var modelUrl = '../../SampleData/models/CesiumAir/Cesium_Air.glb';

bimUrl.then(function(resource) {
return loadTileset(resource);
});
loadTileset(bimUrl);

// Track and create the bindings for the view model
var toolbar = document.getElementById('toolbar');
Expand All @@ -223,17 +222,13 @@
reset();

if (newValue === clipObjects[0]) {
bimUrl.then(function(resource) {
return loadTileset(resource);
});
loadTileset(bimUrl);
} else if (newValue === clipObjects[1]) {
pointCloudUrl.then(function(resource) {
return loadTileset(resource);
}).then(function() {
loadTileset(pointCloudUrl).then(function(tileset) {
tileset.clippingPlanes.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(tileset.boundingSphere.center);
});
} else if (newValue === clipObjects[2]) {
loadTileset(instancedUrl).then(function() {
loadTileset(instancedUrl).then(function(tileset) {
tileset.clippingPlanes.modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(tileset.boundingSphere.center);
});
} else {
Expand Down
6 changes: 2 additions & 4 deletions Apps/Sandcastle/gallery/3D Tiles Feature Picking.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@
});

// Load the NYC buildings tileset
Cesium.CesiumIon.create3DTileset(1461, { accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkYWJmM2MzNS02OWM5LTQ3OWItYjEyYS0xZmNlODM5ZDNkMTYiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjFdLCJpYXQiOjE0OTkyNjQ3NDN9.vuR75SqPDKcggvUrG_vpx0Av02jdiAxnnB1fNf-9f7s' })
.then(function(tileset) {
viewer.scene.primitives.add(tileset);
});
var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(3839) });
viewer.scene.primitives.add(tileset);

// HTML overlay for showing feature name on mouseover
var nameOverlay = document.createElement('div');
Expand Down
8 changes: 1 addition & 7 deletions Apps/Sandcastle/gallery/3D Tiles Feature Styling.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@
});

// Load the NYC buildings tileset.
Cesium.CesiumIon.create3DTileset(1461, { accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkYWJmM2MzNS02OWM5LTQ3OWItYjEyYS0xZmNlODM5ZDNkMTYiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjFdLCJpYXQiOjE0OTkyNjQ3NDN9.vuR75SqPDKcggvUrG_vpx0Av02jdiAxnnB1fNf-9f7s' })
.then(function(tileset) {

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

// Color buildings based on their height.
Expand Down Expand Up @@ -151,10 +149,6 @@
}]);

colorByHeight();
})
.otherwise(function(error) {
console.log(error);
});

//Sandcastle_End
Sandcastle.finishedLoading();
Expand Down
38 changes: 19 additions & 19 deletions Apps/Sandcastle/gallery/3D Tiles Formats.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,43 +45,43 @@
tilesets: [
{
name: 'Tileset',
url: '../../../Specs/Data/Cesium3DTiles/Tilesets/Tileset/'
resource: Cesium.IonResource.fromAssetId(3883)
}, {
name: 'Translucent',
url: '../../../Specs/Data/Cesium3DTiles/Batched/BatchedTranslucent/'
resource: Cesium.IonResource.fromAssetId(3871)
}, {
name: 'Translucent/Opaque',
url: '../../../Specs/Data/Cesium3DTiles/Batched/BatchedTranslucentOpaqueMix/'
resource: Cesium.IonResource.fromAssetId(3872)
}, {
name: 'Multi-color',
url: '../../../Specs/Data/Cesium3DTiles/Batched/BatchedColors/'
resource: Cesium.IonResource.fromAssetId(3870)
}, {
name: 'Request Volume',
url: '../../../Specs/Data/Cesium3DTiles/Tilesets/TilesetWithViewerRequestVolume/'
resource: Cesium.IonResource.fromAssetId(3884)
}, {
name: 'Batched',
url: '../../../Specs/Data/Cesium3DTiles/Batched/BatchedWithBatchTable/'
resource: Cesium.IonResource.fromAssetId(3873)
}, {
name: 'Instanced',
url: '../../../Specs/Data/Cesium3DTiles/Instanced/InstancedWithBatchTable/'
resource: Cesium.IonResource.fromAssetId(3877)
}, {
name: 'Instanced/Orientation',
url: '../../../Specs/Data/Cesium3DTiles/Instanced/InstancedOrientation/'
resource: Cesium.IonResource.fromAssetId(3876)
}, {
name: 'Composite',
url: '../../../Specs/Data/Cesium3DTiles/Composite/Composite/'
resource: Cesium.IonResource.fromAssetId(3874)
}, {
name: 'PointCloud',
url: '../../../Specs/Data/Cesium3DTiles/PointCloud/PointCloudRGB/'
resource: Cesium.IonResource.fromAssetId(3881)
}, {
name: 'PointCloudConstantColor',
url: '../../../Specs/Data/Cesium3DTiles/PointCloud/PointCloudConstantColor/'
resource: Cesium.IonResource.fromAssetId(3879)
}, {
name: 'PointCloudNormals',
url: '../../../Specs/Data/Cesium3DTiles/PointCloud/PointCloudQuantizedOctEncoded/'
resource: Cesium.IonResource.fromAssetId(3880)
}, {
name: 'PointCloudBatched',
url: '../../../Specs/Data/Cesium3DTiles/PointCloud/PointCloudBatched/'
resource: Cesium.IonResource.fromAssetId(3878)
}
],
selectedTileset: undefined,
Expand All @@ -105,13 +105,13 @@
inspectorViewModel.tileset = undefined;
return;
}
tileset = new Cesium.Cesium3DTileset({
url: options.url
});
inspectorViewModel.tileset = tileset;
scene.primitives.add(tileset);
tileset.readyPromise.then(function(tileset) {

tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url : options.resource
}));

tileset.readyPromise.then(function() {
inspectorViewModel.tileset = tileset;
viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0, -2.0, Math.max(100.0 - tileset.boundingSphere.radius, 0.0)));

var properties = tileset.properties;
Expand Down
12 changes: 5 additions & 7 deletions Apps/Sandcastle/gallery/3D Tiles Inspector.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@
viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin);
var inspectorViewModel = viewer.cesium3DTilesInspector.viewModel;

Cesium.CesiumIon.create3DTileset(1461, { accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkYWJmM2MzNS02OWM5LTQ3OWItYjEyYS0xZmNlODM5ZDNkMTYiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjFdLCJpYXQiOjE0OTkyNjQ3NDN9.vuR75SqPDKcggvUrG_vpx0Av02jdiAxnnB1fNf-9f7s' })
.then(function(tileset) {
viewer.scene.primitives.add(tileset);
viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0.0, -0.5, tileset.boundingSphere.radius / 4.0));
}).otherwise(function(error) {
console.log(error);
});
var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(3839) });
viewer.scene.primitives.add(tileset);

tileset.readyPromise.then(function(){
viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0.0, -0.5, tileset.boundingSphere.radius / 4.0));
});
//Sandcastle_End
Sandcastle.finishedLoading();
}
Expand Down
19 changes: 7 additions & 12 deletions Apps/Sandcastle/gallery/3D Tiles Interactivity.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,14 @@
endTransform: Cesium.Matrix4.IDENTITY
});

var tileset;

// Load the NYC buildings tileset.
Cesium.CesiumIon.create3DTileset(1461, { accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkYWJmM2MzNS02OWM5LTQ3OWItYjEyYS0xZmNlODM5ZDNkMTYiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjFdLCJpYXQiOjE0OTkyNjQ3NDN9.vuR75SqPDKcggvUrG_vpx0Av02jdiAxnnB1fNf-9f7s' })
.then(function(result) {
tileset = result;
scene.primitives.add(tileset);
tileset.style = new Cesium.Cesium3DTileStyle({
meta: {
description: "'Building id ${id} has height ${height}.'"
}
});
});
var tileset = new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(3839) });
scene.primitives.add(tileset);
tileset.style = new Cesium.Cesium3DTileStyle({
meta: {
description: "'Building id ${id} has height ${height}.'"
}
});

var handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);

Expand Down
8 changes: 4 additions & 4 deletions Apps/Sandcastle/gallery/3D Tiles Interior.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
// San Miguel model created by Guillermo M. Leal Llaguno. Cleaned up and hosted by Morgan McGuire: http://graphics.cs.williams.edu/data/meshes.xml
var viewer = new Cesium.Viewer('cesiumContainer');

Cesium.CesiumIon.create3DTileset(1463, { accessToken: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI5ZGExZTdmMS0xZjA5LTQxODAtOThmYi04MWU1YjZkMWZjNjgiLCJpZCI6NDQsImFzc2V0cyI6WzE0NjNdLCJpYXQiOjE0OTkyNzYwNzV9.eTEtaAEBUehNIZushZQnp0On9BPRtZYS7XEWFwneSRU' })
.then(function(tileset) {
viewer.scene.primitives.add(tileset);
});
var tileset = new Cesium.Cesium3DTileset({
url: Cesium.IonResource.fromAssetId(3840)
});
viewer.scene.primitives.add(tileset);

var initialPosition = new Cesium.Cartesian3(-1111583.3721328347, -5855888.151574568, 2262561.444696748);
var initialOrientation = new Cesium.HeadingPitchRoll.fromDegrees(100.0, -15.0, 0.0);
Expand Down
Loading

0 comments on commit f516ed7

Please sign in to comment.