Skip to content

Commit

Permalink
Merge branch 'master' into issue3170
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGES.md
  • Loading branch information
slozier committed Nov 18, 2015
2 parents 3be4201 + 4f3b238 commit 183d378
Show file tree
Hide file tree
Showing 460 changed files with 3,193 additions and 2,134 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Thumbs.db
/Apps/CesiumViewer/Gallery/gallery-index.js

/Apps/Sandcastle/jsHintOptions.js
/Apps/Sandcastle/.jshintrc
/Apps/Sandcastle/gallery/gallery-index.js

/Source/Cesium.js
Expand Down
36 changes: 26 additions & 10 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
"camelcase": false,
"curly": true,
"eqeqeq": true,
"es3": true,
"forin": true,
"freeze": true,
"immed": true,
"latedef": true,
"latedef": false,
"newcap": true,
"noarg": true,
"noempty": false,
"noempty": true,
"nonbsp": true,
"nonew": true,
"plusplus": false,
"quotmark": false,
"regexp": false,
"undef": true,
"unused": false,
"unused": "vars",
"strict": true,
"trailing": true,
"asi": false,
"boss": false,
"debug": false,
"eqnull": false,
"esnext": false,
"moz": false,
"evil": false,
"expr": false,
"funcscope": false,
Expand All @@ -32,15 +32,31 @@
"laxbreak": false,
"laxcomma": false,
"loopfunc": false,
"moz": false,
"multistr": true,
"noyield": false,
"notypeof": false,
"proto": false,
"regexdash": false,
"scripturl": false,
"smarttabs": false,
"shadow": false,
"sub": false,
"supernew": false,
"validthis": false,
"browser": true,
"predef": [ "JSON" ]
"browserify": false,
"couch": false,
"devel": true,
"dojo": false,
"jasmine": true,
"jquery": false,
"mocha": true,
"mootools": false,
"node": false,
"nonstandard": false,
"prototypejs": false,
"qunit": false,
"rhino": false,
"shelljs": false,
"worker": false,
"wsh": false,
"yui": false
}
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "0.10"
- "0.12"
sudo: false
script:
- npm run jsHint && npm run release
4 changes: 4 additions & 0 deletions Apps/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../.jshintrc",
"jasmine": false
}
12 changes: 12 additions & 0 deletions Apps/Sandcastle/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../.jshintrc",
"jasmine": false,
"unused": false,
"predef": [
"JSON",
"require",
"console",
"Sandcastle",
"Cesium"
]
}
2 changes: 1 addition & 1 deletion Apps/Sandcastle/CesiumSandcastle.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global require,Blob,CodeMirror,JSHINT*/
/*global require,Blob,JSHINT*/
/*global gallery_demos*/// defined by gallery/gallery-index.js, created by build
/*global sandcastleJsHintOptions*/// defined by jsHintOptions.js, created by build
require({
Expand Down
1 change: 0 additions & 1 deletion Apps/Sandcastle/gallery/Cesium Inspector.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
var scene = viewer.scene;
var globe = scene.globe;
globe.depthTestAgainstTerrain = true;
var ellipsoid = globe.ellipsoid;

var cesiumTerrainProviderHeightmaps = new Cesium.CesiumTerrainProvider({
url : '//assets.agi.com/stk-terrain/world',
Expand Down
9 changes: 3 additions & 6 deletions Apps/Sandcastle/gallery/Picking.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
var handler;

Sandcastle.addDefaultToolbarButton('Show Cartographic Position on Mouse Over', function() {
var ellipsoid = scene.globe.ellipsoid;
var entity = viewer.entities.add({
label : {
show : false
Expand All @@ -46,9 +45,9 @@
// Mouse over the globe to see the cartographic position
handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
handler.setInputAction(function(movement) {
var cartesian = viewer.camera.pickEllipsoid(movement.endPosition, ellipsoid);
var cartesian = viewer.camera.pickEllipsoid(movement.endPosition, scene.globe.ellipsoid);
if (cartesian) {
var cartographic = ellipsoid.cartesianToCartographic(cartesian);
var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
var longitudeString = Cesium.Math.toDegrees(cartographic.longitude).toFixed(2);
var latitudeString = Cesium.Math.toDegrees(cartographic.latitude).toFixed(2);

Expand Down Expand Up @@ -145,8 +144,6 @@
});

Sandcastle.addToolbarButton('Pick position', function() {
var ellipsoid = scene.globe.ellipsoid;

var modelEntity = viewer.entities.add({
name : 'milktruck',
position : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706),
Expand Down Expand Up @@ -174,7 +171,7 @@
var cartesian = viewer.scene.pickPosition(movement.endPosition);

if (Cesium.defined(cartesian)) {
var cartographic = ellipsoid.cartesianToCartographic(cartesian);
var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
var longitudeString = Cesium.Math.toDegrees(cartographic.longitude).toFixed(2);
var latitudeString = Cesium.Math.toDegrees(cartographic.latitude).toFixed(2);
var heightString = cartographic.height.toFixed(2);
Expand Down
92 changes: 92 additions & 0 deletions Apps/Sandcastle/gallery/Terrain Exaggeration.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="Exaggerate terrain.">
<meta name="cesium-sandcastle-labels" content="Tutorials, Showcases">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
<script type="text/javascript">
require.config({
baseUrl : '../../../Source',
waitSeconds : 60
});
</script>
</head>
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
<style>
@import url(../templates/bucket.css);
</style>
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar">
<div id="zoomButtons"></div>
</div>
<script id="cesium_sandcastle_script">
function startup(Cesium) {
"use strict";
//Sandcastle_Begin
var viewer = new Cesium.Viewer('cesiumContainer', {
terrainExaggeration : 2.0
});

var cesiumTerrainProviderMeshes = new Cesium.CesiumTerrainProvider({
url : '//assets.agi.com/stk-terrain/world',
requestWaterMask : true,
requestVertexNormals : true
});
viewer.terrainProvider = cesiumTerrainProviderMeshes;


Sandcastle.addDefaultToolbarMenu([{
text : 'Mount Everest',
onselect : function() {
viewer.camera.setView({
destination : new Cesium.Cartesian3(277096.634865404, 5647834.481964232, 2985563.7039122293),
orientation : {
heading : 4.731089976107251,
pitch : -0.32003481981370063
}
});
}
}, {
text : 'Half Dome',
onselect : function() {
viewer.camera.setView({
destination : new Cesium.Cartesian3(-2497565.707296549, -4393815.215148996, 3886033.5140598584),
orientation : {
heading : 1.6690385899673323,
pitch : -0.32086751043096884
}
});
}
}, {
text : 'San Francisco Bay',
onselect : function() {
viewer.camera.setView({
destination : new Cesium.Cartesian3(-2696570.092794883, -4276051.411224011, 3887257.288168422),
orientation : {
heading : 5.193128432412409,
pitch : -0.3996479673257727
}
});
var target = new Cesium.Cartesian3(-2708814.85583248, -4254159.450845907, 3891403.9457429945);
var offset = new Cesium.Cartesian3(70642.66030209465, -31661.517948317807, 35505.179997143336);
viewer.camera.lookAt(target, offset);
viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
}
}], 'zoomButtons');
//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
}
</script>
</body>
</html>
Binary file added Apps/Sandcastle/gallery/Terrain Exaggeration.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Terrain.html
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,4 @@
}
</script>
</body>
</html>
</html>
129 changes: 129 additions & 0 deletions Apps/Sandcastle/gallery/Video.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="Use a video element as a material">
<meta name="cesium-sandcastle-labels" content="Showcases">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
<script type="text/javascript">
require.config({
baseUrl : '../../../Source',
waitSeconds : 60
});
</script>
</head>
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
<style>
@import url(../templates/bucket.css);

#trailer {
position: absolute;
bottom: 75px;
right: 0;
width: 320px;
height: 180px;
}
</style>

<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar"></div>

<video id="trailer" autoplay loop crossorigin controls>
<source src="http://cesiumjs.org/videos/Sandcastle/big-buck-bunny_trailer.webm" type="video/webm">
<source src="http://cesiumjs.org/videos/Sandcastle/big-buck-bunny_trailer.mp4" type="video/mp4">
<source src="http://cesiumjs.org/videos/Sandcastle/big-buck-bunny_trailer.mov" type="video/quicktime">
Your browser does not support the <code>video</code> element.
</video>
<script id="cesium_sandcastle_script">
function startup(Cesium) {
"use strict";
//Sandcastle_Begin
var viewer = new Cesium.Viewer('cesiumContainer', {showRenderLoopErrors : false});

var videoElement = document.getElementById('trailer');

var sphere = viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-79, 39, 1000),
ellipsoid : {
radii : new Cesium.Cartesian3(1000, 1000, 1000),
material : videoElement
}
});

viewer.trackedEntity = sphere;

var synchronizer;
Sandcastle.addToolbarButton('Toggle clock synchronization', function() {
// By default, the video plays normally and simply shows
// whatever frame the video is currently on.
// We can synchronize the video with the scene clock
// using a VideoSynchronizer.

if (Cesium.defined(synchronizer)) {
synchronizer = synchronizer.destroy();
videoElement.playbackRate = 1.0;
return;
}

synchronizer = new Cesium.VideoSynchronizer({
clock : viewer.clock,
element : videoElement
});
});

// Since it's just an image material, we can modify the number
// of times the video repeats in each direction..
var isRepeating = true;
Sandcastle.addToolbarButton('Toggle Image Repeat', function() {
isRepeating = !isRepeating;
});

sphere.ellipsoid.material.repeat = new Cesium.CallbackProperty(function(time, result) {
if (!Cesium.defined(result)) {
result = new Cesium.Cartesian2();
}
if (isRepeating) {
result.x = 8;
result.y = 8;
} else {
result.x = 1;
result.y = 1;
}
return result;
}, false);

// Like Image, the video element doesn't have to be part of the DOM or
// otherwise on the screen to be used as a texture.
Sandcastle.addToolbarButton('Toggle Video Overlay', function() {
if(videoElement.style.display === 'none'){
videoElement.style.display = '';
return;
}
videoElement.style.display = 'none';
});

// Older browsers do not support WebGL video textures,
// put up a friendly error message indicating such.
viewer.scene.renderError.addEventListener(function() {
if(!videoElement.paused){
videoElement.pause();
}
viewer.cesiumWidget.showErrorPanel('This browser does not support cross-origin WebGL video textures.', '', '');
});

//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
}
</script>
</body>
</html>
Binary file added Apps/Sandcastle/gallery/Video.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 183d378

Please sign in to comment.